summaryrefslogtreecommitdiff
path: root/auto_yards
diff options
context:
space:
mode:
authorautocommitter <autocommitter@linux-forks.de>2024-04-22 14:57:44 +0200
committerautocommitter <autocommitter@linux-forks.de>2024-04-22 14:57:44 +0200
commit4ffe2e563e879169d12f66098c6d4d4dea6ddd69 (patch)
treed9b5829b6522fd9b3ef7baf29818570539afe99e /auto_yards
parentac853fa04d0d8a6489320dfe7dbd60c9371d756b (diff)
downloadluaatc_envs-4ffe2e563e879169d12f66098c6d4d4dea6ddd69.tar.gz
luaatc_envs-4ffe2e563e879169d12f66098c6d4d4dea6ddd69.tar.bz2
luaatc_envs-4ffe2e563e879169d12f66098c6d4d4dea6ddd69.zip
State at 2022-06-20
Diffstat (limited to 'auto_yards')
-rw-r--r--auto_yards/init_code.lua25
1 files changed, 4 insertions, 21 deletions
diff --git a/auto_yards/init_code.lua b/auto_yards/init_code.lua
index 6e4551f..689b7e3 100644
--- a/auto_yards/init_code.lua
+++ b/auto_yards/init_code.lua
@@ -8,8 +8,6 @@ if event.init then
active_indicator_pos = POS(),
dir_indicator_pos = POS(),
error_indicator_pos = POS(),
- ext_notify_pos = POS(),
- notify = table,
headshunt_max = number,
},
@@ -24,8 +22,6 @@ if event.init then
active_indicator_pos = POS(-2002,3,-1099),
dir_indicator_pos = POS(-2009,3,-1101),
error_indicator_pos = POS(-1999,3,-1099),
- ext_notify_pos = POS(-2004,2,-1101),
- notify = {},
headshunt_max = 5,
},
IP = {
@@ -167,7 +163,7 @@ F.yard_arrival = function(yard_id,this_dir) -- arrow points towards yard
end
atc_set_ars_disable(false)
atc_send("S6")
- print("Train "..atc_id.." enters yard ".. yard_id.." from the "..tostring(this_dir).." direction and "..((rts and "will") or "won't").." return in the same direction")
+ print("YARD: "..yard_id..": Train "..atc_id.." enters from the "..tostring(this_dir).." direction and "..((rts and "will") or "won't").." return in the same direction")
return
end
@@ -180,7 +176,7 @@ F.yard_arrival = function(yard_id,this_dir) -- arrow points towards yard
if event.train and atc_arrow then
if F.indicator(yard.active_indicator_pos) then
- print("Train "..atc_id.." has arrived at "..yard_id.." yard and has to wait for the yard to deactivate.")
+ print("YARD: "..yard_id..": Train "..atc_id.." has arrived and has to wait for the yard to deactivate.")
schedule_in(";10","recheck")
return
else
@@ -350,8 +346,8 @@ F.headshunt_exit = function(yard_id,this_dir) -- arrow points out of yard
if event.train then
if atc_arrow and (F.indicator(yard.dir_indicator_pos) == this_dir) then
if F.has_rc(yard_id.."_DEPART") then
- print("Train "..atc_id.." has a length of "..train_length())
- print("It will depart in the "..tostring(this_dir).." direction.")
+ print("YARD: "..yard_id..": Train "..atc_id.." has a length of "..train_length())
+ print("YARD: "..yard_id..": It will depart in the "..tostring(this_dir).." direction.")
unset_autocouple()
F.remove_rc({yard_id.."_FINAL_COLLECT",yard_id.."_DEPART"})
F.remove_rc_match(yard_id.."_LOCOS_%d+")
@@ -377,7 +373,6 @@ F.headshunt_exit = function(yard_id,this_dir) -- arrow points out of yard
if event.msg == "deactivate_check" then
if not atc_id then
F.indicator(yard.active_indicator_pos,false)
- if yard.ext_notify_pos then interrupt_pos(yard.ext_notify_pos,{command="EXIT"}) end
print(yard_id.." yard Disabled")
else
schedule_in(";05","deactivate_check")
@@ -410,18 +405,6 @@ F.lane_EOL = function(yard_id,this_dir) -- arrow points towards headshunt
end
else
if F.indicator(yard.dir_indicator_pos) == this_dir then
- --train is clasifying wagons, let it pass and couple to the rest of the rake
- --send a notification to the yard controller to trigger external functions
- if yard.ext_notify_pos then
- local fc = F.get_rc_safe():match(yard_id.."_CLASS_(%S+)") or nil
- if fc then
- if F.has_rc(yard_id.."_COLLECT_"..fc) then
- interrupt_pos(yard.ext_notify_pos,{command="COLLECTED",msg=fc})
- else
- interrupt_pos(yard.ext_notify_pos,{command="NOTIFY",msg=fc})
- end
- end
- end
F.remove_rc_match(yard_id.."_CLASS_%S+")
else --this should never come into play as it means the train has entered from the wrong end somehow
atc_send("BBOL") --stop the train and open the doors (if available) to signify assistance required