-
Notifications
You must be signed in to change notification settings - Fork 2
Share constants #33
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
Share constants #33
Conversation
4025ffb
to
1e58798
Compare
I think this work has the potential to conflict with the SignalCodes type but we could probably let them coexist for now. It is hard for me to tell where there may be redundancy but the tracking signals plot is riddled with checks for code_is_x functions which are associated functions with the type. Probably want to hear someone else's opinion on this though. |
Could probably replace all of the integers here: |
let msg = builder.init_root::<m::message::Builder>(); | ||
let mut status = msg.init_status(); | ||
status.set_text(CLOSE); | ||
let app_state = cc::ApplicationStates::CLOSE; |
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.
Which version of the py2many are you using? When I run it and produce the common_constants file I get this error:
error[E0599]: the method `to_string` exists for enum `ApplicationStates`, but its trait bounds were not satisfied
--> console_backend/src/server.rs:76:36
|
76 | status.set_text(&app_state.to_string());
| ^^^^^^^^^ method cannot be called on `ApplicationStates` due to unsatisfied trait bounds
|
::: console_backend/src/common_constants.rs:37:1
|
37 | pub enum ApplicationStates {
| --------------------------
| |
| method `to_string` not found for this
| doesn't satisfy `ApplicationStates: ToString`
| doesn't satisfy `ApplicationStates: std::fmt::Display`
|
= note: the following trait bounds were not satisfied:
`ApplicationStates: std::fmt::Display`
which is required by `ApplicationStates: ToString`
error: aborting due to previous error; 12 warnings emitted
For more information about this error, try `rustc --explain E0599`.
error: could not compile `console-backend`
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.
Should be https://github.com/jayvdb/py2many/tree/console
But I have one update to add all the lint ignore flags at the top of the generated files.
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.
So now that you have updated the requirements file. Can you run: `cargo make pip-install-dev' then generate the common constants and then try running the app and connect? This is when I experienced the error. It looked like it was dropping a Display attribute or something.
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.
hmm. looks like I dropped it from the generator when I rebased & pushed it
https://github.com/jayvdb/py2many/blob/console/pyrs/transpiler.py#L362
(should have Display in there iirc)
Ya, we should be able to. I was hoping to get this in with just the strings in constants.rs removed, and we gradually switch over to using more of the piksi_tools_constants as time allows and we can do proper testing of them. |
1e58798
to
b807a03
Compare
b807a03
to
6623880
Compare
continue | ||
# These three codes have been given improved strings | ||
# https://snav.slack.com/archives/C02USAD03/p1618522328058800 | ||
elif line.startswith("GAL_E8I_STR = "): |
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.
It's fair game to just improve these strings in piksi_tools too, then we won't need these patches
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.
I created a PR:
swift-nav/piksi_tools#1235
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.
Yay. They are consistent again. I've merged this but will remove this hack as a fixup in another PR
LGTM. What was the reason for pinning nuitka? |
Created https://swift-nav.atlassian.net/browse/CPP-112 to document the reason for the Nuitka pin. |
No description provided.