-- digiline_send("l14w", "SIS Variant 2 - v1.4 | No info avaliable") local appr_time = {[1]=15, [4]=15} if not appr_tmr then appr_tmr = 0 end local setint = false if event.ext_int then if event.message == "dep4" then next_appr = 4 appr_tmr = appr_time[4] nwaiting = nnwaiting nnwaiting = nil setint=true elseif event.message == "dep44" then next_appr = 44 appr_tmr = appr_time[4] nwaiting = nnwaiting nnwaiting = nil setint=true elseif event.message == "dep1" then next_appr = 1 appr_tmr = appr_time[1] nwaiting = nnwaiting nnwaiting = nil setint=true elseif event.message == "arr1" then if nwaiting then nnwaiting = 1 else nwaiting = 1 end elseif event.message == "arr4" then if nwaiting then nnwaiting = 4 else nwaiting = 4 end elseif event.message == "arr44" then if nwaiting then nnwaiting = 44 else nwaiting = 44 end elseif event.message == "depo" then next_appr = nil end elseif event.int then appr_tmr = appr_tmr - 5 setint=true else next_appr = nil nwaiting = nil nnwaiting = nil digiline_send("l14w", "SIS Variant 2 - v1.4 | Please Wait") return end -- calculate time for nwaiting train local nwt = 0 if nwaiting then nwt = appr_tmr + 10 + appr_time[nwaiting] end --display local seconds = appr_tmr if appr_tmr <= 0 then seconds = "" end local txt = { [1] = "Palm Bay", [4] = "Ice Mntn", [44] = "Showroom", } local line1, line2, line3 = "", "", "" if next_appr then line1 = "Line "..next_appr line2 = txt[next_appr] line3 = "in " .. seconds.."s" if seconds == "" then line3 = "now" end end local line4 = "" if nwt>0 then line4 = "Line "..nwaiting.." - "..nwt.."s" end digiline_send("l14w", line1.." | "..line2.." | "..line3.." | ----------- | "..line4) digiline_send("l14wint", "Appr: "..(next_appr or "-").." "..appr_tmr.."s".." | nwaiting: "..(nwaiting or "-").." | nnwaiting: "..(nnwaiting or "-").. " | "..event.type.." | "..(event.message or "-")) if appr_tmr > 0 and setint then interrupt(5, "appr") end