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 Yak-52 to new module type #264

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 @@ -100,7 +100,9 @@ BIOS.protocol.writeNewModule(SpitfireLFMkIX)
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_T-45.lua]]) -- ID = 43, ProperName = T-45 Goshawk
dofile(lfs.writedir()..[[Scripts\DCS-BIOS\lib\Yak-52.lua]]) -- ID = 39, ProperName = Yak-52
-- dofile(lfs.writedir()..[[Scripts\DCS-BIOS\lib\Yak-52.lua]]) -- ID = 39, ProperName = Yak-52
local Yak_52 = require "Yak-52"
BIOS.protocol.writeNewModule(Yak_52)
----------------------------------------------------------------------------Modules End--------------------------------------
dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOSConfig.lua]])

Expand Down
309 changes: 309 additions & 0 deletions Scripts/DCS-BIOS/lib/modules/aircraft_modules/Yak-52.lua

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Scripts/DCS-BIOS/lib/modules/documentation/StringOutput.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module("StringOutput", package.seeall)
local OutputType = require("OutputType")

--- @class StringOutput: Output
--- @field maxLength integer
--- @field max_length integer
local StringOutput = {}

--- TODO
Expand All @@ -14,7 +14,7 @@ local StringOutput = {}
function StringOutput:new(allocation, suffix, description)
--- @type StringOutput
local o = {
maxLength = allocation.maxLength,
max_length = allocation.maxLength,
address = allocation.address,
suffix = suffix,
description = description,
Expand Down
4 changes: 4 additions & 0 deletions Scripts/DCS-BIOS/test/AircraftTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ function TestAircraft:testSpitfireLFMkIX()
self:validateModule(require("SpitfireLFMkIX"), "SpitfireLFMkIX", 0x5400)
end

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

--- Validates a module is as expected and that control names are valid
--- @param module Module
--- @param expected_name string
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DCS-BIOS/test/controls/FixedStepTumbTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function TestFixedStepTumb:testAddFixedStepTumb()

local string_output = control.outputs[2] --[[@as StringOutput]]
lu.assertEquals(string_output.type, OutputType.string)
lu.assertEquals(string_output.maxLength, 1)
lu.assertEquals(string_output.max_length, 1)
lu.assertEquals(string_output.suffix, Suffix.str)

lu.assertEquals(string_output.address, moduleAddress + 2) -- string will require new address
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DCS-BIOS/test/controls/RadioWheelTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function TestRadioWheel:testAddRadioWheel()

local string_output = control.outputs[2] --[[@as StringOutput]]
lu.assertEquals(string_output.type, OutputType.string)
lu.assertEquals(string_output.maxLength, 1)
lu.assertEquals(string_output.max_length, 1)
lu.assertEquals(string_output.suffix, Suffix.str)

lu.assertEquals(string_output.address, moduleAddress + 2) -- string will require new address
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DCS-BIOS/test/controls/StringTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function TestString:testAddString()
lu.assertEquals(#control.outputs, 1)
local string_output = control.outputs[1] --[[@as StringOutput]]
lu.assertEquals(string_output.type, OutputType.string)
lu.assertEquals(string_output.maxLength, max_length)
lu.assertEquals(string_output.max_length, max_length)
lu.assertEquals(string_output.suffix, Suffix.none)
lu.assertEquals(string_output.address, moduleAddress) -- first control, should be plenty of room, no need to move the address
end
Expand Down
2 changes: 1 addition & 1 deletion Scripts/DCS-BIOS/test/controls/TumbTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function TestTumb:testAddTumbNoCycle()

local string_output = control.outputs[2] --[[@as StringOutput]]
lu.assertEquals(string_output.type, OutputType.string)
lu.assertEquals(string_output.maxLength, 1)
lu.assertEquals(string_output.max_length, 1)
lu.assertEquals(string_output.suffix, Suffix.str)

lu.assertEquals(string_output.address, moduleAddress + 2) -- string will require new address
Expand Down