Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate VNAO Room to new module type #272

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Scripts/DCS-BIOS/BIOS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ local SpitfireLFMkIX = require "SpitfireLFMkIX"
BIOS.protocol.writeNewModule(SpitfireLFMkIX)
--dofile(lfs.writedir()..[[Scripts/DCS-BIOS/lib/SuperCarrier.lua]])
dofile(lfs.writedir()..[[Scripts/DCS-BIOS/lib/UH-1H.lua]]) -- ID = 38, ProperName = UH-1H Huey
dofile(lfs.writedir()..[[Scripts/DCS-BIOS/lib/VNAO_Room.lua]])
-- dofile(lfs.writedir()..[[Scripts/DCS-BIOS/lib/VNAO_Room.lua]])
local VNAO_Room = require "VNAO_Room"
BIOS.protocol.writeNewModule(VNAO_Room)
dofile(lfs.writedir()..[[Scripts/DCS-BIOS/lib/VNAO_T-45.lua]]) -- ID = 43, ProperName = T-45 Goshawk
-- dofile(lfs.writedir()..[[Scripts/DCS-BIOS/lib/Yak-52.lua]]) -- ID = 39, ProperName = Yak-52
local Yak_52 = require "Yak-52"
Expand Down
49 changes: 49 additions & 0 deletions Scripts/DCS-BIOS/lib/modules/aircraft_modules/VNAO_Room.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module("VNAO_Room", package.seeall)

local Module = require("Module")

--- @class VNAO_Room: Module
local VNAO_Room = Module:new("VNAO_Room", 0x0500, { "VNAO_Ready_Room" })

--by WarLord

VNAO_Room:definePushButton("SLIDE_PREV", 2, 10001, 0, "Systems", "Previous Slide")
VNAO_Room:definePushButton("SLIDE_NEXT", 2, 10002, 0, "Systems", "Next Slide")
VNAO_Room:defineToggleSwitch("LIGHTS", 6, 10003, 387, "Systems", "Light Switch")
VNAO_Room:definePotentiometer("LIGHT_DIM", 6, 10004, 387, { 0, 1 }, "Systems", "Light Dimming")

--Gauges
VNAO_Room:defineFloat("FAN1", 380, { 0, 1 }, "Gauges", "Fan 1 Spin")
VNAO_Room:defineFloat("FAN2", 381, { 0, 1 }, "Gauges", "Fan 2 Spin")
VNAO_Room:defineFloat("FAN3", 382, { 0, 1 }, "Gauges", "Fan 3 Spin")
VNAO_Room:defineFloat("FAN4", 11, { 0, 1 }, "Gauges", "Fan 4 Spin")
VNAO_Room:defineFloat("CLOCK_H", 385, { 0, 1 }, "Gauges", "Clock Hour")
VNAO_Room:defineFloat("CLOCK_M", 383, { 0, 1 }, "Gauges", "Clock Minutes")
VNAO_Room:defineFloat("CLOCK_S", 384, { 0, 1 }, "Gauges", "Clock Seconds")
VNAO_Room:defineFloat("LIGHTS_INT", 387, { 0, 1 }, "Gauges", "Lights Intensity")
VNAO_Room:defineFloat("INSTRUCTOR", 400, { 0, 1 }, "Gauges", "Instructor")
VNAO_Room:defineFloat("PILOT_01", 401, { 0, 1 }, "Gauges", "Pilot 01")
VNAO_Room:defineFloat("PILOT_02", 402, { 0, 1 }, "Gauges", "Pilot 02")
VNAO_Room:defineFloat("PILOT_03", 403, { 0, 1 }, "Gauges", "Pilot 03")
VNAO_Room:defineFloat("PILOT_04", 404, { 0, 1 }, "Gauges", "Pilot 04")
VNAO_Room:defineFloat("PILOT_05", 405, { 0, 1 }, "Gauges", "Pilot 05")
VNAO_Room:defineFloat("PILOT_06", 406, { 0, 1 }, "Gauges", "Pilot 06")
VNAO_Room:defineFloat("PILOT_07", 407, { 0, 1 }, "Gauges", "Pilot 07")
VNAO_Room:defineFloat("PILOT_08", 408, { 0, 1 }, "Gauges", "Pilot 08")
VNAO_Room:defineFloat("PILOT_09", 409, { 0, 1 }, "Gauges", "Pilot 09")
VNAO_Room:defineFloat("PILOT_10", 410, { 0, 1 }, "Gauges", "Pilot 10")
VNAO_Room:defineFloat("PILOT_11", 411, { 0, 1 }, "Gauges", "Pilot 11")
VNAO_Room:defineFloat("PILOT_12", 412, { 0, 1 }, "Gauges", "Pilot 12")
VNAO_Room:defineFloat("PILOT_13", 413, { 0, 1 }, "Gauges", "Pilot 13")
VNAO_Room:defineFloat("PILOT_14", 414, { 0, 1 }, "Gauges", "Pilot 14")
VNAO_Room:defineFloat("PILOT_15", 415, { 0, 1 }, "Gauges", "Pilot 15")
VNAO_Room:defineFloat("PILOT_16", 416, { 0, 1 }, "Gauges", "Pilot 16")
VNAO_Room:defineFloat("PILOT_17", 417, { 0, 1 }, "Gauges", "Pilot 17")
VNAO_Room:defineFloat("PILOT_18", 418, { 0, 1 }, "Gauges", "Pilot 18")
VNAO_Room:defineFloat("PILOT_19", 419, { 0, 1 }, "Gauges", "Pilot 19")
VNAO_Room:defineFloat("PILOT_20", 420, { 0, 1 }, "Gauges", "Pilot 20")
VNAO_Room:defineFloat("PILOT_21", 421, { 0, 1 }, "Gauges", "Pilot 21")
VNAO_Room:defineFloat("PILOT_22", 422, { 0, 1 }, "Gauges", "Pilot 22")
VNAO_Room:defineFloat("PILOT_23", 424, { 0, 1 }, "Gauges", "Pilot 23")

return VNAO_Room
4 changes: 4 additions & 0 deletions Scripts/DCS-BIOS/test/AircraftTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ function TestAircraft:testSpitfireLFMkIX()
self:validateModule(require("SpitfireLFMkIX"), "SpitfireLFMkIX", 0x5400)
end

function TestAircraft:testVNAORoom()
self:validateModule(require("VNAO_Room"), "VNAO_Room", 0x0500)
end

function TestAircraft:testYak52()
self:validateModule(require("Yak-52"), "Yak-52", 0x2000)
end
Expand Down