Skip to content
Snippets Groups Projects
Unverified Commit 5ecf1844 authored by Skgland's avatar Skgland
Browse files

use approach in plattform_exit_trigger

parent 5bac1181
Branches master
No related tags found
No related merge requests found
......@@ -163,9 +163,6 @@ S.callbacks = {
-- deactivate everything?
S.deactivated = false
-- enable approach callback mode in both directions
__approach_callback_mode = 2
-- debugging stuff
S.debug_train_id = "259435"
S.check_line_data = {}
......@@ -325,6 +322,7 @@ F.platform_exit_trigger = function(station, platform, event, atc_arrow, get_line
if S.deactivated then
return
end
__approach_callback_mode = 2
if event.train then
local line = get_line()
if line ~= nil then
......@@ -335,6 +333,11 @@ F.platform_exit_trigger = function(station, platform, event, atc_arrow, get_line
F.enter_platform(station, platform, line, true)
end
end
elseif event.approach and not atc_arrow then
local line = get_line()
if line ~= nil then
F.approach_station(station, entry, line, true)
end
end
end
......@@ -450,6 +453,16 @@ F.enter_platform = function(station, platform, line, announce_changes)
end
end
F.approach_platform = function(station, platform, line, announce_changes)
if S.deactivated then
return
end
if event.id ~= S.debug_train_id then
return enter_platform(station, platform, line, announce_changes)
end
end
-- When a train leaves the platform
F.exit_platform = function(station, platform, line, announce_changes)
if S.deactivated then
......@@ -723,7 +736,6 @@ F.util.multidisplay_print = function(displayarray,text,line_break,screen_width,s
local screen_height = screen_height or 2
local line_break = line_break or " | "
local multi_screen_width = #displayarray[1] * (screen_width)
local multi_screen_lines = {}
......@@ -743,7 +755,6 @@ F.util.multidisplay_print = function(displayarray,text,line_break,screen_width,s
print(F.util.pretty(multi_screen_lines))
end
local display_line = 1
local lcd_strings = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment