Skip to content

Commit

Permalink
Merge pull request #573 from hhslepicka/label_time_plot
Browse files Browse the repository at this point in the history
FIX: Disable autoSIPPrefix for TimePlot.
  • Loading branch information
hhslepicka authored Nov 12, 2019
2 parents 35aeb22 + 2e5d0a9 commit 41c3b35
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
12 changes: 11 additions & 1 deletion examples/scatterplot/scatterplot.ui
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,19 @@
will accept.
</string>
</property>
<property name="xLabels">
<stringlist>
<string>Cos Val</string>
</stringlist>
</property>
<property name="yLabels">
<stringlist>
<string>Sin Val</string>
</stringlist>
</property>
<property name="curves">
<stringlist>
<string>{&quot;y_channel&quot;: &quot;ca://MTEST:SinVal&quot;, &quot;x_channel&quot;: &quot;ca://MTEST:CosVal&quot;, &quot;name&quot;: &quot;CircularData&quot;, &quot;color&quot;: &quot;white&quot;, &quot;lineStyle&quot;: 0, &quot;lineWidth&quot;: 1, &quot;symbol&quot;: &quot;o&quot;, &quot;symbolSize&quot;: 10, &quot;redraw_mode&quot;: 3}</string>
<string>{&quot;y_channel&quot;: &quot;ca://MTEST:SinVal&quot;, &quot;x_channel&quot;: &quot;ca://MTEST:CosVal&quot;, &quot;name&quot;: &quot;CircularData&quot;, &quot;color&quot;: &quot;white&quot;, &quot;lineStyle&quot;: 0, &quot;lineWidth&quot;: 1, &quot;symbol&quot;: &quot;o&quot;, &quot;symbolSize&quot;: 10, &quot;redraw_mode&quot;: 3, &quot;buffer_size&quot;: 1200}</string>
</stringlist>
</property>
</widget>
Expand Down
10 changes: 10 additions & 0 deletions examples/timeplot/timeplot.ui
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
<property name="title" stdset="0">
<string>Time Plot</string>
</property>
<property name="xLabels">
<stringlist>
<string>Time</string>
</stringlist>
</property>
<property name="yLabels">
<stringlist>
<string>Value</string>
</stringlist>
</property>
<property name="curves">
<stringlist>
<string>{&quot;channel&quot;: &quot;ca://MTEST:MeanValue&quot;, &quot;name&quot;: &quot;Curve 1&quot;, &quot;color&quot;: &quot;white&quot;, &quot;lineStyle&quot;: 1, &quot;lineWidth&quot;: 1, &quot;symbol&quot;: null, &quot;symbolSize&quot;: 10}</string>
Expand Down
14 changes: 12 additions & 2 deletions examples/waveformplot/waveform_plot.ui
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@
<property name="whatsThis">
<string/>
</property>
<property name="xLabels">
<stringlist>
<string>Point #</string>
</stringlist>
</property>
<property name="yLabels">
<stringlist>
<string>Value</string>
</stringlist>
</property>
<property name="showLegend">
<bool>true</bool>
</property>
<property name="curves">
<stringlist>
<string>{&quot;y_channel&quot;: &quot;ca://MTEST:Waveform&quot;, &quot;x_channel&quot;: &quot;ca://MTEST:TimeBase&quot;, &quot;name&quot;: &quot;Sine&quot;, &quot;color&quot;: &quot;white&quot;}</string>
<string>{&quot;y_channel&quot;: &quot;ca://MTEST:Cosine&quot;, &quot;x_channel&quot;: &quot;ca://MTEST:TimeBase&quot;, &quot;name&quot;: &quot;Cosine&quot;, &quot;color&quot;: &quot;red&quot;}</string>
<string>{&quot;y_channel&quot;: &quot;ca://MTEST:Waveform&quot;, &quot;x_channel&quot;: &quot;ca://MTEST:TimeBase&quot;, &quot;name&quot;: &quot;Sine&quot;, &quot;color&quot;: &quot;white&quot;, &quot;lineStyle&quot;: 1, &quot;lineWidth&quot;: 1, &quot;symbol&quot;: null, &quot;symbolSize&quot;: 10, &quot;redraw_mode&quot;: 2}</string>
<string>{&quot;y_channel&quot;: &quot;ca://MTEST:Cosine&quot;, &quot;x_channel&quot;: &quot;ca://MTEST:TimeBase&quot;, &quot;name&quot;: &quot;Cosine&quot;, &quot;color&quot;: &quot;red&quot;, &quot;lineStyle&quot;: 1, &quot;lineWidth&quot;: 1, &quot;symbol&quot;: null, &quot;symbolSize&quot;: 10, &quot;redraw_mode&quot;: 2}</string>
</stringlist>
</property>
</widget>
Expand Down
4 changes: 4 additions & 0 deletions pydm/widgets/timeplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,10 @@ class TimeAxisItem(AxisItem):
"""
TimeAxisItem formats a unix time axis into a human-readable format.
"""
def __init__(self, *args, **kwargs):
super(TimeAxisItem, self).__init__(*args, **kwargs)
self.enableAutoSIPrefix(False)

def tickStrings(self, values, scale, spacing):
strings = []
for val in values:
Expand Down

0 comments on commit 41c3b35

Please sign in to comment.