2022-06-26 09:15:18 -07:00
|
|
|
package com.rusefi.can;
|
|
|
|
|
|
|
|
import com.rusefi.can.reader.dbc.DbcFile;
|
2022-06-26 09:54:11 -07:00
|
|
|
import com.rusefi.can.reader.impl.PcanTrcReader;
|
2022-06-26 09:15:18 -07:00
|
|
|
|
|
|
|
import java.io.IOException;
|
2022-06-26 09:54:11 -07:00
|
|
|
import java.util.List;
|
2022-06-26 09:15:18 -07:00
|
|
|
|
|
|
|
public class TrcToMlq {
|
|
|
|
public static void main(String[] args) throws IOException {
|
2022-08-26 17:11:21 -07:00
|
|
|
LoggingStrategy.LOG_ONLY_TRANSLATED_FIELDS = true;
|
|
|
|
|
|
|
|
if (args.length == 3) {
|
|
|
|
String dbcFileName = args[0];
|
|
|
|
String inputFolder = args[1];
|
2022-08-26 18:23:03 -07:00
|
|
|
String outputFolder = args[2];
|
2022-08-26 17:11:21 -07:00
|
|
|
HandleFolder.doJob(dbcFileName, inputFolder, outputFolder);
|
|
|
|
} else if (args.length != 2) {
|
2022-06-26 09:15:18 -07:00
|
|
|
System.err.println("Two arguments expected - DBC file name and TRC file name");
|
|
|
|
System.exit(-1);
|
2022-08-26 17:11:21 -07:00
|
|
|
} else {
|
|
|
|
String dbcFileName = args[0];
|
|
|
|
String inputFileName = args[1];
|
2022-06-26 09:15:18 -07:00
|
|
|
|
2022-08-26 17:11:21 -07:00
|
|
|
DbcFile dbc = DbcFile.readFromFile(dbcFileName);
|
2022-06-26 09:15:18 -07:00
|
|
|
|
2022-08-26 17:11:21 -07:00
|
|
|
List<CANPacket> packets = new PcanTrcReader().readFile(inputFileName);
|
2022-06-26 09:54:11 -07:00
|
|
|
|
2022-08-26 17:11:21 -07:00
|
|
|
String outputFileName = System.getProperty("mlq_file_name", "gauges.mlg");
|
|
|
|
LoggingStrategy.writeLog(dbc, packets, outputFileName);
|
|
|
|
}
|
2022-06-26 09:15:18 -07:00
|
|
|
}
|
|
|
|
}
|