Skip to content

Conversation

john-michaelburke
Copy link
Collaborator

Implements

  • UI Log Bar hidden until you click on the folder button on navbar to show/hide it also replaced the connect button.
  • Log Bar has a switch for selecting SBP logging file format (sbp/sbp json).
  • The logging directory has history enabled and can be selected via the File explorer symbol next to it.
  • The mechanism for catching changes in the logging is pretty rough and may be in need of optimizations or a redo. Currently the check happens on every new sbp message which seems highly inefficient. Might be worth having a separate thread that checks at less frequent intervals.

Todo

  • Write unittests. I'll hold off on unittesting the logging until after some feedback on the design.
  • Possibly redo the design based on this feedback.
  • No CLI argument available to set the log directory or enable logging.
  • The SVG coloring for the connect/folder/folder open buttons is showing some issues. I can't seem to be able to accurately color things with rgba(r,g,b,a) and only hardcoded colors seem to work. I also was unable to get the global theme colors working which seems necessary for changing themes seamlessly in the future.

ColorOverlay {
anchors.fill: navBarConnect
source: navBarConnect
color: !connectButton.checked ? "dimgrey" : "crimson"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See comment in the PR body.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a lot of comments in the PR body 😞

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This refers to this comment:

The SVG coloring for the connect/folder/folder open buttons is showing some issues. I can't seem to be able to accurately color things with rgba(r,g,b,a) and only hardcoded colors seem to work.

Ideally I would have wanted to point to "current_theme.button_pressed"/"current_theme.button_depressed" or something of the sort. I was trying to work with https://doc.qt.io/qt-5/qml-qtquick-systempalette.html but I think there may be an inherent issue with the ColorOverlay feature. I can only get the blue channel to show when providing an Qt.rgba(r,g,b,a).

@john-michaelburke john-michaelburke force-pushed the john-michaelburke/save_sbp branch from 7746b20 to 99fd3a7 Compare May 21, 2021 20:09
@john-michaelburke john-michaelburke marked this pull request as ready for review May 21, 2021 20:38
@john-michaelburke john-michaelburke requested review from a team, jayvdb and notoriaga May 21, 2021 20:39
@notoriaga
Copy link
Contributor

The mechanism for catching changes in the logging is pretty rough and may be in need of optimizations or a redo. Currently the check happens on every new sbp message which seems highly inefficient. Might be worth having a separate thread that checks at less frequent intervals.

async console for the hackathon??

@john-michaelburke
Copy link
Collaborator Author

The mechanism for catching changes in the logging is pretty rough and may be in need of optimizations or a redo. Currently the check happens on every new sbp message which seems highly inefficient. Might be worth having a separate thread that checks at less frequent intervals.

async console for the hackathon??

One option before surrendering to an async rewrite could be to pull the MainTab out of "process_messages" and instead have maintab invoke process_messages. Then when the backend gets data to change in the shared state, it could call on the main tab to handle these new changes. Not positive that would work nor make it any more efficient though. I'm just assume the biggest performance drop is the mutex lock in serialize_sbp.

@john-michaelburke john-michaelburke force-pushed the john-michaelburke/save_sbp branch from 5b80946 to 4d57653 Compare May 21, 2021 21:52
ColorOverlay {
anchors.fill: navBarConnect
source: navBarConnect
color: !connectButton.checked ? "dimgrey" : "crimson"
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a lot of comments in the PR body 😞

Copy link
Contributor

@silverjam silverjam left a comment

Choose a reason for hiding this comment

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

Some more feedback:

  • Default logging dir should be "$HOME/SwiftNav" -- on Windows this default to a hidden AppData folder, which isn't very easy to find ($HOME/SwiftNav should be created if it doesn't exist)
  • Hover for the button that shows the logging bar should probably just say "Logging" or "Show Logging Toolbar"
  • Had a lot of trouble getting the folder selector to accept a different folder than the default, see here: https://youtu.be/6lHk92s0tTQ
  • Default logging should probably be SBP-JSON
  • "SBP Json" should be referred to as "SBP-JSON" or "SBP JSON"
  • the radio button could just be a drop down that selects the logging type, or if there's a combined button/drop-down that would probably be the best
  • The "solution log" button should probably just be "CSV Log" (that's what we're mirroring right?) -- and we need to hide this the same as we do in the current console, unless there's a command line switch

@john-michaelburke
Copy link
Collaborator Author

@silverjam I did a bit of reworking for some of the logic to make some of the UI features a little more stable (primarily behavior confirmation). I added the relevant CLI args. And also added the communications and UI for setting log level though it is not implemented yet.

I was unable to find anything easy to set up as you suggested for the SBP logging (button + combobox) this may need some rework but maybe for another PR.

I still need to write up some unittests but thinking maybe after the hackathon and any additional feedback.

@john-michaelburke john-michaelburke changed the title [CPP-155] SBP/ SBPJson/Solution Logging + LogBar (WIPish) [CPP-155] SBP/ SBPJson/Solution Logging + LogBar May 28, 2021
@john-michaelburke john-michaelburke force-pushed the john-michaelburke/save_sbp branch from d238848 to 5754bcf Compare May 28, 2021 17:45
@john-michaelburke john-michaelburke force-pushed the john-michaelburke/save_sbp branch from fd6e77e to 831a724 Compare May 28, 2021 21:16
@silverjam
Copy link
Contributor

@john-michaelburke I think this is good enough to get feedback on, let's go ahead and merge and do a release cut

@john-michaelburke john-michaelburke merged commit 858e13f into main May 29, 2021
@john-michaelburke john-michaelburke deleted the john-michaelburke/save_sbp branch May 29, 2021 00:33
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