Skip to content

Commit

Permalink
Merge pull request #18 from shueja/nt-prefix
Browse files Browse the repository at this point in the history
Use the NT prefix in all datalogging
  • Loading branch information
shueja authored Mar 9, 2024
2 parents aff19c2 + dfef056 commit fc85242
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions monologue/src/generate/java/DataLogger.java.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class DataLogger extends GenericLogger {
if (value == null) {return;}
{%endif%}
{%if t.TypeName == 'IntegerArray'%}
new NTIntegerArrayLogEntry(log, entryName)
new NTIntegerArrayLogEntry(log, "NT:" + entryName)
.append(toLongArray(value));
{%elif t.TypeName == 'LongArray'%}
new NTIntegerArrayLogEntry(log, entryName)
new NTIntegerArrayLogEntry(log, "NT:" + entryName)
.append(value);
{%else%}
new {{t.java.EntryName}}LogEntry(log, entryName).append(value);
new {{t.java.EntryName}}LogEntry(log, "NT:" + entryName).append(value);
{%endif%}
}

Expand All @@ -53,9 +53,9 @@ class DataLogger extends GenericLogger {
LogLevel level)
{
{%if t.TypeName == 'IntegerArray' or t.TypeName == 'LongArray'%}
var entry = new NTIntegerArrayLogEntry(log, entryName);
var entry = new NTIntegerArrayLogEntry(log, "NT:" + entryName);
{%else %}
var entry = new {{t.java.EntryName}}LogEntry(log, entryName);
var entry = new {{t.java.EntryName}}LogEntry(log, "NT:" + entryName);
{%endif%}
LongConsumer consumer;
{%if t.TypeName == 'IntegerArray'%}
Expand Down Expand Up @@ -178,7 +178,7 @@ class DataLogger extends GenericLogger {
builder.startListeners();
table.getEntry(".controllable").setBoolean(false);
sendables.add(builder);
NetworkTableInstance.getDefault().startEntryDataLog(DataLogManager.getLog(), path, path);
NetworkTableInstance.getDefault().startEntryDataLog(DataLogManager.getLog(), path, "NT:" + path);
}


Expand All @@ -187,7 +187,7 @@ class DataLogger extends GenericLogger {
LongConsumer consumer;

if (this.isLazy()) {
var entryHandle = log.start(entryName, struct.getTypeString(), "", 0);
var entryHandle = log.start("NT:" + entryName, struct.getTypeString(), "", 0);
log.addSchema(struct, 0);
int size = struct.getSize();
consumer = new LongConsumer() {
Expand Down Expand Up @@ -215,7 +215,7 @@ class DataLogger extends GenericLogger {
}
};
} else {
var entry = StructLogEntry.create(log, entryName, struct);
var entry = StructLogEntry.create(log, "NT:" + entryName, struct);
consumer = (timestamp) -> {
var value = valueSupplier.get();
if (value == null) {
Expand All @@ -236,7 +236,7 @@ class DataLogger extends GenericLogger {
LongConsumer consumer;

if (this.isLazy()) {
var entryHandle = log.start(entryName, struct.getTypeString()+"[]", "", 0);
var entryHandle = log.start("NT:" + entryName, struct.getTypeString()+"[]", "", 0);
log.addSchema(struct, 0);
int size = struct.getSize();
consumer = new LongConsumer() {
Expand Down Expand Up @@ -276,7 +276,7 @@ class DataLogger extends GenericLogger {
}
};
} else {
var entry = StructArrayLogEntry.create(log, entryName, struct);
var entry = StructArrayLogEntry.create(log, "NT:" + entryName, struct);
consumer = (timestamp) -> {
var value = valueSupplier.get();
if (value == null) {
Expand All @@ -301,7 +301,7 @@ class DataLogger extends GenericLogger {
return;
}

StructLogEntry.create(log, entryName, struct).append(value);
StructLogEntry.create(log, "NT:" + entryName, struct).append(value);
}

@Override
Expand All @@ -312,7 +312,7 @@ class DataLogger extends GenericLogger {
if (value == null) {
return;
}
StructArrayLogEntry.create(log, entryName, struct).append(value);
StructArrayLogEntry.create(log, "NT:" + entryName, struct).append(value);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion monologue/src/generate/java/NTLogger.java.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class NTLogger extends GenericLogger {
builder.startListeners();
table.getTable(path).getEntry(".controllable").setBoolean(false);
sendables.add(builder);
NetworkTablesJNI.startEntryDataLog(NetworkTableInstance.getDefault().getHandle(), DataLogManager.getLog(), path, path);
NetworkTablesJNI.startEntryDataLog(NetworkTableInstance.getDefault().getHandle(), DataLogManager.getLog(), path, "NT:" + path);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion monologue/src/main/java/monologue/Monologue.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static void setupMonologue(
FILE_ONLY = fileOnly;
ntLogger.setLazy(lazyLogging);
dataLogger.setLazy(lazyLogging);
NetworkTableInstance.getDefault().startEntryDataLog(DataLogManager.getLog(), "", "");
NetworkTableInstance.getDefault().startEntryDataLog(DataLogManager.getLog(), "", "NT:");
logObj(loggable, rootpath);

MonologueLog.RuntimeLog("Monologue.setupMonologue() finished");
Expand Down

0 comments on commit fc85242

Please sign in to comment.