config-editor-base 3.0.4 → 3.0.5

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
@@ -21760,6 +21760,8 @@ function parseSupportedPids(csvContent) {
21760
21760
  var SUPPORTED_PIDS_QUERY_VALUES = [0x00, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0];
21761
21761
  var protocolsDetected = new Set();
21762
21762
  var supportedPidsSet = new Set();
21763
+ var foundSupportedPidQueries = new Set();
21764
+ var rangesIndicatingMore = new Set();
21763
21765
  for (var _iterator = _createForOfIteratorHelperLoose(relevantResponses), _step; !(_step = _iterator()).done;) {
21764
21766
  var frame = _step.value;
21765
21767
  var data = frame.dataBytes.toUpperCase();
@@ -21768,16 +21770,40 @@ function parseSupportedPids(csvContent) {
21768
21770
  var pidRangeStart = parseInt(data.substring(4, 6), 16);
21769
21771
  if (!SUPPORTED_PIDS_QUERY_VALUES.includes(pidRangeStart)) continue;
21770
21772
  protocolsDetected.add('OBD2');
21773
+ foundSupportedPidQueries.add(pidRangeStart);
21771
21774
  var supportBits = data.substring(6, 14);
21775
+ var bitmapValue = parseInt(supportBits, 16);
21776
+ if (bitmapValue & 1) {
21777
+ rangesIndicatingMore.add(pidRangeStart);
21778
+ }
21772
21779
  extractSupportedPidsFromBitmap(pidRangeStart, supportBits, supportedPidsSet);
21773
21780
  } else if (data.substring(2, 6) === '62F4') {
21774
21781
  var _pidRangeStart = parseInt(data.substring(6, 8), 16);
21775
21782
  if (!SUPPORTED_PIDS_QUERY_VALUES.includes(_pidRangeStart)) continue;
21776
21783
  protocolsDetected.add('WWH-OBD');
21784
+ foundSupportedPidQueries.add(_pidRangeStart);
21777
21785
  var _supportBits = data.substring(8, 16);
21786
+ var _bitmapValue = parseInt(_supportBits, 16);
21787
+ if (_bitmapValue & 1) {
21788
+ rangesIndicatingMore.add(_pidRangeStart);
21789
+ }
21778
21790
  extractSupportedPidsFromBitmap(_pidRangeStart, _supportBits, supportedPidsSet);
21779
21791
  }
21780
21792
  }
21793
+ var missingSupportedPidQueries = [];
21794
+ if (foundSupportedPidQueries.size > 0) {
21795
+ if (!foundSupportedPidQueries.has(0x00)) {
21796
+ missingSupportedPidQueries.push('00');
21797
+ }
21798
+ var rangeChain = [0x00, 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0];
21799
+ for (var i = 0; i < rangeChain.length - 1; i++) {
21800
+ var currentRange = rangeChain[i];
21801
+ var nextRange = rangeChain[i + 1];
21802
+ if (rangesIndicatingMore.has(currentRange) && !foundSupportedPidQueries.has(nextRange)) {
21803
+ missingSupportedPidQueries.push(nextRange.toString(16).toUpperCase().padStart(2, '0'));
21804
+ }
21805
+ }
21806
+ }
21781
21807
  var hasMixedProtocols = protocolsDetected.size > 1;
21782
21808
  var protocol = protocolsDetected.size > 0 ? Array.from(protocolsDetected)[0] : null;
21783
21809
  var supportedPids = Array.from(supportedPidsSet).sort(function (a, b) {
@@ -21796,7 +21822,8 @@ function parseSupportedPids(csvContent) {
21796
21822
  hasMixedProtocols: hasMixedProtocols,
21797
21823
  allProtocolsDetected: Array.from(protocolsDetected),
21798
21824
  obd11BitCount: obd11BitResponses.length,
21799
- obd29BitCount: obd29BitResponses.length
21825
+ obd29BitCount: obd29BitResponses.length,
21826
+ missingSupportedPidQueries: missingSupportedPidQueries
21800
21827
  };
21801
21828
  }
21802
21829
  function extractSupportedPidsFromBitmap(rangeStart, bitmapHex, supportedSet) {
@@ -22077,7 +22104,13 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
22077
22104
  stateUpdate.mixedWarning = null;
22078
22105
  }
22079
22106
  this.setState(stateUpdate);
22080
- this.props.showAlert("success", "Loaded " + result.totalFrames + " frames");
22107
+ var responseId = result.canIdType === '29bit' ? '18DAF1XX' : '7E8';
22108
+ var baseMessage = "Loaded " + result.totalFrames + " frames: " + result.supportedPids.length + " PIDs are supported with response CAN ID " + responseId + " and protocol " + (result.protocol || 'Unknown') + ".";
22109
+ if (result.missingSupportedPidQueries && result.missingSupportedPidQueries.length > 0) {
22110
+ this.props.showAlert("warning", baseMessage + "\n\nWarning: No response data was found for the following 'supported PID' PIDs: " + result.missingSupportedPidQueries.join(', ') + ".\n\nTo properly evaluate supported PIDs, use the mode 'Identify supported PIDs' to create your evaluation Configuration File.");
22111
+ } else {
22112
+ this.props.showAlert("success", baseMessage);
22113
+ }
22081
22114
  } catch (e) {
22082
22115
  this.props.showAlert("danger", "Error parsing CSV file: " + e.message);
22083
22116
  }