From f4c4acacf97997d543daedd82070783779319854 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Fri, 28 Jun 2024 15:45:13 +1200 Subject: [PATCH] Fix bug with Compass DAT diving data If a survey uses the depth gauge then we set its style to "diving", but we weren't clearing that so all surveys after than in the same DAT file were also set as "diving". --- src/datain.c | 3 ++- tests/depthguage.dat | 11 +++++++++++ tests/depthguage.dump | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/datain.c b/src/datain.c index 111f603c..6fcfa9b5 100644 --- a/src/datain.c +++ b/src/datain.c @@ -642,7 +642,7 @@ data_file_compass_dat_or_clp(bool is_clp) default_calib(pcs); pcs->z[Q_DECLINATION] = HUGE_REAL; - pcs->recorded_style = pcs->style = STYLE_NORMAL; + pcs->style = STYLE_NORMAL; pcs->units[Q_LENGTH] = METRES_PER_FOOT; pcs->infer = BIT(INFER_EQUATES) | BIT(INFER_EQUATES_SELF_OK) | @@ -683,6 +683,7 @@ data_file_compass_dat_or_clp(bool is_clp) pcs->meta->days1 = pcs->meta->days2 = -1; pcs->declination = HUGE_REAL; pcs->ordering = compass_order; + pcs->recorded_style = STYLE_NORMAL; /* */ skipline(); diff --git a/tests/depthguage.dat b/tests/depthguage.dat index bad14cec..dfe7e8cc 100644 --- a/tests/depthguage.dat +++ b/tests/depthguage.dat @@ -42,3 +42,14 @@ DECLINATION: 0 FORMAT: DDDWLRUDLADadNF CORRECTIONS: 0.00 0.00 0.00 CORRECTIONS2: C4 C5 40 270 -10 1 1 1 1 +Cave +SURVEY NAME: D +SURVEY DATE: 1 1 1 COMMENT:Non-diving after diving +SURVEY TEAM: +Us, Them +DECLINATION: 0 + + FROM TO LENGTH BEARING INC LEFT UP DOWN RIGHT FLAGS COMMENTS + + C5 C6 50 000 0 1 1 1 1 + diff --git a/tests/depthguage.dump b/tests/depthguage.dump index 5529f9c0..bcf09abe 100644 --- a/tests/depthguage.dump +++ b/tests/depthguage.dump @@ -8,6 +8,8 @@ LEG 0.00 0.00 0.00 0.00 3.00 -0.53 [] STYLE=DIVING 1901.02.01 LEG 0.00 3.00 -0.53 6.00 3.00 -1.59 [] STYLE=DIVING 1901.01.02 LEG 6.00 3.00 -1.59 6.00 -6.00 -3.18 [] STYLE=DIVING LEG 6.00 -6.00 -3.18 -6.00 -6.00 -5.29 [] STYLE=DIVING 1902.01.01 +LEG -6.00 -6.00 -5.29 -6.00 9.24 -5.29 [] STYLE=NORMAL +NODE -6.00 9.24 -5.29 [C6] UNDERGROUND NODE -6.00 -6.00 -5.29 [C5] UNDERGROUND NODE 6.00 -6.00 -3.18 [C4] UNDERGROUND NODE 6.00 3.00 -1.59 [C3] UNDERGROUND -- 2.11.4.GIT