Commit 8ae4ba5a authored by Nico Mack's avatar Nico Mack

Fixed a bug in multiturn mode when using new Multitaction tables

parent b75e59b1
......@@ -88,6 +88,7 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
protected double initialAngle;
private double stepAngle;
private double lastAngle;
private double value;
private int completedTurns;
private List<ValueCorona> dispatcher;
......@@ -97,6 +98,7 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
// ***************************************************************************
public static final String DEFAULT_VARIABLE = "Value"; //$NON-NLS-1$
private static final Logger LOGGER = LoggerFactory.getLogger(ValueWidget.class.getSimpleName());
// ---------------------------------------------------------------------------
......@@ -227,17 +229,18 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
@SuppressWarnings("unchecked")
protected void updateTethers(Double value) {
@SuppressWarnings("rawtypes")
List<InformationFeed> dataFeeds = this.getTethers(InformationFeed.class);
for (InformationFeed<Double> tether : dataFeeds) {
tether.setInformation(value);
if (this.isTethered()) {
List<InformationFeed> dataFeeds = this.getTethers(InformationFeed.class);
for (InformationFeed<Double> tether : dataFeeds) {
tether.setInformation(value);
}
}
}
// ---------------------------------------------------------------------------
protected void updateFromRotation(double angle, Direction direction) {
double value = 0;
// double value = 0;
if (variable == null) {
return;
......@@ -246,7 +249,7 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
if (withStopAngles) {
value = lowerBound + (stepSize * Math.floor((angle - lowerStopAngle) / stepAngle));
} else if (multiTurn) {
value = variable.getConstrainedValue();
// value = variable.getConstrainedValue();
if ((direction != null) && !Double.isNaN(lastAngle)) {
double wrapped = AngleUtils.wrapTwoPi(angle - lastAngle);
double degrees = Math.toDegrees(wrapped);
......@@ -274,8 +277,8 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
this.updateTethers(value);
this.updateDisplays();
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("{} = {}", variable.getName(), value); //$NON-NLS-1$
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("{} = {}", variable.getName(), value); //$NON-NLS-1$
}
}
......@@ -297,6 +300,8 @@ public class ValueWidget extends TetherableWidget implements InformationProvider
getVariable().setValue(initialValue);
this.updateFromRotation(dialAngle, null);
}
this.value = getVariable().getConstrainedValue();
}
// ---------------------------------------------------------------------------
......
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