Skip to content

Commit b3beae3

Browse files
committedNov 2, 2022
Bug fixes for "FastTrack Automatic Gate Release" timer flag:
- Make sure FastTrack-K profile always has a remote_start object, and toggle the has_remote_start field as the flag changes. - Refresh g_host_poller's remote_start flag value when applying this flag. - Remove remote-start key from RaceInfo table if remote-start flag is withdrawn.
1 parent 84accb6 commit b3beae3

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed
 

‎templates/timer-profiles.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// DO NOT EDIT
12
// This file is generated by the java AllProfiles class
3+
var _all_the_timer_profiles = @PROFILES@;
4+
25
function all_profiles() {
3-
return @PROFILES@;
6+
return _all_the_timer_profiles;
47
}

‎timer/derbynet-timer/src/js/flags.js

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ class Flag {
6060
break;
6161
}
6262
}
63+
if (g_timer_proxy && g_host_poller) {
64+
g_host_poller.offer_remote_start(g_timer_proxy.has_remote_start());
65+
}
6366
});
6467

6568
static dtr_gate_release = new Flag(

‎timer/src/org/jeffpiazza/derby/profiles/FastTrack.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,15 @@ public static Profile profile() {
6767
new Profile.Detector("RG1", Event.GATE_CLOSED),
6868
// An "X" after RG means option disabled
6969
new Profile.Detector("^X$",
70-
Event.GATE_WATCHER_NOT_SUPPORTED));
70+
Event.GATE_WATCHER_NOT_SUPPORTED))
71+
.remote_start(false, "LG");
72+
7173
if (Flag.fasttrack_automatic_gate_release.value()) {
72-
profile.remote_start(true, "LG");
74+
profile.remote_start.has_remote_start = true;
7375
} else {
7476
profile.during(StateMachine.State.MARK, "LR");
7577
}
78+
7679
return profile;
7780
}
7881
}

‎website/ajax/action.timer-message.inc

+1-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ $timer_state = new TimerState(); // An object carrying our idea of the timer
6161
start_response();
6262

6363
if (have_permission(TIMER_MESSAGE_PERMISSION)) {
64-
if ($remote_start == 'YES') {
65-
set_has_remote_start();
66-
}
64+
set_has_remote_start($remote_start == 'YES');
6765

6866
if ($message == 'HELLO') {
6967
// Timer begins in TIMER_SEARCHING, almost the same as unhealthy, until we

‎website/inc/remote-start.inc

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
require_once('inc/data.inc');
44

5-
function set_has_remote_start() {
6-
write_raceinfo('remote-start', time());
5+
function set_has_remote_start($v) {
6+
if ($v) {
7+
write_raceinfo('remote-start', time());
8+
} else {
9+
delete_from_raceinfo('remote-start');
10+
}
711
}
812

913
function has_remote_start() {
@@ -20,4 +24,4 @@ function remote_start_pending() {
2024
return $val;
2125
}
2226

23-
?>
27+
?>

0 commit comments

Comments
 (0)
Please sign in to comment.