Compare commits

...

8 Commits

  1. 0
      ConsoleEmulatorAddProbes.pro
  2. 78
      logic/include/model/ButtonHelper.h
  3. 7
      logic/include/model/Console.h
  4. 13
      logic/include/model/DatabaseManager.h
  5. 29
      logic/include/model/DropDown.h
  6. 10
      logic/include/model/FunctionCodes.h
  7. 26
      logic/include/viewModel/MainViewModel.h
  8. 10
      logic/include/viewModel/utils/Property.h
  9. 6
      logic/logic.pro
  10. 5
      logic/src/model/Console.cpp
  11. 6
      logic/src/model/DatabaseManager.cpp
  12. 38
      logic/src/model/DropDown.cpp
  13. 8
      logic/src/viewModel/MainViewModel.cpp
  14. 6
      ui/App.qml
  15. 3
      ui/emulator/Emulator.qml
  16. 361
      ui/emulator/elements/ProbeButton.qml
  17. 52
      ui/emulator/items/TopLeft.qml
  18. 87
      ui/emulator/items/TopLeftTop.qml
  19. 2
      ui/ui.qrc

0
consoleEmulator.pro → ConsoleEmulatorAddProbes.pro

78
logic/include/model/ButtonHelper.h

@ -2,79 +2,101 @@
#define BUTTONHELPER_H
#define PUSH_BUTTON(CAPITAL_NAME, SMALL_NAME, FUNC_CODE, LED_FUNC_CODE) \
private: \
private: \
PushButton _ ## SMALL_NAME{FUNC_CODE, LED_FUNC_CODE}; \
void init ## CAPITAL_NAME() \
{ \
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData);\
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, SIGNAL(SMALL_NAME ## LedChanged(char)));\
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData); \
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, \
SIGNAL(SMALL_NAME ## LedChanged(char))); \
} \
public: \
public: \
void press ## CAPITAL_NAME() \
{ \
auto arr = _ ## SMALL_NAME.press(); \
_dataSender->send(arr); \
auto arr = _ ## SMALL_NAME.press(); \
_dataSender->send(arr); \
} \
void release ## CAPITAL_NAME() \
{ \
auto arr = _ ## SMALL_NAME.release(); \
_dataSender->send(arr); \
auto arr = _ ## SMALL_NAME.release(); \
_dataSender->send(arr); \
} \
Q_SIGNAL void SMALL_NAME ## LedChanged(char value)
/*************************************************************************************************/
#define PUSH_BUTTON_NO_LED(CAPITAL_NAME, SMALL_NAME, FUNC_CODE) \
private: \
private: \
PushButton _ ## SMALL_NAME{FUNC_CODE}; \
void init ## CAPITAL_NAME() \
{ \
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData);\
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, SIGNAL(SMALL_NAME ## LedChanged(char)));\
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData); \
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, \
SIGNAL(SMALL_NAME ## LedChanged(char))); \
} \
public: \
public: \
void press ## CAPITAL_NAME() \
{ \
auto arr = _ ## SMALL_NAME.press(); \
_dataSender->send(arr); \
auto arr = _ ## SMALL_NAME.press(); \
_dataSender->send(arr); \
} \
void release ## CAPITAL_NAME() \
{ \
auto arr = _ ## SMALL_NAME.release(); \
_dataSender->send(arr); \
auto arr = _ ## SMALL_NAME.release(); \
_dataSender->send(arr); \
} \
Q_SIGNAL void SMALL_NAME ## LedChanged(char value)
/*************************************************************************************************/
#define ROTARY_BUTTON(CAPITAL_NAME, SMALL_NAME, FUNC_CODE, LED_FUNC_CODE) \
private: \
private: \
RotaryButton _ ## SMALL_NAME{FUNC_CODE, LED_FUNC_CODE}; \
void init ## CAPITAL_NAME() \
{ \
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData);\
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, SIGNAL(SMALL_NAME ## LedChanged(char)));\
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData); \
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, \
SIGNAL(SMALL_NAME ## LedChanged(char))); \
} \
public: \
public: \
void rotate ## CAPITAL_NAME(int value) \
{ \
auto arr = _ ## SMALL_NAME.rotate(value); \
_dataSender->send(arr); \
auto arr = _ ## SMALL_NAME.rotate(value); \
_dataSender->send(arr); \
} \
Q_SIGNAL void SMALL_NAME ## LedChanged(char value)
/*************************************************************************************************/
#define ROTARY_BUTTON_NO_LED(CAPITAL_NAME, SMALL_NAME, FUNC_CODE) \
private: \
private: \
RotaryButton _ ## SMALL_NAME{FUNC_CODE}; \
void init ## CAPITAL_NAME() \
{ \
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData);\
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, SIGNAL(SMALL_NAME ## LedChanged(char)));\
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData); \
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, \
SIGNAL(SMALL_NAME ## LedChanged(char))); \
} \
public: \
public: \
void rotate ## CAPITAL_NAME(int value) \
{ \
auto arr = _ ## SMALL_NAME.rotate(value); \
_dataSender->send(arr); \
auto arr = _ ## SMALL_NAME.rotate(value); \
_dataSender->send(arr); \
} \
Q_SIGNAL void SMALL_NAME ## LedChanged(char value)
/*************************************************************************************************/
#define DROP_DOWN(CAPITAL_NAME, SMALL_NAME, FUNC_CODE, LED_FUNC_CODE) \
private: \
DropDown _ ## SMALL_NAME{FUNC_CODE, LED_FUNC_CODE}; \
void init ## CAPITAL_NAME() \
{ \
connect(this, &Console::dataReady, _ ## SMALL_NAME.getLed(), &Led::newData); \
connect(_ ## SMALL_NAME.getLed(), SIGNAL(ledChanged(char)), this, \
SIGNAL(SMALL_NAME ## LedChanged(char))); \
} \
public: \
void select ## CAPITAL_NAME(int value) \
{ \
auto arr = _ ## SMALL_NAME.select(value); \
_dataSender->send(arr); \
} \
Q_SIGNAL void SMALL_NAME ## LedChanged(char value)

7
logic/include/model/Console.h

@ -14,6 +14,7 @@
#include "FunctionCodes.h"
#include "PushButton.h"
#include "RotaryButton.h"
#include "DropDown.h"
#include "DataSender.h"
#include "Logger.h"
@ -22,6 +23,12 @@ class Console : public QObject
{
Q_OBJECT
//Slotes
DROP_DOWN(Slot1, slot1, SLOT1_FC, static_cast<char>(SLOT1_LED_FC));
DROP_DOWN(Slot2, slot2, SLOT2_FC, static_cast<char>(SLOT2_LED_FC));
DROP_DOWN(Slot3, slot3, SLOT3_FC, static_cast<char>(SLOT3_LED_FC));
DROP_DOWN(Slot4, slot4, SLOT4_FC, static_cast<char>(SLOT4_LED_FC));
//PushButton with LED
PUSH_BUTTON(Dual, dual, DUAL_FC, static_cast<char>(DUAL_LED_FC));
PUSH_BUTTON(Quad, quad, QUAD_FC, static_cast<char>(QUAD_LED_FC));

13
logic/include/model/DatabaseManager.h

@ -0,0 +1,13 @@
#ifndef DatabaseManager_H
#define DatabaseManager_H
class DatabaseManager
{
private:
char _functionCode;
public:
DatabaseManager(char functionCode);
};
#endif //DatabaseManager_H

29
logic/include/model/DropDown.h

@ -0,0 +1,29 @@
#ifndef DropDown_H
#define DropDown_H
#define PROTOCOL_LENGTH 8
#define MESSAGE_DIRECTION 0x00
#define DropDownDataLength 0x02
#define DropDownType 0x03
#define ProbA 0x00
#define ProbB 0x01
#define ProbNC 0x02
#define TIME_TAG 0x00
#include "Led.h"
class DropDown
{
private:
char _functionCode;
Led _led;
public:
DropDown(char functionCode);
DropDown(char functionCode, char ledFunctionCode);
Led* getLed();
QByteArray select(int value);
};
#endif //DropDown_H

10
logic/include/model/FunctionCodes.h

@ -1,6 +1,16 @@
#ifndef FUNCTIONCODES_H
#define FUNCTIONCODES_H
//Probes and LED of probes
#define SLOT1_FC 0x01
#define SLOT2_FC 0x09
#define SLOT3_FC 0x19
#define SLOT4_FC 0x18
#define SLOT1_LED_FC 0x20
#define SLOT2_LED_FC 0x27
#define SLOT3_LED_FC 0x30
#define SLOT4_LED_FC 0x48
//Buttons
#define DUAL_FC 0x1D
#define QUAD_FC 0x1C

26
logic/include/viewModel/MainViewModel.h

@ -4,6 +4,7 @@
#include <QtMvvmCore/ViewModel>
#include "utils/Property.h"
#include "model/Console.h"
#include <QList>
#define LED_OFF 0x00
#define LED_COLOR_WHITE 0x01
@ -19,6 +20,12 @@ class MainViewModel : public QtMvvm::ViewModel
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)
@ -134,6 +141,19 @@ class MainViewModel : public QtMvvm::ViewModel
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);
@ -144,6 +164,12 @@ signals:
//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)

10
logic/include/viewModel/utils/Property.h

@ -77,6 +77,16 @@
NAME ## Led(static_cast<int>(value)); \
} \
/**************************************************************************************************/
#define DROP_DOWN_PROPERTY(NAME, CAP_NAME, LED_DEF_VAL) \
MVVM_PROPERTY_CUSTOM(bool, NAME, false) \
void NAME ## Handle() { \
if(NAME()) \
{ \
panel->select ## CAP_NAME('stepDec()'); \
} \
} \
//uncrustify on
#endif //PROPERTY_H

6
logic/logic.pro

@ -8,9 +8,11 @@ TARGET = logic
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += $$files(src/*.cpp, true)
SOURCES += $$files(src/*.cpp, true) \
src/model/DropDown.cpp
HEADERS += $$files(include/*.h, true)
HEADERS += $$files(include/*.h, true) \
include/model/DropDown.h
INCLUDEPATH += $$PWD/include/

5
logic/src/model/Console.cpp

@ -84,6 +84,11 @@ bool Console::isEchoPacket(const QByteArray& data)
/*************************************************************************************************/
void Console::initializeButtons()
{
initSlot1();
initSlot2();
initSlot3();
initSlot4();
initDual();
initQuad();
initSingle();

6
logic/src/model/DatabaseManager.cpp

@ -0,0 +1,6 @@
#include "model/DatabaseManager.h"
DatabaseManager::DatabaseManager(char functionCode)
{
_functionCode = functionCode;
}

38
logic/src/model/DropDown.cpp

@ -0,0 +1,38 @@
#include "model/DropDown.h"
/*************************************************************************************************/
DropDown::DropDown(char functionCode)
{
_functionCode = functionCode;
}
/*************************************************************************************************/
DropDown::DropDown(char functionCode, char ledFunctionCode) :
_led(ledFunctionCode)
{
_functionCode = functionCode;
}
/*************************************************************************************************/
Led* DropDown::getLed()
{
return &_led;
}
/*************************************************************************************************/
QByteArray DropDown::select(int value)
{
QByteArray arr;
arr.resize(PROTOCOL_LENGTH);
arr[0] = MESSAGE_DIRECTION;
arr[1] = DropDownDataLength;
arr[2] = DropDownType;
arr[3] = _functionCode;
arr[4] = static_cast<char>(value >> PROTOCOL_LENGTH);
arr[5] = static_cast<char>(value);
arr[6] = TIME_TAG;
arr[7] = TIME_TAG;
return arr;
}

8
logic/src/viewModel/MainViewModel.cpp

@ -20,6 +20,12 @@ MainViewModel::MainViewModel(QObject* parent) :
connect(network, &UdpDataSender::dataReady, panel, &Console::newData);
//Add Probes in 4 Slots
//CONNECT_LED(slot1)
//CONNECT_LED(slot2)
//CONNECT_LED(slot3)
//CONNECT_LED(slot4)
//Top Left
CONNECT_LED(patient)
CONNECT_LED(utils)
@ -84,5 +90,5 @@ MainViewModel::MainViewModel(QObject* parent) :
CONNECT_LED(depthCenter)
CONNECT_LED(focusCenter)
CONNECT_LED(depthBottom)
CONNECT_LED(focusBottom)
CONNECT_LED(focusBottom)
}

6
ui/App.qml

@ -12,9 +12,9 @@ QtMvvmApp {
onHeightChanged: Const.heightRatio = mvvmApp.height / Const.windowHeight
Component.onCompleted: {
width = Const.windowWidth
height = Const.windowHeight
width = Const.windowWidth / 1.3
height = Const.windowHeight / 1.3
x = (Screen.width - width) / 2
y = (Screen.height - height)
y = (Screen.height - height)
}
}

3
ui/emulator/Emulator.qml

@ -14,6 +14,9 @@ Item {
anchors.top: topLeft.bottom
anchors.topMargin: 120
}
TopLeftTop {
}
TopLeft {
id: topLeft

361
ui/emulator/elements/ProbeButton.qml

@ -0,0 +1,361 @@
import QtQuick 2.0
import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13
import "qrc:/theme"
import "qrc:/const"
import "qrc:/emulator/components"
import de.skycoder42.QtMvvm.Core 1.0
import de.skycoder42.QtMvvm.Quick 1.0
import com.example.consoleemulator 1.0
Button {
id: button
//=========================================
property var name
property var nameLed: name + "Led"
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "down"
viewModelProperty: name
type: MvvmBinding.OneWayToViewModel
}
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "colorMode"
viewModelProperty: nameLed
}
//=========================================
property var image: ""
property var radius: Math.min(width / 2, height / 2)
property var timeToPress: 100
property var border: 6
property var colorMode: 0 // 0->None; 1->White; 2->Green; 3->Yellow
property color lightColor: getColor()
property color lightGlow: getColorGlow()
signal pressed
signal released
implicitWidth: width
implicitHeight: height
onPressed: { button.down = true }
onReleased: { button.down = false }
function getColor() {
switch(colorMode) {
case(0): return Theme.current.none
case(1): return Theme.current.white
case(2): return Theme.current.green
case(3): return Theme.current.yellow
}
}
function getColorGlow() {
switch(colorMode) {
case(0): return Theme.current.noneGlow
case(1): return Theme.current.whiteGlow
case(2): return Theme.current.greenGlow
case(3): return Theme.current.yellowGlow
}
}
width: Const.macroButton
height: Const.macroButton*2
contentItem: Item {
id: content
anchors.fill: parent
z: 1
Item {
property var factor: button.state == "Pressed" ?
Const.imageScalePressed : Const.imageScale
property var elevator: button.state == "Pressed" ? 3 : 0
anchors.horizontalCenter: parent.horizontalCenter
y: (parent.height * (1-factor)) / 2 + elevator
width: parent.width * factor
height: parent.height * factor
Behavior on y {
NumberAnimation {
duration: timeToPress
easing.type: Easing.InOutQuad
}
}
Behavior on width {
NumberAnimation {
duration: timeToPress
easing.type: Easing.InOutQuad
}
}
Behavior on height {
NumberAnimation {
duration: timeToPress
easing.type: Easing.InOutQuad
}
}
Image {
id: img
anchors.fill: parent
source: image
fillMode: Image.PreserveAspectFit
antialiasing: true
smooth: true
}
ColorOverlay {
anchors.fill: img
source: img
color: button.state == "Pressed" ? Theme.current.textSelected : Theme.current.text
antialiasing: true
smooth: true
}
}
}
background: Item{
width: parent.width
height: parent.height
Rectangle {
id: backLightGlow
property var diffusion: Theme.current.glowRaduis
width: backLight.width + diffusion
height: backLight.height + diffusion
radius: width / 2
anchors.horizontalCenter: backLight.horizontalCenter
y: - diffusion / 4
color: Theme.current.background
border {
width: diffusion / 2
color: Theme.current.background
}
}
Rectangle {
anchors.fill: backLightGlow
color: "transparent"
layer.enabled: true
layer.effect: OpacityMask {
maskSource: backLightGlow
}
Rectangle {
width: parent.width
height: parent.height
radius: parent.radius
color: "transparent"
RadialGradient {
anchors.fill: parent
gradient: Gradient {
GradientStop { position: 0.0; color: lightGlow }
GradientStop {
position: 0.5 * (backLight.width - backLightGlow.diffusion / backLightGlow.width)
color: lightGlow
}
GradientStop { position: 0.5; color: "transparent" }
GradientStop { position: 1.0; color: "transparent" }
}
}
}
}
Rectangle {
id: backLight
width: parent.width + 4
height: parent.height + 4
radius: width / 2
color: lightColor
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
}
Rectangle {
id: background
anchors.fill: parent
radius: button.radius
color: Theme.current.button
Behavior on color {
ColorAnimation {
duration: timeToPress
easing.type: Easing.InOutQuad
}
}
}
Item {
id: coloredRing
width: parent.width
height: parent.height
Rectangle {
id: lightRing
width: parent.width
height: parent.height
radius: width / 2
color: "transparent"
border{
color: background.color
width: button.border
}
}
Item {
id: borderGrad
implicitWidth: parent.width
implicitHeight: parent.height
anchors.fill: parent
layer.enabled: true
layer.effect:
OpacityMask {
maskSource: lightRing
}
Rectangle {
width: parent.width
height: parent.height
color: background.color
LinearGradient {
id: linGrad
anchors.fill: parent
start: Qt.point(0, parent.height)
end: Qt.point(0, 0)
gradient: Gradient {
GradientStop {
id: buttonDown
position: 0
color: Theme.current.shadow
Behavior on color {
ColorAnimation {
duration: timeToPress
easing.type: Easing.InOutQuad
}
}
}
GradientStop {
id: buttonUp
position: 1
color: Theme.current.light
Behavior on color {
ColorAnimation {
duration: timeToPress
easing.type: Easing.InOutQuad
}
}
}
}
}
}
}
}
MouseArea {
hoverEnabled: true
anchors.fill: background
onEntered: {
button.state = "Hovering"
}
onExited: {
button.state = ""
}
onPressed: {
button.state = "Pressed"
button.pressed()
}
onReleased: {
button.released()
if (containsMouse)
button.state = "Hovering"
else
button.state = ""
}
}
}
Item {
id: hoverLight
implicitWidth: parent.width
implicitHeight: parent.height
anchors.fill: parent
layer.enabled: true
layer.effect: OpacityMask {
maskSource: background
}
Rectangle {
id: hoverGlow
width: 2 * parent.width
height: parent.height
x: - 2 * parent.width
color: "transparent"
HoverGlow {}
}
}
states: [
State {
name: "Hovering"
PropertyChanges {
target: hoverGlow
x: 0
}
},
State {
name: "Pressed"
PropertyChanges {
target: background
color: Theme.current.buttonSelected
}
PropertyChanges {
target: buttonUp
color: Theme.current.shadow
}
PropertyChanges {
target: buttonDown
color: Theme.current.light
}
}
]
transitions: [
Transition {
from: ""; to: "Hovering"
NumberAnimation {
properties: "x"
duration: 500
easing.type: Easing.OutQuad
}
}
]
}

52
ui/emulator/items/TopLeft.qml

@ -5,33 +5,33 @@ import "qrc:/emulator/components"
import "qrc:/const"
GridLayout {
id: topLeft
x: 70
y: 120
rows: 3
columns: 4
rowSpacing: 36
columnSpacing: 36
NeuLight {
image: "qrc:/icons/topLeft/power.png"
Layout.column: 3
colorMode: 3
id: topLeft
x: 70
y: 270
rows: 3
columns: 4
rowSpacing: 36
columnSpacing: 36
NeuLight {
image: "qrc:/icons/topLeft/power.png"
Layout.column: 3
colorMode: 3
// enabled: false
// name: "power"
}
KnobLightBind { name: "patient" ; image: "qrc:/icons/topLeft/patient.png" }
KnobLightBind { name: "utils" ; image: "qrc:/icons/topLeft/utils.png" }
KnobLightBind { name: "dvd" ; image: "qrc:/icons/topLeft/dvd.png" }
KnobLightBind { name: "report" ; image: "qrc:/icons/topLeft/report.png" }
KnobLightBind { name: "probe" ; image: "qrc:/icons/topLeft/probe.png"
Layout.column: 1
Layout.row: 2
}
KnobLightBind { name: "archive" ; image: "qrc:/icons/topLeft/archive.png" }
KnobLightBind { name: "end" ; image: "qrc:/icons/topLeft/end.png" }
// name: "power"
}
KnobLightBind { name: "patient" ; image: "qrc:/icons/topLeft/patient.png" }
KnobLightBind { name: "utils" ; image: "qrc:/icons/topLeft/utils.png" }
KnobLightBind { name: "dvd" ; image: "qrc:/icons/topLeft/dvd.png" }
KnobLightBind { name: "report" ; image: "qrc:/icons/topLeft/report.png" }
KnobLightBind { name: "probe" ; image: "qrc:/icons/topLeft/probe.png"
Layout.column: 1
Layout.row: 2
}
KnobLightBind { name: "archive" ; image: "qrc:/icons/topLeft/archive.png" }
KnobLightBind { name: "end" ; image: "qrc:/icons/topLeft/end.png" }
}

87
ui/emulator/items/TopLeftTop.qml

@ -0,0 +1,87 @@
import QtQuick 2.0
import QtQuick.Layouts 1.13
import QtQuick.Controls 2.12
import de.skycoder42.QtMvvm.Core 1.0
import de.skycoder42.QtMvvm.Quick 1.0
import com.example.consoleemulator 1.0
import "qrc:/emulator/elements"
import "qrc:/emulator/components"
import "qrc:/const"
import "qrc:/qtmvvm/views"
GridLayout {
x: 70
y: 50
rowSpacing: 36
columns: 4
ProbeButton {
name: "probe1"
image: "qrc:/icons/topLeft/probe.png"
}
ProbeButton {
name: "probe2"
image: "qrc:/icons/topLeft/probe.png"
}
ProbeButton {
name: "probe3"
image: "qrc:/icons/topLeft/probe.png"
}
ProbeButton {
name: "probe4"
image: "qrc:/icons/topLeft/probe.png"
}
property var widthOfBtns: 130
property var probeList: []
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "probeList"
viewModelProperty: "probeList"
}
ComboBox {
model: probeList
width: widthOfBtns
implicitWidth: width
implicitHeight: 25
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "currentIndex"
viewModelProperty: "currentSelectedProbe1"
}
}
ComboBox {
model: probeList
width: widthOfBtns
implicitWidth: width
implicitHeight: 25
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "currentIndex"
viewModelProperty: "currentSelectedProbe2"
}
}
ComboBox {
model: probeList
width: widthOfBtns
implicitWidth: width
implicitHeight: 25
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "currentIndex"
viewModelProperty: "currentSelectedProbe3"
}
}
ComboBox {
model: probeList
width: widthOfBtns
implicitWidth: width
implicitHeight: 25
MvvmBinding {
viewModel: mainView.viewModel
viewProperty: "currentIndex"
viewModelProperty: "currentSelectedProbe4"
}
}
}

2
ui/ui.qrc

@ -95,6 +95,8 @@
<file>emulator/components/SliderBar.qml</file>
<file>emulator/elements/SliderBarBind.qml</file>
<file>emulator/items/Setting.qml</file>
<file>emulator/items/TopLeftTop.qml</file>
<file>emulator/elements/ProbeButton.qml</file>
</qresource>
<qresource prefix="/qtmvvm/views">
<file>MainView.qml</file>

Loading…
Cancel
Save