|
|
@ -10,6 +10,11 @@ |
|
|
|
#define US_HOME_PATH "US_HOME" |
|
|
|
#define CONNECT_LED(NAME) \ |
|
|
|
connect(panel, SIGNAL(NAME ## LedChanged(char)), this, SLOT(NAME ## LedHandle(char))); |
|
|
|
#define CONNECT_PROBE_SELECTION(NAME) \ |
|
|
|
connect(panel, \ |
|
|
|
&Console::changeProbeSelectionEnable ## NAME, \ |
|
|
|
this, \ |
|
|
|
&MainViewModel::setProbeSelectionEnable ## NAME); |
|
|
|
|
|
|
|
MainViewModel::MainViewModel(QObject* parent) : ViewModel(parent) |
|
|
|
{ |
|
|
@ -48,31 +53,37 @@ MainViewModel::MainViewModel(QObject* parent) : ViewModel(parent) |
|
|
|
}); |
|
|
|
|
|
|
|
//Enable and disable changes in probe selection box
|
|
|
|
connect(panel, &Console::changeProbeSelectionEnable1, [ = ]() |
|
|
|
{ |
|
|
|
this->isProbeSelectionEnable1(!this->isProbeSelectionEnable1()); |
|
|
|
this->slot1Led(this->isProbeSelectionEnable1() ? LED_COLOR_WHITE : LED_COLOR_GREEN); |
|
|
|
}); |
|
|
|
|
|
|
|
connect(panel, &Console::changeProbeSelectionEnable2, [ = ]() |
|
|
|
{ |
|
|
|
this->isProbeSelectionEnable2(!this->isProbeSelectionEnable2()); |
|
|
|
this->slot2Led(this->isProbeSelectionEnable2() ? LED_COLOR_WHITE : LED_COLOR_GREEN); |
|
|
|
}); |
|
|
|
|
|
|
|
connect(panel, &Console::changeProbeSelectionEnable3, [ = ]() |
|
|
|
{ |
|
|
|
this->isProbeSelectionEnable3(!this->isProbeSelectionEnable3()); |
|
|
|
this->slot3Led(this->isProbeSelectionEnable3() ? LED_COLOR_WHITE : LED_COLOR_GREEN); |
|
|
|
}); |
|
|
|
//connect(panel, &Console::changeProbeSelectionEnable1, [ = ]()
|
|
|
|
//{
|
|
|
|
//this->isProbeSelectionEnable1(!this->isProbeSelectionEnable1());
|
|
|
|
////this->slot1Led(this->isProbeSelectionEnable1() ? LED_COLOR_WHITE : LED_COLOR_GREEN);
|
|
|
|
//});
|
|
|
|
|
|
|
|
//connect(panel, &Console::changeProbeSelectionEnable2, [ = ]()
|
|
|
|
//{
|
|
|
|
//this->isProbeSelectionEnable2(!this->isProbeSelectionEnable2());
|
|
|
|
////this->slot2Led(this->isProbeSelectionEnable2() ? LED_COLOR_WHITE : LED_COLOR_GREEN);
|
|
|
|
//});
|
|
|
|
|
|
|
|
//connect(panel, &Console::changeProbeSelectionEnable3, [ = ]()
|
|
|
|
//{
|
|
|
|
//this->isProbeSelectionEnable3(!this->isProbeSelectionEnable3());
|
|
|
|
////this->slot3Led(this->isProbeSelectionEnable3() ? LED_COLOR_WHITE : LED_COLOR_GREEN);
|
|
|
|
//});
|
|
|
|
|
|
|
|
//connect(panel, &Console::changeProbeSelectionEnable4, [ = ]()
|
|
|
|
//{
|
|
|
|
//this->isProbeSelectionEnable4(!this->isProbeSelectionEnable4());
|
|
|
|
////this->slot4Led(this->isProbeSelectionEnable4() ? LED_COLOR_WHITE : LED_COLOR_GREEN);
|
|
|
|
//});
|
|
|
|
|
|
|
|
connect(panel, &Console::changeProbeSelectionEnable4, [ = ]() |
|
|
|
{ |
|
|
|
this->isProbeSelectionEnable4(!this->isProbeSelectionEnable4()); |
|
|
|
this->slot4Led(this->isProbeSelectionEnable4() ? LED_COLOR_WHITE : LED_COLOR_GREEN); |
|
|
|
}); |
|
|
|
//connect(this, );
|
|
|
|
|
|
|
|
CONNECT_PROBE_SELECTION(1) |
|
|
|
CONNECT_PROBE_SELECTION(2) |
|
|
|
CONNECT_PROBE_SELECTION(3) |
|
|
|
CONNECT_PROBE_SELECTION(4) |
|
|
|
|
|
|
|
//Add Probes in 4 Slots
|
|
|
|
CONNECT_LED(slot1) |
|
|
|
CONNECT_LED(slot2) |
|
|
@ -145,3 +156,23 @@ MainViewModel::MainViewModel(QObject* parent) : ViewModel(parent) |
|
|
|
CONNECT_LED(depthBottom) |
|
|
|
CONNECT_LED(focusBottom) |
|
|
|
} |
|
|
|
|
|
|
|
void MainViewModel::setProbeSelectionEnable1(bool value) |
|
|
|
{ |
|
|
|
isProbeSelectionEnable1(value); |
|
|
|
} |
|
|
|
|
|
|
|
void MainViewModel::setProbeSelectionEnable2(bool value) |
|
|
|
{ |
|
|
|
isProbeSelectionEnable2(value); |
|
|
|
} |
|
|
|
|
|
|
|
void MainViewModel::setProbeSelectionEnable3(bool value) |
|
|
|
{ |
|
|
|
isProbeSelectionEnable3(value); |
|
|
|
} |
|
|
|
|
|
|
|
void MainViewModel::setProbeSelectionEnable4(bool value) |
|
|
|
{ |
|
|
|
isProbeSelectionEnable4(value); |
|
|
|
} |
|
|
|