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.
39 lines
1.1 KiB
39 lines
1.1 KiB
4 years ago
|
#ifndef MACROS_H
|
||
|
#define MACROS_H
|
||
|
|
||
|
/*************************************************************************************************/
|
||
|
#define IS_IN_RANGE(val, min, max) \
|
||
|
(val >= min && val <= max)
|
||
|
|
||
|
/*************************************************************************************************/
|
||
|
#define SET_SCENARIO_INDEPENDENT_VALUE(param, val, min, max) \
|
||
|
if(!IS_IN_RANGE(val, min, max)) \
|
||
|
{ \
|
||
|
return false; \
|
||
|
} \
|
||
|
_input.param = val; \
|
||
|
calculateScenarioIndependentValues(); \
|
||
|
return true;
|
||
|
|
||
|
/*************************************************************************************************/
|
||
|
#define SET_SCENARIO_DEPENDENT_VALUE(param, val, min, max) \
|
||
|
if(!IS_IN_RANGE(val, min, max)) \
|
||
|
{ \
|
||
|
return false; \
|
||
|
} \
|
||
|
_input.param = val; \
|
||
|
calculateScenarioDependentValues(); \
|
||
|
return true;
|
||
|
|
||
|
/*************************************************************************************************/
|
||
|
#define UPDATE_VALUE(TYPE, SETTER) \
|
||
|
{ \
|
||
|
auto temp = GET_VALUE(request, 0, TYPE); \
|
||
|
auto result = _core->SETTER(temp); \
|
||
|
processScenGenCommand(result, request); \
|
||
|
}
|
||
|
|
||
|
//#define CHECK_FOR_REGENERATE(TYPE, NAME, )
|
||
|
|
||
|
#endif //MACROS_H
|