Rework graph interfaces again
This commit is contained in:
11
gui/graph.py
11
gui/graph.py
@@ -44,7 +44,7 @@ class Graph(metaclass=ABCMeta):
|
||||
|
||||
@property
|
||||
def extraInputs(self):
|
||||
return ()
|
||||
return {}
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
@@ -55,6 +55,11 @@ class Graph(metaclass=ABCMeta):
|
||||
def redrawOnEffectiveChange(self):
|
||||
return False
|
||||
|
||||
def getPlotPoints(self, fit, extraData, xRange, xAmount, yType):
|
||||
xRange = self.parseRange(xRange)
|
||||
graph = getattr(self, self.yDefs[yType].eosGraph, None)
|
||||
return graph.getPlotPoints(fit, extraData, xRange, xAmount)
|
||||
|
||||
def parseRange(self, string):
|
||||
m = re.match('\s*(?P<first>\d+(\.\d+)?)\s*(-\s*(?P<second>\d+(\.\d+)?))?', string)
|
||||
if m is None:
|
||||
@@ -67,8 +72,8 @@ class Graph(metaclass=ABCMeta):
|
||||
return (float(first), float(second))
|
||||
|
||||
|
||||
XDef = namedtuple('XDef', ('handle', 'inputDefault', 'inputLabel', 'inputIconID', 'axisLabel'))
|
||||
YDef = namedtuple('YDef', ('handle', 'switchLabel', 'axisLabel'))
|
||||
XDef = namedtuple('XDef', ('inputDefault', 'inputLabel', 'inputIconID', 'axisLabel'))
|
||||
YDef = namedtuple('YDef', ('switchLabel', 'axisLabel', 'eosGraph'))
|
||||
ExtraInput = namedtuple('ExtraInput', ('handle', 'inputDefault', 'inputLabel', 'inputIconID'))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user