From 0b955aea6c04b894bace7b61ade90bb71b4b211c Mon Sep 17 00:00:00 2001 From: h-4nd-h Date: Tue, 15 Mar 2022 12:23:30 +0330 Subject: [PATCH] Add helper to ease development --- logic/include/model/ButtonHelper.h | 39 ++++++ logic/include/model/Console.h | 31 ++--- logic/include/model/FunctionCodes.h | 134 +++++++++++++++++++ logic/include/model/Led.h | 19 ++- logic/include/model/PushButton.h | 22 ++++ logic/include/model/Pushbutton.h | 20 --- logic/include/model/RotayButton.h | 16 +-- logic/src/model/Console.cpp | 55 +------- logic/src/model/Led.cpp | 13 +- logic/src/model/PushButton.cpp | 52 ++++++++ logic/src/model/Pushbutton.cpp | 58 --------- logic/src/model/RotayButton.cpp | 49 ++++--- logic/src/viewModel/MainViewModel.cpp | 26 ++-- test/tst_console.cpp | 180 ++++++++++++-------------- 14 files changed, 403 insertions(+), 311 deletions(-) create mode 100644 logic/include/model/ButtonHelper.h create mode 100644 logic/include/model/FunctionCodes.h create mode 100644 logic/include/model/PushButton.h delete mode 100644 logic/include/model/Pushbutton.h create mode 100644 logic/src/model/PushButton.cpp delete mode 100644 logic/src/model/Pushbutton.cpp diff --git a/logic/include/model/ButtonHelper.h b/logic/include/model/ButtonHelper.h new file mode 100644 index 0000000..9e3db87 --- /dev/null +++ b/logic/include/model/ButtonHelper.h @@ -0,0 +1,39 @@ +#ifndef BUTTONHELPER_H +#define BUTTONHELPER_H + +#define PUSH_BUTTON(CAPITAL_NAME, SMALL_NAME, FUNC_CODE, LED_FUNC_CODE) \ +private: \ + PushButton _ ## SMALL_NAME{FUNC_CODE, LED_FUNC_CODE}; \ +public: \ + void press ## CAPITAL_NAME() \ + { \ + auto arr = _ ## SMALL_NAME.press(); \ + _dataSender->send(arr); \ + } \ + void release ## CAPITAL_NAME() \ + { \ + auto arr = _ ## SMALL_NAME.release(); \ + _dataSender->send(arr); \ + } \ +signals: \ + void SMALL_NAME ## LedChanged(int value) + +/*************************************************************************************************/ +#define PUSH_BUTTON_NO_LED(CAPITAL_NAME, SMALL_NAME, FUNC_CODE) \ +private: \ + PushButton _ ## SMALL_NAME{FUNC_CODE}; \ +public: \ + void press ## CAPITAL_NAME() \ + { \ + auto arr = _ ## SMALL_NAME.press(); \ + _dataSender->send(arr); \ + } \ + void release ## CAPITAL_NAME() \ + { \ + auto arr = _ ## SMALL_NAME.release(); \ + _dataSender->send(arr); \ + } \ +signals: \ + void SMALL_NAME ## LedChanged(int value) + +#endif //BUTTONHELPER_H diff --git a/logic/include/model/Console.h b/logic/include/model/Console.h index c29cf1b..f7eb13d 100644 --- a/logic/include/model/Console.h +++ b/logic/include/model/Console.h @@ -3,31 +3,26 @@ #include -#include "Pushbutton.h" +#include "ButtonHelper.h" +#include "FunctionCodes.h" +#include "PushButton.h" #include "RotayButton.h" -class DataSender; +#include "DataSender.h" -class Console: public QObject +class Console : public QObject { - Q_OBJECT + Q_OBJECT + + PUSH_BUTTON(Dual, dual, DUAL_FC, static_cast(DUAL_LED_FC)); + PUSH_BUTTON(Quad, quad, QUAD_FC, static_cast(QUAD_LED_FC)); private: - DataSender* _dataSender; - PushButton _dual, _quad; - // RotayButton _Js1; + DataSender* _dataSender; public: - Console(); - void injectDataSender(DataSender* sender); - void test(); - void pressDual(); - void releaseDual(); - void pressQuad(); - void releaseQuad(); - -signals: - void dualLedChanged(int value); + Console(); + void injectDataSender(DataSender* sender); }; -#endif // CONSOLE_H +#endif //CONSOLE_H diff --git a/logic/include/model/FunctionCodes.h b/logic/include/model/FunctionCodes.h new file mode 100644 index 0000000..ac2dd94 --- /dev/null +++ b/logic/include/model/FunctionCodes.h @@ -0,0 +1,134 @@ +#ifndef FUNCTIONCODES_H +#define FUNCTIONCODES_H + +//Buttons +#define DUAL_FC 0x1D +#define QUAD_FC 0x1C +#define SINGLE_FC 0x1B +#define P1_FC 0x21 +#define P2_FC 0x22 +#define P3_FC 0x23 +#define P4_FC 0x24 +#define EXIT_FC 0x0C +#define FREEZE_FC 0x15 +#define POINTER_FC 0x0D +#define AUTOSET_FC 0x14 +#define ABC_FC 0x0E +#define FOUR_D_FC 0x13 +#define CLEAR_FC 0x10 +#define THREE_D_FC 0x12 +#define MEASURE_FC 0x11 +#define BODY_MARK_FC 0x0F +#define PATIENT_FC 0x02 +#define UTILS_FC 0x03 +#define DVD_FC 0x04 +#define REPORT_FC 0x05 +#define PROBE_FC 0x06 +#define ARCHIVE_FC 0x07 +#define END_FC 0x08 +#define XTD_FC 0x16 +#define BF_FC 0x17 +#define P5_FC 0x25 +#define P6_FC 0x26 + +#define JOYSTICK1_TOP_FC 0x39 +#define JOYSTICK2_TOP_FC 0x3C +#define JOYSTICK3_TOP_FC 0x3F +#define JOYSTICK4_TOP_FC 0x42 +#define JOYSTICK5_TOP_FC 0x45 +#define DEPTHTOP_FC 0x33 +#define FOCUSTOP_FC 0x36 + +#define JOYSTICK1_CENTER_FC 0x38 +#define JOYSTICK2_CENTER_FC 0x3B +#define JOYSTICK3_CENTER_FC 0x3E +#define JOYSTICK4_CENTER_FC 0x41 +#define JOYSTICK5_CENTER_FC 0x44 +#define DEPTH_CENTER_FC 0x32 +#define FOCUS_CENTER_FC 0x35 +#define MODE_PW_CENTER_FC 0x49 +#define MODE_M_CENTER_FC 0x4A +#define MODE_PD_CENTER_FC 0x4B +#define MODE_C_CENTER_FC 0x4C +#define MODE_2D_CENTER_FC 0x4D + +#define JOYSTICK1_BOTTOM_FC 0x37 +#define JOYSTICK2_BOTTOM_FC 0x3A +#define JOYSTICK3_BOTTOM_FC 0x3D +#define JOYSTICK4_BOTTOM_FC 0x40 +#define JOYSTICK5_BOTTOM_FC 0x43 +#define DEPTH_BOTTOM_FC 0x31 +#define FOCUS_BOTTOM_FC 0x34 + +//Trackball +#define TRACKBALL_TOP_FC 0x2A +#define TRACKBALL_BOTTOM_FC 0x2B +#define TRACKBALL_RIGHT_FC 0x2C +#define TRACKBALL_LEFT_FC 0x2D +#define TRACKBALL_TOP_RIGHT_FC 0x2E +#define TRACKBALL_BOTTOM_RIGHT_FC 0x28 +#define TRACKBALL_TOP_LEFT_FC 0x2F +#define TRACKBALL_TOP_BOTTOM_FC 0x29 + +//Joystick +#define JOYSTICK1_FC 0x56 +#define JOYSTICK2_FC 0x57 +#define JOYSTICK3_FC 0x58 +#define JOYSTICK4_FC 0x59 +#define JOYSTICK5_FC 0x5A +#define DEPTH_FC 0x52 +#define FOCUS_FC 0x51 +#define MODE_PW_FC 0x5E +#define MODE_M_FC 0x5F +#define MODE_PD_FC 0x60 +#define MODE_C_FC 0x61 +#define MODE_2D_FC 0x62 + +//Leds +#define DUAL_LED_FC 0X82 +#define QUAD_LED_FC 0X81 +#define SINGLE_LED_FC 0X80 +#define P1_LED_FC 0X86 +#define P2_LED_FC 0X87 +#define P3_LED_FC 0X88 +#define P4_LED_FC 0X89 +#define EXIT_LED_FC 0X71 +#define FREEZE_LED_FC 0X7A +#define POINTER_LED_FC 0X72 +#define AUTOSET_LED_FC 0X79 +#define ABC_LED_FC 0X73 +#define FOUR_D_LED_FC 0X78 +#define CLEAR_LED_FC 0X75 +#define THREE_D_LED_FC 0X77 +#define MEASURE_LED_FC 0X76 +#define BODY_MARK_LED_FC 0X74 +#define POWER_LED_FC 0X66 +#define PATIENT_LED_FC 0X67 +#define UTILS_LED_FC 0X68 +#define DVD_LED_FC 0X69 +#define REPORT_LED_FC 0X6A +#define PROBE_LED_FC 0X6B +#define ARCHIVE_LED_FC 0X6C +#define END_LED_FC 0X6D +#define XTD_LED_FC 0X7B +#define BF_LED_FC 0X7C +#define P5_LED_FC 0X8A +#define P6_LED_FC 0X8B + +#define MODE_PW_LED_FC 0X98 +#define MODE_2D_LED_FC 0X9A +#define MODE_M_LED_FC 0X9C +#define MODE_C_LED_FC 0X9E +#define MODE_PD_LED_FC 0X9F +#define QUADRAT_LED_FC 0X9D +#define X_LED_FC 0X9B +#define Y_LED_FC 0X99 +#define Z_LED_FC 0X97 + +#define ZOOM_LED_FC 0X8F +#define DEPTH_LED_FC 0X90 +#define ANGLE_LED_FC 0X91 +#define FOCUS_ZONE_LED_FC 0X92 +#define FOCUS_DEPTH_LED_FC 0X93 + +#endif //FUNCTIONCODES_H diff --git a/logic/include/model/Led.h b/logic/include/model/Led.h index db0b6b6..a7942be 100644 --- a/logic/include/model/Led.h +++ b/logic/include/model/Led.h @@ -5,20 +5,19 @@ class Led : public QObject { - Q_OBJECT + Q_OBJECT + private: - char _functionCode; - bool _hasLed; + char _functionCode; + bool _hasLed; public: - Led(); - Led(char functionCode); - void newData(QByteArray data); + Led(); + Led(char functionCode); + void newData(QByteArray data); signals: - void ledChanged(char value); - - + void ledChanged(char value); }; -#endif // LED_H +#endif //LED_H diff --git a/logic/include/model/PushButton.h b/logic/include/model/PushButton.h new file mode 100644 index 0000000..81e9e61 --- /dev/null +++ b/logic/include/model/PushButton.h @@ -0,0 +1,22 @@ +#ifndef PUSHBUTTON_H +#define PUSHBUTTON_H + +#include "Led.h" + +class PushButton +{ +private: + char _functionCode; + Led _led; + + QByteArray generateCode(bool isPressed); + +public: + PushButton(char functionCode); + PushButton(char functionCode, char ledFunctionCode); + QByteArray press(); + QByteArray release(); + Led* getLed(); +}; + +#endif //PUSHBUTTON_H diff --git a/logic/include/model/Pushbutton.h b/logic/include/model/Pushbutton.h deleted file mode 100644 index 76499e9..0000000 --- a/logic/include/model/Pushbutton.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef PUSHBUTTON_H -#define PUSHBUTTON_H - -#include "Led.h" - -class PushButton -{ -private: - char _functionCode; - Led _led ; - -public: - PushButton(char functionCode); - PushButton(char functionCode, char ledFunctionCode); - QByteArray press(); - QByteArray release(); - Led* getLed(); -}; - -#endif // PUSHBUTTON_H diff --git a/logic/include/model/RotayButton.h b/logic/include/model/RotayButton.h index b6a3d41..540ae20 100644 --- a/logic/include/model/RotayButton.h +++ b/logic/include/model/RotayButton.h @@ -6,14 +6,14 @@ class RotayButton { private: - char _functionCode; - Led _led; -public: + char _functionCode; + Led _led; - RotayButton(char functionCode); - RotayButton(char functionCode, char ledFunctionCode); - Led* getLed(); - QByteArray rotate(int value); +public: + RotayButton(char functionCode); + RotayButton(char functionCode, char ledFunctionCode); + Led* getLed(); + QByteArray rotate(int value); }; -#endif // ROTAYBUTTON_H +#endif //ROTAYBUTTON_H diff --git a/logic/src/model/Console.cpp b/logic/src/model/Console.cpp index 5fe664a..5c4756b 100644 --- a/logic/src/model/Console.cpp +++ b/logic/src/model/Console.cpp @@ -1,58 +1,13 @@ #include "model/Console.h" -#include +#include "model/DataSender.h" -Console::Console() : - _dual(0x1D, static_cast(0x82)), - _quad(0x1C, static_cast(0x81)) - - -{ - -} - -//******************************************************************************** -void Console::injectDataSender(DataSender *sender) +Console::Console() { - _dataSender = sender; } -//******************************************************************************** -void Console::test() +/*************************************************************************************************/ +void Console::injectDataSender(DataSender* sender) { - QByteArray arr; - arr.append(0x01); - arr.append(0x03); - arr.append(0x05); - _dataSender->send(arr); + _dataSender = sender; } - -//******************************************************************************** -void Console::pressDual() -{ - auto arr = _dual.press(); - _dataSender->send(arr); -} - -//******************************************************************************** -void Console::releaseDual() -{ - auto arr = _dual.release(); - _dataSender->send(arr); -} - -//******************************************************************************** -void Console::pressQuad() -{ - auto arr = _quad.press(); - _dataSender->send(arr); -} - -//******************************************************************************** -void Console::releaseQuad() -{ - auto arr = _quad.release(); - _dataSender->send(arr); -} - -//******************************************************************************** diff --git a/logic/src/model/Led.cpp b/logic/src/model/Led.cpp index 0c4e2c1..06d55b3 100644 --- a/logic/src/model/Led.cpp +++ b/logic/src/model/Led.cpp @@ -1,16 +1,13 @@ -#include "../../include/model/Led.h" - +#include "model/Led.h" Led::Led() { - _hasLed = false; + _hasLed = false; } -//******************************************************************************** +/*************************************************************************************************/ Led::Led(char functionCode) { - _functionCode = functionCode; - _hasLed = true; + _functionCode = functionCode; + _hasLed = true; } - -//******************************************************************************** diff --git a/logic/src/model/PushButton.cpp b/logic/src/model/PushButton.cpp new file mode 100644 index 0000000..3523bf7 --- /dev/null +++ b/logic/src/model/PushButton.cpp @@ -0,0 +1,52 @@ +#include "model/PushButton.h" + +/*************************************************************************************************/ +QByteArray PushButton::generateCode(bool isPressed) +{ + QByteArray arr; + + arr.resize(8); + arr[0] = 0x00; + arr[1] = 0x01; + arr[2] = 0x04; + arr[3] = _functionCode; + arr[4] = isPressed ? 0x01 : 0x00; + arr[5] = 0x00; + arr[6] = 0x00; + arr[7] = 0x00; + + return arr; +} + +/*************************************************************************************************/ +PushButton::PushButton(char functionCode) +{ + _functionCode = functionCode; +} + +/*************************************************************************************************/ +PushButton::PushButton(char functionCode, char ledFunctionCode) : + _led(ledFunctionCode) +{ + _functionCode = functionCode; +} + +/*************************************************************************************************/ +QByteArray PushButton::press() +{ + return generateCode(true); +} + +/*************************************************************************************************/ + +QByteArray PushButton::release() +{ + return generateCode(false); +} + +/*************************************************************************************************/ +Led* PushButton::getLed() + +{ + return &_led; +} diff --git a/logic/src/model/Pushbutton.cpp b/logic/src/model/Pushbutton.cpp deleted file mode 100644 index e988aef..0000000 --- a/logic/src/model/Pushbutton.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "../../include/model/Pushbutton.h" - -//******************************************************************************** -PushButton::PushButton(char functionCode) -{ - _functionCode = functionCode; -} - -//******************************************************************************** -PushButton::PushButton(char functionCode, char ledFunctionCode) : - _led(ledFunctionCode) -{ - _functionCode = functionCode; -} - -//******************************************************************************** -QByteArray PushButton::press() -{ - QByteArray arr; - - arr.resize(8); - arr[0] = 0x00; - arr[1] = 0x01; - arr[2] = 0x04; - arr[3] = _functionCode; - arr[4] = 0x01; - arr[5] = 0x00; - arr[6] = 0x00; - arr[7] = 0x00; - return arr; -} - -//******************************************************************************** - -QByteArray PushButton::release() -{ - QByteArray arr; - - arr.resize(8); - arr[0] = 0x00; - arr[1] = 0x01; - arr[2] = 0x04; - arr[3] = _functionCode; - arr[4] = 0x00; - arr[5] = 0x00; - arr[6] = 0x00; - arr[7] = 0x00; - return arr; -} - -//******************************************************************************** -Led *PushButton::getLed() - -{ - return &_led; -} - -//******************************************************************************** diff --git a/logic/src/model/RotayButton.cpp b/logic/src/model/RotayButton.cpp index fd27468..5bab4fc 100644 --- a/logic/src/model/RotayButton.cpp +++ b/logic/src/model/RotayButton.cpp @@ -1,40 +1,37 @@ -#include "../../include/model/RotayButton.h" - +#include "model/RotayButton.h" RotayButton::RotayButton(char functionCode) { - _functionCode = functionCode; + _functionCode = functionCode; } -//******************************************************************************** -RotayButton::RotayButton(char functionCode, char ledFunctionCode): - _led(ledFunctionCode) +/*************************************************************************************************/ +RotayButton::RotayButton(char functionCode, char ledFunctionCode) : + _led(ledFunctionCode) { - _functionCode = functionCode; - + _functionCode = functionCode; } -//******************************************************************************** -Led *RotayButton::getLed() +/*************************************************************************************************/ +Led* RotayButton::getLed() { - return &_led; + return &_led; } -//******************************************************************************** +/*************************************************************************************************/ QByteArray RotayButton::rotate(int value) { - QByteArray arr; - - arr.resize(8); - arr[0] = 0x00; - arr[1] = 0X02; - arr[2] = 0X05; - arr[3] = _functionCode; - arr[4] = 0x01; - arr[5] = 0x00; - arr[6] = 0x00; - arr[7] = 0x00; - return arr; + QByteArray arr; + + arr.resize(8); + arr[0] = 0x00; + arr[1] = 0X02; + arr[2] = 0X05; + arr[3] = _functionCode; + arr[4] = 0x01; + arr[5] = 0x00; + arr[6] = 0x00; + arr[7] = 0x00; + + return arr; } - -//******************************************************************************** diff --git a/logic/src/viewModel/MainViewModel.cpp b/logic/src/viewModel/MainViewModel.cpp index 52b2300..742e25b 100644 --- a/logic/src/viewModel/MainViewModel.cpp +++ b/logic/src/viewModel/MainViewModel.cpp @@ -5,31 +5,29 @@ #include "model/Console.h" #include "UdpDataSender.h" -MainViewModel::MainViewModel(QObject *parent) : - ViewModel(parent), - _text(QStringLiteral("hello world")) +MainViewModel::MainViewModel(QObject* parent) : + ViewModel(parent), + _text(QStringLiteral("hello world")) { - Console c; - auto u = new UdpDataSender; - c.injectDataSender(u); - c.test(); } QString MainViewModel::text() const { - return _text; + return _text; } void MainViewModel::showSettings() { - show(); + show(); } -void MainViewModel::setText(const QString &text) +void MainViewModel::setText(const QString& text) { - if (_text == text) - return; + if(_text == text) + { + return; + } - _text = text; - emit textChanged(_text); + _text = text; + emit textChanged(_text); } diff --git a/test/tst_console.cpp b/test/tst_console.cpp index 71b7770..4867cb3 100644 --- a/test/tst_console.cpp +++ b/test/tst_console.cpp @@ -5,133 +5,115 @@ class ConsoleTest : public QObject { - Q_OBJECT + Q_OBJECT public: - ConsoleTest(); - ~ConsoleTest(); + ConsoleTest(); + ~ConsoleTest(); +//uncrustify off private slots: - void test_case1(); - void pressDual_test_case(); - void releaseDual_test_case(); - void pressQuad_test_case(); - void releaseQuad_test_case(); - +//uncrustify on + void pressDual_test_case(); + void releaseDual_test_case(); + void pressQuad_test_case(); + void releaseQuad_test_case(); }; -//******************************************************************************** +/*************************************************************************************************/ ConsoleTest::ConsoleTest() { - } -//******************************************************************************** +/*************************************************************************************************/ ConsoleTest::~ConsoleTest() { - } -//******************************************************************************** -void ConsoleTest::test_case1() -{ - Console c; - auto t = new TestDataSender; - c.injectDataSender(t); - c.test(); - - QByteArray arr; - arr.append(0x01); - arr.append(0x04); - arr.append(0x05); - QCOMPARE(t->consoleData, arr); -} - -//******************************************************************************** +/*************************************************************************************************/ void ConsoleTest::pressDual_test_case() { - Console c; - auto t = new TestDataSender; - c.injectDataSender(t); - c.pressDual(); - QByteArray arr; - - arr.resize(8); - arr[0] = 0x00; - arr[1] = 0x01; - arr[2] = 0x04; - arr[3] = 0x1D; - arr[4] = 0x01; - arr[5] = 0x00; - arr[6] = 0x00; - arr[7] = 0x00; - QCOMPARE(t->consoleData, arr); - + Console c; + auto t = new TestDataSender; + c.injectDataSender(t); + c.pressDual(); + QByteArray arr; + + arr.resize(8); + arr[0] = 0x00; + arr[1] = 0x01; + arr[2] = 0x04; + arr[3] = 0x1D; + arr[4] = 0x01; + arr[5] = 0x00; + arr[6] = 0x00; + arr[7] = 0x00; + QCOMPARE(t->consoleData, arr); } -//******************************************************************************** +/*************************************************************************************************/ void ConsoleTest::releaseDual_test_case() { - Console c; - auto t = new TestDataSender; - c.injectDataSender(t); - c.releaseDual(); - QByteArray arr; - - arr.resize(8); - arr[0] = 0x00; - arr[1] = 0x01; - arr[2] = 0x04; - arr[3] = 0x1D; - arr[4] = 0x00; - arr[5] = 0x00; - arr[6] = 0x00; - arr[7] = 0x00; - - QCOMPARE(t->consoleData, arr); + Console c; + auto t = new TestDataSender; + c.injectDataSender(t); + c.releaseDual(); + QByteArray arr; + + arr.resize(8); + arr[0] = 0x00; + arr[1] = 0x01; + arr[2] = 0x04; + arr[3] = 0x1D; + arr[4] = 0x00; + arr[5] = 0x00; + arr[6] = 0x00; + arr[7] = 0x00; + + QCOMPARE(t->consoleData, arr); } -//******************************************************************************** +/*************************************************************************************************/ void ConsoleTest::pressQuad_test_case() { - Console c; - auto t = new TestDataSender; - c.injectDataSender(t); - c.pressQuad(); - QByteArray arr; - - arr.resize(8); - arr[0] = 0x00; - arr[1] = 0x01; - arr[2] = 0x04; - arr[3] = 0x1C; - arr[4] = 0x01; - arr[5] = 0x00; - arr[6] = 0x00; - arr[7] = 0x00; - QCOMPARE(t->consoleData, arr); + Console c; + auto t = new TestDataSender; + c.injectDataSender(t); + c.pressQuad(); + QByteArray arr; + + arr.resize(8); + arr[0] = 0x00; + arr[1] = 0x01; + arr[2] = 0x04; + arr[3] = 0x1C; + arr[4] = 0x01; + arr[5] = 0x00; + arr[6] = 0x00; + arr[7] = 0x00; + QCOMPARE(t->consoleData, arr); } -//******************************************************************************** +/*************************************************************************************************/ void ConsoleTest::releaseQuad_test_case() { - Console c; - auto t = new TestDataSender; - c.injectDataSender(t); - c.releaseQuad(); - QByteArray arr; - - arr.resize(8); - arr[0] = 0x00; - arr[1] = 0x01; - arr[2] = 0x04; - arr[3] = 0x1C; - arr[4] = 0x00; - arr[5] = 0x00; - arr[6] = 0x00; - arr[7] = 0x00; - - QCOMPARE(t->consoleData, arr); + Console c; + auto t = new TestDataSender; + c.injectDataSender(t); + c.releaseQuad(); + QByteArray arr; + + arr.resize(8); + arr[0] = 0x00; + arr[1] = 0x01; + arr[2] = 0x04; + arr[3] = 0x1C; + arr[4] = 0x00; + arr[5] = 0x00; + arr[6] = 0x00; + arr[7] = 0x00; + + QCOMPARE(t->consoleData, arr); } QTEST_APPLESS_MAIN(ConsoleTest)