You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

242 lines
7.4 KiB

#ifndef MAINVIEWMODEL_H
#define MAINVIEWMODEL_H
#include <QtMvvmCore/ViewModel>
#include "utils/Property.h"
#include "model/Console.h"
#include <QList>
#define LED_OFF 0x00
#define LED_COLOR_WHITE 0x01
#define LED_COLOR_GREEN 0x02
#define LedColorYellow 0x03
class MainViewModel : public QtMvvm::ViewModel
{
Q_OBJECT
Console * panel;
MVVM_PROPERTY(int, stepInc, 1)
MVVM_PROPERTY(int, stepDec, -1)
//Slots
DROP_DOWN_PROPERTY(slot1, Slot1, LED_OFF)
DROP_DOWN_PROPERTY(slot2, Slot2, LED_OFF)
DROP_DOWN_PROPERTY(slot3, Slot3, LED_OFF)
DROP_DOWN_PROPERTY(slot4, Slot4, LED_OFF)
//Top Left
BUTTON_LED_PROPERTY(patient, Patient, false, LED_OFF)
BUTTON_LED_PROPERTY(utils, Utils, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(dvd, Dvd, false, LED_COLOR_GREEN)
BUTTON_LED_PROPERTY(report, Report, false, LedColorYellow)
BUTTON_LED_PROPERTY(probe, Probe, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(archive, Archive, false, LED_COLOR_GREEN)
BUTTON_LED_PROPERTY(end, End, false, LedColorYellow)
//TopRight
BUTTON_LED_PROPERTY(xtd, Xtd, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(bf, Bf, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(p5, P5, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(p6, P6, false, LED_COLOR_WHITE)
//BottomRight
BUTTON_LED_PROPERTY(dual, Dual, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(quad, Quad, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(single, Single, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(p1, P1, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(p2, P2, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(p3, P3, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(p4, P4, false, LED_COLOR_WHITE)
//CurveButtons
BUTTON_LED_PROPERTY(exit, Exit, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(freeze, Freeze, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(pointer, Pointer, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(autoSet, AutoSet, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(abc, Abc, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(fourD, FourD, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(clear, Clear, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(threeD, ThreeD, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(measure, Measure, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(bodyMark, BodyMark, false, LED_COLOR_WHITE)
//TrackballGroup
BUTTON_LED_PROPERTY(trackballLeft, TrackballLeft, false, LED_OFF)
BUTTON_LED_PROPERTY(trackballRight, TrackballRight, false, LED_OFF)
BUTTON_LED_PROPERTY(trackballTop, TrackballTop, false, LED_OFF)
BUTTON_LED_PROPERTY(trackballBottom, TrackballBottom, false, LED_OFF)
BUTTON_LED_PROPERTY(trackballTopLeft, TrackballTopLeft, false, LED_OFF)
BUTTON_LED_PROPERTY(trackballTopRight, TrackballTopRight, false, LED_OFF)
BUTTON_LED_PROPERTY(trackballBottomLeft, TrackballBottomLeft, false, LED_OFF)
BUTTON_LED_PROPERTY(trackballBottomRight, TrackballBottomRight, false, LED_OFF)
//Encoders
LED_PROPERTY(modeM, LED_OFF) //quadrat -> modeMLed
LED_PROPERTY(modePd, LED_OFF) //z -> modePdLed
LED_PROPERTY(modeC, LED_OFF) //y -> modeCLed
LED_PROPERTY(modeB, LED_OFF) //x -> modeBLed
LED_PROPERTY(modePwCenter, LED_OFF) //modePw -> modePwCenterLed
LED_PROPERTY(modeMCenter, LED_OFF) //modeM -> modeMCenterLed
LED_PROPERTY(modePdCenter, LED_OFF) //modePd -> modePdCenterLed
LED_PROPERTY(modeCCenter, LED_OFF) //modeC -> modeCCenterLed
LED_PROPERTY(modeBCenter, LED_OFF) //modeB -> modeBCenterLed
BUTTON_PROPERTY(modePwCenter, ModePwCenter, false)
BUTTON_PROPERTY(modeMCenter, ModeMCenter, false)
BUTTON_PROPERTY(modePdCenter, ModePdCenter, false)
BUTTON_PROPERTY(modeCCenter, ModeCCenter, false)
BUTTON_PROPERTY(modeBCenter, ModeBCenter, false)
JOYSTICK_PROPERTY(modePw, ModePw)
JOYSTICK_PROPERTY(modePd, ModePd)
JOYSTICK_PROPERTY(modeC, ModeC)
JOYSTICK_PROPERTY(modeM, ModeM)
JOYSTICK_PROPERTY(modeB, ModeB)
//JoystickCouple
LED_PROPERTY(depthCenter, LED_OFF) //zoom -> depthCenterLed
LED_PROPERTY(depthBottom, LED_OFF) //depth -> depthBottomLed
LED_PROPERTY(focus, LED_OFF) //angle -> focusLed
LED_PROPERTY(focusCenter, LED_OFF) //focusZone -> focusCenterLed
LED_PROPERTY(focusBottom, LED_OFF) //focusDepth -> focusBottomLed
BUTTON_PROPERTY(depthCenter, DepthCenter, false)
BUTTON_PROPERTY(focusCenter, FocusCenter, false)
BUTTON_PROPERTY(depthBottom, DepthBottom, false)
BUTTON_PROPERTY(focusBottom, FocusBottom, false)
BUTTON_PROPERTY(depthTop, DepthTop, false)
BUTTON_PROPERTY(focusTop, FocusTop, false)
JOYSTICK_PROPERTY(depth, Depth)
JOYSTICK_PROPERTY(focus, Focus)
//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)
JOYSTICK_PROPERTY(js1, Js1)
JOYSTICK_PROPERTY(js2, Js2)
JOYSTICK_PROPERTY(js3, Js3)
JOYSTICK_PROPERTY(js4, Js4)
JOYSTICK_PROPERTY(js5, Js5)
//Probes
//BUTTON_LED_PROPERTY(probe1, Probe1, false, LED_OFF)
//BUTTON_LED_PROPERTY(probe2, Probe2, false, LED_OFF)
//BUTTON_LED_PROPERTY(probe3, Probe3, false, LED_OFF)
//BUTTON_LED_PROPERTY(probe4, Probe4, false, LED_OFF)
MVVM_PROPERTY(QList<QVariant>, probeList, QList<QVariant>({"Pouya", "Mamad"}))
MVVM_PROPERTY(int, currentSelectedProbe1, 0)
MVVM_PROPERTY(int, currentSelectedProbe2, 0)
MVVM_PROPERTY(int, currentSelectedProbe3, 0)
MVVM_PROPERTY(int, currentSelectedProbe4, 0)
public:
Q_INVOKABLE explicit MainViewModel(QObject* parent = nullptr);
private:
signals:
void ledChanged(char value);
//uncrustify off
public slots:
//Probes
// LED_SLOT(slot1)
// LED_SLOT(slot2)
// LED_SLOT(slot3)
// LED_SLOT(slot4)
//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