Skip to content

Conversation

jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Apr 19, 2021

No description provided.

@john-michaelburke
Copy link
Collaborator

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.

let msg = builder.init_root::<m::message::Builder>();
let mut status = msg.init_status();
status.set_text(CLOSE);
let app_state = cc::ApplicationStates::CLOSE;
Copy link
Collaborator

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`

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

@jayvdb jayvdb Apr 20, 2021

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)

@jayvdb
Copy link
Contributor Author

jayvdb commented Apr 20, 2021

Could probably replace all of the integers here:
https://github.com/swift-nav/console_pp/blob/41a0e6a5fa96880832cc0ad0ba2404474127c403/console_backend/src/types.rs#L236

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.

@jayvdb jayvdb force-pushed the common-constants branch from 1e58798 to b807a03 Compare April 20, 2021 02:51
continue
# These three codes have been given improved strings
# https://snav.slack.com/archives/C02USAD03/p1618522328058800
elif line.startswith("GAL_E8I_STR = "):
Copy link
Contributor

@silverjam silverjam Apr 20, 2021

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

Copy link
Collaborator

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

Copy link
Contributor Author

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

@john-michaelburke
Copy link
Collaborator

LGTM. What was the reason for pinning nuitka?

@jayvdb
Copy link
Contributor Author

jayvdb commented Apr 20, 2021

Created https://swift-nav.atlassian.net/browse/CPP-112 to document the reason for the Nuitka pin.

@jayvdb jayvdb merged commit b1ebb34 into main Apr 20, 2021
@jayvdb jayvdb deleted the common-constants branch April 20, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants