comparison OSTC2Operations.cpp @ 8:21ce6187d32e

Minor changes done by automatic style checker
author Ideenmodellierer
date Mon, 12 Jan 2026 13:51:17 +0000
parents 0b3630a29ad8
children
comparison
equal deleted inserted replaced
7:0969ef86c42d 8:21ce6187d32e
37 37
38 #include "OSTC2Operations.h" 38 #include "OSTC2Operations.h"
39 #include "HexFile.h" 39 #include "HexFile.h"
40 #include "Utils/Log.h" 40 #include "Utils/Log.h"
41 41
42 #define FIRMWARE_SIZE 0x17F40 42 #define FIRMWARE_SIZE 0x17F40
43 43
44 #include <QApplication> 44 #include <QApplication>
45 #include <QProgressBar> 45 #include <QProgressBar>
46 #include <QRegularExpression> 46 #include <QRegularExpression>
47 extern QProgressBar* progress; 47 extern QProgressBar *progress;
48 48
49 ////////////////////////////////////////////////////////////////////////////// 49 //////////////////////////////////////////////////////////////////////////////
50 50
51 OSTC2Operations::OSTC2Operations() 51 OSTC2Operations::OSTC2Operations()
52 { 52 {
75 } 75 }
76 #endif 76 #endif
77 QRegularExpression OSTC2Operations::portTemplate() const 77 QRegularExpression OSTC2Operations::portTemplate() const
78 { 78 {
79 #if defined(Q_OS_MAC) 79 #if defined(Q_OS_MAC)
80 return QRegularExpression("tty.OSTC[0-9]+.*", 80 return QRegularExpression("tty.OSTC[0-9]+.*", QRegularExpression::CaseInsensitiveOption);
81 QRegularExpression::CaseInsensitiveOption);
82 #elif defined(Q_OS_LINUX) 81 #elif defined(Q_OS_LINUX)
83 // Debian, Ubuntu, RedHat, CentOS, SUSE 82 // Debian, Ubuntu, RedHat, CentOS, SUSE
84 return QRegularExpression("ttyUSB.*"); // default: case-sensitive 83 return QRegularExpression("ttyUSB.*"); // default: case-sensitive
85 #elif defined(Q_OS_WIN) 84 #elif defined(Q_OS_WIN)
86 return QRegularExpression("COM.*"); // default: case-sensitive 85 return QRegularExpression("COM.*"); // default: case-sensitive
87 #endif 86 #endif
88 } 87 }
89 ////////////////////////////////////////////////////////////////////////////// 88 //////////////////////////////////////////////////////////////////////////////
90 89
91 //void OSTC2pOperations::loadFirmware(HexFile& hex, const QString& fileName) const 90 //void OSTC2pOperations::loadFirmware(HexFile& hex, const QString& fileName) const
103 } 102 }
104 103
105 HardwareOperations::CompanionFeatures OSTC2Operations::supported() const 104 HardwareOperations::CompanionFeatures OSTC2Operations::supported() const
106 { 105 {
107 // No ICON, no DUMPSCREEN. 106 // No ICON, no DUMPSCREEN.
108 return CompanionFeatures(PARAMETERS|DATE|NAME|FIRMWARE 107 return CompanionFeatures(PARAMETERS | DATE | NAME | FIRMWARE | HELIUM_DIVE | CCR_DIVE
109 |HELIUM_DIVE|CCR_DIVE|BLUETOOTH); 108 | BLUETOOTH);
110 } 109 }
111 110
112 ////////////////////////////////////////////////////////////////////////////// 111 //////////////////////////////////////////////////////////////////////////////
113 112
114 QSize OSTC2Operations::nameSize() const 113 QSize OSTC2Operations::nameSize() const
122 { 121 {
123 descriptionString.clear(); 122 descriptionString.clear();
124 123
125 LOG_TRACE("Getting model..."); 124 LOG_TRACE("Getting model...");
126 HardwareDescriptor hw = hardwareDescriptor(); 125 HardwareDescriptor hw = hardwareDescriptor();
127 if( hw != HW_OSTC2_a && hw != HW_OSTC2_b && hw != HW_OSTC2_c ) 126 if (hw != HW_OSTC2_a && hw != HW_OSTC2_b && hw != HW_OSTC2_c)
128 LOG_THROW("Not an OSTC2."); 127 LOG_THROW("Not an OSTC2.");
129 128
130 LOG_TRACE("Getting identity..."); 129 LOG_TRACE("Getting identity...");
131 getCommonIdentity(); 130 getCommonIdentity();
132 131