diff options
author | Joseph W. Joshua <joejoshw@gmail.com> | 2014-06-21 09:14:55 +0300 |
---|---|---|
committer | Thiago Macieira <thiago@macieira.org> | 2014-08-13 10:48:14 -0700 |
commit | a52beebbe9ba8d335d6d867a868166996dc6711e (patch) | |
tree | 14fa8d2b1e18d9cb57fedb4cf55550f8c056d703 /configuredivecomputerthreads.cpp | |
parent | 8b39d2fc172b72ade19a754f33575f663573f147 (diff) | |
download | subsurface-a52beebbe9ba8d335d6d867a868166996dc6711e.tar.gz |
Implement saving of OSTC3 Gas Settings
Implements writing OSTC3 gas settings to the device.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Diffstat (limited to 'configuredivecomputerthreads.cpp')
-rw-r--r-- | configuredivecomputerthreads.cpp | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp index 7ee015f3e..ae57893dc 100644 --- a/configuredivecomputerthreads.cpp +++ b/configuredivecomputerthreads.cpp @@ -185,8 +185,44 @@ void WriteSettingsThread::run() switch (dc_device_get_type(m_data->device)) { case DC_FAMILY_HW_OSTC3: supported = true; - //write general settings + //write gas values + unsigned char gas1Data[4] = {m_deviceDetails->gas1().oxygen, + m_deviceDetails->gas1().helium, + m_deviceDetails->gas1().type, + m_deviceDetails->gas1().depth}; + + unsigned char gas2Data[4] = {m_deviceDetails->gas2().oxygen, + m_deviceDetails->gas2().helium, + m_deviceDetails->gas2().type, + m_deviceDetails->gas2().depth}; + + unsigned char gas3Data[4] = {m_deviceDetails->gas3().oxygen, + m_deviceDetails->gas3().helium, + m_deviceDetails->gas3().type, + m_deviceDetails->gas3().depth}; + + unsigned char gas4Data[4] = {m_deviceDetails->gas4().oxygen, + m_deviceDetails->gas4().helium, + m_deviceDetails->gas4().type, + m_deviceDetails->gas4().depth}; + + unsigned char gas5Data[4] = {m_deviceDetails->gas5().oxygen, + m_deviceDetails->gas5().helium, + m_deviceDetails->gas5().type, + m_deviceDetails->gas5().depth}; + //gas 1 + hw_ostc3_device_config_write(m_data->device, 0x10, gas1Data, sizeof(gas1Data)); + //gas 2 + hw_ostc3_device_config_write(m_data->device, 0x11, gas2Data, sizeof(gas2Data)); + //gas 3 + hw_ostc3_device_config_write(m_data->device, 0x12, gas3Data, sizeof(gas3Data)); + //gas 4 + hw_ostc3_device_config_write(m_data->device, 0x13, gas4Data, sizeof(gas4Data)); + //gas 5 + hw_ostc3_device_config_write(m_data->device, 0x14, gas5Data, sizeof(gas5Data)); + + //write general settings //custom text hw_ostc3_device_customtext(m_data->device, m_deviceDetails->customText().toUtf8().data()); unsigned char data[1] = {0}; |