config-editor-base 2.7.3 → 2.7.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.
@@ -230,8 +230,6 @@ var handleUploadedFile = function handleUploadedFile(file, dropdown, schemaAry,
230
230
  if (contentJSON != null) {
231
231
  switch (true) {
232
232
  case type == "uischema" && isValidUISchema(file.name):
233
- console.log("contentJSON", contentJSON);
234
- console.log("fileNameDisplay", fileNameDisplay);
235
233
  dispatch(setUISchemaContent(contentJSON));
236
234
  dispatch(resetLocalUISchemaList());
237
235
  dispatch(setUISchemaFile([fileNameDisplay]));
@@ -345,7 +343,6 @@ var publicSchemaFiles = function publicSchemaFiles(selectedConfig, schemaAry, co
345
343
  console.log("Unable to load embedded Rule Schema");
346
344
  }
347
345
  if (uiSchemaAryFiltered && uiSchemaAryFiltered.length) {
348
- console.log("uiSchemaAryFiltered", uiSchemaAryFiltered);
349
346
  dispatch(resetUISchemaList());
350
347
  dispatch(setUISchemaFile(uiSchemaAryFiltered));
351
348
  dispatch(setUISchemaContent(loadFile(uiSchemaAryFiltered[0])));
@@ -405,6 +402,29 @@ var checkConfigTransmitPeriodDelay = function checkConfigTransmitPeriodDelay(con
405
402
  }
406
403
  };
407
404
  };
405
+ var checkConfigTransmitExceedLimits = function checkConfigTransmitExceedLimits(content) {
406
+ return function (dispatch) {
407
+ var transmitList = [];
408
+ for (var i = 1; i <= 2; i++) {
409
+ if (content["can_" + i] && Array.isArray(content["can_" + i].transmit)) {
410
+ transmitList = transmitList.concat(content["can_" + i].transmit);
411
+ }
412
+ }
413
+ var messageCount = transmitList.length;
414
+ var byteCount = transmitList.reduce(function (total, message) {
415
+ return total + (message.data ? message.data.length / 2 : 0);
416
+ }, 0);
417
+ var MAX_MESSAGES = 224;
418
+ var MAX_BYTES = 4096;
419
+ if (messageCount > MAX_MESSAGES || byteCount > MAX_BYTES) {
420
+ dispatch(set({
421
+ type: "warning",
422
+ message: "Your CAN transmit list(s) exceed the limits: " + messageCount + " messages (max 224) and " + byteCount + " bytes (max 4096). This is invalid and will cause the device to reject your Configuration File",
423
+ autoClear: false
424
+ }));
425
+ }
426
+ };
427
+ };
408
428
  var checkConfigTransmitMonitoring = function checkConfigTransmitMonitoring(content) {
409
429
  return function (dispatch) {
410
430
  for (var i = 1; i < 3; i++) {
@@ -420,6 +440,24 @@ var checkConfigTransmitMonitoring = function checkConfigTransmitMonitoring(conte
420
440
  }
421
441
  };
422
442
  };
443
+ var checkConfigTransmitMonitoringRouting = function checkConfigTransmitMonitoringRouting(content) {
444
+ return function (dispatch) {
445
+ if (content["routing"] && content["routing"].length > 0) {
446
+ content["routing"].forEach(function (route) {
447
+ if (route.state === 1 && (route.chn_dst === 1 || route.chn_dst === 2)) {
448
+ var channelKey = "can_" + route.chn_dst;
449
+ if (content[channelKey] && content[channelKey].phy && content[channelKey].phy.mode !== 0) {
450
+ dispatch(set({
451
+ type: "warning",
452
+ message: "You are routing a message onto CAN CH" + route.chn_dst + ", but the device will not route any messages unless the CAN CH" + route.chn_dst + " mode is set to Normal.",
453
+ autoClear: false
454
+ }));
455
+ }
456
+ }
457
+ });
458
+ }
459
+ };
460
+ };
423
461
  var checkConfigFiltersDisabled = function checkConfigFiltersDisabled(content) {
424
462
  return function (dispatch) {
425
463
  for (var i = 1; i < 3; i++) {
@@ -574,7 +612,6 @@ var checkConfigTlsPort = function checkConfigTlsPort(content) {
574
612
  var checkMissingAPN = function checkMissingAPN(content) {
575
613
  return function (dispatch) {
576
614
  if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined && content.connect.cellular != undefined && content.connect.cellular.apn != undefined) {
577
- console.log("content.connect.cellular.apn", content.connect.cellular.apn);
578
615
  if (content.connect.s3.server.endpoint != undefined && content.connect.cellular.apn != undefined) {
579
616
  if (content.connect.s3.server.endpoint.includes("http") && content.connect.cellular.apn == "") {
580
617
  dispatch(set({
@@ -698,6 +735,8 @@ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, conte
698
735
  if (content.can_2 != undefined) {
699
736
  dispatch(checkConfigTransmitPeriodDelay(content));
700
737
  dispatch(checkConfigTransmitMonitoring(content));
738
+ dispatch(checkConfigTransmitMonitoringRouting(content));
739
+ dispatch(checkConfigTransmitExceedLimits(content));
701
740
  dispatch(checkConfigFiltersDisabled(content));
702
741
  dispatch(checkConfigTls(content));
703
742
  dispatch(checkConfigAwsEndpoint(content));
@@ -814,7 +853,9 @@ var actions = {
814
853
  resetFiles: resetFiles,
815
854
  resetLocalSchemaList: resetLocalSchemaList,
816
855
  checkConfigTransmitPeriodDelay: checkConfigTransmitPeriodDelay,
856
+ checkConfigTransmitExceedLimits: checkConfigTransmitExceedLimits,
817
857
  checkConfigTransmitMonitoring: checkConfigTransmitMonitoring,
858
+ checkConfigTransmitMonitoringRouting: checkConfigTransmitMonitoringRouting,
818
859
  checkConfigFiltersDisabled: checkConfigFiltersDisabled,
819
860
  checkConfigControlSignalZeroScalingFactor: checkConfigControlSignalZeroScalingFactor,
820
861
  checkConfigTls: checkConfigTls,