config-editor-base 2.9.1 → 2.9.2
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 +128 -123
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +128 -123
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -1
package/dist/index.modern.js
CHANGED
|
@@ -8,6 +8,7 @@ import Select from 'react-select';
|
|
|
8
8
|
import Files from 'react-files';
|
|
9
9
|
import applyNav, { GENERIC_NAV } from 'rjsf-tabs';
|
|
10
10
|
import { ReactGhLikeDiff } from 'react-gh-like-diff';
|
|
11
|
+
import Ajv from 'ajv';
|
|
11
12
|
|
|
12
13
|
function _arrayLikeToArray(r, a) {
|
|
13
14
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -21892,7 +21893,6 @@ function extractSupportedPidsFromBitmap(rangeStart, bitmapHex, supportedSet) {
|
|
|
21892
21893
|
}
|
|
21893
21894
|
|
|
21894
21895
|
var merge$1 = require("deepmerge");
|
|
21895
|
-
var yourForm$1;
|
|
21896
21896
|
var modeOptions = [{
|
|
21897
21897
|
value: "all",
|
|
21898
21898
|
label: "Select from all PIDs"
|
|
@@ -22203,6 +22203,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22203
22203
|
}
|
|
22204
22204
|
};
|
|
22205
22205
|
_proto.testMergedFile = function testMergedFile() {
|
|
22206
|
+
var _this8 = this;
|
|
22206
22207
|
var _this$state4 = this.state,
|
|
22207
22208
|
generatedConfig = _this$state4.generatedConfig,
|
|
22208
22209
|
enableControlSignal = _this$state4.enableControlSignal,
|
|
@@ -22273,8 +22274,24 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22273
22274
|
this.setState({
|
|
22274
22275
|
mergedConfig: mergedConfigTemp
|
|
22275
22276
|
}, function () {
|
|
22276
|
-
|
|
22277
|
-
|
|
22277
|
+
var schemaContent = _this8.props.schemaContent;
|
|
22278
|
+
if (schemaContent && mergedConfigTemp) {
|
|
22279
|
+
try {
|
|
22280
|
+
var ajv = new Ajv({
|
|
22281
|
+
allErrors: true,
|
|
22282
|
+
strict: false,
|
|
22283
|
+
logger: false
|
|
22284
|
+
});
|
|
22285
|
+
var validate = ajv.compile(schemaContent);
|
|
22286
|
+
var valid = validate(mergedConfigTemp);
|
|
22287
|
+
_this8.setState({
|
|
22288
|
+
mergedConfigValid: valid
|
|
22289
|
+
});
|
|
22290
|
+
} catch (e) {
|
|
22291
|
+
_this8.setState({
|
|
22292
|
+
mergedConfigValid: false
|
|
22293
|
+
});
|
|
22294
|
+
}
|
|
22278
22295
|
}
|
|
22279
22296
|
});
|
|
22280
22297
|
};
|
|
@@ -22322,7 +22339,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22322
22339
|
linkElement.click();
|
|
22323
22340
|
};
|
|
22324
22341
|
_proto.render = function render() {
|
|
22325
|
-
var
|
|
22342
|
+
var _this9 = this;
|
|
22326
22343
|
var _this$state6 = this.state,
|
|
22327
22344
|
toolMode = _this$state6.toolMode,
|
|
22328
22345
|
channel = _this$state6.channel,
|
|
@@ -22333,7 +22350,6 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22333
22350
|
searchQuery = _this$state6.searchQuery,
|
|
22334
22351
|
supportedPids = _this$state6.supportedPids,
|
|
22335
22352
|
generatedConfig = _this$state6.generatedConfig,
|
|
22336
|
-
mergedConfig = _this$state6.mergedConfig,
|
|
22337
22353
|
mergedConfigValid = _this$state6.mergedConfigValid,
|
|
22338
22354
|
csvFileName = _this$state6.csvFileName,
|
|
22339
22355
|
mixedWarning = _this$state6.mixedWarning,
|
|
@@ -22343,7 +22359,6 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22343
22359
|
combinedConfig = _this$state6.combinedConfig;
|
|
22344
22360
|
var _this$props = this.props,
|
|
22345
22361
|
formData = _this$props.formData,
|
|
22346
|
-
schemaContent = _this$props.schemaContent,
|
|
22347
22362
|
editorConfigFiles = _this$props.editorConfigFiles;
|
|
22348
22363
|
var configFileName = editorConfigFiles && editorConfigFiles.length > 0 ? editorConfigFiles[0].name : "";
|
|
22349
22364
|
var isVersion0109 = configFileName.includes("01.09");
|
|
@@ -22387,7 +22402,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22387
22402
|
}, /*#__PURE__*/React.createElement(Files, {
|
|
22388
22403
|
onChange: this.handleCsvUpload,
|
|
22389
22404
|
onError: function onError(error) {
|
|
22390
|
-
return
|
|
22405
|
+
return _this9.props.showAlert("danger", error.message);
|
|
22391
22406
|
},
|
|
22392
22407
|
accepts: [".csv"],
|
|
22393
22408
|
multiple: false,
|
|
@@ -22414,7 +22429,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22414
22429
|
options: channelOptions,
|
|
22415
22430
|
value: channel,
|
|
22416
22431
|
onChange: function onChange(opt) {
|
|
22417
|
-
return
|
|
22432
|
+
return _this9.handleSettingChange("channel", opt);
|
|
22418
22433
|
},
|
|
22419
22434
|
comment: "Select which CAN channel should be used to transmit the OBD requests."
|
|
22420
22435
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -22424,7 +22439,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22424
22439
|
options: bitRateOptions,
|
|
22425
22440
|
value: bitRate,
|
|
22426
22441
|
onChange: function onChange(opt) {
|
|
22427
|
-
return
|
|
22442
|
+
return _this9.handleSettingChange("bitRate", opt);
|
|
22428
22443
|
},
|
|
22429
22444
|
comment: "Cars typically use 500K, trucks/buses may use 250K or 500K."
|
|
22430
22445
|
}))), toolMode !== "test" && /*#__PURE__*/React.createElement("div", {
|
|
@@ -22436,7 +22451,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22436
22451
|
options: canIdOptions,
|
|
22437
22452
|
value: canId,
|
|
22438
22453
|
onChange: function onChange(opt) {
|
|
22439
|
-
return
|
|
22454
|
+
return _this9.handleSettingChange("canId", opt);
|
|
22440
22455
|
},
|
|
22441
22456
|
comment: "Cars typically use 7DF, trucks/buses typically use 18DB33F1."
|
|
22442
22457
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -22446,7 +22461,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22446
22461
|
options: obdModeOptions,
|
|
22447
22462
|
value: obdMode,
|
|
22448
22463
|
onChange: function onChange(opt) {
|
|
22449
|
-
return
|
|
22464
|
+
return _this9.handleSettingChange("obdMode", opt);
|
|
22450
22465
|
},
|
|
22451
22466
|
comment: "Cars use OBD2, trucks/buses may use OBD2 or WWH-OBD."
|
|
22452
22467
|
}))), toolMode !== "test" && /*#__PURE__*/React.createElement("div", {
|
|
@@ -22459,17 +22474,17 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22459
22474
|
max: 10000,
|
|
22460
22475
|
onChange: function onChange(e) {
|
|
22461
22476
|
var val = parseInt(e.target.value) || 0;
|
|
22462
|
-
|
|
22477
|
+
_this9.setState({
|
|
22463
22478
|
spacing: val
|
|
22464
22479
|
});
|
|
22465
22480
|
},
|
|
22466
22481
|
onBlur: function onBlur(e) {
|
|
22467
22482
|
var val = Math.min(10000, Math.max(100, parseInt(e.target.value) || 100));
|
|
22468
|
-
|
|
22483
|
+
_this9.setState({
|
|
22469
22484
|
spacing: val
|
|
22470
22485
|
}, function () {
|
|
22471
|
-
if (
|
|
22472
|
-
|
|
22486
|
+
if (_this9.getSelectedPids().length > 0) {
|
|
22487
|
+
_this9.generateTransmitList();
|
|
22473
22488
|
}
|
|
22474
22489
|
});
|
|
22475
22490
|
}
|
|
@@ -22520,7 +22535,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22520
22535
|
key: pid.uniqueId,
|
|
22521
22536
|
className: "checkbox-white-space",
|
|
22522
22537
|
onClick: function onClick() {
|
|
22523
|
-
return !pid.disabled &&
|
|
22538
|
+
return !pid.disabled && _this9.handlePidToggle(pid.uniqueId);
|
|
22524
22539
|
},
|
|
22525
22540
|
style: {
|
|
22526
22541
|
display: "flex",
|
|
@@ -22546,7 +22561,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22546
22561
|
checked: pid.selected,
|
|
22547
22562
|
disabled: pid.disabled,
|
|
22548
22563
|
onChange: function onChange() {
|
|
22549
|
-
return !pid.disabled &&
|
|
22564
|
+
return !pid.disabled && _this9.handlePidToggle(pid.uniqueId);
|
|
22550
22565
|
}
|
|
22551
22566
|
}), /*#__PURE__*/React.createElement("span", null))), /*#__PURE__*/React.createElement("span", {
|
|
22552
22567
|
className: "binary-text-alt-2",
|
|
@@ -22589,11 +22604,11 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22589
22604
|
type: "checkbox",
|
|
22590
22605
|
checked: enableOBDFilter,
|
|
22591
22606
|
onChange: function onChange() {
|
|
22592
|
-
|
|
22607
|
+
_this9.setState({
|
|
22593
22608
|
enableOBDFilter: !enableOBDFilter
|
|
22594
22609
|
}, function () {
|
|
22595
|
-
if (
|
|
22596
|
-
|
|
22610
|
+
if (_this9.getSelectedPids().length > 0) {
|
|
22611
|
+
_this9.generateTransmitList();
|
|
22597
22612
|
}
|
|
22598
22613
|
});
|
|
22599
22614
|
},
|
|
@@ -22618,11 +22633,11 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22618
22633
|
type: "checkbox",
|
|
22619
22634
|
checked: enableControlSignal,
|
|
22620
22635
|
onChange: function onChange() {
|
|
22621
|
-
|
|
22636
|
+
_this9.setState({
|
|
22622
22637
|
enableControlSignal: !enableControlSignal
|
|
22623
22638
|
}, function () {
|
|
22624
|
-
if (
|
|
22625
|
-
|
|
22639
|
+
if (_this9.getSelectedPids().length > 0) {
|
|
22640
|
+
_this9.generateTransmitList();
|
|
22626
22641
|
}
|
|
22627
22642
|
});
|
|
22628
22643
|
},
|
|
@@ -22667,7 +22682,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22667
22682
|
type: "checkbox",
|
|
22668
22683
|
checked: showPreview,
|
|
22669
22684
|
onChange: function onChange() {
|
|
22670
|
-
return
|
|
22685
|
+
return _this9.setState({
|
|
22671
22686
|
showPreview: !showPreview
|
|
22672
22687
|
});
|
|
22673
22688
|
},
|
|
@@ -22681,20 +22696,7 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
|
|
|
22681
22696
|
}
|
|
22682
22697
|
}, /*#__PURE__*/React.createElement("pre", {
|
|
22683
22698
|
className: "browse-file-preview"
|
|
22684
|
-
}, JSON.stringify(combinedConfig, null, 2))))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null))
|
|
22685
|
-
style: {
|
|
22686
|
-
display: "none"
|
|
22687
|
-
}
|
|
22688
|
-
}, /*#__PURE__*/React.createElement(Form, {
|
|
22689
|
-
validator: validator,
|
|
22690
|
-
onError: this.onValidationError,
|
|
22691
|
-
schema: schemaContent ? schemaContent : {},
|
|
22692
|
-
formData: mergedConfig ? mergedConfig : {},
|
|
22693
|
-
onSubmit: this.onSubmit,
|
|
22694
|
-
ref: function ref(form) {
|
|
22695
|
-
yourForm$1 = form;
|
|
22696
|
-
}
|
|
22697
|
-
})));
|
|
22699
|
+
}, JSON.stringify(combinedConfig, null, 2))))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
|
|
22698
22700
|
};
|
|
22699
22701
|
return OBDTool;
|
|
22700
22702
|
}(React.Component);
|
|
@@ -23120,7 +23122,6 @@ function evaluateFilters(frames, configData, detectedDeviceType) {
|
|
|
23120
23122
|
var _excluded = ["name"],
|
|
23121
23123
|
_excluded2 = ["name"];
|
|
23122
23124
|
var merge$2 = require("deepmerge");
|
|
23123
|
-
var yourForm$2;
|
|
23124
23125
|
var prescalerOptions = [{
|
|
23125
23126
|
value: "none",
|
|
23126
23127
|
label: "None"
|
|
@@ -24048,6 +24049,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24048
24049
|
return filterConfig;
|
|
24049
24050
|
};
|
|
24050
24051
|
_proto.testMergedFile = function testMergedFile() {
|
|
24052
|
+
var _this11 = this;
|
|
24051
24053
|
var _this$state7 = this.state,
|
|
24052
24054
|
generatedFilterConfig = _this$state7.generatedFilterConfig,
|
|
24053
24055
|
filterMergeMode = _this$state7.filterMergeMode;
|
|
@@ -24081,8 +24083,24 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24081
24083
|
this.setState({
|
|
24082
24084
|
mergedConfig: mergedConfigTemp
|
|
24083
24085
|
}, function () {
|
|
24084
|
-
|
|
24085
|
-
|
|
24086
|
+
var schemaContent = _this11.props.schemaContent;
|
|
24087
|
+
if (schemaContent && mergedConfigTemp) {
|
|
24088
|
+
try {
|
|
24089
|
+
var ajv = new Ajv({
|
|
24090
|
+
allErrors: true,
|
|
24091
|
+
strict: false,
|
|
24092
|
+
logger: false
|
|
24093
|
+
});
|
|
24094
|
+
var validate = ajv.compile(schemaContent);
|
|
24095
|
+
var valid = validate(mergedConfigTemp);
|
|
24096
|
+
_this11.setState({
|
|
24097
|
+
mergedConfigValid: valid
|
|
24098
|
+
});
|
|
24099
|
+
} catch (e) {
|
|
24100
|
+
_this11.setState({
|
|
24101
|
+
mergedConfigValid: false
|
|
24102
|
+
});
|
|
24103
|
+
}
|
|
24086
24104
|
}
|
|
24087
24105
|
});
|
|
24088
24106
|
};
|
|
@@ -24290,7 +24308,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24290
24308
|
});
|
|
24291
24309
|
};
|
|
24292
24310
|
_proto.render = function render() {
|
|
24293
|
-
var
|
|
24311
|
+
var _this12 = this;
|
|
24294
24312
|
var _this$state10 = this.state,
|
|
24295
24313
|
csvFileName = _this$state10.csvFileName,
|
|
24296
24314
|
dbcFileNames = _this$state10.dbcFileNames,
|
|
@@ -24329,7 +24347,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24329
24347
|
}, /*#__PURE__*/React.createElement(Files, {
|
|
24330
24348
|
onChange: this.handleCsvUpload,
|
|
24331
24349
|
onError: function onError(error) {
|
|
24332
|
-
return
|
|
24350
|
+
return _this12.props.showAlert("danger", error.message);
|
|
24333
24351
|
},
|
|
24334
24352
|
accepts: [".csv"],
|
|
24335
24353
|
multiple: false,
|
|
@@ -24343,7 +24361,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24343
24361
|
}, /*#__PURE__*/React.createElement(Files, {
|
|
24344
24362
|
onChange: this.handleDbcUpload,
|
|
24345
24363
|
onError: function onError(error) {
|
|
24346
|
-
return
|
|
24364
|
+
return _this12.props.showAlert("danger", error.message);
|
|
24347
24365
|
},
|
|
24348
24366
|
accepts: [".dbc"],
|
|
24349
24367
|
multiple: true,
|
|
@@ -24378,10 +24396,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24378
24396
|
type: "checkbox",
|
|
24379
24397
|
checked: groupJ1939Pgns,
|
|
24380
24398
|
onChange: function onChange() {
|
|
24381
|
-
|
|
24399
|
+
_this12.setState({
|
|
24382
24400
|
groupJ1939Pgns: !groupJ1939Pgns
|
|
24383
24401
|
}, function () {
|
|
24384
|
-
|
|
24402
|
+
_this12.mergeData();
|
|
24385
24403
|
});
|
|
24386
24404
|
},
|
|
24387
24405
|
style: {
|
|
@@ -24391,7 +24409,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24391
24409
|
}), "Group 29-bit IDs as PGNs"), /*#__PURE__*/React.createElement("p", {
|
|
24392
24410
|
className: "field-description field-description-shift"
|
|
24393
24411
|
}, "In J1939/ISOBUS/NMEA protocol use cases it can be relevant to evaluate messages at the 18-bit PGN level instead of the 29-bit ID level.")), csvData && function () {
|
|
24394
|
-
var isEnabled =
|
|
24412
|
+
var isEnabled = _this12.props.formData && _this12.isFirmwareVersionSupported();
|
|
24395
24413
|
return /*#__PURE__*/React.createElement("div", {
|
|
24396
24414
|
className: "form-group pl0 field-string",
|
|
24397
24415
|
style: {
|
|
@@ -24408,9 +24426,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24408
24426
|
}
|
|
24409
24427
|
}, /*#__PURE__*/React.createElement("input", {
|
|
24410
24428
|
type: "checkbox",
|
|
24411
|
-
checked:
|
|
24429
|
+
checked: _this12.state.showFilteredSummary,
|
|
24412
24430
|
onChange: function onChange() {
|
|
24413
|
-
return
|
|
24431
|
+
return _this12.toggleFilteredSummary();
|
|
24414
24432
|
},
|
|
24415
24433
|
disabled: !isEnabled,
|
|
24416
24434
|
style: {
|
|
@@ -24459,10 +24477,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24459
24477
|
}, label, ":"), /*#__PURE__*/React.createElement("input", {
|
|
24460
24478
|
type: "text",
|
|
24461
24479
|
className: "form-control encryption-input",
|
|
24462
|
-
value:
|
|
24480
|
+
value: _this12.state["channelMap" + label],
|
|
24463
24481
|
onChange: function onChange(e) {
|
|
24464
|
-
var
|
|
24465
|
-
return
|
|
24482
|
+
var _this12$setState;
|
|
24483
|
+
return _this12.setState((_this12$setState = {}, _this12$setState["channelMap" + label] = e.target.value, _this12$setState));
|
|
24466
24484
|
},
|
|
24467
24485
|
style: {
|
|
24468
24486
|
width: "36px",
|
|
@@ -24578,11 +24596,11 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24578
24596
|
marginLeft: "8px"
|
|
24579
24597
|
}
|
|
24580
24598
|
}, "Signals")), filteredEntries.map(function (entry) {
|
|
24581
|
-
var isChannelValid =
|
|
24599
|
+
var isChannelValid = _this12.props.deviceType === "CANmod" ? _this12.isChannelValid(entry.channel) : true;
|
|
24582
24600
|
return /*#__PURE__*/React.createElement("div", {
|
|
24583
24601
|
key: entry.uniqueId,
|
|
24584
24602
|
onClick: function onClick() {
|
|
24585
|
-
return isChannelValid &&
|
|
24603
|
+
return isChannelValid && _this12.handleEntryToggle(entry.uniqueId);
|
|
24586
24604
|
},
|
|
24587
24605
|
style: {
|
|
24588
24606
|
display: "flex",
|
|
@@ -24610,7 +24628,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24610
24628
|
checked: entry.selected,
|
|
24611
24629
|
disabled: !isChannelValid,
|
|
24612
24630
|
onChange: function onChange() {
|
|
24613
|
-
return isChannelValid &&
|
|
24631
|
+
return isChannelValid && _this12.handleEntryToggle(entry.uniqueId);
|
|
24614
24632
|
}
|
|
24615
24633
|
}), /*#__PURE__*/React.createElement("span", null))), /*#__PURE__*/React.createElement("span", {
|
|
24616
24634
|
className: "binary-text-alt-2",
|
|
@@ -24647,7 +24665,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24647
24665
|
display: "flex",
|
|
24648
24666
|
alignItems: "center"
|
|
24649
24667
|
}
|
|
24650
|
-
},
|
|
24668
|
+
}, _this12.renderBarChart(entry.isGroup ? entry.groupedPercentage : entry.percentage, maxPercentage), /*#__PURE__*/React.createElement("span", {
|
|
24651
24669
|
style: {
|
|
24652
24670
|
marginLeft: "4px",
|
|
24653
24671
|
fontFamily: "monospace",
|
|
@@ -24738,7 +24756,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24738
24756
|
marginLeft: "4px"
|
|
24739
24757
|
},
|
|
24740
24758
|
onClick: function onClick() {
|
|
24741
|
-
return
|
|
24759
|
+
return _this12.selectTop(30);
|
|
24742
24760
|
}
|
|
24743
24761
|
}, "Top 30"), /*#__PURE__*/React.createElement("span", {
|
|
24744
24762
|
style: {
|
|
@@ -24751,7 +24769,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24751
24769
|
cursor: "pointer"
|
|
24752
24770
|
},
|
|
24753
24771
|
onClick: function onClick() {
|
|
24754
|
-
return
|
|
24772
|
+
return _this12.selectTop(50);
|
|
24755
24773
|
}
|
|
24756
24774
|
}, "Top 50"), /*#__PURE__*/React.createElement("span", {
|
|
24757
24775
|
style: {
|
|
@@ -24764,7 +24782,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24764
24782
|
cursor: "pointer"
|
|
24765
24783
|
},
|
|
24766
24784
|
onClick: function onClick() {
|
|
24767
|
-
return
|
|
24785
|
+
return _this12.selectMatched(true);
|
|
24768
24786
|
}
|
|
24769
24787
|
}, "Matched"), /*#__PURE__*/React.createElement("span", {
|
|
24770
24788
|
style: {
|
|
@@ -24777,13 +24795,13 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24777
24795
|
cursor: "pointer"
|
|
24778
24796
|
},
|
|
24779
24797
|
onClick: function onClick() {
|
|
24780
|
-
return
|
|
24798
|
+
return _this12.selectMatched(false);
|
|
24781
24799
|
}
|
|
24782
24800
|
}, "Unmatched")), csvData && function () {
|
|
24783
|
-
var activeCsvData =
|
|
24784
|
-
var isFiltered =
|
|
24785
|
-
var originalFileSize =
|
|
24786
|
-
var filteredFileSize = isFiltered ? originalFileSize * (1 -
|
|
24801
|
+
var activeCsvData = _this12.state.showFilteredSummary && _this12.state.filteredCsvData ? _this12.state.filteredCsvData : csvData;
|
|
24802
|
+
var isFiltered = _this12.state.showFilteredSummary && _this12.state.filteredCsvData;
|
|
24803
|
+
var originalFileSize = _this12.csvFileSize / (1024 * 1024);
|
|
24804
|
+
var filteredFileSize = isFiltered ? originalFileSize * (1 - _this12.state.filterReductionPercent / 100) : originalFileSize;
|
|
24787
24805
|
return /*#__PURE__*/React.createElement("div", {
|
|
24788
24806
|
style: {
|
|
24789
24807
|
fontSize: "12px",
|
|
@@ -24810,7 +24828,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24810
24828
|
color: "#5cb85c",
|
|
24811
24829
|
marginTop: "4px"
|
|
24812
24830
|
}
|
|
24813
|
-
}, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null,
|
|
24831
|
+
}, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null, _this12.state.filterReductionPercent.toFixed(1), "%"), ")"));
|
|
24814
24832
|
}(), function () {
|
|
24815
24833
|
var hasSelection = mergedEntries.some(function (e) {
|
|
24816
24834
|
return e.selected;
|
|
@@ -24836,8 +24854,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24836
24854
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24837
24855
|
className: "col-xs-6",
|
|
24838
24856
|
style: {
|
|
24839
|
-
opacity:
|
|
24840
|
-
pointerEvents:
|
|
24857
|
+
opacity: _this12.props.deviceType === "CANmod" ? 0.5 : 1,
|
|
24858
|
+
pointerEvents: _this12.props.deviceType === "CANmod" ? "none" : "auto"
|
|
24841
24859
|
}
|
|
24842
24860
|
}, /*#__PURE__*/React.createElement(SimpleDropdown, {
|
|
24843
24861
|
name: "Type",
|
|
@@ -24848,59 +24866,59 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24848
24866
|
value: "rejection",
|
|
24849
24867
|
label: "Rejection"
|
|
24850
24868
|
}],
|
|
24851
|
-
value:
|
|
24869
|
+
value: _this12.state.filterType,
|
|
24852
24870
|
onChange: function onChange(opt) {
|
|
24853
|
-
return
|
|
24871
|
+
return _this12.setState({
|
|
24854
24872
|
filterType: opt.value
|
|
24855
24873
|
}, function () {
|
|
24856
|
-
return
|
|
24874
|
+
return _this12.generateFilterConfig();
|
|
24857
24875
|
});
|
|
24858
24876
|
}
|
|
24859
|
-
}),
|
|
24877
|
+
}), _this12.props.deviceType === "CANmod" && /*#__PURE__*/React.createElement("span", {
|
|
24860
24878
|
className: "field-description",
|
|
24861
24879
|
style: {
|
|
24862
24880
|
fontSize: "11px",
|
|
24863
24881
|
color: "#999"
|
|
24864
24882
|
}
|
|
24865
|
-
}, "CANmod only supports acceptance filters")),
|
|
24883
|
+
}, "CANmod only supports acceptance filters")), _this12.state.filterType === "acceptance" && /*#__PURE__*/React.createElement("div", {
|
|
24866
24884
|
className: "col-xs-6"
|
|
24867
24885
|
}, /*#__PURE__*/React.createElement(SimpleDropdown, {
|
|
24868
24886
|
name: "Prescaler",
|
|
24869
24887
|
options: prescalerOptions,
|
|
24870
|
-
value:
|
|
24888
|
+
value: _this12.state.prescalerType,
|
|
24871
24889
|
onChange: function onChange(opt) {
|
|
24872
|
-
return
|
|
24890
|
+
return _this12.setState({
|
|
24873
24891
|
prescalerType: opt.value
|
|
24874
24892
|
}, function () {
|
|
24875
|
-
return
|
|
24893
|
+
return _this12.generateFilterConfig();
|
|
24876
24894
|
});
|
|
24877
24895
|
}
|
|
24878
|
-
}))),
|
|
24896
|
+
}))), _this12.state.filterType === "acceptance" && _this12.state.prescalerType !== "none" && /*#__PURE__*/React.createElement("div", {
|
|
24879
24897
|
className: "form-group pl0 field-string"
|
|
24880
|
-
},
|
|
24898
|
+
}, _this12.state.prescalerType === "count" && "Count value", _this12.state.prescalerType === "time" && "Time interval (ms)", _this12.state.prescalerType === "data" && "Data mask (hex)", (_this12.state.prescalerType === "count" || _this12.state.prescalerType === "time") && /*#__PURE__*/React.createElement("input", {
|
|
24881
24899
|
type: "number",
|
|
24882
24900
|
className: "form-control encryption-input",
|
|
24883
24901
|
min: "1",
|
|
24884
|
-
max:
|
|
24885
|
-
value:
|
|
24902
|
+
max: _this12.state.prescalerType === "count" ? 256 : 4194304,
|
|
24903
|
+
value: _this12.state.prescalerValue,
|
|
24886
24904
|
onChange: function onChange(e) {
|
|
24887
|
-
return
|
|
24905
|
+
return _this12.setState({
|
|
24888
24906
|
prescalerValue: parseInt(e.target.value) || 1
|
|
24889
24907
|
}, function () {
|
|
24890
|
-
return
|
|
24908
|
+
return _this12.generateFilterConfig();
|
|
24891
24909
|
});
|
|
24892
24910
|
}
|
|
24893
|
-
}),
|
|
24911
|
+
}), _this12.state.prescalerType === "data" && /*#__PURE__*/React.createElement("input", {
|
|
24894
24912
|
type: "text",
|
|
24895
24913
|
className: "form-control encryption-input",
|
|
24896
|
-
value:
|
|
24914
|
+
value: _this12.state.dataPrescalerMask,
|
|
24897
24915
|
onChange: function onChange(e) {
|
|
24898
24916
|
var val = e.target.value.toUpperCase();
|
|
24899
24917
|
if (/^[a-fA-F0-9]*$/.test(val) && val.length <= 16) {
|
|
24900
|
-
|
|
24918
|
+
_this12.setState({
|
|
24901
24919
|
dataPrescalerMask: val
|
|
24902
24920
|
}, function () {
|
|
24903
|
-
return
|
|
24921
|
+
return _this12.generateFilterConfig();
|
|
24904
24922
|
});
|
|
24905
24923
|
}
|
|
24906
24924
|
},
|
|
@@ -24911,7 +24929,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24911
24929
|
}
|
|
24912
24930
|
}), /*#__PURE__*/React.createElement("span", {
|
|
24913
24931
|
className: "field-description field-description-shift"
|
|
24914
|
-
},
|
|
24932
|
+
}, _this12.state.prescalerType === "count" && "Accept every Nth message (1-256)", _this12.state.prescalerType === "time" && "Minimum time between messages (1-4194304 ms)", _this12.state.prescalerType === "data" && "Hex mask for data change detection")), /*#__PURE__*/React.createElement("div", {
|
|
24915
24933
|
style: {
|
|
24916
24934
|
display: "flex",
|
|
24917
24935
|
alignItems: "center",
|
|
@@ -24931,12 +24949,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24931
24949
|
type: "radio",
|
|
24932
24950
|
name: "filterMergeMode",
|
|
24933
24951
|
value: "replace",
|
|
24934
|
-
checked:
|
|
24952
|
+
checked: _this12.state.filterMergeMode === "replace",
|
|
24935
24953
|
onChange: function onChange(e) {
|
|
24936
|
-
return
|
|
24954
|
+
return _this12.setState({
|
|
24937
24955
|
filterMergeMode: e.target.value
|
|
24938
24956
|
}, function () {
|
|
24939
|
-
return
|
|
24957
|
+
return _this12.generateFilterConfig();
|
|
24940
24958
|
});
|
|
24941
24959
|
},
|
|
24942
24960
|
style: {
|
|
@@ -24959,12 +24977,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24959
24977
|
type: "radio",
|
|
24960
24978
|
name: "filterMergeMode",
|
|
24961
24979
|
value: "append_top",
|
|
24962
|
-
checked:
|
|
24980
|
+
checked: _this12.state.filterMergeMode === "append_top",
|
|
24963
24981
|
onChange: function onChange(e) {
|
|
24964
|
-
return
|
|
24982
|
+
return _this12.setState({
|
|
24965
24983
|
filterMergeMode: e.target.value
|
|
24966
24984
|
}, function () {
|
|
24967
|
-
return
|
|
24985
|
+
return _this12.generateFilterConfig();
|
|
24968
24986
|
});
|
|
24969
24987
|
},
|
|
24970
24988
|
style: {
|
|
@@ -24987,12 +25005,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
24987
25005
|
type: "radio",
|
|
24988
25006
|
name: "filterMergeMode",
|
|
24989
25007
|
value: "append_bottom",
|
|
24990
|
-
checked:
|
|
25008
|
+
checked: _this12.state.filterMergeMode === "append_bottom",
|
|
24991
25009
|
onChange: function onChange(e) {
|
|
24992
|
-
return
|
|
25010
|
+
return _this12.setState({
|
|
24993
25011
|
filterMergeMode: e.target.value
|
|
24994
25012
|
}, function () {
|
|
24995
|
-
return
|
|
25013
|
+
return _this12.generateFilterConfig();
|
|
24996
25014
|
});
|
|
24997
25015
|
},
|
|
24998
25016
|
style: {
|
|
@@ -25026,9 +25044,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25026
25044
|
}, 0);
|
|
25027
25045
|
return " (" + count11Bit + " 11-bit, " + count29Bit + " 29-bit) | " + sizePercent.toFixed(1) + "%";
|
|
25028
25046
|
}()), function () {
|
|
25029
|
-
var isFirmwareSupported =
|
|
25030
|
-
var isCanmod =
|
|
25031
|
-
var isCanmodRouter = isCanmod &&
|
|
25047
|
+
var isFirmwareSupported = _this12.isFirmwareVersionSupported();
|
|
25048
|
+
var isCanmod = _this12.props.deviceType === "CANmod";
|
|
25049
|
+
var isCanmodRouter = isCanmod && _this12.isCanmodRouter();
|
|
25032
25050
|
var minFirmware = isCanmod ? MIN_FIRMWARE_CANMOD_ROUTER : MIN_FIRMWARE_CANEDGE;
|
|
25033
25051
|
var isDeviceSupported = !isCanmod || isCanmodRouter;
|
|
25034
25052
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -25039,20 +25057,20 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25039
25057
|
}
|
|
25040
25058
|
}, /*#__PURE__*/React.createElement("button", {
|
|
25041
25059
|
className: "btn btn-primary",
|
|
25042
|
-
onClick:
|
|
25043
|
-
disabled: !
|
|
25060
|
+
onClick: _this12.onMerge,
|
|
25061
|
+
disabled: !_this12.props.formData || Object.keys(_this12.props.formData).length === 0 || _this12.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
|
|
25044
25062
|
}, "Merge files"), /*#__PURE__*/React.createElement("button", {
|
|
25045
25063
|
className: "btn btn-default",
|
|
25046
|
-
onClick:
|
|
25047
|
-
disabled: Object.keys(
|
|
25048
|
-
}, "Download JSON")),
|
|
25064
|
+
onClick: _this12.onDownload,
|
|
25065
|
+
disabled: Object.keys(_this12.state.generatedFilterConfig).length === 0
|
|
25066
|
+
}, "Download JSON")), _this12.props.formData && Object.keys(_this12.props.formData).length > 0 && isDeviceSupported && !isFirmwareSupported && /*#__PURE__*/React.createElement("div", {
|
|
25049
25067
|
style: {
|
|
25050
25068
|
fontSize: "12px",
|
|
25051
25069
|
color: "#666",
|
|
25052
25070
|
marginTop: "8px"
|
|
25053
25071
|
}
|
|
25054
25072
|
}, "Merging requires firmware ", minFirmware, ".XX+ - please update your device"));
|
|
25055
|
-
}(), Object.keys(
|
|
25073
|
+
}(), Object.keys(_this12.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
25056
25074
|
style: {
|
|
25057
25075
|
marginTop: "10px"
|
|
25058
25076
|
}
|
|
@@ -25065,17 +25083,17 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25065
25083
|
}
|
|
25066
25084
|
}, /*#__PURE__*/React.createElement("input", {
|
|
25067
25085
|
type: "checkbox",
|
|
25068
|
-
checked:
|
|
25086
|
+
checked: _this12.state.showFilterPreview,
|
|
25069
25087
|
onChange: function onChange() {
|
|
25070
|
-
return
|
|
25071
|
-
showFilterPreview: !
|
|
25088
|
+
return _this12.setState({
|
|
25089
|
+
showFilterPreview: !_this12.state.showFilterPreview
|
|
25072
25090
|
});
|
|
25073
25091
|
},
|
|
25074
25092
|
style: {
|
|
25075
25093
|
marginRight: "6px",
|
|
25076
25094
|
marginBottom: "4px"
|
|
25077
25095
|
}
|
|
25078
|
-
}), "Show partial config preview"),
|
|
25096
|
+
}), "Show partial config preview"), _this12.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
|
|
25079
25097
|
style: {
|
|
25080
25098
|
marginTop: "10px"
|
|
25081
25099
|
}
|
|
@@ -25086,21 +25104,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
|
|
|
25086
25104
|
overflow: "auto",
|
|
25087
25105
|
fontSize: "11px"
|
|
25088
25106
|
}
|
|
25089
|
-
}, JSON.stringify(
|
|
25090
|
-
}()), /*#__PURE__*/React.createElement("div",
|
|
25091
|
-
style: {
|
|
25092
|
-
display: "none"
|
|
25093
|
-
}
|
|
25094
|
-
}, /*#__PURE__*/React.createElement(Form, {
|
|
25095
|
-
validator: validator,
|
|
25096
|
-
onError: this.onValidationError,
|
|
25097
|
-
schema: this.props.schemaContent ? this.props.schemaContent : {},
|
|
25098
|
-
formData: this.state.mergedConfig ? this.state.mergedConfig : {},
|
|
25099
|
-
onSubmit: this.onSubmit,
|
|
25100
|
-
ref: function ref(form) {
|
|
25101
|
-
yourForm$2 = form;
|
|
25102
|
-
}
|
|
25103
|
-
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
|
|
25107
|
+
}, JSON.stringify(_this12.state.generatedFilterConfig, null, 2)))));
|
|
25108
|
+
}()), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
|
|
25104
25109
|
};
|
|
25105
25110
|
return FilterBuilderTool;
|
|
25106
25111
|
}(React.Component);
|