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.
package/dist/index.js CHANGED
@@ -233,8 +233,6 @@ var handleUploadedFile = function handleUploadedFile(file, dropdown, schemaAry,
233
233
  if (contentJSON != null) {
234
234
  switch (true) {
235
235
  case type == "uischema" && isValidUISchema(file.name):
236
- console.log("contentJSON", contentJSON);
237
- console.log("fileNameDisplay", fileNameDisplay);
238
236
  dispatch(setUISchemaContent(contentJSON));
239
237
  dispatch(resetLocalUISchemaList());
240
238
  dispatch(setUISchemaFile([fileNameDisplay]));
@@ -348,7 +346,6 @@ var publicSchemaFiles = function publicSchemaFiles(selectedConfig, schemaAry, co
348
346
  console.log("Unable to load embedded Rule Schema");
349
347
  }
350
348
  if (uiSchemaAryFiltered && uiSchemaAryFiltered.length) {
351
- console.log("uiSchemaAryFiltered", uiSchemaAryFiltered);
352
349
  dispatch(resetUISchemaList());
353
350
  dispatch(setUISchemaFile(uiSchemaAryFiltered));
354
351
  dispatch(setUISchemaContent(loadFile(uiSchemaAryFiltered[0])));
@@ -408,6 +405,29 @@ var checkConfigTransmitPeriodDelay = function checkConfigTransmitPeriodDelay(con
408
405
  }
409
406
  };
410
407
  };
408
+ var checkConfigTransmitExceedLimits = function checkConfigTransmitExceedLimits(content) {
409
+ return function (dispatch) {
410
+ var transmitList = [];
411
+ for (var i = 1; i <= 2; i++) {
412
+ if (content["can_" + i] && Array.isArray(content["can_" + i].transmit)) {
413
+ transmitList = transmitList.concat(content["can_" + i].transmit);
414
+ }
415
+ }
416
+ var messageCount = transmitList.length;
417
+ var byteCount = transmitList.reduce(function (total, message) {
418
+ return total + (message.data ? message.data.length / 2 : 0);
419
+ }, 0);
420
+ var MAX_MESSAGES = 224;
421
+ var MAX_BYTES = 4096;
422
+ if (messageCount > MAX_MESSAGES || byteCount > MAX_BYTES) {
423
+ dispatch(set({
424
+ type: "warning",
425
+ 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",
426
+ autoClear: false
427
+ }));
428
+ }
429
+ };
430
+ };
411
431
  var checkConfigTransmitMonitoring = function checkConfigTransmitMonitoring(content) {
412
432
  return function (dispatch) {
413
433
  for (var i = 1; i < 3; i++) {
@@ -423,6 +443,24 @@ var checkConfigTransmitMonitoring = function checkConfigTransmitMonitoring(conte
423
443
  }
424
444
  };
425
445
  };
446
+ var checkConfigTransmitMonitoringRouting = function checkConfigTransmitMonitoringRouting(content) {
447
+ return function (dispatch) {
448
+ if (content["routing"] && content["routing"].length > 0) {
449
+ content["routing"].forEach(function (route) {
450
+ if (route.state === 1 && (route.chn_dst === 1 || route.chn_dst === 2)) {
451
+ var channelKey = "can_" + route.chn_dst;
452
+ if (content[channelKey] && content[channelKey].phy && content[channelKey].phy.mode !== 0) {
453
+ dispatch(set({
454
+ type: "warning",
455
+ 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.",
456
+ autoClear: false
457
+ }));
458
+ }
459
+ }
460
+ });
461
+ }
462
+ };
463
+ };
426
464
  var checkConfigFiltersDisabled = function checkConfigFiltersDisabled(content) {
427
465
  return function (dispatch) {
428
466
  for (var i = 1; i < 3; i++) {
@@ -577,7 +615,6 @@ var checkConfigTlsPort = function checkConfigTlsPort(content) {
577
615
  var checkMissingAPN = function checkMissingAPN(content) {
578
616
  return function (dispatch) {
579
617
  if (content.connect != undefined && content.connect.s3 != undefined && content.connect.s3.server != undefined && content.connect.cellular != undefined && content.connect.cellular.apn != undefined) {
580
- console.log("content.connect.cellular.apn", content.connect.cellular.apn);
581
618
  if (content.connect.s3.server.endpoint != undefined && content.connect.cellular.apn != undefined) {
582
619
  if (content.connect.s3.server.endpoint.includes("http") && content.connect.cellular.apn == "") {
583
620
  dispatch(set({
@@ -701,6 +738,8 @@ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, conte
701
738
  if (content.can_2 != undefined) {
702
739
  dispatch(checkConfigTransmitPeriodDelay(content));
703
740
  dispatch(checkConfigTransmitMonitoring(content));
741
+ dispatch(checkConfigTransmitMonitoringRouting(content));
742
+ dispatch(checkConfigTransmitExceedLimits(content));
704
743
  dispatch(checkConfigFiltersDisabled(content));
705
744
  dispatch(checkConfigTls(content));
706
745
  dispatch(checkConfigAwsEndpoint(content));
@@ -817,7 +856,9 @@ var actions = {
817
856
  resetFiles: resetFiles,
818
857
  resetLocalSchemaList: resetLocalSchemaList,
819
858
  checkConfigTransmitPeriodDelay: checkConfigTransmitPeriodDelay,
859
+ checkConfigTransmitExceedLimits: checkConfigTransmitExceedLimits,
820
860
  checkConfigTransmitMonitoring: checkConfigTransmitMonitoring,
861
+ checkConfigTransmitMonitoringRouting: checkConfigTransmitMonitoringRouting,
821
862
  checkConfigFiltersDisabled: checkConfigFiltersDisabled,
822
863
  checkConfigControlSignalZeroScalingFactor: checkConfigControlSignalZeroScalingFactor,
823
864
  checkConfigTls: checkConfigTls,