From 5f72b7ec62a6f2fb8ce6b9d5379f03a3e4126971 Mon Sep 17 00:00:00 2001 From: autocommitter Date: Mon, 22 Apr 2024 14:52:14 +0200 Subject: State at 2020-08-29 --- Tyard/init_code.lua | 5 +++++ Tyard/nodes/(-4011,12,-2642).lua | 1 + Tyard/nodes/(-4011,12,-2646).lua | 1 + Tyard/nodes/(-4024,12,-2642).lua | 1 + Tyard/nodes/(-4027,12,-2655).lua | 1 + Tyard/nodes/(-4027,12,-2731).lua | 1 + Tyard/nodes/(-4031,12,-2655).lua | 1 + Tyard/nodes/(-4031,12,-2731).lua | 1 + Tyard/nodes/(-4035,12,-2655).lua | 1 + Tyard/nodes/(-4035,12,-2731).lua | 1 + Tyard/nodes/(-4039,12,-2655).lua | 1 + Tyard/nodes/(-4039,12,-2731).lua | 1 + Tyard/nodes/(-4043,12,-2655).lua | 1 + Tyard/nodes/(-4043,12,-2731).lua | 1 + Tyard/nodes/(-4047,12,-2655).lua | 1 + Tyard/nodes/(-4047,12,-2731).lua | 1 + Tyard/nodes/(-4051,12,-2655).lua | 1 + Tyard/nodes/(-4051,12,-2731).lua | 1 + Tyard/nodes/(-4055,12,-2655).lua | 1 + Tyard/nodes/(-4055,12,-2731).lua | 1 + Tyard/nodes/(-4059,12,-2714).lua | 1 + Tyard/nodes/(-4063,12,-2669).lua | 1 + 22 files changed, 26 insertions(+) create mode 100644 Tyard/init_code.lua create mode 100644 Tyard/nodes/(-4011,12,-2642).lua create mode 100644 Tyard/nodes/(-4011,12,-2646).lua create mode 100644 Tyard/nodes/(-4024,12,-2642).lua create mode 100644 Tyard/nodes/(-4027,12,-2655).lua create mode 100644 Tyard/nodes/(-4027,12,-2731).lua create mode 100644 Tyard/nodes/(-4031,12,-2655).lua create mode 100644 Tyard/nodes/(-4031,12,-2731).lua create mode 100644 Tyard/nodes/(-4035,12,-2655).lua create mode 100644 Tyard/nodes/(-4035,12,-2731).lua create mode 100644 Tyard/nodes/(-4039,12,-2655).lua create mode 100644 Tyard/nodes/(-4039,12,-2731).lua create mode 100644 Tyard/nodes/(-4043,12,-2655).lua create mode 100644 Tyard/nodes/(-4043,12,-2731).lua create mode 100644 Tyard/nodes/(-4047,12,-2655).lua create mode 100644 Tyard/nodes/(-4047,12,-2731).lua create mode 100644 Tyard/nodes/(-4051,12,-2655).lua create mode 100644 Tyard/nodes/(-4051,12,-2731).lua create mode 100644 Tyard/nodes/(-4055,12,-2655).lua create mode 100644 Tyard/nodes/(-4055,12,-2731).lua create mode 100644 Tyard/nodes/(-4059,12,-2714).lua create mode 100644 Tyard/nodes/(-4063,12,-2669).lua (limited to 'Tyard') diff --git a/Tyard/init_code.lua b/Tyard/init_code.lua new file mode 100644 index 0000000..99b63e4 --- /dev/null +++ b/Tyard/init_code.lua @@ -0,0 +1,5 @@ +-- flag to hard enable RTS: +S.single_dir = true + + +F.EOL = function(direction,lane) if S.yard_active then if S.dir == direction then if atc_arrow then if not S.exiting then --return to PICKUP via headshunt split_off_locomotive("B0WR") set_rc("PICKUP") set_route("TY"..direction.."_"..lane, "HEADSHUNT") else --if S.exiting then loco has already sorted to correct lane for departure --S.exiting set by the pickup track set_rc(S.rc) set_route("TY"..direction.."_"..lane, "EXIT") S.exiting = nil end end else -- preparing for bi-directional. also EOL Bounce atc_send("B0WD1RS4") end end end \ No newline at end of file diff --git a/Tyard/nodes/(-4011,12,-2642).lua b/Tyard/nodes/(-4011,12,-2642).lua new file mode 100644 index 0000000..81a963d --- /dev/null +++ b/Tyard/nodes/(-4011,12,-2642).lua @@ -0,0 +1 @@ +if S.yard_active and atc_arrow then set_autocouple() end \ No newline at end of file diff --git a/Tyard/nodes/(-4011,12,-2646).lua b/Tyard/nodes/(-4011,12,-2646).lua new file mode 100644 index 0000000..3c9efc3 --- /dev/null +++ b/Tyard/nodes/(-4011,12,-2646).lua @@ -0,0 +1 @@ +--arrow points into yard -- config'd for Southbound entrance (North end of yard) local dir = "N" local entrance_signal = "Tyard_Enter_"..dir -- train enters from mainline. stop at signal to be safe if event.train and atc_arrow then atc_send("B0") end if atc_arrow then local rc = get_rc() or "" -- allow for manual working if rc:match("TYARD_NOSHUNT") then return end if S.yard_active then -- send train to "waiting" if can_set_route(entrance_signal,"WAITING") then set_route(entrance_signal,"WAITING") atc_set_text_outside("Waiting for yard to clear") atc_send("S6") else interrupt(5,"recheck") end else -- send train to "pickup" S.yard_active = true step_fc() local rc = get_rc() or "" S.rc = rc --check for RTS if S.single_dir == true or S.rc:match("TY_RTS") then S.dir = dir --working end = entrance dir S.RTS = true set_rc("AROUND_"..S.dir) else --invert S.dir --working end ~= entrance end if dir == "N" then S.dir = "S" else S.dir = "N" end end set_route(entrance_signal,"PICKUP") atc_set_text_outside("Proceeding to Classification Yard") atc_send("S4") end else -- train exiting set_rc(S.rc) S.yard_active = nil S.rc = nil S.dir = nil unset_autocouple() atc_send("SM") end \ No newline at end of file diff --git a/Tyard/nodes/(-4024,12,-2642).lua b/Tyard/nodes/(-4024,12,-2642).lua new file mode 100644 index 0000000..36743ff --- /dev/null +++ b/Tyard/nodes/(-4024,12,-2642).lua @@ -0,0 +1 @@ +if event.channel=="ops" or event.punch then digiline_send("lcd","Active:"..tostring(S.yard_active).."\nRC:"..tostring(S.rc).."\nRTS:"..tostring(S.RTS) .. " Dir:"..tostring(S.dir) .."\nExiting:"..tostring(S.exiting)) end \ No newline at end of file diff --git a/Tyard/nodes/(-4027,12,-2655).lua b/Tyard/nodes/(-4027,12,-2655).lua new file mode 100644 index 0000000..39f9b81 --- /dev/null +++ b/Tyard/nodes/(-4027,12,-2655).lua @@ -0,0 +1 @@ +--North pickup splitter local dir = "N" local lane = 0 --nothing below this line should indicate a hard direction --should be able to convert to function using only above args -------------------------------------------------- if S.yard_active then if atc_arrow then if S.dir == dir then set_route("TY"..dir.."_"..lane, "HEADSHUNT") local plen = train_length() local rc = split_at_fc("B0") local trc = "TY"..dir.."_"..rc if plen == train_length() and (rc == "" or S.rc:match(trc)) then S.exiting = true end if rc and rc ~= "" then set_rc("TY"..dir.."_"..rc) else set_rc(S.rc) S.exiting = true end else -- if S.dir ~= dir if S.RTS then -- loop around to other HS S.RTS = nil set_route("TY"..dir.."_"..lane,"AROUND") split_off_locomotive("B0") set_rc("AROUND_"..S.dir) return else atc_send("B0WRS4") end end end -- nothing to do if train goes against arrow end \ No newline at end of file diff --git a/Tyard/nodes/(-4027,12,-2731).lua b/Tyard/nodes/(-4027,12,-2731).lua new file mode 100644 index 0000000..b04ffad --- /dev/null +++ b/Tyard/nodes/(-4027,12,-2731).lua @@ -0,0 +1 @@ +--South pickup splitter local dir = "S" local lane = 0 --nothing below this line should indicate a hard direction --should be able to convert to function using only above args -------------------------------------------------- if S.yard_active then if atc_arrow then if S.dir == dir then set_route("TY"..dir.."_"..lane, "HEADSHUNT") local plen = train_length() local rc = split_at_fc("B0") local trc = "TY"..dir.."_"..rc if plen == train_length() and (rc == "" or S.rc:match(trc)) then S.exiting = true end if rc and rc ~= "" then set_rc("TY"..dir.."_"..rc) else set_rc(S.rc) S.exiting = true end else -- if S.dir ~= dir if S.RTS then -- loop around to other HS S.RTS = nil set_route("TY"..dir.."_"..lane,"AROUND") split_off_locomotive("B0") set_rc("AROUND_"..S.dir) return else atc_send("B0WRS4") end end end -- nothing to do if train goes against arrow end \ No newline at end of file diff --git a/Tyard/nodes/(-4031,12,-2655).lua b/Tyard/nodes/(-4031,12,-2655).lua new file mode 100644 index 0000000..b6c6d60 --- /dev/null +++ b/Tyard/nodes/(-4031,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",1) \ No newline at end of file diff --git a/Tyard/nodes/(-4031,12,-2731).lua b/Tyard/nodes/(-4031,12,-2731).lua new file mode 100644 index 0000000..c4c1959 --- /dev/null +++ b/Tyard/nodes/(-4031,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",1) \ No newline at end of file diff --git a/Tyard/nodes/(-4035,12,-2655).lua b/Tyard/nodes/(-4035,12,-2655).lua new file mode 100644 index 0000000..3fd7dcb --- /dev/null +++ b/Tyard/nodes/(-4035,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",2) \ No newline at end of file diff --git a/Tyard/nodes/(-4035,12,-2731).lua b/Tyard/nodes/(-4035,12,-2731).lua new file mode 100644 index 0000000..f15a717 --- /dev/null +++ b/Tyard/nodes/(-4035,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",2) \ No newline at end of file diff --git a/Tyard/nodes/(-4039,12,-2655).lua b/Tyard/nodes/(-4039,12,-2655).lua new file mode 100644 index 0000000..592871f --- /dev/null +++ b/Tyard/nodes/(-4039,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",3) \ No newline at end of file diff --git a/Tyard/nodes/(-4039,12,-2731).lua b/Tyard/nodes/(-4039,12,-2731).lua new file mode 100644 index 0000000..af4c22e --- /dev/null +++ b/Tyard/nodes/(-4039,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",3) \ No newline at end of file diff --git a/Tyard/nodes/(-4043,12,-2655).lua b/Tyard/nodes/(-4043,12,-2655).lua new file mode 100644 index 0000000..c86923a --- /dev/null +++ b/Tyard/nodes/(-4043,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",4) \ No newline at end of file diff --git a/Tyard/nodes/(-4043,12,-2731).lua b/Tyard/nodes/(-4043,12,-2731).lua new file mode 100644 index 0000000..9227db4 --- /dev/null +++ b/Tyard/nodes/(-4043,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",4) \ No newline at end of file diff --git a/Tyard/nodes/(-4047,12,-2655).lua b/Tyard/nodes/(-4047,12,-2655).lua new file mode 100644 index 0000000..3ce2888 --- /dev/null +++ b/Tyard/nodes/(-4047,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",5) \ No newline at end of file diff --git a/Tyard/nodes/(-4047,12,-2731).lua b/Tyard/nodes/(-4047,12,-2731).lua new file mode 100644 index 0000000..e953f0e --- /dev/null +++ b/Tyard/nodes/(-4047,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",5) \ No newline at end of file diff --git a/Tyard/nodes/(-4051,12,-2655).lua b/Tyard/nodes/(-4051,12,-2655).lua new file mode 100644 index 0000000..9e4298b --- /dev/null +++ b/Tyard/nodes/(-4051,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",6) \ No newline at end of file diff --git a/Tyard/nodes/(-4051,12,-2731).lua b/Tyard/nodes/(-4051,12,-2731).lua new file mode 100644 index 0000000..2fc4fc5 --- /dev/null +++ b/Tyard/nodes/(-4051,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",6) \ No newline at end of file diff --git a/Tyard/nodes/(-4055,12,-2655).lua b/Tyard/nodes/(-4055,12,-2655).lua new file mode 100644 index 0000000..4113ece --- /dev/null +++ b/Tyard/nodes/(-4055,12,-2655).lua @@ -0,0 +1 @@ +F.EOL("N",7) \ No newline at end of file diff --git a/Tyard/nodes/(-4055,12,-2731).lua b/Tyard/nodes/(-4055,12,-2731).lua new file mode 100644 index 0000000..edb2ef8 --- /dev/null +++ b/Tyard/nodes/(-4055,12,-2731).lua @@ -0,0 +1 @@ +F.EOL("S",7) \ No newline at end of file diff --git a/Tyard/nodes/(-4059,12,-2714).lua b/Tyard/nodes/(-4059,12,-2714).lua new file mode 100644 index 0000000..f89a6ec --- /dev/null +++ b/Tyard/nodes/(-4059,12,-2714).lua @@ -0,0 +1 @@ +--waiting lane -- config'd for the southbound-waiting lane -- train nose points south, using a north signal local dir = "N" local waiting_signal = "TY_WAITING_"..dir if S.yard_active then if atc_id then atc_send("B0") interrupt(10,"recheck") end else -- send train to "headshunt" if not atc_id then return end S.yard_active = true step_fc() local rc = get_rc() or "" S.rc = rc --check for RTS if S.single_dir == true or S.rc:match("TY_RTS") then S.dir = dir --working end = entrance dir S.RTS = true -- to direct train to PICKUP lane. AROUND_dir will be set by the pickup track else --invert S.dir --working end ~= entrance end if dir == "N" then S.dir = "S" else S.dir = "N" end end set_rc("PICKUP") set_route(waiting_signal,"HEADSHUNT") atc_set_text_outside("Proceeding to Classification Yard") atc_send("S0WRS4") end \ No newline at end of file diff --git a/Tyard/nodes/(-4063,12,-2669).lua b/Tyard/nodes/(-4063,12,-2669).lua new file mode 100644 index 0000000..7489acc --- /dev/null +++ b/Tyard/nodes/(-4063,12,-2669).lua @@ -0,0 +1 @@ +-- \ No newline at end of file -- cgit v1.2.3