diff options
author | Anton Lundin <glance@acc.umu.se> | 2016-01-22 14:17:50 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-22 06:50:22 -0800 |
commit | 451293f1a08b34c056d0db16b9050c1b7e4df295 (patch) | |
tree | a4bb2c1230d8e407162e6c35c6abe6f402bbf703 /subsurface-core | |
parent | 91a72f45d4e4f46061b1df514617472e1ff57ecb (diff) | |
download | subsurface-451293f1a08b34c056d0db16b9050c1b7e4df295.tar.gz |
configure OSTC/OSTC3: Add safety stop parameters
This adds the configure parameters for safety stops on the hwOS(OSTC3)
and OSTC computers.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core')
-rw-r--r-- | subsurface-core/configuredivecomputerthreads.cpp | 35 | ||||
-rw-r--r-- | subsurface-core/devicedetails.cpp | 6 | ||||
-rw-r--r-- | subsurface-core/devicedetails.h | 4 |
3 files changed, 43 insertions, 2 deletions
diff --git a/subsurface-core/configuredivecomputerthreads.cpp b/subsurface-core/configuredivecomputerthreads.cpp index 7c5c7b9d5..53a8aa7f1 100644 --- a/subsurface-core/configuredivecomputerthreads.cpp +++ b/subsurface-core/configuredivecomputerthreads.cpp @@ -53,6 +53,10 @@ #define OSTC3_GRAPHICAL_SPEED_INDICATOR 0x40 #define OSTC3_ALWAYS_SHOW_PPO2 0x41 #define OSTC3_TEMP_SENSOR_OFFSET 0x42 +#define OSTC3_SAFETY_STOP_LENGTH 0x43 +#define OSTC3_SAFETY_STOP_START_DEPTH 0x44 +#define OSTC3_SAFETY_STOP_END_DEPTH 0x45 +#define OSTC3_SAFETY_STOP_RESET_DEPTH 0x46 #define OSTC3_HW_OSTC_3 0x0A #define OSTC3_HW_OSTC_3P 0x1A @@ -407,7 +411,7 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev dc_status_t rc; dc_event_progress_t progress; progress.current = 0; - progress.maximum = 53; + progress.maximum = 57; unsigned char hardware[1]; //Read hardware type @@ -650,6 +654,10 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev READ_SETTING(OSTC3_DYNAMIC_ASCEND_RATE, dynamicAscendRate); READ_SETTING(OSTC3_GRAPHICAL_SPEED_INDICATOR, graphicalSpeedIndicator); READ_SETTING(OSTC3_ALWAYS_SHOW_PPO2, alwaysShowppO2); + READ_SETTING(OSTC3_SAFETY_STOP_LENGTH, safetyStopLength); + READ_SETTING(OSTC3_SAFETY_STOP_START_DEPTH, safetyStopStartDepth); + READ_SETTING(OSTC3_SAFETY_STOP_END_DEPTH, safetyStopEndDepth); + READ_SETTING(OSTC3_SAFETY_STOP_RESET_DEPTH, safetyStopResetDepth); #undef READ_SETTING @@ -913,6 +921,11 @@ static dc_status_t write_ostc3_settings(dc_device_t *device, DeviceDetails *m_de WRITE_SETTING(OSTC3_DYNAMIC_ASCEND_RATE, dynamicAscendRate); WRITE_SETTING(OSTC3_GRAPHICAL_SPEED_INDICATOR, graphicalSpeedIndicator); WRITE_SETTING(OSTC3_ALWAYS_SHOW_PPO2, alwaysShowppO2); + WRITE_SETTING(OSTC3_TEMP_SENSOR_OFFSET, tempSensorOffset); + WRITE_SETTING(OSTC3_SAFETY_STOP_LENGTH, safetyStopLength); + WRITE_SETTING(OSTC3_SAFETY_STOP_START_DEPTH, safetyStopStartDepth); + WRITE_SETTING(OSTC3_SAFETY_STOP_END_DEPTH, safetyStopEndDepth); + WRITE_SETTING(OSTC3_SAFETY_STOP_RESET_DEPTH, safetyStopResetDepth); #undef WRITE_SETTING @@ -1256,6 +1269,16 @@ static dc_status_t read_ostc_settings(dc_device_t *device, DeviceDetails *m_devi m_deviceDetails->aGFHigh = read_ostc_cf(data, 68); // CF69: Allow Gradient Factor change m_deviceDetails->aGFSelectable = read_ostc_cf(data, 69); + // CF70: Safety Stop Duration [s] + m_deviceDetails->safetyStopLength = read_ostc_cf(data, 70); + // CF71: Safety Stop Start Depth [m] + m_deviceDetails->safetyStopStartDepth = read_ostc_cf(data, 71); + // CF72: Safety Stop End Depth [m] + m_deviceDetails->safetyStopEndDepth = read_ostc_cf(data, 72); + // CF73: Safety Stop Reset Depth [m] + m_deviceDetails->safetyStopResetDepth = read_ostc_cf(data, 73); + // CF74: Battery Timeout [min] + #ifdef DEBUG_OSTC_CF for (int cf = 64; cf <= 95 && cf <= max_CF; cf++) printf("CF %d: %d\n", cf, read_ostc_cf(data, cf)); @@ -1557,6 +1580,16 @@ static dc_status_t write_ostc_settings(dc_device_t *device, DeviceDetails *m_dev write_ostc_cf(data, 68, max_CF, m_deviceDetails->aGFHigh); // CF69: Allow Gradient Factor change write_ostc_cf(data, 69, max_CF, m_deviceDetails->aGFSelectable); + // CF70: Safety Stop Duration [s] + write_ostc_cf(data, 70, max_CF, m_deviceDetails->safetyStopLength); + // CF71: Safety Stop Start Depth [m] + write_ostc_cf(data, 71, max_CF, m_deviceDetails->safetyStopStartDepth); + // CF72: Safety Stop End Depth [m] + write_ostc_cf(data, 72, max_CF, m_deviceDetails->safetyStopEndDepth); + // CF73: Safety Stop Reset Depth [m] + write_ostc_cf(data, 73, max_CF, m_deviceDetails->safetyStopResetDepth); + // CF74: Battery Timeout [min] + #ifdef DEBUG_OSTC_CF for (int cf = 64; cf <= 95 && cf <= max_CF; cf++) printf("CF %d: %d\n", cf, read_ostc_cf(data, cf)); diff --git a/subsurface-core/devicedetails.cpp b/subsurface-core/devicedetails.cpp index e5c33e418..a2da0d5bc 100644 --- a/subsurface-core/devicedetails.cpp +++ b/subsurface-core/devicedetails.cpp @@ -74,6 +74,10 @@ DeviceDetails::DeviceDetails(QObject *parent) : dynamicAscendRate(false), graphicalSpeedIndicator(false), alwaysShowppO2(false), - tempSensorOffset(0) + tempSensorOffset(0), + safetyStopLength(0), + safetyStopStartDepth(0), + safetyStopEndDepth(0), + safetyStopResetDepth(0) { } diff --git a/subsurface-core/devicedetails.h b/subsurface-core/devicedetails.h index 0d929c018..b5e59afe8 100644 --- a/subsurface-core/devicedetails.h +++ b/subsurface-core/devicedetails.h @@ -92,6 +92,10 @@ public: bool graphicalSpeedIndicator; bool alwaysShowppO2; int tempSensorOffset; + unsigned safetyStopLength; + unsigned safetyStopStartDepth; + unsigned safetyStopEndDepth; + unsigned safetyStopResetDepth; }; |