Skip to content
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

This pull request introduces some changes to the SRF Auto Plot functionality: #22

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hmarts9
Copy link
Contributor

@hmarts9 hmarts9 commented Oct 10, 2024

Changes

  1. Converted Timeplot from a UI file to a Python code file
  2. Implemented legend functionality for the plot
  3. Used rainbow method to add a rainbow color scheme to distinguish multiple curves
  4. Enhanced the plot update method to incorporate new features
  5. Improved user interface with additional plot settings

Key Updates

  • Defined the TimeplotGUI class in Python, which allows for easier maintenance/modifications
  • The Plot class extends TimeplotGUI and implements the core plotting functionality
  • Added make_rainbow method to generate distinct colors for each curve
  • Implemented _add_curves_to_plot method to add color-coded curves to the plot
  • Updated the update method by breaking it down into smaller methods for better readability and maintainability.
  • Ensured legend visibility by calling self.plot.showLegend() in _update_plot_settings

@lisazacarias
Copy link
Collaborator

@hmarts9 have you had a chance to look at this?

Copy link
Collaborator

@lisazacarias lisazacarias left a comment

Choose a reason for hiding this comment

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

Looks good! If this is just a problem with my local version that's fine but it wasn't scrolling until I added the update mode line. If it works for you I'll switch this to approved

self.verticalLayout.addLayout(self.horizontalLayout_2)

# Plot
self.plot = PyDMArchiverTimePlot()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be in the init

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I definitely understand wanting to move it in the init, but I just put it in the setup_ui method, bc it follows separation of concerns principle by grouping all UI creation into one dedicated method. I can move it if you think thats better though.

# Plot
self.plot = PyDMArchiverTimePlot()
self.plot.setTimeSpan(600)
self.plot.setUpdatesAsynchronously(True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need the line self.plot.updateMode = PyDMTimePlot.AtFixedRated to actually make it scroll, at least in my local testing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah youre right. That would help with the scrolling behavior ill add it!

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.

2 participants