ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 00 00 00 01 00 08 06 00 00 00 5c 72 a8 | .PNG........IHDR.............\r. |
0020 | 66 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 93 00 00 00 09 70 48 59 73 00 00 0e c3 00 | f....bKGD..............pHYs..... |
0040 | 00 0e c3 01 c7 6f a8 64 00 00 00 07 74 49 4d 45 07 e0 06 09 13 18 0e 53 1b a3 7f 00 00 20 00 49 | .....o.d....tIME.......S.......I |
0060 | 44 41 54 78 da ec bd 4d ac 6d db 72 1e f4 55 8d 31 e7 5a fb fc dc 7b 7d fd 8c e4 bc 98 07 09 56 | DATx...M.m.r..U.1.Z...{}.......V |
0080 | 6c 0c 92 11 e1 4f 51 08 72 1c c4 af 68 20 e8 d1 02 a4 80 e8 20 24 3a e9 44 56 40 22 12 a2 41 83 | l....OQ.r...h........$:.DV@"..A. |
00a0 | 0e 4d 24 24 7a a1 85 84 13 09 a1 88 58 a4 81 11 11 18 84 15 c5 8e 6d c5 ef dd 9f 73 f6 cf 9a 73 | .M$$z.......X.........m....s...s |
00c0 | 8c aa a2 51 63 8c 39 e6 dc 6b 9f 73 8d ec 7d 7d ce 1d f5 b4 df de 77 ef 75 d6 cf 9c 63 d4 a8 fa | ...Qc.9..k.s..}}......w.u...c... |
00e0 | ea ab af 80 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 | ....a....6l..a....6l..a....6l..a |
0100 | c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 | ....6l..a....6l..a....6l..a....6 |
0120 | 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 | l..a....6l..a....6l..a....6l..a. |
0140 | 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c | ...6l..a....6l..a....6l..a....6l |
0160 | d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 | ..a....6l..a....6l..a....6l..a.. |
0180 | 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 | ..6l..a....6l..a....6l..a....6l. |
01a0 | b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d | .a....6l..a....6l..a....6l..a... |
01c0 | 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 | .6l..a....6l..a....6l..a....6l.. |
01e0 | 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 6c d8 b0 61 c3 86 0d 1b 36 ec f7 db e8 bb f2 41 ff | a....6l..a....6l..a....6......A. |
0200 | cc 3f fb a7 e9 77 7f f8 23 bc 7c f9 12 2f 5f be c4 67 9f 7d 86 1f fc e0 07 78 fd fa 35 98 19 b7 | .?...w..#.|../_..g.}.....x..5... |
0220 | b7 b7 58 d7 15 66 06 22 82 aa 22 84 80 79 9e 01 00 77 77 77 f8 cd df fc 4d 7c f5 d5 57 b8 bd bb | ..X..f.".."..y...www....M|..W... |
0240 | c3 db 37 77 78 f5 ea 8c 57 f3 8c bf fe bf fe 4d 1b 4b e9 79 ed 67 7f e6 4f d0 ba ae 58 53 c6 67 | ..7wx...W......M.K.y.g..O...XS.g |
0260 | 9f 7d 86 d7 af 5f e3 f3 cf 3f c7 0f 7e f0 03 7c fa e9 a7 60 66 7c f9 e5 97 78 78 78 00 33 03 00 | .}..._...?..~..|...`f|...xxx.3.. |
0280 | 98 19 a7 d3 09 9f 7d f6 19 54 15 5f 7c f1 05 7e fd d7 7f 1d 77 77 77 f8 ea ab af b0 ae 2b 3e ff | ......}..T._|..~....www......+>. |
02a0 | fc c7 f0 37 fe c6 af 7c 67 ee 67 fc d8 3f e0 3f ff e7 7e 91 cc 70 73 b9 3c 9c ea ef ea 82 38 fe | ...7...|g.g..?.?..~..ps.<.....8. |
02c0 | dc 1b 33 b7 af eb bf f7 ff 16 20 fd 33 ff c4 9f bc fb 5f 86 13 78 36 fb 47 7e ee 1f 26 00 2f 99 | ..3.........3....._..x6.G~..&./. |
02e0 | 79 ea 7f af aa 8f 7e ae f7 2b 84 d0 7e 4e 29 41 55 db f7 fa d8 fa fd cf fe d9 5f 58 88 e8 e1 97 | y.....~..+..~N)AU........._X.... |
0300 | 7f f9 af da 70 00 1f b8 99 ea 64 b0 7f cf cc fe f4 53 0e a0 5f 38 bf 57 07 a0 c0 ff 49 c0 5f 02 | ....p.....d......S.._8.W....I._. |
0320 | 70 37 b6 e6 f3 18 33 bf 00 f0 17 98 f9 67 ff ff 38 00 11 81 aa b6 ef 47 07 00 e0 7f 06 f0 5f 02 | p7....3......g..8......G......_. |
0340 | 58 87 03 f8 c0 4d 24 47 03 fe 94 a8 fc 6b 00 40 f4 74 d6 63 f6 cd 1c fe e1 19 fe 28 11 fe f2 70
train.speed_restriction = 0
--TODO temporary
--advtrains.drb_dump(id)
--error("Debug: "..id.." triggered LZB-0")
else
train.speed_restriction = speed
train.is_shunt = shunt
end
--atdebug("train drove over IP: speed=",speed,"shunt=",shunt)
end
end
advtrains.tnc_register_on_approach(function(pos, id, train, index, has_entered, lzbdata)
--atdebug(id,"IL ApprC",pos,index,lzbdata)
--train.debug = advtrains.print_concat_table({train.is_shunt,"|",index,"|",lzbdata})
local pts = advtrains.roundfloorpts(pos)
local cn = train.path_cn[index]
local travsht = lzbdata.il_shunt
local travspd = lzbdata.il_speed
if travsht==nil then
-- lzbdata has reset
travspd = train.speed_restriction
travsht = train.is_shunt or false
end
-- check for signal
local asp, spos = il.db.get_ip_signal_asp(pts, cn)
-- do ARS if needed
local ars_enabled = not train.ars_disable
-- Note on ars_disable:
-- Theoretically, the ars_disable flag would need to behave like the speed restriction field: it should be
-- stored in lzbdata and updated once the train drives over. However, for the sake of simplicity, it is simply
-- a value in the train. In this case, this is sufficient because once a train triggers ARS for the first time,
-- resetting the path does not matter to the set route and ARS doesn't need to be called again.
if spos and ars_enabled then
--atdebug(id,"IL Spos (ARS)",spos,asp)
local sigd = il.db.get_sigd_for_signal(spos)
if sigd then
il.ars_check(sigd, train)
end
end
--atdebug("trav: ",pos, cn, asp, spos, "travsht=", lzb.travsht)
local lspd
if asp then
--atdebug(id,"IL Signal",spos, asp, lzbdata, "trainstate", train.speed_restriction, train.is_shunt)
local nspd = 0
--interpreting aspect and determining speed to proceed
if travsht then
--shunt move
if asp.shunt then
nspd = SHUNT_SPEED_MAX
elseif asp.proceed_as_main and asp.main ~= 0 then
nspd = asp.main
travsht = false
end
else
--train move
if asp.main ~= 0 then
nspd = asp.main
elseif asp.shunt then
nspd = SHUNT_SPEED_MAX
travsht = true
end
end
-- nspd can now be: 1. !=0: new speed restriction, 2. =0: stop here or 3. nil: keep travspd
if nspd then
if nspd == -1 then
travspd = nil
else
travspd = nspd
end
end
--atdebug("ns,ts", nspd, travspd)
lspd = travspd
local udata = {signal_pos = spos}
local callback = get_over_function(lspd, travsht)
lzbdata.il_shunt = travsht
lzbdata.il_speed = travspd
--atdebug("new lzbdata",lzbdata)
advtrains.lzb_add_checkpoint(train, index, lspd, callback, lzbdata, udata)
end
end)
-- Set the ars_disable flag to the value passed
-- Triggers a path invalidation if set to false
function advtrains.interlocking.ars_set_disable(train, value)
if value then
train.ars_disable = true
else
train.ars_disable = nil
minetest.after(0, advtrains.path_invalidate, train)
end
end
|