config-editor-base 2.0.8 → 2.0.9

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
@@ -434,41 +434,43 @@ var resetLocalSchemaList = function resetLocalSchemaList() {
434
434
  type: RESET_LOCAL_SCHEMA_LIST
435
435
  };
436
436
  };
437
- var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
437
+ var checkConfigTransmitPeriodDelay = function checkConfigTransmitPeriodDelay(content) {
438
438
  return function (dispatch) {
439
- var contentJSON = content;
440
-
441
- if (contentJSON.can_2 != undefined) {
442
- if (contentJSON.can_1.transmit != undefined) {
443
- var transmitList1 = contentJSON.can_1.transmit;
444
- var transmitList1Filtered = transmitList1.filter(function (e) {
439
+ for (var i = 1; i < 3; i++) {
440
+ if (content["can_" + i].transmit != undefined) {
441
+ var transmitList = content["can_" + i].transmit;
442
+ var transmitListFiltered = transmitList.filter(function (e) {
445
443
  return e.period < e.delay;
446
444
  });
447
445
 
448
- if (transmitList1Filtered.length > 0) {
446
+ if (transmitListFiltered.length > 0) {
449
447
  dispatch(set({
450
448
  type: "warning",
451
- 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.",
449
+ message: "Your CAN CH" + i + " transmit list includes one or more entries with period < delay. This is invalid and will cause the device to reject your Configuration File.",
452
450
  autoClear: false
453
451
  }));
454
452
  }
455
453
  }
456
-
457
- if (contentJSON.can_2.transmit != undefined) {
458
- var transmitList2 = contentJSON.can_2.transmit;
459
- var transmitList2Filtered = transmitList2.filter(function (e) {
460
- return e.period < e.delay;
461
- });
462
-
463
- if (transmitList2Filtered.length > 0) {
454
+ }
455
+ };
456
+ };
457
+ var checkConfigTransmitMonitoring = function checkConfigTransmitMonitoring(content) {
458
+ return function (dispatch) {
459
+ for (var i = 1; i < 3; i++) {
460
+ if (content["can_" + i].transmit != undefined && content["can_" + i].phy != undefined && content["can_" + i].phy.mode != undefined && content["can_" + i].transmit.length > 0) {
461
+ if (content["can_" + i].phy.mode == 2) {
464
462
  dispatch(set({
465
463
  type: "warning",
466
- 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.",
464
+ message: "Your CAN CH" + i + " has a non-empty transmit list, but the mode is set to Monitoring. Note that the device will not transmit any messages unless the mode is set to Normal",
467
465
  autoClear: false
468
466
  }));
469
467
  }
470
468
  }
471
469
  }
470
+ };
471
+ };
472
+ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
473
+ return function (dispatch) {
472
474
 
473
475
  dispatch(setConfigContent(content));
474
476
  var blob = new Blob([JSON.stringify(content, null, 2)], {
@@ -566,6 +568,8 @@ var actions = {
566
568
  setSchemaContent: setSchemaContent,
567
569
  resetFiles: resetFiles,
568
570
  resetLocalSchemaList: resetLocalSchemaList,
571
+ checkConfigTransmitPeriodDelay: checkConfigTransmitPeriodDelay,
572
+ checkConfigTransmitMonitoring: checkConfigTransmitMonitoring,
569
573
  saveUpdatedConfiguration: saveUpdatedConfiguration,
570
574
  setUpdatedFormData: setUpdatedFormData,
571
575
  setUpdatedFormDataValue: setUpdatedFormDataValue,