Mercurial > public > ostc_companion
comparison OSTC4Operations.h @ 11:6fba58c4964b
Minor changes done by automatic style checker
| author | Ideenmodellierer |
|---|---|
| date | Mon, 12 Jan 2026 13:57:24 +0000 |
| parents | 115cfa4a3239 |
| children | e47e0f59101d |
comparison
equal
deleted
inserted
replaced
| 10:9a3c1a6f9833 | 11:6fba58c4964b |
|---|---|
| 39 // 2016-04-25 jDG: Final H&W version. | 39 // 2016-04-25 jDG: Final H&W version. |
| 40 | 40 |
| 41 #ifndef OSTC4_OPERATIONS_H | 41 #ifndef OSTC4_OPERATIONS_H |
| 42 #define OSTC4_OPERATIONS_H | 42 #define OSTC4_OPERATIONS_H |
| 43 | 43 |
| 44 #include <QRegularExpression> | |
| 44 #include "OSTC3Operations.h" | 45 #include "OSTC3Operations.h" |
| 45 #include <QRegularExpression> | |
| 46 | 46 |
| 47 #include "AES/Adler16.h" | |
| 48 #include "ostc45_icon.h" | |
| 49 #include "crc_wrapper.h" | |
| 50 #include "Export.h" | |
| 51 #include <QFile> | 47 #include <QFile> |
| 52 #include <QString> | 48 #include <QString> |
| 49 #include "AES/Adler16.h" | |
| 50 #include "Export.h" | |
| 51 #include "crc_wrapper.h" | |
| 52 #include "ostc45_icon.h" | |
| 53 | 53 |
| 54 ////////////////////////////////////////////////////////////////////////////// | 54 ////////////////////////////////////////////////////////////////////////////// |
| 55 /// \brief Implementing various operations for H&W OSTC4 dive computer | 55 /// \brief Implementing various operations for H&W OSTC4 dive computer |
| 56 class OSTC4Operations | 56 class OSTC4Operations : public OSTC3Operations |
| 57 : public OSTC3Operations | |
| 58 { | 57 { |
| 59 //------------------------------------------------------------------------ | 58 //------------------------------------------------------------------------ |
| 60 /// \brief Custom text size (lines and columns). | 59 /// \brief Custom text size (lines and columns). |
| 61 EXPORT QSize nameSize() const override; | 60 EXPORT QSize nameSize() const override; |
| 62 | 61 |
| 69 EXPORT QString model() const override; | 68 EXPORT QString model() const override; |
| 70 | 69 |
| 71 /// \brief Tells what is supported for a given computer. | 70 /// \brief Tells what is supported for a given computer. |
| 72 EXPORT CompanionFeatures supported() const override; | 71 EXPORT CompanionFeatures supported() const override; |
| 73 | 72 |
| 74 struct FirmwareOSTC4 { | 73 struct FirmwareOSTC4 |
| 75 uint length; | 74 { |
| 76 uchar type, dummy5, dummy6, dummy7; | 75 uint length; |
| 77 uint checksum; | 76 uchar type, dummy5, dummy6, dummy7; |
| 78 struct { | 77 uint checksum; |
| 78 struct | |
| 79 { | |
| 79 unsigned char x, y, z, beta; | 80 unsigned char x, y, z, beta; |
| 80 } version; | 81 } version; |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 QFile _file; | 84 QFile _file; |
| 84 | 85 |
| 85 std::unique_ptr<BmpToArray> bmp; | 86 std::unique_ptr<BmpToArray> bmp; |
| 86 | 87 |
| 87 /// \param[in] dryRun: If TRUE, do not upload FW, just check file structure. | 88 /// \param[in] dryRun: If TRUE, do not upload FW, just check file structure. |
| 88 void openFirmware(const QString& fileName, bool dryRun); | 89 void openFirmware(const QString &fileName, bool dryRun); |
| 89 | 90 |
| 90 void loadFirmwarePart(FirmwareOSTC4& header, | 91 void loadFirmwarePart(FirmwareOSTC4 &header, QByteArray &bin, int part, bool dryRun); |
| 91 QByteArray& bin, int part, | |
| 92 bool dryRun); | |
| 93 | 92 |
| 94 void getSignal() override; | 93 void getSignal() override; |
| 95 void getAllHeader(unsigned char* pBuffer) override; | 94 void getAllHeader(unsigned char *pBuffer) override; |
| 96 void writeAllHeader(unsigned char* pBuffer) override; | 95 void writeAllHeader(unsigned char *pBuffer) override; |
| 97 void getAllSamples(unsigned char* pBuffer) override; | 96 void getAllSamples(unsigned char *pBuffer) override; |
| 98 void writeAllSamples(unsigned char* pBuffer) override; | 97 void writeAllSamples(unsigned char *pBuffer) override; |
| 99 void setIcons(const QString& fileName) override; | 98 void setIcons(const QString &fileName) override; |
| 100 | 99 |
| 101 EXPORT QString firmwareTemplate() const override; | 100 EXPORT QString firmwareTemplate() const override; |
| 102 // EXPORT QRegExp portTemplate() const override; | 101 // EXPORT QRegExp portTemplate() const override; |
| 103 EXPORT QRegularExpression portTemplate() const override; | 102 EXPORT QRegularExpression portTemplate() const override; |
| 104 EXPORT QStringList listPorts() const override; | 103 EXPORT QStringList listPorts() const override; |
| 105 EXPORT void upgradeFW(const QString &fileName) override; | 104 EXPORT void upgradeFW(const QString &fileName) override; |
| 106 | 105 |
| 107 Adler32 fileChecksum; | 106 Adler32 fileChecksum; |
| 108 | 107 |
| 109 CrcWrapper* m_crcWrapper; | 108 CrcWrapper *m_crcWrapper; |
| 110 | 109 |
| 111 public: | 110 public: |
| 112 EXPORT OSTC4Operations(); | 111 EXPORT OSTC4Operations(); |
| 113 }; | 112 }; |
| 114 | 113 |
