-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wpiutil] DataLog: Use codegen for entry types #7479
base: main
Are you sure you want to change the base?
[wpiutil] DataLog: Use codegen for entry types #7479
Conversation
019ed88
to
44c1538
Compare
Signed-off-by: Jade Turner <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generation stuff should be in src/generate/main and src/generated/main to match what's already in wpimath and wpiutil.
Also eventually we should clean up the empty lines in the output, but I'm assuming that's just because this is still a draft.
|
||
|
||
def render_template( | ||
template: Template, output_dir: Path, filename: str, ty: Dict[str, Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use type_
(or _type
) instead of ty
to be clearer about the meaning while still avoiding hiding the builtin type
function?
render_template(java_template, java_root_path, entry_name, ty) | ||
|
||
|
||
def main(argv): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #7311, the argv
argument should be removed and the no-args overload of parser.parse_args()
should be used.
* @return Last value, or null if none. | ||
* @return Last value, or false if none. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to add a field to the json so that this doesn't get changed.
/** The data type for integer array values. */ | ||
/** The data type for int64[] values. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want another field so that there's less of these changes. (For most of the other ones, it wasn't that bad, but this one is especially unhelpful)
}, | ||
{ | ||
"name": "String", | ||
"DataType": "String", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"DataType": "String", | |
"DataType": "string", |
/** | ||
* Constructs a String log entry. | ||
* | ||
* @param log datalog | ||
* @param name name of the entry | ||
* @param metadata metadata | ||
* @param type Data type | ||
* @param timestamp entry creation timestamp (0=now) | ||
*/ | ||
public StringLogEntry(DataLog log, String name, String metadata, String type, long timestamp) { | ||
super(log, name, type, metadata, timestamp); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should figure out how to make the constructors match what was there previously.
boolean m_hasLastValue; | ||
double m_lastValue; | ||
private boolean m_hasLastValue; | ||
|
||
|
||
private double m_lastValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PeterJohnson Any reason these were package private before? (They were added in #6674)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it compiles cleanly, no.
TODO: