mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Basic GUI part for DL7 import
This sets the basic properties properly but is still missing the parsing of meta-data, especially used units. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8a4f2f998a
commit
74f0192711
2 changed files with 18 additions and 2 deletions
|
@ -17,6 +17,7 @@ const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] =
|
|||
{ "Manual import", SILENCE_WARNING },
|
||||
{ "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" },
|
||||
{ "DAN DL7", 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "|" },
|
||||
{ "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, "," },
|
||||
{ "Seabear CSV", 0, 1, 5, -1, -1, -1, -1, -1, 2, 3, 4, 6, -1, ";" },
|
||||
|
@ -28,6 +29,7 @@ enum Known {
|
|||
MANUAL,
|
||||
APD,
|
||||
APD2,
|
||||
DL7,
|
||||
XP5,
|
||||
SENSUS,
|
||||
SEABEAR,
|
||||
|
@ -386,6 +388,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
|
|||
bool seabear = false;
|
||||
bool xp5 = false;
|
||||
bool apd = false;
|
||||
bool dl7 = false;
|
||||
|
||||
// reset everything
|
||||
ColumnNameProvider *provider = new ColumnNameProvider(this);
|
||||
|
@ -467,6 +470,12 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
|
|||
blockSignals(true);
|
||||
ui->knownImports->setCurrentText("XP5");
|
||||
blockSignals(false);
|
||||
} else if (firstLine.contains("FSH")) {
|
||||
dl7 = true;
|
||||
firstLine = "|Sample time|Sample depth||||||||";
|
||||
blockSignals(true);
|
||||
ui->knownImports->setCurrentText("DAN DL7");
|
||||
blockSignals(false);
|
||||
}
|
||||
|
||||
// Special handling for APD Log Viewer
|
||||
|
@ -551,7 +560,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
|
|||
}
|
||||
if (matchedSome) {
|
||||
ui->dragInstructions->setText(tr("Some column headers were pre-populated; please drag and drop the headers so they match the column they are in."));
|
||||
if (triggeredBy != KNOWNTYPES && !seabear && !xp5 && !apd) {
|
||||
if (triggeredBy != KNOWNTYPES && !seabear && !xp5 && !apd && !dl7) {
|
||||
blockSignals(true);
|
||||
ui->knownImports->setCurrentIndex(0); // <- that's "Manual import"
|
||||
blockSignals(false);
|
||||
|
@ -665,6 +674,13 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
|
|||
* actual data.
|
||||
*/
|
||||
while (strlen(f.readLine()) > 3 && !f.atEnd());
|
||||
} else if (dl7) {
|
||||
while ((firstLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) {
|
||||
if (firstLine.contains("ZDP")) {
|
||||
firstLine = f.readLine().trimmed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (rows < 10 && !f.atEnd()) {
|
||||
|
|
|
@ -116,7 +116,7 @@ private:
|
|||
QString separator;
|
||||
};
|
||||
|
||||
#define CSVAPPS 8
|
||||
#define CSVAPPS 9
|
||||
static const CSVAppConfig CSVApps[CSVAPPS];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue