diff --git a/src/core/ConfigParser.cpp b/src/core/ConfigParser.cpp index 97d7cca..5af020c 100644 --- a/src/core/ConfigParser.cpp +++ b/src/core/ConfigParser.cpp @@ -626,6 +626,7 @@ int Configparser::handle_on_lit_or_unlit_or_blink(IniFileSectionHeader section_h int Configparser::handle_on_line_add(IniFileSectionHeader section_header, std::string key, std::string value, Configuration& config) { //line="on_select:SW_ALT,dataref:sim/custom/gauges/compas/pkp_helper_course_L" + //line="on_select:SW_ALT,dataref:sim/custom/gauges/compas/pkp_helper_course_L, dot_position: 2" //line="on_select:SW_ALT,dataref:sim/custom/gauges/compas/pkp_helper_course_L, minimum_digit_number: 3" //line="dataref:sim/custom/gauges/compas/pkp_helper_course_L" //line="dataref:sim/custom/gauges/compas/test[0] @@ -658,6 +659,21 @@ int Configparser::handle_on_line_add(IniFileSectionHeader section_header, std::s } } + std::string dot_position = ""; + get_and_remove_token_pair(m, TOKEN_DOT_POSITION, dot_position); + if (dot_position != "") + { + if (section_header.name == TOKEN_SECTION_MULTI_DISPLAY) + config.class_configs.back().multi_displays[section_header.id]->set_dot_position(condition, stoi(dot_position)); + else if (section_header.name == TOKEN_SECTION_DISPLAY) + config.class_configs.back().generic_displays[section_header.id]->set_dot_position(stoi(dot_position)); + else + { + Logger(TLogLevel::logERROR) << "parser: invalid line for device type: " << section_header.name << std::endl; + return EXIT_FAILURE; + } + } + // at this point only the dataref/lua/const key-value pair shall remain if (m.size() != 2) { diff --git a/src/core/ConfigParser.h b/src/core/ConfigParser.h index 67fd91b..a0582fa 100644 --- a/src/core/ConfigParser.h +++ b/src/core/ConfigParser.h @@ -84,6 +84,7 @@ class Configparser const std::string TOKEN_BCD = "bcd"; const std::string TOKEN_BLANK_LEADING_ZEROS = "blank_leading_zeros"; const std::string TOKEN_MIN_DIGIT_NUMBER = "minimum_digit_number"; + const std::string TOKEN_DOT_POSITION = "dot_position"; const std::string TOKEN_ON_SELECT = "on_select"; const std::string TOKEN_BEGIN = "begin"; const std::string TOKEN_END = "end";