LOG_ONLY_TRANSLATED_FIELDS

This commit is contained in:
rusefillc 2022-08-24 16:50:56 -04:00
parent 849b6c2f46
commit 5c809e7a22
2 changed files with 5 additions and 0 deletions

View File

@ -15,10 +15,14 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
public class LoggingStrategy {
public static boolean LOG_ONLY_TRANSLATED_FIELDS;
public static List<BinaryLogEntry> getFieldNameEntries(DbcFile dbc) {
List<BinaryLogEntry> entries = new ArrayList<>();
for (DbcPacket packet : dbc.packets.values()) {
for (DbcField field : packet.getFields()) {
if (LoggingStrategy.LOG_ONLY_TRANSLATED_FIELDS && !field.isNiceName())
continue;
entries.add(new BinaryLogEntry() {
@Override
public String getName() {

View File

@ -18,6 +18,7 @@ public class TrcToMlq {
DbcFile dbc = DbcFile.readFromFile(dbcFileName);
LoggingStrategy.LOG_ONLY_TRANSLATED_FIELDS = true;
List<BinaryLogEntry> entries = LoggingStrategy.getFieldNameEntries(dbc);
List<CANPacket> packets = new PcanTrcReader().readFile(trcFileName);