config-editor-base 2.2.6 → 2.2.8

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
@@ -441,6 +441,36 @@ var checkConfigFiltersDisabled = function checkConfigFiltersDisabled(content) {
441
441
  }
442
442
  };
443
443
  };
444
+ var checkConfigControlSignalZeroScalingFactor = function checkConfigControlSignalZeroScalingFactor(content) {
445
+ return function (dispatch) {
446
+ var channels = ["can_1", "can_2", "can_internal"];
447
+ var channel_names = ["CAN CH1", "CAN CH2", "CAN INTERNAL"];
448
+ for (var i = 0; i < 3; i++) {
449
+ var can_control = content[channels[i]].control;
450
+ if (can_control != undefined && can_control.control_rx_state != undefined && can_control.control_tx_state != undefined) {
451
+ if (can_control.control_rx_state != 0 || can_control.control_tx_state != 0) {
452
+ var type_list = ["start", "stop"];
453
+ for (var j = 0; j < 2; j++) {
454
+ var type = type_list[j];
455
+ if (can_control[type] != undefined && can_control[type].signal != undefined && can_control[type].signal.factor != undefined && can_control[type].signal.length != undefined) {
456
+ var fields = ["factor", "length"];
457
+ var field_names = ["signal scaling factor", "signal bit length"];
458
+ for (var k = 0; k < 2; k++) {
459
+ if (can_control[type].signal[fields[k]] == 0) {
460
+ dispatch(set({
461
+ type: "warning",
462
+ message: "You have enabled a Control Signal on " + channel_names[i] + " (" + type + ") with a " + field_names[k] + " of 0 - this will result in a constant signal value and is most likely not intended.",
463
+ autoClear: false
464
+ }));
465
+ }
466
+ }
467
+ }
468
+ }
469
+ }
470
+ }
471
+ }
472
+ };
473
+ };
444
474
  var checkConfigTls = function checkConfigTls(content) {
445
475
  return function (dispatch) {
446
476
  if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined) {
@@ -518,7 +548,6 @@ var checkFileSplitOffsetPeriod = function checkFileSplitOffsetPeriod(content) {
518
548
  };
519
549
  var checkRTCAdjustment = function checkRTCAdjustment(content) {
520
550
  return function (dispatch) {
521
- console.log("content.rtc.adjustment", content.rtc.adjustment);
522
551
  if (content.connect != undefined && content.rtc != undefined && content.rtc.adjustment != undefined && content.rtc.adjustment > 400) {
523
552
  dispatch(set({
524
553
  type: "warning",
@@ -543,6 +572,22 @@ var checkConfigTlsPort = function checkConfigTlsPort(content) {
543
572
  }
544
573
  };
545
574
  };
575
+ var checkMissingAPN = function checkMissingAPN(content) {
576
+ return function (dispatch) {
577
+ if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined && content.connect.cellular != undefined && content.connect.cellular.apn != undefined) {
578
+ console.log("content.connect.cellular.apn", content.connect.cellular.apn);
579
+ if (content.connect.s3.server.endpoint != undefined && content.connect.cellular.apn != undefined) {
580
+ if (content.connect.s3.server.endpoint.includes("http") && content.connect.cellular.apn == "") {
581
+ dispatch(set({
582
+ type: "warning",
583
+ message: "Your SIM APN is blank. This is most likely incorrect and may result in the device being unable to connect. Please add the APN if it exists",
584
+ autoClear: false
585
+ }));
586
+ }
587
+ }
588
+ }
589
+ };
590
+ };
546
591
  var checkFileSplitValue = function checkFileSplitValue(content) {
547
592
  return function (dispatch) {
548
593
  if (content.log != undefined && content.log.file != undefined && content.log.file.split_time_period != undefined) {
@@ -570,6 +615,8 @@ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, conte
570
615
  dispatch(checkRTCAdjustment(content));
571
616
  dispatch(checkConfigTlsPort(content));
572
617
  dispatch(checkFileSplitValue(content));
618
+ dispatch(checkMissingAPN(content));
619
+ dispatch(checkConfigControlSignalZeroScalingFactor(content));
573
620
  }
574
621
  dispatch(setConfigContent(content));
575
622
  var blob = new Blob([JSON.stringify(content, null, 2)], {
@@ -670,6 +717,7 @@ var actions = {
670
717
  checkConfigTransmitPeriodDelay: checkConfigTransmitPeriodDelay,
671
718
  checkConfigTransmitMonitoring: checkConfigTransmitMonitoring,
672
719
  checkConfigFiltersDisabled: checkConfigFiltersDisabled,
720
+ checkConfigControlSignalZeroScalingFactor: checkConfigControlSignalZeroScalingFactor,
673
721
  checkConfigTls: checkConfigTls,
674
722
  checkConfigAwsEndpoint: checkConfigAwsEndpoint,
675
723
  checkS3EncryptedPasswordsNoKpub: checkS3EncryptedPasswordsNoKpub,
@@ -677,6 +725,7 @@ var actions = {
677
725
  checkFileSplitOffsetPeriod: checkFileSplitOffsetPeriod,
678
726
  checkRTCAdjustment: checkRTCAdjustment,
679
727
  checkConfigTlsPort: checkConfigTlsPort,
728
+ checkMissingAPN: checkMissingAPN,
680
729
  checkFileSplitValue: checkFileSplitValue,
681
730
  saveUpdatedConfiguration: saveUpdatedConfiguration,
682
731
  setUpdatedFormData: setUpdatedFormData,