@@ -1206,6 +1206,19 @@ Node convert<ModelData>::encode(const ModelData& rhs)
1206
1206
node[" switchNames" ][std::to_string (i)][" val" ] = rhs.functionSwitchNames [i];
1207
1207
}
1208
1208
}
1209
+
1210
+ if (Boards::getCapability (board, Board::FunctionSwitchColors)) {
1211
+ for (int i = 0 ; i < CPN_MAX_SWITCHES_FUNCTION; i += 1 ) {
1212
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" r" ] = rhs.functionSwitchLedONColor [i].r ;
1213
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" g" ] = rhs.functionSwitchLedONColor [i].g ;
1214
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" b" ] = rhs.functionSwitchLedONColor [i].b ;
1215
+ }
1216
+ for (int i = 0 ; i < CPN_MAX_SWITCHES_FUNCTION; i += 1 ) {
1217
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" r" ] = rhs.functionSwitchLedOFFColor [i].r ;
1218
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" g" ] = rhs.functionSwitchLedOFFColor [i].g ;
1219
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" b" ] = rhs.functionSwitchLedOFFColor [i].b ;
1220
+ }
1221
+ }
1209
1222
}
1210
1223
1211
1224
// Custom USB joytsick mapping
@@ -1474,6 +1487,20 @@ bool convert<ModelData>::decode(const Node& node, ModelData& rhs)
1474
1487
node[" functionSwitchStartConfig" ] >> rhs.functionSwitchStartConfig ;
1475
1488
node[" functionSwitchLogicalState" ] >> rhs.functionSwitchLogicalState ;
1476
1489
node[" switchNames" ] >> rhs.functionSwitchNames ;
1490
+ if (node[" functionSwitchLedONColor" ]) {
1491
+ for (int i = 0 ; i < CPN_MAX_SWITCHES_FUNCTION; i += 1 ) {
1492
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" r" ] >> rhs.functionSwitchLedONColor [i].r ;
1493
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" g" ] >> rhs.functionSwitchLedONColor [i].g ;
1494
+ node[" functionSwitchLedONColor" ][std::to_string (i)][" b" ] >> rhs.functionSwitchLedONColor [i].b ;
1495
+ }
1496
+ }
1497
+ if (node[" functionSwitchLedOFFColor" ]) {
1498
+ for (int i = 0 ; i < CPN_MAX_SWITCHES_FUNCTION; i += 1 ) {
1499
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" r" ] >> rhs.functionSwitchLedOFFColor [i].r ;
1500
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" g" ] >> rhs.functionSwitchLedOFFColor [i].g ;
1501
+ node[" functionSwitchLedOFFColor" ][std::to_string (i)][" b" ] >> rhs.functionSwitchLedOFFColor [i].b ;
1502
+ }
1503
+ }
1477
1504
1478
1505
// Custom USB joytsick mapping
1479
1506
node[" usbJoystickExtMode" ] >> rhs.usbJoystickExtMode ;
0 commit comments