aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/route_ui.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2024-12-13 00:23:18 +0100
committerorwell <orwell@bleipb.de>2024-12-13 00:23:18 +0100
commit7d5f840579b74374698704f256479520bde25091 (patch)
treeb39e32d1b2f518656bb12f2b6641ad31967bac99 /advtrains_interlocking/route_ui.lua
parentfe620eccb283a9d6e15c8fdbf564e8e2142da749 (diff)
downloadadvtrains-7d5f840579b74374698704f256479520bde25091.tar.gz
advtrains-7d5f840579b74374698704f256479520bde25091.tar.bz2
advtrains-7d5f840579b74374698704f256479520bde25091.zip
Repair sections on smartroute, detect start!=end TS in routesetting, create section with IL tool aux1route_prog_rework
Diffstat (limited to 'advtrains_interlocking/route_ui.lua')
-rw-r--r--advtrains_interlocking/route_ui.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/advtrains_interlocking/route_ui.lua b/advtrains_interlocking/route_ui.lua
index b75f9d7..7dddc6e 100644
--- a/advtrains_interlocking/route_ui.lua
+++ b/advtrains_interlocking/route_ui.lua
@@ -75,8 +75,17 @@ function atil.show_route_edit_form(pname, sigd, routeid, sel_rpartidx)
end
end
end
+ -- sanity check, is section at next the same as the current?
+ local nvar = c_rseg.next
+ if nvar then
+ local re_tcbs = ildb.get_tcbs({p = nvar.p, s = (nvar.s==1) and 2 or 1})
+ if not re_tcbs or not re_tcbs.ts_id or re_tcbs.ts_id~=c_ts_id then
+ itab(i, "-!- At "..sigd_to_string(c_sigd)..".Section Start and End do not match!", "err", nil)
+ break
+ end
+ end
-- advance
- c_sigd = c_rseg.next
+ c_sigd = nvar
i = i + 1
end
if c_sigd then
@@ -135,6 +144,8 @@ function atil.show_route_edit_form(pname, sigd, routeid, sel_rpartidx)
-- checkbox for call-on
form = form..string.format("checkbox[4.5,4.0;se_callon;Call-on (section may be occupied);%s]", rseg.call_on)
end
+ elseif sel_rpart and sel_rpart.err then
+ form = form.."textarea[4.5,2.5;4,4;errorta;Error:;"..tab[sel_rpartidx].."]"
else
form = form..F.label(4.5, 2, "<< Select a route part to edit options")
end