summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init_code.lua13
-rw-r--r--nodes/(-1925,13,-4577).lua2
-rw-r--r--nodes/(1984,41,8404).lua4
-rw-r--r--nodes/(773,8,132).lua9
4 files changed, 22 insertions, 6 deletions
diff --git a/init_code.lua b/init_code.lua
index 42b3509..59cf8a2 100644
--- a/init_code.lua
+++ b/init_code.lua
@@ -261,10 +261,12 @@ function F.ttp_begin(p)
last_delay = 0,
}
-- if no travel times are available yet, set this train as recording
- if not tti.travel_times or p.force_tt_reset then
+ if not tti.travel_times or p.force_tt_reset or tti.force_tt_reset then
tti.travel_times = {}
tti.station_order = {p.stn}
tti.recording_train = atc_id
+ tti.force_tt_reset = false
+ print(atc_id,"starting TT recording for",p.tt)
elseif tti.recording_train == atc_id then
tti.recording_train = nil
end
@@ -365,6 +367,7 @@ F.ttp_stop({
if tti.recording_train == atc_id then
-- we are recording. save travel time
tti.travel_times[p.stn] = rwt.diff(trn.initial_dep or 0, time_now)
+ print(atc_id," for ",p.tt,"at",p.stn,"-> travel time",rwt.to_string(tti.travel_times[p.stn]))
tti.station_order[#tti.station_order+1] = p.stn
atc_set_text_inside(p.stn.."\nRec TT "
..rwt.to_string(tti.travel_times[p.stn], true).." Da"
@@ -420,14 +423,14 @@ function F.ttp_info_trains(tt, starttime)
if trn.actual_dep then
p[#p+1] = ("Trn "..tid..
" after "..trn.location..
- " Dd "..rwt.to_string(trn.desired_dep, true)..
+ " Dd "..rwt.to_string(trn.desired_dep or 0, true)..
" Da "..rwt.to_string(trn.actual_dep, true)..
- " Delay "..rwt.to_string(trn.last_delay))
+ " Delay "..rwt.to_string(trn.last_delay or "59;59"))
else
p[#p+1] = ("Trn "..tid..
" at "..trn.location..
- " Dd "..rwt.to_string(trn.desired_dep, true)..
- " Delay "..rwt.to_string(trn.last_delay))
+ " Dd "..rwt.to_string(trn.desired_dep or 0, true)..
+ " Delay "..rwt.to_string(trn.last_delay or "59;59"))
end
end
end
diff --git a/nodes/(-1925,13,-4577).lua b/nodes/(-1925,13,-4577).lua
index a1d7a28..fa700e6 100644
--- a/nodes/(-1925,13,-4577).lua
+++ b/nodes/(-1925,13,-4577).lua
@@ -8,7 +8,7 @@ F.ttp_begin({
doorside = "R",
reverse = true,
only_lines = { E1 = true },
- force_tt_reset = true,
+ force_tt_reset = false,
})
if event.train then
diff --git a/nodes/(1984,41,8404).lua b/nodes/(1984,41,8404).lua
new file mode 100644
index 0000000..6e23563
--- /dev/null
+++ b/nodes/(1984,41,8404).lua
@@ -0,0 +1,4 @@
+F.ttp_stop({
+ stn = "Azena Transirejo",
+ doorside = "R",
+}) \ No newline at end of file
diff --git a/nodes/(773,8,132).lua b/nodes/(773,8,132).lua
new file mode 100644
index 0000000..cc8b8cb
--- /dev/null
+++ b/nodes/(773,8,132).lua
@@ -0,0 +1,9 @@
+F.ttp_begin({
+ stn = "Leekston East", -- station name
+ tt = "NX_N", -- timetable ID
+ depint = "05;00", --departure slot interval
+ depoff = "02;00", --departure slot offset
+ doorside = "R",
+ only_lines = {XN=true},
+ force_tt_reset = false,
+}) \ No newline at end of file