config-editor-base 2.0.2 → 2.0.4

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.
@@ -370,6 +370,12 @@ var publicSchemaFiles = function publicSchemaFiles(selectedConfig, schemaAry, co
370
370
  return e.includes(selectedConfig.substr(7, 5));
371
371
  });
372
372
 
373
+ if (!deviceType.includes("GNSS")) {
374
+ schemaAryFiltered = schemaAryFiltered.filter(function (e) {
375
+ return !e.includes("GNSS");
376
+ });
377
+ }
378
+
373
379
  if (deviceType.includes("CANedge")) {
374
380
  schemaAryFiltered = schemaAryFiltered.filter(function (e) {
375
381
  return e.includes(deviceType);
@@ -429,6 +435,38 @@ var resetLocalSchemaList = function resetLocalSchemaList() {
429
435
  };
430
436
  var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
431
437
  return function (dispatch) {
438
+ var contentJSON = JSON.parse(content);
439
+
440
+ if (contentJSON.can_2 != undefined) {
441
+ var transmitList1 = contentJSON.can_1.transmit;
442
+ var transmitList2 = contentJSON.can_2.transmit;
443
+ transmitList1Filtered = transmitList1.filter(function (e) {
444
+ return e.period < e.delay;
445
+ });
446
+ transmitList2Filtered = transmitList2.filter(function (e) {
447
+ return e.period < e.delay;
448
+ });
449
+ }
450
+
451
+ console.log("transmitList1Filtered", transmitList1Filtered);
452
+ console.log("transmitList2Filtered", transmitList2Filtered);
453
+
454
+ if (transmitList1Filtered.length > 0) {
455
+ dispatch(set({
456
+ type: "warning",
457
+ message: "Your CAN CH1 transmit list includes one or more entries with period < delay. This is invalid and will cause the device to reject your Configuration File.",
458
+ autoClear: false
459
+ }));
460
+ }
461
+
462
+ if (transmitList2Filtered.length > 0) {
463
+ dispatch(set({
464
+ type: "warning",
465
+ message: "Your CAN CH2 transmit list includes one or more entries with period < delay. This is invalid and will cause the device to reject your Configuration File.",
466
+ autoClear: false
467
+ }));
468
+ }
469
+
432
470
  dispatch(setConfigContent(content));
433
471
  var blob = new Blob([JSON.stringify(content, null, 2)], {
434
472
  type: "text/json"