diff --git a/logic/include/model/Console.h b/logic/include/model/Console.h index f7a112c..e40f7e3 100644 --- a/logic/include/model/Console.h +++ b/logic/include/model/Console.h @@ -8,8 +8,6 @@ #define EchoFunctionCode 0xA4 #define ZeroValue 0x00 - - #include #include "ButtonHelper.h" @@ -22,108 +20,106 @@ class Console : public QObject { - Q_OBJECT - - // PushButton with LED - PUSH_BUTTON(Dual, dual, DUAL_FC, static_cast(DUAL_LED_FC)); - PUSH_BUTTON(Quad, quad, QUAD_FC, static_cast(QUAD_LED_FC)); - PUSH_BUTTON(Single, single, SINGLE_FC, static_cast(SINGLE_LED_FC)); - PUSH_BUTTON(P1, p1, P1_FC, static_cast(P1_LED_FC)); - PUSH_BUTTON(P2, p2, P2_FC, static_cast(P2_LED_FC)); - PUSH_BUTTON(P3, p3, P3_FC, static_cast(P3_LED_FC)); - PUSH_BUTTON(P4, p4, P4_FC, static_cast(P4_LED_FC)); - PUSH_BUTTON(P5, p5, P5_FC, static_cast(P5_LED_FC)); - PUSH_BUTTON(P6, p6, P6_FC, static_cast(P6_LED_FC)); - PUSH_BUTTON(Exit, exit, EXIT_FC, static_cast(EXIT_LED_FC)); - PUSH_BUTTON(Freeze, freeze, FREEZE_FC, static_cast(FREEZE_LED_FC)); - PUSH_BUTTON(Pointer, pointer, POINTER_FC, static_cast(POINTER_LED_FC)); - PUSH_BUTTON(AutoSet, autoSet, AUTOSET_FC, static_cast(AUTOSET_LED_FC)); - PUSH_BUTTON(Abc, abc, ABC_FC, static_cast(ABC_LED_FC)); - PUSH_BUTTON(FourD, fourD, FOUR_D_FC, static_cast(FOUR_D_LED_FC)); - PUSH_BUTTON(Clear, clear, CLEAR_FC, static_cast(CLEAR_LED_FC)); - PUSH_BUTTON(ThreeD, threeD, THREE_D_FC, static_cast(THREE_D_LED_FC)); - PUSH_BUTTON(Measure, measure, MEASURE_FC, static_cast(MEASURE_LED_FC)); - PUSH_BUTTON(BodyMark, bodyMark, BODY_MARK_FC, static_cast(BODY_MARK_LED_FC)); - PUSH_BUTTON(Patient, patient, PATIENT_FC, static_cast(PATIENT_LED_FC)); - PUSH_BUTTON(Utils, utils, UTILS_FC, static_cast(UTILS_LED_FC)); - PUSH_BUTTON(Dvd, dvd, DVD_FC, static_cast(DVD_LED_FC)); - PUSH_BUTTON(Report, report, REPORT_FC, static_cast(REPORT_LED_FC)); - PUSH_BUTTON(Probe, probe, PROBE_FC, static_cast(PROBE_LED_FC)); - PUSH_BUTTON(Archive, archive, ARCHIVE_FC, static_cast(ARCHIVE_LED_FC)); - PUSH_BUTTON(End, end, END_FC, static_cast(END_LED_FC)); - PUSH_BUTTON(Xtd, xtd, XTD_FC, static_cast(XTD_LED_FC)); - PUSH_BUTTON(Bf, bf, BF_FC, static_cast(BF_LED_FC)); - PUSH_BUTTON(DepthCenter, depthCenter, DEPTH_CENTER_FC, static_cast(ZOOM_LED_FC)); - PUSH_BUTTON(FocusCenter, focusCenter, FOCUS_CENTER_FC, static_cast(FOCUS_ZONE_LED_FC)); - PUSH_BUTTON(ModePwCenter, modePwCenter, MODE_PW_CENTER_FC, static_cast(MODE_PW_LED_FC)); - PUSH_BUTTON(ModeMCenter, modeMCenter, MODE_M_CENTER_FC, static_cast(MODE_M_LED_FC)); - PUSH_BUTTON(ModePdCenter, modePdCenter, MODE_PD_CENTER_FC, static_cast(MODE_PD_LED_FC)); - PUSH_BUTTON(ModeCCenter, modeCCenter, MODE_C_CENTER_FC, static_cast(MODE_C_LED_FC)); - PUSH_BUTTON(ModeBCenter, modeBCenter, MODE_2D_CENTER_FC, static_cast(MODE_2D_LED_FC)); - PUSH_BUTTON(DepthBottom, depthBottom, DEPTH_BOTTOM_FC, static_cast(DEPTH_LED_FC)); - PUSH_BUTTON(FocusBottom, focusBottom, FOCUS_BOTTOM_FC, static_cast(FOCUS_DEPTH_LED_FC)); - - // PushButton with No LED - PUSH_BUTTON_NO_LED(Js1Top, js1Top, JOYSTICK1_TOP_FC); - PUSH_BUTTON_NO_LED(Js2Top, js2Top, JOYSTICK2_TOP_FC); - PUSH_BUTTON_NO_LED(Js3Top, js3Top, JOYSTICK3_TOP_FC); - PUSH_BUTTON_NO_LED( Js4Top, Js4Top, JOYSTICK4_TOP_FC); - PUSH_BUTTON_NO_LED(Js5Top, js5Top, JOYSTICK5_TOP_FC); - PUSH_BUTTON_NO_LED(DepthTop, depthTop, DEPTHTOP_FC); - PUSH_BUTTON_NO_LED(FocusTop, focusTop, FOCUSTOP_FC); - PUSH_BUTTON_NO_LED(Js1Center, js1Center, JOYSTICK1_CENTER_FC); - PUSH_BUTTON_NO_LED(Js2Center, js2Center, JOYSTICK2_CENTER_FC); - PUSH_BUTTON_NO_LED(Js3Center, js3Center, JOYSTICK3_CENTER_FC); - PUSH_BUTTON_NO_LED(Js4Center, js4Center, JOYSTICK4_CENTER_FC); - PUSH_BUTTON_NO_LED(Js5Center, js5Center, JOYSTICK5_CENTER_FC); - PUSH_BUTTON_NO_LED(Js1Bottom, js1Bottom, JOYSTICK1_BOTTOM_FC); - PUSH_BUTTON_NO_LED(Js2Bottom, js2Bottom, JOYSTICK2_BOTTOM_FC); - PUSH_BUTTON_NO_LED(Js3Bottom, js3Bottom, JOYSTICK3_BOTTOM_FC); - PUSH_BUTTON_NO_LED(Js4Bottom, js4Bottom, JOYSTICK4_BOTTOM_FC); - PUSH_BUTTON_NO_LED(Js5Bottom, js5Bottom, JOYSTICK5_BOTTOM_FC); - PUSH_BUTTON_NO_LED(TrackballTop, trackballTop, TRACKBALL_TOP_FC); - PUSH_BUTTON_NO_LED(TrackballTopRight, trackballTopRight, TRACKBALL_TOP_RIGHT_FC); - PUSH_BUTTON_NO_LED(TrackballRight, trackballRight, TRACKBALL_RIGHT_FC); - PUSH_BUTTON_NO_LED(TrackballBottomRight, trackballBottomRight, TRACKBALL_BOTTOM_RIGHT_FC); - PUSH_BUTTON_NO_LED(TrackballBottom, trackballBottom, TRACKBALL_BOTTOM_FC); - PUSH_BUTTON_NO_LED(TrackballBottomLeft, trackballBottomLeft, TRACKBALL_TOP_BOTTOM_FC); - PUSH_BUTTON_NO_LED(TrackballLeft, trackballLeft, TRACKBALL_LEFT_FC); - PUSH_BUTTON_NO_LED(TrackballTopLeft, trackballTopLeft, TRACKBALL_TOP_LEFT_FC); - - // ROTAY_BUTTON with LED - ROTARY_BUTTON(Focus, focus, FOCUS_FC, static_cast(ANGLE_LED_FC)); - ROTARY_BUTTON(ModeM, modeM, MODE_M_FC, static_cast(QUADRAT_LED_FC)); - ROTARY_BUTTON(ModePd, modePd, MODE_PD_FC, static_cast(Z_LED_FC)); - ROTARY_BUTTON(ModeC, modeC, MODE_C_FC, static_cast(Y_LED_FC)); - ROTARY_BUTTON(ModeB, modeB, MODE_2D_FC, static_cast(X_LED_FC)); - - // ROTAY_BUTTON with No LED - ROTARY_BUTTON_NO_LED(Js1, js1, JOYSTICK1_FC); - ROTARY_BUTTON_NO_LED(Js2, js2, JOYSTICK2_FC); - ROTARY_BUTTON_NO_LED(Js3, js3, JOYSTICK3_FC); - ROTARY_BUTTON_NO_LED(Js4, js4, JOYSTICK4_FC); - ROTARY_BUTTON_NO_LED(Js5, js5, JOYSTICK5_FC); - ROTARY_BUTTON_NO_LED(Depth, depth, DEPTH_FC); - ROTARY_BUTTON_NO_LED(ModePw, modePw, MODE_PW_FC); - + Q_OBJECT + + //PushButton with LED + PUSH_BUTTON(Dual, dual, DUAL_FC, static_cast(DUAL_LED_FC)); + PUSH_BUTTON(Quad, quad, QUAD_FC, static_cast(QUAD_LED_FC)); + PUSH_BUTTON(Single, single, SINGLE_FC, static_cast(SINGLE_LED_FC)); + PUSH_BUTTON(P1, p1, P1_FC, static_cast(P1_LED_FC)); + PUSH_BUTTON(P2, p2, P2_FC, static_cast(P2_LED_FC)); + PUSH_BUTTON(P3, p3, P3_FC, static_cast(P3_LED_FC)); + PUSH_BUTTON(P4, p4, P4_FC, static_cast(P4_LED_FC)); + PUSH_BUTTON(P5, p5, P5_FC, static_cast(P5_LED_FC)); + PUSH_BUTTON(P6, p6, P6_FC, static_cast(P6_LED_FC)); + PUSH_BUTTON(Exit, exit, EXIT_FC, static_cast(EXIT_LED_FC)); + PUSH_BUTTON(Freeze, freeze, FREEZE_FC, static_cast(FREEZE_LED_FC)); + PUSH_BUTTON(Pointer, pointer, POINTER_FC, static_cast(POINTER_LED_FC)); + PUSH_BUTTON(AutoSet, autoSet, AUTOSET_FC, static_cast(AUTOSET_LED_FC)); + PUSH_BUTTON(Abc, abc, ABC_FC, static_cast(ABC_LED_FC)); + PUSH_BUTTON(FourD, fourD, FOUR_D_FC, static_cast(FOUR_D_LED_FC)); + PUSH_BUTTON(Clear, clear, CLEAR_FC, static_cast(CLEAR_LED_FC)); + PUSH_BUTTON(ThreeD, threeD, THREE_D_FC, static_cast(THREE_D_LED_FC)); + PUSH_BUTTON(Measure, measure, MEASURE_FC, static_cast(MEASURE_LED_FC)); + PUSH_BUTTON(BodyMark, bodyMark, BODY_MARK_FC, static_cast(BODY_MARK_LED_FC)); + PUSH_BUTTON(Patient, patient, PATIENT_FC, static_cast(PATIENT_LED_FC)); + PUSH_BUTTON(Utils, utils, UTILS_FC, static_cast(UTILS_LED_FC)); + PUSH_BUTTON(Dvd, dvd, DVD_FC, static_cast(DVD_LED_FC)); + PUSH_BUTTON(Report, report, REPORT_FC, static_cast(REPORT_LED_FC)); + PUSH_BUTTON(Probe, probe, PROBE_FC, static_cast(PROBE_LED_FC)); + PUSH_BUTTON(Archive, archive, ARCHIVE_FC, static_cast(ARCHIVE_LED_FC)); + PUSH_BUTTON(End, end, END_FC, static_cast(END_LED_FC)); + PUSH_BUTTON(Xtd, xtd, XTD_FC, static_cast(XTD_LED_FC)); + PUSH_BUTTON(Bf, bf, BF_FC, static_cast(BF_LED_FC)); + PUSH_BUTTON(DepthCenter, depthCenter, DEPTH_CENTER_FC, static_cast(ZOOM_LED_FC)); + PUSH_BUTTON(FocusCenter, focusCenter, FOCUS_CENTER_FC, static_cast(FOCUS_ZONE_LED_FC)); + PUSH_BUTTON(ModePwCenter, modePwCenter, MODE_PW_CENTER_FC, static_cast(MODE_PW_LED_FC)); + PUSH_BUTTON(ModeMCenter, modeMCenter, MODE_M_CENTER_FC, static_cast(MODE_M_LED_FC)); + PUSH_BUTTON(ModePdCenter, modePdCenter, MODE_PD_CENTER_FC, static_cast(MODE_PD_LED_FC)); + PUSH_BUTTON(ModeCCenter, modeCCenter, MODE_C_CENTER_FC, static_cast(MODE_C_LED_FC)); + PUSH_BUTTON(ModeBCenter, modeBCenter, MODE_2D_CENTER_FC, static_cast(MODE_2D_LED_FC)); + PUSH_BUTTON(DepthBottom, depthBottom, DEPTH_BOTTOM_FC, static_cast(DEPTH_LED_FC)); + PUSH_BUTTON(FocusBottom, focusBottom, FOCUS_BOTTOM_FC, static_cast(FOCUS_DEPTH_LED_FC)); + + //PushButton with No LED + PUSH_BUTTON_NO_LED(Js1Top, js1Top, JOYSTICK1_TOP_FC); + PUSH_BUTTON_NO_LED(Js2Top, js2Top, JOYSTICK2_TOP_FC); + PUSH_BUTTON_NO_LED(Js3Top, js3Top, JOYSTICK3_TOP_FC); + PUSH_BUTTON_NO_LED(Js4Top, js4Top, JOYSTICK4_TOP_FC); + PUSH_BUTTON_NO_LED(Js5Top, js5Top, JOYSTICK5_TOP_FC); + PUSH_BUTTON_NO_LED(DepthTop, depthTop, DEPTHTOP_FC); + PUSH_BUTTON_NO_LED(FocusTop, focusTop, FOCUSTOP_FC); + PUSH_BUTTON_NO_LED(Js1Center, js1Center, JOYSTICK1_CENTER_FC); + PUSH_BUTTON_NO_LED(Js2Center, js2Center, JOYSTICK2_CENTER_FC); + PUSH_BUTTON_NO_LED(Js3Center, js3Center, JOYSTICK3_CENTER_FC); + PUSH_BUTTON_NO_LED(Js4Center, js4Center, JOYSTICK4_CENTER_FC); + PUSH_BUTTON_NO_LED(Js5Center, js5Center, JOYSTICK5_CENTER_FC); + PUSH_BUTTON_NO_LED(Js1Bottom, js1Bottom, JOYSTICK1_BOTTOM_FC); + PUSH_BUTTON_NO_LED(Js2Bottom, js2Bottom, JOYSTICK2_BOTTOM_FC); + PUSH_BUTTON_NO_LED(Js3Bottom, js3Bottom, JOYSTICK3_BOTTOM_FC); + PUSH_BUTTON_NO_LED(Js4Bottom, js4Bottom, JOYSTICK4_BOTTOM_FC); + PUSH_BUTTON_NO_LED(Js5Bottom, js5Bottom, JOYSTICK5_BOTTOM_FC); + PUSH_BUTTON_NO_LED(TrackballTop, trackballTop, TRACKBALL_TOP_FC); + PUSH_BUTTON_NO_LED(TrackballTopRight, trackballTopRight, TRACKBALL_TOP_RIGHT_FC); + PUSH_BUTTON_NO_LED(TrackballRight, trackballRight, TRACKBALL_RIGHT_FC); + PUSH_BUTTON_NO_LED(TrackballBottomRight, trackballBottomRight, TRACKBALL_BOTTOM_RIGHT_FC); + PUSH_BUTTON_NO_LED(TrackballBottom, trackballBottom, TRACKBALL_BOTTOM_FC); + PUSH_BUTTON_NO_LED(TrackballBottomLeft, trackballBottomLeft, TRACKBALL_TOP_BOTTOM_FC); + PUSH_BUTTON_NO_LED(TrackballLeft, trackballLeft, TRACKBALL_LEFT_FC); + PUSH_BUTTON_NO_LED(TrackballTopLeft, trackballTopLeft, TRACKBALL_TOP_LEFT_FC); + + //ROTAY_BUTTON with LED + ROTARY_BUTTON(Focus, focus, FOCUS_FC, static_cast(ANGLE_LED_FC)); + ROTARY_BUTTON(ModeM, modeM, MODE_M_FC, static_cast(QUADRAT_LED_FC)); + ROTARY_BUTTON(ModePd, modePd, MODE_PD_FC, static_cast(Z_LED_FC)); + ROTARY_BUTTON(ModeC, modeC, MODE_C_FC, static_cast(Y_LED_FC)); + ROTARY_BUTTON(ModeB, modeB, MODE_2D_FC, static_cast(X_LED_FC)); + + //ROTAY_BUTTON with No LED + ROTARY_BUTTON_NO_LED(Js1, js1, JOYSTICK1_FC); + ROTARY_BUTTON_NO_LED(Js2, js2, JOYSTICK2_FC); + ROTARY_BUTTON_NO_LED(Js3, js3, JOYSTICK3_FC); + ROTARY_BUTTON_NO_LED(Js4, js4, JOYSTICK4_FC); + ROTARY_BUTTON_NO_LED(Js5, js5, JOYSTICK5_FC); + ROTARY_BUTTON_NO_LED(Depth, depth, DEPTH_FC); + ROTARY_BUTTON_NO_LED(ModePw, modePw, MODE_PW_FC); private: - DataSender* _dataSender; - Logger* _logger; + DataSender* _dataSender; + Logger* _logger; public: - Console(); + Console(); - void injectDataSender(DataSender* sender); - void injectLogger(Logger* logger); - void newData(QByteArray data); - void hasValidDataFormat(const QByteArray& data); - bool isEchoPacket(const QByteArray& data); - void initializeButtons(); + void injectDataSender(DataSender* sender); + void injectLogger(Logger* logger); + void newData(QByteArray data); + void hasValidDataFormat(const QByteArray& data); + bool isEchoPacket(const QByteArray& data); + void initializeButtons(); signals: - void dataReady(QByteArray data, Logger* log); - + void dataReady(QByteArray data, Logger* log); }; #endif //CONSOLE_H diff --git a/logic/include/viewModel/MainViewModel.h b/logic/include/viewModel/MainViewModel.h index 85566fe..51b24b4 100644 --- a/logic/include/viewModel/MainViewModel.h +++ b/logic/include/viewModel/MainViewModel.h @@ -2,28 +2,184 @@ #define MAINVIEWMODEL_H #include +#include "utils/Property.h" +#include "model/Console.h" + +#define LedOFF 0x00 +#define LedColorWhite 0x01 +#define LedColorGreen 0x02 +#define LedColorYellow 0x03 class MainViewModel : public QtMvvm::ViewModel { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) + Console * panel; -public: - Q_INVOKABLE explicit MainViewModel(QObject *parent = nullptr); + //Top Left + BUTTON_LED_PROPERTY(patient, Patient, false, LedOFF) + BUTTON_LED_PROPERTY(utils, Utils, false, LedColorWhite) + BUTTON_LED_PROPERTY(dvd, Dvd, false, LedColorGreen) + BUTTON_LED_PROPERTY(report, Report, false, LedColorYellow) + BUTTON_LED_PROPERTY(probe, Probe, false, LedColorWhite) + BUTTON_LED_PROPERTY(archive, Archive, false, LedColorGreen) + BUTTON_LED_PROPERTY(end, End, false, LedColorYellow) + + //TopRight + BUTTON_LED_PROPERTY(xtd, Xtd, false, LedColorWhite) + BUTTON_LED_PROPERTY(bf, Bf, false, LedColorWhite) + BUTTON_LED_PROPERTY(p5, P5, false, LedColorWhite) + BUTTON_LED_PROPERTY(p6, P6, false, LedColorWhite) + + //BottomRight + BUTTON_LED_PROPERTY(dual, Dual, false, LedColorWhite) + BUTTON_LED_PROPERTY(quad, Quad, false, LedColorWhite) + BUTTON_LED_PROPERTY(single, Single, false, LedColorWhite) + BUTTON_LED_PROPERTY(p1, P1, false, LedColorWhite) + BUTTON_LED_PROPERTY(p2, P2, false, LedColorWhite) + BUTTON_LED_PROPERTY(p3, P3, false, LedColorWhite) + BUTTON_LED_PROPERTY(p4, P4, false, LedColorWhite) + + //CurveButtons + BUTTON_LED_PROPERTY(exit, Exit, false, LedColorWhite) + BUTTON_LED_PROPERTY(freeze, Freeze, false, LedColorWhite) + BUTTON_LED_PROPERTY(pointer, Pointer, false, LedColorWhite) + BUTTON_LED_PROPERTY(autoSet, AutoSet, false, LedColorWhite) + BUTTON_LED_PROPERTY(abc, Abc, false, LedColorWhite) + BUTTON_LED_PROPERTY(fourD, FourD, false, LedColorWhite) + BUTTON_LED_PROPERTY(clear, Clear, false, LedColorWhite) + BUTTON_LED_PROPERTY(threeD, ThreeD, false, LedColorWhite) + BUTTON_LED_PROPERTY(measure, Measure, false, LedColorWhite) + BUTTON_LED_PROPERTY(bodyMark, BodyMark, false, LedColorWhite) + + //TrackballGroup + BUTTON_LED_PROPERTY(trackballLeft, TrackballLeft, false, LedOFF) + BUTTON_LED_PROPERTY(trackballRight, TrackballRight, false, LedOFF) + BUTTON_LED_PROPERTY(trackballTop, TrackballTop, false, LedOFF) + BUTTON_LED_PROPERTY(trackballBottom, TrackballBottom, false, LedOFF) - QString text() const; + BUTTON_LED_PROPERTY(trackballTopLeft, TrackballTopLeft, false, LedOFF) + BUTTON_LED_PROPERTY(trackballTopRight, TrackballTopRight, false, LedOFF) + BUTTON_LED_PROPERTY(trackballBottomLeft, TrackballBottomLeft, false, LedOFF) + BUTTON_LED_PROPERTY(trackballBottomRight, TrackballBottomRight, false, LedOFF) -public Q_SLOTS: - void showSettings(); + //Encoders + LED_PROPERTY(modeM, LedOFF) //quadrat -> modeMLed + LED_PROPERTY(modePd, LedOFF) //z -> modePdLed + LED_PROPERTY(modeC, LedOFF) //y -> modeCLed + LED_PROPERTY(modeB, LedOFF) //x -> modeBLed - void setText(const QString &text); + LED_PROPERTY(modePwCenter, LedOFF) //modePw -> modePwCenterLed + LED_PROPERTY(modeMCenter, LedOFF) //modeM -> modeMCenterLed + LED_PROPERTY(modePdCenter, LedOFF) //modePd -> modePdCenterLed + LED_PROPERTY(modeCCenter, LedOFF) //modeC -> modeCCenterLed + LED_PROPERTY(modeBCenter, LedOFF) //modeB -> modeBCenterLed -Q_SIGNALS: - void textChanged(const QString &text); + //JoystickCouple + LED_PROPERTY(depthCenter, LedOFF) //zoom -> depthCenterLed + LED_PROPERTY(depthBottom, LedOFF) //depth -> depthBottomLed + LED_PROPERTY(focus, LedOFF) //angle -> focusLed + LED_PROPERTY(focusCenter, LedOFF) //focus zone -> focusCenterLed + LED_PROPERTY(focusBottom, LedOFF) //focus-depth -> focusBottomLed + + //Joysticks + BUTTON_PROPERTY(js1Top, Js1Top, false) + BUTTON_PROPERTY(js2Top, Js2Top, false) + BUTTON_PROPERTY(js3Top, Js3Top, false) + BUTTON_PROPERTY(js4Top, Js4Top, false) + BUTTON_PROPERTY(js5Top, Js5Top, false) + + BUTTON_PROPERTY(js1Center, Js1Center, false) + BUTTON_PROPERTY(js2Center, Js2Center, false) + BUTTON_PROPERTY(js3Center, Js3Center, false) + BUTTON_PROPERTY(js4Center, Js4Center, false) + BUTTON_PROPERTY(js5Center, Js5Center, false) + + BUTTON_PROPERTY(js1Bottom, Js1Bottom, false) + BUTTON_PROPERTY(js2Bottom, Js2Bottom, false) + BUTTON_PROPERTY(js3Bottom, Js3Bottom, false) + BUTTON_PROPERTY(js4Bottom, Js4Bottom, false) + BUTTON_PROPERTY(js5Bottom, Js5Bottom, false) + + //TODO + +public: + Q_INVOKABLE explicit MainViewModel(QObject* parent = nullptr); private: - QString _text; + +signals: + void ledChanged(char value); + +//uncrustify off +public slots: + //Top Left + LED_SLOT(patient) + LED_SLOT(utils) + LED_SLOT(dvd) + LED_SLOT(report) + LED_SLOT(probe) + LED_SLOT(archive) + LED_SLOT(end) + + // TopRight + LED_SLOT(xtd) + LED_SLOT(bf) + LED_SLOT(p5) + LED_SLOT(p6) + + // BottomRight + LED_SLOT(dual) + LED_SLOT(quad) + LED_SLOT(single) + LED_SLOT(p1) + LED_SLOT(p2) + LED_SLOT(p3) + LED_SLOT(p4) + + // CurveButtons + LED_SLOT(exit) + LED_SLOT(freeze) + LED_SLOT(pointer) + LED_SLOT(autoSet) + LED_SLOT(abc) + LED_SLOT(fourD) + LED_SLOT(clear) + LED_SLOT(threeD) + LED_SLOT(measure) + LED_SLOT(bodyMark) + + //TrackballGroup + LED_SLOT(trackballLeft) + LED_SLOT(trackballRight) + LED_SLOT(trackballTop) + LED_SLOT(trackballBottom) + + LED_SLOT(trackballTopLeft) + LED_SLOT(trackballTopRight) + LED_SLOT(trackballBottomLeft) + LED_SLOT(trackballBottomRight) + + //Encoders + LED_SLOT(modeM) + LED_SLOT(modePd) + LED_SLOT(modeC) + LED_SLOT(modeB) + + LED_SLOT(modePwCenter) + LED_SLOT(modeMCenter) + LED_SLOT(modePdCenter) + LED_SLOT(modeCCenter) + LED_SLOT(modeBCenter) + + //JoystickCouple + LED_SLOT(focus) + LED_SLOT(depthCenter) + LED_SLOT(focusCenter) + LED_SLOT(depthBottom) + LED_SLOT(focusBottom) + +//uncrustify on }; -#endif // MAINVIEWMODEL_H +#endif //MAINVIEWMODEL_H diff --git a/logic/include/viewModel/utils/Property.h b/logic/include/viewModel/utils/Property.h index 82171ee..47ddf43 100644 --- a/logic/include/viewModel/utils/Property.h +++ b/logic/include/viewModel/utils/Property.h @@ -1,4 +1,67 @@ #ifndef PROPERTY_H #define PROPERTY_H -#endif // PROPERTY_H +#include +#include + +//uncrustify off +#define MVVM_PROPERTY(TYPE, NAME, DEFAULT_VALUE) \ + Q_PROPERTY(TYPE NAME READ NAME WRITE NAME NOTIFY NAME ## Changed ) \ + public: \ + TYPE NAME() const { return _ ## NAME ; } \ + void NAME(TYPE value) { \ + if (_ ## NAME == value) return; \ + _ ## NAME = value; \ + emit NAME ## Changed(value); \ + qDebug() << #NAME << value; \ + } \ + Q_SIGNAL void NAME ## Changed(TYPE value);\ + private: \ + TYPE _ ## NAME = DEFAULT_VALUE; \ + +/**************************************************************************************************/ +#define MVVM_PROPERTY_CUSTOM(TYPE, NAME, DEFAULT_VALUE) \ + Q_PROPERTY(TYPE NAME READ NAME WRITE NAME NOTIFY NAME ## Changed ) \ + public: \ + TYPE NAME() const { return _ ## NAME ; } \ + void NAME(TYPE value) { \ + if (_ ## NAME == value) return; \ + _ ## NAME = value; \ + emit NAME ## Changed(value); \ + NAME ## Handle(); \ + qDebug() << #NAME << value; \ + } \ + Q_SIGNAL void NAME ## Changed(TYPE value);\ + private: \ + TYPE _ ## NAME = DEFAULT_VALUE; \ + +/**************************************************************************************************/ +#define BUTTON_LED_PROPERTY(NAME, CAP_NAME, DEFAULT_VALUE, LED_DEF_VAL) \ + LED_PROPERTY(NAME, LED_DEF_VAL) \ + BUTTON_PROPERTY(NAME, CAP_NAME, DEFAULT_VALUE) + +/**************************************************************************************************/ +#define BUTTON_PROPERTY(NAME, CAP_NAME, DEFAULT_VALUE) \ + MVVM_PROPERTY_CUSTOM(bool, NAME, DEFAULT_VALUE) \ + void NAME ## Handle() { \ + if(_ ## NAME){ \ + panel->press ## CAP_NAME(); \ + } \ + else { \ + panel->release ## CAP_NAME(); \ + } \ + } \ + +/**************************************************************************************************/ +#define LED_PROPERTY(NAME, LED_DEF_VAL) \ + MVVM_PROPERTY(int, NAME ## Led, LED_DEF_VAL) \ + +/**************************************************************************************************/ +#define LED_SLOT(NAME) \ + void NAME ## LedHandle(char value) { \ + NAME ## Led(static_cast(value)); \ + } \ + +//uncrustify on + +#endif //PROPERTY_H diff --git a/logic/src/viewModel/MainViewModel.cpp b/logic/src/viewModel/MainViewModel.cpp index 742e25b..5df770d 100644 --- a/logic/src/viewModel/MainViewModel.cpp +++ b/logic/src/viewModel/MainViewModel.cpp @@ -5,29 +5,90 @@ #include "model/Console.h" #include "UdpDataSender.h" +#define CONNECT_LED(NAME) \ + connect(panel, SIGNAL(NAME ## LedChanged(char)), this, SLOT(NAME ## LedHandle(char))); + MainViewModel::MainViewModel(QObject* parent) : - ViewModel(parent), - _text(QStringLiteral("hello world")) + ViewModel(parent) { -} + panel = new Console; -QString MainViewModel::text() const -{ - return _text; -} + //Top Left + CONNECT_LED(patient) + CONNECT_LED(utils) + CONNECT_LED(dvd) + CONNECT_LED(report) + CONNECT_LED(probe) + CONNECT_LED(archive) + CONNECT_LED(end) -void MainViewModel::showSettings() -{ - show(); -} + //TopRight + CONNECT_LED(xtd) + CONNECT_LED(bf) + CONNECT_LED(p5) + CONNECT_LED(p6) -void MainViewModel::setText(const QString& text) -{ - if(_text == text) - { - return; - } + //BottomRight + CONNECT_LED(dual) + CONNECT_LED(quad) + CONNECT_LED(single) + CONNECT_LED(p1) + CONNECT_LED(p2) + CONNECT_LED(p3) + CONNECT_LED(p4) + + //CurveButtons + CONNECT_LED(exit) + CONNECT_LED(freeze) + CONNECT_LED(pointer) + CONNECT_LED(autoSet) + CONNECT_LED(abc) + CONNECT_LED(fourD) + CONNECT_LED(clear) + CONNECT_LED(threeD) + CONNECT_LED(measure) + CONNECT_LED(bodyMark) + + //TrackballGroup + CONNECT_LED(trackballLeft) + CONNECT_LED(trackballRight) + CONNECT_LED(trackballTop) + CONNECT_LED(trackballBottom) + + CONNECT_LED(trackballTopLeft) + CONNECT_LED(trackballTopRight) + CONNECT_LED(trackballBottomLeft) + CONNECT_LED(trackballBottomRight) + + //Encoders + CONNECT_LED(modeM) + CONNECT_LED(modePd) + CONNECT_LED(modeC) + CONNECT_LED(modeB) + + CONNECT_LED(modePwCenter) + CONNECT_LED(modeMCenter) + CONNECT_LED(modePdCenter) + CONNECT_LED(modeCCenter) + CONNECT_LED(modeBCenter) + + //JoystickCouple + CONNECT_LED(focus) + CONNECT_LED(depthCenter) + CONNECT_LED(focusCenter) + CONNECT_LED(depthBottom) + CONNECT_LED(focusBottom) + + //Turn some LEDs on + panel->depthCenterLedChanged(0); + panel->depthBottomLedChanged(1); + panel->focusLedChanged(1); + panel->focusCenterLedChanged(2); + panel->focusBottomLedChanged(3); - _text = text; - emit textChanged(_text); + panel->modePwCenterLedChanged(1); + panel->modePdCenterLedChanged(1); + panel->modeCCenterLedChanged(1); + panel->modeMCenterLedChanged(1); + panel->modeBCenterLedChanged(2); } diff --git a/ui/App.qml b/ui/App.qml old mode 100644 new mode 100755 index ac61da9..e75023b --- a/ui/App.qml +++ b/ui/App.qml @@ -1,6 +1,20 @@ import QtQuick 2.10 +import QtQuick.Window 2.13 import de.skycoder42.QtMvvm.Quick 1.0 +import "qrc:/const/" +import "qrc:/theme/" QtMvvmApp { title: qsTr("consoleEmulator") + id: mvvmApp + + onWidthChanged: Const.widthRatio = mvvmApp.width / Const.windowWidth + onHeightChanged: Const.heightRatio = mvvmApp.height / Const.windowHeight + + Component.onCompleted: { + width = Const.windowWidth + height = Const.windowHeight + x = (Screen.width - width) / 2 + y = (Screen.height - height) + } } diff --git a/ui/MainView.qml b/ui/MainView.qml old mode 100644 new mode 100755 index 9299e7c..fd5af8d --- a/ui/MainView.qml +++ b/ui/MainView.qml @@ -1,70 +1,32 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 +import QtQuick.Window 2.13 import QtQuick.Layouts 1.3 import de.skycoder42.QtMvvm.Core 1.0 import de.skycoder42.QtMvvm.Quick 1.0 import com.example.consoleemulator 1.0 +import "qrc:/emulator/" +import "qrc:/theme/" +import "qrc:/const/" Page { id: mainView property MainViewModel viewModel: null - header: ContrastToolBar { - RowLayout { - anchors.fill: parent - spacing: 0 - - ToolBarLabel { - text: qsTr("MainViewModel") - Layout.fillWidth: true - } - - MenuButton { - MenuItem { - id: settings - text: qsTr("Settings") - onClicked: viewModel.showSettings() - } - } - } - } - - PresenterProgress {} - - Pane { + Rectangle{ anchors.fill: parent + color: Theme.current.background + } - ColumnLayout { - anchors.fill: parent - - TextField { - id: textEdit - Layout.fillWidth: true - - MvvmBinding { - viewModel: mainView.viewModel - viewModelProperty: "text" - view: textEdit - viewProperty: "text" - } - } - - Label { - id: textLabel - Layout.fillWidth: true - - MvvmBinding { - viewModel: mainView.viewModel - viewModelProperty: "text" - view: textLabel - viewProperty: "text" - type: MvvmBinding.OneWayToView - } - } + Rectangle { + id: correctedPosition + width: Const.windowWidth + height: Const.windowHeight + scale: Const.ratio + color: Theme.current.background + x: (mainView.width - width) / 2 + y: (mainView.height - height) / 2 - Item { - Layout.fillHeight: true - } - } + Emulator {} } } diff --git a/ui/emulator/components/Trackball.qml b/ui/emulator/components/Trackball.qml index f160d24..8add1d9 100644 --- a/ui/emulator/components/Trackball.qml +++ b/ui/emulator/components/Trackball.qml @@ -7,102 +7,110 @@ import "qrc:/const" Item { id: control - property var longBut: Const.macroButton - property var shortBut: Const.microButton - -// property alias increase: incButton.down -// property alias decrease: decButton.down - -// LightRing { -// id: lightRing -// colorMode: parent.led -// anchors.verticalCenter: mainKnob.verticalCenter -// anchors.horizontalCenter: mainKnob.horizontalCenter -// width: Const.macroButton + 2 * thickness -// } - -// ModeBg { -// additionalLength: 3 * shortBut -// anchors.centerIn: parent -// } - -// ModeBg { -// additionalLength: - shortBut -// anchors.centerIn: parent -// } - - width: Const.macroButton + Const.microButton + 2 * Const.margin + property var longBut: 70 //Const.macroButton + property var shortBut: 32 //Const.microButton + property var margin: 10 //Const.margin + + property alias leftDown: leftBut.down + property alias rightDown: rightBut.down + property alias topDown: topBut.down + property alias bottomDown: bottomBut.down + + property alias topLeftDown: topLeftBut.down + property alias topRightDown: topRightBut.down + property alias bottomLeftDown: bottomLeftBut.down + property alias bottomRightDown: bottomRightBut.down + + property var leftColor + property var rightColor + property var topColor + property var bottomColor + + property var topLeftColor + property var topRightColor + property var bottomLeftColor + property var bottomRightColor + + width: longBut + shortBut + 2 * margin height: width LightRing { colorMode: 0 anchors.centerIn: parent - width: Const.macroButton + Const.microButton + 2 * Const.margin + 3 * shortBut + width: longBut + shortBut + 2 * margin + 115 height: width - thickness: 60 + thickness: 70 } - Knob { + NeuLight { id: leftBut anchors.right: parent.left anchors.verticalCenter: parent.verticalCenter implicitWidth: shortBut implicitHeight: longBut + colorMode: leftColor } - Knob { + NeuLight { id: rightBut anchors.left: parent.right anchors.verticalCenter: parent.verticalCenter implicitWidth: shortBut implicitHeight: longBut + colorMode: rightColor } - Knob { + NeuLight { id: topBut anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.top implicitWidth: longBut implicitHeight: shortBut + colorMode: topColor } - Knob { + NeuLight { id: bottomBut anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.bottom implicitWidth: longBut implicitHeight: shortBut + colorMode: bottomColor } - Knob { + NeuLight { id: topLeftBut anchors.verticalCenter: parent.top anchors.horizontalCenter: parent.left implicitWidth: shortBut implicitHeight: shortBut + colorMode: topLeftColor } - Knob { + NeuLight { id: topRightBut anchors.verticalCenter: parent.top anchors.horizontalCenter: parent.right implicitWidth: shortBut implicitHeight: shortBut + colorMode: topRightColor } - Knob { + NeuLight { id: bottomLeftBut anchors.verticalCenter: parent.bottom anchors.horizontalCenter: parent.left implicitWidth: shortBut implicitHeight: shortBut + colorMode: bottomLeftColor } - Knob { + NeuLight { id: bottomRightBut anchors.verticalCenter: parent.bottom anchors.horizontalCenter: parent.right implicitWidth: shortBut implicitHeight: shortBut + colorMode: bottomRightColor } } diff --git a/ui/emulator/elements/LightImageBind.qml b/ui/emulator/elements/LightImageBind.qml index c081c44..b3fefb5 100644 --- a/ui/emulator/elements/LightImageBind.qml +++ b/ui/emulator/elements/LightImageBind.qml @@ -9,5 +9,11 @@ import "qrc:/const" import "qrc:/emulator/components" LightImage { - property var name + property var nameLed + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "colorMode" + viewModelProperty: nameLed + } } diff --git a/ui/emulator/elements/ModeButtonBind.qml b/ui/emulator/elements/ModeButtonBind.qml index 50a4bb7..3d9e64f 100644 --- a/ui/emulator/elements/ModeButtonBind.qml +++ b/ui/emulator/elements/ModeButtonBind.qml @@ -9,5 +9,11 @@ import "qrc:/const" import "qrc:/emulator/components" ModeButton { - property var name + property var nameLed + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "led" + viewModelProperty: nameLed + } } diff --git a/ui/emulator/elements/ModeOptionBind.qml b/ui/emulator/elements/ModeOptionBind.qml index 8bfeb7f..77081de 100644 --- a/ui/emulator/elements/ModeOptionBind.qml +++ b/ui/emulator/elements/ModeOptionBind.qml @@ -9,5 +9,18 @@ import "qrc:/const" import "qrc:/emulator/components" ModeOption { - property var name + property var nameLed + property var nameLedOption + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "led" + viewModelProperty: nameLed + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "ledOption" + viewModelProperty: nameLedOption + } } diff --git a/ui/emulator/elements/TrackballBind.qml b/ui/emulator/elements/TrackballBind.qml index 252e171..cab847e 100644 --- a/ui/emulator/elements/TrackballBind.qml +++ b/ui/emulator/elements/TrackballBind.qml @@ -1,7 +1,127 @@ import QtQuick 2.0 +import de.skycoder42.QtMvvm.Core 1.0 +import de.skycoder42.QtMvvm.Quick 1.0 +import com.example.consoleemulator 1.0 + import "qrc:/emulator/components" Trackball { + property bool leftPressed: leftDown + property bool rightPressed: rightDown + property bool topPressed: topDown + property bool bottomPressed: bottomDown + + property bool topLeftPressed: topLeftDown + property bool topRightPressed: topRightDown + property bool bottomLeftPressed: bottomLeftDown + property bool bottomRightPressed: bottomRightDown + + onLeftDownChanged: leftPressed = leftDown + onRightDownChanged: rightPressed = rightDown + onTopDownChanged: topPressed = topDown + onBottomDownChanged: bottomPressed = bottomDown + + onTopLeftDownChanged: topLeftPressed = topLeftDown + onTopRightDownChanged: topRightPressed = topRightDown + onBottomLeftDownChanged: bottomLeftPressed = bottomLeftDown + onBottomRightDownChanged: bottomRightPressed = bottomRightDown + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "leftPressed" + viewModelProperty: "trackballLeft" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "rightPressed" + viewModelProperty: "trackballRight" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "topPressed" + viewModelProperty: "trackballTop" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "bottomPressed" + viewModelProperty: "trackballBottom" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "topLeftPressed" + viewModelProperty: "trackballTopLeft" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "topRightPressed" + viewModelProperty: "trackballTopRight" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "bottomLeftPressed" + viewModelProperty: "trackballBottomLeft" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "bottomRightPressed" + viewModelProperty: "trackballBottomRight" + } + + // Leds + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "leftColor" + viewModelProperty: "trackballLeft" + "Led" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "rightColor" + viewModelProperty: "trackballRight" + "Led" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "topColor" + viewModelProperty: "trackballTop" + "Led" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "bottomColor" + viewModelProperty: "trackballBottom" + "Led" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "topLeftColor" + viewModelProperty: "trackballTopLeft" + "Led" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "topRightColor" + viewModelProperty: "trackballTopRight" + "Led" + } + + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "bottomLeftColor" + viewModelProperty: "trackballBottomLeft" + "Led" + } + MvvmBinding { + viewModel: mainView.viewModel + viewProperty: "bottomRightColor" + viewModelProperty: "trackballBottomRight" + "Led" + } } diff --git a/ui/emulator/items/Encoders.qml b/ui/emulator/items/Encoders.qml index fe59512..f90bae3 100755 --- a/ui/emulator/items/Encoders.qml +++ b/ui/emulator/items/Encoders.qml @@ -17,37 +17,38 @@ Item { spacing: 40 ModeOptionBind { y: 130 - name: "modePw" - imageOption: "qrc:/icons/encoder/x.png" + nameLed: "modePwCenterLed" + nameLedOption: "modeBLed" // x name image: "qrc:/icons/encoder/modePw.png" + imageOption: "qrc:/icons/encoder/x.png" } ModeOptionBind { y: 41 - name: "modeM" - // tinyName: "y" - imageOption: "qrc:/icons/encoder/y.png" + nameLed: "modeMCenterLed" + nameLedOption: "modeCLed" // y name image: "qrc:/icons/encoder/modeM.png" + imageOption: "qrc:/icons/encoder/y.png" } ModeOptionBind { - name: "modePd" - // tinyName: "z" + nameLed: "modePdCenterLed" + nameLedOption: "modePdLed" // z name imageOption: "qrc:/icons/encoder/z.png" image: "qrc:/icons/encoder/modePd.png" } ModeOptionBind { y: 41 - name: "modeC" - // tinyName: "quadrat" + nameLed: "modeCCenterLed" + nameLedOption: "modeMLed" // quadrat name imageOption: "qrc:/icons/encoder/quadratic.png" image: "qrc:/icons/encoder/modeC.png" } ModeButtonBind { y: 130 - name: "mode2D" + nameLed: "modeBCenterLed" image: "qrc:/icons/encoder/mode2d.png" led: 2 } diff --git a/ui/emulator/items/JoystickCouple.qml b/ui/emulator/items/JoystickCouple.qml index 00e1ea2..87d83eb 100644 --- a/ui/emulator/items/JoystickCouple.qml +++ b/ui/emulator/items/JoystickCouple.qml @@ -19,14 +19,13 @@ Item { anchors.horizontalCenter: leftJoy.horizontalCenter LightImageBind { - name: "zoom" + nameLed: "depthCenterLed" image: "qrc:/icons/miniButton/zoom.png" } LightImageBind { - name: "depth" + nameLed: "depthBottomLed" image: "qrc:/icons/miniButton/depth.png" - colorMode: 2 } } @@ -43,21 +42,18 @@ Item { anchors.horizontalCenter: rightJoy.horizontalCenter LightImageBind { - name: "angle" + nameLed: "focusLed" image: "qrc:/icons/miniButton/angle.png" - colorMode: 1 } LightImageBind { - name: "focusZone" + nameLed: "focusCenterLed" image: "qrc:/icons/miniButton/focusZone.png" - colorMode: 2 } LightImageBind { - name: "focusDepth" + nameLed: "focusBottomLed" image: "qrc:/icons/miniButton/focusDepth.png" - colorMode: 3 } } } diff --git a/ui/emulator/items/MiniButtons.qml b/ui/emulator/items/MiniButtons.qml deleted file mode 100755 index a31e893..0000000 --- a/ui/emulator/items/MiniButtons.qml +++ /dev/null @@ -1,44 +0,0 @@ -import QtQuick 2.0 -import "qrc:/console/elements" -import "qrc:/ui" - -Item { - width: 290 * UI.ratio - height: 46 * UI.ratio - x: 1590 * UI.ratio - y: 510 * UI.ratio - - Row { - spacing: 10 * UI.ratio - - MiniButton { - name: "zoom" - image: "qrc:/ui/Images/miniButton/zoom.png" - } - - MiniButton { - name: "depth" - image: "qrc:/ui/Images/miniButton/depth.png" - } - - Item { - width: 10 * UI.ratio - height: 46 * UI.ratio - } - - MiniButton { - name: "angle" - image: "qrc:/ui/Images/miniButton/angle.png" - } - - MiniButton { - name: "focusZone" - image: "qrc:/ui/Images/miniButton/focusZone.png" - } - - MiniButton { - name: "focusDepth" - image: "qrc:/ui/Images/miniButton/focusDepth.png" - } - } -} diff --git a/ui/emulator/items/TrackballGroup.qml b/ui/emulator/items/TrackballGroup.qml index e1bd2a7..5694ba5 100644 --- a/ui/emulator/items/TrackballGroup.qml +++ b/ui/emulator/items/TrackballGroup.qml @@ -4,7 +4,5 @@ import "qrc:/emulator/elements" TrackballBind { anchors.horizontalCenter: parent.horizontalCenter - y: 650 - - + y: 620 } diff --git a/ui/theme/Palette.qml b/ui/theme/Palette.qml index 8ce5207..7ad75b5 100755 --- a/ui/theme/Palette.qml +++ b/ui/theme/Palette.qml @@ -13,8 +13,8 @@ QtObject { property color shadow: isDarkTheme ? "#C0000000" : "#95A4B9" property color lightShadow: isDarkTheme ? "#80000000" : "#80C9D1DD" - property color button: isDarkTheme ? "#222222" : "#C6D1E1" - property color buttonSelected: isDarkTheme ? "#202020" : "#AAB7CA" + property color button: isDarkTheme ? "#303032" : "#C6D1E1" + property color buttonSelected: isDarkTheme ? "#242426" : "#AAB7CA" property color text: isDarkTheme ? "#656E85" : "#323B52" property color textSelected: isDarkTheme ? "#656E85" : "#323B52" diff --git a/ui/ui.qrc b/ui/ui.qrc index c4c3f4c..aeaf059 100644 --- a/ui/ui.qrc +++ b/ui/ui.qrc @@ -1,8 +1,100 @@ App.qml + const/Const.qml + const/qmldir + emulator/components/HoverGlow.qml + emulator/components/JoystickButton.qml + emulator/components/Knob.qml + emulator/components/KnobImage.qml + emulator/components/KnobLight.qml + emulator/components/LightImage.qml + emulator/components/LightRing.qml + emulator/components/ModeBg.qml + emulator/components/ModeBgOption.qml + emulator/components/ModeButton.qml + emulator/components/ModeOption.qml + emulator/components/NeuButton.qml + emulator/components/NeuImage.qml + emulator/components/NeuLight.qml + emulator/components/SegmentButton.qml + emulator/components/SegmentCircle.qml + emulator/components/Trackball.qml + emulator/elements/JoystickButtonBind.qml + emulator/elements/KnobLightBind.qml + emulator/elements/LightImageBind.qml + emulator/elements/ModeButtonBind.qml + emulator/elements/ModeOptionBind.qml + emulator/elements/TrackballBind.qml + emulator/items/BottomRight.qml + emulator/items/CurveButtons.qml + emulator/items/Encoders.qml + emulator/items/JoystickCouple.qml + emulator/items/Joysticks.qml + emulator/items/TopLeft.qml + emulator/items/TopRight.qml + emulator/items/Trackball.qml + emulator/items/TrackballGroup.qml + emulator/Emulator.qml + icons/bottomRight/dual.png + icons/bottomRight/p1.png + icons/bottomRight/p2.png + icons/bottomRight/p3.png + icons/bottomRight/p4.png + icons/bottomRight/quad.png + icons/bottomRight/single.png + icons/curveButtons/3d.png + icons/curveButtons/4d.png + icons/curveButtons/abc.png + icons/curveButtons/auto.png + icons/curveButtons/bodyMark.png + icons/curveButtons/clear.png + icons/curveButtons/exit.png + icons/curveButtons/freeze.png + icons/curveButtons/meas.png + icons/curveButtons/pointer.png + icons/encoder/mode2d.png + icons/encoder/modeC.png + icons/encoder/modeM.png + icons/encoder/modePd.png + icons/encoder/modePw.png + icons/encoder/quadratic.png + icons/encoder/x.png + icons/encoder/y.png + icons/encoder/z.png + icons/joystick/TT.svg + icons/miniButton/angle.png + icons/miniButton/depth.png + icons/miniButton/focusDepth.png + icons/miniButton/focusZone.png + icons/miniButton/zoom.png + icons/mode/2d.png + icons/mode/bf.png + icons/mode/c.png + icons/mode/m.png + icons/mode/pd.png + icons/mode/pw.png + icons/topLeft/archive.png + icons/topLeft/dvd.png + icons/topLeft/end.png + icons/topLeft/patient.png + icons/topLeft/power.png + icons/topLeft/probe.png + icons/topLeft/report.png + icons/topLeft/utils.png + icons/topRight/bf.png + icons/topRight/p5.png + icons/topRight/p6.png + icons/topRight/xtd.png + icons/uiMode/dark.svg + icons/uiMode/light.svg + theme/Dark.qml + theme/Light.qml + theme/Palette.qml + theme/qmldir + theme/Theme.qml - + MainView.qml