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):
def computeItemStyleFromCurvePlot(self, plot, scans):
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 item in plot.items():
if isinstance(item, plot_item_model.ScanItem):
continue
if isinstance(item, plot_model.ComputableMixIn):
if isinstance(item, plot_state_model.CurveStatisticItem):
source = item.source()
baseStyle = self.getStyleFromItem(source, scan)
style = plot_model.Style(
lineStyle=":", lineColor=baseStyle.lineColor
)
if countBase == 1:
# Allocate a new color for everything
color = self.pickColor(i)
i += 1
else:
# Reuse the color
source = item.source()
baseStyle = self.getStyleFromItem(source, scan)
style = plot_model.Style(
lineStyle="-.", lineColor=baseStyle.lineColor
)
color = 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:
color = self.pickColor(i)
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