Skip to content

Commit 34bd524

Browse files
committed
Radio enhancements.
1 parent 305ea39 commit 34bd524

File tree

17 files changed

+353
-393
lines changed

17 files changed

+353
-393
lines changed

A-29B.lua

Lines changed: 13 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ A_29B = {
254254
HumanRadio = {
255255
frequency = 124.0, -- onboard radio, default DCSW frequency, chnl 0
256256
editable = true,
257-
minFrequency = 30.000,
257+
minFrequency = 108.000,
258258
maxFrequency = 399.975,
259259
rangeFrequency = {
260260
{min = 30.0, max = 87.975},
@@ -265,9 +265,12 @@ A_29B = {
265265

266266
panelRadio = {
267267
[1] = {
268-
name = _("AN/ARC-150(V)-2"), --UHF
268+
name = _("V/UHF COM1 XT-6013"),
269269
range = {
270-
{min = 225.0, max = 399.975}
270+
{min = 108.0, max = 117.975},
271+
{min = 118.0, max = 136.99167},
272+
{min = 137.0, max = 173.975},
273+
{min = 225.0, max = 399.975},
271274
},
272275
channels = {
273276
[1] = { name = _("Channel 1"), default = 225.0, modulation = _("AM")}, -- default
@@ -280,23 +283,16 @@ A_29B = {
280283
[8] = { name = _("Channel 8"), default = 257.0, modulation = _("AM")},
281284
[9] = { name = _("Channel 9"), default = 253.0, modulation = _("AM")},
282285
[10] = { name = _("Channel 10"), default = 263.0, modulation = _("AM")},
283-
[11] = { name = _("Channel 11"), default = 267.0, modulation = _("AM")},
284-
[12] = { name = _("Channel 12"), default = 254.0, modulation = _("AM")},
285-
[13] = { name = _("Channel 13"), default = 264.0, modulation = _("AM")},
286-
[14] = { name = _("Channel 14"), default = 266.0, modulation = _("AM")},
287-
[15] = { name = _("Channel 15"), default = 265.0, modulation = _("AM")},
288-
[16] = { name = _("Channel 16"), default = 252.0, modulation = _("AM")},
289-
[17] = { name = _("Channel 17"), default = 268.0, modulation = _("AM")},
290-
[18] = { name = _("Channel 18"), default = 269.0, modulation = _("AM")},
291-
[19] = { name = _("Channel 19"), default = 268.0, modulation = _("AM")},
292-
[20] = { name = _("Channel 20"), default = 269.0, modulation = _("AM")},
293286
}
294287
},
295288
[2] = {
296-
name = _("SRT-651/N"), --VHF/UHF
297-
range = {{min = 30.0, max = 88.0},
298-
{min = 108.0, max = 174.0},
299-
{min = 225.0, max = 399.975}},
289+
name = _("V/UHF COM1 XT-6313D"), --VHF/UHF
290+
range = {
291+
{min = 108.0, max = 117.975},
292+
{min = 118.0, max = 136.99167},
293+
{min = 137.0, max = 173.975},
294+
{min = 225.0, max = 399.975},
295+
},
300296
channels = {
301297
[1] = { name = _("Channel 1"), default = 225.0, connect = true}, -- default
302298
[2] = { name = _("Channel 2"), default = 258.0},
@@ -308,70 +304,11 @@ A_29B = {
308304
[8] = { name = _("Channel 8"), default = 257.0},
309305
[9] = { name = _("Channel 9"), default = 253.0},
310306
[10] = { name = _("Channel 10"), default = 263.0},
311-
[11] = { name = _("Channel 11"), default = 267.0},
312-
[12] = { name = _("Channel 12"), default = 254.0},
313-
[13] = { name = _("Channel 13"), default = 264.0},
314-
[14] = { name = _("Channel 14"), default = 266.0},
315-
[15] = { name = _("Channel 15"), default = 265.0},
316-
[16] = { name = _("Channel 16"), default = 252.0},
317-
[17] = { name = _("Channel 17"), default = 268.0},
318-
[18] = { name = _("Channel 18"), default = 269.0},
319-
[19] = { name = _("Channel 19"), default = 268.0},
320-
[20] = { name = _("Channel 20"), default = 269.0},
321-
[21] = { name = _("Channel 21"), default = 225.0},
322-
[22] = { name = _("Channel 22"), default = 258.0},
323-
[23] = { name = _("Channel 23"), default = 260.0},
324-
[24] = { name = _("Channel 24"), default = 270.0},
325-
[25] = { name = _("Channel 25"), default = 255.0},
326-
[26] = { name = _("Channel 26"), default = 259.0},
327-
[27] = { name = _("Channel 27"), default = 262.0},
328-
[28] = { name = _("Channel 28"), default = 257.0},
329-
[29] = { name = _("Channel 29"), default = 253.0},
330-
[30] = { name = _("Channel 30"), default = 263.0},
331307
}
332308
},
333309
},
334310

335-
-- HumanRadio = {
336-
-- frequency = 254.0, -- Maykop (Caucasus) or Nellis (NTTR)
337-
-- editable = true,
338-
-- minFrequency = 225.000,
339-
-- maxFrequency = 399.900,
340-
-- modulation = MODULATION_AM
341-
-- },
342311

343-
-- panelRadio = {
344-
-- [1] = {
345-
-- name = _("AN/ARC-51A"),
346-
-- range = {
347-
-- {min = 225.0, max = 399.9}
348-
-- },
349-
-- channels = { -- matches L-39C except for channel 8, which was changed to a Georgian airport and #20 which is NTTR only (for now). This radio goes 1-20 not 0-19.
350-
-- [1] = { name = _("Channel 1"), default = 264.0, modulation = _("AM"), connect = true}, -- mineralnye-vody (URMM) : 264.0
351-
-- [2] = { name = _("Channel 2"), default = 265.0, modulation = _("AM")}, -- nalchik (URMN) : 265.0
352-
-- [3] = { name = _("Channel 3"), default = 256.0, modulation = _("AM")}, -- sochi-adler (URSS) : 256.0
353-
-- [4] = { name = _("Channel 4"), default = 254.0, modulation = _("AM")}, -- maykop-khanskaya (URKH), nellis (KLSV) : 254.0
354-
-- [5] = { name = _("Channel 5"), default = 250.0, modulation = _("AM")}, -- anapa (URKA) : 250.0
355-
-- [6] = { name = _("Channel 6"), default = 270.0, modulation = _("AM")}, -- beslan (URMO) : 270.0
356-
-- [7] = { name = _("Channel 7"), default = 257.0, modulation = _("AM")}, -- krasnodar-pashkovsky (URKK) : 257.0
357-
-- [8] = { name = _("Channel 8"), default = 258.0, modulation = _("AM")}, -- sukhumi-babushara (UGSS) : 255.0
358-
-- [9] = { name = _("Channel 9"), default = 262.0, modulation = _("AM")}, -- kobuleti (UG5X) : 262.0
359-
-- [10] = { name = _("Channel 10"), default = 259.0, modulation = _("AM")}, -- gudauta (UG23) : 259.0
360-
-- [11] = { name = _("Channel 11"), default = 268.0, modulation = _("AM")}, -- tbilisi-soganlug (UG24) : 268.0
361-
-- [12] = { name = _("Channel 12"), default = 269.0, modulation = _("AM")}, -- tbilisi-vaziani (UG27) : 269.0
362-
-- [13] = { name = _("Channel 13"), default = 260.0, modulation = _("AM")}, -- batumi (UGSB) : 260.0
363-
-- [14] = { name = _("Channel 14"), default = 263.0, modulation = _("AM")}, -- kutaisi-kopitnari (UGKO) : 263.0
364-
-- [15] = { name = _("Channel 15"), default = 261.0, modulation = _("AM")}, -- senaki-kolkhi (UGKS) : 261.0
365-
-- [16] = { name = _("Channel 16"), default = 267.0, modulation = _("AM")}, -- tbilisi-lochini (UGTB) : 267.0
366-
-- [17] = { name = _("Channel 17"), default = 251.0, modulation = _("AM")}, -- krasnodar-center (URKI), creech (KINS) : 251.0
367-
-- [18] = { name = _("Channel 18"), default = 253.0, modulation = _("AM")}, -- krymsk (URKW), mccarran (KLAS) : 253.0
368-
-- [19] = { name = _("Channel 19"), default = 266.0, modulation = _("AM")}, -- mozdok (XRMF) : 266.0
369-
-- [20] = { name = _("Channel 20"), default = 252.0, modulation = _("AM")}, -- N/A, groom lake/homey (KXTA) : 252.0
370-
-- }
371-
-- },
372-
-- },
373-
374-
375312
-- Countermeasures
376313
SingleChargeTotal = 60,
377314
CMDS_Incrementation = 15,

Cockpit/Scripts/Systems/UFCP/flir.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,6 @@ function SetCommandFlir(command,value)
204204

205205
end
206206

207-
function flir_post_initialize()
207+
function post_initialize_flir()
208208
FLIR.LOOK_WPT_SET:set(0)
209209
end

Cockpit/Scripts/Systems/UFCP/main.lua

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,29 @@ function update_main()
5656

5757
-- Line 2
5858
text = text .. "COM1 "
59-
if ufcp_com1_frequency_sel == UFCP_COM_FREQUENCY_SEL_IDS.PRST then
60-
text = text .. string.format("%-2d", ufcp_com1_channel)
59+
local radio1 = GetDevice(devices["VUHF1_RADIO"])
60+
61+
if radio1:get_channel_mode() then
62+
text = text .. string.format("%-2d", radio1:get_channel())
6163
if ufcp_main_sel == SEL_IDS.COM1 then text = text .. "^" else text = text .. " " end
62-
text = text .. string.format("[%07.3f] ", ufcp_com1_frequency)
64+
text = text .. string.format("[%07.3f] ", radio1:get_set_frequency()/1e6)
6365
else
64-
text = text .. string.format("%07.3f", ufcp_com1_frequency)
66+
text = text .. string.format("%07.3f", radio1:get_set_frequency()/1e6)
6567
if ufcp_main_sel == SEL_IDS.COM1 then text = text .. "^" else text = text .. " " end
6668
text = text .. " "
6769
end
6870
text = text .. "\n"
6971

7072
-- Line 3
7173
text = text .. "COM2 "
74+
local radio2 = GetDevice(devices["VUHF2_RADIO"])
7275

73-
if ufcp_com2_frequency_sel == UFCP_COM_FREQUENCY_SEL_IDS.PRST then
74-
text = text .. string.format("%-2d", ufcp_com2_channel)
76+
if radio2:get_channel_mode() then
77+
text = text .. string.format("%-2d", radio2:get_channel())
7578
if ufcp_main_sel == SEL_IDS.COM2 then text = text .. "^" else text = text .. " " end
76-
text = text .. string.format("[%07.3f] ", ufcp_com2_frequency)
79+
text = text .. string.format("[%07.3f] ", radio2:get_set_frequency()/1e6)
7780
else
78-
text = text .. string.format("%07.3f", ufcp_com2_frequency)
81+
text = text .. string.format("%07.3f", radio2:get_set_frequency()/1e6)
7982
if ufcp_main_sel == SEL_IDS.COM2 then text = text .. "^" else text = text .. " " end
8083
text = text .. " "
8184
end
@@ -165,41 +168,35 @@ function SetCommandMain(command,value)
165168
ufcp_cmfd_ref:performClickableAction(device_commands.NAV_DEC_FYT, 1, true)
166169
end
167170
elseif ufcp_main_sel == SEL_IDS.COM1 then
168-
if ufcp_com1_frequency_sel == UFCP_COM_FREQUENCY_SEL_IDS.PRST then
169-
if command == device_commands.UFCP_UP and value == 1 and ufcp_com1_channel < ufcp_com1_max_channel then
170-
ufcp_com1_channel = (ufcp_com1_channel + 1)
171-
ufcp_com1_frequency = ufcp_com1_channels[ufcp_com1_channel + 1]
172-
elseif command == device_commands.UFCP_DOWN and value == 1 and ufcp_com1_channel > 0 then
173-
ufcp_com1_channel = (ufcp_com1_channel - 1)
174-
ufcp_com1_frequency = ufcp_com1_channels[ufcp_com1_channel + 1]
171+
local radio1 = GetDevice(devices["VUHF1_RADIO"])
172+
if radio1:get_channel_mode() then
173+
if command == device_commands.UFCP_UP and value == 1 then
174+
radio1:set_channel((radio1:get_channel() + 1))
175+
elseif command == device_commands.UFCP_DOWN and value == 1 then
176+
radio1:set_channel((radio1:get_channel() - 1))
175177
end
176178
end
177179
if command == device_commands.UFCP_0 and value == 1 then
178-
if ufcp_com1_frequency_sel == UFCP_COM_FREQUENCY_SEL_IDS.PRST then
179-
ufcp_com1_frequency_sel = UFCP_COM_FREQUENCY_SEL_IDS.MAN
180-
ufcp_com1_frequency = ufcp_com1_frequency_manual
180+
if radio1:get_channel_mode() then
181+
radio1:set_frequency(ufcp_com1_frequency_manual)
181182
else
182-
ufcp_com1_frequency_sel = UFCP_COM_FREQUENCY_SEL_IDS.PRST
183-
ufcp_com1_frequency = ufcp_com1_channels[ufcp_com1_channel + 1]
183+
radio1:set_channel(radio1:get_channel())
184184
end
185185
end
186186
elseif ufcp_main_sel == SEL_IDS.COM2 then
187-
if ufcp_com2_frequency_sel == UFCP_COM_FREQUENCY_SEL_IDS.PRST then
188-
if command == device_commands.UFCP_UP and value == 1 and ufcp_com2_channel < ufcp_com2_max_channel then
189-
ufcp_com2_channel = (ufcp_com2_channel + 1)
190-
ufcp_com2_frequency = ufcp_com2_channels[ufcp_com2_channel + 1]
191-
elseif command == device_commands.UFCP_DOWN and value == 1 and ufcp_com2_channel > 0 then
192-
ufcp_com2_channel = (ufcp_com2_channel - 1)
193-
ufcp_com2_frequency = ufcp_com2_channels[ufcp_com1_channel + 1]
187+
local radio2 = GetDevice(devices["VUHF2_RADIO"])
188+
if radio2:get_channel_mode() then
189+
if command == device_commands.UFCP_UP and value == 1 then
190+
radio2:set_channel((radio2:get_channel() + 1))
191+
elseif command == device_commands.UFCP_DOWN and value == 1 then
192+
radio2:set_channel((radio2:get_channel() - 1))
194193
end
195194
end
196195
if command == device_commands.UFCP_0 and value == 1 then
197-
if ufcp_com2_frequency_sel == UFCP_COM_FREQUENCY_SEL_IDS.PRST then
198-
ufcp_com2_frequency_sel = UFCP_COM_FREQUENCY_SEL_IDS.MAN
199-
ufcp_com2_frequency = ufcp_com2_frequency_manual
196+
if radio2:get_channel_mode() then
197+
radio2:set_frequency(ufcp_com2_frequency_manual)
200198
else
201-
ufcp_com2_frequency_sel = UFCP_COM_FREQUENCY_SEL_IDS.PRST
202-
ufcp_com2_frequency = ufcp_com2_channels[ufcp_com2_channel + 1]
199+
radio2:set_channel(radio2:get_channel())
203200
end
204201
end
205202
elseif ufcp_main_sel == SEL_IDS.TIME then

Cockpit/Scripts/Systems/UFCP/navaids.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ ufcp_navaids_adf_mode = ADF_MODE_IDS.ADF
4040
ADHSI_COURSE:set(ufcp_navaids_crs)
4141
ADHSI_ILS_FREQ:set(ufcp_navaids_ils)
4242

43-
for i = 1,ufcp_com1_max_channel+1 do ufcp_com1_channels[i] = 118 end
44-
4543
-- Methods
4644

4745
local function is_adf_frequency(frequency)

0 commit comments

Comments
 (0)