config-editor-base 2.7.8 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -738,11 +738,32 @@ var publicSchemaFiles = function publicSchemaFiles(selectedConfig, schemaAry, co
738
738
  if (contentJSON.can_2 != undefined && contentJSON.connect && contentJSON.connect.cellular != undefined && contentJSON.gnss != undefined) {
739
739
  deviceType = "CANedge3 GNSS";
740
740
  }
741
+ if (contentJSON.sensor && contentJSON.sensor.gnss !== undefined) {
742
+ deviceType = "CANmod.gps";
743
+ }
744
+ if (contentJSON.sensor && contentJSON.sensor.channel_1 && contentJSON.sensor.channel_1.digital_low !== undefined) {
745
+ deviceType = "CANmod.input";
746
+ }
747
+ if (contentJSON.phy && contentJSON.phy.can && contentJSON.phy.can.route) {
748
+ deviceType = "CANmod.router";
749
+ }
750
+ if (contentJSON.sensor && contentJSON.sensor.top_left && contentJSON.sensor.top_left.type !== undefined) {
751
+ deviceType = "CANmod.temp";
752
+ }
753
+ var version = selectedConfig.substr(7, 5);
741
754
  var schemaAryFiltered = schemaAry.filter(function (e) {
742
- return e.includes(selectedConfig.substr(7, 5));
755
+ if (!e.includes(version)) return false;
756
+ if (deviceType && deviceType.startsWith('CANmod')) {
757
+ return e.includes(deviceType);
758
+ }
759
+ return true;
743
760
  });
744
761
  var uiSchemaAryFiltered = uiSchemaAry.filter(function (e) {
745
- return e.includes(selectedConfig.substr(7, 5));
762
+ if (!e.includes(version)) return false;
763
+ if (deviceType && deviceType.startsWith('CANmod')) {
764
+ return e.includes(deviceType);
765
+ }
766
+ return true;
746
767
  });
747
768
  if (!deviceType.includes("GNSS")) {
748
769
  schemaAryFiltered = schemaAryFiltered.filter(function (e) {
@@ -1149,6 +1170,20 @@ var checkGNSSEstimate = function checkGNSSEstimate(content) {
1149
1170
  }
1150
1171
  };
1151
1172
  };
1173
+ var checkCANmodMonitoringMode = function checkCANmodMonitoringMode(content) {
1174
+ return function (dispatch) {
1175
+ var _content$phy, _content$phy$can, _content$phy$can$phy;
1176
+ if (((_content$phy = content.phy) === null || _content$phy === void 0 ? void 0 : (_content$phy$can = _content$phy.can) === null || _content$phy$can === void 0 ? void 0 : (_content$phy$can$phy = _content$phy$can.phy) === null || _content$phy$can$phy === void 0 ? void 0 : _content$phy$can$phy.mode) !== undefined) {
1177
+ if (content.phy.can.phy.mode !== 0) {
1178
+ dispatch(set({
1179
+ type: "warning",
1180
+ message: "Your CANmod primary CAN bus mode must be set to 'Normal' if you want the CANmod to output CAN messages",
1181
+ autoClear: false
1182
+ }));
1183
+ }
1184
+ }
1185
+ };
1186
+ };
1152
1187
  var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
1153
1188
  return function (dispatch) {
1154
1189
  if (content.can_2 != undefined) {
@@ -1175,6 +1210,7 @@ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, conte
1175
1210
  dispatch(checkIncorrectRoamingSuperSIM(content));
1176
1211
  dispatch(checkConfigControlSignalZeroScalingFactor(content));
1177
1212
  }
1213
+ dispatch(checkCANmodMonitoringMode(content));
1178
1214
  dispatch(setConfigContent(content));
1179
1215
  var blob = new Blob([JSON.stringify(content, null, 2)], {
1180
1216
  type: "text/json"
@@ -1293,6 +1329,7 @@ var actions = {
1293
1329
  checkIncorrectAPNSpaces: checkIncorrectAPNSpaces,
1294
1330
  checkFileSplitValue: checkFileSplitValue,
1295
1331
  checkGNSSEstimate: checkGNSSEstimate,
1332
+ checkCANmodMonitoringMode: checkCANmodMonitoringMode,
1296
1333
  saveUpdatedConfiguration: saveUpdatedConfiguration,
1297
1334
  setUpdatedFormData: setUpdatedFormData,
1298
1335
  setUpdatedFormDataValue: setUpdatedFormDataValue,