From 904a4b00a197f954a359cb12a887fff7290eeb93 Mon Sep 17 00:00:00 2001 From: cheapie Date: Tue, 16 Apr 2024 17:52:28 -0500 Subject: Add more blinkenlights to controller --- controllerfw.lua | 24 ++++++++++++++++++++++++ textures/celevator_led_green_off.png | Bin 0 -> 621 bytes textures/celevator_led_green_on.png | Bin 0 -> 615 bytes textures/celevator_led_red_off.png | Bin 0 -> 619 bytes textures/celevator_led_red_on.png | Bin 0 -> 611 bytes textures/celevator_led_yellow_off.png | Bin 0 -> 617 bytes textures/celevator_led_yellow_on.png | Bin 0 -> 614 bytes 7 files changed, 24 insertions(+) create mode 100644 textures/celevator_led_green_off.png create mode 100644 textures/celevator_led_green_on.png create mode 100644 textures/celevator_led_red_off.png create mode 100644 textures/celevator_led_red_on.png create mode 100644 textures/celevator_led_yellow_off.png create mode 100644 textures/celevator_led_yellow_on.png diff --git a/controllerfw.lua b/controllerfw.lua index 07ba86a..6e257d9 100644 --- a/controllerfw.lua +++ b/controllerfw.lua @@ -857,6 +857,30 @@ elseif mem.screenstate == "status" then end fs("button[1,10;3,1;faults;Fault History]") fs("button[4.5,10;3,1;parameters;Edit Parameters]") + local redon = "celevator_led_red_on.png" + local redoff = "celevator_led_red_off.png" + local yellowon = "celevator_led_yellow_on.png" + local yellowoff = "celevator_led_yellow_off.png" + local greenon = "celevator_led_green_on.png" + local greenoff = "celevator_led_green_off.png" + fs(string.format("image[7,1;0.7,0.7;%s]",mem.carstate == "fault" and redon or redoff)) + fs("label[8,1.35;FAULT]") + fs(string.format("image[7,1.9;0.7,0.7;%s]",(mem.carstate == "mrinspect" or mem.carstate == "carinspect" or mem.carstate == "inspconflict") and yellowon or yellowoff)) + fs("label[8,2.25;INSP/ACCESS]") + fs(string.format("image[7,2.8;0.7,0.7;%s]",mem.carstate == "normal" and greenon or greenoff)) + fs("label[8,3.15;NORMAL OPERATION]") + fs(string.format("image[7,3.7;0.7,0.7;%s]",mem.drive.status.vel > 0.01 and yellowon or yellowoff)) + fs("label[8,4.05;UP]") + fs(string.format("image[7,4.6;0.7,0.7;%s]",math.abs(mem.drive.status.vel) > 0.01 and yellowon or yellowoff)) + fs("label[8,4.95;DRIVE CMD]") + fs(string.format("image[7,5.5;0.7,0.7;%s]",mem.drive.status.vel < -0.01 and yellowon or yellowoff)) + fs("label[8,5.85;DOWN]") + fs(string.format("image[7,6.4;0.7,0.7;%s]",math.abs(mem.drive.status.vel) > math.min(0.4,mem.params.contractspeed/2) and yellowon or yellowoff)) + fs("label[8,6.75;HIGH SPEED]") + fs(string.format("image[7,7.3;0.7,0.7;%s]",math.abs(gettarget(getpos(true))-mem.drive.status.apos) < 0.5 and greenon or greenoff)) + fs("label[8,7.65;DOOR ZONE]") + fs(string.format("image[7,8.2;0.7,0.7;%s]",mem.doorstate == "closed" and greenon or greenoff)) + fs("label[8,8.55;DOORS LOCKED]") fs("style[*;font=mono]") local stopswimg = "celevator_toggle_switch.png"..(mem.controllerstopsw and "^\\[transformFY" or "") fs(string.format("image_button[1,5;1,1.33;%s;stopsw;;false;false;%s]",stopswimg,stopswimg)) diff --git a/textures/celevator_led_green_off.png b/textures/celevator_led_green_off.png new file mode 100644 index 0000000..771588b Binary files /dev/null and b/textures/celevator_led_green_off.png differ diff --git a/textures/celevator_led_green_on.png b/textures/celevator_led_green_on.png new file mode 100644 index 0000000..788ebb1 Binary files /dev/null and b/textures/celevator_led_green_on.png differ diff --git a/textures/celevator_led_red_off.png b/textures/celevator_led_red_off.png new file mode 100644 index 0000000..92e4bc8 Binary files /dev/null and b/textures/celevator_led_red_off.png differ diff --git a/textures/celevator_led_red_on.png b/textures/celevator_led_red_on.png new file mode 100644 index 0000000..3e86955 Binary files /dev/null and b/textures/celevator_led_red_on.png differ diff --git a/textures/celevator_led_yellow_off.png b/textures/celevator_led_yellow_off.png new file mode 100644 index 0000000..21b35d7 Binary files /dev/null and b/textures/celevator_led_yellow_off.png differ diff --git a/textures/celevator_led_yellow_on.png b/textures/celevator_led_yellow_on.png new file mode 100644 index 0000000..e0bcfbf Binary files /dev/null and b/textures/celevator_led_yellow_on.png differ -- cgit v1.2.3