mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:03:23 +00:00
Wire up a skeleton for configure OSTC 4
Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
0c276403ac
commit
4cbf64bf99
3 changed files with 56 additions and 2 deletions
|
@ -361,6 +361,32 @@ static dc_status_t write_suunto_vyper_settings(dc_device_t *device, DeviceDetail
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static dc_status_t read_ostc4_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
|
||||||
|
{
|
||||||
|
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||||
|
dc_event_progress_t progress;
|
||||||
|
progress.current = 0;
|
||||||
|
progress.maximum = 1;
|
||||||
|
unsigned char hardware[1];
|
||||||
|
|
||||||
|
EMIT_PROGRESS();
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static dc_status_t write_ostc4_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
|
||||||
|
{
|
||||||
|
dc_status_t rc = DC_STATUS_SUCCESS;
|
||||||
|
dc_event_progress_t progress;
|
||||||
|
progress.current = 0;
|
||||||
|
progress.maximum = 1;
|
||||||
|
|
||||||
|
EMIT_PROGRESS();
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if DC_VERSION_CHECK(0, 5, 0)
|
#if DC_VERSION_CHECK(0, 5, 0)
|
||||||
static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
|
static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
|
||||||
{
|
{
|
||||||
|
@ -374,7 +400,6 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
|
||||||
rc = hw_ostc3_device_hardware (device, hardware, sizeof (hardware));
|
rc = hw_ostc3_device_hardware (device, hardware, sizeof (hardware));
|
||||||
if (rc != DC_STATUS_SUCCESS)
|
if (rc != DC_STATUS_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
EMIT_PROGRESS();
|
|
||||||
|
|
||||||
dc_descriptor_t *desc = get_descriptor(DC_FAMILY_HW_OSTC3, hardware[0]);
|
dc_descriptor_t *desc = get_descriptor(DC_FAMILY_HW_OSTC3, hardware[0]);
|
||||||
if (desc) {
|
if (desc) {
|
||||||
|
@ -384,6 +409,11 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
|
||||||
return DC_STATUS_UNSUPPORTED;
|
return DC_STATUS_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_deviceDetails->model == "OSTC 4")
|
||||||
|
return read_ostc4_settings(device, m_deviceDetails, progress_cb, userdata);
|
||||||
|
|
||||||
|
EMIT_PROGRESS();
|
||||||
|
|
||||||
//Read gas mixes
|
//Read gas mixes
|
||||||
gas gas1;
|
gas gas1;
|
||||||
gas gas2;
|
gas gas2;
|
||||||
|
@ -1647,6 +1677,10 @@ void WriteSettingsThread::run()
|
||||||
break;
|
break;
|
||||||
#if DC_VERSION_CHECK(0, 5, 0)
|
#if DC_VERSION_CHECK(0, 5, 0)
|
||||||
case DC_FAMILY_HW_OSTC3:
|
case DC_FAMILY_HW_OSTC3:
|
||||||
|
// FIXME: Is this the best way?
|
||||||
|
if (m_deviceDetails->model == "OSTC 4")
|
||||||
|
rc = write_ostc4_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
|
||||||
|
else
|
||||||
rc = write_ostc3_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
|
rc = write_ostc3_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
|
||||||
if (rc != DC_STATUS_SUCCESS)
|
if (rc != DC_STATUS_SUCCESS)
|
||||||
emit error(tr("Failed!"));
|
emit error(tr("Failed!"));
|
||||||
|
|
|
@ -480,6 +480,9 @@ void ConfigureDiveComputerDialog::populateDeviceDetails()
|
||||||
case 2:
|
case 2:
|
||||||
populateDeviceDetailsOSTC();
|
populateDeviceDetailsOSTC();
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
populateDeviceDetailsOSTC4();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -785,6 +788,10 @@ void ConfigureDiveComputerDialog::populateDeviceDetailsSuuntoVyper()
|
||||||
deviceDetails->alarmTime = ui.alarmTimeSpinBox->value();
|
deviceDetails->alarmTime = ui.alarmTimeSpinBox->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigureDiveComputerDialog::populateDeviceDetailsOSTC4()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigureDiveComputerDialog::readSettings()
|
void ConfigureDiveComputerDialog::readSettings()
|
||||||
{
|
{
|
||||||
ui.progressBar->setValue(0);
|
ui.progressBar->setValue(0);
|
||||||
|
@ -865,6 +872,9 @@ void ConfigureDiveComputerDialog::reloadValues()
|
||||||
case 2:
|
case 2:
|
||||||
reloadValuesOSTC();
|
reloadValuesOSTC();
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
reloadValuesOSTC4();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1149,6 +1159,10 @@ void ConfigureDiveComputerDialog::reloadValuesSuuntoVyper()
|
||||||
ui.alarmTimeSpinBox->setValue(deviceDetails->alarmTime);
|
ui.alarmTimeSpinBox->setValue(deviceDetails->alarmTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigureDiveComputerDialog::reloadValuesOSTC4()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigureDiveComputerDialog::on_backupButton_clicked()
|
void ConfigureDiveComputerDialog::on_backupButton_clicked()
|
||||||
{
|
{
|
||||||
QString filename = existing_filename ?: prefs.default_filename;
|
QString filename = existing_filename ?: prefs.default_filename;
|
||||||
|
@ -1227,6 +1241,10 @@ void ConfigureDiveComputerDialog::on_DiveComputerList_currentRowChanged(int curr
|
||||||
selected_product = "OSTC 2N";
|
selected_product = "OSTC 2N";
|
||||||
fw_upgrade_possible = true;
|
fw_upgrade_possible = true;
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
selected_vendor = "Heinrichs Weikamp";
|
||||||
|
selected_product = "OSTC 4";
|
||||||
|
fw_upgrade_possible = true;
|
||||||
default:
|
default:
|
||||||
/* Not Supported */
|
/* Not Supported */
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -114,9 +114,11 @@ private:
|
||||||
void populateDeviceDetailsOSTC3();
|
void populateDeviceDetailsOSTC3();
|
||||||
void populateDeviceDetailsOSTC();
|
void populateDeviceDetailsOSTC();
|
||||||
void populateDeviceDetailsSuuntoVyper();
|
void populateDeviceDetailsSuuntoVyper();
|
||||||
|
void populateDeviceDetailsOSTC4();
|
||||||
void reloadValuesOSTC3();
|
void reloadValuesOSTC3();
|
||||||
void reloadValuesOSTC();
|
void reloadValuesOSTC();
|
||||||
void reloadValuesSuuntoVyper();
|
void reloadValuesSuuntoVyper();
|
||||||
|
void reloadValuesOSTC4();
|
||||||
|
|
||||||
QString selected_vendor;
|
QString selected_vendor;
|
||||||
QString selected_product;
|
QString selected_product;
|
||||||
|
|
Loading…
Add table
Reference in a new issue