Commit fa7cba25 authored by Valentin Valls's avatar Valentin Valls

Style strategy in case there is an only one curve with derivative and markers

parent 11df97e6
...@@ -120,23 +120,32 @@ class DefaultStyleStrategy(plot_model.StyleStrategy): ...@@ -120,23 +120,32 @@ class DefaultStyleStrategy(plot_model.StyleStrategy):
def computeItemStyleFromCurvePlot(self, plot, scans): def computeItemStyleFromCurvePlot(self, plot, scans):
i = 0 i = 0
countBase = 0
if len(scans) == 1:
countBase = 0
for item in plot.items():
if not isinstance(item, plot_model.ComputableMixIn):
countBase += 1
for scan in scans: for scan in scans:
for item in plot.items(): for item in plot.items():
if isinstance(item, plot_item_model.ScanItem): if isinstance(item, plot_item_model.ScanItem):
continue continue
if isinstance(item, plot_model.ComputableMixIn): if isinstance(item, plot_model.ComputableMixIn):
if isinstance(item, plot_state_model.CurveStatisticItem): if countBase == 1:
source = item.source() # Allocate a new color for everything
baseStyle = self.getStyleFromItem(source, scan) color = self.pickColor(i)
style = plot_model.Style( i += 1
lineStyle=":", lineColor=baseStyle.lineColor
)
else: else:
# Reuse the color
source = item.source() source = item.source()
baseStyle = self.getStyleFromItem(source, scan) baseStyle = self.getStyleFromItem(source, scan)
style = plot_model.Style( color = baseStyle.lineColor
lineStyle="-.", lineColor=baseStyle.lineColor if isinstance(item, plot_state_model.CurveStatisticItem):
) style = plot_model.Style(lineStyle=":", lineColor=color)
else:
style = plot_model.Style(lineStyle="-.", lineColor=color)
else: else:
color = self.pickColor(i) color = self.pickColor(i)
style = plot_model.Style(lineStyle="-", lineColor=color) style = plot_model.Style(lineStyle="-", lineColor=color)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment