config-editor-base 2.0.2 → 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.
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +38 -0
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -373,6 +373,12 @@ var publicSchemaFiles = function publicSchemaFiles(selectedConfig, schemaAry, co
|
|
|
373
373
|
return e.includes(selectedConfig.substr(7, 5));
|
|
374
374
|
});
|
|
375
375
|
|
|
376
|
+
if (!deviceType.includes("GNSS")) {
|
|
377
|
+
schemaAryFiltered = schemaAryFiltered.filter(function (e) {
|
|
378
|
+
return !e.includes("GNSS");
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
|
|
376
382
|
if (deviceType.includes("CANedge")) {
|
|
377
383
|
schemaAryFiltered = schemaAryFiltered.filter(function (e) {
|
|
378
384
|
return e.includes(deviceType);
|
|
@@ -432,6 +438,38 @@ var resetLocalSchemaList = function resetLocalSchemaList() {
|
|
|
432
438
|
};
|
|
433
439
|
var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, content) {
|
|
434
440
|
return function (dispatch) {
|
|
441
|
+
var contentJSON = JSON.parse(content);
|
|
442
|
+
|
|
443
|
+
if (contentJSON.can_2 != undefined) {
|
|
444
|
+
var transmitList1 = contentJSON.can_1.transmit;
|
|
445
|
+
var transmitList2 = contentJSON.can_2.transmit;
|
|
446
|
+
transmitList1Filtered = transmitList1.filter(function (e) {
|
|
447
|
+
return e.period < e.delay;
|
|
448
|
+
});
|
|
449
|
+
transmitList2Filtered = transmitList2.filter(function (e) {
|
|
450
|
+
return e.period < e.delay;
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
console.log("transmitList1Filtered", transmitList1Filtered);
|
|
455
|
+
console.log("transmitList2Filtered", transmitList2Filtered);
|
|
456
|
+
|
|
457
|
+
if (transmitList1Filtered.length > 0) {
|
|
458
|
+
dispatch(set({
|
|
459
|
+
type: "warning",
|
|
460
|
+
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.",
|
|
461
|
+
autoClear: false
|
|
462
|
+
}));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (transmitList2Filtered.length > 0) {
|
|
466
|
+
dispatch(set({
|
|
467
|
+
type: "warning",
|
|
468
|
+
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.",
|
|
469
|
+
autoClear: false
|
|
470
|
+
}));
|
|
471
|
+
}
|
|
472
|
+
|
|
435
473
|
dispatch(setConfigContent(content));
|
|
436
474
|
var blob = new Blob([JSON.stringify(content, null, 2)], {
|
|
437
475
|
type: "text/json"
|