Skip to content

Conversation

@john-michaelburke
Copy link
Collaborator

  • Adds a magnetometer tab under advanced.
  • Converts the consts in constants.rs to pub(crate) consts.

@john-michaelburke john-michaelburke marked this pull request as ready for review June 16, 2021 22:46
@john-michaelburke john-michaelburke requested a review from a team June 16, 2021 22:46
let shared_state = SharedState::new();
let client_send = TestSender { inner: Vec::new() };
let mut mag_tab = AdvancedMagnetometerTab::new(shared_state, client_send);
sleep(Duration::from_secs_f64(GUI_UPDATE_PERIOD));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if GUI_UPDATE_PERIOD is moved into a variable of either the tab or maybe client_send, it could be adjusted during test execution to avoid these sleeps.

Or, I guess/wonder if the value of the constant GUI_UPDATE_PERIOD can be reduced to a lower value during test invocation only. It seems const functions would allow this, combined with if cfg!(test) {...} else {...}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is a good idea. I ended up removing it though because we don't need the rate limiting AFAICT. This is a feature in other tabs though I'll keep in mind when we need it. Could be good for the tracking tab as we decided to add it back there recently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why shouldn't this tab/all tabs have rate limiting? It seems like a useful approach in general to avoid the possibility of the GUI becoming lagged, esp. as we already need it for some tabs. Anyways, this doesnt need to hold up this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old console sort mixed the rate limiting of the backend and the frontend. Using the GUI_UPDATE_PERIOD here would be in some sense rate limiting how frequently the backend sends data to the frontend. Our QML frontend does impose it's own rate limiting using the timers. I don't argue that there could be value in rate limiting the backend and its comms with the frontend but we have not really had issue with it so far so I think we can leave it on the backburner for now. It would be good to reassess things like this once we approach initial launch to see if we can optimize things so I'll create a ticket for it. https://swift-nav.atlassian.net/browse/CPP-228

The use of the GUI_UPDATE_PERIOD in the tracking signals was not imposed to reduce lagging but rather we were collecting so many points the xaxis moving too quickly so instead of averaging things over time we reverted back to the GUI filter from the old console. (I know you saw this already but I'm going to link the above ticket to this comment and reference to the other PR here): The discussion is somewhat scattered throughout this PR and referred to as implementing decimination: #67

Copy link
Contributor

@silverjam silverjam Jun 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of the tracking tab GUI_UPDATE_PERIOD is probably a bad name, as you mention, we use timers in most of the GUI to drive the refresh rate of the plots: the back-end data gets pushed to the front-end data model whenever there's new data available, then the GUI pulls the data according to the timer period (which again, is driven by the refresh rate). The GUI_UPDATE_PERIOD constant should probably be called TRACKING_UPDATE_PERIOD.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I swapped out the naming from GUI to TRACKING.

@john-michaelburke john-michaelburke requested a review from jayvdb June 17, 2021 00:43
@jayvdb
Copy link
Contributor

jayvdb commented Jun 17, 2021

In the legend, it looks like there should be some extra whitespace between the line and description.

@john-michaelburke john-michaelburke merged commit dc1e06f into main Jun 18, 2021
@john-michaelburke john-michaelburke deleted the johnmichael-burke/mag branch June 18, 2021 02:09
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