mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add optional support for po2 import from csv files
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
907a22f37e
commit
8dde12fa35
6 changed files with 55 additions and 7 deletions
|
@ -6,8 +6,8 @@
|
|||
|
||||
const CSVImportDialog::CSVAppConfig CSVImportDialog::CSVApps[CSVAPPS] = {
|
||||
{"", },
|
||||
{"APD Log Viewer", 0, 1, 15, "Tab"},
|
||||
{"XP5", 0, 1, 9, "Tab"},
|
||||
{"APD Log Viewer", 0, 1, 15, 6, "Tab"},
|
||||
{"XP5", 0, 1, 9, -1, "Tab"},
|
||||
{NULL,}
|
||||
};
|
||||
|
||||
|
@ -29,6 +29,8 @@ CSVImportDialog::CSVImportDialog(QWidget *parent) :
|
|||
connect(ui->CSVTime, SIGNAL(valueChanged(int)), this, SLOT(unknownImports(int)));
|
||||
connect(ui->CSVTemperature, SIGNAL(valueChanged(int)), this, SLOT(unknownImports(int)));
|
||||
connect(ui->temperatureCheckBox, SIGNAL(clicked(bool)), this, SLOT(unknownImports(bool)));
|
||||
connect(ui->CSVpo2, SIGNAL(valueChanged(int)), this, SLOT(unknownImports(int)));
|
||||
connect(ui->po2CheckBox, SIGNAL(clicked(bool)), this, SLOT(unknownImports(bool)));
|
||||
}
|
||||
|
||||
CSVImportDialog::~CSVImportDialog()
|
||||
|
@ -41,7 +43,10 @@ void CSVImportDialog::on_buttonBox_accepted()
|
|||
{
|
||||
char *error = NULL;
|
||||
|
||||
parse_csv_file(ui->CSVFile->text().toUtf8().data(), ui->CSVTime->value(), ui->CSVDepth->value(), VALUE_IF_CHECKED(CSVTemperature), &error);
|
||||
parse_csv_file(ui->CSVFile->text().toUtf8().data(), ui->CSVTime->value(),
|
||||
ui->CSVDepth->value(), VALUE_IF_CHECKED(CSVTemperature),
|
||||
VALUE_IF_CHECKED(CSVpo2),
|
||||
&error);
|
||||
if (error != NULL) {
|
||||
|
||||
mainWindow()->showError(error);
|
||||
|
@ -82,6 +87,7 @@ void CSVImportDialog::on_knownImports_currentIndexChanged(int index)
|
|||
ui->CSVTime->blockSignals(false);
|
||||
ui->CSVDepth->blockSignals(false);
|
||||
SET_VALUE_AND_CHECKBOX(CSVTemperature, temperatureCheckBox, CSVApps[index].temperature);
|
||||
SET_VALUE_AND_CHECKBOX(CSVpo2, po2CheckBox, CSVApps[index].po2);
|
||||
}
|
||||
|
||||
void CSVImportDialog::unknownImports(bool arg1)
|
||||
|
|
|
@ -37,6 +37,7 @@ private:
|
|||
int time;
|
||||
int depth;
|
||||
int temperature;
|
||||
int po2;
|
||||
QString separator;
|
||||
};
|
||||
|
||||
|
|
|
@ -149,6 +149,23 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="CSVpo2">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="po2CheckBox">
|
||||
<property name="text">
|
||||
<string>Po2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>label</zorder>
|
||||
<zorder>label_2</zorder>
|
||||
|
@ -156,6 +173,8 @@
|
|||
<zorder>CSVDepth</zorder>
|
||||
<zorder>temperatureCheckBox</zorder>
|
||||
<zorder>CSVTemperature</zorder>
|
||||
<zorder>po2CheckBox</zorder>
|
||||
<zorder>CSVpo2</zorder>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="geometry">
|
||||
|
@ -224,5 +243,11 @@
|
|||
<receiver>CSVTemperature</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>po2CheckBox</sender>
|
||||
<signal>clicked(bool)</signal>
|
||||
<receiver>CSVpo2</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue