summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2020-09-08 20:27:44 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-15 08:47:51 -0700
commit06e6bcecb717bf912c81b9039e9d1524cfc9ae5a (patch)
tree5f7244863264b1f809aeae2b87b3ca5e1431b4c4 /core
parentdbf7fa89a27d9a6a721eceb056209d9ec7b22dec (diff)
downloadsubsurface-06e6bcecb717bf912c81b9039e9d1524cfc9ae5a.tar.gz
Shearwater cloud import: ignore bogus rows
A sample log I received contains a lot of rows with 0 values in it. This will ignore the obviously bogus ones. (However, we might miss the first sample if that is recorded at time 0.) Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/import-shearwater.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/import-shearwater.c b/core/import-shearwater.c
index 3cedb3f22..9b5d8038c 100644
--- a/core/import-shearwater.c
+++ b/core/import-shearwater.c
@@ -323,9 +323,9 @@ static int shearwater_cloud_dive(void *param, int columns, char **data, char **c
struct parser_state *state = (struct parser_state *)param;
sqlite3 *handle = state->sql_handle;
char get_profile_template[] = "select currentTime,currentDepth,waterTemp,averagePPO2,currentNdl,CNSPercent,decoCeiling,firstStopDepth,firstStopTime from dive_log_records where diveLogId=%ld";
- char get_profile_template_ai[] = "select currentTime,currentDepth,waterTemp,averagePPO2,currentNdl,CNSPercent,decoCeiling,aiSensor0_PressurePSI,aiSensor1_PressurePSI,firstStopDepth,firstStopTime from dive_log_records where diveLogId = %ld";
+ char get_profile_template_ai[] = "select currentTime,currentDepth,waterTemp,averagePPO2,currentNdl,CNSPercent,decoCeiling,aiSensor0_PressurePSI,aiSensor1_PressurePSI,firstStopDepth,firstStopTime from dive_log_records where diveLogId = %ld and currentTime > 0";
char get_cylinder_template[] = "select fractionO2 / 100,fractionHe / 100 from dive_log_records where diveLogId = %ld group by fractionO2,fractionHe";
- char get_changes_template[] = "select a.currentTime,a.fractionO2 / 100,a.fractionHe /100 from dive_log_records as a,dive_log_records as b where (a.id - 1) = b.id and (a.fractionO2 != b.fractionO2 or a.fractionHe != b.fractionHe) and a.diveLogId=b.divelogId and a.diveLogId = %ld";
+ char get_changes_template[] = "select a.currentTime,a.fractionO2 / 100,a.fractionHe /100 from dive_log_records as a,dive_log_records as b where (a.id - 1) = b.id and (a.fractionO2 != b.fractionO2 or a.fractionHe != b.fractionHe) and a.diveLogId=b.divelogId and a.diveLogId = %ld and a.currentTime > 0";
char get_mode_template[] = "select distinct currentCircuitSetting from dive_log_records where diveLogId = %ld";
char get_buffer[1024];