config-editor-base 2.0.3 → 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.
@@ -435,6 +435,38 @@ var resetLocalSchemaList = function resetLocalSchemaList() {
435
435
  };
436
436
  var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
437
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
+
438
470
  dispatch(setConfigContent(content));
439
471
  var blob = new Blob([JSON.stringify(content, null, 2)], {
440
472
  type: "text/json"