LOG_ONLY_TRANSLATED_FIELDS
This commit is contained in:
parent
849b6c2f46
commit
5c809e7a22
|
@ -15,10 +15,14 @@ import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
public class LoggingStrategy {
|
public class LoggingStrategy {
|
||||||
|
public static boolean LOG_ONLY_TRANSLATED_FIELDS;
|
||||||
|
|
||||||
public static List<BinaryLogEntry> getFieldNameEntries(DbcFile dbc) {
|
public static List<BinaryLogEntry> getFieldNameEntries(DbcFile dbc) {
|
||||||
List<BinaryLogEntry> entries = new ArrayList<>();
|
List<BinaryLogEntry> entries = new ArrayList<>();
|
||||||
for (DbcPacket packet : dbc.packets.values()) {
|
for (DbcPacket packet : dbc.packets.values()) {
|
||||||
for (DbcField field : packet.getFields()) {
|
for (DbcField field : packet.getFields()) {
|
||||||
|
if (LoggingStrategy.LOG_ONLY_TRANSLATED_FIELDS && !field.isNiceName())
|
||||||
|
continue;
|
||||||
entries.add(new BinaryLogEntry() {
|
entries.add(new BinaryLogEntry() {
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
|
@ -18,6 +18,7 @@ public class TrcToMlq {
|
||||||
|
|
||||||
DbcFile dbc = DbcFile.readFromFile(dbcFileName);
|
DbcFile dbc = DbcFile.readFromFile(dbcFileName);
|
||||||
|
|
||||||
|
LoggingStrategy.LOG_ONLY_TRANSLATED_FIELDS = true;
|
||||||
List<BinaryLogEntry> entries = LoggingStrategy.getFieldNameEntries(dbc);
|
List<BinaryLogEntry> entries = LoggingStrategy.getFieldNameEntries(dbc);
|
||||||
|
|
||||||
List<CANPacket> packets = new PcanTrcReader().readFile(trcFileName);
|
List<CANPacket> packets = new PcanTrcReader().readFile(trcFileName);
|
||||||
|
|
Loading…
Reference in New Issue