@RobBauer Thanks! I've been looking at that file, and I wonder if what I'm looking for is the displayToData function:
- Code: Select all
def displayToData(self, value):
goal = float(value)
measure = self.task.getMeasure(self.measure)
minValue = -1.0
maxValue = 1.0
if math.fabs(measure - goal) < 0.01:
return self.value
else:
tries = 10
while tries:
if math.fabs(measure - goal) < 0.01:
break;
if goal < measure:
maxValue = self.value
if value == minValue:
break
self.value = minValue + (self.value - minValue) / 2.0
self.modifier.updateValue(self.value, 0)
measure = self.task.getMeasure(self.measure)
else:
minValue = self.value
if value == maxValue:
break
self.value = self.value + (maxValue - self.value) / 2.0
self.modifier.updateValue(self.value, 0)
measure = self.task.getMeasure(self.measure)
tries -= 1
return self.value
But I'm not entirely sure what it's doing. I think what it's doing is taking a goal measurement, and, given the model's current measurements, constructing the slider
value within (-1, 1) required to reach the goal. I think this because it updates the modifiers during the code.
Am I correct?
Thanks again for your help!