Mercurial > public > ostc_companion
comparison OSTC_CR_Operations.cpp @ 1:0b3630a29ad8
Initial version based on previous repository.
Project was ported to QT6 and in now cmake based.
| author | Ideenmodellierer <tiefenrauscher@web.de> |
|---|---|
| date | Thu, 27 Nov 2025 18:40:28 +0100 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:76ccd6ce50c0 | 1:0b3630a29ad8 |
|---|---|
| 1 ////////////////////////////////////////////////////////////////////////////// | |
| 2 /// \file OSTC_CR_Operations.cpp | |
| 3 /// \brief Implementing various operations for H&W OSTC-cR dive computer | |
| 4 /// \author JD Gascuel. | |
| 5 /// \sa ComputerOperations.h | |
| 6 /// | |
| 7 /// \copyright (c) 2011-2016 JD Gascuel. All rights reserved. | |
| 8 /// $Id$ | |
| 9 ////////////////////////////////////////////////////////////////////////////// | |
| 10 // | |
| 11 // BSD 2-Clause License: | |
| 12 // | |
| 13 // Redistribution and use in source and binary forms, with or without | |
| 14 // modification, are permitted provided that the following conditions | |
| 15 // are met: | |
| 16 // | |
| 17 // 1. Redistributions of source code must retain the above copyright notice, | |
| 18 // this list of conditions and the following disclaimer. | |
| 19 // | |
| 20 // 2. Redistributions in binary form must reproduce the above copyright notice, | |
| 21 // this list of conditions and the following disclaimer in the documentation | |
| 22 // and/or other materials provided with the distribution. | |
| 23 // | |
| 24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| 25 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 26 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
| 27 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | |
| 28 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
| 29 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| 30 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| 31 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| 32 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| 33 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | |
| 34 // THE POSSIBILITY OF SUCH DAMAGE. | |
| 35 // | |
| 36 ////////////////////////////////////////////////////////////////////////////// | |
| 37 | |
| 38 #include "OSTC_CR_Operations.h" | |
| 39 | |
| 40 #include "Utils/Log.h" | |
| 41 | |
| 42 ////////////////////////////////////////////////////////////////////////////// | |
| 43 | |
| 44 OSTCcROperations::OSTCcROperations() | |
| 45 { | |
| 46 emulatorName = "OSTC_CR"; | |
| 47 } | |
| 48 | |
| 49 ////////////////////////////////////////////////////////////////////////////// | |
| 50 | |
| 51 QString OSTCcROperations::model() const | |
| 52 { | |
| 53 return "OSTC_cR"; | |
| 54 } | |
| 55 | |
| 56 HardwareOperations::CompanionFeatures OSTCcROperations::supported() const | |
| 57 { | |
| 58 // No ICON, no DUMPSCREEN | |
| 59 return CompanionFeatures(PARAMETERS|DATE|NAME|FIRMWARE | |
| 60 |HELIUM_DIVE|CCR_DIVE); | |
| 61 } | |
| 62 | |
| 63 void OSTCcROperations::getIdentity() | |
| 64 { | |
| 65 descriptionString.clear(); | |
| 66 | |
| 67 LOG_TRACE("Getting model..."); | |
| 68 HardwareDescriptor hw = hardwareDescriptor(); | |
| 69 if( hw != HW_UNKNOWN_OSTC && hw != HW_OSTCcR_a && hw != HW_OSTCcR_b ) | |
| 70 LOG_THROW("Not an OSTC cR."); | |
| 71 | |
| 72 LOG_TRACE("Getting identity..."); | |
| 73 getCommonIdentity(); | |
| 74 | |
| 75 if( hw == HW_UNKNOWN_OSTC && (firmware() > 0x0A00 || serialNumber() > 10000) ) | |
| 76 LOG_THROW("Not an OSTC cR"); | |
| 77 | |
| 78 LOG_TRACE("Found " << descriptionString); | |
| 79 } | |
| 80 | |
| 81 ////////////////////////////////////////////////////////////////////////////// | |
| 82 | |
| 83 QString OSTCcROperations::firmwareTemplate() const | |
| 84 { | |
| 85 return "*_ostc3_firmware.hex"; | |
| 86 } |
