diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-04-29 00:20:08 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-04-29 00:20:08 +0200 |
commit | 1227e6ba5d23dad303761d57a85b6d4b221282b2 (patch) | |
tree | 6d8687cae1a2bc98f19bb6d47936d9242d09d61f | |
parent | a1b9cb908948375ec0cfd31b34c978b3ad842a29 (diff) |
tracker/hatire: enable setting DTR on com port
-rw-r--r-- | tracker-hatire/ftnoir_hatcontrols.ui | 84 | ||||
-rw-r--r-- | tracker-hatire/ftnoir_tracker_hat_dialog.cpp | 1 | ||||
-rw-r--r-- | tracker-hatire/ftnoir_tracker_hat_settings.h | 3 | ||||
-rw-r--r-- | tracker-hatire/lang/nl_NL.ts | 4 | ||||
-rw-r--r-- | tracker-hatire/lang/ru_RU.ts | 4 | ||||
-rw-r--r-- | tracker-hatire/lang/stub.ts | 4 | ||||
-rw-r--r-- | tracker-hatire/lang/zh_CN.ts | 4 | ||||
-rw-r--r-- | tracker-hatire/thread.cpp | 1 |
8 files changed, 74 insertions, 31 deletions
diff --git a/tracker-hatire/ftnoir_hatcontrols.ui b/tracker-hatire/ftnoir_hatcontrols.ui index ca4cefbc..758d8e51 100644 --- a/tracker-hatire/ftnoir_hatcontrols.ui +++ b/tracker-hatire/ftnoir_hatcontrols.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>389</width> - <height>488</height> + <height>497</height> </rect> </property> <property name="minimumSize"> @@ -1136,16 +1136,6 @@ p, li { white-space: pre-wrap; } <string>Serial Parameters</string> </property> <layout class="QGridLayout" name="gridLayout_8"> - <item row="0" column="1"> - <widget class="QComboBox" name="QCB_Serial_baudRate"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> <item row="3" column="1"> <widget class="QComboBox" name="QCB_Serial_stopBits"> <property name="sizePolicy"> @@ -1163,6 +1153,13 @@ p, li { white-space: pre-wrap; } </property> </widget> </item> + <item row="0" column="0"> + <widget class="QLabel" name="baudRateLabel"> + <property name="text"> + <string>BaudRate:</string> + </property> + </widget> + </item> <item row="2" column="1"> <widget class="QComboBox" name="QCB_Serial_parity"> <property name="sizePolicy"> @@ -1173,13 +1170,10 @@ p, li { white-space: pre-wrap; } </property> </widget> </item> - <item row="4" column="1"> - <widget class="QComboBox" name="QCB_Serial_flowControl"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="1" column="0"> + <widget class="QLabel" name="dataBitsLabel"> + <property name="text"> + <string>Data bits</string> </property> </widget> </item> @@ -1190,6 +1184,16 @@ p, li { white-space: pre-wrap; } </property> </widget> </item> + <item row="0" column="1"> + <widget class="QComboBox" name="QCB_Serial_baudRate"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> <item row="2" column="0"> <widget class="QLabel" name="parityLabel"> <property name="text"> @@ -1197,15 +1201,18 @@ p, li { white-space: pre-wrap; } </property> </widget> </item> - <item row="0" column="0"> - <widget class="QLabel" name="baudRateLabel"> - <property name="text"> - <string>BaudRate:</string> + <item row="1" column="1"> + <widget class="QComboBox" name="QCB_Serial_dataBits"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> </widget> </item> - <item row="1" column="1"> - <widget class="QComboBox" name="QCB_Serial_dataBits"> + <item row="4" column="1"> + <widget class="QComboBox" name="QCB_Serial_flowControl"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> @@ -1214,10 +1221,23 @@ p, li { white-space: pre-wrap; } </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="dataBitsLabel"> + <item row="5" column="0"> + <widget class="QLabel" name="label_6"> <property name="text"> - <string>Data bits</string> + <string>DTR</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QCheckBox" name="QCB_Serial_dtr"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> </property> </widget> </item> @@ -1371,6 +1391,7 @@ p, li { white-space: pre-wrap; } </layout> </widget> <tabstops> + <tabstop>tabWidget</tabstop> <tabstop>cbSerialPort</tabstop> <tabstop>btnZero</tabstop> <tabstop>btnReset</tabstop> @@ -1393,24 +1414,27 @@ p, li { white-space: pre-wrap; } <tabstop>cb_z</tabstop> <tabstop>chkInvertZ</tabstop> <tabstop>le_cmd_init</tabstop> + <tabstop>spb_BeforeInit</tabstop> <tabstop>le_cmd_start</tabstop> + <tabstop>spb_BeforeStart</tabstop> <tabstop>spb_AfterStart</tabstop> <tabstop>le_cmd_stop</tabstop> <tabstop>le_cmd_center</tabstop> <tabstop>le_cmd_zero</tabstop> - <tabstop>le_cmd_reset</tabstop> <tabstop>spb_Fps</tabstop> + <tabstop>le_cmd_reset</tabstop> <tabstop>cb_Endian</tabstop> <tabstop>QCB_Serial_baudRate</tabstop> <tabstop>QCB_Serial_dataBits</tabstop> <tabstop>QCB_Serial_parity</tabstop> <tabstop>QCB_Serial_stopBits</tabstop> <tabstop>QCB_Serial_flowControl</tabstop> + <tabstop>QCB_Serial_dtr</tabstop> + <tabstop>btn_icone</tabstop> + <tabstop>chkEnableLogging</tabstop> <tabstop>lineSend</tabstop> <tabstop>btnSend</tabstop> <tabstop>pteINFO</tabstop> - <tabstop>tabWidget</tabstop> - <tabstop>btn_icone</tabstop> </tabstops> <resources> <include location="ftnoir_hat.qrc"/> diff --git a/tracker-hatire/ftnoir_tracker_hat_dialog.cpp b/tracker-hatire/ftnoir_tracker_hat_dialog.cpp index 7cb25d18..39883a34 100644 --- a/tracker-hatire/ftnoir_tracker_hat_dialog.cpp +++ b/tracker-hatire/ftnoir_tracker_hat_dialog.cpp @@ -91,6 +91,7 @@ dialog_hatire::dialog_hatire() : theTracker(nullptr), timer(this) tie_setting(s.DelaySeq, ui.spb_AfterStart); tie_setting(s.BigEndian, ui.cb_Endian); + tie_setting(s.pDTR, ui.QCB_Serial_dtr); tie_setting(s.pBaudRate, ui.QCB_Serial_baudRate); tie_setting(s.pDataBits, ui.QCB_Serial_dataBits); diff --git a/tracker-hatire/ftnoir_tracker_hat_settings.h b/tracker-hatire/ftnoir_tracker_hat_settings.h index a41f906d..b17042c7 100644 --- a/tracker-hatire/ftnoir_tracker_hat_settings.h +++ b/tracker-hatire/ftnoir_tracker_hat_settings.h @@ -22,7 +22,7 @@ struct TrackerSettings : opts value<int> DelayInit, DelayStart, DelaySeq; - value<bool> BigEndian, EnableLogging; + value<bool> BigEndian, EnableLogging, pDTR; value<QString> QSerialPortName; @@ -63,6 +63,7 @@ struct TrackerSettings : opts DelaySeq(b, "after-start-delay", 0), BigEndian(b, "is-big-endian", false), EnableLogging(b, "enable-logging", false), + pDTR(b, "data-terminal-ready", false), QSerialPortName(b, "serial-port-name", ""), pBaudRate(b, "baud-rate", QSerialPort::Baud115200), pDataBits(b, "data-bits", QSerialPort::Data8), diff --git a/tracker-hatire/lang/nl_NL.ts b/tracker-hatire/lang/nl_NL.ts index a1e613b0..af8cbd2c 100644 --- a/tracker-hatire/lang/nl_NL.ts +++ b/tracker-hatire/lang/nl_NL.ts @@ -269,6 +269,10 @@ p, li { white-space: pre-wrap; } <source>Enable logging to diagnostic file</source> <translation type="unfinished"></translation> </message> + <message> + <source>DTR</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>dialog_hatire</name> diff --git a/tracker-hatire/lang/ru_RU.ts b/tracker-hatire/lang/ru_RU.ts index f7f3024d..16052702 100644 --- a/tracker-hatire/lang/ru_RU.ts +++ b/tracker-hatire/lang/ru_RU.ts @@ -269,6 +269,10 @@ p, li { white-space: pre-wrap; } <source>Enable logging to diagnostic file</source> <translation type="unfinished"></translation> </message> + <message> + <source>DTR</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>dialog_hatire</name> diff --git a/tracker-hatire/lang/stub.ts b/tracker-hatire/lang/stub.ts index 0d22bf81..90c8e616 100644 --- a/tracker-hatire/lang/stub.ts +++ b/tracker-hatire/lang/stub.ts @@ -269,6 +269,10 @@ p, li { white-space: pre-wrap; } <source>Enable logging to diagnostic file</source> <translation type="unfinished"></translation> </message> + <message> + <source>DTR</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>dialog_hatire</name> diff --git a/tracker-hatire/lang/zh_CN.ts b/tracker-hatire/lang/zh_CN.ts index c415b50c..d80cfa28 100644 --- a/tracker-hatire/lang/zh_CN.ts +++ b/tracker-hatire/lang/zh_CN.ts @@ -269,6 +269,10 @@ p, li { white-space: pre-wrap; } <source>Enable logging to diagnostic file</source> <translation type="unfinished"></translation> </message> + <message> + <source>DTR</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>dialog_hatire</name> diff --git a/tracker-hatire/thread.cpp b/tracker-hatire/thread.cpp index 533aaebf..7d61a90a 100644 --- a/tracker-hatire/thread.cpp +++ b/tracker-hatire/thread.cpp @@ -168,6 +168,7 @@ serial_result hatire_thread::init_serial_port_impl() && com_port.setParity((QSerialPort::Parity)s.pParity) && com_port.setStopBits((QSerialPort::StopBits)s.pStopBits) && com_port.setFlowControl((QSerialPort::FlowControl)s.pFlowControl) + && com_port.setDataTerminalReady(s.pDTR) && com_port.clear(QSerialPort::AllDirections) ) { |