From a02a133a40af22bbef3465dcde44b0e600c625ec Mon Sep 17 00:00:00 2001 From: Charlie <30303272+charliefoxtwo@users.noreply.github.com> Date: Thu, 23 May 2024 16:12:00 -0700 Subject: [PATCH] Fix #587 Add F-4E IFF device --- Scripts/DCS-BIOS/doc/Addresses.h | 29 +- Scripts/DCS-BIOS/doc/doc_assets/F-4E.jsonp | 511 +++++++++++++++++- Scripts/DCS-BIOS/doc/json/F-4E.json | 511 +++++++++++++++++- .../lib/modules/aircraft_modules/F-4E.lua | 37 ++ 4 files changed, 1080 insertions(+), 8 deletions(-) diff --git a/Scripts/DCS-BIOS/doc/Addresses.h b/Scripts/DCS-BIOS/doc/Addresses.h index c2cce78ea..8e4f71f2c 100644 --- a/Scripts/DCS-BIOS/doc/Addresses.h +++ b/Scripts/DCS-BIOS/doc/Addresses.h @@ -13061,8 +13061,33 @@ #define F_22A_START_R_SW 0x6600, 0x0040, 6 #define F_22A_START_R_SW_AM 0x6600, 0x0040 #define F_22A_TAXI_LIGHTS_SW 0x6600, 0x6000, 13 -#define F_4E_PLT_MASTER_ARM_SW 0x2A00, 0x0001, 0 -#define F_4E_PLT_MASTER_ARM_SW_AM 0x2A00, 0x0001 +#define F_4E_PLT_IFF_AUDIO_LIGHT_SW 0x2A00, 0x0180, 7 +#define F_4E_PLT_IFF_CODE 0x2A00, 0x0003, 0 +#define F_4E_PLT_IFF_IDENT 0x2A08, 0x00C0, 6 +#define F_4E_PLT_IFF_M1 0x2A00, 0x0600, 9 +#define F_4E_PLT_IFF_M1_CODE_ONES 0x2A06, 0x0180, 7 +#define F_4E_PLT_IFF_M1_CODE_TENS 0x2A06, 0x0070, 4 +#define F_4E_PLT_IFF_M2 0x2A00, 0x1800, 11 +#define F_4E_PLT_IFF_M3 0x2A00, 0x6000, 13 +#define F_4E_PLT_IFF_M3_CODE_HUNDREDS 0x2A06, 0x7000, 12 +#define F_4E_PLT_IFF_M3_CODE_ONES 0x2A08, 0x0038, 3 +#define F_4E_PLT_IFF_M3_CODE_TENS 0x2A08, 0x0007, 0 +#define F_4E_PLT_IFF_M3_CODE_THOUSANDS 0x2A06, 0x0E00, 9 +#define F_4E_PLT_IFF_M4 0x2A00, 0x8000, 15 +#define F_4E_PLT_IFF_M4_AM 0x2A00, 0x8000 +#define F_4E_PLT_IFF_MASTER 0x2A00, 0x0070, 4 +#define F_4E_PLT_IFF_MC 0x2A06, 0x0003, 0 +#define F_4E_PLT_IFF_RAD 0x2A06, 0x000C, 2 +#define F_4E_PLT_IFF_REPLY_TEST_BUTTON 0x2A00, 0x0004, 2 +#define F_4E_PLT_IFF_REPLY_TEST_BUTTON_AM 0x2A00, 0x0004 +#define F_4E_PLT_IFF_REPLY_TEST_DIM 0x2A02, 0xFFFF, 0 +#define F_4E_PLT_IFF_REPLY_TEST_DIM_A 0x2A02 +#define F_4E_PLT_IFF_TEST_BUTTON 0x2A00, 0x0008, 3 +#define F_4E_PLT_IFF_TEST_BUTTON_AM 0x2A00, 0x0008 +#define F_4E_PLT_IFF_TEST_DIM 0x2A04, 0xFFFF, 0 +#define F_4E_PLT_IFF_TEST_DIM_A 0x2A04 +#define F_4E_PLT_MASTER_ARM_SW 0x2A06, 0x8000, 15 +#define F_4E_PLT_MASTER_ARM_SW_AM 0x2A06, 0x8000 #define F_5E_3_ACC 0x768E, 0x0004, 2 #define F_5E_3_ACCELEROMETER 0x76A0, 0xFFFF, 0 #define F_5E_3_ACCELEROMETER_A 0x76A0 diff --git a/Scripts/DCS-BIOS/doc/doc_assets/F-4E.jsonp b/Scripts/DCS-BIOS/doc/doc_assets/F-4E.jsonp index 32b2af7c0..805ea6de7 100644 --- a/Scripts/DCS-BIOS/doc/doc_assets/F-4E.jsonp +++ b/Scripts/DCS-BIOS/doc/doc_assets/F-4E.jsonp @@ -1,5 +1,510 @@ docdata["F-4E"] = { + "PLT IFF Panel": { + "PLT_IFF_AUDIO_LIGHT_SW": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Select Mode 4 Indication", + "identifier": "PLT_IFF_AUDIO_LIGHT_SW", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_AUDIO_LIGHT_SW", + "description": "selector position", + "mask": 384, + "max_value": 2, + "shift_by": 7, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_CODE": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Select Mode 4 Function", + "identifier": "PLT_IFF_CODE", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 3 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_CODE", + "description": "selector position", + "mask": 3, + "max_value": 3, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_IDENT": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Set Position Identification", + "identifier": "PLT_IFF_IDENT", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10760, + "address_mask_shift_identifier": "F_4E_PLT_IFF_IDENT", + "description": "selector position", + "mask": 192, + "max_value": 2, + "shift_by": 6, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M1": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode 1", + "identifier": "PLT_IFF_M1", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M1", + "description": "selector position", + "mask": 1536, + "max_value": 2, + "shift_by": 9, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M1_CODE_ONES": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M1 Code (ones)", + "identifier": "PLT_IFF_M1_CODE_ONES", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 3 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M1_CODE_ONES", + "description": "selector position", + "mask": 384, + "max_value": 3, + "shift_by": 7, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M1_CODE_TENS": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M1 Code (tens)", + "identifier": "PLT_IFF_M1_CODE_TENS", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M1_CODE_TENS", + "description": "selector position", + "mask": 112, + "max_value": 7, + "shift_by": 4, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M2": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode 2", + "identifier": "PLT_IFF_M2", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M2", + "description": "selector position", + "mask": 6144, + "max_value": 2, + "shift_by": 11, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode 3A", + "identifier": "PLT_IFF_M3", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3", + "description": "selector position", + "mask": 24576, + "max_value": 2, + "shift_by": 13, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3_CODE_HUNDREDS": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M3 Code (hundreds)", + "identifier": "PLT_IFF_M3_CODE_HUNDREDS", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3_CODE_HUNDREDS", + "description": "selector position", + "mask": 28672, + "max_value": 7, + "shift_by": 12, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3_CODE_ONES": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M3 Code (ones)", + "identifier": "PLT_IFF_M3_CODE_ONES", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10760, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3_CODE_ONES", + "description": "selector position", + "mask": 56, + "max_value": 7, + "shift_by": 3, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3_CODE_TENS": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M3 Code (tens)", + "identifier": "PLT_IFF_M3_CODE_TENS", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10760, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3_CODE_TENS", + "description": "selector position", + "mask": 7, + "max_value": 7, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3_CODE_THOUSANDS": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M3 Code (thousands)", + "identifier": "PLT_IFF_M3_CODE_THOUSANDS", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3_CODE_THOUSANDS", + "description": "selector position", + "mask": 3584, + "max_value": 7, + "shift_by": 9, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M4": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode 4", + "identifier": "PLT_IFF_M4", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 1 + }, { + "argument": "TOGGLE", + "description": "Toggle switch state", + "interface": "action" + } ], + "outputs": [ { + "address": 10752, + "address_mask_identifier": "F_4E_PLT_IFF_M4_AM", + "address_mask_shift_identifier": "F_4E_PLT_IFF_M4", + "description": "selector position", + "mask": 32768, + "max_value": 1, + "shift_by": 15, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_MASTER": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Select Master Mode", + "identifier": "PLT_IFF_MASTER", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 4 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_MASTER", + "description": "selector position", + "mask": 112, + "max_value": 4, + "shift_by": 4, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_MC": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode C", + "identifier": "PLT_IFF_MC", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_MC", + "description": "selector position", + "mask": 3, + "max_value": 2, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_RAD": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Monitor Radiation", + "identifier": "PLT_IFF_RAD", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_RAD", + "description": "selector position", + "mask": 12, + "max_value": 2, + "shift_by": 2, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_REPLY_TEST_BUTTON": { + "api_variant": "momentary_last_position", + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "IFF Reply Lamp (push to test)", + "identifier": "PLT_IFF_REPLY_TEST_BUTTON", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 1 + }, { + "argument": "TOGGLE", + "description": "Toggle switch state", + "interface": "action" + } ], + "outputs": [ { + "address": 10752, + "address_mask_identifier": "F_4E_PLT_IFF_REPLY_TEST_BUTTON_AM", + "address_mask_shift_identifier": "F_4E_PLT_IFF_REPLY_TEST_BUTTON", + "description": "selector position", + "mask": 4, + "max_value": 1, + "shift_by": 2, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_REPLY_TEST_DIM": { + "category": "PLT IFF Panel", + "control_type": "limited_dial", + "description": "IFF Reply Lamp (rotate to dim)", + "identifier": "PLT_IFF_REPLY_TEST_DIM", + "inputs": [ { + "description": "set the position of the dial", + "interface": "set_state", + "max_value": 65535 + }, { + "description": "turn the dial left or right", + "interface": "variable_step", + "max_value": 65535, + "suggested_step": 3200 + } ], + "outputs": [ { + "address": 10754, + "address_identifier": "F_4E_PLT_IFF_REPLY_TEST_DIM_A", + "address_mask_shift_identifier": "F_4E_PLT_IFF_REPLY_TEST_DIM", + "description": "position of the potentiometer", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_TEST_BUTTON": { + "api_variant": "momentary_last_position", + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "IFF Test Lamp (push to test)", + "identifier": "PLT_IFF_TEST_BUTTON", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 1 + }, { + "argument": "TOGGLE", + "description": "Toggle switch state", + "interface": "action" + } ], + "outputs": [ { + "address": 10752, + "address_mask_identifier": "F_4E_PLT_IFF_TEST_BUTTON_AM", + "address_mask_shift_identifier": "F_4E_PLT_IFF_TEST_BUTTON", + "description": "selector position", + "mask": 8, + "max_value": 1, + "shift_by": 3, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_TEST_DIM": { + "category": "PLT IFF Panel", + "control_type": "limited_dial", + "description": "IFF Reply Lamp (rotate to dim)", + "identifier": "PLT_IFF_TEST_DIM", + "inputs": [ { + "description": "set the position of the dial", + "interface": "set_state", + "max_value": 65535 + }, { + "description": "turn the dial left or right", + "interface": "variable_step", + "max_value": 65535, + "suggested_step": 3200 + } ], + "outputs": [ { + "address": 10756, + "address_identifier": "F_4E_PLT_IFF_TEST_DIM_A", + "address_mask_shift_identifier": "F_4E_PLT_IFF_TEST_DIM", + "description": "position of the potentiometer", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + } + }, "PLT Weapons Panel": { "PLT_MASTER_ARM_SW": { "category": "PLT Weapons Panel", @@ -19,13 +524,13 @@ docdata["F-4E"] = "interface": "action" } ], "outputs": [ { - "address": 10752, + "address": 10758, "address_mask_identifier": "F_4E_PLT_MASTER_ARM_SW_AM", "address_mask_shift_identifier": "F_4E_PLT_MASTER_ARM_SW", "description": "selector position", - "mask": 1, + "mask": 32768, "max_value": 1, - "shift_by": 0, + "shift_by": 15, "suffix": "", "type": "integer" } ] diff --git a/Scripts/DCS-BIOS/doc/json/F-4E.json b/Scripts/DCS-BIOS/doc/json/F-4E.json index fe6ee0ee8..ac8290643 100644 --- a/Scripts/DCS-BIOS/doc/json/F-4E.json +++ b/Scripts/DCS-BIOS/doc/json/F-4E.json @@ -1,4 +1,509 @@ { + "PLT IFF Panel": { + "PLT_IFF_AUDIO_LIGHT_SW": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Select Mode 4 Indication", + "identifier": "PLT_IFF_AUDIO_LIGHT_SW", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_AUDIO_LIGHT_SW", + "description": "selector position", + "mask": 384, + "max_value": 2, + "shift_by": 7, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_CODE": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Select Mode 4 Function", + "identifier": "PLT_IFF_CODE", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 3 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_CODE", + "description": "selector position", + "mask": 3, + "max_value": 3, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_IDENT": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Set Position Identification", + "identifier": "PLT_IFF_IDENT", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10760, + "address_mask_shift_identifier": "F_4E_PLT_IFF_IDENT", + "description": "selector position", + "mask": 192, + "max_value": 2, + "shift_by": 6, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M1": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode 1", + "identifier": "PLT_IFF_M1", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M1", + "description": "selector position", + "mask": 1536, + "max_value": 2, + "shift_by": 9, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M1_CODE_ONES": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M1 Code (ones)", + "identifier": "PLT_IFF_M1_CODE_ONES", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 3 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M1_CODE_ONES", + "description": "selector position", + "mask": 384, + "max_value": 3, + "shift_by": 7, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M1_CODE_TENS": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M1 Code (tens)", + "identifier": "PLT_IFF_M1_CODE_TENS", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M1_CODE_TENS", + "description": "selector position", + "mask": 112, + "max_value": 7, + "shift_by": 4, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M2": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode 2", + "identifier": "PLT_IFF_M2", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M2", + "description": "selector position", + "mask": 6144, + "max_value": 2, + "shift_by": 11, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode 3A", + "identifier": "PLT_IFF_M3", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3", + "description": "selector position", + "mask": 24576, + "max_value": 2, + "shift_by": 13, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3_CODE_HUNDREDS": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M3 Code (hundreds)", + "identifier": "PLT_IFF_M3_CODE_HUNDREDS", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3_CODE_HUNDREDS", + "description": "selector position", + "mask": 28672, + "max_value": 7, + "shift_by": 12, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3_CODE_ONES": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M3 Code (ones)", + "identifier": "PLT_IFF_M3_CODE_ONES", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10760, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3_CODE_ONES", + "description": "selector position", + "mask": 56, + "max_value": 7, + "shift_by": 3, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3_CODE_TENS": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M3 Code (tens)", + "identifier": "PLT_IFF_M3_CODE_TENS", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10760, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3_CODE_TENS", + "description": "selector position", + "mask": 7, + "max_value": 7, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M3_CODE_THOUSANDS": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "M3 Code (thousands)", + "identifier": "PLT_IFF_M3_CODE_THOUSANDS", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 7 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_M3_CODE_THOUSANDS", + "description": "selector position", + "mask": 3584, + "max_value": 7, + "shift_by": 9, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_M4": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode 4", + "identifier": "PLT_IFF_M4", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 1 + }, { + "argument": "TOGGLE", + "description": "Toggle switch state", + "interface": "action" + } ], + "outputs": [ { + "address": 10752, + "address_mask_identifier": "F_4E_PLT_IFF_M4_AM", + "address_mask_shift_identifier": "F_4E_PLT_IFF_M4", + "description": "selector position", + "mask": 32768, + "max_value": 1, + "shift_by": 15, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_MASTER": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Select Master Mode", + "identifier": "PLT_IFF_MASTER", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 4 + } ], + "outputs": [ { + "address": 10752, + "address_mask_shift_identifier": "F_4E_PLT_IFF_MASTER", + "description": "selector position", + "mask": 112, + "max_value": 4, + "shift_by": 4, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_MC": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Mode C", + "identifier": "PLT_IFF_MC", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_MC", + "description": "selector position", + "mask": 3, + "max_value": 2, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_RAD": { + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "Monitor Radiation", + "identifier": "PLT_IFF_RAD", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 2 + } ], + "outputs": [ { + "address": 10758, + "address_mask_shift_identifier": "F_4E_PLT_IFF_RAD", + "description": "selector position", + "mask": 12, + "max_value": 2, + "shift_by": 2, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_REPLY_TEST_BUTTON": { + "api_variant": "momentary_last_position", + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "IFF Reply Lamp (push to test)", + "identifier": "PLT_IFF_REPLY_TEST_BUTTON", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 1 + }, { + "argument": "TOGGLE", + "description": "Toggle switch state", + "interface": "action" + } ], + "outputs": [ { + "address": 10752, + "address_mask_identifier": "F_4E_PLT_IFF_REPLY_TEST_BUTTON_AM", + "address_mask_shift_identifier": "F_4E_PLT_IFF_REPLY_TEST_BUTTON", + "description": "selector position", + "mask": 4, + "max_value": 1, + "shift_by": 2, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_REPLY_TEST_DIM": { + "category": "PLT IFF Panel", + "control_type": "limited_dial", + "description": "IFF Reply Lamp (rotate to dim)", + "identifier": "PLT_IFF_REPLY_TEST_DIM", + "inputs": [ { + "description": "set the position of the dial", + "interface": "set_state", + "max_value": 65535 + }, { + "description": "turn the dial left or right", + "interface": "variable_step", + "max_value": 65535, + "suggested_step": 3200 + } ], + "outputs": [ { + "address": 10754, + "address_identifier": "F_4E_PLT_IFF_REPLY_TEST_DIM_A", + "address_mask_shift_identifier": "F_4E_PLT_IFF_REPLY_TEST_DIM", + "description": "position of the potentiometer", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_TEST_BUTTON": { + "api_variant": "momentary_last_position", + "category": "PLT IFF Panel", + "control_type": "selector", + "description": "IFF Test Lamp (push to test)", + "identifier": "PLT_IFF_TEST_BUTTON", + "inputs": [ { + "description": "switch to previous or next state", + "interface": "fixed_step" + }, { + "description": "set position", + "interface": "set_state", + "max_value": 1 + }, { + "argument": "TOGGLE", + "description": "Toggle switch state", + "interface": "action" + } ], + "outputs": [ { + "address": 10752, + "address_mask_identifier": "F_4E_PLT_IFF_TEST_BUTTON_AM", + "address_mask_shift_identifier": "F_4E_PLT_IFF_TEST_BUTTON", + "description": "selector position", + "mask": 8, + "max_value": 1, + "shift_by": 3, + "suffix": "", + "type": "integer" + } ] + }, + "PLT_IFF_TEST_DIM": { + "category": "PLT IFF Panel", + "control_type": "limited_dial", + "description": "IFF Reply Lamp (rotate to dim)", + "identifier": "PLT_IFF_TEST_DIM", + "inputs": [ { + "description": "set the position of the dial", + "interface": "set_state", + "max_value": 65535 + }, { + "description": "turn the dial left or right", + "interface": "variable_step", + "max_value": 65535, + "suggested_step": 3200 + } ], + "outputs": [ { + "address": 10756, + "address_identifier": "F_4E_PLT_IFF_TEST_DIM_A", + "address_mask_shift_identifier": "F_4E_PLT_IFF_TEST_DIM", + "description": "position of the potentiometer", + "mask": 65535, + "max_value": 65535, + "shift_by": 0, + "suffix": "", + "type": "integer" + } ] + } + }, "PLT Weapons Panel": { "PLT_MASTER_ARM_SW": { "category": "PLT Weapons Panel", @@ -18,13 +523,13 @@ "interface": "action" } ], "outputs": [ { - "address": 10752, + "address": 10758, "address_mask_identifier": "F_4E_PLT_MASTER_ARM_SW_AM", "address_mask_shift_identifier": "F_4E_PLT_MASTER_ARM_SW", "description": "selector position", - "mask": 1, + "mask": 32768, "max_value": 1, - "shift_by": 0, + "shift_by": 15, "suffix": "", "type": "integer" } ] diff --git a/Scripts/DCS-BIOS/lib/modules/aircraft_modules/F-4E.lua b/Scripts/DCS-BIOS/lib/modules/aircraft_modules/F-4E.lua index a6cd2a510..62cc4724f 100644 --- a/Scripts/DCS-BIOS/lib/modules/aircraft_modules/F-4E.lua +++ b/Scripts/DCS-BIOS/lib/modules/aircraft_modules/F-4E.lua @@ -5,6 +5,19 @@ local Module = require("Scripts.DCS-BIOS.lib.modules.Module") --- @class F_4E: Module local F_4E = Module:new("F-4E", 0x2A00, { "F-4E-45MC" }) +--- Default limited multiposition tumb for F-4E +--- @param identifier string the unique identifier for the control +--- @param device_id integer the dcs device id +--- @param command integer the dcs command +--- @param arg_number integer the dcs argument number +--- @param count integer the number of discrete steps the control has +--- @param category string the category in which the control should appear +--- @param description string additional information about the control +--- @return Control control the control which was added to the module +function F_4E:defineMultipositionRollerLimited(identifier, device_id, command, arg_number, count, category, description) + self:defineTumb(identifier, device_id, command, arg_number, 1 / (count - 1), { 0, 1 }, nil, false, category, description) +end + -- ICS local ICS_DEVICE_ID = 2 @@ -14,6 +27,30 @@ local ARC_164_DEVICE_ID = 3 -- IFF local IFF_DEVICE_ID = 4 +-- pilot iff panel +local PILOT_IFF_PANEL = "PLT IFF Panel" + +F_4E:defineMultipositionSwitch("PLT_IFF_CODE", IFF_DEVICE_ID, 3001, 1322, 4, 1 / 3, PILOT_IFF_PANEL, "Select Mode 4 Function") +F_4E:definePushButton("PLT_IFF_REPLY_TEST_BUTTON", IFF_DEVICE_ID, 3064, 2843, PILOT_IFF_PANEL, "IFF Reply Lamp (push to test)") +F_4E:definePotentiometer("PLT_IFF_REPLY_TEST_DIM", IFF_DEVICE_ID, 3065, 2842, { 0, 1 }, PILOT_IFF_PANEL, "IFF Reply Lamp (rotate to dim)") +F_4E:definePushButton("PLT_IFF_TEST_BUTTON", IFF_DEVICE_ID, 3066, 2845, PILOT_IFF_PANEL, "IFF Test Lamp (push to test)") +F_4E:definePotentiometer("PLT_IFF_TEST_DIM", IFF_DEVICE_ID, 3067, 2844, { 0, 1 }, PILOT_IFF_PANEL, "IFF Test Lamp (rotate to dim)") +F_4E:defineMultipositionSwitch("PLT_IFF_MASTER", IFF_DEVICE_ID, 3005, 1521, 5, 1 / 4, PILOT_IFF_PANEL, "Select Master Mode") +F_4E:define3PosTumb("PLT_IFF_AUDIO_LIGHT_SW", IFF_DEVICE_ID, 3009, 1328, PILOT_IFF_PANEL, "Select Mode 4 Indication") +F_4E:define3PosTumb("PLT_IFF_M1", IFF_DEVICE_ID, 3013, 1323, PILOT_IFF_PANEL, "Mode 1") +F_4E:define3PosTumb("PLT_IFF_M2", IFF_DEVICE_ID, 3017, 1324, PILOT_IFF_PANEL, "Mode 2") +F_4E:define3PosTumb("PLT_IFF_M3", IFF_DEVICE_ID, 3021, 1325, PILOT_IFF_PANEL, "Mode 3A") +F_4E:define3PosTumb("PLT_IFF_MC", IFF_DEVICE_ID, 3025, 1326, PILOT_IFF_PANEL, "Mode C") +F_4E:define3PosTumb("PLT_IFF_RAD", IFF_DEVICE_ID, 3029, 1329, PILOT_IFF_PANEL, "Monitor Radiation") +F_4E:defineToggleSwitch("PLT_IFF_M4", IFF_DEVICE_ID, 3033, 1327, PILOT_IFF_PANEL, "Mode 4") +F_4E:defineMultipositionRollerLimited("PLT_IFF_M1_CODE_TENS", IFF_DEVICE_ID, 3036, 1331, 8, PILOT_IFF_PANEL, "M1 Code (tens)") +F_4E:defineMultipositionRollerLimited("PLT_IFF_M1_CODE_ONES", IFF_DEVICE_ID, 3040, 1332, 4, PILOT_IFF_PANEL, "M1 Code (ones)") +F_4E:defineMultipositionRollerLimited("PLT_IFF_M3_CODE_THOUSANDS", IFF_DEVICE_ID, 3044, 1333, 8, PILOT_IFF_PANEL, "M3 Code (thousands)") +F_4E:defineMultipositionRollerLimited("PLT_IFF_M3_CODE_HUNDREDS", IFF_DEVICE_ID, 3048, 1334, 8, PILOT_IFF_PANEL, "M3 Code (hundreds)") +F_4E:defineMultipositionRollerLimited("PLT_IFF_M3_CODE_TENS", IFF_DEVICE_ID, 3052, 1335, 8, PILOT_IFF_PANEL, "M3 Code (tens)") +F_4E:defineMultipositionRollerLimited("PLT_IFF_M3_CODE_ONES", IFF_DEVICE_ID, 3056, 1336, 8, PILOT_IFF_PANEL, "M3 Code (ones)") +F_4E:define3PosTumb("PLT_IFF_IDENT", IFF_DEVICE_ID, 3060, 1330, PILOT_IFF_PANEL, "Set Position Identification") + -- Countermeasures local COUNTERMEASURES_DEVICE_ID = 5