diff --git a/gui/graphFrame/frame.py b/gui/graphFrame/frame.py index e15b3a64b..52a122a99 100644 --- a/gui/graphFrame/frame.py +++ b/gui/graphFrame/frame.py @@ -178,7 +178,8 @@ class GraphFrame(wx.Frame): return self.graphSelection.GetClientData(self.graphSelection.GetSelection()) def clearCache(self, key=None): - self.getView().clearCache(key=key) + pass + #self.getView().clearCache(key=key) def draw(self): global mpl_version @@ -188,7 +189,7 @@ class GraphFrame(wx.Frame): if not self: pyfalog.warning('GraphFrame handled event, however GraphFrame no longer exists. Ignoring event') return - + self.ctrlPanel.getValues() # values = self.ctrlPanel.getValues() # view = self.getView() # self.subplot.clear() diff --git a/gui/graphFrame/input.py b/gui/graphFrame/input.py index cc73417ce..1b23c4a48 100644 --- a/gui/graphFrame/input.py +++ b/gui/graphFrame/input.py @@ -18,10 +18,10 @@ # ============================================================================= -import wx - import re +import wx + def valToStr(val): if val is None: @@ -83,7 +83,7 @@ class RangeBox(wx.TextCtrl): if currentValue == self._storedValue: event.Skip() return - if currentValue == '' or re.match('^\d*\.?\d*\-?\d*\.?\d*$', currentValue): + if currentValue == '' or re.match('^\d*\.?\d*-?\d*\.?\d*$', currentValue): self._storedValue = currentValue event.Skip() else: diff --git a/gui/graphFrame/panel.py b/gui/graphFrame/panel.py index 504630ea0..29432eab2 100644 --- a/gui/graphFrame/panel.py +++ b/gui/graphFrame/panel.py @@ -214,11 +214,31 @@ class GraphControlPanel(wx.Panel): def OnDrawTimer(self, event): event.Skip() - # self.graphFrame.clearCache() - # self.graphFrame.draw() + self.graphFrame.clearCache() + self.graphFrame.draw() def getValues(self): + view = self.graphFrame.getView() values = {} + # Vectors + srcVectorDef = view.srcVectorDef + if srcVectorDef is not None: + if not self.srcVector.IsDirectionOnly: + values[srcVectorDef.lengthHandle] = (self.srcVector.GetLength() * 100, srcVectorDef.lengthUnit) + values[srcVectorDef.angleHandle] = (self.srcVector.GetAngle(), srcVectorDef.angleUnit) + tgtVectorDef = view.tgtVectorDef + if tgtVectorDef is not None: + if not self.tgtVector.IsDirectionOnly: + values[tgtVectorDef.lengthHandle] = (self.tgtVector.GetLength() * 100, tgtVectorDef.lengthUnit) + values[tgtVectorDef.angleHandle] = (self.tgtVector.GetAngle(), srcVectorDef.angleUnit) + # Input boxes which were set up overwrite values if needed + for k, v in self.inputs.items(): + inputHandle, inputUnit = k + inputBox = v[0] + if isinstance(inputBox, RangeBox): + values[inputHandle] = (inputBox.GetValueRange(), inputUnit) + elif isinstance(inputBox, ConstantBox): + values[inputHandle] = (inputBox.GetValueFloat(), inputUnit) return values @property