summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-07-17 22:14:00 -0500
committercheapie <cheapiephp@gmail.com>2026-07-17 22:14:00 -0500
commitcc42ad614bcba2b06eded78d4d149696c6d26337 (patch)
treef48f0319c0bf1a3735d8684a0b52ad1573d53b77
parentee5e72c9975c0a8e66bddd849f6daa897712f570 (diff)
downloadcelevator-cc42ad614bcba2b06eded78d4d149696c6d26337.tar
celevator-cc42ad614bcba2b06eded78d4d149696c6d26337.tar.gz
celevator-cc42ad614bcba2b06eded78d4d149696c6d26337.tar.bz2
celevator-cc42ad614bcba2b06eded78d4d149696c6d26337.tar.xz
celevator-cc42ad614bcba2b06eded78d4d149696c6d26337.zip
Improve handling of multiple calls in fire service and call cancel button behavior
-rw-r--r--controllerfw.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/controllerfw.lua b/controllerfw.lua
index 9962c52..7298e6b 100644
--- a/controllerfw.lua
+++ b/controllerfw.lua
@@ -739,6 +739,21 @@ elseif event.type == "cop" then
open()
elseif fields.callcancel and (mem.carstate == "indep" or mem.carstate == "fs2") then
mem.carcalls = {}
+ if mem.drive.status.vel > 0 then
+ for i=getpos(),#mem.params.floornames,1 do
+ if mem.drive.status.neareststop < gettarget(i) and mem.drive.status.dpos > gettarget(i) then
+ gotofloor(i)
+ break
+ end
+ end
+ elseif mem.drive.status.vel < 0 then
+ for i=#mem.params.floornames,getpos(),-1 do
+ if mem.drive.status.neareststop > gettarget(i) and mem.drive.status.dpos < gettarget(i) then
+ gotofloor(i)
+ break
+ end
+ end
+ end
elseif fields.phone then
mem.phoneactive = true
interrupt(15,"phonedone")
@@ -1165,6 +1180,7 @@ if mem.carmotion then
local hallcall = mem.upcalls[getpos()] or mem.dncalls[getpos()]
if mem.carstate == "normal" or mem.carstate == "indep" or mem.carstate == "fs1" or mem.carstate == "fs2" or mem.carstate == "swing" then
mem.carcalls[getpos()] = nil
+ if mem.carstate == "fs2" then mem.carcalls = {} end
if mem.direction == "up" then
mem.upcalls[getpos()] = nil
mem.swingupcalls[getpos()] = nil