Changeset 4cbf64b in subsurface


Ignore:
Timestamp:
May 4, 2017, 10:50:15 AM (3 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
527763f
Parents:
0c27640
git-author:
Anton Lundin <glance@…> (04/26/17 11:49:12)
git-committer:
Dirk Hohndel <dirk@…> (05/04/17 10:50:15)
Message:

Wire up a skeleton for configure OSTC 4

Signed-off-by: Anton Lundin <glance@…>

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/configuredivecomputerthreads.cpp

    rb368ecd r4cbf64b  
    362362}
    363363
     364static dc_status_t read_ostc4_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
     365{
     366        dc_status_t rc = DC_STATUS_SUCCESS;
     367        dc_event_progress_t progress;
     368        progress.current = 0;
     369        progress.maximum = 1;
     370        unsigned char hardware[1];
     371
     372        EMIT_PROGRESS();
     373
     374        return rc;
     375}
     376
     377static dc_status_t write_ostc4_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
     378{
     379        dc_status_t rc = DC_STATUS_SUCCESS;
     380        dc_event_progress_t progress;
     381        progress.current = 0;
     382        progress.maximum = 1;
     383
     384        EMIT_PROGRESS();
     385
     386        return rc;
     387}
     388
     389
    364390#if DC_VERSION_CHECK(0, 5, 0)
    365391static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_deviceDetails, dc_event_callback_t progress_cb, void *userdata)
     
    375401        if (rc != DC_STATUS_SUCCESS)
    376402                return rc;
    377         EMIT_PROGRESS();
    378403
    379404        dc_descriptor_t *desc = get_descriptor(DC_FAMILY_HW_OSTC3, hardware[0]);
     
    384409                return DC_STATUS_UNSUPPORTED;
    385410        }
     411
     412        if (m_deviceDetails->model == "OSTC 4")
     413                return read_ostc4_settings(device, m_deviceDetails, progress_cb, userdata);
     414
     415        EMIT_PROGRESS();
    386416
    387417        //Read gas mixes
     
    16481678#if DC_VERSION_CHECK(0, 5, 0)
    16491679        case DC_FAMILY_HW_OSTC3:
    1650                 rc = write_ostc3_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
     1680                // FIXME: Is this the best way?
     1681                if (m_deviceDetails->model == "OSTC 4")
     1682                        rc = write_ostc4_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
     1683                else
     1684                        rc = write_ostc3_settings(m_data->device, m_deviceDetails, DeviceThread::event_cb, this);
    16511685                if (rc != DC_STATUS_SUCCESS)
    16521686                        emit error(tr("Failed!"));
  • desktop-widgets/configuredivecomputerdialog.cpp

    r0c27640 r4cbf64b  
    480480        case 2:
    481481                populateDeviceDetailsOSTC();
     482                break;
     483        case 3:
     484                populateDeviceDetailsOSTC4();
    482485                break;
    483486        }
     
    786789}
    787790
     791void ConfigureDiveComputerDialog::populateDeviceDetailsOSTC4()
     792{
     793}
     794
    788795void ConfigureDiveComputerDialog::readSettings()
    789796{
     
    865872        case 2:
    866873                reloadValuesOSTC();
     874                break;
     875        case 3:
     876                reloadValuesOSTC4();
    867877                break;
    868878        }
     
    11501160}
    11511161
     1162void ConfigureDiveComputerDialog::reloadValuesOSTC4()
     1163{
     1164}
     1165
    11521166void ConfigureDiveComputerDialog::on_backupButton_clicked()
    11531167{
     
    12281242                fw_upgrade_possible = true;
    12291243                break;
     1244        case 3:
     1245                selected_vendor = "Heinrichs Weikamp";
     1246                selected_product = "OSTC 4";
     1247                fw_upgrade_possible = true;
    12301248        default:
    12311249                /* Not Supported */
  • desktop-widgets/configuredivecomputerdialog.h

    r9021a44 r4cbf64b  
    115115        void populateDeviceDetailsOSTC();
    116116        void populateDeviceDetailsSuuntoVyper();
     117        void populateDeviceDetailsOSTC4();
    117118        void reloadValuesOSTC3();
    118119        void reloadValuesOSTC();
    119120        void reloadValuesSuuntoVyper();
     121        void reloadValuesOSTC4();
    120122
    121123        QString selected_vendor;
Note: See TracChangeset for help on using the changeset viewer.