From cc71c102e4f5fde7e4f8fc22b0080269186ee986 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sun, 11 Jan 2015 00:01:15 +0100 Subject: [PATCH 7/7] Refactor dctype -> divemode ... and repair a failed rebase (sorry). Signed-off-by: Robert C. Helling --- dive.c | 14 +-- dive.h | 4 +- file.c | 2 +- libdivecomputer.c | 4 +- load-git.c | 4 +- parse-xml.c | 24 +++--- planner.c | 6 +- profile.c | 11 +-- qt-ui/diveplanner.cpp | 8 +- qt-ui/maintab.cpp | 12 +-- qt-ui/maintab.ui | 177 +++++++++++++++++++++----------------- qt-ui/preferences.ui | 34 ++++---- qt-ui/profile/diveprofileitem.cpp | 6 +- qt-ui/profile/profilewidget2.cpp | 4 +- save-git.c | 4 +- save-xml.c | 6 +- statistics.c | 2 +- subsurfacestartup.c | 2 +- 18 files changed, 172 insertions(+), 152 deletions(-) diff --git a/dive.c b/dive.c index c464e7e..33e3fb2 100644 --- a/dive.c +++ b/dive.c @@ -29,7 +29,7 @@ static const char *default_tags[] = { const char *cylinderuse_text[] = { QT_TRANSLATE_NOOP("gettextFromC", "OC-gas"), QT_TRANSLATE_NOOP("gettextFromC", "diluent"), QT_TRANSLATE_NOOP("gettextFromC", "oxygen") }; -const char *dctype_text[] = { "OC", "CCR", "PSCR", "Freedive" }; +const char *divemode_text[] = { "OC", "CCR", "PSCR", "Freedive" }; int event_is_gaschange(struct event *ev) { @@ -736,7 +736,7 @@ void per_cylinder_mean_depth(struct dive *dive, struct divecomputer *dc, int *me mean[explicit_first_cylinder(dive, dc)] = dc->meandepth.mm; duration[explicit_first_cylinder(dive, dc)] = dc->duration.seconds; - if (dc->dctype == CCR) { + if (dc->divemode == CCR) { // Do the same for the O2 cylinder int o2_cyl = get_cylinder_idx_by_use(dive, OXYGEN); if (o2_cyl < 0) @@ -866,7 +866,7 @@ int explicit_first_cylinder(struct dive *dive, struct divecomputer *dc) struct event *ev = get_next_event(dc->events, "gaschange"); if (ev && dc && dc->sample && ev->time.seconds == dc->sample[0].time.seconds) return get_cylinder_index(dive, ev); - else if (dc->dctype == CCR) + else if (dc->divemode == CCR) return MAX(get_cylinder_idx_by_use(dive, DILUENT), 0); else return 0; @@ -878,7 +878,7 @@ void update_setpoint_events(struct divecomputer *dc) bool changed = false; int new_setpoint = 0; - if (dc->dctype == CCR) + if (dc->divemode == CCR) new_setpoint = prefs.defaultsetpoint; while (ev) { @@ -1271,7 +1271,7 @@ static void fixup_dive_dc(struct dive *dive, struct divecomputer *dc) } fixup_pressure(dive, sample, OC_GAS); - if (dive->dc.dctype == CCR) + if (dive->dc.divemode == CCR) fixup_pressure(dive, sample, OXYGEN); if (temp) { @@ -1665,7 +1665,7 @@ int gasmix_distance(const struct gasmix *a, const struct gasmix *b) * *mix = structure containing cylinder gas mixture information. * This function called by: calculate_gas_information_new() in profile.c; add_segment() in deco.c. */ -extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2, enum dive_comp_type dctype, int sac) +extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2, enum dive_comp_type divemode, int sac) { if (!sac) { /* The SAC has not yet been computer, so use the default * @@ -1686,7 +1686,7 @@ extern void fill_pressures(struct gas_pressures *pressures, const double amb_pre } } } else { - if (dctype == PSCR) { /* The steady state approximation should be good enough */ + if (divemode == PSCR) { /* The steady state approximation should be good enough */ pressures->o2 = get_o2(mix) / 1000.0 * amb_pressure - (1.0 - get_o2(mix) / 1000.0) * prefs.o2consumption / (sac * prefs.pscr_ratio / 1000.0); pressures->he = (amb_pressure - pressures->o2) * get_he(mix) / (1000.0 - get_o2(mix)); pressures->n2 = (amb_pressure - pressures->o2) * (1000 - get_o2(mix) - get_he(mix)) / (1000.0 - get_o2(mix)); diff --git a/dive.h b/dive.h index bcae405..46b3d39 100644 --- a/dive.h +++ b/dive.h @@ -51,7 +51,7 @@ enum dive_comp_type {OC, CCR, PSCR, FREEDIVE, NUM_DC_TYPE}; // Flags (Open-circu enum cylinderuse {OC_GAS, DILUENT, OXYGEN, NUM_GAS_USE}; // The different uses for cylinders extern const char *cylinderuse_text[]; -extern const char *dctype_text[]; +extern const char *divemode_text[]; struct gasmix { fraction_t o2; @@ -267,7 +267,7 @@ struct divecomputer { depth_t maxdepth, meandepth; temperature_t airtemp, watertemp; pressure_t surface_pressure; - enum dive_comp_type dctype; // dive computer type: OC(default) or CCR + enum dive_comp_type divemode; // dive computer type: OC(default) or CCR uint8_t no_o2sensors; // rebreathers: number of O2 sensors used int salinity; // kg per 10000 l const char *model, *serial, *fw_version; diff --git a/file.c b/file.c index 42f4339..60de64d 100644 --- a/file.c +++ b/file.c @@ -540,7 +540,7 @@ int parse_txt_file(const char *filename, const char *csv) value = parse_mkvi_value(memtxt.buffer, "Rig Serial number"); dive->dc.deviceid = atoi(value); free(value); - dive->dc.dctype = CCR; + dive->dc.divemode = CCR; dive->dc.no_o2sensors = 2; dive->cylinder[cur_cylinder_index].cylinder_use = OXYGEN; diff --git a/libdivecomputer.c b/libdivecomputer.c index 70be23f..a78f53c 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -556,10 +556,10 @@ static int dive_cb(const unsigned char *data, unsigned int size, case DC_DIVEMODE_FREEDIVE: case DC_DIVEMODE_GAUGE: case DC_DIVEMODE_OC: /* Open circuit */ - dive->dc.dctype = OC; + dive->dc.divemode = OC; break; case DC_DIVEMODE_CC: /* Closed circuit */ - dive->dc.dctype = CCR; + dive->dc.divemode = CCR; break; } #endif diff --git a/load-git.c b/load-git.c index 02fc98b..1cdb44c 100644 --- a/load-git.c +++ b/load-git.c @@ -133,7 +133,7 @@ static duration_t get_duration(const char *line) static enum dive_comp_type get_dctype(const char *line) { for (enum dive_comp_type i = 0; i < NUM_DC_TYPE; i++) { - if (strcmp(line, dctype_text[i]) == 0) + if (strcmp(line, divemode_text[i]) == 0) return i; } return 0; @@ -528,7 +528,7 @@ static void parse_dc_duration(char *line, struct membuffer *str, void *_dc) { struct divecomputer *dc = _dc; dc->duration = get_duration(line); } static void parse_dc_dctype(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->dctype = get_dctype(line); } +{ struct divecomputer *dc = _dc; dc->divemode = get_dctype(line); } static void parse_dc_maxdepth(char *line, struct membuffer *str, void *_dc) { struct divecomputer *dc = _dc; dc->maxdepth = get_depth(line); } diff --git a/parse-xml.c b/parse-xml.c index bd6e21b..92e470c 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -570,7 +570,7 @@ static void get_dc_type(char *buffer, enum dive_comp_type *dct) { if (trimspace(buffer)) { for (enum dive_comp_type i = 0; i < NUM_DC_TYPE; i++) { - if (strcmp(buffer, dctype_text[i]) == 0) + if (strcmp(buffer, divemode_text[i]) == 0) *dct = i; } } @@ -875,7 +875,7 @@ static void try_to_fill_dc(struct divecomputer *dc, const char *name, char *buf) return; if (MATCH("diveid", hex_value, &dc->diveid)) return; - if (MATCH("dctype", get_dc_type, &dc->dctype)) + if (MATCH("dctype", get_dc_type, &dc->divemode)) return; if (MATCH("no_o2sensors", get_sensor, &dc->no_o2sensors)) return; @@ -934,7 +934,7 @@ static void try_to_fill_sample(struct sample *sample, const char *name, char *bu if (MATCH("sensor3.sample", double_to_o2pressure, &sample->o2sensor[2])) // up to 3 CCR sensors return; if (MATCH("po2.sample", double_to_o2pressure, &sample->setpoint)) { - cur_dive->dc.dctype = CCR; + cur_dive->dc.divemode = CCR; return; } if (MATCH("heartbeat", get_uint8, &sample->heartbeat)) @@ -2256,7 +2256,7 @@ extern int shearwater_profile_sample(void *handle, int columns, char **data, cha cur_sample->temperature.mkelvin = metric ? C_to_mkelvin(atof(data[2])) : F_to_mkelvin(atof(data[2])); if (data[3]) { cur_sample->setpoint.mbar = atof(data[3]) * 1000; - cur_dive->dc.dctype = CCR; + cur_dive->dc.divemode = CCR; } if (data[4]) cur_sample->ndl.seconds = atoi(data[4]) * 60; @@ -2571,19 +2571,19 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size) // ptr[15] is dive type if (0xc8 <= ptr[15] && ptr[15] <= 0xcf) - cur_dc->dctype = OC; + cur_dc->divemode = OC; else if (0xd0 <= ptr[15] && ptr[15] <= 0xd7) - cur_dc->dctype = CCR; + cur_dc->divemode = CCR; else if (0xd8 <= ptr[15] && ptr[15] <= 0xdf) - cur_dc->dctype = CCR; // mCCR + cur_dc->divemode = CCR; // mCCR else if (0xe0 <= ptr[15] && ptr[15] <= 0xe7) - cur_dc->dctype = OC; // Free diving + cur_dc->divemode = OC; // Free diving else if (0xe8 <= ptr[15] && ptr[15] <= 0xef) - cur_dc->dctype = OC; // Gauge + cur_dc->divemode = OC; // Gauge else if (0xf0 <= ptr[15] && ptr[15] <= 0xf7) - cur_dc->dctype = PSCR; // ASCR + cur_dc->divemode = PSCR; // ASCR else if (0xf8 <= ptr[15] && ptr[15] <= 0xff) - cur_dc->dctype = PSCR; + cur_dc->divemode = PSCR; cur_dc->maxdepth.mm = ((ptr[21] << 8) + ptr[20]) * 10; @@ -2604,7 +2604,7 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size) // Crazy precision on these stored values... // Only store value if we're in CCR/PSCR mode, // because we rather calculate ppo2 our selfs. - if (cur_dc->dctype == CCR || cur_dc->dctype == PSCR) + if (cur_dc->divemode == CCR || cur_dc->divemode == PSCR) cur_sample->o2sensor[0].mbar = ((ptr[7] << 8) + ptr[6]) / 10; if (!ptr[8] && ptr[9]) cur_sample->in_deco = true; diff --git a/planner.c b/planner.c index 322bd25..e6bd088 100644 --- a/planner.c +++ b/planner.c @@ -251,7 +251,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas) int oldpo2 = 0; int lasttime = 0; int lastdepth = 0; - enum dive_comp_type type = displayed_dive.dc.dctype; + enum dive_comp_type type = displayed_dive.dc.divemode; if (!diveplan || !diveplan->dp) return; @@ -346,7 +346,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas) finish_sample(dc); dp = dp->next; } - dc->dctype = type; + dc->divemode = type; #if DEBUG_PLAN & 32 save_dive(stdout, &displayed_dive); #endif @@ -699,7 +699,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool snprintf(temp, sizeof(temp), "%s", translate("gettextFromC", "OTU")); len += snprintf(buffer + len, sizeof(buffer) - len, "
%s: %i", temp, dive->otu); - if (dive->dc.dctype == CCR) + if (dive->dc.divemode == CCR) snprintf(temp, sizeof(temp), "%s", translate("gettextFromC", "Gas consumption (CCR legs excluded):")); else snprintf(temp, sizeof(temp), "%s", translate("gettextFromC", "Gas consumption:")); diff --git a/profile.c b/profile.c index a09268b..205663b 100644 --- a/profile.c +++ b/profile.c @@ -435,7 +435,7 @@ static void check_setpoint_events(struct dive *dive, struct divecomputer *dc, st i = set_setpoint(pi, i, setpoint.mbar, ev->time.seconds); setpoint.mbar = ev->value; if (setpoint.mbar) - dc->dctype = CCR; + dc->divemode = CCR; ev = get_next_event(ev->next, "SP change"); } while (ev); set_setpoint(pi, i, setpoint.mbar, ~0u); @@ -607,7 +607,7 @@ struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer * pi->has_ndl |= sample->ndl.seconds; entry->in_deco = sample->in_deco; entry->cns = sample->cns; - if (dc->dctype == CCR) { + if (dc->divemode == CCR) { entry->o2pressure.mbar = entry->o2setpoint.mbar = sample->setpoint.mbar; // for rebreathers entry->o2sensor[0].mbar = sample->o2sensor[0].mbar; // for up to three rebreather O2 sensors entry->o2sensor[1].mbar = sample->o2sensor[1].mbar; @@ -940,7 +940,7 @@ static void calculate_gas_information_new(struct dive *dive, struct plot_info *p amb_pressure = depth_to_mbar(entry->depth, dive) / 1000.0; - fill_pressures(&entry->pressures, amb_pressure, &dive->cylinder[cylinderindex].gasmix, entry->o2pressure.mbar / 1000.0, dive->dc.dctype, entry->sac); + fill_pressures(&entry->pressures, amb_pressure, &dive->cylinder[cylinderindex].gasmix, entry->o2pressure.mbar / 1000.0, dive->dc.divemode, entry->sac); fn2 = (int)(1000.0 * entry->pressures.n2 / amb_pressure); fhe = (int)(1000.0 * entry->pressures.he / amb_pressure); @@ -984,7 +984,8 @@ void fill_o2_values(struct divecomputer *dc, struct plot_info *pi, struct dive * for (i = 0; i < pi->nr; i++) { struct plot_data *entry = pi->entry + i; - if (dc->dctype == CCR) { + + if (dc->divemode == CCR) { if (i == 0) { // For 1st iteration, initialise the last_sensor values for (j = 0; j < dc->no_o2sensors; j++) last_sensor[j].mbar = pi->entry->o2sensor[j].mbar; @@ -1058,7 +1059,7 @@ void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plo setup_gas_sensor_pressure(dive, dc, pi); /* Try to populate our gas pressure knowledge */ if (!fast) { populate_pressure_information(dive, dc, pi, false); /* .. calculate missing pressure entries for all gasses except o2 */ - if (dc->dctype == CCR) /* For CCR dives.. */ + if (dc->divemode == CCR) /* For CCR dives.. */ populate_pressure_information(dive, dc, pi, true); /* .. calculate missing o2 gas pressure entries */ } fill_o2_values(dc, pi, dive); /* .. and insert the O2 sensor data having 0 values. */ diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index d9aa381..1e10734 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -785,13 +785,13 @@ void DivePlannerPointsModel::setGFLow(const int ghflow) void DivePlannerPointsModel::setRebreatherMode(QString mode) { - qDebug() << mode << "selected, was" << displayed_dive.dc.dctype; + qDebug() << mode << "selected, was" << displayed_dive.dc.divemode; if (mode == "OC") - displayed_dive.dc.dctype = OC; + displayed_dive.dc.divemode = OC; else if (mode == "pSCR") - displayed_dive.dc.dctype = PSCR; + displayed_dive.dc.divemode = PSCR; else if (mode == "CCR") - displayed_dive.dc.dctype = CCR; + displayed_dive.dc.divemode = CCR; plannerModel->emitDataChanged(); } diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 3e49086..d930cbf 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -430,7 +430,7 @@ void MainTab::updateDiveInfo(bool clear) UPDATE_TEXT(displayed_dive, buddy); UPDATE_TEMP(displayed_dive, airtemp); UPDATE_TEMP(displayed_dive, watertemp); - ui.DiveType->setCurrentIndex(displayed_dive.dc.dctype); + ui.DiveType->setCurrentIndex(displayed_dive.dc.divemode); if (!clear) { updateGpsCoordinates(&displayed_dive); @@ -514,7 +514,7 @@ void MainTab::updateDiveInfo(bool clear) ui.otuText->setText(QString("%1").arg(displayed_dive.otu)); ui.waterTemperatureText->setText(get_temperature_string(displayed_dive.watertemp, true)); ui.airTemperatureText->setText(get_temperature_string(displayed_dive.airtemp, true)); - ui.DiveType->setCurrentIndex(current_dc->dctype); + ui.DiveType->setCurrentIndex(current_dc->divemode); volume_t gases[MAX_CYLINDERS] = {}; get_gas_used(&displayed_dive, gases); QString volumes; @@ -650,7 +650,7 @@ void MainTab::updateDiveInfo(bool clear) } editMode = NONE; ui.cylinders->view()->hideColumn(CylindersModel::DEPTH); - if (get_dive_dc(&displayed_dive, dc_number)->dctype == CCR) + if (get_dive_dc(&displayed_dive, dc_number)->divemode == CCR) ui.cylinders->view()->showColumn(CylindersModel::USE); else ui.cylinders->view()->hideColumn(CylindersModel::USE); @@ -772,8 +772,8 @@ void MainTab::acceptChanges() MODIFY_SELECTED_DIVES(EDIT_VALUE(visibility)); if (displayed_dive.airtemp.mkelvin != cd->airtemp.mkelvin) MODIFY_SELECTED_DIVES(EDIT_VALUE(airtemp.mkelvin)); - if (displayed_dive.dc.dctype != cd->dc.dctype) { - MODIFY_SELECTED_DIVES(EDIT_VALUE(dc.dctype)); + if (displayed_dive.dc.divemode != cd->dc.divemode) { + MODIFY_SELECTED_DIVES(EDIT_VALUE(dc.divemode)); MODIFY_SELECTED_DIVES(update_setpoint_events(&mydive->dc)); do_replot = true; } @@ -1019,7 +1019,7 @@ void MainTab::divetype_Changed(int index) { if (editMode == IGNORE) return; - displayed_dive.dc.dctype = (enum dive_comp_type) index; + displayed_dive.dc.divemode = (enum dive_comp_type) index; update_setpoint_events(&displayed_dive.dc); markChangedWidget(ui.DiveType); } diff --git a/qt-ui/maintab.ui b/qt-ui/maintab.ui index 226442f..937dec4 100644 --- a/qt-ui/maintab.ui +++ b/qt-ui/maintab.ui @@ -22,7 +22,9 @@ 0 - + + scrollArea + @@ -40,14 +42,41 @@ 0 0 - 435 - 770 + 397 + 744 0 + + + + QLayout::SetNoConstraint + + + + + + 0 + 0 + + + + Coordinates + + + + + + + Dive mode + + + + + @@ -83,16 +112,6 @@ - - - - true - - - Qt::UTC - - - @@ -106,6 +125,16 @@ + + + + true + + + Qt::UTC + + + @@ -134,136 +163,129 @@ - - - - Coordinates - - - - + Divemaster - + Buddy - + false - + false - + 0 - + 0 0 - - Qt::StrongFocus + + Rating - + 0 0 - - Qt::StrongFocus + + Visibility - + Suit - + false - - - - Tags - - - - - - - Notes - - - - + 0 - + 0 0 - - Rating + + Qt::StrongFocus - + 0 0 - - Visibility + + Qt::StrongFocus - + + + + Tags + + + + + + + Notes + + + + @@ -295,24 +317,7 @@ - - - - false - - - - - - - 0 - 0 - - - - - - + 0 @@ -368,6 +373,20 @@ + + + + + + false + + + + + + + + @@ -398,8 +417,8 @@ 0 0 - 423 - 752 + 397 + 734 @@ -454,8 +473,8 @@ 0 0 - 423 - 752 + 397 + 734 @@ -771,8 +790,8 @@ 0 0 - 423 - 752 + 397 + 734 diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui index 65075b0..2572990 100644 --- a/qt-ui/preferences.ui +++ b/qt-ui/preferences.ui @@ -6,8 +6,8 @@ 0 0 - 924 - 742 + 940 + 756 @@ -748,14 +748,14 @@ Misc - + GFLow - + 1 @@ -765,14 +765,14 @@ - + GFHigh - + 1 @@ -782,28 +782,21 @@ - + GFLow at max depth - - - - CCR: Show setpoints when viewing pO₂ - - - - + Default CCR set-point - + bar @@ -819,6 +812,13 @@ + + + + CCR: Show setpoints when viewing pO₂ + + + @@ -1413,11 +1413,11 @@ + - diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index c049d91..60a030b 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -624,14 +624,14 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo int o2mbar; QPolygonF boundingPoly, o2Poly; // This is the "Whole Item", but a pressure can be divided in N Polygons. polygons.clear(); - if (displayed_dive.dc.dctype == CCR) + if (displayed_dive.dc.divemode == CCR) polygons.append(o2Poly); for (int i = 0, count = dataModel->rowCount(); i < count; i++) { o2mbar = 0; plot_data *entry = dataModel->data().entry + i; int mbar = GET_PRESSURE(entry); - if (displayed_dive.dc.dctype == CCR) + if (displayed_dive.dc.divemode == CCR) o2mbar = GET_O2CYLINDER_PRESSURE(entry); if (entry->cylinderindex != last_index) { @@ -665,7 +665,7 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo for (int i = 0, count = dataModel->rowCount(); i < count; i++) { entry = dataModel->data().entry + i; mbar = GET_PRESSURE(entry); - if (displayed_dive.dc.dctype == CCR && displayed_dive.oxygen_cylinder_index >= 0) + if (displayed_dive.dc.divemode == CCR && displayed_dive.oxygen_cylinder_index >= 0) o2mbar = GET_O2CYLINDER_PRESSURE(entry); if (o2mbar) { diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 7ccc7cf..f24e17d 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -531,7 +531,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) currentdc = fake_dc(currentdc); } - o2SetpointGasItem->setVisible(current_dive && (currentdc->dctype == CCR) && prefs.show_ccr_setpoint && prefs.pp_graphs.po2); + o2SetpointGasItem->setVisible(current_dive && (currentdc->divemode == CCR) && prefs.show_ccr_setpoint && prefs.pp_graphs.po2); /* This struct holds all the data that's about to be plotted. * I'm not sure this is the best approach ( but since we are @@ -988,7 +988,7 @@ void ProfileWidget2::setProfileState() } pn2GasItem->setVisible(prefs.pp_graphs.pn2); po2GasItem->setVisible(prefs.pp_graphs.po2); - o2SetpointGasItem->setVisible(current_dive && prefs.pp_graphs.po2 && (current_dc->dctype == CCR) && (prefs.show_ccr_setpoint)); + o2SetpointGasItem->setVisible(current_dive && prefs.pp_graphs.po2 && (current_dc->divemode == CCR) && (prefs.show_ccr_setpoint)); pheGasItem->setVisible(prefs.pp_graphs.phe); timeAxis->setPos(itemPos.time.pos.on); diff --git a/save-git.c b/save-git.c index f9f5943..a8f745c 100644 --- a/save-git.c +++ b/save-git.c @@ -355,8 +355,8 @@ static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer show_date(b, dc->when); if (dc->duration.seconds && dc->duration.seconds != dive->dc.duration.seconds) put_duration(b, dc->duration, "duration ", "min\n"); - if (dc->dctype != OC) { - put_format(b, "dctype %s\n", dctype_text[dc->dctype]); + if (dc->divemode != OC) { + put_format(b, "dctype %s\n", divemode_text[dc->divemode]); put_format(b, "numberofoxygensensors %d\n",dc->no_o2sensors); } diff --git a/save-xml.c b/save-xml.c index 29e09dc..053b8fc 100644 --- a/save-xml.c +++ b/save-xml.c @@ -369,10 +369,10 @@ static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer show_date(b, dc->when); if (dc->duration.seconds && dc->duration.seconds != dive->dc.duration.seconds) put_duration(b, dc->duration, " duration='", " min'"); - if (dc->dctype != OC) { + if (dc->divemode != OC) { for (enum dive_comp_type i = 0; i < NUM_DC_TYPE; i++) - if (dc->dctype == i) - show_utf8(b, dctype_text[i], " dctype='", "'", 1); + if (dc->divemode == i) + show_utf8(b, divemode_text[i], " dctype='", "'", 1); if (dc->no_o2sensors) put_format(b," no_o2sensors='%d'", dc->no_o2sensors); } diff --git a/statistics.c b/statistics.c index 96d6a65..bca9e65 100644 --- a/statistics.c +++ b/statistics.c @@ -308,7 +308,7 @@ bool is_cylinder_used(struct dive *dive, int idx) return true; event = get_next_event(event->next, "gaschange"); } - if (dc->dctype == CCR && (idx == dive->diluent_cylinder_index || idx == dive->oxygen_cylinder_index)) + if (dc->divemode == CCR && (idx == dive->diluent_cylinder_index || idx == dive->oxygen_cylinder_index)) return true; } if (idx == 0 && !firstGasExplicit) diff --git a/subsurfacestartup.c b/subsurfacestartup.c index c673813..4b8428e 100644 --- a/subsurfacestartup.c +++ b/subsurfacestartup.c @@ -54,7 +54,7 @@ struct preferences default_prefs = { .user_id = NULL, .album_id = NULL, .access_token = NULL - } + }, .defaultsetpoint = 1100 }; -- 1.9.3 (Apple Git-50)