first commit

This commit is contained in:
2026-02-21 17:11:31 +09:00
commit 18b4338361
4001 changed files with 365464 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#include "rm_value_selector.h"
#if (USE_JSON_SETTINGS)
#include <QJsonArray>
#include <QJsonObject>
#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<a.size();i++) {
if(a.at(i).toInt() == value) {
return i;
}
}
}
return value;
}
#else // USE_JSON_SETTINGS
RMValueSelector::RMValueSelector(unsigned char* value,QList<int> indexMap)
{
_value = value;
_indexMap = indexMap;
}
#endif // USE_JSON_SETTINGS