-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1059 from jbellister-slac/fix_eventplot
Fix event plot curve creation
- Loading branch information
Showing
5 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Form</class> | ||
<widget class="QWidget" name="Form"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<widget class="PyDMEventPlot" name="PyDMEventPlot"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>20</x> | ||
<y>10</y> | ||
<width>341</width> | ||
<height>271</height> | ||
</rect> | ||
</property> | ||
<property name="toolTip"> | ||
<string/> | ||
</property> | ||
<property name="yAxes"> | ||
<stringlist> | ||
<string>{"name": "Axis 1", "orientation": "left", "label": null, "minRange": -1.0, "maxRange": 1.0, "autoRange": true, "logMode": false}</string> | ||
</stringlist> | ||
</property> | ||
<property name="curves"> | ||
<stringlist> | ||
<string>{"channel": "ca://MTEST:Waveform", "y_idx": "1", "x_idx": "2", "name": "", "color": "white", "lineStyle": 2, "lineWidth": 1, "symbol": "o", "symbolSize": 15, "yAxisName": "Axis 1", "barWidth": null, "upperThreshold": null, "lowerThreshold": null, "thresholdColor": "white", "buffer_size": 2, "bufferSizeChannelAddress": null}</string> | ||
<string>{"channel": "ca://MTEST:Waveform", "y_idx": "3", "x_idx": "3", "name": "", "color": "red", "lineStyle": 2, "lineWidth": 1, "symbol": "star", "symbolSize": 15, "yAxisName": "Axis 1", "barWidth": null, "upperThreshold": null, "lowerThreshold": null, "thresholdColor": "white", "buffer_size": 2, "bufferSizeChannelAddress": null}</string> | ||
</stringlist> | ||
</property> | ||
</widget> | ||
</widget> | ||
<customwidgets> | ||
<customwidget> | ||
<class>PyDMEventPlot</class> | ||
<extends>QGraphicsView</extends> | ||
<header>pydm.widgets.eventplot</header> | ||
</customwidget> | ||
</customwidgets> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from ...widgets.eventplot import PyDMEventPlot | ||
|
||
|
||
def test_add_channel(qtbot): | ||
"""A quick check to ensure adding a channel to an event plot works as expected""" | ||
event_plot = PyDMEventPlot() | ||
qtbot.addWidget(event_plot) | ||
|
||
curve = "TEST:EVENT:PLOT" | ||
event_plot.addChannel(curve) | ||
|
||
assert event_plot.curveAtIndex(0).channel.address == "TEST:EVENT:PLOT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters