Add a known type for second DC on APD import

This patch adds importing of sensor values from the second DC on APD log
import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2015-07-22 18:06:30 +03:00 committed by Dirk Hohndel
parent ac4871c699
commit c9a98a4f7b
2 changed files with 6 additions and 4 deletions

View file

@ -13,7 +13,8 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] =
// time, depth, temperature, po2, sensor1, sensor2, sensor3, cns, ndl, tts, stopdepth, pressure, setpoint // time, depth, temperature, po2, sensor1, sensor2, sensor3, cns, ndl, tts, stopdepth, pressure, setpoint
// indices are 0 based, -1 means the column doesn't exist // indices are 0 based, -1 means the column doesn't exist
{ "Manual import", }, { "Manual import", },
{ "APD Log Viewer", 0, 1, 15, 6, 3, 4, 5, 17, -1, -1, 18, -1, 2, "Tab" }, { "APD Log Viewer - DC1", 0, 1, 15, 6, 3, 4, 5, 17, -1, -1, 18, -1, 2, "Tab" },
{ "APD Log Viewer - DC2", 0, 1, 15, 6, 7, 8, 9, 17, -1, -1, 18, -1, 2, "Tab" },
{ "XP5", 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Tab" }, { "XP5", 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "Tab" },
{ "SensusCSV", 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "," }, { "SensusCSV", 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "," },
{ "Seabear CSV", 0, 1, 5, -1, -1, -1, -1, -1, 2, 3, 4, 6, -1, ";" }, { "Seabear CSV", 0, 1, 5, -1, -1, -1, -1, -1, 2, 3, 4, 6, -1, ";" },
@ -24,6 +25,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] =
static enum { static enum {
MANUAL, MANUAL,
APD, APD,
APD2,
XP5, XP5,
SENSUS, SENSUS,
SEABEAR, SEABEAR,
@ -446,13 +448,13 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
} }
// Special handling for APD Log Viewer // Special handling for APD Log Viewer
if ((triggeredBy == KNOWNTYPES && value == APD) || (triggeredBy == INITIAL && fileNames.first().endsWith(".apd", Qt::CaseInsensitive))) { if ((triggeredBy == KNOWNTYPES && (value == APD || value == APD2)) || (triggeredBy == INITIAL && fileNames.first().endsWith(".apd", Qt::CaseInsensitive))) {
apd=true; apd=true;
firstLine = "Sample time\tSample depth\tSample setpoint\tSample sensor1 pO₂\tSample sensor2 pO₂\tSample sensor3 pO₂\tSample pO₂\t\t\t\t\t\t\t\t\tSample temperature\t\tSample CNS\tSample stopdepth"; firstLine = "Sample time\tSample depth\tSample setpoint\tSample sensor1 pO₂\tSample sensor2 pO₂\tSample sensor3 pO₂\tSample pO₂\t\t\t\t\t\t\t\t\tSample temperature\t\tSample CNS\tSample stopdepth";
blockSignals(true); blockSignals(true);
ui->CSVSeparator->setCurrentText(tr("Tab")); ui->CSVSeparator->setCurrentText(tr("Tab"));
if (triggeredBy == INITIAL && fileNames.first().contains(".apd", Qt::CaseInsensitive)) if (triggeredBy == INITIAL && fileNames.first().contains(".apd", Qt::CaseInsensitive))
ui->knownImports->setCurrentText("APD Log Viewer"); ui->knownImports->setCurrentText("APD Log Viewer - DC1");
blockSignals(false); blockSignals(false);
} }

View file

@ -114,7 +114,7 @@ private:
QString separator; QString separator;
}; };
#define CSVAPPS 7 #define CSVAPPS 8
static const CSVAppConfig CSVApps[CSVAPPS]; static const CSVAppConfig CSVApps[CSVAPPS];
}; };