Skip to content

ENH: Add Curve/PV Settings Modal#138

Merged
zdomke merged 10 commits into
ui_redesignfrom
zdomke/curve_settings
Apr 21, 2025
Merged

ENH: Add Curve/PV Settings Modal#138
zdomke merged 10 commits into
ui_redesignfrom
zdomke/curve_settings

Conversation

@zdomke

@zdomke zdomke commented Apr 21, 2025

Copy link
Copy Markdown
Collaborator

CurveSettingsModal

Create a settings modal for controlling the look of individual curves. The modal will open to the bottom right of its parent widget, similar to the modal in #137.

The modal class, CurveSettingsModal, takes in 3 arguments:

  • parent: QWidget
    • This is the parent object of the modal. Should be whatever button opens the modal
  • plot: PyDMArchiverTimePlot
    • This is the main plot of Trace
    • This is only used for redrawing the plot when the orientation changes. This should probably be done in PyDM instead of here
  • curve: TimePlotCurveItem
    • The curve item that is controlled by the modal

The modal contains settings for:

  • Setting the curve's name (label in the legend)
  • Color
  • Appearance
    • Line type (step or direct)
    • Style (solid, dotted, dashed, etc.)
    • Width
  • Symbol
    • Shape (circle, star, none, etc.)
    • Size

Settings components:

Also created a file containing reused components of the settings modals. Changed PlotSettingsModal to use common settings components.

Images of Modal

Screenshot 2025-04-21 at 15 32 45
Screenshot 2025-04-21 at 15 33 41

@zdomke zdomke requested a review from a team April 21, 2025 22:43
@zdomke zdomke self-assigned this Apr 21, 2025
@zdomke zdomke added the enhancement New feature or request label Apr 21, 2025
@zdomke zdomke added this to the Trace 1.5 milestone Apr 21, 2025
@zdomke zdomke linked an issue Apr 21, 2025 that may be closed by this pull request
@zdomke zdomke marked this pull request as ready for review April 21, 2025 22:43
@zdomke

zdomke commented Apr 21, 2025

Copy link
Copy Markdown
Collaborator Author

To test this I created test curves and axes at the end of TraceDisplay.__init__(). Here's the code I used:

  self.plot.addAxis(plot_data_item=None, name="Y-Axis 1", orientation="left")
  self.plot.addYChannel(
      y_channel="KLYS:LI22:31:KVAC", name="testing", color="blue", useArchiveData=True, yAxisName="Y-Axis 1"
  )
  self.plot.addAxis(plot_data_item=None, name="Y-Axis 2", orientation="left")
  self.plot.addYChannel(
      y_channel="KLYS:LI22:41:KVAC", name="testing 2", color="green", useArchiveData=True, yAxisName="Y-Axis 2"
  )
  test_button = QPushButton("Test", self)
  self.curve_settings = CurveSettingsModal(test_button, self.plot, self.plot._curves[0])
  test_button.clicked.connect(self.curve_settings.show)
  self.layout().addWidget(test_button)

@ngAlexander9 ngAlexander9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

okay!

@zdomke zdomke merged commit 6119c17 into ui_redesign Apr 21, 2025
@shilorigins shilorigins deleted the zdomke/curve_settings branch April 22, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] - Redesign Trace

2 participants