diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-09-25 14:05:30 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-09-26 11:22:51 +0200 |
commit | add1d5d0b01078a3a99167a65e691e2ee647f398 (patch) | |
tree | da7f8a98a845545358ae5f723ada9d3f9fc9409c /tracker-hatire | |
parent | d0a3b0a85c50c7c746b8ef17af19f4e88dfdf895 (diff) |
tracker/hatire: fix warnings
Diffstat (limited to 'tracker-hatire')
-rw-r--r-- | tracker-hatire/ftnoir_tracker_hat.h | 2 | ||||
-rw-r--r-- | tracker-hatire/thread.cpp | 16 | ||||
-rw-r--r-- | tracker-hatire/thread.hpp | 1 |
3 files changed, 8 insertions, 11 deletions
diff --git a/tracker-hatire/ftnoir_tracker_hat.h b/tracker-hatire/ftnoir_tracker_hat.h index b2300556..5577235c 100644 --- a/tracker-hatire/ftnoir_tracker_hat.h +++ b/tracker-hatire/ftnoir_tracker_hat.h @@ -42,8 +42,6 @@ private: int frame_cnt = 0; std::atomic<int> CptError { 0 }; - - static inline QByteArray to_latin1(const QString& str) { return str.toLatin1(); } }; class hatire_metadata : public Metadata diff --git a/tracker-hatire/thread.cpp b/tracker-hatire/thread.cpp index 4938e77f..533aaebf 100644 --- a/tracker-hatire/thread.cpp +++ b/tracker-hatire/thread.cpp @@ -71,7 +71,7 @@ void hatire_thread::Log(const QString& message) { QTextStream out(&flDiagnostics); QString milliSeconds; - milliSeconds = QString("%1").arg(QTime::currentTime().msec(), 3, 10, QChar('0')); + milliSeconds = QStringLiteral("%1").arg(QTime::currentTime().msec(), 3, 10, QChar('0')); // We have a file out << QTime::currentTime().toString() << "." << milliSeconds << ": " << message << "\r\n"; flDiagnostics.close(); @@ -111,7 +111,7 @@ void hatire_thread::teardown_serial() { QByteArray msg; Log("Tracker shut down"); - com_port.write(to_latin1(s.CmdStop)); + com_port.write(s.CmdStop->toUtf8()); if (!com_port.waitForBytesWritten(1000)) { emit serial_debug_info("TimeOut in writing CMD"); @@ -120,7 +120,7 @@ void hatire_thread::teardown_serial() { msg.append("\r\n"); msg.append("SEND '"); - msg.append(s.CmdStop); + msg.append(s.CmdStop->toUtf8()); msg.append("'\r\n"); } emit serial_debug_info(msg); @@ -200,7 +200,7 @@ serial_result hatire_thread::init_serial_port_impl() } Log(tr("Waiting on init")); qDebug() << QTime::currentTime() << " HAT send INIT "; - sendcmd_str(s.CmdInit); + emit sendcmd_str(s.CmdInit); // Wait init MPU sequence for (int i = 1; i <= s.DelayStart; i+=50) { @@ -208,7 +208,7 @@ serial_result hatire_thread::init_serial_port_impl() } // Send START cmd to IMU qDebug() << QTime::currentTime() << " HAT send START "; - sendcmd_str(s.CmdStart); + emit sendcmd_str(s.CmdStart); // Wait start MPU sequence for (int i = 1; i <=s.DelaySeq; i+=50) @@ -241,13 +241,13 @@ void hatire_thread::serial_info_impl() if (com_port.isOpen()) { msg.append("\r\n"); - msg.append(com_port.portName()); + msg.append(com_port.portName().toUtf8()); msg.append("\r\n"); msg.append("BAUDRATE :"); - msg.append(QString::number(com_port.baudRate())); + msg.append(QString::number(com_port.baudRate()).toLatin1()); msg.append("\r\n"); msg.append("DataBits :"); - msg.append(QString::number(com_port.dataBits())); + msg.append(QString::number(com_port.dataBits()).toLatin1()); msg.append("\r\n"); msg.append("Parity :"); diff --git a/tracker-hatire/thread.hpp b/tracker-hatire/thread.hpp index 5cecbdce..f6bd8d49 100644 --- a/tracker-hatire/thread.hpp +++ b/tracker-hatire/thread.hpp @@ -50,7 +50,6 @@ class hatire_thread : public QThread char buf[1024]; void run() override; - static inline QByteArray to_latin1(const QString& str) { return str.toLatin1(); } void serial_debug_info_str(const QString& str); |