config-editor-base 2.9.7 → 2.9.9

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
@@ -21826,8 +21826,11 @@ function isObdResponse29Bit(canId) {
21826
21826
  }
21827
21827
 
21828
21828
  function parseSupportedPids(csvContent) {
21829
- var frames = parseCanFrameCsv(csvContent);
21830
- var receiveFrames = getReceiveFrames(frames);
21829
+ var parseResult = parseCanFrameCsv(csvContent);
21830
+ if (parseResult.error) {
21831
+ throw new Error(parseResult.error);
21832
+ }
21833
+ var receiveFrames = getReceiveFrames(parseResult.frames);
21831
21834
  var obd11BitResponses = receiveFrames.filter(function (f) {
21832
21835
  return f.ide === 0 && f.id === '7E8';
21833
21836
  });
@@ -21871,7 +21874,7 @@ function parseSupportedPids(csvContent) {
21871
21874
  transmitId: use29Bit ? '18DB33F1' : '7DF',
21872
21875
  canIdType: use29Bit ? '29bit' : '11bit',
21873
21876
  responseCount: relevantResponses.length,
21874
- totalFrames: frames.length,
21877
+ totalFrames: parseResult.frames.length,
21875
21878
  hasMixedIds: hasBothIdTypes,
21876
21879
  hasMixedProtocols: hasMixedProtocols,
21877
21880
  allProtocolsDetected: Array.from(protocolsDetected),
@@ -24283,7 +24286,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24283
24286
  filterType = _this$state6.filterType,
24284
24287
  prescalerType = _this$state6.prescalerType,
24285
24288
  prescalerValue = _this$state6.prescalerValue,
24286
- dataPrescalerMask = _this$state6.dataPrescalerMask;
24289
+ dataPrescalerMask = _this$state6.dataPrescalerMask,
24290
+ csvData = _this$state6.csvData;
24287
24291
  var selectedEntries = mergedEntries.filter(function (e) {
24288
24292
  return e.selected;
24289
24293
  });
@@ -24407,15 +24411,33 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24407
24411
  } else if (isCanmodRouter) {
24408
24412
  var isExtended = _entry4.idInt > 0x7FF;
24409
24413
  var idHex = parseInt(_entry4.id, 16).toString(16).toUpperCase();
24410
- var _filter = {
24411
- name: (_entry4.messageName || idHex).substring(0, 16),
24412
- state: 1,
24413
- id_format: isExtended ? 1 : 0,
24414
- frame_format: 2,
24415
- f1: idHex,
24416
- f2: isExtended ? "1FFFFFFF" : "7FF",
24417
- prescaler_type: prescaler_type
24418
- };
24414
+ var isDbcOnlyJ1939 = !csvData && _entry4.isJ1939 && isExtended;
24415
+ var _filter = void 0;
24416
+ if (isDbcOnlyJ1939) {
24417
+ var _pgn = extractPgn$1(_entry4.idInt);
24418
+ var _isPdu = (_pgn & 0xFF00) < 0xF000;
24419
+ var _mask = _isPdu ? "3FF0000" : "3FFFF00";
24420
+ var _filterId = _isPdu ? ((_pgn & 0x3FF00) << 8).toString(16).toUpperCase() : (_pgn << 8).toString(16).toUpperCase();
24421
+ _filter = {
24422
+ name: (_entry4.messageName || "PGN " + _pgn.toString(16).toUpperCase()).substring(0, 16),
24423
+ state: 1,
24424
+ id_format: 1,
24425
+ frame_format: 2,
24426
+ f1: _filterId,
24427
+ f2: _mask,
24428
+ prescaler_type: prescaler_type
24429
+ };
24430
+ } else {
24431
+ _filter = {
24432
+ name: (_entry4.messageName || idHex).substring(0, 16),
24433
+ state: 1,
24434
+ id_format: isExtended ? 1 : 0,
24435
+ frame_format: 2,
24436
+ f1: idHex,
24437
+ f2: isExtended ? "1FFFFFFF" : "7FF",
24438
+ prescaler_type: prescaler_type
24439
+ };
24440
+ }
24419
24441
  if (prescaler_value !== undefined) {
24420
24442
  _filter.prescaler_value = prescaler_value;
24421
24443
  }
@@ -24423,16 +24445,35 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24423
24445
  } else {
24424
24446
  var _isExtended = _entry4.idInt > 0x7FF;
24425
24447
  var _idHex = _entry4.id.toUpperCase();
24426
- var _filter2 = {
24427
- name: (_entry4.messageName || _idHex).substring(0, 16),
24428
- state: 1,
24429
- type: filterTypeValue,
24430
- id_format: _isExtended ? 1 : 0,
24431
- method: 0,
24432
- f1: _idHex,
24433
- f2: _idHex,
24434
- prescaler_type: prescaler_type
24435
- };
24448
+ var _isDbcOnlyJ = !csvData && _entry4.isJ1939 && _isExtended;
24449
+ var _filter2 = void 0;
24450
+ if (_isDbcOnlyJ) {
24451
+ var _pgn2 = extractPgn$1(_entry4.idInt);
24452
+ var _isPdu2 = (_pgn2 & 0xFF00) < 0xF000;
24453
+ var _mask2 = _isPdu2 ? "3FF0000" : "3FFFF00";
24454
+ var _filterId2 = _isPdu2 ? ((_pgn2 & 0x3FF00) << 8).toString(16).toUpperCase() : (_pgn2 << 8).toString(16).toUpperCase();
24455
+ _filter2 = {
24456
+ name: (_entry4.messageName || "PGN " + _pgn2.toString(16).toUpperCase()).substring(0, 16),
24457
+ state: 1,
24458
+ type: filterTypeValue,
24459
+ id_format: 1,
24460
+ method: 1,
24461
+ f1: _filterId2,
24462
+ f2: _mask2,
24463
+ prescaler_type: prescaler_type
24464
+ };
24465
+ } else {
24466
+ _filter2 = {
24467
+ name: (_entry4.messageName || _idHex).substring(0, 16),
24468
+ state: 1,
24469
+ type: filterTypeValue,
24470
+ id_format: _isExtended ? 1 : 0,
24471
+ method: 0,
24472
+ f1: _idHex,
24473
+ f2: _idHex,
24474
+ prescaler_type: prescaler_type
24475
+ };
24476
+ }
24436
24477
  if (prescaler_value !== undefined) {
24437
24478
  _filter2.prescaler_value = prescaler_value;
24438
24479
  }