diff --git a/Scripts/DCS-BIOS/doc/Addresses.h b/Scripts/DCS-BIOS/doc/Addresses.h index 834ed30a9..2084226e2 100644 --- a/Scripts/DCS-BIOS/doc/Addresses.h +++ b/Scripts/DCS-BIOS/doc/Addresses.h @@ -8639,8 +8639,19 @@ #define FW_190D9_WINDSHIELDDAMAGE_A 0x349C #define FW_190D9_WND_SET 0x340A, 0xFFFF, 0 #define FW_190D9_WND_SET_A 0x340A +#define F_14_AFTERBURNER_LEFT 0x14EE, 0xFFFF, 0 +#define F_14_AFTERBURNER_LEFT_A 0x14EE +#define F_14_AFTERBURNER_RIGHT 0x14F0, 0xFFFF, 0 +#define F_14_AFTERBURNER_RIGHT_A 0x14F0 +#define F_14_AFTERBURNER_ZONE_LEFT 0x14FA, 0xFFFF, 0 +#define F_14_AFTERBURNER_ZONE_LEFT_A 0x14FA +#define F_14_AFTERBURNER_ZONE_RIGHT 0x1480, 0x0E00, 9 +#define F_14_BUFFET 0x14EC, 0xFFFF, 0 +#define F_14_BUFFET_A 0x14EC #define F_14_CANOPY_POS 0x1470, 0xFFFF, 0 #define F_14_CANOPY_POS_A 0x1470 +#define F_14_CATAPULTING 0x1478, 0x8000, 15 +#define F_14_CATAPULTING_AM 0x1478, 0x8000 #define F_14_EXT_ANTI_COL 0x1478, 0x0100, 8 #define F_14_EXT_ANTI_COL_AM 0x1478, 0x0100 #define F_14_EXT_FORMATION_LIGHTS 0x14AE, 0xFFFF, 0 @@ -8694,6 +8705,8 @@ #define F_14_INTERNAL_FLOOD_WHT_L_A 0x14C0 #define F_14_INTERNAL_PLT_PANEL_L 0x14C2, 0xFFFF, 0 #define F_14_INTERNAL_PLT_PANEL_L_A 0x14C2 +#define F_14_IS_F14A 0x1480, 0x0100, 8 +#define F_14_IS_F14A_AM 0x1480, 0x0100 #define F_14_PLT_ACCEL_METER_NEEDLE 0x1344, 0xFFFF, 0 #define F_14_PLT_ACCEL_METER_NEEDLE2 0x1362, 0xFFFF, 0 #define F_14_PLT_ACCEL_METER_NEEDLE2_A 0x1362 diff --git a/Scripts/DCS-BIOS/doc/doc_assets/F-14.jsonp b/Scripts/DCS-BIOS/doc/doc_assets/F-14.jsonp index fc04ef5b3..b8bbdf1fb 100644 --- a/Scripts/DCS-BIOS/doc/doc_assets/F-14.jsonp +++ b/Scripts/DCS-BIOS/doc/doc_assets/F-14.jsonp @@ -276,6 +276,133 @@ docdata["F-14"] = } ] } }, + "Airframe": { + "AFTERBURNER_LEFT": { + "category": "Airframe", + "control_type": "metadata", + "description": "Left afterburner position", + "identifier": "AFTERBURNER_LEFT", + "inputs": [ ], + "outputs": [ { + "address": 5358, + "address_identifier": "F_14_AFTERBURNER_LEFT_A", + "address_mask_shift_identifier": "F_14_AFTERBURNER_LEFT", + "description": "Left afterburner position", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "AFTERBURNER_RIGHT": { + "category": "Airframe", + "control_type": "metadata", + "description": "Right afterburner position", + "identifier": "AFTERBURNER_RIGHT", + "inputs": [ ], + "outputs": [ { + "address": 5360, + "address_identifier": "F_14_AFTERBURNER_RIGHT_A", + "address_mask_shift_identifier": "F_14_AFTERBURNER_RIGHT", + "description": "Right afterburner position", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "AFTERBURNER_ZONE_LEFT": { + "category": "Airframe", + "control_type": "metadata", + "description": "Left afterburner zone", + "identifier": "AFTERBURNER_ZONE_LEFT", + "inputs": [ ], + "outputs": [ { + "address": 5370, + "address_identifier": "F_14_AFTERBURNER_ZONE_LEFT_A", + "address_mask_shift_identifier": "F_14_AFTERBURNER_ZONE_LEFT", + "description": "Left afterburner zone", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "AFTERBURNER_ZONE_RIGHT": { + "category": "Airframe", + "control_type": "metadata", + "description": "Right afterburner zone", + "identifier": "AFTERBURNER_ZONE_RIGHT", + "inputs": [ ], + "outputs": [ { + "address": 5248, + "address_mask_shift_identifier": "F_14_AFTERBURNER_ZONE_RIGHT", + "description": "Right afterburner zone", + "mask": 3584, + "max_value": 5, + "shift_by": 9, + "suffix": "", + "type": "integer" + } ] + }, + "BUFFET": { + "category": "Airframe", + "control_type": "metadata", + "description": "How much the aircraft is shaking", + "identifier": "BUFFET", + "inputs": [ ], + "outputs": [ { + "address": 5356, + "address_identifier": "F_14_BUFFET_A", + "address_mask_shift_identifier": "F_14_BUFFET", + "description": "How much the aircraft is shaking", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "CATAPULTING": { + "category": "Airframe", + "control_type": "metadata", + "description": "Whether the aircraft is catapulting", + "identifier": "CATAPULTING", + "inputs": [ ], + "outputs": [ { + "address": 5240, + "address_mask_identifier": "F_14_CATAPULTING_AM", + "address_mask_shift_identifier": "F_14_CATAPULTING", + "description": "Whether the aircraft is catapulting", + "mask": 32768, + "max_value": 1, + "shift_by": 15, + "suffix": "", + "type": "integer" + } ] + }, + "IS_F14A": { + "category": "Airframe", + "control_type": "metadata", + "description": "Whether the aircraft is the A-model", + "identifier": "IS_F14A", + "inputs": [ ], + "outputs": [ { + "address": 5248, + "address_mask_identifier": "F_14_IS_F14A_AM", + "address_mask_shift_identifier": "F_14_IS_F14A", + "description": "Whether the aircraft is the A-model", + "mask": 256, + "max_value": 1, + "shift_by": 8, + "suffix": "", + "type": "integer" + } ] + } + }, "Airspeed Indicator": { "PLT_AIRSPD_KNOB": { "api_variant": "multiturn", diff --git a/Scripts/DCS-BIOS/doc/json/F-14.json b/Scripts/DCS-BIOS/doc/json/F-14.json index d76a57806..b5eec7522 100644 --- a/Scripts/DCS-BIOS/doc/json/F-14.json +++ b/Scripts/DCS-BIOS/doc/json/F-14.json @@ -275,6 +275,133 @@ } ] } }, + "Airframe": { + "AFTERBURNER_LEFT": { + "category": "Airframe", + "control_type": "metadata", + "description": "Left afterburner position", + "identifier": "AFTERBURNER_LEFT", + "inputs": [ ], + "outputs": [ { + "address": 5358, + "address_identifier": "F_14_AFTERBURNER_LEFT_A", + "address_mask_shift_identifier": "F_14_AFTERBURNER_LEFT", + "description": "Left afterburner position", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "AFTERBURNER_RIGHT": { + "category": "Airframe", + "control_type": "metadata", + "description": "Right afterburner position", + "identifier": "AFTERBURNER_RIGHT", + "inputs": [ ], + "outputs": [ { + "address": 5360, + "address_identifier": "F_14_AFTERBURNER_RIGHT_A", + "address_mask_shift_identifier": "F_14_AFTERBURNER_RIGHT", + "description": "Right afterburner position", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "AFTERBURNER_ZONE_LEFT": { + "category": "Airframe", + "control_type": "metadata", + "description": "Left afterburner zone", + "identifier": "AFTERBURNER_ZONE_LEFT", + "inputs": [ ], + "outputs": [ { + "address": 5370, + "address_identifier": "F_14_AFTERBURNER_ZONE_LEFT_A", + "address_mask_shift_identifier": "F_14_AFTERBURNER_ZONE_LEFT", + "description": "Left afterburner zone", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "AFTERBURNER_ZONE_RIGHT": { + "category": "Airframe", + "control_type": "metadata", + "description": "Right afterburner zone", + "identifier": "AFTERBURNER_ZONE_RIGHT", + "inputs": [ ], + "outputs": [ { + "address": 5248, + "address_mask_shift_identifier": "F_14_AFTERBURNER_ZONE_RIGHT", + "description": "Right afterburner zone", + "mask": 3584, + "max_value": 5, + "shift_by": 9, + "suffix": "", + "type": "integer" + } ] + }, + "BUFFET": { + "category": "Airframe", + "control_type": "metadata", + "description": "How much the aircraft is shaking", + "identifier": "BUFFET", + "inputs": [ ], + "outputs": [ { + "address": 5356, + "address_identifier": "F_14_BUFFET_A", + "address_mask_shift_identifier": "F_14_BUFFET", + "description": "How much the aircraft is shaking", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "CATAPULTING": { + "category": "Airframe", + "control_type": "metadata", + "description": "Whether the aircraft is catapulting", + "identifier": "CATAPULTING", + "inputs": [ ], + "outputs": [ { + "address": 5240, + "address_mask_identifier": "F_14_CATAPULTING_AM", + "address_mask_shift_identifier": "F_14_CATAPULTING", + "description": "Whether the aircraft is catapulting", + "mask": 32768, + "max_value": 1, + "shift_by": 15, + "suffix": "", + "type": "integer" + } ] + }, + "IS_F14A": { + "category": "Airframe", + "control_type": "metadata", + "description": "Whether the aircraft is the A-model", + "identifier": "IS_F14A", + "inputs": [ ], + "outputs": [ { + "address": 5248, + "address_mask_identifier": "F_14_IS_F14A_AM", + "address_mask_shift_identifier": "F_14_IS_F14A", + "description": "Whether the aircraft is the A-model", + "mask": 256, + "max_value": 1, + "shift_by": 8, + "suffix": "", + "type": "integer" + } ] + } + }, "Airspeed Indicator": { "PLT_AIRSPD_KNOB": { "api_variant": "multiturn", diff --git a/Scripts/DCS-BIOS/lib/modules/aircraft_modules/F-14.lua b/Scripts/DCS-BIOS/lib/modules/aircraft_modules/F-14.lua index 951ab823f..8af1d524b 100644 --- a/Scripts/DCS-BIOS/lib/modules/aircraft_modules/F-14.lua +++ b/Scripts/DCS-BIOS/lib/modules/aircraft_modules/F-14.lua @@ -1449,4 +1449,46 @@ F_14:definePotentiometer("RIO_MIRROR_TOP", 12, 3857, 46, { 0, 1 }, "Cockpit Mech F_14:defineReadWriteRadio("UHF_FREQ", 3, 7, 3, 1000, "UHF Radio") F_14:defineReadWriteRadio("VUHF_FREQ", 4, 7, 3, 1000, "VUHF Radio") +--- @type number[] +local airframe_values = {} + +F_14:addExportHook(function() + local dev6 = GetDevice(6) + + if not dev6 then + airframe_values = {} + return + end + + -- this method does exist on this device and is the only way to get data from the device + ---@diagnostic disable-next-line: undefined-field + airframe_values = dev6:get_values() +end) + +F_14:defineIntegerFromGetter("BUFFET", function() + return Module.valueConvert(airframe_values[1], { 0, 1 }, { 0, 65535 }) +end, 65535, "Airframe", "How much the aircraft is shaking") +F_14:defineIntegerFromGetter("AFTERBURNER_LEFT", function() + return Module.valueConvert(airframe_values[2], { 0, 1 }, { 0, 65535 }) +end, 65535, "Airframe", "Left afterburner position") +F_14:defineIntegerFromGetter("AFTERBURNER_RIGHT", function() + return Module.valueConvert(airframe_values[3], { 0, 1 }, { 0, 65535 }) +end, 65535, "Airframe", "Right afterburner position") +F_14:reserveIntValue(65535) -- todo: rolling speed (determine limits) +F_14:defineIntegerFromGetter("CATAPULTING", function() + return airframe_values[5] +end, 1, "Airframe", "Whether the aircraft is catapulting") +F_14:reserveIntValue(65535) -- todo: pitch acceleration (determine limits) +F_14:reserveIntValue(65535) -- todo: roll acceleration (determine limits) +F_14:reserveIntValue(65535) -- todo: yaw acceleration (determine limits) +F_14:defineIntegerFromGetter("IS_F14A", function() + return airframe_values[9] +end, 1, "Airframe", "Whether the aircraft is the A-model") +F_14:defineIntegerFromGetter("AFTERBURNER_ZONE_LEFT", function() + return airframe_values[10] +end, 65535, "Airframe", "Left afterburner zone") +F_14:defineIntegerFromGetter("AFTERBURNER_ZONE_RIGHT", function() + return airframe_values[11] +end, 5, "Airframe", "Right afterburner zone") + return F_14