Browse Source

Remove redundant macros

develop
miladS 10 months ago
parent
commit
ed46cbed6f
  1. 9
      logic/include/viewModel/MainViewModel.h
  2. 17
      logic/include/viewModel/utils/Property.h

9
logic/include/viewModel/MainViewModel.h

@ -20,11 +20,10 @@ class MainViewModel : public QtMvvm::ViewModel
MVVM_PROPERTY(int, stepInc, 1)
MVVM_PROPERTY(int, stepDec, -1)
//Probes
BUTTON_SLOT_LED_PROPERTY(slot1, Slot1, false, LED_COLOR_GREEN, 1)
BUTTON_SLOT_LED_PROPERTY(slot2, Slot2, false, LED_COLOR_WHITE, 2)
BUTTON_SLOT_LED_PROPERTY(slot3, Slot3, false, LED_COLOR_WHITE, 3)
BUTTON_SLOT_LED_PROPERTY(slot4, Slot4, false, LED_COLOR_WHITE, 4)
BUTTON_LED_PROPERTY(slot1, Slot1, false, LED_COLOR_GREEN)
BUTTON_LED_PROPERTY(slot2, Slot2, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(slot3, Slot3, false, LED_COLOR_WHITE)
BUTTON_LED_PROPERTY(slot4, Slot4, false, LED_COLOR_WHITE)
MVVM_PROPERTY(QList<QVariant>, probeList, {})

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

@ -38,11 +38,6 @@
LED_PROPERTY(NAME, LED_DEF_VAL) \
BUTTON_PROPERTY(NAME, CAP_NAME, DEFAULT_VALUE)
/**************************************************************************************************/
#define BUTTON_SLOT_LED_PROPERTY(NAME, CAP_NAME, DEFAULT_VALUE, LED_DEF_VAL, SLOT_NUMBER) \
LED_PROPERTY(NAME, LED_DEF_VAL) \
BUTTON_SLOT_PROPERTY(NAME, CAP_NAME, DEFAULT_VALUE, SLOT_NUMBER)
/**************************************************************************************************/
#define BUTTON_PROPERTY(NAME, CAP_NAME, DEFAULT_VALUE) \
MVVM_PROPERTY_CUSTOM(bool, NAME, DEFAULT_VALUE) \
@ -55,18 +50,6 @@
} \
} \
/**************************************************************************************************/
#define BUTTON_SLOT_PROPERTY(NAME, CAP_NAME, DEFAULT_VALUE, SLOT_NUMBER) \
MVVM_PROPERTY_CUSTOM(bool, NAME, DEFAULT_VALUE) \
void NAME ## Handle() { \
if(_ ## NAME){ \
panel->press ## CAP_NAME(isProbeSelectionEnable ## SLOT_NUMBER()); \
} \
else { \
panel->release ## CAP_NAME(); \
} \
} \
/**************************************************************************************************/
#define LED_PROPERTY(NAME, LED_DEF_VAL) \
MVVM_PROPERTY(int, NAME ## Led, LED_DEF_VAL) \

Loading…
Cancel
Save