diff --git a/graphs/data/base/graph.py b/graphs/data/base/graph.py index 0c4d6d350..f07718989 100644 --- a/graphs/data/base/graph.py +++ b/graphs/data/base/graph.py @@ -90,6 +90,7 @@ class FitGraph(metaclass=ABCMeta): srcVectorDef = None tgtVectorDef = None hasTargets = False + usesHpEffectivity = False def getPlotPoints(self, mainInput, miscInputs, xSpec, ySpec, src, tgt=None): cacheKey = self._makeCacheKey(src=src, tgt=tgt) diff --git a/graphs/gui/ctrlPanel.py b/graphs/gui/ctrlPanel.py index b955c8174..d72d2c566 100644 --- a/graphs/gui/ctrlPanel.py +++ b/graphs/gui/ctrlPanel.py @@ -133,16 +133,8 @@ class GraphControlPanel(wx.Panel): self.Freeze() self._clearStoredValues() view = self.graphFrame.getView() - self.ySubSelection.Clear() - self.xSubSelection.Clear() - for yDef in view.yDefs: - self.ySubSelection.Append(self.formatLabel(yDef, selector=True), yDef) - self.ySubSelection.SetSelection(0) - self.ySubSelection.Enable(len(view.yDefs) > 1) - for xDef in view.xDefs: - self.xSubSelection.Append(self.formatLabel(xDef, selector=True), xDef) - self.xSubSelection.SetSelection(0) - self.xSubSelection.Enable(len(view.xDefs) > 1) + + self.refreshAxeLabels() # Vectors self._setVectorDefaults() @@ -256,15 +248,26 @@ class GraphControlPanel(wx.Panel): continue addInputField(inputDef, handledHandles) - def refreshAxeLabels(self): - # Currently we need to refresh only Y for dps graph - selectedY = self.ySubSelection.GetSelection() + def refreshAxeLabels(self, restoreSelection=False): view = self.graphFrame.getView() + if restoreSelection: + selectedY = self.ySubSelection.GetSelection() + selectedX = self.xSubSelection.GetSelection() + else: + selectedY = selectedX = 0 + self.ySubSelection.Clear() for yDef in view.yDefs: self.ySubSelection.Append(self.formatLabel(yDef, selector=True), yDef) + self.ySubSelection.Enable(len(view.yDefs) > 1) self.ySubSelection.SetSelection(selectedY) + self.xSubSelection.Clear() + for xDef in view.xDefs: + self.xSubSelection.Append(self.formatLabel(xDef, selector=True), xDef) + self.xSubSelection.Enable(len(view.xDefs) > 1) + self.xSubSelection.SetSelection(selectedX) + def refreshColumns(self, layout=True): view = self.graphFrame.getView() self.sourceList.refreshExtraColumns(view.srcExtraCols) diff --git a/graphs/gui/frame.py b/graphs/gui/frame.py index 303bf21b1..94a29b50a 100644 --- a/graphs/gui/frame.py +++ b/graphs/gui/frame.py @@ -164,7 +164,7 @@ class GraphFrame(AuxiliaryFrame): event.Skip() self.ctrlPanel.Freeze() if getattr(event, 'refreshAxeLabels', False): - self.ctrlPanel.refreshAxeLabels() + self.ctrlPanel.refreshAxeLabels(restoreSelection=True) if getattr(event, 'refreshColumns', False): self.ctrlPanel.refreshColumns() self.ctrlPanel.Thaw()