#include "rm_value_selector.h" #if (USE_JSON_SETTINGS) #include #include #include "rm_settings_cfg.h" RMValueSelector::RMValueSelector(int object) { _object = object; } unsigned char RMValueSelector::realValue(int index) { QJsonObject obj = CFG::items.at(_object).toObject(); if(obj.contains("index_map")) { QJsonArray a = obj.value("index_map").toArray(); return a.at(index).toInt(); } return index; } int RMValueSelector::realIndex(unsigned char value) { QJsonObject obj = CFG::items.at(_object).toObject(); if(obj.contains("index_map")) { QJsonArray a = obj.value("index_map").toArray(); for(int i=0;i indexMap) { _value = value; _indexMap = indexMap; } #endif // USE_JSON_SETTINGS