Compare commits
3 Commits
4ff0333d1b
...
6e5411ff86
Author | SHA1 | Date |
---|---|---|
rusefillc | 6e5411ff86 | |
rusefillc | 3501ac3b32 | |
rusefillc | 8933621961 |
|
@ -18,7 +18,7 @@ public class CANPacket {
|
||||||
result.append(arrayName + " = {");
|
result.append(arrayName + " = {");
|
||||||
|
|
||||||
byte[] data = getData();
|
byte[] data = getData();
|
||||||
System.out.println(String.format("Got ECU 0x%x", getId()) + " " + data.length);
|
// System.out.println(String.format("Got ECU 0x%x", getId()) + " " + data.length);
|
||||||
|
|
||||||
for (int index = 0; index < data.length; index++) {
|
for (int index = 0; index < data.length; index++) {
|
||||||
if (index > 0)
|
if (index > 0)
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class ByteRateOfChangeReports {
|
||||||
|
|
||||||
CanToMegaLogViewer.createMegaLogViewer(reportDestinationFolder, logFileContent, simpleFileName);
|
CanToMegaLogViewer.createMegaLogViewer(reportDestinationFolder, logFileContent, simpleFileName);
|
||||||
|
|
||||||
PacketRatio.write(reportDestinationFolder, logFileContent, simpleFileName);
|
PacketRatio.write(dbc, reportDestinationFolder, logFileContent, simpleFileName);
|
||||||
|
|
||||||
ByteRateOfChange.TraceReport report = ByteRateOfChange.process(reportDestinationFolder, simpleFileName, logFileContent);
|
ByteRateOfChange.TraceReport report = ByteRateOfChange.process(reportDestinationFolder, simpleFileName, logFileContent);
|
||||||
report.save(simpleFileName + "-ByteRateOfChange.txt");
|
report.save(simpleFileName + "-ByteRateOfChange.txt");
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class ChecksumScanner {
|
||||||
for (Map.Entry<Integer, AtomicBoolean> e : isChecksumMap.entrySet()) {
|
for (Map.Entry<Integer, AtomicBoolean> e : isChecksumMap.entrySet()) {
|
||||||
if (e.getValue().get()) {
|
if (e.getValue().get()) {
|
||||||
Integer sid = e.getKey();
|
Integer sid = e.getKey();
|
||||||
System.out.println("Ends with checksum " + sid);
|
System.out.println("ChecksumScanner: Ends with checksum " + sid);
|
||||||
withChecksum.add(sid);
|
withChecksum.add(sid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.rusefi.can.analysis;
|
package com.rusefi.can.analysis;
|
||||||
|
|
||||||
import com.rusefi.can.CANPacket;
|
import com.rusefi.can.CANPacket;
|
||||||
import com.rusefi.can.DualSid;
|
import com.rusefi.can.reader.dbc.DbcFile;
|
||||||
|
import com.rusefi.can.reader.dbc.DbcPacket;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
|
@ -14,7 +15,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class PacketRatio {
|
public class PacketRatio {
|
||||||
|
|
||||||
public static void write(String reportDestinationFolder, List<CANPacket> logFileContent, String simpleFileName) throws IOException {
|
public static void write(DbcFile dbc, String reportDestinationFolder, List<CANPacket> logFileContent, String simpleFileName) throws IOException {
|
||||||
|
|
||||||
Map<Integer, AtomicInteger> countBySID = new TreeMap<>();
|
Map<Integer, AtomicInteger> countBySID = new TreeMap<>();
|
||||||
|
|
||||||
|
@ -27,7 +28,10 @@ public class PacketRatio {
|
||||||
|
|
||||||
for (Map.Entry<Integer, AtomicInteger> e : countBySID.entrySet()) {
|
for (Map.Entry<Integer, AtomicInteger> e : countBySID.entrySet()) {
|
||||||
double ratio = 100.0 * e.getValue().get() / logFileContent.size();
|
double ratio = 100.0 * e.getValue().get() / logFileContent.size();
|
||||||
w.write(DualSid.dualSid(e.getKey()) + ": " + ratio + "\n");
|
Integer sid = e.getKey();
|
||||||
|
DbcPacket packet = dbc == null ? null : dbc.packets.get(sid);
|
||||||
|
String key = packet == null ? Integer.toString(sid) : packet.getName();
|
||||||
|
w.write(key + ": " + ratio + "\n");
|
||||||
}
|
}
|
||||||
w.close();
|
w.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue