diff options
-rw-r--r-- | core/file.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/core/file.c b/core/file.c index b2ff56f49..dddc77826 100644 --- a/core/file.c +++ b/core/file.c @@ -275,8 +275,6 @@ enum csv_format { POSEIDON_SETPOINT, POSEIDON_SENSOR1, POSEIDON_SENSOR2, - POSEIDON_PRESSURE, - POSEIDON_O2CYLINDER, POSEIDON_NDL, POSEIDON_CEILING }; @@ -308,12 +306,6 @@ static void add_sample_data(struct sample *sample, enum csv_format type, double case POSEIDON_SENSOR2: sample->o2sensor[1].mbar = lrint(val * 10); break; - case POSEIDON_PRESSURE: - sample->pressure[0].mbar = lrint(val * 1000); - break; - case POSEIDON_O2CYLINDER: - sample->pressure[1].mbar = lrint(val * 1000); - break; case POSEIDON_NDL: sample->ndl.seconds = lrint(val * 60); break; @@ -609,7 +601,7 @@ int parse_txt_file(const char *filename, const char *csv) int prev_depth = 0, cur_sampletime = 0, prev_setpoint = -1, prev_ndl = -1; bool has_depth = false, has_setpoint = false, has_ndl = false; char *lineptr, *key, *value; - int o2cylinder_pressure = 0, cylinder_pressure = 0, cur_cylinder_index = 0; + int cur_cylinder_index = 0; unsigned int prev_time = 0; struct dive *dive; @@ -780,21 +772,11 @@ int parse_txt_file(const char *filename, const char *csv) break; case 13: //O2 Tank Pressure - add_sample_data(sample, POSEIDON_O2CYLINDER, value); - if (!o2cylinder_pressure) { - dive->cylinder[0].sample_start.mbar = value * 1000; - o2cylinder_pressure = value; - } else - o2cylinder_pressure = value; + add_sample_pressure(sample, 0, lrint(value * 1000)); break; case 14: //Diluent Tank Pressure - add_sample_data(sample, POSEIDON_PRESSURE, value); - if (!cylinder_pressure) { - dive->cylinder[1].sample_start.mbar = value * 1000; - cylinder_pressure = value; - } else - cylinder_pressure = value; + add_sample_pressure(sample, 1, lrint(value * 1000)); break; //16 Remaining dive time #1? //17 related to O2 injection @@ -874,10 +856,6 @@ int parse_txt_file(const char *filename, const char *csv) add_sample_data(sample, POSEIDON_SETPOINT, prev_setpoint); if (!has_ndl && prev_ndl >= 0) add_sample_data(sample, POSEIDON_NDL, prev_ndl); - if (cylinder_pressure) - dive->cylinder[1].sample_end.mbar = cylinder_pressure * 1000; - if (o2cylinder_pressure) - dive->cylinder[0].sample_end.mbar = o2cylinder_pressure * 1000; finish_sample(dc); if (!lineptr || !*lineptr) |