Skip to content
Permalink
Browse files

SCWarrants should not tamper with any functions. Not sure if it is by…

… purpose that Warrants do. But I have not changed anything except for SCWarrants.
  • Loading branch information...
kjlisby committed Sep 9, 2018
1 parent 9fa99ee commit fd2eee1fec8a75b9ef362f9793cd8086c008f92d
@@ -614,6 +614,9 @@ synchronized public int getRunState() {
* @param abort not normal shutdown
*/
public void stopRun(boolean abort) {
stopRun(abort,true);
}
public void stopRun(boolean abort, boolean turnOffFunctions) {
if (abort) {
_abort =true;
}
@@ -624,8 +627,10 @@ public void stopRun(boolean abort) {
if (_throttle != null && _throttle.getSpeedSetting() > 0.0f) {
_throttle.setSpeedSetting(-1.0f);
setSpeed(0.0f); // prevent creep after EStop - according to Jim Betz
for (int i = 0; i < 10; i++) {
setFunction(i, false);
if (turnOffFunctions) {
for (int i = 0; i < 10; i++) {
setFunction(i, false);
}
}
_warrant.releaseThrottle(_throttle);
}
@@ -583,7 +583,7 @@ synchronized public void stopWarrant(boolean abort) {
_nextSignal.removePropertyChangeListener(this);
_nextSignal = null;
}
super.stopWarrant(abort);
super.stopWarrant(abort, false);
}


@@ -388,14 +388,19 @@ protected boolean profileHasSpeedInfo() {
}

protected void stopRun(boolean updateSpeedProfile) {
stopRun(updateSpeedProfile, true);
}
protected void stopRun(boolean updateSpeedProfile, boolean turnOffFunctions) {
if (updateSpeedProfile && _sessionProfile != null) {
WarrantManager manager = InstanceManager.getDefault(WarrantManager.class);
manager.setSpeedProfiles(_rosterId, _mergeProfile, _sessionProfile);
}
if (_throttle != null) { // quiet
_throttle.setF0(false);
_throttle.setF1(false);
_throttle.setF2(false);
if (turnOffFunctions) {
if (_throttle != null) { // quiet
_throttle.setF0(false);
_throttle.setF1(false);
_throttle.setF2(false);
}
}
}

@@ -678,6 +678,9 @@ protected void startTracker() {
}

synchronized public void stopWarrant(boolean abort) {
stopWarrant(abort, true);
}
synchronized public void stopWarrant(boolean abort, boolean turnOffFunctions) {
_delayStart = false;
if (_protectSignal != null) {
_protectSignal.removePropertyChangeListener(this);
@@ -694,8 +697,8 @@ synchronized public void stopWarrant(boolean abort) {
_student = null;
}
if (_engineer != null) {
_speedUtil.stopRun(!abort); // don't write speed profile measurements
_engineer.stopRun(abort); // release throttle
_speedUtil.stopRun(!abort, turnOffFunctions); // don't write speed profile measurements
_engineer.stopRun(abort, turnOffFunctions); // release throttle
_engineer = null;
}
deAllocate();

0 comments on commit fd2eee1

Please sign in to comment.
You can’t perform that action at this time.