progress
This commit is contained in:
parent
49d0cf13a4
commit
bc909e16fd
|
@ -1,7 +1,7 @@
|
|||
package com.rusefi.can;
|
||||
|
||||
import com.rusefi.can.reader.CANLineReader;
|
||||
import com.rusefi.can.reader.dbc.DbcFile;
|
||||
import com.rusefi.can.reader.impl.PcanTrcReader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -21,11 +21,12 @@ public class HandleFolder {
|
|||
|
||||
String fullInputFile = inputFolderName + File.separator + inputFile;
|
||||
|
||||
List<CANPacket> packets = new PcanTrcReader().readFile(fullInputFile);
|
||||
List<CANPacket> packets = CANLineReader.getReader().readFile(fullInputFile);
|
||||
|
||||
String outputFileName = outputFolder + File.separator + inputFile + ".mlg";
|
||||
|
||||
LoggingStrategy.writeLog(dbc, packets, outputFileName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
package com.rusefi.can;
|
||||
|
||||
import com.rusefi.can.reader.ReaderType;
|
||||
import com.rusefi.can.reader.dbc.DbcFile;
|
||||
import com.rusefi.can.reader.impl.PcanTrcReader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.rusefi.can.reader.CANLineReader.getReader;
|
||||
|
||||
public class TrcToMlq {
|
||||
public static ReaderType getCurrentReaderType() {
|
||||
return ReaderType.PCAN;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
LoggingStrategy.LOG_ONLY_TRANSLATED_FIELDS = true;
|
||||
|
||||
|
@ -24,7 +30,7 @@ public class TrcToMlq {
|
|||
|
||||
DbcFile dbc = DbcFile.readFromFile(dbcFileName);
|
||||
|
||||
List<CANPacket> packets = new PcanTrcReader().readFile(inputFileName);
|
||||
List<CANPacket> packets = getReader().readFile(inputFileName);
|
||||
|
||||
String outputFileName = System.getProperty("mlq_file_name", "gauges.mlg");
|
||||
LoggingStrategy.writeLog(dbc, packets, outputFileName);
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.rusefi.can.reader;
|
||||
|
||||
import com.rusefi.can.CANPacket;
|
||||
import com.rusefi.can.TrcToMlq;
|
||||
import com.rusefi.can.reader.impl.CANoeReader;
|
||||
import com.rusefi.can.reader.impl.PcanTrcReader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
@ -17,6 +20,16 @@ public interface CANLineReader {
|
|||
return data;
|
||||
}
|
||||
|
||||
static CANLineReader getReader() {
|
||||
switch (TrcToMlq.getCurrentReaderType()) {
|
||||
case CANOE:
|
||||
return CANoeReader.INSTANCE;
|
||||
case PCAN:
|
||||
default:
|
||||
return new PcanTrcReader();
|
||||
}
|
||||
}
|
||||
|
||||
CANPacket readLine(String line);
|
||||
|
||||
default List<CANPacket> readFile(String fileName) throws IOException {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package com.rusefi.can.reader;
|
||||
|
||||
public enum ReaderType {
|
||||
PCAN,
|
||||
CANOE,
|
||||
CANHACKER,
|
||||
|
||||
}
|
Loading…
Reference in New Issue