something?
This commit is contained in:
parent
5c02116408
commit
fd3f11bf24
|
@ -26,6 +26,6 @@ public class ConvertTrcToMegaLogViewerWithDBC {
|
|||
};
|
||||
|
||||
|
||||
FolderUtil.handleFolder(inputFolderName, fileAction, ".trc");
|
||||
FolderUtil.handleFolder(inputFolderName, fileAction, ".trc1");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.rusefi.can.CANPacket;
|
|||
import com.rusefi.can.reader.impl.CANoeReader;
|
||||
import com.rusefi.can.reader.impl.CanHackerReader;
|
||||
import com.rusefi.can.reader.impl.PcanTrcReader1_1;
|
||||
import com.rusefi.can.reader.impl.PcanTrcReader2_0;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
@ -30,13 +31,19 @@ public interface CANLineReader {
|
|||
return CANoeReader.INSTANCE;
|
||||
case CANHACKER:
|
||||
return CanHackerReader.INSTANCE;
|
||||
case PCAN2:
|
||||
return PcanTrcReader2_0.INSTANCE;
|
||||
case PCAN:
|
||||
default:
|
||||
return new PcanTrcReader1_1();
|
||||
}
|
||||
}
|
||||
|
||||
CANPacket readLine(String line);
|
||||
default CANPacket readLine(String line) {
|
||||
return readLine(line, "no-file-name");
|
||||
}
|
||||
|
||||
CANPacket readLine(String line, String fileName);
|
||||
|
||||
default List<CANPacket> readFile(String fileName) throws IOException {
|
||||
return skipHeaderAndRead(fileName, 0);
|
||||
|
@ -52,7 +59,7 @@ public interface CANLineReader {
|
|||
public void accept(String s) {
|
||||
if (index++ < skipCount)
|
||||
return;
|
||||
CANPacket packet = readLine(s);
|
||||
CANPacket packet = readLine(s, fileName);
|
||||
if (packet != null)
|
||||
result.add(packet);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.rusefi.can.reader;
|
|||
|
||||
public enum ReaderType {
|
||||
PCAN,
|
||||
PCAN2,
|
||||
CANOE,
|
||||
CANHACKER,
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ public enum CANoeReader implements CANLineReader {
|
|||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public CANPacket readLine(String line) {
|
||||
public CANPacket readLine(String line, String fileName) {
|
||||
if (line.contains("ErrorFrame"))
|
||||
return null;
|
||||
String[] tokens = line.trim().split("\\s+");
|
||||
|
|
|
@ -18,7 +18,7 @@ public enum CanHackerReader implements CANLineReader {
|
|||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public CANPacket readLine(String line) {
|
||||
public CANPacket readLine(String line, String fileName) {
|
||||
line = line.trim();
|
||||
if (line.startsWith("@"))
|
||||
return null;
|
||||
|
|
|
@ -11,7 +11,7 @@ import static com.rusefi.can.reader.impl.PcanTrcReader2_0.FILEVERSION;
|
|||
*/
|
||||
public class PcanTrcReader1_1 implements CANLineReader {
|
||||
@Override
|
||||
public CANPacket readLine(String line) {
|
||||
public CANPacket readLine(String line, String fileName) {
|
||||
line = line.trim();
|
||||
if (line.startsWith(FILEVERSION) && !line.startsWith(FILEVERSION + "=1.1"))
|
||||
throw new IllegalStateException("Unexpected fileversion " + line);
|
||||
|
|
|
@ -13,10 +13,10 @@ public enum PcanTrcReader2_0 implements CANLineReader {
|
|||
public static final String FILEVERSION = ";$FILEVERSION";
|
||||
|
||||
@Override
|
||||
public CANPacket readLine(String line) {
|
||||
public CANPacket readLine(String line, String fileName) {
|
||||
line = line.trim();
|
||||
if (line.startsWith(FILEVERSION) && !line.startsWith(FILEVERSION + "=2.0"))
|
||||
throw new IllegalStateException("Unexpected fileversion " + line);
|
||||
throw new IllegalStateException("Unexpected fileversion " + line + " in " + fileName);
|
||||
if (line.startsWith(";"))
|
||||
return null;
|
||||
String[] tokens = line.split("\\s+");
|
||||
|
|
Loading…
Reference in New Issue