VAG use-case
This commit is contained in:
parent
998d8c69e9
commit
c6c302e4ac
|
@ -1,5 +1,11 @@
|
|||
package com.rusefi.can.analysis;
|
||||
|
||||
import com.rusefi.can.CANPacket;
|
||||
import com.rusefi.can.reader.CANLineReader;
|
||||
import com.rusefi.util.FolderUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
@ -48,6 +54,26 @@ public class ByteRateOfChangeReports {
|
|||
report.println();
|
||||
report.println();
|
||||
}
|
||||
public static String createOutputFolder(String inputFolderName) {
|
||||
String reportDestinationFolder = inputFolderName + File.separator + "processed";
|
||||
new File(reportDestinationFolder).mkdirs();
|
||||
return reportDestinationFolder;
|
||||
}
|
||||
|
||||
public static void scanInputFolder(String inputFolderName, String fileNameSuffix) throws IOException {
|
||||
String reportDestinationFolder = createOutputFolder(inputFolderName);
|
||||
|
||||
List<ByteRateOfChange.TraceReport> reports = new ArrayList<>();
|
||||
|
||||
FolderUtil.handleFolder(inputFolderName, (simpleFileName, fullInputFileName) -> {
|
||||
|
||||
List<CANPacket> logFileContent = CANLineReader.getReader().readFile(fullInputFileName);
|
||||
|
||||
ByteRateOfChange.TraceReport report = ByteRateOfChange.process(reportDestinationFolder, simpleFileName, logFileContent);
|
||||
reports.add(report);
|
||||
}, fileNameSuffix);
|
||||
compareEachReportAgainstAllOthers(reports);
|
||||
}
|
||||
|
||||
static class ByteVariationDifference {
|
||||
private final int deltaCount;
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package com.rusefi.can;
|
||||
|
||||
import com.rusefi.can.analysis.ByteRateOfChangeReports;
|
||||
import com.rusefi.can.reader.ReaderType;
|
||||
import com.rusefi.can.reader.ReaderTypeHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ByteRateOfChangeNissanSandbox {
|
||||
public static void main(String[] args) throws IOException {
|
||||
ReaderTypeHolder.INSTANCE.type = ReaderType.PCAN;
|
||||
|
||||
String inputFolderName = "C:\\stuff\\rusefi_documentation\\OEM-Docs\\Nissan\\2011_Xterra\\CAN-Nov-2022";
|
||||
|
||||
ByteRateOfChangeReports.scanInputFolder(inputFolderName, "pcan.trc");
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package com.rusefi.can;
|
||||
|
||||
import com.rusefi.can.analysis.ByteRateOfChange;
|
||||
import com.rusefi.can.analysis.ByteRateOfChangeReports;
|
||||
import com.rusefi.can.reader.CANLineReader;
|
||||
import com.rusefi.can.reader.ReaderType;
|
||||
import com.rusefi.can.reader.ReaderTypeHolder;
|
||||
import com.rusefi.util.FolderUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
public class ByteRateOfChangeSandbox {
|
||||
public static void main(String[] args) throws IOException {
|
||||
ReaderTypeHolder.INSTANCE.type = ReaderType.PCAN;
|
||||
|
||||
String inputFolderName = "C:\\stuff\\rusefi_documentation\\OEM-Docs\\Nissan\\2011_Xterra\\CAN-Nov-2022";
|
||||
|
||||
String reportDestinationFolder = inputFolderName + File.separator + "processed";
|
||||
new File(reportDestinationFolder).mkdirs();
|
||||
|
||||
|
||||
List<ByteRateOfChange.TraceReport> reports = new ArrayList<>();
|
||||
|
||||
FolderUtil.handleFolder(inputFolderName, (simpleFileName, fullInputFileName) -> {
|
||||
|
||||
List<CANPacket> logFileContent = CANLineReader.getReader().readFile(fullInputFileName);
|
||||
|
||||
ByteRateOfChange.TraceReport report = ByteRateOfChange.process(reportDestinationFolder, simpleFileName, logFileContent);
|
||||
reports.add(report);
|
||||
}, "pcan.trc");
|
||||
|
||||
|
||||
ByteRateOfChangeReports.compareEachReportAgainstAllOthers(reports);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.rusefi.can;
|
||||
|
||||
import com.rusefi.can.analysis.ByteRateOfChangeReports;
|
||||
import com.rusefi.can.reader.ReaderType;
|
||||
import com.rusefi.can.reader.ReaderTypeHolder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ByteRateOfChangeVagSandbox {
|
||||
public static void main(String[] args) throws IOException {
|
||||
ReaderTypeHolder.INSTANCE.type = ReaderType.PCAN;
|
||||
|
||||
String inputFolderName = "C:\\stuff\\rusefi_documentation\\OEM-Docs\\VAG\\2006-Passat-B6";
|
||||
|
||||
ByteRateOfChangeReports.scanInputFolder(inputFolderName, "fast-acceleration3.trc");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue