diff --git a/ExportsModules/Empty-DCS.lua b/ExportsModules/Empty-DCS.lua deleted file mode 100644 index 6949589..0000000 --- a/ExportsModules/Empty-DCS.lua +++ /dev/null @@ -1,106 +0,0 @@ --- modul name --- Version - -gES_FoundDCSModule = true - -gES_GlassCockpitConfigEveryFrameArguments = -{ --- Hier kommen alle Anzeigen rein die in HELOS/HawgTouch angezeigt werden sollen --- [4] DCS ID, e.g. 4 for AOA --- "%.4f" Format des Rückgabewerte, z.B. "%.4f" eine Floatzahl mit 4 Nachkommastellen, "%0.1f" eine Floatzahl mit führender 0 und einer Nachkommstelle, "%1d" eine Einstellige dezimalzahl --- -- AOA, Description of DCS ID - [4] = "%.4f", -- AOA - [] = "", -- -} -gES_GlassCockpitConfigArguments = -{ --- Hier kommen alle Schalter rein die in HELOS/HawgTouch angezeigt werden sollen --- [101] DCS ID from Button, e.g. 22 for PTR-EXT-STORES-JETT (mergency Jettison External Stores) --- "%.1" Format des Wertes der an DCS gesendet werden soll, Beschreibung siehe oben --- -- PTR-EXT-STORES-JETT (mergency Jettison External Stores) Description of DCS ID - [101] = "%.1f", -- PTR-EXT-STORES-JETT (mergency Jettison External Stores) - [] = "", -- -} - ------------------------------ --- HIGH IMPORTANCE EXPORTS -- --- done every export event -- ------------------------------ - --- Pointed to by ProcessGlassCockpitDCSHighImportance -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - end -end - -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) --- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll --- In der Regel sind das die Statusanzeigen - --- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware --- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen --- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der übergeben DCS ID aus dem Spiel ausliest --- 178 ist die DCS ID von dem man die Werte haben will --- Description - SendDataHW("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE - SendDataHW("", mainPanelDevice:get_argument_value()) -- -end - ------------------------------------------------------ --- LOW IMPORTANCE EXPORTS -- --- done every gExportLowTickInterval export events -- ------------------------------------------------------ - --- Pointed to by ProcessGlassCockpitDCSConfigLowImportance -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - end -end - -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) - --[[ - every frame export to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config - ]] - - --===================================================================================== - --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - WriteToLog('CMSP: '..dump(list_indication(7))) - - local ltmp1 = 0 - for ltmp2 = 0, 13, 1 do - ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] ---[[ - local ltmp1 = 0 - for ltmp2 = 1, 73, 1 do - ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end -]] -end - ------------------------------ --- Custom functions -- ------------------------------ - -function genericRadio(key, value, hardware) -end diff --git a/ExportsModules/Ka-50.lua b/ExportsModules/Ka-50.lua deleted file mode 100644 index 1958a5e..0000000 --- a/ExportsModules/Ka-50.lua +++ /dev/null @@ -1,2015 +0,0 @@ --- Ka-50 Export --- Version 0.9.9 BETA - -gES_FoundDCSModule = true - -gES_GlassCockpitConfigEveryFrameArguments = -{ - -- LAMPS - --------------------------------------------------- - [44] = "%0.1f", -- lamp_MasterWarning {0.0,0.3} - [46] = "%0.1f", -- lamp_RotorRPM {0.0,1.0} - [47] = "%0.1f", -- lamp_UNDERFIREwarning {0.0,1.0} - [48] = "%0.1f", -- lamp_LowerGear {0.0,1.0} - [78] = "%0.1f", -- lamp_RPM_leftEngineMax {0.0,1.0} - [79] = "%0.1f", -- lamp_RPM_rightEngineMax {0.0,1.0} - [80] = "%0.1f", -- lamp_NyMax {0.0,1.0} - [81] = "%0.1f", -- lamp_vibr_leftEngine {0.0,1.0} - [82] = "%0.1f", -- lamp_vibr_rightEngine {0.0,1.0} - [83] = "%0.1f", -- lamp_IAS_max {0.0,1.0} - [84] = "%0.1f", -- lamp_mainTransmission {0.0,1.0} - [85] = "%0.1f", -- lamp_Fire {0.0,1.0} - [86] = "%0.1f", -- lamp_IFFfailure {0.0,1.0} - -- VVI - --------------------------------------------------- - [24] = "%.4f", -- vy (Vertical Velocity Indicator) {-1.0,1.0} - -- ADI (IKP-81) - --------------------------------------------------- - [100] = "%.4f", -- ADI_Roll {-1.0,1.0} - [101] = "%.4f", -- ADI_Pitch {-math.pi/2.0,math.pi/2.0}{1.0,-1.0} - [102] = "%0.1f", -- ADI_steering_warning_flag {0.0,1.0} - [109] = "%0.1f", -- ADI_attitude_warning_flag {0.0,1.0} - [107] = "%.4f", -- ADI_bank_steering {-1.0,1.0} - [106] = "%.4f", -- ADI_pitch_steering {-1.0,1.0} - [111] = "%.4f", -- ADI_airspeed_deviation {-1.0,1.0} - [103] = "%.4f", -- ADI_track_deviation {-1.0,1.0} - [526] = "%.4f", -- ADI_height_deviation {-1.0,1.0} - [108] = "%.4f", -- ADI_sideslip {-1.0,1.0} - -- Barometric Altimeter (VM_15PV) - -------------------------------------------------- - [87] = "%.4f", -- VM_15PV_BALT_thousands {0.0,1.0} - [88] = "%0.2f", -- VM_15PV_BaroPressure {0.0,1.0} - [89] = "%.4f", -- VM_15PV_BALT_CommandedAlt {0.0,1.0} - -- HSI (PNP-72-16) - --------------------------------------------------- - [112] = "%.4f", -- HSI_heading {0.0, 1.0} - [118] = "%.4f", -- HSI_commanded_course_needle {0.0, 1.0} - [124] = "%.4f", -- HSI_commanded_heading_needle {0.0, 1.0} - [115] = "%.4f", -- HSI_bearing_needle {0.0, 1.0} - [119] = "%0.1f", -- HSI_heading_warning_flag{0.0,1.0} - [114] = "%0.1f", -- HSI_course_warning_flag{0.0, 1.0} - [125] = "%0.1f", -- HSI_glideslope_warning_flag{0.0, 1.0} - [117] = "%0.4f", -- HSI_range_counter_100 {0.0,1.0} - [527] = "%0.4f", -- HSI_range_counter_10 {0.0,1.0} - [528] = "%0.4f", -- HSI_range_counter_1 {0.0,1.0} - [127] = "%.4f", -- HSI_longitudinal_deviation{-1.0, 1.0} - [128] = "%.4f", -- HSI_lateral_deviation{-1.0, 1.0} - [116] = "%0.1f", -- HSI_range_unavailable_flag{0.0, 1.0} - [121] = "%0.1f", -- HSI_course_unavailable_flag{0.0, 1.0} - -- Rotor Pitch - --------------------------------------------------- - [53] = "%.4f", -- RotorPitch {0.0,1.0} - -- Rotor RPM - --------------------------------------------------- - [52] = "%.4f", -- RotorRPM {0.0,1.0} - -- Radar Altimeter ( A_036) - --------------------------------------------------- - [94] = "%.4f", -- A_036_RALT {0.0,1.0} - [93] = "%.4f", -- A_036_DangerRALT {0.0,1.0} - [95] = "%0.1f", -- A_036_warning_flag {0.0,1.0} - [92] = "%0.1f", -- A_036_DangerRALT_lamp {0.0,1.0} - -- Indicated Airspeed - --------------------------------------------------- - [51] = "%.4f", -- IAS {0.0,1.0} - -- Accelerometer (ADP_4) - --------------------------------------------------- - [97] = "%0.2f", -- ADP_4_acceleration {0.0,1.0} - [98] = "%0.2f", -- ADP_4_max_achieved_acc {0.0,1.0} - [99] = "%0.2f", -- ADP_4_min_achieved_acc {0.0,1.0} - -- Mechanic Clock - --------------------------------------------------- - [68] = "%.4f", -- CLOCK_currtime_hours {0.0,1.0} - [69] = "%.4f", -- CLOCK_currtime_minutes {0.0,1.0} - [70] = "%.4f", -- CLOCK_currtime_seconds {0.0,1.0} - [75] = "%0.1f", -- CLOCK_flight_time_meter_status{0.0,0.2} - [72] = "%.4f", -- CLOCK_flight_hours {0.0,1.0} - [531] = "%.4f", -- CLOCK_flight_minutes {0.0,1.0} - [73] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0,1.0} - [532] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0,1.0} - -- backup ADI (AGR-81) - --------------------------------------------------- - [142] = "%.4f", -- AGR_81_Roll {1.0, -1.0} - [143] = "%.4f", -- AGR_81_Pitch {-1.0, 1.0} - [144] = "%.4f", -- AGR_81_sideslip {-1.0, 1.0} - [145] = "%0.1f", -- AGR_81_failure_flag{0.0, 1.0} - -- Engines temperature - --------------------------------------------------- - [133] = "%.4f", -- LeftEngineTemperatureHund {0.0,1.0} - [566] = "%.4f", -- LeftEngineTemperatureTenth {0.0,1.0} - [134] = "%.4f", -- RightEngineTemperatureHund {0.0,1.0} - [567] = "%.4f", -- RightEngineTemperatureHund {0.0,1.0} - -- Engine RPM - --------------------------------------------------- - [135] = "%.4f", -- LeftEngineRPM {0.0,1.0} - [136] = "%.4f", -- RightEngineRPM {0.0,1.0} - -- Fuel tanks - --------------------------------------------------- - [138] = "%.4f", -- RearTankAmount {0.0,1.0} - [137] = "%.4f", -- ForwardTankAmount {0.0,1.0} - [139] = "%0.1f", -- lamp_ForwardTankTest {0.0,1.0} - [140] = "%0.1f", -- lamp_RearTankTest {0.0,1.0} - -- PUI-800 Weapon panel - --------------------------------------------------- - [392] = "%0.1f", -- lamp_PUI800_Sta1_WeapIsPresent{0.0, 1.0} - [393] = "%0.1f", -- lamp_PUI800_Sta2_WeapIsPresent{0.0, 1.0} - [394] = "%0.1f", -- lamp_PUI800_Sta3_WeapIsPresent{0.0, 1.0} - [395] = "%0.1f", -- lamp_PUI800_Sta4_WeapIsPresent{0.0, 1.0} - [388] = "%0.1f", -- lamp_PUI800_Sta1_WeapIsReady{0.0, 1.0} - [389] = "%0.1f", -- lamp_PUI800_Sta2_WeapIsReady{0.0, 1.0} - [390] = "%0.1f", -- lamp_PUI800_Sta3_WeapIsReady{0.0, 1.0} - [391] = "%0.1f", -- lamp_PUI800_Sta4_WeapIsReady{0.0, 1.0} - -- LGCP - Landing gear control panel - --------------------------------------------------- - [63] = "%0.1f", -- LGCP_Lamp_NoseGearUp {0.0,1.0} - [64] = "%0.1f", -- LGCP_Lamp_NoseGearDown {0.0,1.0} - [61] = "%0.1f", -- LGCP_Lamp_RightMainGearUp {0.0,1.0} - [62] = "%0.1f", -- LGCP_Lamp_RightMainGearDown {0.0,1.0} - [59] = "%0.1f", -- LGCP_Lamp_LeftMainGearUp {0.0,1.0} - [60] = "%0.1f", -- LGCP_Lamp_LeftMainGearDown{0.0, 1.0} - -- LAMPS - --------------------------------------------------- - [170] = "%0.1f", -- lamp_H_RALT_stab {0.0,1.0} - [175] = "%0.1f", -- lamp_Hover {0.0,1.0} - [172] = "%0.1f", -- lamp_Descent {0.0,1.0} - [165] = "%0.1f", -- lamp_RouteHeadingSteering {0.0,1.0} - [171] = "%0.1f", -- lamp_RouteCourseSteering {0.0,1.0} - [176] = "%0.1f", -- lamp_Waypoint {0.0,1.0} - [166] = "%0.1f", -- lamp_EndOfRoute {0.0,1.0} - [164] = "%0.1f", -- lamp_RoughNAVcalc {0.0,1.0} - [178] = "%0.1f", -- lamp_Burst {0.0,1.0} - [173] = "%0.1f", -- lamp_CannonMovingBarr {0.0,1.0} - [177] = "%0.1f", -- lamp_CannonMovingBarr2 {0.0,1.0} - [211] = "%0.1f", -- lamp_FuelCrossfeedOn {0.0,1.0} - [187] = "%0.1f", -- lamp_CouplerOff {0.0,1.0} - [204] = "%0.1f", -- lamp_ActuatorsOilPress {0.0,1.0} - [213] = "%0.1f", -- lamp_LockOff {0.0,1.0} - -- Magnetic Compass (KI-13) - --------------------------------------------------- - [11] = "%.4f", -- KI_13_course {-1,1} - [12] = "%.4f", -- KI_13_pitch {-1,1} - [14] = "%.4f", -- KI_13_bank {-1,1} - -- LAMPS - --------------------------------------------------- - [167] = "%0.1f", -- lamp_WeapSysBUS_ON {0.0,1.0} - [180] = "%0.1f", -- lamp_TrainingMode {0.0,1.0} - [179] = "%0.1f", -- lamp_OBZOR_800 {0.0,1.0} - [188] = "%0.1f", -- lamp_RANET {0.0,1.0} - [189] = "%0.1f", -- lamp_CC_test {0.0,1.0} - [206] = "%0.1f", -- lamp_CC_failure {0.0,1.0} - [212] = "%0.1f", -- lamp_DC_AC_Inverter {0.0,1.0} - [205] = "%0.1f", -- lamp_I_251V {0.0,1.0} - [181] = "%0.1f", -- lamp_AntiIceLeftEngine {0.0,1.0} - [190] = "%0.1f", -- lamp_DustProtectLeftEngine {0.0,1.0} - [207] = "%0.1f", -- lamp_BackupModeLeftEngine {0.0,1.0} - [183] = "%0.1f", -- lamp_AntiIceRotors {0.0,1.0} - [182] = "%0.1f", -- lamp_AntiIceRightEngine {0.0,1.0} - [191] = "%0.1f", -- lamp_DustProtectRightEngine {0.0,1.0} - [208] = "%0.1f", -- lamp_BackupModeRightEngine {0.0,1.0} - [184] = "%0.1f", -- lamp_VUO_Heat {0.0,1.0} - [200] = "%0.1f", -- lamp_ForwardTank {0.0,1.0} - [209] = "%0.1f", -- lamp_LeftValveClosed {0.0,1.0} - [185] = "%0.1f", -- lamp_LeftOuterTank {0.0,1.0} - [202] = "%0.1f", -- lamp_LeftInnerTank {0.0,1.0} - [201] = "%0.1f", -- lamp_RearTank {0.0,1.0} - [210] = "%0.1f", -- lamp_RightValveClosed {0.0,1.0} - [186] = "%0.1f", -- lamp_RightOuterTank {0.0,1.0} - [203] = "%0.1f", -- lamp_RightInnerTank {0.0,1.0} - -- DATALINK - --------------------------------------------------- - [159] = "%0.1f", -- PRC_button_SEND {0.0,0.3} - [150] = "%0.1f", -- PRC_button_ESCAPE {0.0,0.3} - [161] = "%0.1f", -- PRC_button_ERASE {0.0,0.3} - [15] = "%0.1f", -- PRC_button_CLEAN {0.0,0.3} - [16] = "%0.1f", -- PRC_button_WINGMAN_ALL {0.0,0.3} - [17] = "%0.1f", -- PRC_button_WINGMAN_1 {0.0,0.3} - [18] = "%0.1f", -- PRC_button_WINGMAN_2 {0.0,0.3} - [19] = "%0.1f", -- PRC_button_WINGMAN_3 {0.0,0.3} - [20] = "%0.1f", -- PRC_button_WINGMAN_4 {0.0,0.3} - [21] = "%0.1f", -- PRC_button_TARGET_1 {0.0,0.3} - [22] = "%0.1f", -- PRC_button_TARGET_2 {0.0,0.3} - [23] = "%0.1f", -- PRC_button_TARGET_3 {0.0,0.3} - [50] = "%0.1f", -- PRC_button_TARGET_POINT {0.0,0.3} - -- Laser warning system - --------------------------------------------------- - [25] = "%0.1f", -- LWS_LampAzimuth_0 {0.0,1.0} - [28] = "%0.1f", -- LWS_LampAzimuth_90 {0.0,1.0} - [26] = "%0.1f", -- LWS_LampAzimuth_180 {0.0,1.0} - [27] = "%0.1f", -- LWS_LampAzimuth_270 {0.0,1.0} - [31] = "%0.1f", -- LWS_LampAzimuth_UpperHemisphere {0.0,1.0} - [32] = "%0.1f", -- LWS_LampAzimuth_LowerHemisphere {0.0,1.0} - [33] = "%0.1f", -- LWS_LampAzimuth_LaserRangefinder {0.0,1.0} - [34] = "%0.1f", -- LWS_LampAzimuth_LaserTargetingSystem {0.0,1.0} - [582] = "%0.1f", -- LWS_LampReady {0.0,1.0} - -- UV-26 - --------------------------------------------------- - [541] = "%0.1f", -- UV26_lampLeftBoard {0.0,1.0} - [542] = "%0.1f", -- UV26_lampRightBoard {0.0,1.0} - -- PVI (Nav Control Panel) - --------------------------------------------------- - [315] = "%0.1f", -- PVI_button_WPT{0.0, 0.3} - [519] = "%0.1f", -- PVI_button_INSREALN{0.0, 0.3} - [316] = "%0.1f", -- PVI_button_FIXPT{0.0, 0.3} - [520] = "%0.1f", -- PVI_button_PRECALN{0.0, 0.3} - [317] = "%0.1f", -- PVI_button_AERDR{0.0, 0.3} - [521] = "%0.1f", -- PVI_button_NORMALN{0.0, 0.3} - [318] = "%0.1f", -- PVI_button_TGT{0.0, 0.3} - [313] = "%0.1f", -- PVI_button_ENTER{0.0, 0.3} - [314] = "%0.1f", -- PVI_button_CANCEL{0.0, 0.3} - [522] = "%0.1f", -- PVI_button_INITCOORD{0.0, 0.3} - [319] = "%0.1f", -- PVI_button_FILAMBDA{0.0, 0.3} - [320] = "%0.1f", -- PVI_button_FIZ{0.0, 0.3} - [321] = "%0.1f", -- PVI_button_DU{0.0, 0.3} - [322] = "%0.1f", -- PVI_button_FII{0.0, 0.3} - [323] = "%0.1f", -- PVI_button_BRGRNG{0.0, 0.3} - [330] = "%0.1f", -- PPR_button_K{0.0, 0.3} - [332] = "%0.1f", -- PPR_button_H{0.0, 0.3} - [331] = "%0.1f", -- PPR_button_T{0.0, 0.3} - [333] = "%0.1f", -- PPR_button_B{0.0, 0.3} - [334] = "%0.1f", -- PPR_button_DIR{0.0, 0.3} - -- RadioCommunicator R-828 - --------------------------------------------------- - [375] = "%0.1f", -- Radio_ASU_lamp{0.0,1.0} - -- RadioCommunicator R-800 - --------------------------------------------------- - [419] = "%0.1f", -- Radio_Test_lamp {0.0,1.0} - [577] = "%.3f", -- R800Rotary1 {0.0,1.0} - [574] = "%.2f", -- R800Rotary2 {0.0,1.0} - [575] = "%.2f", -- R800Rotary3 {0.0,1.0} - [576] = "%.2f", -- R800Rotary4 {0.0,1.0} - -- WEAPON INTERFACE - --------------------------------------------------- - [437] = "%0.1f", -- PRC_button_AUTO_TURN {0.0,0.3} - [438] = "%0.1f", -- PRC_button_AIRBORNE_TARGET {0.0,0.3} - [439] = "%0.1f", -- PRC_button_FORWARD_HEMISPHERE {0.0,0.3} - [440] = "%0.1f", -- PRC_button_GROUND_MOVING_TARGET {0.0,0.3} - [441] = "%0.1f", -- PRC_button_CLEAR {0.0,0.3} - -- Engines start panel - --------------------------------------------------- - [163] = "%0.1f", -- lamp_EnginesStartValve{0.0, 1.0} - -- APU control panel - --------------------------------------------------- - [162] = "%0.1f", -- lamp_APUValveOpen{0.0, 1.0}{0.0, 1.0} - [168] = "%0.1f", -- lamp_APUOilPres{0.0, 1.0}{0.0, 1.0} - [169] = "%0.1f", -- lamp_APUStoppedByRPM{0.0, 1.0} - [174] = "%0.1f", -- lamp_APU_IsON{0.0, 1.0} - -- APU Temperature - --------------------------------------------------- - [6] = "%.4f", -- APUTemperature {0.0, 900.0} = {0.0, 1.0} - -- Right Side Panel - --------------------------------------------------- - [586] = "%0.1f", -- lamp_AC_Ground_Power{0.0, 1.0} - [261] = "%0.1f", -- lamp_DC_Ground_Power{0.0, 1.0} - -- Eject system - --------------------------------------------------- - [461] = "%0.1f", -- EjectSystemTestLamp{0.0, 1.0} - -- Fire Extinguishers panel - --------------------------------------------------- - [237] = "%0.1f", -- lamp_Exting_LeftEngineFire{0.0, 1.0} - [239] = "%0.1f", -- lamp_Exting_APU_Fire{0.0, 1.0} - [568] = "%0.1f", -- lamp_Exting_HydraulicsFire{0.0, 1.0} - [241] = "%0.1f", -- lamp_Exting_RightEngineFire{0.0, 1.0} - [243] = "%0.1f", -- lamp_Exting_VentilatorFire{0.0, 1.0} - [244] = "%0.1f", -- lamp_Exting_Lamp1{0.0, 1.0} - [245] = "%0.1f", -- lamp_Exting_Lamp2{0.0, 1.0} - -- Engines mode indicator - --------------------------------------------------- - [592] = "%.4f", -- EnginesMode {0.0,1.0} - [234] = "%0.2f", -- LeftEngineMode{0.0,1.0} - [235] = "%0.2f", -- RightEngineMode {0.0,1.0} - -- Oil pressure and temperature indicators group (Right Panel) - --------------------------------------------------- - [252] = "%.4f", -- NeedleOilPressureEngineLeft {0.0,1.0} - [253] = "%.4f", -- NeedleOilPressureEngineRight {0.0, 1.0} - [254] = "%.4f", -- NeedleOilPressureGearBox {0.0,1.0} - [255] = "%.4f", -- NeedleOilTemperatureEngineLeft {0.0,1.0} - [256] = "%.4f", -- NeedleOilTemperatureEngineRight {0.0,1.0} - [257] = "%.4f", -- NeedleOilTemperatureGearBox {0.0,1.0} - -- Right Back Panel - --------------------------------------------------- - [469] = "%0.1f", -- lamp_flap_hydro_1{0.0, 1.0} - [470] = "%0.1f", -- lamp_flap_hydro_2{0.0, 1.0} - -- Hydraulics Gauges (Back Panel) - --------------------------------------------------- - [471] = "%.4f", -- hydro_common_pressure {0.0,1.0} - [472] = "%.4f", -- hydro_main_pressure {0.0,1.0} - [473] = "%.4f", -- hydro_acc_brake_pressure {0.0,1.0} - [474] = "%.4f", -- hydro_gear_brake_pressure {0.0,1.0} - [475] = "%.4f", -- hydro_common_temperature {0.0,1.0} - [476] = "%.4f", -- hydro_main_temperature {0.0,1.0} - -- Latitude Entry Panel (PShK_7) - --------------------------------------------------- - [342] = "%0.1f", -- PShK7_LampAuto {0.0,1.0} - [339] = "%0.4f", -- PShK7_Latitude_counter_tenth {0.0,10.0} - [594] = "%0.4f", -- PShK7_Latitude_counter_units {0.0,10.0} - -- Magnetic Variation Entry Panel (ZMS_3) - --------------------------------------------------- - [337] = "%0.4f", -- ZMS3_MagVar_counter_hundreds_tenth {-1.0,1.0} - [596] = "%0.4f", -- ZMS3_MagVar_counter_units {0.0,1.0} - -- Ambient Temperature - --------------------------------------------------- - [587] = "%0.4f" -- Ambient Temperature {-60, 50} = {-0.946, 0.788} -} - -gES_GlassCockpitConfigArguments = -{ - -- ADI - --------------------------------------------------- - [110] = "%.1f", -- TEST-IKP-PTR (ADI Test Button) {0.0,1.0} - -- HSI - --------------------------------------------------- - [113] = "%.1f", -- TEST-PNP-PTR03 (HSI test Button) - [54] = "%1d", -- ZPU-ZK-PTR (HSI Desired track angle - Desired heading, Auto - Manual) {0,1} - --laser ranger - --------------------------------------------------- - [56] = "%1d", -- LDP-LD-PTR (Laser rangefinder / designator - mode switch) - [57] = "%1d", -- LD-LDP-COVER-PTR (Laser rangefinder Cover) - [55] = "%.1f", -- CHOP-LDP-PTR (Laser designator reset) - -- RADIOALTIMETER - --------------------------------------------------- - [96] = "%.1f", -- TEST-RADIO-HIGHT-PTR (Radar altimeter test) - -- CPT MECH - --------------------------------------------------- - [572] = "%.1f", -- G--PTR (Accelerometer reset) - -- SYSTEM CONTROLLER - --------------------------------------------------- - [45] = "%.1f", -- CONTROL-ALARM-PTR (Lamps test) - -- STANDBY ADI (AGR-81) - --------------------------------------------------- - [230] = "%1d", -- RES-AG-PTR (Standby Attitude Indicator power switch) - -- Engines Start-Up Control Panel - --------------------------------------------------- - [131] = "%.1f", -- CONTROL-TEMP-WORK-PTR (Running engines exhaust gas temperature indicator test button) - [132] = "%.1f", -- CONTROL-TEMP-NOTWORK-PTR (Stopped engines exhaust gas temperature indicator test button) - -- FUEL SYSTEM - --------------------------------------------------- - [616] = "%.1f", -- CONTROL-OIL-PTR (Fuel quantity indicator self test button) - -- ABRIS Display - --------------------------------------------------- - [512] = "%.1f", -- PTR_BTN-ABRIS-01 (ABRIS Pushbutton 1) {start value 0.01 the same index for -2,-3,-4,-5,-6,-7,-8,-9,-RCL,-ENTR with increment 0.01} - [513] = "%.1f", -- PTR_BTN-ABRIS-02 (ABRIS Pushbutton 2) - [514] = "%.1f", -- PTR_BTN-ABRIS-03 (ABRIS Pushbutton 3) - [515] = "%.1f", -- PTR_BTN-ABRIS-04 (ABRIS Pushbutton 4) - [516] = "%.1f", -- PTR_BTN-ABRIS-05 (ABRIS Pushbutton 5) - [523] = "%.1f", -- ABRIS_SHUNT_PTR (ABRIS Cursor Control (rot/push)) - [517] = "%.3f", -- ABRIS_BRIGHTNESS_PTR (ABRIS Brightness) {0.0,1.0} (0.05) - [130] = "%0.1f", -- ABRIS-POWER_PTR (ABRIS Power) - -- HUD - --------------------------------------------------- - [8] = "%.3f", -- PTR_HUD-BRIGHTNESS (HUD Brightness) - [9] = "%1d", -- PTR_HUD-TMB-SETKA02 (HUD Modes Reticle/Night/Day) - [7] = "%.1f", -- PTR-HUD-TEST (HUD Test) - [510] = "%0.1f", -- PTR_HUD-FILTER (HUD Filter) - -- PUI-800 Weapons Control Panel - --------------------------------------------------- - [387] = "%1d", -- MASTER-ARM-PTR (Master Arm) - [402] = "%.1f", -- UI800-AVARCHOP-PTR (External stores jettison) - [396] = "%1d", -- MASTER-EXPLODE-PTR (Jettison arm mode - arm fuse/disarm fuse) - [403] = "%1d", -- PUI800-AUTO-PTR (Manual/Auto weapon system control switch) - [399] = "%1d", -- PUI800-OFBR-PTR (Cannon round selector switch HE/AP) - [400] = "%0.1f", -- SR-PTR (Weapon mode switch - Burst Length) - [398] = "%1d", -- MT-PTR (Cannon rate of fire setting) - [397] = "%.1f", -- MASTER-UNLOAD-PTR (Expedite emergency ATGM launch) - -- PUR Weapons Aux Panel - -- SHKVAL - --------------------------------------------------- - [404] = "%1d", -- PUR-BACKGROUND-PTR (IT-23 Black-White indication switch) - [406] = "%.3f", -- PUR-LIGHTIT-PTR (IT-23 display brightness) - [407] = "%.3f", -- PUR-CONTRAST-PTR (IT-23 display contrast) - -- SHKVAL windscreen wiper - [224] = "%.1f", -- WIPER-PTR (SHKVAL windscreen wiper) - -- HELMET - [405] = "%.3f", -- PUR-LIGHTNVU-PTR (Helmet device brightness) - -- WEAPON SYSTEM - [408] = "%0.1f", -- PUR-LIT-PTR (Laser code selector) - [409] = "%1d", -- PUR-OGR-INF-PTR (HUD/TV declutter switch) - -- Outside illumination - --------------------------------------------------- - [382] = "%0.1f", -- LANDING LIGHTS-DIR-LIGHT-PTR (Light landing-search. On/Retraction/Off) - [383] = "%1d", -- LANDING LIGHTS-BASE-RESERV-PTR (Lights landing-search change. Main/Reserved) - -- ALMAZ system - --------------------------------------------------- - [384] = "%.1f", -- SPEECH-INFO-OFF-PTR01 (Voice message system messages off) - [385] = "%.1f", -- SPEECH-INFO-RETRY-PTR (Voice message system messages repeat) - [386] = "%0.1f", -- SPEECH-INFO-AVAR-PTR (Voice message system emergency on) - [442] = "%.1f", -- SPEECH-BIT-PTR (Voice message system check) - -- CPT MECH - --------------------------------------------------- - [65] = "%1d", -- GEAR-PTR (Gear lever) - [66] = "%1d", -- AVAR-GEAR-PTR (Main/Common hydraulics for emergency gear) - [67] = "%1d", -- AVAR-GEAR-COVER-PTR (Main/Common hydraulics for emergency gear Cover) - -- OVERHEAD PANEL - --------------------------------------------------- - [146] = "%0.1f", -- ANO-PTR (Navigation Lights 10\% / 30\% / 100\% / Off) - [147] = "%0.1f", -- WINDSCREEN-WIPER-PTR (Windshield wiper switch) - [539] = "%1d", -- PPD-DUAS-PTR (Pitot static port and AoA sensors heat switch) - [151] = "%1d", -- PVD-CLOCK-PTR (Pitot ram air and clock heat switch) - [153] = "%1d", -- POS-ROTORS-PTR (Rotor de-icing system switch) - [154] = "%0.1f", -- POS-ENGINE-PZU-PTR (Engines de-icing / dust-protection systems switch) - [156] = "%.1f", -- KONTR-PVD-PTR (Pitot heat system test) - -- Laser Warning System - --------------------------------------------------- - [35] = "%.1f", -- L-140-RESET-PTR (LWS Reset button) - [583] = "%1d", -- L140-SWITCH (LWS Power switch) - [584] = "%.1f", -- L140-CNOB (LWS self-test button) - -- UV-26 CMD Control Panel - --------------------------------------------------- - [36] = "%0.1f", -- UV26-BOARD-PTR (CMD Select Left/Both/Right board flares dispensers) - [37] = "%0.1f", -- UV26-PROGR-PTR (CMD Amount flares counter/Programming) - [38] = "%.1f", -- UV26-SERIES-PTR (CMD Num of sequences) - [39] = "%.1f", -- UV26-BURST-PTR (CMD Num in sequence) - [41] = "%.1f", -- UV26-INTERVAL-PTR (CMD Dispense interval) - [43] = "%.1f", -- UV26-START-PTR (CMD Start dispense) - [42] = "%.1f", -- UV26-CANCELPRG-PTR (CMD Reset to default program) - [40] = "%.1f", -- UV26-STOP-PTR (CMD Stop dispense) - -- UV-26 related (REAR PANEL) - [496] = "%1d", -- UV26-POWER-PTR (CMD Power) - [497] = "%1d", -- UV26-POWER-COVER-PTR (CMD Power Cover) - [498] = "%1d", -- UV26-TEST-PTR (CMD BIT) - [499] = "%1d", -- UV26-TEST-COVER-PTR (CMD BIT Cover) - -- PVI NAV Panel - --------------------------------------------------- - [312] = "%0.1f", -- PVI-0-PTR (NAV '0' Btn) - [303] = "%0.1f", -- PVI-1-PTR (NAV '1' Btn) - [304] = "%0.1f", -- PVI-2-PTR (NAV '2' Btn) - [305] = "%0.1f", -- PVI-3-PTR (NAV '3' Btn) - [306] = "%0.1f", -- PVI-4-PTR (NAV '4' Btn) - [307] = "%0.1f", -- PVI-5-PTR (NAV '5' Btn) - [308] = "%0.1f", -- PVI-6-PTR (NAV '6' Btn) - [309] = "%0.1f", -- PVI-7-PTR (NAV '7' Btn) - [310] = "%0.1f", -- PVI-8-PTR (NAV '8' Btn) - [311] = "%0.1f", -- PVI-9-PTR (NAV '9' Btn) - [324] = "%0.1f", -- PVI-SWITCH-PTR (NAV Master modes) - [325] = "%1d", -- PVI_I251V_PTR (NAV INU fixtaking method) - [326] = "%1d", -- PVI_VCU_PTR (NAV Datalink power) - [327] = "%.3f", -- PVI-BRIGHTNESS-PTR (NAV Brightness) - -- DATALINK - --------------------------------------------------- - -- Datalink Mode Controls - [328] = "%0.1f", -- DTLK-SELF-ID-PTR (Datalink self ID) - [329] = "%0.1f", -- DTLK-MASTER-MODES-PTR (Datalink Master mode) - -- PPR - Autopilot Control Panel - -- AUTOPILOT - --------------------------------------------------- - [335] = "%0.1f", -- BAR-RV-PTR (Autopilot BARO/RALT altitude hold mode) - -- NAV SYSTEM - [336] = "%0.1f", -- ZK-LZP-PTR (Autopilot Desired heading - Desired track) - --ARK-22 - --------------------------------------------------- - [381] = "%0.2f", -- IANDING LIGHTS-DIR-LIGHT-PTR01 (ADF Inner-Auto-Outer NDB switch) - [355] = "%.1f", -- ARK-CONTROL-PTR (ADF Test) - [354] = "%1d", -- TLF-TLG-PTR (TLF-TLG modes) - [353] = "%.3f", -- VARK-VOLUME-PTR (ADF Volume) - [356] = "%1d", -- TLF-TLG-PTR01 (COMPASS-ANTENNA modes) - [357] = "%0.1f", -- VARK-VOLUME-PTR01 (ADF channel switch) - --R-828 - --------------------------------------------------- - [371] = "%0.1f", -- CHANNEL-PTR (R-828 (VHF-1) Radio channel selector) - [372] = "%.3f", -- RADIO-VOLUME-PTR (R-828 (VHF-1) Radio Volume) - [373] = "%.1f", -- ASU-PTR (R-828 (VHF-1) Tuner button) - [374] = "%1d", -- RADIO-PSH-SWITCH-PTR (R-828 (VHF-1) Squelch) - -- Signal Flares - --------------------------------------------------- - [376] = "%.1f", -- SIGNAL-FLARE-1-PTR (Signal flare red) - [377] = "%.1f", -- SIGNAL-FLARE-2-PTR (Signal flare green) - [378] = "%.1f", -- SIGNAL-FLARE-3-PTR (Signal flare white) - [379] = "%.1f", -- SIGNAL-FLARE-4-PTR (Signal flare yellow) - [380] = "%1d", -- SIGNAL-FLARE-SWITCH-PTR (Signal flare system power) - --R-800 - --------------------------------------------------- - [418] = "%.1f", -- START-PANEL-CONTROL-PTR (R-800 (VHF-2) BIT button) - [417] = "%1d", -- CONTR-RADIO-CHM-AM-PTR (R-800 (VHF-2) AM-FM toggle switch) - [421] = "%1d", -- CONTR-RADIO-AP-PTR (R-800 (VHF-2) Emergency receiver) - [422] = "%1d", -- CONTR-RADIO-ARK-PTR (R-800 (VHF-2) ADF switch) - [420] = "%1d", -- CONTR-RADIO-50-100-PTR01 (R-800 (VHF-2) Data transfer rate switch) - [423] = "%1d", -- CONTR-RADIO-PSH-PTR (R-800 (VHF-2) Squelch) - -- PVR - --------------------------------------------------- - -- WEAPONS - [432] = "%1d", -- PVR-DRILL-PTR (Training mode) - [431] = "%0.1f", -- PVR-MODE-PTR (Weapon system mode selector) - [436] = "%1d", -- PVR-AS-PM-PTR (Automatic Tracking / gun sight) - -- K041 - [433] = "%1d", -- K-041-PTR (K-041 Targeting-navigation system power switch) - -- LASERRANGER - [435] = "%1d", -- PVR-IZL-PTR (Laser standby ON/OFF switch) - -- HELMET - [434] = "%1d", -- PVR-OBZ-PTR (Helmet-mounted sight system power switch) - -- SHKVAL - [301] = "%0.1f", -- V-SCAN-PTR (Shkval scan rate) - -- Engines Start-Up Control Panel - --------------------------------------------------- - [412] = "%.1f", -- START-PANEL-START-PTR (Start-up selected engine button) - [413] = "%.1f", -- START-PANEL-STOP-START-PTR ("Interrupt start-up button) - [414] = "%.1f", -- START-PANEL-STOP-START-PTR01 (Stop APU button) - [415] = "%0.1f", -- START-PANEL-ROLLING-PTR (Engine Startup/Crank/False Start selector) - [416] = "%0.1f", -- START-ENGINE-SELECTOR-PTR (Engine selector) - [554] = "%1d", -- EMERGENCY-BRAKE ENGINE-LEFT-PTR (Left engine cut-off valve) - [555] = "%1d", -- EMERGENCY-BRAKE ENGINE-RIGHT-PTR (Right engine cut-off valve) - [556] = "%1d", -- BRAKE-ROTOR-LOW-PTR01 (Rotor brake) - --Radio switcher - --------------------------------------------------- - [428] = "%0.2f", -- RADIO-RATE-PTR (SPU-9 Radio communicator selector) - -- Right Side Panel - --------------------------------------------------- - -- ELECTRICS POWER - [262] = "%1d", -- ENERG-AER-RIT-PTR (DC ground power) - [263] = "%1d", -- ENERG-COVER-AER-RIT-PTR (DC ground power Cover) - [543] = "%1d", -- ENERG-AKK2-PTR (Battery 2) - [544] = "%1d", -- ENERG-COVER-AKK2-PTR (Battery 2 Cover) - [264] = "%1d", -- ENERG-AKK1-PTR (Battery 1) - [265] = "%1d", -- ENERG-COVER-AKK1-PTR (Battery 1 Cover) - [267] = "%1d", -- RAMP-POWER-PTR (AC ground power) - [268] = "%1d", -- GEN-LEFT-PTR (AC left generator) - [269] = "%1d", -- GEN-RIGHT-PTR (AC right generator) - [270] = "%01.f", -- CONVERTER-PTR (DC/AC inverter) {0.0, 0.2} - -- FUEL SYSTEM - [271] = "%1d", -- FUEL-PUMP-FRONT-PTR (Forward fuel tank pumps) - [272] = "%1d", -- FUEL-PUMP-BACK-PTR (Rear fuel tank pumps) - [273] = "%1d", -- FUEL-PUMP-INNER-PTR (Inner external fuel tanks pumps) - [274] = "%1d", -- FUEL-PUMP-OUTER-PTR (Outer external fuel tanks pumps) - [275] = "%1d", -- FUEL-METER-PTR (Fuelmeter power) - [276] = "%1d", -- PAV-CRANE-ENGINE-LEFT-PTR (Left engine fuel shutoff valve) - [277] = "%1d", -- PAV-CRANE-COVER-ENGINE-LEFT-PTR (Left engine fuel shutoff valve) - [278] = "%1d", -- PAV-CRANE-ENGINE-RIGHT-PTR (Right engine fuel shutoff valve) - [279] = "%1d", -- PAV-CRANE-COVER-ENGINE-RIGHT-PTR (Right engine fuel shutoff valve) - [280] = "%1d", -- PAV-CRANE-VSU-PTR (APU fuel shutoff valve) - [281] = "%1d", -- PAV-CRANE-COVER-VSU-PTR (APU fuel shutoff valve Cover) - [282] = "%1d", -- PAV-CRANE-CYKLIZATION-PTR (Fuel crossfeed valve) - [283] = "%1d", -- PAV-CRANE-COVER-CYKLIZATION-PTR (Fuel crossfeed valve Cover) - -- COMMS POWER - [284] = "%1d", -- COMM-PWR-AVSK-PTR (Intercom) - [285] = "%1d", -- COMM-PWR-UKV-1-PTR (VHF-1 (R828) power switch) - [286] = "%1d", -- COMM-PWR-UKV-2-PTR (VHF-2 (R-800) power switch) - [287] = "%1d", -- COMM-PWR-TLK-PTR (Radio equipment datalink TLK power switch) - [288] = "%1d", -- COMM-PWR-UKV-TLK-PTR (Radio equipment datalink UHF TLK power switch) - [289] = "%1d", -- COMM-PWR-SA-TLF-PTR (Radio equipment datalink SA-TLF power switch) - -- WEAPON SYS - [547] = "%1d", -- SUO-PTR (Weapons Control system) - [548] = "%1d", -- SUO-COVER-PTR (Weapons Control system Cover) - -- EJECT SYSTEM - [214] = "%1d", -- RIGHT-EMERG-SW1-PTR (Ejecting system power 1) - [215] = "%1d", -- RIGHT-EMERG-SW2-PTR (Ejecting system power 2) - [216] = "%1d", -- RIGHT-EMERG-SW3-PTR (Ejecting system power 3) - [217] = "%1d", -- RIGHT-COVER-EMERG-VACATION-PTR (Ejecting system power Cover) - [462] = "%0.1f", -- CONTR-SAPROTATE-PTR (Ejecting system circuit selector) - [460] = "%.1f", -- CONTR-SAP-PTR (Ejecting system circuit test) - -- HYDRAULICS - [220] = "%1d", -- HYDRO-PTR (Main hydraulics) - [221] = "%1d", -- HYDRO-COVER-PTR02 (Main hydraulics Cover) - -- IFF - [218] = "%1d", -- SRO-PTR (IFF power) - [219] = "%1d", -- COVER-SRO-PTR (IFF power Cover) - -- NAV SYSTEM - [222] = "%1d", -- PNK-PTR (Navigation system power) - [229] = "%0.1f", -- GYRO-MAG-MAN-HEADING-PTR (Gyro/Mag/Manual heading) - -- Outside illumination - [228] = "%1d", -- FLASHER-PTR (Anticollision Light) - [296] = "%1d", -- CONTUR-LIGHT-PTR (Tip Lights) - [297] = "%0.1f", -- FORMATION-PTR (Formation Lights) - -- ENGINES - [290] = "%1d", -- ERD-LEFT-PTR (EEG Left engine Electronic Engine Governor) - [291] = "%1d", -- ERD-LEFT-COVER-PTR (EEG Left engine Electronic Engine Governor Cover) - [292] = "%1d", -- ERD-RIGHT-PTR (EEG Right engine Electronic Engine Governor) - [293] = "%1d", -- ERD-RIGHT-COVER-PTR (EEG Right engine Electronic Engine Governor Cover) - [294] = "%1d", -- PAV-CRANE-VSU-PTR01 (EEG gas generator test Operate switch) - [569] = "%1d", -- PAV-CRANE-COVER-VSU-PTR01 (EEG gas generator test Operate switch Cover) - [295] = "%0.1f", -- PAV-CRANE-VSU-PTR02 (EEG power turbine channel 1 test Operate EEG power turbine channel 2 test, three-switch contactor) - [570] = "%0.1f", -- PAV-CRANE-COVER-VSU-PTR02 (EEG power turbine channel 1 test Operate EEG power turbine channel 2 test, three-switch contactor Cover) - [457] = "%.1f", -- RT-12-6-LEFT-PTR (Left EGT control threshold governor button) - [458] = "%.1f", -- RT-12-6-RIGHT-PTR (Right EGT control threshold governor button) - [459] = "%.1f", -- RT-12-6-IV-PTR (Engines vibrations monitoring system control button) - -- Lighting - [300] = "%1d", -- DESK-PTR (Lighting cockpit panel switch) - [299] = "%1d", -- DEVICES-PTR (Lighting night vision cockpit switch) - [298] = "%1d", -- AGR-PKP-PTR (Lighting ADI and SAI switch) - -- Fire Extinguishers Control Panel - [236] = "%.1f", -- PUI800-AVARCHOP-PTR01 (Left engine extinguisher) - [238] = "%.1f", -- PUI800-AVARCHOP-PTR02 (APU extinguisher) - [240] = "%.1f", -- PUI800-AVARCHOP-PTR03 (Right engine extinguisher) - [242] = "%.1f", -- PUI800-AVARCHOP-PTR04 (Ventilator extinguisher) - [248] = "%0.1f", -- FIREEXT-PTR (Fire extinguisher Work Off Test switch) - [249] = "%0.1f", -- FIREEXT-COVER-PTR (Fire extinguisher Work Off Test switch Cover) - [250] = "%1d", -- FIREEXT-INDICATION-PTR (Fire signaling) - [246] = "%1d", -- BALOONS-PTR (Fire extinguisher First (Auto) / Second (Manual) selector) - [247] = "%1d", -- BALOONS-COVER-PTR (Fire extinguisher First (Auto) / Second (Manual) selector Cover) - -- Misc. systems - [258] = "%0.1f", -- REDUCTOR-PTR (Reducing gear box oil pressure indication selector) - [259] = "%1d", -- HANGER-PTR (Sling load Auto/Manual) - -- Auxiliary panel - --------------------------------------------------- - -- Preflight Set and Check Panel - [483] = "%0.1f", -- PPK-BBTZ-PTR (ATGM Temperature selector) - [484] = "%0.1f", -- PPK-NRAKS-PTR (Unguided rocket and gun pods ballistics data settings selector) - [485] = "%1d", -- PPK-RNP-PTR (Systems BIT selector) - [486] = "%1d", -- KCVM-PTR (Control computers BIT switch) - [489] = "%.1f", -- AKS-PTR (Self test system push-button) - [490] = "%1d", -- VnK-PTR (Emergency INU alignment switch) - [491] = "%1d", -- ROPE-PTR (Stabilisation and indication of hanger cable switch) - [492] = "%1d", -- FKP-PTR (Video Tape Recorder switch) - [487] = "%1d", -- IKV-PTR (INU Power switch) - [488] = "%1d", -- HEAT_IKV-PTR (INU Heater switch) - [452] = "%1d", -- P-CONTR-VMG-HYDRO-PTR (Power plant, hydraulics, EKRAN self-test systems switch) - [453] = "%1d", -- P-CONTR-VMG-HYDRO-COVER-PTR (Power plant, hydraulics, EKRAN self-test systems switch Cover) - -- PShK_7 (Latitude Entry Panel) - [340] = "%.3f", -- LATITUDE-PTR (Latitude selection rotaty) - [341] = "%1d", -- N-S-PTR (North/South latitude selection) - -- ZMS_3 (Magnetic Variation Entry Panel) - [338] = "%.3f" -- DCLIN-PTR (Magnetic variation selection rotaty) -} - --- Lookup tables for weapons store type display -gES_Ka50StationTypes = -{ - ["9A4172"] = "NC", - ["S-8KOM"] = "HP", - ["S-13"] = "HP", - ["UPK-23-250"] = "NN", - ["AO-2.5RT"] = "A6", - ["PTAB-2.5KO"] = "A6", - ["FAB-250"] = "A6", - ["FAB-500"] = "A6" -} - --- State data -gKa50Trigger = 0 - ------------------------------------------------------ --- LOW IMPORTANCE EXPORTS -- --- done every gExportLowTickInterval export events -- ------------------------------------------------------ - --- Pointed to by ProcessGlassCockpitDCSLowImportance, if the player aircraft is a Ka-50 -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - -- function for HELIOS and HawgTouch - - local lWeaponSystem = GetDevice(12) - local lEKRAN = GetDevice(10) - local lCannonAmmoCount = "" - local lStationNumbers = lWeaponSystem:get_selected_weapon_stations() - local lStationCount = "" - local lStationType = "" - local lTargetingPower = mainPanelDevice:get_argument_value(433) - local lTrigger = mainPanelDevice:get_argument_value(615) - if lTrigger == 0 then - gKa50Trigger = 1 - end - if lTrigger == -1 then - gKa50Trigger = 0 - end - - if lTargetingPower == 1 then - lCannonAmmoCount = string.format("%02d",string.match(lWeaponSystem:get_selected_gun_ammo_count() / 10,"(%d+)")) - - if #lStationNumbers ~= 0 and gKa50Trigger == 0 then - lStationCount = 0 - for i=1,#lStationNumbers do - lStationCount = lStationCount + lWeaponSystem:get_weapon_count_on_station(lStationNumbers[i]) - end - - lStationCount = string.format("%02d", lStationCount); - - lStationType = gES_Ka50StationTypes[lWeaponSystem:get_weapon_type_on_station(lStationNumbers[1])] - if lStationType == nil then - lStationType = "" - end - end - end - - local lEkranSendString = "" - local lEkranText = lEKRAN:get_actual_text_frame() - if lEkranText ~= "" then - lEkranSendString = string.sub(lEkranText,1,8).."\n"..string.sub(lEkranText,12,19).."\n"..string.sub(lEkranText,23,30).."\n"..string.sub(lEkranText,34,41) - end - - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - SendData("2001",lStationType) - SendData("2002",lStationCount) - SendData("2003",lCannonAmmoCount) - SendData("2004",lEkranSendString) - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - --SendData("2016",lEkranSendString) - local lFAILlight = "" -- FAILURE - local lMEMORYlight = "" -- MEMORY - local lTURNlight = "" -- TURN - if lEkranSendString ~= "" then - lFAILlight = "FAILURE" - end - -- DisplayWindow (main message) - -- FAILlight (failure text) - -- MEMORYlight (memmory text) - -- TURNlight (turn text) - SendData("2016", string.format("%s;%s;%s;%s", - lEkranSendString, - lFAILlight, - lMEMORYlight, - lTURNlight)) - --[[ - -- PUI-800 Weapon panel - --------------------------------------------------- - [392] = "%0.1f", -- lamp_PUI800_Sta1_WeapIsPresent{0.0, 1.0} - [393] = "%0.1f", -- lamp_PUI800_Sta2_WeapIsPresent{0.0, 1.0} - [394] = "%0.1f", -- lamp_PUI800_Sta3_WeapIsPresent{0.0, 1.0} - [395] = "%0.1f", -- lamp_PUI800_Sta4_WeapIsPresent{0.0, 1.0} - [388] = "%0.1f", -- lamp_PUI800_Sta1_WeapIsReady{0.0, 1.0} - [389] = "%0.1f", -- lamp_PUI800_Sta2_WeapIsReady{0.0, 1.0} - [390] = "%0.1f", -- lamp_PUI800_Sta3_WeapIsReady{0.0, 1.0} - [391] = "%0.1f", -- lamp_PUI800_Sta4_WeapIsReady{0.0, 1.0} - ]] - SendData("2014", string.format("%.1f;%.1f;%.1f;%.1f;%.1f;%.1f;%.1f;%.1f;%s;%s;%s", - mainPanelDevice:get_argument_value(392), - mainPanelDevice:get_argument_value(393), - mainPanelDevice:get_argument_value(394), - mainPanelDevice:get_argument_value(395), - mainPanelDevice:get_argument_value(388), - mainPanelDevice:get_argument_value(389), - mainPanelDevice:get_argument_value(390), - mainPanelDevice:get_argument_value(391), - lStationType, - lStationCount, - lCannonAmmoCount)) - -- LGCP - Landing gear control panel - --------------------------------------------------- - --[[ - [63] = "%0.1f", -- LGCP_Lamp_NoseGearUp {0.0,1.0} - [64] = "%0.1f", -- LGCP_Lamp_NoseGearDown {0.0,1.0} - [61] = "%0.1f", -- LGCP_Lamp_RightMainGearUp {0.0,1.0} - [62] = "%0.1f", -- LGCP_Lamp_RightMainGearDown {0.0,1.0} - [59] = "%0.1f", -- LGCP_Lamp_LeftMainGearUp {0.0,1.0} - [60] = "%0.1f", -- LGCP_Lamp_LeftMainGearDown{0.0, 1.0} - ]] - SendData("2013", string.format("%.1f;%.1f;%.1f;%.1f;%.1f;%.1f", - mainPanelDevice:get_argument_value(63), - mainPanelDevice:get_argument_value(64), - mainPanelDevice:get_argument_value(61), - mainPanelDevice:get_argument_value(62), - mainPanelDevice:get_argument_value(59), - mainPanelDevice:get_argument_value(60))) - - -- Master Warning and Rotor RPM Lamp - SendData("44", mainPanelDevice:get_argument_value(44) > 0.0 and 1 or 0) -- lamp_MasterWarning {0.0,0.3} - SendData("46", mainPanelDevice:get_argument_value(46) > 0.0 and 1 or 0) -- lamp_RotorRPM {0.0,1.0} - end -end - --- Pointed to by ProcessHARDWARELowImportance, if the player aircraft is a Ka-50 -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) - -- Radio comunication - -- ARK_22 (ADF) Frequncy - local lARK_22 = GetDevice(46) - SendDataHW("2000", string.format("%1d", lARK_22:get_channel())) - - -- R_800 - local lR_800 = GetDevice(48) - SendDataHW("2001", string.format("%7.3f", lR_800:get_frequency()/1000000)) - - -- R_828 Channel - local lR_828 = {[0.0]="1",[0.1]="2",[0.2]="3",[0.3]="4",[0.4]="5",[0.5]="6",[0.6]="7",[0.7]="8",[0.8]="9",[0.9]="10"} - SendDataHW("2002", lR_828[math.round(mainPanelDevice:get_argument_value(371), 1)]) - - -- R_828 Frequency - local lR_828_F = GetDevice(49) - if lR_828_F:is_on() then - SendDataHW("2003", string.format("%7.3f", lR_828_F:get_frequency()/1000000)) - else - SendDataHW("2003", "-") - end - - -- Weapos - local lWeaponSystem = GetDevice(12) - local lCannonAmmoCount = " " - local lStationNumbers = lWeaponSystem:get_selected_weapon_stations() - local lStationCount = " " - local lStationType = " " - local lTargetingPower = mainPanelDevice:get_argument_value(433) - local lTrigger = mainPanelDevice:get_argument_value(615) - if lTrigger == 0 then - gKa50Trigger = 1 - end - if lTrigger == -1 then - gKa50Trigger = 0 - end - - if lTargetingPower == 1 then - lCannonAmmoCount = string.format("%02d",string.match(lWeaponSystem:get_selected_gun_ammo_count() / 10,"(%d+)")) - - if #lStationNumbers ~= 0 and gKa50Trigger == 0 then - lStationCount = 0 - for i=1,#lStationNumbers do - lStationCount = lStationCount + lWeaponSystem:get_weapon_count_on_station(lStationNumbers[i]) - end - - lStationCount = string.format("%02d", lStationCount); - - lStationType = gES_Ka50StationTypes[lWeaponSystem:get_weapon_type_on_station(lStationNumbers[1])] - if lStationType == nil then - lStationType = " " - end - end - end - - --SendDataHW("2004",lStationType) - SendDataHW("2005",lStationCount) - SendDataHW("2006",lCannonAmmoCount) - - local lUV26 = list_indication(7) - lUV26 = lUV26:gsub("-----------------------------------------", "") - lUV26 = lUV26:gsub("txt_digits", "") - lUV26 = lUV26:gsub("%c", "") - - SendDataHW("2007", string.format("%s", lUV26)) - - - local lPVI800 = list_indication(5) - --[[ - txt_VIT Inhalt obere Zeile - txt_NIT Inhalt untere Zeile - txt_OIT_PPM Punkt obere Zeile - txt_OIT_NOT Punkt untere Zeile - txt_VIT_apostrophe1 1. Apostroph obere Zeile 3. Ziffer - txt_VIT_apostrophe2 2. Apostroph obere Zeile 5. Ziffer - txt_NIT_apostrophe1 1. Apostroph untere Zeile 3. Ziffer - txt_NIT_apostrophe2 2. Apostroph untere Zeile 5. Ziffer - ]] - local ltxt_upper_row, ltxt_lower_row = "" - local lpos1, pos2, lpos3, pos4, ltxt_VIT, ltxt_NIT, ltxt_OIT_PPM, ltxt_OIT_NOT - local ltxt_VIT_apostrophe1, ltxt_VIT_apostrophe2, ltxt_NIT_apostrophe1, ltxt_NIT_apostrophe2 = false - lpos1, pos2 = lPVI800:find("txt_VIT%c", 1) - if pos2 ~= nil then - lpos3, pos4 = lPVI800:find("-----------------------------------------", pos2) - if lpos3 ~= nil then - ltxt_VIT = lPVI800:sub(pos2 + 1, lpos3 - 2) - else - ltxt_VIT = lPVI800:sub(pos2 + 1) - end - end - lpos1, pos2 = lPVI800:find("txt_NIT%c", 1) - if pos2 ~= nil then - lpos3, pos4 = lPVI800:find("-----------------------------------------", pos2) - if lpos3 ~= nil then - ltxt_NIT = lPVI800:sub(pos2 + 1, lpos3 - 2) - else - ltxt_NIT = lPVI800:sub(pos2 + 1) - end - end - lpos1, pos2 = lPVI800:find("txt_OIT_PPM%c", 1) - if pos2 ~= nil then - lpos3, pos4 = lPVI800:find("-----------------------------------------", pos2) - if lpos3 ~= nil then - ltxt_OIT_PPM = lPVI800:sub(pos2 + 1, lpos3 - 2) - else - ltxt_OIT_PPM = lPVI800:sub(pos2 + 1) - end - end - lpos1, pos2 = lPVI800:find("txt_OIT_NOT%c", 1) - if pos2 ~= nil then - lpos3, pos4 = lPVI800:find("-----------------------------------------", pos2) - if lpos3 ~= nil then - ltxt_OIT_NOT = lPVI800:sub(pos2 + 1, lpos3 - 2) - else - ltxt_OIT_NOT = lPVI800:sub(pos2 + 1) - end - end - lpos1, pos2 = lPVI800:find("txt_VIT_apostrophe1", 1) - if pos2 ~= nil then - ltxt_VIT_apostrophe1 = true - end - lpos1, pos2 = lPVI800:find("txt_VIT_apostrophe2", 1) - if pos2 ~= nil then - ltxt_VIT_apostrophe2 = true - end - lpos1, pos2 = lPVI800:find("txt_NIT_apostrophe1", 1) - if pos2 ~= nil then - ltxt_NIT_apostrophe1 = true - end - lpos1, pos2 = lPVI800:find("txt_NIT_apostrophe2", 1) - if pos2 ~= nil then - ltxt_NIT_apostrophe2 = true - end - - if ltxt_VIT ~= nil then - ltxt_VIT = ltxt_VIT:gsub("%c", "") - ltxt_upper_row = ltxt_VIT:sub(1, 3) - if ltxt_VIT_apostrophe1 then - ltxt_upper_row = ltxt_upper_row.."." - end - ltxt_upper_row = ltxt_upper_row..ltxt_VIT:sub(4, 5) - if ltxt_VIT_apostrophe2 then - ltxt_upper_row = ltxt_upper_row.."." - end - ltxt_upper_row = ltxt_upper_row..ltxt_VIT:sub(6) - end - - if ltxt_NIT ~= nil then - ltxt_NIT = ltxt_NIT:gsub("%c", "") - ltxt_lower_row = ltxt_NIT:sub(1, 3) - if ltxt_NIT_apostrophe1 then - ltxt_lower_row = ltxt_lower_row.."." - end - ltxt_lower_row = ltxt_lower_row..ltxt_NIT:sub(4, 5) - if ltxt_NIT_apostrophe2 then - ltxt_lower_row = ltxt_lower_row.."." - end - ltxt_lower_row = ltxt_lower_row..ltxt_NIT:sub(6) - end - - if ltxt_VIT ~= nil then - ltxt_upper_row = ltxt_upper_row..string.rep(" ", 7 - ltxt_VIT:len()) - else - ltxt_upper_row = string.rep(" ", 7) - end - - if ltxt_OIT_PPM ~= nil then - ltxt_OIT_PPM = ltxt_OIT_PPM:gsub("%c", "") - ltxt_upper_row = ltxt_upper_row..ltxt_OIT_PPM - else - ltxt_upper_row = ltxt_upper_row.." " - end - - if ltxt_NIT ~= nil then - ltxt_lower_row = ltxt_lower_row..string.rep(" ", 7 - ltxt_NIT:len()) - else - ltxt_lower_row = string.rep(" ", 7) - end - - if ltxt_OIT_NOT ~= nil then - ltxt_OIT_NOT = ltxt_OIT_NOT:gsub("%c", "") - ltxt_lower_row = ltxt_lower_row..ltxt_OIT_NOT - else - ltxt_lower_row = ltxt_lower_row.." " - end - - SendDataHW("2008", string.format("%s", ltxt_upper_row)) - SendDataHW("2009", string.format("%s", ltxt_lower_row)) - - --[[ - --WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - - local ltmp1 = 0 - for ltmp2 = 1, 14, 1 do - ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] -end - ------------------------------ --- HIGH IMPORTANCE EXPORTS -- --- done every export event -- ------------------------------ - --- Pointed to by ProcessGlassCockpitDCSHighImportance, if the player aircraft is a Ka-50 -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - - - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - - -- ADI (IKP-81) - --------------------------------------------------- - --[[ - [100] = "%.4f", -- ADI_Roll {-1.0,1.0} - [101] = "%.4f", -- ADI_Pitch {-math.pi/2.0,math.pi/2.0}{1.0,-1.0} - [102] = "%0.1f", -- ADI_steering_warning_flag {0.0,1.0} - [109] = "%0.1f", -- ADI_attitude_warning_flag {0.0,1.0} - [107] = "%.4f", -- ADI_bank_steering {-1.0,1.0} - [106] = "%.4f", -- ADI_pitch_steering {-1.0,1.0} - [111] = "%.4f", -- ADI_airspeed_deviation {-1.0,1.0} - [103] = "%.4f", -- ADI_track_deviation {-1.0,1.0} - [526] = "%.4f", -- ADI_height_deviation {-1.0,1.0} - [108] = "%.4f", -- ADI_sideslip {-1.0,1.0} - ]] - SendData("2000", string.format("%.4f;%.4f;%.1f;%.1f;%.4f;%.4f;%.4f;%.4f;%.4f;%.4f", - mainPanelDevice:get_argument_value(100), - mainPanelDevice:get_argument_value(101), - mainPanelDevice:get_argument_value(102), - mainPanelDevice:get_argument_value(109), - mainPanelDevice:get_argument_value(107), - mainPanelDevice:get_argument_value(106), - mainPanelDevice:get_argument_value(111), - mainPanelDevice:get_argument_value(103), - mainPanelDevice:get_argument_value(526), - mainPanelDevice:get_argument_value(108))) - -- VVI - --------------------------------------------------- - --[24] = "%.4f", -- vy (Vertical Velocity Indicator) {-1.0,1.0} - -- Barometric Altimeter (VM_15PV) - -------------------------------------------------- - --[[ - [87] = "%.4f", -- VM_15PV_BALT_thousands {0.0,1.0} - [573] = "%.4f", -- VM_15PV_BALT_tenth {0.0,1.0} - [88] = "%0.2f", -- VM_15PV_BaroPressure {0.0,1.0} - [89] = "%.4f", -- VM_15PV_BALT_CommandedAlt {0.0,1.0} - ]] - SendData("2001", string.format("%.4f;%.4f;%.2f;%.4f", - mainPanelDevice:get_argument_value(87), - mainPanelDevice:get_argument_value(573), - mainPanelDevice:get_argument_value(88), - mainPanelDevice:get_argument_value(89))) - --WriteToLog('VM_15PV_BALT_thousands '..dump(mainPanelDevice:get_argument_value(87))..', VM_15PV_BALT_tenth '..dump(mainPanelDevice:get_argument_value(573))..', VM_15PV_BaroPressure '..dump(mainPanelDevice:get_argument_value(88))..', VM_15PV_BALT_CommandedAlt '..dump(mainPanelDevice:get_argument_value(89))) - -- HSI (PNP-72-16) - --------------------------------------------------- - --[[ - [112] = "%.4f", -- HSI_heading {0.0, 1.0} - [118] = "%.4f", -- HSI_commanded_course_needle {0.0, 1.0} - [124] = "%.4f", -- HSI_commanded_heading_needle {0.0, 1.0} - [115] = "%.4f", -- HSI_bearing_needle {0.0, 1.0} - [119] = "%0.1f", -- HSI_heading_warning_flag{0.0,1.0} - [114] = "%0.1f", -- HSI_course_warning_flag{0.0, 1.0} - [125] = "%0.1f", -- HSI_glideslope_warning_flag{0.0, 1.0} - [117] = "%0.4f", -- HSI_range_counter_100 {0.0,1.0} - [527] = "%0.4f", -- HSI_range_counter_10 {0.0,1.0} - [528] = "%0.4f", -- HSI_range_counter_1 {0.0,1.0} - [127] = "%.4f", -- HSI_longitudinal_deviation{-1.0, 1.0} - [128] = "%.4f", -- HSI_lateral_deviation{-1.0, 1.0} - [116] = "%0.1f", -- HSI_range_unavailable_flag{0.0, 1.0} - [121] = "%0.1f", -- HSI_course_unavailable_flag{0.0, 1.0} - ]] - SendData("2002", string.format("%.4f;%.4f;%.4f;%.4f;%.1f;%.1f;%.1f;%.4f;%.4f;%.4f;%.4f;%.4f;%.1f;%.1f", - mainPanelDevice:get_argument_value(112), - mainPanelDevice:get_argument_value(118), - mainPanelDevice:get_argument_value(124), - mainPanelDevice:get_argument_value(115), - mainPanelDevice:get_argument_value(119), - mainPanelDevice:get_argument_value(114), - mainPanelDevice:get_argument_value(125), - mainPanelDevice:get_argument_value(117), - mainPanelDevice:get_argument_value(527), - mainPanelDevice:get_argument_value(528), - mainPanelDevice:get_argument_value(127), - mainPanelDevice:get_argument_value(128), - mainPanelDevice:get_argument_value(116), - mainPanelDevice:get_argument_value(121))) - --WriteToLog('HSI_heading '..dump(mainPanelDevice:get_argument_value(118))) - -- Rotor Pitch - --------------------------------------------------- - --[53] = "%.4f", -- RotorPitch {0.0,1.0} - -- Rotor RPM - --------------------------------------------------- - --[52] = "%.4f", -- RotorRPM {0.0,1.0} - -- Radar Altimeter ( A_036) - --------------------------------------------------- - --[[ - [94] = "%.4f", -- A_036_RALT {0.0,1.0} - [93] = "%.4f", -- A_036_DangerRALT {0.0,1.0} - [95] = "%0.1f", -- A_036_warning_flag {0.0,1.0} - [92] = "%0.1f", -- A_036_DangerRALT_lamp {0.0,1.0} - ]] - SendData("2003", string.format("%.4f;%.4f;%.1f;%.1f", - mainPanelDevice:get_argument_value(94), - mainPanelDevice:get_argument_value(93), - mainPanelDevice:get_argument_value(95), - mainPanelDevice:get_argument_value(92))) - -- Indicated Airspeed - --------------------------------------------------- - ---[51] = "%.4f", -- IAS {0.0,1.0} - --SendData("51", string.format("%.4f", mainPanelDevice:get_argument_value(51))) - --WriteToLog('IAS '..dump(mainPanelDevice:get_argument_value(51))) - -- Accelerometer (ADP_4) - --------------------------------------------------- - --[[ - [97] = "%0.2f", -- ADP_4_acceleration {0.0,1.0} - [98] = "%0.2f", -- ADP_4_max_achieved_acc {0.0,1.0} - [99] = "%0.2f", -- ADP_4_min_achieved_acc {0.0,1.0} - ]] - SendData("2004", string.format("%.2f;%.2f;%.2f", - mainPanelDevice:get_argument_value(97), - mainPanelDevice:get_argument_value(98), - mainPanelDevice:get_argument_value(99))) - -- Mechanic Clock - --------------------------------------------------- - --[[ - [68] = "%.4f", -- CLOCK_currtime_hours {0.0,1.0} - [69] = "%.4f", -- CLOCK_currtime_minutes {0.0,1.0} - [70] = "%.4f", -- CLOCK_currtime_seconds {0.0,1.0} - [75] = "%0.1f", -- CLOCK_flight_time_meter_status{0.0,0.2} - [72] = "%.4f", -- CLOCK_flight_hours {0.0,1.0} - [531] = "%.4f", -- CLOCK_flight_minutes {0.0,1.0} - [73] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0,1.0} - [532] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0,1.0} - ]] - SendData("2005", string.format("%.4f;%.4f;%.4f;%.1f;%.4f;%.4f;%.4f;%.4f", - mainPanelDevice:get_argument_value(68), - mainPanelDevice:get_argument_value(69), - mainPanelDevice:get_argument_value(70), - mainPanelDevice:get_argument_value(75), - mainPanelDevice:get_argument_value(72), - mainPanelDevice:get_argument_value(531), - mainPanelDevice:get_argument_value(73), - mainPanelDevice:get_argument_value(532))) - -- backup ADI (AGR-81) - --------------------------------------------------- - --[[ - [142] = "%.4f", -- AGR_81_Roll {1.0, -1.0} - [143] = "%.4f", -- AGR_81_Pitch {-1.0, 1.0} - [144] = "%.4f", -- AGR_81_sideslip {-1.0, 1.0} - [145] = "%0.1f", -- AGR_81_failure_flag{0.0, 1.0} - ]] - SendData("2006", string.format("%.4f;%.4f;%.4f;%.1f", - mainPanelDevice:get_argument_value(142), - mainPanelDevice:get_argument_value(143), - mainPanelDevice:get_argument_value(144), - mainPanelDevice:get_argument_value(145))) - -- Engines temperature - --------------------------------------------------- - --[[ - [133] = "%.4f", -- LeftEngineTemperatureHund {0.0,1.0} - [566] = "%.4f", -- LeftEngineTemperatureTenth {0.0,1.0} - [134] = "%.4f", -- RightEngineTemperatureHund {0.0,1.0} - [567] = "%.4f", -- RightEngineTemperatureHund {0.0,1.0} - ]] - SendData("2007", string.format("%.4f;%.4f;%.4f;%.4f", - mainPanelDevice:get_argument_value(133), - mainPanelDevice:get_argument_value(566), - mainPanelDevice:get_argument_value(134), - mainPanelDevice:get_argument_value(567))) - -- Engine RPM - --------------------------------------------------- - --[[ - [135] = "%.4f", -- LeftEngineRPM {0.0,1.0} - [136] = "%.4f", -- RightEngineRPM {0.0,1.0} - ]] - SendData("2008", string.format("%.4f;%.4f", - mainPanelDevice:get_argument_value(135), - mainPanelDevice:get_argument_value(136))) - -- Fuel tanks - --------------------------------------------------- - --[[ - [137] = "%.4f", -- ForwardTankAmount {0.0,1.0} - [138] = "%.4f", -- RearTankAmount {0.0,1.0} - [139] = "%0.1f", -- lamp_ForwardTankTest {0.0,1.0} - [140] = "%0.1f", -- lamp_RearTankTest {0.0,1.0} - ]] - SendData("2009", string.format("%.4f;%.4f;%.1f;%.1f", - mainPanelDevice:get_argument_value(137), - mainPanelDevice:get_argument_value(138), - mainPanelDevice:get_argument_value(139), - mainPanelDevice:get_argument_value(140))) - -- Magnetic Compass (KI-13) - --------------------------------------------------- - --[[ - [11] = "%.4f", -- KI_13_course {-1,1} - [12] = "%.4f", -- KI_13_pitch {-1,1} - [14] = "%.4f", -- KI_13_bank {-1,1} - ]] - SendData("2010", string.format("%.4f;%.4f;%.4f", - mainPanelDevice:get_argument_value(11), - mainPanelDevice:get_argument_value(12), - mainPanelDevice:get_argument_value(14))) - -- Oil pressure and temperature indicators group (Right Panel) - --------------------------------------------------- - --[[ - [252] = "%.4f", -- NeedleOilPressureEngineLeft {0.0,1.0} - [253] = "%.4f", -- NeedleOilPressureEngineRight {0.0, 1.0} - [254] = "%.4f", -- NeedleOilPressureGearBox {0.0,1.0} - [255] = "%.4f", -- NeedleOilTemperatureEngineLeft {0.0,1.0} - [256] = "%.4f", -- NeedleOilTemperatureEngineRight {0.0,1.0} - [257] = "%.4f", -- NeedleOilTemperatureGearBox {0.0,1.0} - ]] - --SendData("2011", string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.4f", - -- mainPanelDevice:get_argument_value(252), - -- mainPanelDevice:get_argument_value(253), - -- mainPanelDevice:get_argument_value(254), - -- mainPanelDevice:get_argument_value(255), - -- mainPanelDevice:get_argument_value(256), - -- mainPanelDevice:get_argument_value(257))) - -- Hydraulics Gauges (Back Panel) - --------------------------------------------------- - --[[ - [471] = "%.4f", -- hydro_common_pressure {0.0,1.0} - [472] = "%.4f", -- hydro_main_pressure {0.0,1.0} - [473] = "%.4f", -- hydro_acc_brake_pressure {0.0,1.0} - [474] = "%.4f", -- hydro_gear_brake_pressure {0.0,1.0} - [475] = "%.4f", -- hydro_common_temperature {0.0,1.0} - [476] = "%.4f", -- hydro_main_temperature {0.0,1.0} - ]] - --SendData("2012", string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.4f", - -- mainPanelDevice:get_argument_value(471), - -- mainPanelDevice:get_argument_value(472), - -- mainPanelDevice:get_argument_value(473), - -- mainPanelDevice:get_argument_value(474), - -- mainPanelDevice:get_argument_value(475), - -- mainPanelDevice:get_argument_value(476))) - --WriteToLog('hydro_common_temperature '..dump(mainPanelDevice:get_argument_value(475))..', hydro_main_temperature '..dump(mainPanelDevice:get_argument_value(476))) - -- APU Temperature - --------------------------------------------------- - --[6] = "%.4f", -- APUTemperature {0.0, 900.0} = {0.0, 1.0} - -- ambientTemperature - --------------------------------------------------- - --[587] = "%0.3f" -- ambientTemperature {-60, 50} = {-0.946, 0.788} - -- Engines mode indicator - --------------------------------------------------- - --[[ - [592] = "%.4f", -- EnginesMode {0.0,1.0} - [234] = "%0.2f", -- LeftEngineMode{0.0,1.0} - [235] = "%0.2f", -- RightEngineMode {0.0,1.0} - ]] - SendData("2015", string.format("%.4f;%.4f;%.4f", - mainPanelDevice:get_argument_value(592), - mainPanelDevice:get_argument_value(234), - mainPanelDevice:get_argument_value(235))) - --WriteToLog('EnginesMode '..dump(mainPanelDevice:get_argument_value(592))..', LeftEngineMode '..dump(mainPanelDevice:get_argument_value(234))..', RightEngineMode '..dump(mainPanelDevice:get_argument_value(235))) - end -end - --- Pointed to by ProcessHARDWAREHighImportance, if the player aircraft is a Ka-50 -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) - --[[ - every frame export to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config - ]] - - --SendDataHW("2006",UV26Display()) - - -- LAMPS - --------------------------------------------------- - SendDataHW("44", mainPanelDevice:get_argument_value(44) > 0.0 and 1 or 0) -- lamp_MasterWarning {0.0,0.3} - SendDataHW("46", mainPanelDevice:get_argument_value(46) > 0.0 and 1 or 0) -- lamp_RotorRPM {0.0,1.0} - SendDataHW("47", string.format("%0.1f", mainPanelDevice:get_argument_value(47))) -- lamp_UNDERFIREwarning {0.0,1.0} - SendDataHW("48", string.format("%0.1f", mainPanelDevice:get_argument_value(48))) -- lamp_LowerGear {0.0,1.0} - SendDataHW("78", string.format("%0.1f", mainPanelDevice:get_argument_value(78))) -- lamp_RPM_leftEngineMax {0.0,1.0} - SendDataHW("79", string.format("%0.1f", mainPanelDevice:get_argument_value(79))) -- lamp_RPM_rightEngineMax {0.0,1.0} - SendDataHW("80", string.format("%0.1f", mainPanelDevice:get_argument_value(80))) -- lamp_NyMax {0.0,1.0} - SendDataHW("81", string.format("%0.1f", mainPanelDevice:get_argument_value(81))) -- lamp_vibr_leftEngine {0.0,1.0} - SendDataHW("82", string.format("%0.1f", mainPanelDevice:get_argument_value(82))) -- lamp_vibr_rightEngine {0.0,1.0} - SendDataHW("83", string.format("%0.1f", mainPanelDevice:get_argument_value(83))) -- lamp_IAS_max {0.0,1.0} - SendDataHW("84", string.format("%0.1f", mainPanelDevice:get_argument_value(84))) -- lamp_mainTransmission {0.0,1.0} - SendDataHW("85", string.format("%0.1f", mainPanelDevice:get_argument_value(85))) -- lamp_Fire {0.0,1.0} - SendDataHW("86", string.format("%0.1f", mainPanelDevice:get_argument_value(86))) -- lamp_IFFfailure {0.0,1.0} - -- Fuel tanks - --------------------------------------------------- - SendDataHW("139", string.format("%0.1f", mainPanelDevice:get_argument_value(139))) -- lamp_ForwardTankTest {0.0,1.0} - SendDataHW("140", string.format("%0.1f", mainPanelDevice:get_argument_value(140))) -- lamp_RearTankTest {0.0,1.0} - -- PUI-800 Weapon panel - --------------------------------------------------- - SendDataHW("392", string.format("%0.1f", mainPanelDevice:get_argument_value(392))) -- lamp_PUI800_Sta1_WeapIsPresent{0.0, 1.0} - SendDataHW("393", string.format("%0.1f", mainPanelDevice:get_argument_value(393))) -- lamp_PUI800_Sta2_WeapIsPresent{0.0, 1.0} - SendDataHW("394", string.format("%0.1f", mainPanelDevice:get_argument_value(394))) -- lamp_PUI800_Sta3_WeapIsPresent{0.0, 1.0} - SendDataHW("395", string.format("%0.1f", mainPanelDevice:get_argument_value(395))) -- lamp_PUI800_Sta4_WeapIsPresent{0.0, 1.0} - SendDataHW("388", string.format("%0.1f", mainPanelDevice:get_argument_value(388))) -- lamp_PUI800_Sta1_WeapIsReady{0.0, 1.0} - SendDataHW("389", string.format("%0.1f", mainPanelDevice:get_argument_value(389))) -- lamp_PUI800_Sta2_WeapIsReady{0.0, 1.0} - SendDataHW("390", string.format("%0.1f", mainPanelDevice:get_argument_value(390))) -- lamp_PUI800_Sta3_WeapIsReady{0.0, 1.0} - SendDataHW("391", string.format("%0.1f", mainPanelDevice:get_argument_value(391))) -- lamp_PUI800_Sta4_WeapIsReady{0.0, 1.0} - -- LGCP - Landing gear control panel - --------------------------------------------------- - SendDataHW("63", string.format("%0.1f", mainPanelDevice:get_argument_value(63))) -- LGCP_Lamp_NoseGearUp {0.0,1.0} - SendDataHW("64", string.format("%0.1f", mainPanelDevice:get_argument_value(64))) -- LGCP_Lamp_NoseGearDown {0.0,1.0} - SendDataHW("61", string.format("%0.1f", mainPanelDevice:get_argument_value(61))) -- LGCP_Lamp_RightMainGearUp {0.0,1.0} - SendDataHW("62", string.format("%0.1f", mainPanelDevice:get_argument_value(62))) -- LGCP_Lamp_RightMainGearDown {0.0,1.0} - SendDataHW("59", string.format("%0.1f", mainPanelDevice:get_argument_value(59))) -- LGCP_Lamp_LeftMainGearUp {0.0,1.0} - SendDataHW("60", string.format("%0.1f", mainPanelDevice:get_argument_value(60))) -- LGCP_Lamp_LeftMainGearDown{0.0, 1.0} - -- LAMPS - --------------------------------------------------- - SendDataHW("170", string.format("%0.1f", mainPanelDevice:get_argument_value(170))) -- lamp_H_RALT_stab {0.0,1.0} - SendDataHW("175", string.format("%0.1f", mainPanelDevice:get_argument_value(175))) -- lamp_Hover {0.0,1.0} - SendDataHW("172", string.format("%0.1f", mainPanelDevice:get_argument_value(172))) -- lamp_Descent {0.0,1.0} - SendDataHW("165", string.format("%0.1f", mainPanelDevice:get_argument_value(165))) -- lamp_RouteHeadingSteering {0.0,1.0} - SendDataHW("171", string.format("%0.1f", mainPanelDevice:get_argument_value(171))) -- lamp_RouteCourseSteering {0.0,1.0} - SendDataHW("176", string.format("%0.1f", mainPanelDevice:get_argument_value(176))) -- lamp_Waypoint {0.0,1.0} - SendDataHW("166", string.format("%0.1f", mainPanelDevice:get_argument_value(166))) -- lamp_EndOfRoute {0.0,1.0} - SendDataHW("164", string.format("%0.1f", mainPanelDevice:get_argument_value(164))) -- lamp_RoughNAVcalc {0.0,1.0} - SendDataHW("178", string.format("%0.1f", mainPanelDevice:get_argument_value(178))) -- lamp_Burst {0.0,1.0} - SendDataHW("173", string.format("%0.1f", mainPanelDevice:get_argument_value(173))) -- lamp_CannonMovingBarr {0.0,1.0} - SendDataHW("177", string.format("%0.1f", mainPanelDevice:get_argument_value(177))) -- lamp_CannonMovingBarr2 {0.0,1.0} - SendDataHW("211", string.format("%0.1f", mainPanelDevice:get_argument_value(211))) -- lamp_FuelCrossfeedOn {0.0,1.0} - SendDataHW("187", string.format("%0.1f", mainPanelDevice:get_argument_value(187))) -- lamp_CouplerOff {0.0,1.0} - SendDataHW("204", string.format("%0.1f", mainPanelDevice:get_argument_value(204))) -- lamp_ActuatorsOilPress {0.0,1.0} - SendDataHW("213", string.format("%0.1f", mainPanelDevice:get_argument_value(213))) -- lamp_LockOff {0.0,1.0} - -- LAMPS - --------------------------------------------------- - SendDataHW("167", string.format("%0.1f", mainPanelDevice:get_argument_value(167))) -- lamp_WeapSysBUS_ON {0.0,1.0} - SendDataHW("180", string.format("%0.1f", mainPanelDevice:get_argument_value(180))) -- lamp_TrainingMode {0.0,1.0} - SendDataHW("179", string.format("%0.1f", mainPanelDevice:get_argument_value(179))) -- lamp_OBZOR_800 {0.0,1.0} - SendDataHW("188", string.format("%0.1f", mainPanelDevice:get_argument_value(188))) -- lamp_RANET {0.0,1.0} - SendDataHW("189", string.format("%0.1f", mainPanelDevice:get_argument_value(189))) -- lamp_CC_test {0.0,1.0} - SendDataHW("206", string.format("%0.1f", mainPanelDevice:get_argument_value(206))) -- lamp_CC_failure {0.0,1.0} - SendDataHW("212", string.format("%0.1f", mainPanelDevice:get_argument_value(212))) -- lamp_DC_AC_Inverter {0.0,1.0} - SendDataHW("205", string.format("%0.1f", mainPanelDevice:get_argument_value(205))) -- lamp_I_251V {0.0,1.0} - SendDataHW("181", string.format("%0.1f", mainPanelDevice:get_argument_value(181))) -- lamp_AntiIceLeftEngine {0.0,1.0} - SendDataHW("190", string.format("%0.1f", mainPanelDevice:get_argument_value(190))) -- lamp_DustProtectLeftEngine {0.0,1.0} - SendDataHW("207", string.format("%0.1f", mainPanelDevice:get_argument_value(207))) -- lamp_BackupModeLeftEngine {0.0,1.0} - SendDataHW("183", string.format("%0.1f", mainPanelDevice:get_argument_value(183))) -- lamp_AntiIceRotors {0.0,1.0} - SendDataHW("182", string.format("%0.1f", mainPanelDevice:get_argument_value(182))) -- lamp_AntiIceRightEngine {0.0,1.0} - SendDataHW("191", string.format("%0.1f", mainPanelDevice:get_argument_value(191))) -- lamp_DustProtectRightEngine {0.0,1.0} - SendDataHW("208", string.format("%0.1f", mainPanelDevice:get_argument_value(208))) -- lamp_BackupModeRightEngine {0.0,1.0} - SendDataHW("184", string.format("%0.1f", mainPanelDevice:get_argument_value(184))) -- lamp_VUO_Heat {0.0,1.0} - SendDataHW("200", string.format("%0.1f", mainPanelDevice:get_argument_value(200))) -- lamp_ForwardTank {0.0,1.0} - SendDataHW("209", string.format("%0.1f", mainPanelDevice:get_argument_value(209))) -- lamp_LeftValveClosed {0.0,1.0} - SendDataHW("185", string.format("%0.1f", mainPanelDevice:get_argument_value(185))) -- lamp_LeftOuterTank {0.0,1.0} - SendDataHW("202", string.format("%0.1f", mainPanelDevice:get_argument_value(202))) -- lamp_LeftInnerTank {0.0,1.0} - SendDataHW("201", string.format("%0.1f", mainPanelDevice:get_argument_value(201))) -- lamp_RearTank {0.0,1.0} - SendDataHW("210", string.format("%0.1f", mainPanelDevice:get_argument_value(210))) -- lamp_RightValveClosed {0.0,1.0} - SendDataHW("186", string.format("%0.1f", mainPanelDevice:get_argument_value(186))) -- lamp_RightOuterTank {0.0,1.0} - SendDataHW("203", string.format("%0.1f", mainPanelDevice:get_argument_value(203))) -- lamp_RightInnerTank {0.0,1.0} - -- DATALINK - --------------------------------------------------- - SendDataHW("159", mainPanelDevice:get_argument_value(159) > 0.0 and 1 or 0) -- PRC_button_SEND {0.0,0.3} - SendDataHW("150", mainPanelDevice:get_argument_value(150) > 0.0 and 1 or 0) -- PRC_button_ESCAPE {0.0,0.3} - SendDataHW("161", mainPanelDevice:get_argument_value(161) > 0.0 and 1 or 0) -- PRC_button_ERASE {0.0,0.3} - SendDataHW("15", mainPanelDevice:get_argument_value(15) > 0.0 and 1 or 0) -- PRC_button_CLEAN {0.0,0.3} - SendDataHW("16", mainPanelDevice:get_argument_value(16) > 0.0 and 1 or 0) -- PRC_button_WINGMAN_ALL {0.0,0.3} - SendDataHW("17", mainPanelDevice:get_argument_value(17) > 0.0 and 1 or 0) -- PRC_button_WINGMAN_1 {0.0,0.3} - SendDataHW("18", mainPanelDevice:get_argument_value(18) > 0.0 and 1 or 0) -- PRC_button_WINGMAN_2 {0.0,0.3} - SendDataHW("19", mainPanelDevice:get_argument_value(19) > 0.0 and 1 or 0) -- PRC_button_WINGMAN_3 {0.0,0.3} - SendDataHW("20", mainPanelDevice:get_argument_value(20) > 0.0 and 1 or 0) -- PRC_button_WINGMAN_4 {0.0,0.3} - SendDataHW("21", mainPanelDevice:get_argument_value(21) > 0.0 and 1 or 0) -- PRC_button_TARGET_1 {0.0,0.3} - SendDataHW("22", mainPanelDevice:get_argument_value(22) > 0.0 and 1 or 0) -- PRC_button_TARGET_2 {0.0,0.3} - SendDataHW("23", mainPanelDevice:get_argument_value(23) > 0.0 and 1 or 0) -- PRC_button_TARGET_3 {0.0,0.3} - SendDataHW("50", mainPanelDevice:get_argument_value(50) > 0.0 and 1 or 0) -- PRC_button_TARGET_POINT {0.0,0.3} - -- Laser warning system - --------------------------------------------------- - SendDataHW("25", string.format("%0.1f", mainPanelDevice:get_argument_value(25))) -- LWS_LampAzimuth_0 {0.0,1.0} - SendDataHW("28", string.format("%0.1f", mainPanelDevice:get_argument_value(28))) -- LWS_LampAzimuth_90 {0.0,1.0} - SendDataHW("26", string.format("%0.1f", mainPanelDevice:get_argument_value(26))) -- LWS_LampAzimuth_180 {0.0,1.0} - SendDataHW("27", string.format("%0.1f", mainPanelDevice:get_argument_value(27))) -- LWS_LampAzimuth_270 {0.0,1.0} - SendDataHW("31", string.format("%0.1f", mainPanelDevice:get_argument_value(31))) -- LWS_LampAzimuth_UpperHemisphere {0.0,1.0} - SendDataHW("32", string.format("%0.1f", mainPanelDevice:get_argument_value(32))) -- LWS_LampAzimuth_LowerHemisphere {0.0,1.0} - SendDataHW("33", string.format("%0.1f", mainPanelDevice:get_argument_value(33))) -- LWS_LampAzimuth_LaserRangefinder {0.0,1.0} - SendDataHW("34", string.format("%0.1f", mainPanelDevice:get_argument_value(34))) -- LWS_LampAzimuth_LaserTargetingSystem {0.0,1.0} - SendDataHW("582", string.format("%0.1f", mainPanelDevice:get_argument_value(582))) -- LWS_LampReady {0.0,1.0} - -- UV-26 - --------------------------------------------------- - SendDataHW("541", string.format("%0.1f", mainPanelDevice:get_argument_value(541))) -- UV26_lampLeftBoard {0.0,1.0} - SendDataHW("542", string.format("%0.1f", mainPanelDevice:get_argument_value(542))) -- UV26_lampRightBoard {0.0,1.0} - -- PVI (Nav Control Panel) - --------------------------------------------------- - SendDataHW("315", mainPanelDevice:get_argument_value(315) > 0.0 and 1 or 0) -- PVI_button_WPT{0.0, 0.3} - SendDataHW("519", mainPanelDevice:get_argument_value(519) > 0.0 and 1 or 0) -- PVI_button_INSREALN{0.0, 0.3} - SendDataHW("316", mainPanelDevice:get_argument_value(316) > 0.0 and 1 or 0) -- PVI_button_FIXPT{0.0, 0.3} - SendDataHW("520", mainPanelDevice:get_argument_value(520) > 0.0 and 1 or 0) -- PVI_button_PRECALN{0.0, 0.3} - SendDataHW("317", mainPanelDevice:get_argument_value(317) > 0.0 and 1 or 0) -- PVI_button_AERDR{0.0, 0.3} - SendDataHW("521", mainPanelDevice:get_argument_value(521) > 0.0 and 1 or 0) -- PVI_button_NORMALN{0.0, 0.3} - SendDataHW("318", mainPanelDevice:get_argument_value(318) > 0.0 and 1 or 0) -- PVI_button_TGT{0.0, 0.3} - SendDataHW("313", mainPanelDevice:get_argument_value(313) > 0.0 and 1 or 0) -- PVI_button_ENTER{0.0, 0.3} - SendDataHW("314", mainPanelDevice:get_argument_value(314) > 0.0 and 1 or 0) -- PVI_button_CANCEL{0.0, 0.3} - SendDataHW("522", mainPanelDevice:get_argument_value(522) > 0.0 and 1 or 0) -- PVI_button_INITCOORD{0.0, 0.3} - SendDataHW("319", mainPanelDevice:get_argument_value(319) > 0.0 and 1 or 0) -- PVI_button_FILAMBDA{0.0, 0.3} - SendDataHW("320", mainPanelDevice:get_argument_value(320) > 0.0 and 1 or 0) -- PVI_button_FIZ{0.0, 0.3} - SendDataHW("321", mainPanelDevice:get_argument_value(321) > 0.0 and 1 or 0) -- PVI_button_DU{0.0, 0.3} - SendDataHW("322", mainPanelDevice:get_argument_value(322) > 0.0 and 1 or 0) -- PVI_button_FII{0.0, 0.3} - SendDataHW("323", mainPanelDevice:get_argument_value(323) > 0.0 and 1 or 0) -- PVI_button_BRGRNG{0.0, 0.3} - SendDataHW("330", mainPanelDevice:get_argument_value(330) > 0.0 and 1 or 0) -- PPR_button_K{0.0, 0.3} - SendDataHW("332", mainPanelDevice:get_argument_value(332) > 0.0 and 1 or 0) -- PPR_button_H{0.0, 0.3} - SendDataHW("331", mainPanelDevice:get_argument_value(331) > 0.0 and 1 or 0) -- PPR_button_T{0.0, 0.3} - SendDataHW("333", mainPanelDevice:get_argument_value(333) > 0.0 and 1 or 0) -- PPR_button_B{0.0, 0.3} - SendDataHW("334", mainPanelDevice:get_argument_value(334) > 0.0 and 1 or 0) -- PPR_button_DIR{0.0, 0.3} - -- RadioCommunicator R-828 - --------------------------------------------------- - SendDataHW("375", string.format("%0.1f", mainPanelDevice:get_argument_value(375))) -- Radio_ASU_lamp{0.0,1.0} - -- RadioCommunicator R-800 - --------------------------------------------------- - SendDataHW("419", string.format("%0.1f", mainPanelDevice:get_argument_value(419))) -- Radio_Test_lamp {0.0,1.0} - -- WEAPON INTERFACE - --------------------------------------------------- - SendDataHW("437", mainPanelDevice:get_argument_value(437) > 0.0 and 1 or 0) -- PRC_button_AUTO_TURN {0.0,0.3} - SendDataHW("438", mainPanelDevice:get_argument_value(438) > 0.0 and 1 or 0) -- PRC_button_AIRBORNE_TARGET {0.0,0.3} - SendDataHW("439", mainPanelDevice:get_argument_value(439) > 0.0 and 1 or 0) -- PRC_button_FORWARD_HEMISPHERE {0.0,0.3} - SendDataHW("440", mainPanelDevice:get_argument_value(440) > 0.0 and 1 or 0) -- PRC_button_GROUND_MOVING_TARGET {0.0,0.3} - SendDataHW("441", mainPanelDevice:get_argument_value(441) > 0.0 and 1 or 0) -- PRC_button_CLEAR {0.0,0.3} - -- Engines start panel - --------------------------------------------------- - SendDataHW("163", string.format("%0.1f", mainPanelDevice:get_argument_value(163))) -- lamp_EnginesStartValve{0.0, 1.0} - -- APU control panel - --------------------------------------------------- - SendDataHW("162", string.format("%0.1f", mainPanelDevice:get_argument_value(162))) -- lamp_APUValveOpen{0.0, 1.0}{0.0, 1.0} - SendDataHW("168", string.format("%0.1f", mainPanelDevice:get_argument_value(168))) -- lamp_APUOilPres{0.0, 1.0}{0.0, 1.0} - SendDataHW("169", string.format("%0.1f", mainPanelDevice:get_argument_value(169))) -- lamp_APUStoppedByRPM{0.0, 1.0} - SendDataHW("174", string.format("%0.1f", mainPanelDevice:get_argument_value(174))) -- lamp_APU_IsON{0.0, 1.0} - -- Right Side Panel - --------------------------------------------------- - SendDataHW("586", string.format("%0.1f", mainPanelDevice:get_argument_value(586))) -- lamp_AC_Ground_Power{0.0, 1.0} - SendDataHW("261", string.format("%0.1f", mainPanelDevice:get_argument_value(261))) -- lamp_DC_Ground_Power{0.0, 1.0} - -- Eject system - --------------------------------------------------- - SendDataHW("461", string.format("%0.1f", mainPanelDevice:get_argument_value(461))) -- EjectSystemTestLamp{0.0, 1.0} - -- Fire Extinguishers panel - --------------------------------------------------- - SendDataHW("237", string.format("%0.1f", mainPanelDevice:get_argument_value(237))) -- lamp_Exting_LeftEngineFire{0.0, 1.0} - SendDataHW("239", string.format("%0.1f", mainPanelDevice:get_argument_value(239))) -- lamp_Exting_APU_Fire{0.0, 1.0} - SendDataHW("568", string.format("%0.1f", mainPanelDevice:get_argument_value(568))) -- lamp_Exting_HydraulicsFire{0.0, 1.0} - SendDataHW("241", string.format("%0.1f", mainPanelDevice:get_argument_value(241))) -- lamp_Exting_RightEngineFire{0.0, 1.0} - SendDataHW("243", string.format("%0.1f", mainPanelDevice:get_argument_value(243))) -- lamp_Exting_VentilatorFire{0.0, 1.0} - SendDataHW("244", string.format("%0.1f", mainPanelDevice:get_argument_value(244))) -- lamp_Exting_Lamp1{0.0, 1.0} - SendDataHW("245", string.format("%0.1f", mainPanelDevice:get_argument_value(245))) -- lamp_Exting_Lamp2{0.0, 1.0} - -- Right Back Panel - --------------------------------------------------- - SendDataHW("469", string.format("%0.1f", mainPanelDevice:get_argument_value(469))) -- lamp_flap_hydro_1{0.0, 1.0} - SendDataHW("470", string.format("%0.1f", mainPanelDevice:get_argument_value(470))) -- lamp_flap_hydro_2{0.0, 1.0} - -- Latitude Entry Panel (PShK_7) - --------------------------------------------------- - SendDataHW("342", string.format("%0.1f", mainPanelDevice:get_argument_value(342))) -- PShK7_LampAuto {0.0,1.0} - - -- generic Radio display and frequency rotarys - ------------------------------------------------- - genericRadio(nil, nil, gES_genericRadioHardwareID) - ---[[ - -- ENGINE_INTERFACE - local lENGINE_INTERFACE = GetDevice(4) - WriteToLog('lENGINE_INTERFACE:get_left_engine_temp '..dump(lENGINE_INTERFACE:get_left_engine_temp())) - WriteToLog('lENGINE_INTERFACE:get_left_engine_rpm '..dump(lENGINE_INTERFACE:get_left_engine_rpm())) - WriteToLog('lENGINE_INTERFACE:get_right_engine_temp '..dump(lENGINE_INTERFACE:get_right_engine_temp())) - WriteToLog('lENGINE_INTERFACE:get_right_engine_rpm '..dump(lENGINE_INTERFACE:get_right_engine_rpm())) - WriteToLog('lENGINE_INTERFACE:get_apu_temp '..dump(lENGINE_INTERFACE:get_apu_temp())) - - -- ABRIS - local lABRIS = GetDevice(9) - WriteToLog('lABRIS:get_active_route '..dump(lABRIS:get_active_route())) - WriteToLog('lABRIS:get_edited_route '..dump(lABRIS:get_edited_route())) - WriteToLog('lABRIS:get_sns_mode '..dump(lABRIS:get_sns_mode())) - WriteToLog('lABRIS:get_current_route '..dump(lABRIS:get_current_route())) - --WriteToLog('lABRIS:get_current_route_segment_info '..dump(lABRIS:get_current_route_segment_info())) -- DCS Error - WriteToLog('lABRIS:get_mode '..dump(lABRIS:get_mode())) - WriteToLog('lABRIS:print_to_console '..dump(lABRIS:print_to_console())) - --WriteToLog('lABRIS:replace_last_console_line '..dump(lABRIS:replace_last_console_line())) -- DCS Error - - -- EKRAN - local lEKRAN = GetDevice(10) - WriteToLog('lEKRAN:get_actual_text_frame '..dump(lEKRAN:get_actual_text_frame())) - - -- WEAP_INTERFACE - local lWEAP_INTERFACE = GetDevice(12) - WriteToLog('lWEAP_INTERFACE:get_weapon_type_on_station '..dump(lWEAP_INTERFACE:get_weapon_type_on_station())) - WriteToLog('lWEAP_INTERFACE:get_selected_weapon_stations '..dump(lWEAP_INTERFACE:get_selected_weapon_stations())) - WriteToLog('lWEAP_INTERFACE:get_selected_gun_ammo '..dump(lWEAP_INTERFACE:get_selected_gun_ammo())) - WriteToLog('lWEAP_INTERFACE:get_selected_gun_ammo_count '..dump(lWEAP_INTERFACE:get_selected_gun_ammo_count())) - WriteToLog('lWEAP_INTERFACE:get_weapon_count_on_station '..dump(lWEAP_INTERFACE:get_weapon_count_on_station())) - - -- DISS - local lDISS = GetDevice(16) - WriteToLog('lDISS:get_w_vector '..dump(lDISS:get_w_vector())) - WriteToLog('lDISS:get_drift_angle '..dump(lDISS:get_drift_angle())) - - -- NAV_INTERFACE - local lNAV_INTERFACE = GetDevice(28) - WriteToLog('lNAV_INTERFACE:get_indicated_air_speed '..dump(lNAV_INTERFACE:get_indicated_air_speed())) - WriteToLog('lNAV_INTERFACE:get_vertical_velocity '..dump(lNAV_INTERFACE:get_vertical_velocity())) - - -- HSI - local lHSI = GetDevice(30) - WriteToLog('lHSI:get_course '..dump(lHSI:get_course())) - WriteToLog('lHSI:get_course_dev_warning_flag '..dump(lHSI:get_course_dev_warning_flag())) - WriteToLog('lHSI:get_heading '..dump(lHSI:get_heading())) - WriteToLog('lHSI:get_heading_warning_flag '..dump(lHSI:get_heading_warning_flag())) - WriteToLog('lHSI:get_glideslope_dev_warning_flag '..dump(lHSI:get_glideslope_dev_warning_flag())) - WriteToLog('lHSI:get_range '..dump(lHSI:get_range())) - WriteToLog('lHSI:get_commanded_course '..dump(lHSI:get_commanded_course())) - WriteToLog('lHSI:get_bearing '..dump(lHSI:get_bearing())) - WriteToLog('lHSI:get_commanded_heading '..dump(lHSI:get_commanded_heading())) - - -- ADI - local lADI = GetDevice(31) - WriteToLog('lADI:get_sideslip '..dump(lADI:get_sideslip())) - WriteToLog('lADI:get_attitude_warn_flag_val '..dump(lADI:get_attitude_warn_flag_val())) - WriteToLog('lADI:get_pitch_steering '..dump(lADI:get_pitch_steering())) - WriteToLog('lADI:get_track_deviation '..dump(lADI:get_track_deviation())) - WriteToLog('lADI:get_airspeed_deviation '..dump(lADI:get_airspeed_deviation())) - WriteToLog('lADI:get_height_deviation '..dump(lADI:get_height_deviation())) - WriteToLog('lADI:get_bank_steering '..dump(lADI:get_bank_steering())) - WriteToLog('lADI:get_pitch '..dump(lADI:get_pitch())) - WriteToLog('lADI:get_steering_warn_flag_val '..dump(lADI:get_steering_warn_flag_val())) - WriteToLog('lADI:get_bank '..dump(lADI:get_bank())) - - -- AUTOPILOT - local lAUTOPILOT = GetDevice(33) - WriteToLog('lAUTOPILOT:get_channel_status_Bank '..dump(lAUTOPILOT:get_channel_status_Bank())) - WriteToLog('lAUTOPILOT:get_directional_mode '..dump(lAUTOPILOT:get_directional_mode())) - WriteToLog('lAUTOPILOT:get_channel_status_Yaw '..dump(lAUTOPILOT:get_channel_status_Yaw())) - WriteToLog('lAUTOPILOT:get_channel_status_Pitch '..dump(lAUTOPILOT:get_channel_status_Pitch())) - WriteToLog('lAUTOPILOT:get_channel_status_Height '..dump(lAUTOPILOT:get_channel_status_Height())) - - -- RADAR_ALTIMETER - local lRADAR_ALTIMETER = GetDevice(38) - WriteToLog('lRADAR_ALTIMETER:get_altitude '..dump(lRADAR_ALTIMETER:get_altitude())) - WriteToLog('lRADAR_ALTIMETER:get_dangerous_height_flag '..dump(lRADAR_ALTIMETER:get_dangerous_height_flag())) - WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..dump(lRADAR_ALTIMETER:get_distance_limit())) - WriteToLog('lRADAR_ALTIMETER:get_dangerous_height '..dump(lRADAR_ALTIMETER:get_dangerous_height())) - WriteToLog('lRADAR_ALTIMETER:get_warning_flag '..dump(lRADAR_ALTIMETER:get_warning_flag())) - WriteToLog('lRADAR_ALTIMETER:get_mode '..dump(lRADAR_ALTIMETER:get_mode())) - WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..dump(lRADAR_ALTIMETER:get_aperture_size())) - WriteToLog('lRADAR_ALTIMETER:get_needle_value '..dump(lRADAR_ALTIMETER:get_needle_value())) - - -- MISC_SYSTEMS_INTERFACE - local lMISC_SYSTEMS_INTERFACE = GetDevice(41) - WriteToLog('lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch '..dump(lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch())) - WriteToLog('lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm '..dump(lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm())) - - -- ARK_22 - local lARK_22 = GetDevice(46) - WriteToLog('lARK_22:get_channel '..dump(lARK_22:get_channel())) - WriteToLog('lARK_22:get_mode '..dump(lARK_22:get_mode())) - WriteToLog('lARK_22:get_homer_selector_pos '..dump(lARK_22:get_homer_selector_pos())) - - -- R_800 - local lR_800 = GetDevice(48) - WriteToLog('lR_800:is_on '..dump(lR_800:is_on())) - WriteToLog('lR_800:get_frequency '..dump(lR_800:get_frequency())) - --WriteToLog('lR_800:set_modulation '..dump(lR_800:set_modulation())) -- test the parameters - --WriteToLog('lR_800:set_frequency '..dump(lR_800:(set_frequency))) -- test the parameters - - -- R_828 - local R_828 = GetDevice(49) - WriteToLog('R_828:is_on '..dump(R_828:is_on())) - WriteToLog('R_828:get_frequency '..dump(R_828:get_frequency())) - --WriteToLog('R_828:set_modulation '..dump(R_828:set_modulation())) -- test the parameters - --WriteToLog('R_828:set_frequency '..dump(R_828:(set_frequency))) -- test the parameters - --WriteToLog('R_828:set_channel '..dump(R_828:(set_channel))) -- test the parameters - - -- SPU_9 - local lSPU_9 = GetDevice(50) - WriteToLog('lSPU_9:get_is_on '..dump(lSPU_9:get_is_on())) - WriteToLog('lSPU_9:is_communicator_available '..dump(lSPU_9:is_communicator_available())) - WriteToLog('lSPU_9:get_selector_pos '..dump(lSPU_9:get_selector_pos())) - WriteToLog('lSPU_9:get_noise_level '..dump(lSPU_9:get_noise_level())) - WriteToLog('lSPU_9:get_signal_level '..dump(lSPU_9:get_signal_level())) - --WriteToLog('lSPU_9:set_communicator '..dump(lSPU_9:set_communicator())) -- test the parameters - --WriteToLog('lSPU_9:set_voip_mode '..dump(lSPU_9:set_voip_mode())) -- test the parameters - - -- STBY_ADI - local lSTBY_ADI = GetDevice(55) - WriteToLog('lSTBY_ADI:get_sideslip '..dump(lSTBY_ADI:get_sideslip())) - WriteToLog('lSTBY_ADI:get_bank '..dump(lSTBY_ADI:get_bank())) - WriteToLog('lSTBY_ADI:get_pitch '..dump(lSTBY_ADI:get_pitch())) - ]] ---[[ - local ltmp1 = 0 - for ltmp2 = 0, 62, 1 do - ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end -]] -end - ------------------------------ --- Custom functions -- ------------------------------ - -function genericRadio(key, value, hardware) - local lHardware = hardware or 1 - -- Werte werden per Encoder im Bereich von 0.0 bis 2.0 in 0.1 Schritten uebergeben - -- im jeweiligen Abschnitt muessen die Eingangsdaten auf den Zulaessigen Bereich eingeschraengt werden - local lRotaryFrequency_1, lRotaryFrequency_2, lVolume, lPreset, lLoad, lSquelch, lManualPreset, lPower, lDevice, lClickAction, lSetFrequency = nil - local lMainPanelDevice = GetDevice(0) - local lMaxRadios = 2 - - if gES_genericRadio == nil then - gES_genericRadio = 0 - end - if gES_genericRadioFrequency1 == nil then - gES_genericRadioFrequency1 = 0.0 - end - if gES_genericRadioFrequency2 == nil then - gES_genericRadioFrequency2 = 0.0 - end - if gES_genericRadioPresetChannel == nil then - gES_genericRadioPresetChannel = 0.0 - end - if gES_genericRadioPower == nil then - gES_genericRadioPower = {} - end - if gES_genericRadioPresetManual == nil then - gES_genericRadioPresetManual = {} - end - if gES_genericRadioSquelch == nil then - gES_genericRadioSquelch = {} - end - - if key == "3001" then - gES_genericRadio = tonumber(value) - end - if key == "3002" then - lRotaryFrequency_1 = tonumber(value) - end - if key == "3003" then - lRotaryFrequency_2 = tonumber(value) - end - if key == "3004" then - lVolume = tonumber(value) - end - if key == "3005" then - lPreset = tonumber(value) - end - if key == "3006" then - lLoad = tonumber(value) - end - if key == "3007" then - lSquelch = tonumber(value) - end - if key == "3008" then - lManualPreset = tonumber(value) - end - if key == "3009" then - lPower = tonumber(value) - end - - if gES_genericRadio > lMaxRadios then - WriteToLog("Radio Nr. "..gES_genericRadio.." not defined.") - return - end - - if gES_genericRadio == 1 then - -- R_800 FM/AM Radio###.### - local lDeviceID = 48 - local lR_800 = GetDevice(lDeviceID) - - -- check status of the radio - if gES_genericRadioPower[gES_genericRadio] == nil then - if lR_800:is_on() then - gES_genericRadioPower[gES_genericRadio] = 1.0 - else - gES_genericRadioPower[gES_genericRadio] = 0.0 - end - end - if gES_genericRadioPresetManual[gES_genericRadio] == nil then - gES_genericRadioPresetManual[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(167), 1) == 0) and 1 or 0) - end - if gES_genericRadioSquelch[gES_genericRadio] == nil then - gES_genericRadioSquelch[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(170), 1) == 0) and 1 or 0) - end - - local lR_800_FREQUENCY = math.round(lR_800:get_frequency()/1000000 , 3, "floor") - - SendDataHW("3000", string.format("%.3f", lR_800_FREQUENCY), lHardware) - SendDataHW("3001", string.format("-"), lHardware) - SendDataHW("3002", string.format("%.3f", lR_800_FREQUENCY), lHardware) - - if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then - - local lFrequency = StrSplit(lR_800_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 25) - lFrequency[2] = ltmp * 25 - end - if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then - lFrequency[1] = lFrequency[1] - 1 - if lFrequency[1] == 99 then - lFrequency[1] = 399 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - else - lFrequency[1] = lFrequency[1] + 1 - if lFrequency[1] == 400 then - lFrequency[1] = 100 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("1. generic Ka-50 R_800 Radio, don't split frequency: "..lFrequency) - end - end - - if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then - - local lFrequency = StrSplit(lR_800_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 25) - lFrequency[2] = ltmp * 25 - end - if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then - lFrequency[2] = lFrequency[2] - 25 - if lFrequency[2] == -25 then - lFrequency[2] = 975 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - else - lFrequency[2] = lFrequency[2] + 25 - if lFrequency[2] == 1000 then - lFrequency[2] = 0 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("2. generic Ka-50 R_800 Radio, don't split frequency: "..lFrequency) - end - end ---[[ - if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then - lVolume = lVolume / 2 - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3005, - Value = lVolume} - end - if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then - -- Preset 0.0 to 0.20 in 0.01 steps - if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3001, - Value = 0.01} - gES_genericRadioPresetChannel = lPreset - else - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3002, - Value = -0.01} - gES_genericRadioPresetChannel = lPreset - end - end - if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3006, - Value = lLoad} - end -]] - if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then - if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then - -- Squelch off - lSquelch = 0.0 - gES_genericRadioSquelch[gES_genericRadio] = 0 - elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then - -- Squelch on - lSquelch = 1.0 - gES_genericRadioSquelch[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3006, - Value = lSquelch} - end - -- ManualPreset is AM FM modus switch - if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then - if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0.0 then - -- AM - lManualPreset = 1.0 - gES_genericRadioPresetManual[gES_genericRadio] = 1.0 - elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then - -- FM - lManualPreset = 0.0 - gES_genericRadioPresetManual[gES_genericRadio] = 0.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3002, - Value = lManualPreset} - end - if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then - if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then - -- Power off - lPower = 0.0 - gES_genericRadioPower[gES_genericRadio] = 0 - elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then - -- Power on - lPower = 1.0 - gES_genericRadioPower[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3011, - Value = lPower} - end - - elseif gES_genericRadio == 2 then - -- R_828 VHF ###.### - --------------------------------------------------- - local lDeviceID = 49 - local lR_828_RADIO = GetDevice(lDeviceID) - - -- check status of the radio - if gES_genericRadioPower[gES_genericRadio] == nil then - if lR_828_RADIO:is_on() then - gES_genericRadioPower[gES_genericRadio] = 1.0 - else - gES_genericRadioPower[gES_genericRadio] = 0.0 - end - end - if gES_genericRadioPresetManual[gES_genericRadio] == nil then - gES_genericRadioPresetManual[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(135), 1) == 0.1) and 1 or 0) - end - if gES_genericRadioSquelch[gES_genericRadio] == nil then - gES_genericRadioSquelch[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(134), 1) == 1.0) and 0 or 1) - end - - local lR_828_RADIO_PRESET = {[0.0]="1",[0.1]="2",[0.2]="3",[0.3]="4",[0.4]="5",[0.5]="6",[0.6]="7",[0.7]="8",[0.8]="9",[0.9]="10"} - local lR_828_RADIO_FREQUENCY = math.round(lR_828_RADIO:get_frequency()/1000000 , 3, "floor") - - local lPresetChannel = math.round(lMainPanelDevice:get_argument_value(371), 1) - - SendDataHW("3000", string.format("%s0%.3f", lR_828_RADIO_PRESET[lPresetChannel], lR_828_RADIO_FREQUENCY), lHardware) - SendDataHW("3001", string.format("%s0", lR_828_RADIO_PRESET[lPresetChannel]), lHardware) - SendDataHW("3002", string.format("%.3f", lR_828_RADIO_FREQUENCY), lHardware) - ---[[ - if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then - - local lFrequency = StrSplit(lR_828_RADIO_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 25) - lFrequency[2] = ltmp * 25 - end - if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then - lFrequency[1] = lFrequency[1] - 1 - if lFrequency[1] == 29 then - lFrequency[1] = 159 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - else - lFrequency[1] = lFrequency[1] + 1 - if lFrequency[1] == 160 then - lFrequency[1] = 30 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("1. generic Ka-50 VHF Radio, don't split frequency: "..lFrequency) - end - end - - if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then - - local lFrequency = StrSplit(lR_828_RADIO_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 25) - lFrequency[2] = ltmp * 25 - end - if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then - lFrequency[2] = lFrequency[2] - 25 - if lFrequency[2] == -25 then - lFrequency[2] = 975 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - else - lFrequency[2] = lFrequency[2] + 25 - if lFrequency[2] == 1000 then - lFrequency[2] = 0 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("2. generic Ka-50 VHF Radio, don't split frequency: "..lFrequency) - end - end -]] - if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then - lVolume = lVolume / 2 - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3002, - Value = lVolume} - end - if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then ---[[ - -- Preset 0.0 to 0.9 in 0.1 steps - lPreset = (lPreset / 2) - 0.1 - if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3001, - Value = 0.1} - gES_genericRadioPresetChannel = lPreset - else - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3001, - Value = -0.1} - gES_genericRadioPresetChannel = lPreset - end -]] - -- Preset 0.0 to 0.9 in 0.1 steps - lPreset = lPreset / 2 - if lPreset == 1.0 then - lPreset = 0.9 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3001, - Value = lPreset} - end - -- Load Button change the Frequence - if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3003, - Value = lLoad} - end - if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then - if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then - -- Squelch off - lSquelch = 0.0 - gES_genericRadioSquelch[gES_genericRadio] = 0 - elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then - -- Squelch on - lSquelch = 1.0 - gES_genericRadioSquelch[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3004, - Value = lSquelch} - end ---[[ - if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then - if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then - -- Manual on - lManualPreset = 0.2 - gES_genericRadioPresetManual[gES_genericRadio] = 0 - elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then - -- Preset on - lManualPreset = 0.3 - gES_genericRadioPresetManual[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3003, - Value = lManualPreset} - end -]] - if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then - if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then - -- Power off - lPower = 0.0 - gES_genericRadioPower[gES_genericRadio] = 0 - elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then - -- Power on - lPower = 1.0 - gES_genericRadioPower[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3005, - Value = lPower} - end - - --SendDataHW("3011", lMainPanelDevice:get_argument_value(375), lHardware) - gES_genericRadioPresetManual[gES_genericRadio] = lMainPanelDevice:get_argument_value(375) - - else - SendDataHW("3000", "-", lHardware) - SendDataHW("3001", "-", lHardware) - SendDataHW("3002", "-", lHardware) - SendDataHW("3010", 0, lHardware) - SendDataHW("3011", 0, lHardware) - SendDataHW("3012", 0, lHardware) - return - end - - SendDataHW("3010", gES_genericRadioPower[gES_genericRadio], lHardware) - SendDataHW("3011", gES_genericRadioPresetManual[gES_genericRadio], lHardware) - SendDataHW("3012", gES_genericRadioSquelch[gES_genericRadio], lHardware) - - if lClickAction ~= nil then - lDevice = GetDevice(lClickAction.DeviceID) - if type(lDevice) == "table" then - --WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ") - lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value) - end - elseif lSetFrequency ~= nil then - lDevice = GetDevice(lSetFrequency.DeviceID) - if type(lDevice) == "table" and lDevice:is_on() then - --WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ") - lDevice:set_frequency(lSetFrequency.Frequency) - else - WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on") - end - end -end diff --git a/ExportsModules/P-51D.lua b/ExportsModules/P-51D.lua deleted file mode 100644 index db3aa19..0000000 --- a/ExportsModules/P-51D.lua +++ /dev/null @@ -1,554 +0,0 @@ --- P-51D Export --- Version 0.9.9 BETA - -gES_FoundDCSModule = true - -gES_GlassCockpitConfigEveryFrameArguments = -{ - --[[ - every frames arguments - based of "mainpanel_init.lua" - Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) - [DeviceID] = "Format" - [4] = "%.4f", <- floating-point number with 4 digits after point - [19] = "%0.1f", <- floating-point number with 1 digit after point - [129] = "%1d", <- decimal number - ]] - -- Flight Instruments - [11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7} - [29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6} - -- Altimeter - [97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0} - [96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0} - [24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0} - [25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0} - -- Artificial horizon - [15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} - [14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} - [16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0} - [20] = "%.1f", -- AHorizon_Caged {0.0, 1.0} - -- directional gyro - [12] = "%.4f", -- GyroHeading - -- turn indicator - [27] = "%.4f", -- TurnNeedle {-1.0, 1.0} - [28] = "%.4f", -- Slipball {-1.0, 1.0} - -- oxygen pressure indicator - [34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} - [33] = "%.4f", -- Oxygen_Flow_Blinker - -- fuel system - [155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} - [156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} - [160] = "%.4f", -- Fuel_Tank_Fuselage {0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,85.0} {0.0,0.12,0.28,0.40,0.51,0.62,0.72,0.83,0.96,1.0} - [32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0} - -- A-11 clock - [4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0} - [5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0} - [6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0} - -- AN5730 remote compass - [1] = "%.4f", -- CompassHeading - [2] = "%.4f", -- CommandedCourse - [3] = "%.4f", -- CommandedCourseKnob - -- TailRadarWarning - [161] = "%.1f", -- Lamp TailRadarWarning - -- SCR-522A Control panel - [122] = "%.1f", -- A_channel_light - [123] = "%.1f", -- B_channel_light - [124] = "%.1f", -- C_channel_light - [125] = "%.1f", -- D_channel_light - [126] = "%.1f", -- Transmit_light - -- hydraulic pressure - [78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0} - -- Landing gears handle - [150] = "%.4f", -- Landing_Gear_Handle - [151] = "%.4f", -- Landing_Gear_Handle_Indoor - [80] = "%.1f", -- LandingGearGreenLight - [82] = "%.1f", -- LandingGearRedLight - -- gauges - [10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} - [23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} - [9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0} - [21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} - [22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1} - [30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0} - [31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0} - [164] = "%.1f", -- Left_Fluor_Light - [165] = "%.1f", -- Right_Fluor_Light - [59] = "%.1f", -- Hight_Blower_Lamp - -- Trimmer - [170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0} - [172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0} - [171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0} - [174] = "%.4f", -- Control_Lock_Bracket - [175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} - [177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} - [178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} - [101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} - -- light - [185] = "%.1f", -- Left_cockpit_light - [186] = "%.1f", -- Right_cockpit_light - [190] = "%.4f", -- warEmergencyPowerLimWire - ------------- - --[181] = "%.4f", -- Panel_Shake_Z - --[180] = "%.4f", -- Panel_Shake_Y - --[189] = "%.4f", -- Panel_Rot_X - --[162] = "%.1f", -- Canopy_Trucks - --[163] = "%.1f", -- Canopy_Visibility - -- Stick - --[50] = "%.4f", -- StickPitch - --[51] = "%.4f", -- StickBank - -- RudderPedals - --[54] = "%.4f", -- RudderPedals - --[55] = "%.4f", -- Left_Wheel_Brake - --[56] = "%.4f", -- Right_Wheel_Brake - -- K-14 gunsight - [36] = "%.4f", -- sightRange - --[188] = "%.4f", -- K_14_Shake_Z - --[187] = "%.4f", -- K_14_Shake_Y - ------------- - --[45] = "%.4f", -- ThrottleTwistGrip - ------------- - [77] = "%.4f", -- Rocket_Counter - ------------- - --[413] = "%.1f", -- WindShieldDamages - --[412] = "%.1f", -- WindShieldOil -} - -gES_GlassCockpitConfigArguments = -{ - --[[ - arguments for export in low tick interval - based on "clickabledata.lua" - ]] - -- Right Swich Panel - [102] = "%d", -- Generator Connect/Disconnect - [103] = "%d", -- Battery Connect/Disconnect - [104] = "%d", -- Gun Heating ON/OFF - [105] = "%d", -- Pitot Heating ON/OFF - [106] = "%d", -- Wing Position Lights Bright/Off/Dim - [107] = "%d", -- Tail Position Lights Bright/Off/Dim - [108] = "%d", -- Red Recognition Light Key/Off/Steady - [109] = "%d", -- Green Recognition Light Key/Off/Steady - [110] = "%d", -- Amber Recognition Light Key/Off/Steady - [111] = "%d", -- Recognition Lights Key - [112] = "%d", -- Circuit Protectors Reset - [100] = "%.4f", -- Right Fluorescent Light (rotary) - [90] = "%.4f", -- Left Fluorescent Light (rotary) - -- Flight Instrument panel - [3] = "%.4f", -- Course Set (rotary) - [13] = "%.4f", -- Heading Set/Cage (rotary) - [179] = "%d", -- Heading Set/Cage Button - [17] = "%.4f", -- Pitch Adjustment (rotary) - [18] = "%.4f", -- Cage (rotary) - [19] = "%d", -- Cage Button - [8] = "%d", -- Winding/Adjustment Clock Button - [7] = "%.4f", -- Winding/Adjustment Clock (rotary) - [26] = "%.4f", -- Set Pressure (rotary) - -- SCR-522A Control panel - [117] = "%d", -- Radio ON/OFF - [118] = "%d", -- A Channel Activate - [119] = "%d", -- B Channel Activate - [120] = "%d", -- C Channel Activate - [121] = "%d", -- D Channel Activate - [127] = "%.4f", -- Radio Lights Dimmer (rotary) - [116] = "%.4f", -- Radio Audio Volume (rotary) - [44] = "%d", -- Microphone On - [200] = "%d", -- Arm rest - [129] = "%d", -- Switch Locking Lever - [128] = "%d", -- Radio Mode Transmit/Receive/Remote - ------------- - [71] = "%.4f", -- Cockpit Lights (rotary) - [66] = "%0.1f", -- Ignition Off/Right/Left/Both - [67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On - [72] = "%d", -- Silence Landing Gear Warning Horn Cut Off - -- Bomb Arm/Chemical - [69] = "%d", -- Left Bomb Arm/Chemical - [70] = "%d", -- Right Bomb Arm/Chemical - -- Release Mode - [68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm - [73] = "%0.1f", -- Rockets Release Mode Off/Single/Auto - [74] = "%d", -- Rockets Delay Switch Delay/Int - [75] = "%0.4f", -- Rockets Counter Control - -- Engine Control Panel - [58] = "%d", -- Supercharger Switch Cover - [57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH - [60] = "%d", -- High Blower Lamp Test - [61] = "%d", -- Fuel Booster On/Off - [62] = "%d", -- Oil Dilute Activate - [63] = "%d", -- Starter Activate - [64] = "%d", -- Starter Switch Cover - [65] = "%d", -- Primer Activate - -- Oxygen Regulator - [131] = "%d", -- Auto-Mix On-Off - [130] = "%0.4f", -- Oxygen Emergency By-pass - -- Fuel system - [85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank - [86] = "%d", -- Fuel Shut-Off Valve ON/OFF - -- AN/APS-13 - [114] = "%d", -- ail Warning Radar Power ON/OFF - [115] = "%d", -- Tail Warning Radar Test - [113] = "%.4f", -- Tail Warning Radar Light Control (rotary) - ------------- - [79] = "%d", -- Hydraulic Release Knob - [94] = "%.4f", -- Flaps Control Handle (rotary) - [84] = "%d", -- Parking Brake Handle - [81] = "%d", -- Safe Landing Gear Light Test - [83] = "%d", -- Unsafe Landing Gear Light Test - -- Detrola receiver - [137] = "%.4f", -- Detrola Frequency Selector (rotary) - [138] = "%.4f", -- Detrola Volume (rotary) - -- canopy - [147] = "%.4f", -- Canopy Hand Crank (rotary) - [149] = "%d", -- Canopy Emergency Release Handle - -- AN/ARA-8 - [152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING - [153] = "%d", -- Homing Adapter Power On/Off - [154] = "%d", -- Homing Adapter's Circuit Breaker - -- SCR-695 - [139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6 - [140] = "%d", -- IFF Power On/Off - [141] = "%d", -- IFF TIME/OFF/ON - [142] = "%d", -- IFF Detonator Circuit On/Off - [143] = "%d", -- IFF Distress Signal On/Off - [145] = "%d", -- IFF Detonator Left - [146] = "%d", -- IFF Detonator Right - -- Trimmers - [91] = "%.4f", -- Aileron Trim (rotary) - [92] = "%.4f", -- Elevator Trim (rotary) - [93] = "%.4f", -- Rudder Trim (rotary) - ------------- - [157] = "%.4f", -- Defroster (rotary) - [158] = "%.4f", -- Cold Air (rotary) - [159] = "%.4f", -- Hot Air (rotary) - ------------- - [89] = "%d", -- Landing Light On/Off - [168] = "%d", -- Coolant Control Cover - [87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control - [169] = "%d", -- Oil Control Cover - [88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control - [134] = "%0.1f", -- Carburetor Cold Air Control (rotary) - [135] = "%0.1f", -- Carburetor Warm Air Control (rotary) - [47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH - [43] = "%.4f", -- Throttle (rotary) - [46] = "%.4f", -- Propeller RPM (rotary) - [173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position - [48] = "%.4f", -- Lock Throttle (rotary) - [49] = "%.4f", -- Lock Propeller & Mixture (rotary) - [176] = "%d", -- G-meter reset - [183] = "%d", -- Mirror -} - ------------------------------ --- HIGH IMPORTANCE EXPORTS -- --- done every export event -- ------------------------------ - -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - --[[ - every frame export to GlassCockpit - Example from A-10C - Get Radio Frequencies - get data from device - local lUHFRadio = GetDevice(54) - SendData("ExportID", "Format") - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data - ]] - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 --- WriteToLog('in ProcessGlassCockpitDCSConfigHighImportance - HELIOS: '..t) - local MainPanel = GetDevice(0) - local AirspeedNeedle = MainPanel:get_argument_value(11)*1000 - local Altimeter_10000_footPtr = MainPanel:get_argument_value(96)*100000 - local Variometer = MainPanel:get_argument_value(29) - local TurnNeedle = MainPanel:get_argument_value(27) - local Slipball = MainPanel:get_argument_value(28) - local CompassHeading = MainPanel:get_argument_value(1) - local CommandedCourse = MainPanel:get_argument_value(2) - local Manifold_Pressure = MainPanel:get_argument_value(10) - local Engine_RPM = MainPanel:get_argument_value(23) - local AHorizon_Pitch = MainPanel:get_argument_value(15) - local AHorizon_Bank = MainPanel:get_argument_value(14) - local AHorizon_PitchShift = MainPanel:get_argument_value(16) * 10.0 * math.pi/180.0 - local AHorizon_Caged = MainPanel:get_argument_value(20) - local GyroHeading = MainPanel:get_argument_value(12) - local vaccum_suction = MainPanel:get_argument_value(9) - local carburator_temp = MainPanel:get_argument_value(21) - local coolant_temp = MainPanel:get_argument_value(22) - local Acelerometer = MainPanel:get_argument_value(175) - local OilTemperature = MainPanel:get_argument_value(30) - local OilPressure = MainPanel:get_argument_value(31) - local FuelPressure = MainPanel:get_argument_value(32) - local Clock_hours = MainPanel:get_argument_value(4) - local Clock_minutes = MainPanel:get_argument_value(5) - local Clock_seconds = MainPanel:get_argument_value(6) - local LandingGearGreenLight = MainPanel:get_argument_value(80) - local LandingGearRedLight = MainPanel:get_argument_value(82) - local Hight_Blower_Lamp = MainPanel:get_argument_value(59) - local Acelerometer_Min = MainPanel:get_argument_value(177) - local Acelerometer_Max = MainPanel:get_argument_value(178) - local Ammeter = MainPanel:get_argument_value(101) - local hydraulic_Pressure = MainPanel:get_argument_value(78) - local Oxygen_Flow_Blinker = MainPanel:get_argument_value(33) - local Oxygen_Pressure = MainPanel:get_argument_value(34) - local Fuel_Tank_Left = MainPanel:get_argument_value(155) - local Fuel_Tank_Right = MainPanel:get_argument_value(156) - local Fuel_Tank_Fuselage = MainPanel:get_argument_value(160) - local Tail_radar_warning = MainPanel:get_argument_value(161) - local Channel_A = MainPanel:get_argument_value(122) - local Channel_B = MainPanel:get_argument_value(123) - local Channel_C = MainPanel:get_argument_value(124) - local Channel_D = MainPanel:get_argument_value(125) - local transmit_light = MainPanel:get_argument_value(126) - local RocketCounter = MainPanel:get_argument_value(77) - - --- preparing landing gear and High Blower lights, all together, in only one value - local gear_lights = 0 - if LandingGearGreenLight > 0 then gear_lights = gear_lights +100 end - if LandingGearRedLight > 0 then gear_lights = gear_lights +10 end - if Hight_Blower_Lamp > 0 then gear_lights = gear_lights +1 end - ------------------------------------------------------------ - - --- preparing radio lights, all together, in only one value - local radio_active = 0 - if Channel_A > 0 then radio_active = 1 end - if Channel_B >0 then radio_active= 2 end - if Channel_C >0 then radio_active= 3 end - if Channel_D >0 then radio_active= 4 end - if transmit_light >0 then radio_active = radio_active + 10 end - ------------------------------------------------------------ - - - ---- sending P51 and tf51 data across fc2 interface - ----Please comment out the appropriate entries in the table 'gES_GlassCockpitConfigEveryFrameArguments'. - - SendData("1", string.format("%.5f", math.floor((AHorizon_Pitch+1)*1000) + ((AHorizon_Bank+1)/100) ) ) -- pitch - SendData("2", string.format("%.3f", math.floor(Oxygen_Flow_Blinker*100) + (Oxygen_Pressure/100) ) ) -- bank - SendData("3", string.format("%.4f", math.floor(OilTemperature*100) + (vaccum_suction/100) ) ) -- yaw - SendData("4", string.format("%.3f", math.floor(Altimeter_10000_footPtr) + (AHorizon_Caged/100) ) ) -- barometric altitude - SendData("5", string.format("%.5f", math.floor(Clock_hours*1000000) + (Tail_radar_warning/100) ) ) -- radar altitude - SendData("6", string.format("%.5f", math.floor(CompassHeading*1000) + (CommandedCourse/100) ) ) -- adf - SendData("7", string.format("%.4f", math.floor(Clock_seconds*100) + (hydraulic_Pressure/100) ) ) -- rmi - SendData("8", string.format("%.2f", math.floor(GyroHeading*1000) + (radio_active/100) ) ) -- heading - SendData("9", string.format("%.4f", math.floor(Engine_RPM*100) + (Manifold_Pressure/100) ) ) -- left rpm - SendData("10", string.format("%.4f", math.floor(Fuel_Tank_Left*100) + (Fuel_Tank_Right/100) ) ) -- right rpm - SendData("11", string.format("%.4f", math.floor(carburator_temp*100) + (coolant_temp/100) ) ) -- left temp - SendData("12", string.format("%.4f", math.floor(gear_lights) + (Acelerometer_Min/100 ) ) ) -- right temp - SendData("13", string.format("%.2f", Variometer) ) -- vvi - SendData("14", string.format("%.5f", math.floor(AirspeedNeedle)+ (RocketCounter/100) ) ) -- ias - SendData("15", string.format("%.4f", math.floor(OilPressure*100) + (FuelPressure/100) ) ) -- distance to way - SendData("16", string.format("%.3f", math.floor(Acelerometer*1000) + (Acelerometer_Max/100 ) ) ) -- aoa - SendData("17", string.format("%.4f", math.floor((TurnNeedle+1)*100) + ((Slipball+1)/100) ) ) -- glide - SendData("18", string.format("%.4f", math.floor(Fuel_Tank_Fuselage*100) + (Ammeter/100) ) ) -- side - - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 --- WriteToLog('in ProcessGlassCockpitDCSConfigHighImportance - HawgTouch: '..t) - -- ADI AN5736 - -- Artificial horizon - --[15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} - --[14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} - --[16] = "%.1f", -- AHorizon_PitchShift - --[20] = "%.1f", -- AHorizon_Caged - SendData(2000, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(15), - mainPanelDevice:get_argument_value(14))) - -- turn indicator AN5820 - --[27] = "%.4f", -- TurnNeedle {-1.0, 1.0} - --[28] = "%.4f", -- Slipball {-1.0, 1.0} - SendData(2001, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(27), - mainPanelDevice:get_argument_value(28))) - -- directional gyro AN5735 - --[12] = "%.1f", -- GyroHeading {0.0, 1.0} - -- Vacuum_Suction AN5771-5 - --[9] = "%.4f", -- Vacuum_Suction {0.0, 1.0} - -- F-2 Airspeed Indicator - -- [11] = "%.2f", -- AirspeedNeedle {0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700} {0.0, 0.05, 0.10, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7} - -- Altimeter AN5760-2 - --[96] = "%.1f", -- Altimeter_10000_footPtr {0.0, 1.0} - --[24] = "%.1f", -- Altimeter_1000_footPtr {0.0, 1.0} - --[25] = "%.1f", -- Altimeter_100_footPtr {0.0, 1.0} - --[97] = "%.1f", -- Altimeter_Pressure {28.1, 31.0} {0.0, 1.0} - SendData(2002, string.format("%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(96), - mainPanelDevice:get_argument_value(24), - mainPanelDevice:get_argument_value(25), - mainPanelDevice:get_argument_value(97))) - -- Rate of Climb Indicator AN5825 - --[29] = "%.1f", -- Variometer {0.0, 1.0} - -- D-10 Manifold Pressure Indicator - --[10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} - -- Tachometer - --[23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} - -- AN5790-6 Carburetor Air Temperature Indicator - --[21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} - -- Coolant Temperature Indicator - --[22] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} - -- Engine Gauge - --[30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0.0, 1.0} - --[31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0.0, 1.0} - --[32] = "%.1f", -- Fuel_Pressure {0.0, 25.0} -- PSI {0.0, 1.0} - SendData(2003, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(30), - mainPanelDevice:get_argument_value(31), - mainPanelDevice:get_argument_value(32))) - -- Remote Indicator Compass - -- AN5730 remote compass - --[1] = "%.4f", -- CompassHeading {0.0, 1.0} - --[2] = "%.4f", -- CommandedCourse {0.0, 1.0} - SendData(2004, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(1), - mainPanelDevice:get_argument_value(2))) - -- A-11 clock - --[4] = "%.4f", -- CLOCK_currtime_hours {0.0, 1.0} - --[5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 1.0} - --[6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 1.0} - SendData(2005, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(4), - mainPanelDevice:get_argument_value(5), - mainPanelDevice:get_argument_value(6))) - -- Oxygen Flow Indicator - --[33] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0} - -- Oxygen Pressure Gauge - --[34] = "%.1f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} - -- Hydraulic Pressure Gauge - --[78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} -- PSI {0.0, 1.0} - -- Fuel Gauges - -- Left Wing Main Tank - --[155] = "%.2f", -- Fuel_Tank_Left {0.0, 5.0, 15.0, 30.0, 45.0, 60.0, 75.0, 92.0} -- US GAL {0.0, 0.2, 0.36, 0.52, 0.65, 0.77, 0.92, 1.0} - -- Fuselage Tank - --[160] = "%.2f", -- Fuel_Tank_Fuselage {0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 85.0} -- US GAL {0.0, 0.12, 0.28, 0.40, 0.51, 0.62, 0.72, 0.83, 0.96, 1.0} - -- Right Wing Main Tank - --[156] = "%.2f", -- Fuel_Tank_Right {0.0, 5.0, 15.0, 30.0, 45.0, 60.0, 75.0, 92.0} -- US GAL {0.0, 0.2, 0.36, 0.52, 0.65, 0.77, 0.92, 1.0} - -- AN-5745 accelerometer indicator - --[175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} - --[177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} - --[178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} - SendData(2006, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(175), - mainPanelDevice:get_argument_value(177), - mainPanelDevice:get_argument_value(178))) - -- Landing Gear Warning Lights - --[80] = "%.1f", -- LandingGearGreenLight - --[82] = "%.1f", -- LandingGearRedLight - SendData(2007, string.format("%.1f;%.1f", - mainPanelDevice:get_argument_value(80), - mainPanelDevice:get_argument_value(82))) - -- AMMETER - --[101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} - end -end - -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) - --[[ - every frame export to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config - ]] - -- no dimming lights - -- TailRadarWarning - SendDataHW("161", mainPanelDevice:get_argument_value(161) > 0.3 and 1 or 0) -- Lamp TailRadarWarning - -- SCR-522A Control panel - SendDataHW("122", mainPanelDevice:get_argument_value(122) > 0.3 and 1 or 0) -- A_channel_light - SendDataHW("123", mainPanelDevice:get_argument_value(123) > 0.3 and 1 or 0) -- B_channel_light - SendDataHW("124", mainPanelDevice:get_argument_value(124) > 0.3 and 1 or 0) -- C_channel_light - SendDataHW("125", mainPanelDevice:get_argument_value(125) > 0.3 and 1 or 0) -- D_channel_light - SendDataHW("126", mainPanelDevice:get_argument_value(126) > 0.3 and 1 or 0) -- Transmit_light - -- Landing gears - SendDataHW("80", mainPanelDevice:get_argument_value(80) > 0.3 and 1 or 0) -- LandingGearGreenLight - SendDataHW("82", mainPanelDevice:get_argument_value(82) > 0.3 and 1 or 0) -- LandingGearRedLight - -- Engine - SendDataHW("59", mainPanelDevice:get_argument_value(59) > 0.3 and 1 or 0) -- Hight_Blower_Lamp - -- Cockpit Lights - SendDataHW("164", mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Left_Fluor_Light - SendDataHW("165", mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Right_Fluor_Light - SendDataHW("185", mainPanelDevice:get_argument_value(185) > 0.3 and 1 or 0) -- Left_cockpit_light - SendDataHW("186", mainPanelDevice:get_argument_value(186) > 0.3 and 1 or 0) -- Right_cockpit_light - - --[[ - -- dimming lights - -- TailRadarWarning - SendDataHW("161", string.format("%.1f", mainPanelDevice:get_argument_value(161))) -- Lamp TailRadarWarning - -- SCR-522A Control panel - SendDataHW("122", string.format("%.1f", mainPanelDevice:get_argument_value(122))) -- A_channel_light - SendDataHW("123", string.format("%.1f", mainPanelDevice:get_argument_value(123))) -- B_channel_light - SendDataHW("124", string.format("%.1f", mainPanelDevice:get_argument_value(124))) -- C_channel_light - SendDataHW("125", string.format("%.1f", mainPanelDevice:get_argument_value(125))) -- D_channel_light - SendDataHW("126", string.format("%.1f", mainPanelDevice:get_argument_value(126))) -- Transmit_light - -- Landing gears - SendDataHW("80", string.format("%.1f", mainPanelDevice:get_argument_value(80))) -- LandingGearGreenLight - SendDataHW("82", string.format("%.1f", mainPanelDevice:get_argument_value(82))) -- LandingGearRedLight - -- Engine - SendDataHW("59", string.format("%.1f", mainPanelDevice:get_argument_value(59))) -- Hight_Blower_Lamp - -- Cockpit Lights - SendDataHW("164", string.format("%.1f", mainPanelDevice:get_argument_value(164))) -- Left_Fluor_Light - SendDataHW("165", string.format("%.1f", mainPanelDevice:get_argument_value(165))) -- Right_Fluor_Light - SendDataHW("185", string.format("%.1f", mainPanelDevice:get_argument_value(185))) -- Left_cockpit_light - SendDataHW("186", string.format("%.1f", mainPanelDevice:get_argument_value(186))) -- Right_cockpit_light - ]] -end - ------------------------------------------------------ --- LOW IMPORTANCE EXPORTS -- --- done every gExportLowTickInterval export events -- ------------------------------------------------------ - -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - --[[ - export in low tick interval to GlassCockpit - Example from A-10C - Get Radio Frequencies - get data from device - local lUHFRadio = GetDevice(54) - SendData("ExportID", "Format") - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data - ]] - - --[[ - local lDETROLA = GetDevice(24) - WriteToLog('lDETROLA: '..dump(lDETROLA:is_on())) - WriteToLog('lDETROLA: '..dump(lDETROLA:get_frequency())) - --SendData(2000, string.format("%7.3f", lDETROLA:get_frequency()/1000000)) - - local lINTERCOM = GetDevice(31) - WriteToLog('lINTERCOM: '..dump(lINTERCOM:is_communicator_available())) - WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_noise_level())) - WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_signal_level())) - ]] ---[[ - local ltmp1 = 0 - for ltmp2 = 1, 35, 1 do - ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end -]] -end - -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) ---[[ - export in low tick interval to hardware - Example from A-10C - Landing Gear - mainPanelDevice, basis panel - SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE - SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE - SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE - ]] - - --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - - local ltmp1 = 0 - for ltmp2 = 1, 10, 1 do - ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] -end diff --git a/ExportsModules/TF-51D.lua b/ExportsModules/TF-51D.lua deleted file mode 100644 index cb1046f..0000000 --- a/ExportsModules/TF-51D.lua +++ /dev/null @@ -1,534 +0,0 @@ --- TF-51D Export --- Version 0.9.9 BETA - -gES_FoundDCSModule = true - -gES_GlassCockpitConfigEveryFrameArguments = -{ - --[[ - every frames arguments - based of "mainpanel_init.lua" - Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) - [DeviceID] = "Format" - [4] = "%.4f", <- floating-point number with 4 digits after point - [19] = "%0.1f", <- floating-point number with 1 digit after point - [129] = "%1d", <- decimal number - ]] - -- Flight Instruments - [11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7} - [29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6} - -- Altimeter - [97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0} - [96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0} - [24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0} - [25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0} - -- Artificial horizon - [15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} - [14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} - [16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0} - [20] = "%.1f", -- AHorizon_Caged {0.0, 1.0} - -- directional gyro - [12] = "%.4f", -- GyroHeading - -- turn indicator - [27] = "%.4f", -- TurnNeedle {-1.0, 1.0} - [28] = "%.4f", -- Slipball {-1.0, 1.0} - -- oxygen pressure indicator - [34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} - [33] = "%.4f", -- Oxygen_Flow_Blinker - -- fuel system - [155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} - [156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} - [32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0} - -- A-11 clock - [4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0} - [5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0} - [6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0} - -- AN5730 remote compass - [1] = "%.4f", -- CompassHeading - [2] = "%.4f", -- CommandedCourse - [3] = "%.4f", -- CommandedCourseKnob - -- TailRadarWarning - [161] = "%.1f", -- Lamp TailRadarWarning - -- SCR-522A Control panel - [122] = "%.1f", -- A_channel_light - [123] = "%.1f", -- B_channel_light - [124] = "%.1f", -- C_channel_light - [125] = "%.1f", -- D_channel_light - [126] = "%.1f", -- Transmit_light - -- hydraulic pressure - [78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0} - -- Landing gears handle - [150] = "%.4f", -- Landing_Gear_Handle - [151] = "%.4f", -- Landing_Gear_Handle_Indoor - [80] = "%.1f", -- LandingGearGreenLight - [82] = "%.1f", -- LandingGearRedLight - -- gauges - [10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} - [23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} - [9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0} - [21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} - [22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1} - [30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0} - [31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0} - [164] = "%.1f", -- Left_Fluor_Light - [165] = "%.1f", -- Right_Fluor_Light - [59] = "%.1f", -- Hight_Blower_Lamp - -- Trimmer - [170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0} - [172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0} - [171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0} - [174] = "%.4f", -- Control_Lock_Bracket - [175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} - [177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} - [178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} - [101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} - -- light - [185] = "%.1f", -- Left_cockpit_light - [186] = "%.1f", -- Right_cockpit_light - [190] = "%.4f", -- warEmergencyPowerLimWire -} - -gES_GlassCockpitConfigArguments = -{ - --[[ - arguments for export in low tick interval - based on "clickabledata.lua" - ]] - -- Right Swich Panel - [102] = "%d", -- Generator Connect/Disconnect - [103] = "%d", -- Battery Connect/Disconnect - [104] = "%d", -- Gun Heating ON/OFF - [105] = "%d", -- Pitot Heating ON/OFF - [106] = "%d", -- Wing Position Lights Bright/Off/Dim - [107] = "%d", -- Tail Position Lights Bright/Off/Dim - [108] = "%d", -- Red Recognition Light Key/Off/Steady - [109] = "%d", -- Green Recognition Light Key/Off/Steady - [110] = "%d", -- Amber Recognition Light Key/Off/Steady - [111] = "%d", -- Recognition Lights Key - [112] = "%d", -- Circuit Protectors Reset - [100] = "%.4f", -- Right Fluorescent Light (rotary) - [90] = "%.4f", -- Left Fluorescent Light (rotary) - -- Flight Instrument panel - [3] = "%.4f", -- Course Set (rotary) - [13] = "%.4f", -- Heading Set/Cage (rotary) - [179] = "%d", -- Heading Set/Cage Button - [17] = "%.4f", -- Pitch Adjustment (rotary) - [18] = "%.4f", -- Cage (rotary) - [19] = "%d", -- Cage Button - [8] = "%d", -- Winding/Adjustment Clock Button - [7] = "%.4f", -- Winding/Adjustment Clock (rotary) - [26] = "%.4f", -- Set Pressure (rotary) - -- SCR-522A Control panel - [117] = "%d", -- Radio ON/OFF - [118] = "%d", -- A Channel Activate - [119] = "%d", -- B Channel Activate - [120] = "%d", -- C Channel Activate - [121] = "%d", -- D Channel Activate - [127] = "%.4f", -- Radio Lights Dimmer (rotary) - [116] = "%.4f", -- Radio Audio Volume (rotary) - [44] = "%d", -- Microphone On - [129] = "%d", -- Switch Locking Lever - [128] = "%d", -- Radio Mode Transmit/Receive/Remote - ------------- - [71] = "%.4f", -- Cockpit Lights (rotary) - [66] = "%0.1f", -- Ignition Off/Right/Left/Both - [67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On - [72] = "%d", -- Silence Landing Gear Warning Horn Cut Off - -- Bomb Arm/Chemical - [69] = "%d", -- Left Bomb Arm/Chemical - [70] = "%d", -- Right Bomb Arm/Chemical - -- Release Mode - [68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm - -- Engine Control Panel - [58] = "%d", -- Supercharger Switch Cover - [57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH - [60] = "%d", -- High Blower Lamp Test - [61] = "%d", -- Fuel Booster On/Off - [62] = "%d", -- Oil Dilute Activate - [63] = "%d", -- Starter Activate - [64] = "%d", -- Starter Switch Cover - [65] = "%d", -- Primer Activate - -- Oxygen Regulator - [131] = "%d", -- Auto-Mix On-Off - [130] = "%0.4f", -- Oxygen Emergency By-pass - -- Fuel system - [85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank - [86] = "%d", -- Fuel Shut-Off Valve ON/OFF - -- AN/APS-13 - [114] = "%d", -- ail Warning Radar Power ON/OFF - [115] = "%d", -- Tail Warning Radar Test - [113] = "%.4f", -- Tail Warning Radar Light Control (rotary) - ------------- - [79] = "%d", -- Hydraulic Release Knob - [94] = "%.4f", -- Flaps Control Handle (rotary) - [84] = "%d", -- Parking Brake Handle - [81] = "%d", -- Safe Landing Gear Light Test - [83] = "%d", -- Unsafe Landing Gear Light Test - -- Detrola receiver - [137] = "%.4f", -- Detrola Frequency Selector (rotary) - [138] = "%.4f", -- Detrola Volume (rotary) - -- canopy - [147] = "%.4f", -- Canopy Hand Crank (rotary) - [149] = "%d", -- Canopy Emergency Release Handle - -- AN/ARA-8 - [152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING - [153] = "%d", -- Homing Adapter Power On/Off - [154] = "%d", -- Homing Adapter's Circuit Breaker - -- SCR-695 - [139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6 - [140] = "%d", -- IFF Power On/Off - [141] = "%d", -- IFF TIME/OFF/ON - [142] = "%d", -- IFF Detonator Circuit On/Off - [143] = "%d", -- IFF Distress Signal On/Off - [145] = "%d", -- IFF Detonator Left - [146] = "%d", -- IFF Detonator Right - -- Trimmers - [91] = "%.4f", -- Aileron Trim (rotary) - [92] = "%.4f", -- Elevator Trim (rotary) - [93] = "%.4f", -- Rudder Trim (rotary) - ------------- - [157] = "%.4f", -- Defroster (rotary) - [158] = "%.4f", -- Cold Air (rotary) - [159] = "%.4f", -- Hot Air (rotary) - ------------- - [89] = "%d", -- Landing Light On/Off - [168] = "%d", -- Coolant Control Cover - [87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control - [169] = "%d", -- Oil Control Cover - [88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control - [134] = "%0.1f", -- Carburetor Cold Air Control (rotary) - [135] = "%0.1f", -- Carburetor Warm Air Control (rotary) - [47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH - [43] = "%.4f", -- Throttle (rotary) - [46] = "%.4f", -- Propeller RPM (rotary) - [173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position - [48] = "%.4f", -- Lock Throttle (rotary) - [49] = "%.4f", -- Lock Propeller & Mixture (rotary) - [176] = "%d", -- G-meter reset - [183] = "%d", -- Mirror - --Gunsight Selector - [41] = "%d", -- Sight On/Off - [39] = "%d", -- Fixed Reticle Mask Lever - [40] = "%0.1f", -- Sight Mode, Fixed Sight/Fixed-Gyro Sight/Gyro Sight - [42] = "%.1f", -- Gun Sight Brightness - [35] = "%.1f", -- Wing Span Selector - ------------- - [132] = "%.4f", -- Left Payload Salvo - [133] = "%.4f" -- Right Payload Salvo -} - ------------------------------ --- HIGH IMPORTANCE EXPORTS -- --- done every export event -- ------------------------------ - -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - --[[ - every frame export to GlassCockpit - Example from A-10C - Get Radio Frequencies - get data from device - local lUHFRadio = GetDevice(54) - SendData("ExportID", "Format") - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data - ]] - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 --- WriteToLog('in ProcessGlassCockpitDCSConfigHighImportance - HELIOS: '..t) - local MainPanel = GetDevice(0) - local AirspeedNeedle = MainPanel:get_argument_value(11)*1000 - local Altimeter_10000_footPtr = MainPanel:get_argument_value(96)*100000 - local Variometer = MainPanel:get_argument_value(29) - local TurnNeedle = MainPanel:get_argument_value(27) - local Slipball = MainPanel:get_argument_value(28) - local CompassHeading = MainPanel:get_argument_value(1) - local CommandedCourse = MainPanel:get_argument_value(2) - local Manifold_Pressure = MainPanel:get_argument_value(10) - local Engine_RPM = MainPanel:get_argument_value(23) - local AHorizon_Pitch = MainPanel:get_argument_value(15) - local AHorizon_Bank = MainPanel:get_argument_value(14) - local AHorizon_PitchShift = MainPanel:get_argument_value(16) * 10.0 * math.pi/180.0 - local AHorizon_Caged = MainPanel:get_argument_value(20) - local GyroHeading = MainPanel:get_argument_value(12) - local vaccum_suction = MainPanel:get_argument_value(9) - local carburator_temp = MainPanel:get_argument_value(21) - local coolant_temp = MainPanel:get_argument_value(22) - local Acelerometer = MainPanel:get_argument_value(175) - local OilTemperature = MainPanel:get_argument_value(30) - local OilPressure = MainPanel:get_argument_value(31) - local FuelPressure = MainPanel:get_argument_value(32) - local Clock_hours = MainPanel:get_argument_value(4) - local Clock_minutes = MainPanel:get_argument_value(5) - local Clock_seconds = MainPanel:get_argument_value(6) - local LandingGearGreenLight = MainPanel:get_argument_value(80) - local LandingGearRedLight = MainPanel:get_argument_value(82) - local Hight_Blower_Lamp = MainPanel:get_argument_value(59) - local Acelerometer_Min = MainPanel:get_argument_value(177) - local Acelerometer_Max = MainPanel:get_argument_value(178) - local Ammeter = MainPanel:get_argument_value(101) - local hydraulic_Pressure = MainPanel:get_argument_value(78) - local Oxygen_Flow_Blinker = MainPanel:get_argument_value(33) - local Oxygen_Pressure = MainPanel:get_argument_value(34) - local Fuel_Tank_Left = MainPanel:get_argument_value(155) - local Fuel_Tank_Right = MainPanel:get_argument_value(156) - local Fuel_Tank_Fuselage = MainPanel:get_argument_value(160) - local Tail_radar_warning = MainPanel:get_argument_value(161) - local Channel_A = MainPanel:get_argument_value(122) - local Channel_B = MainPanel:get_argument_value(123) - local Channel_C = MainPanel:get_argument_value(124) - local Channel_D = MainPanel:get_argument_value(125) - local transmit_light = MainPanel:get_argument_value(126) - local RocketCounter = MainPanel:get_argument_value(77) - - --- preparing landing gear and High Blower lights, all together, in only one value - local gear_lights = 0 - if LandingGearGreenLight > 0 then gear_lights = gear_lights +100 end - if LandingGearRedLight > 0 then gear_lights = gear_lights +10 end - if Hight_Blower_Lamp > 0 then gear_lights = gear_lights +1 end - ------------------------------------------------------------ - - --- preparing radio lights, all together, in only one value - local radio_active = 0 - if Channel_A > 0 then radio_active = 1 end - if Channel_B >0 then radio_active= 2 end - if Channel_C >0 then radio_active= 3 end - if Channel_D >0 then radio_active= 4 end - if transmit_light >0 then radio_active = radio_active + 10 end - ------------------------------------------------------------ - - - ---- sending P51 and tf51 data across fc2 interface - ----Please comment out the appropriate entries in the table 'gES_GlassCockpitConfigEveryFrameArguments'. - - SendData("1", string.format("%.5f", math.floor((AHorizon_Pitch+1)*1000) + ((AHorizon_Bank+1)/100) ) ) -- pitch - SendData("2", string.format("%.3f", math.floor(Oxygen_Flow_Blinker*100) + (Oxygen_Pressure/100) ) ) -- bank - SendData("3", string.format("%.4f", math.floor(OilTemperature*100) + (vaccum_suction/100) ) ) -- yaw - SendData("4", string.format("%.3f", math.floor(Altimeter_10000_footPtr) + (AHorizon_Caged/100) ) ) -- barometric altitude - SendData("5", string.format("%.5f", math.floor(Clock_hours*1000000) + (Tail_radar_warning/100) ) ) -- radar altitude - SendData("6", string.format("%.5f", math.floor(CompassHeading*1000) + (CommandedCourse/100) ) ) -- adf - SendData("7", string.format("%.4f", math.floor(Clock_seconds*100) + (hydraulic_Pressure/100) ) ) -- rmi - SendData("8", string.format("%.2f", math.floor(GyroHeading*1000) + (radio_active/100) ) ) -- heading - SendData("9", string.format("%.4f", math.floor(Engine_RPM*100) + (Manifold_Pressure/100) ) ) -- left rpm - SendData("10", string.format("%.4f", math.floor(Fuel_Tank_Left*100) + (Fuel_Tank_Right/100) ) ) -- right rpm - SendData("11", string.format("%.4f", math.floor(carburator_temp*100) + (coolant_temp/100) ) ) -- left temp - SendData("12", string.format("%.4f", math.floor(gear_lights) + (Acelerometer_Min/100 ) ) ) -- right temp - SendData("13", string.format("%.2f", Variometer) ) -- vvi - SendData("14", string.format("%.5f", math.floor(AirspeedNeedle)+ (RocketCounter/100) ) ) -- ias - SendData("15", string.format("%.4f", math.floor(OilPressure*100) + (FuelPressure/100) ) ) -- distance to way - SendData("16", string.format("%.3f", math.floor(Acelerometer*1000) + (Acelerometer_Max/100 ) ) ) -- aoa - SendData("17", string.format("%.4f", math.floor((TurnNeedle+1)*100) + ((Slipball+1)/100) ) ) -- glide - SendData("18", string.format("%.4f", math.floor(Fuel_Tank_Fuselage*100) + (Ammeter/100) ) ) -- side - - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 --- WriteToLog('in ProcessGlassCockpitDCSConfigHighImportance - HawgTouch: '..t) - -- ADI AN5736 - -- Artificial horizon - --[15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} - --[14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} - --[16] = "%.1f", -- AHorizon_PitchShift - --[20] = "%.1f", -- AHorizon_Caged - SendData(2000, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(15), - mainPanelDevice:get_argument_value(14))) - -- turn indicator AN5820 - --[27] = "%.4f", -- TurnNeedle {-1.0, 1.0} - --[28] = "%.4f", -- Slipball {-1.0, 1.0} - SendData(2001, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(27), - mainPanelDevice:get_argument_value(28))) - -- directional gyro AN5735 - --[12] = "%.1f", -- GyroHeading {0.0, 1.0} - -- Vacuum_Suction AN5771-5 - --[9] = "%.4f", -- Vacuum_Suction {0.0, 1.0} - -- F-2 Airspeed Indicator - -- [11] = "%.2f", -- AirspeedNeedle {0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700} {0.0, 0.05, 0.10, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7} - -- Altimeter AN5760-2 - --[96] = "%.1f", -- Altimeter_10000_footPtr {0.0, 1.0} - --[24] = "%.1f", -- Altimeter_1000_footPtr {0.0, 1.0} - --[25] = "%.1f", -- Altimeter_100_footPtr {0.0, 1.0} - --[97] = "%.1f", -- Altimeter_Pressure {28.1, 31.0} {0.0, 1.0} - SendData(2002, string.format("%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(96), - mainPanelDevice:get_argument_value(24), - mainPanelDevice:get_argument_value(25), - mainPanelDevice:get_argument_value(97))) - -- Rate of Climb Indicator AN5825 - --[29] = "%.1f", -- Variometer {0.0, 1.0} - -- D-10 Manifold Pressure Indicator - --[10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} - -- Tachometer - --[23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} - -- AN5790-6 Carburetor Air Temperature Indicator - --[21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} - -- Coolant Temperature Indicator - --[22] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} - -- Engine Gauge - --[30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0.0, 1.0} - --[31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0.0, 1.0} - --[32] = "%.1f", -- Fuel_Pressure {0.0, 25.0} -- PSI {0.0, 1.0} - SendData(2003, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(30), - mainPanelDevice:get_argument_value(31), - mainPanelDevice:get_argument_value(32))) - -- Remote Indicator Compass - -- AN5730 remote compass - --[1] = "%.4f", -- CompassHeading {0.0, 1.0} - --[2] = "%.4f", -- CommandedCourse {0.0, 1.0} - SendData(2004, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(1), - mainPanelDevice:get_argument_value(2))) - -- A-11 clock - --[4] = "%.4f", -- CLOCK_currtime_hours {0.0, 1.0} - --[5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 1.0} - --[6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 1.0} - SendData(2005, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(4), - mainPanelDevice:get_argument_value(5), - mainPanelDevice:get_argument_value(6))) - -- Oxygen Flow Indicator - --[33] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0} - -- Oxygen Pressure Gauge - --[34] = "%.1f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} - -- Hydraulic Pressure Gauge - --[78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} -- PSI {0.0, 1.0} - -- Fuel Gauges - -- Left Wing Main Tank - --[155] = "%.2f", -- Fuel_Tank_Left {0.0, 5.0, 15.0, 30.0, 45.0, 60.0, 75.0, 92.0} -- US GAL {0.0, 0.2, 0.36, 0.52, 0.65, 0.77, 0.92, 1.0} - -- Fuselage Tank - --[160] = "%.2f", -- Fuel_Tank_Fuselage {0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 85.0} -- US GAL {0.0, 0.12, 0.28, 0.40, 0.51, 0.62, 0.72, 0.83, 0.96, 1.0} - -- Right Wing Main Tank - --[156] = "%.2f", -- Fuel_Tank_Right {0.0, 5.0, 15.0, 30.0, 45.0, 60.0, 75.0, 92.0} -- US GAL {0.0, 0.2, 0.36, 0.52, 0.65, 0.77, 0.92, 1.0} - -- AN-5745 accelerometer indicator - --[175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} - --[177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} - --[178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} - SendData(2006, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(175), - mainPanelDevice:get_argument_value(177), - mainPanelDevice:get_argument_value(178))) - -- Landing Gear Warning Lights - --[80] = "%.1f", -- LandingGearGreenLight - --[82] = "%.1f", -- LandingGearRedLight - SendData(2007, string.format("%.1f;%.1f", - mainPanelDevice:get_argument_value(80), - mainPanelDevice:get_argument_value(82))) - -- AMMETER - --[101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} - end -end - -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) - --[[ - every frame export to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config - ]] - -- no dimming lights - -- TailRadarWarning - SendDataHW("161", mainPanelDevice:get_argument_value(161) > 0.3 and 1 or 0) -- Lamp TailRadarWarning - -- SCR-522A Control panel - SendDataHW("122", mainPanelDevice:get_argument_value(122) > 0.3 and 1 or 0) -- A_channel_light - SendDataHW("123", mainPanelDevice:get_argument_value(123) > 0.3 and 1 or 0) -- B_channel_light - SendDataHW("124", mainPanelDevice:get_argument_value(124) > 0.3 and 1 or 0) -- C_channel_light - SendDataHW("125", mainPanelDevice:get_argument_value(125) > 0.3 and 1 or 0) -- D_channel_light - SendDataHW("126", mainPanelDevice:get_argument_value(126) > 0.3 and 1 or 0) -- Transmit_light - -- Landing gears - SendDataHW("80", mainPanelDevice:get_argument_value(80) > 0.3 and 1 or 0) -- LandingGearGreenLight - SendDataHW("82", mainPanelDevice:get_argument_value(82) > 0.3 and 1 or 0) -- LandingGearRedLight - -- Engine - SendDataHW("59", mainPanelDevice:get_argument_value(59) > 0.3 and 1 or 0) -- Hight_Blower_Lamp - -- Cockpit Lights - SendDataHW("164", mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Left_Fluor_Light - SendDataHW("165", mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Right_Fluor_Light - SendDataHW("185", mainPanelDevice:get_argument_value(185) > 0.3 and 1 or 0) -- Left_cockpit_light - SendDataHW("186", mainPanelDevice:get_argument_value(186) > 0.3 and 1 or 0) -- Right_cockpit_light - - --[[ - -- dimming lights - -- TailRadarWarning - SendDataHW("161", string.format("%.1f", mainPanelDevice:get_argument_value(161))) -- Lamp TailRadarWarning - -- SCR-522A Control panel - SendDataHW("122", string.format("%.1f", mainPanelDevice:get_argument_value(122))) -- A_channel_light - SendDataHW("123", string.format("%.1f", mainPanelDevice:get_argument_value(123))) -- B_channel_light - SendDataHW("124", string.format("%.1f", mainPanelDevice:get_argument_value(124))) -- C_channel_light - SendDataHW("125", string.format("%.1f", mainPanelDevice:get_argument_value(125))) -- D_channel_light - SendDataHW("126", string.format("%.1f", mainPanelDevice:get_argument_value(126))) -- Transmit_light - -- Landing gears - SendDataHW("80", string.format("%.1f", mainPanelDevice:get_argument_value(80))) -- LandingGearGreenLight - SendDataHW("82", string.format("%.1f", mainPanelDevice:get_argument_value(82))) -- LandingGearRedLight - -- Engine - SendDataHW("59", string.format("%.1f", mainPanelDevice:get_argument_value(59))) -- Hight_Blower_Lamp - -- Cockpit Lights - SendDataHW("164", string.format("%.1f", mainPanelDevice:get_argument_value(164))) -- Left_Fluor_Light - SendDataHW("165", string.format("%.1f", mainPanelDevice:get_argument_value(165))) -- Right_Fluor_Light - SendDataHW("185", string.format("%.1f", mainPanelDevice:get_argument_value(185))) -- Left_cockpit_light - SendDataHW("186", string.format("%.1f", mainPanelDevice:get_argument_value(186))) -- Right_cockpit_light - ]] -end - ------------------------------------------------------ --- LOW IMPORTANCE EXPORTS -- --- done every gExportLowTickInterval export events -- ------------------------------------------------------ - -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - --[[ - export in low tick interval to GlassCockpit - Example from A-10C - Get Radio Frequencies - get data from device - local lUHFRadio = GetDevice(54) - SendData("ExportID", "Format") - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data - ]] - - --[[ - local lDETROLA = GetDevice(24) - WriteToLog('lDETROLA: '..dump(lDETROLA:is_on())) - WriteToLog('lDETROLA: '..dump(lDETROLA:get_frequency())) - --SendData(2000, string.format("%7.3f", lDETROLA:get_frequency()/1000000)) - - local lINTERCOM = GetDevice(31) - WriteToLog('lINTERCOM: '..dump(lINTERCOM:is_communicator_available())) - WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_noise_level())) - WriteToLog('lINTERCOM: '..dump(lINTERCOM:get_signal_level())) - ]] ---[[ - local ltmp1 = 0 - for ltmp2 = 1, 35, 1 do - ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end -]] -end - -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) ---[[ - export in low tick interval to hardware - Example from A-10C - Landing Gear - mainPanelDevice, basis panel - SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE - SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE - SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE - ]] - - --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - - local ltmp1 = 0 - for ltmp2 = 1, 10, 1 do - ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] -end diff --git a/Scripts/DCS-ExportScript/Config.lua b/Scripts/DCS-ExportScript/Config.lua new file mode 100644 index 0000000..fd964ff --- /dev/null +++ b/Scripts/DCS-ExportScript/Config.lua @@ -0,0 +1,43 @@ +-- Ikarus and D.A.C. Export Script +-- Version 1.0.0 BETA +-- +-- Config File +-- +-- Copyright by Michael aka McMicha 2014 +-- Contact dcs2arcaze.micha@farbpigmente.org + +ExportScript.Config = {} + +-- Ikarus a Glass Cockpit Software +ExportScript.Config.IkarusExport = true -- false for not use +ExportScript.Config.IkarusHost = "127.0.0.1" -- IP for Ikarus +ExportScript.Config.IkarusPort = 1625 -- Port Ikarus (1625) +ExportScript.Config.IkarusSeparator = ":" + +-- D.A.C. (DCS Arcaze Connector) +ExportScript.Config.DACExport = true -- false for not use +ExportScript.Config.DAC = {} +-- first hardware +ExportScript.Config.DAC[1] = {} +ExportScript.Config.DAC[1].Host = "127.0.0.1" -- IP for hardware 1 +ExportScript.Config.DAC[1].SendPort = 26026 -- Port for hardware 1 +ExportScript.Config.DAC[1].Separator = ":" +-- secound to n hardware +--ExportScript.Config.DAC[2] = {} +--ExportScript.Config.DAC[2].Host = "127.0.0.1" -- IP for hardware 2 +--ExportScript.Config.DAC[2].SendPort = 9092 -- Port for hardware 2 +--ExportScript.Config.DAC[2].Separator = ":" + +-- D.A.C. can data send +ExportScript.Config.DACListener = true -- false for not use +ExportScript.Config.DACListenerPort = 26027 -- Listener Port for D.A.C. + +-- Other +ExportScript.Config.ExportInterval = 0.1 +ExportScript.Config.ExportLowTickInterval = 1 +ExportScript.Config.LogPath = lfs.writedir()..[[Logs\Export.log]] +ExportScript.Config.ExportModulePath = lfs.writedir()..[[Scripts\DCS-ExportScript\ExportsModules\]] +ExportScript.Config.Debug = false +ExportScript.Config.FirstNewDataSend = true +ExportScript.Config.FirstNewDataSendCount = 5 +ExportScript.Config.genericRadioHardwareID = 1 \ No newline at end of file diff --git a/Scripts/DCS-ExportScript/ExportScript.lua b/Scripts/DCS-ExportScript/ExportScript.lua new file mode 100644 index 0000000..5936565 --- /dev/null +++ b/Scripts/DCS-ExportScript/ExportScript.lua @@ -0,0 +1,277 @@ +-- Ikarus and D.A.C. Export Script +-- Version 1.0.0 BETA +-- +-- Copyright by Michael aka McMicha 2014 +-- Contact dcs2arcaze.micha@farbpigmente.org + + +-- Main Table +ExportScript = {} +-- Simulation id +ExportScript.SimID = string.format("%08x*",os.time()) + +-- State data for export +ExportScript.PacketSize = 0 +ExportScript.SendStrings = {} +ExportScript.LastData = {} + +ExportScript.PacketSizeDAC = {} +ExportScript.SendStringsDAC = {} +ExportScript.LastDataDAC = {} + +dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]]) +dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Tools.lua]]) + +for i = 1, #ExportScript.Config.DAC, 1 do + ExportScript.PacketSizeDAC[i] = 0 + ExportScript.SendStringsDAC[i] = {} + ExportScript.LastDataDAC[i] = {} +end + +-- Frame counter for non important data +ExportScript.TickCount = 0 +ExportScript.TickCountDAC = 0 + +-- Found DCS or FC Module +ExportScript.FoundDCSModule = false +ExportScript.FoundFCModule = false +ExportScript.FoundNoModul = true + +--------------------------------------------- +-- DCS Export API Function Implementations -- +--------------------------------------------- + +function LuaExportStart() +-- Works once just before mission start. +-- (and before player selects their aircraft, if there is a choice!) + + -- 2) Setup udp sockets to talk to GlassCockpit + package.path = package.path..";.\\LuaSocket\\?.lua" + package.cpath = package.cpath..";.\\LuaSocket\\?.dll" + + ExportScript.socket = require("socket") + + ExportScript.UDPsender = ExportScript.socket.udp() + ExportScript.UDPsender:setsockname("*", 0) + ExportScript.UDPsender:setoption('broadcast', true) + ExportScript.UDPsender:settimeout(.001) -- set the timeout for reading the socket + + if ExportScript.Config.DACListener then + ExportScript.UDPListener = ExportScript.socket.udp() + ExportScript.UDPListener:setsockname("*", ExportScript.Config.DACListenerPort) + ExportScript.UDPListener:setoption('broadcast', true) + ExportScript.UDPListener:settimeout(.001) -- set the timeout for reading the socket + end + +-- local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old") + ExportScript.logFile = io.open(ExportScript.Config.LogPath, "w+") +-- if lrenmae1 == nil then +-- ExportScript.Tools.WriteToLog("Rename Error: "..lrename2) +-- end + + ExportScript.AF = {} -- Table for Auxiliary functions + ExportScript.AF.EventNumberOLD = 0 -- event number from previous event + + ExportScript.Tools.SelectModule() -- point globals to Module functions and data. +end + +function LuaExportBeforeNextFrame() + ExportScript.Tools.ProcessInput() +end + +function LuaExportAfterNextFrame() +end + +function LuaExportStop() +-- Works once just after mission stop. + ExportScript.Tools.SendDataDAC("DAC", "stop") + for i=1, #ExportScript.Config.DAC, 1 do + ExportScript.Tools.FlushDataDAC(i) + end + + ExportScript.Tools.SendData("Ikarus", "stop") + ExportScript.Tools.FlushData() + + ExportScript.UDPsender:close() + if ExportScript.Config.DACListener then + ExportScript.UDPListener:close() + end + + ExportScript.ModuleName = nil + ExportScript.FoundNoModul = false + + if ExportScript.logFile then + ExportScript.Tools.WriteToLog("====== Logfile close ======") + ExportScript.logFile:flush() + ExportScript.logFile:close() + ExportScript.logFile = nil + end +end + +function LuaExportActivityNextEvent(t) + t = t + ExportScript.Config.ExportInterval + local coStatus + + ExportScript.TickCount = ExportScript.TickCount + 1 + + local lMyInfo = LoGetSelfData() + if lMyInfo ~= nil then + if ExportScript.ModuleName ~= lMyInfo.Name then + ExportScript.Tools.SelectModule() -- point globals to Module functions and data. + end + lMyInfo = nil + end + + local lDevice = GetDevice(0) + if type(lDevice) == "table" and ExportScript.FoundDCSModule then + + lDevice:update_arguments() + + if ExportScript.Config.Debug then + ExportScript.Tools.ProcessArguments(lDevice, ExportScript.EveryFrameArguments) -- Module arguments as appropriate + else + ExportScript.coProcessArguments_EveryFrame = coroutine.create(ExportScript.Tools.ProcessArguments) + coStatus = coroutine.resume( ExportScript.coProcessArguments_EveryFrame, lDevice, ExportScript.EveryFrameArguments) + end + + if ExportScript.Config.IkarusExport then + if ExportScript.Config.Debug then + ExportScript.ProcessIkarusDCSHighImportance(lDevice) -- Module, as appropriate; determined in ExportScript.Tools.SelectModule() + else + ExportScript.coProcessIkarusDCSHighImportance = coroutine.create(ExportScript.ProcessIkarusDCSHighImportance) + coStatus = coroutine.resume( ExportScript.coProcessIkarusDCSHighImportance, lDevice) + end + end + + if ExportScript.Config.DACExport then + if ExportScript.Config.Debug then + ExportScript.ProcessDACHighImportance(lDevice) -- Module, as appropriate; determined in ExportScript.Tools.SelectModule() + else + ExportScript.coProcessDACHighImportance = coroutine.create(ExportScript.ProcessDACHighImportance) + coStatus = coroutine.resume( ExportScript.coProcessDACHighImportance, lDevice) + end + end + + if ExportScript.FirstNewDataSend and ExportScript.FirstNewDataSendCount == 0 then + if ExportScript.Config.DACExport then + ExportScript.Tools.ResetChangeValuesDAC() + end + if ExportScript.Config.IkarusExport then + ExportScript.Tools.ResetChangeValues() + end + ExportScript.FirstNewDataSend = false + else + ExportScript.FirstNewDataSendCount = ExportScript.FirstNewDataSendCount - 1 + end + + if ExportScript.TickCount >= ExportScript.Config.ExportLowTickInterval then + if ExportScript.Config.Debug then + ExportScript.Tools.ProcessArguments(lDevice, ExportScript.Arguments) -- Module arguments as appropriate + else + ExportScript.coProcessArguments_Arguments = coroutine.create(ExportScript.Tools.ProcessArguments) + coStatus = coroutine.resume( ExportScript.coProcessArguments_Arguments, lDevice, ExportScript.Arguments) + end + + if ExportScript.Config.IkarusExport then + if ExportScript.Config.Debug then + ExportScript.ProcessIkarusDCSLowImportance(lDevice) -- Module as appropriate; determined in ExportScript.Tools.SelectModule() + else + ExportScript.coProcessIkarusDCSLowImportance = coroutine.create(ExportScript.ProcessIkarusDCSLowImportance) + coStatus = coroutine.resume( ExportScript.coProcessIkarusDCSLowImportance, lDevice) + end + end + + if ExportScript.Config.DACExport then + if ExportScript.Config.Debug then + ExportScript.ProcessDACLowImportance(lDevice) -- Module, as appropriate; determined in ExportScript.Tools.SelectModule() + else + ExportScript.coProcessDACLowImportance = coroutine.create(ExportScript.ProcessDACLowImportance) + coStatus = coroutine.resume( ExportScript.coProcessDACLowImportance, lDevice) + end + ExportScript.TickCountDAC = ExportScript.TickCountDAC + 1 + end + ExportScript.TickCount = 0 + end + + if ExportScript.Config.IkarusExport then + ExportScript.Tools.FlushData() + end + + if ExportScript.Config.DACExport then + for i=1, #ExportScript.Config.DAC, 1 do + ExportScript.Tools.FlushDataDAC(i) + end + end + elseif ExportScript.FoundFCModule then -- Assume FC Aircraft + + ExportScript.AF.EventNumber = os.clock() --tonumber(tostring(os.clock()):gsub(".", "")) + + if ExportScript.Config.IkarusExport then + if ExportScript.Config.Debug then + ExportScript.ProcessIkarusFCHighImportance() + else + ExportScript.coProcessGlassCockpitFCHighImportance = coroutine.create(ExportScript.ProcessIkarusFCHighImportance) + coStatus = coroutine.resume( ExportScript.coProcessGlassCockpitFCHighImportance) + end + end + if ExportScript.Config.DACExport then + if ExportScript.Config.Debug then + ExportScript.ProcessDACHighImportance(lDevice) + else + ExportScript.coProcessDACHighImportance = coroutine.create(ExportScript.ProcessDACHighImportance) + coStatus = coroutine.resume( ExportScript.coProcessDACHighImportance, lDevice) + end + end + + if ExportScript.FirstNewDataSend and ExportScript.FirstNewDataSendCount == 0 then + if ExportScript.Config.DACExport then + ExportScript.Tools.ResetChangeValuesDAC() + end + if ExportScript.Config.IkarusExport then + ExportScript.Tools.ResetChangeValues() + end + ExportScript.FirstNewDataSend = false + else + ExportScript.FirstNewDataSendCount = ExportScript.FirstNewDataSendCount - 1 + end + + if ExportScript.TickCount >= ExportScript.Config.ExportLowTickInterval then + if ExportScript.Config.IkarusExport then + if ExportScript.Config.Debug then + ExportScript.ProcessIkarusFCLowImportance() + else + ExportScript.coProcessIkarusFCLowImportance = coroutine.create(ExportScript.ProcessIkarusFCLowImportance) + coStatus = coroutine.resume( ExportScript.coProcessIkarusFCLowImportance) + end + end + + if ExportScript.Config.DACExport then + if ExportScript.Config.Debug then + ExportScript.ProcessDACLowImportance(lDevice) + else + ExportScript.coProcessDACLowImportance = coroutine.create(ExportScript.ProcessDACLowImportance) + coStatus = coroutine.resume( ExportScript.coProcessDACLowImportance, lDevice) + end + ExportScript.TickCountDAC = ExportScript.TickCountDAC + 1 + end + ExportScript.TickCount = 0 + end + + if ExportScript.Config.IkarusExport then + ExportScript.Tools.FlushData() + end + + if ExportScript.Config.DACExport then + for i=1, #ExportScript.Config.DAC, 1 do + ExportScript.Tools.FlushDataDAC(i) + end + end + else -- No Module found + if ExportScript.FoundNoModul then + ExportScript.Tools.WriteToLog("No Module Found.") + ExportScript.Tools.SelectModule() -- point globals to Module functions and data. + end + end + + return t +end diff --git a/ExportsModules/A-10A.lua b/Scripts/DCS-ExportScript/ExportsModules/A-10A.lua similarity index 86% rename from ExportsModules/A-10A.lua rename to Scripts/DCS-ExportScript/ExportsModules/A-10A.lua index 31fc70d..9bc6d43 100644 --- a/ExportsModules/A-10A.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/A-10A.lua @@ -1,17 +1,17 @@ -- A-10A Export -- Version 0.9.9 BETA -gES_FoundFCModule = true +ExportScript.FoundFCModule = true -- auxiliary function -dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua") +dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") ----------------------------------------- -- FLAMING CLIFFS AIRCRAFT / A-10A -- -- FC aircraft don't support GetDevice -- ----------------------------------------- -function ProcessGlassCockpitFCHighImportanceConfig() +function ExportScript.ProcessIkarusFCHighImportanceConfig() local myData = LoGetSelfData() @@ -384,7 +384,7 @@ function ProcessGlassCockpitFCHighImportanceConfig() end end -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) +function ExportScript.ProcessDACHighImportance(mainPanelDevice) --[[ local lPayloadInfo = LoGetPayloadInfo() WriteToLog('lPayloadInfo: '..dump(lPayloadInfo)) @@ -424,7 +424,7 @@ function ProcessHARDWAREConfigHighImportance(mainPanelDevice) ]] end -function ProcessGlassCockpitFCLowImportanceConfig() +function ExportScript.ProcessIkarusFCLowImportanceConfig() local lEngineFuelInternal = LoGetEngineInfo().fuel_internal -- TANK1 (INT) (KG) local lEngineFuelExternal = LoGetEngineInfo().fuel_external -- TANK2 (EXT) (KG) @@ -489,7 +489,7 @@ function ProcessGlassCockpitFCLowImportanceConfig() -- Fuel Indicator end -- Weapon Panel - gES_PayloadInfo = LoGetPayloadInfo() + ExportScript.AF.PayloadInfo = LoGetPayloadInfo() --[[ ShellsCounter Station1 @@ -511,31 +511,31 @@ function ProcessGlassCockpitFCLowImportanceConfig() 1 2 3 4 5 6 7 8 9 10 11 1 3 5 7 9 11 10 8 6 4 2 -- Weapon Station ID ]] - gES_TmpWeaponPanelActive = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + ExportScript.AF.TmpWeaponPanelActive = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} for lIndex = 1, 11, 1 do - gES_TmpWeaponPanelActive[lIndex] = (gES_PayloadInfo.Stations[lIndex].count > 0 and 0.2 or 0.1) -- get status, empty or load + ExportScript.AF.TmpWeaponPanelActive[lIndex] = (ExportScript.AF.PayloadInfo.Stations[lIndex].count > 0 and 0.2 or 0.1) -- get status, empty or load end - if gES_PayloadInfo.CurrentStation > 0 then - gES_TmpWeaponPanelActive[gES_PayloadInfo.CurrentStation] = 0.3 -- currrent value + if ExportScript.AF.PayloadInfo.CurrentStation > 0 then + ExportScript.AF.TmpWeaponPanelActive[ExportScript.AF.PayloadInfo.CurrentStation] = 0.3 -- currrent value - table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit_A10A) -- corresponding station + table.foreach(ExportScript.AF.PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit_A10A) -- corresponding station end SendData(26, string.format("%d;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f", - gES_PayloadInfo.Cannon.shells, - gES_TmpWeaponPanelActive[1], - gES_TmpWeaponPanelActive[3], - gES_TmpWeaponPanelActive[5], - gES_TmpWeaponPanelActive[7], - gES_TmpWeaponPanelActive[9], - gES_TmpWeaponPanelActive[11], - gES_TmpWeaponPanelActive[10], - gES_TmpWeaponPanelActive[8], - gES_TmpWeaponPanelActive[6], - gES_TmpWeaponPanelActive[4], - gES_TmpWeaponPanelActive[2])) + ExportScript.AF.PayloadInfo.Cannon.shells, + ExportScript.AF.TmpWeaponPanelActive[1], + ExportScript.AF.TmpWeaponPanelActive[3], + ExportScript.AF.TmpWeaponPanelActive[5], + ExportScript.AF.TmpWeaponPanelActive[7], + ExportScript.AF.TmpWeaponPanelActive[9], + ExportScript.AF.TmpWeaponPanelActive[11], + ExportScript.AF.TmpWeaponPanelActive[10], + ExportScript.AF.TmpWeaponPanelActive[8], + ExportScript.AF.TmpWeaponPanelActive[6], + ExportScript.AF.TmpWeaponPanelActive[4], + ExportScript.AF.TmpWeaponPanelActive[2])) -- Wepaon Panel end -- UHF Gauges, no value @@ -543,23 +543,23 @@ function ProcessGlassCockpitFCLowImportanceConfig() end end -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) +function ExportScript.ProcessDACLowImportance(mainPanelDevice) -- where necessary, specify HardwareID, example SightingSystem(2) - SightingSystem() - FuelQuantityIndicator() - StatusLamp() - MechanicalDevicesIndicator() - FlareChaff() - WeaponStatusPanel() - RWRStatusPanel() - AOAIndicator() + ExportScript.AF.SightingSystem() + ExportScript.AF.FuelQuantityIndicator() + ExportScript.AF.StatusLamp() + ExportScript.AF.MechanicalDevicesIndicator() + ExportScript.AF.FlareChaff() + ExportScript.AF.WeaponStatusPanel() + ExportScript.AF.RWRStatusPanel() + ExportScript.AF.AOAIndicator() end ----------------------------- -- Custom functions -- ----------------------------- -function SightingSystem(hardware) +function ExportScript.AF.SightingSystem(hardware) local lHardware = hardware or 1 local lSightingSystemInfo = LoGetSightingSystemInfo() if lSightingSystemInfo == nil then @@ -609,7 +609,7 @@ function SightingSystem(hardware) --SendDataHW("604", lSightingSystemInfo.radar_on == true and 1 or 0, lHardware ) end -function FuelQuantityIndicator(hardware) +function ExportScript.AF.FuelQuantityIndicator(hardware) -- Fuel quantity shows the fuel remaining in all tanks local lHardware = hardware or 1 local lEngineInfo = LoGetEngineInfo() @@ -659,7 +659,7 @@ function FuelQuantityIndicator(hardware) ]] end -function StatusLamp(hardware) +function ExportScript.AF.StatusLamp(hardware) local lHardware = hardware or 1 local lMCPState = LoGetMCPState() -- Warning Lights if lMCPState == nil then @@ -734,7 +734,7 @@ function StatusLamp(hardware) end end -function FlareChaff(hardware) +function ExportScript.AF.FlareChaff(hardware) local lHardware = hardware or 1 local lSnares = LoGetSnares() -- Flare and Chaff if lSnares == nil then @@ -749,7 +749,7 @@ function FlareChaff(hardware) SendDataHW("801", lSnares.flare, lHardware ) end -function MechanicalDevicesIndicator(hardware) +function ExportScript.AF.MechanicalDevicesIndicator(hardware) -- The mechanical devices indicator shows the position of the landing gear, flaps, leading edge flaps and airbrake local lHardware = hardware or 1 local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,... @@ -855,7 +855,7 @@ function MechanicalDevicesIndicator(hardware) SendDataHW("533", ((lMechInfo.flaps.value > 0.93 and lGetTrueAirSpeed > 340) and 1 or 0), lHardware ) -- Speed Warning for Flaps, same light as gear warning light, but blinking light end -function RWRStatusPanel(hardware) +function ExportScript.AF.RWRStatusPanel(hardware) -- RWR Status Panel only local lHardware = hardware or 1 local lTWSInfo = LoGetTWSInfo() @@ -920,7 +920,7 @@ function RWRStatusPanel(hardware) SendDataHW("444", (lScanTmp and 1 or 0), lHardware ) end -function AOAIndicator(hardware) +function ExportScript.AF.AOAIndicator(hardware) -- AOA Indicator only local lHardware = hardware or 1 local lAoA = LoGetAngleOfAttack() @@ -946,14 +946,14 @@ function AOAIndicator(hardware) end end -function WeaponStatusPanel(hardware) +function ExportScript.AF.WeaponStatusPanel(hardware) -- The weapon status panel, quantity and readiness of the currently selected weapon and the remaining gun ammunition are indicated. local lHardware = hardware or 1 - gES_PayloadInfo = LoGetPayloadInfo() - if gES_PayloadInfo == nil then + ExportScript.AF.PayloadInfo = LoGetPayloadInfo() + if ExportScript.AF.PayloadInfo == nil then return end - --WriteToLog('gES_PayloadInfo: '..dump(gES_PayloadInfo)) + --WriteToLog('ExportScript.AF.PayloadInfo: '..dump(ExportScript.AF.PayloadInfo)) --[[ exsample [Stations] = { [1] = { @@ -1177,44 +1177,44 @@ function WeaponStatusPanel(hardware) ]] -- Payload Info -- weapon stations (panel) 1 (left) - 11 (right) reserved - SendDataHW("100", gES_PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells - SendDataHW("101", (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1) - SendDataHW("102", (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2) - SendDataHW("103", (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3) - SendDataHW("104", (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4) - SendDataHW("105", (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5) - SendDataHW("106", (gES_PayloadInfo.Stations[11].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6, center station) - SendDataHW("107", (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7) - SendDataHW("108", (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8) - SendDataHW("109", (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9) - SendDataHW("110", (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10) - SendDataHW("111", (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 11) + SendDataHW("100", ExportScript.AF.PayloadInfo.Cannon.shells, lHardware ) -- count cannon shells + SendDataHW("101", (ExportScript.AF.PayloadInfo.Stations[1].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1) + SendDataHW("102", (ExportScript.AF.PayloadInfo.Stations[3].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2) + SendDataHW("103", (ExportScript.AF.PayloadInfo.Stations[5].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3) + SendDataHW("104", (ExportScript.AF.PayloadInfo.Stations[7].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4) + SendDataHW("105", (ExportScript.AF.PayloadInfo.Stations[9].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5) + SendDataHW("106", (ExportScript.AF.PayloadInfo.Stations[11].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6, center station) + SendDataHW("107", (ExportScript.AF.PayloadInfo.Stations[10].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7) + SendDataHW("108", (ExportScript.AF.PayloadInfo.Stations[8].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8) + SendDataHW("109", (ExportScript.AF.PayloadInfo.Stations[6].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9) + SendDataHW("110", (ExportScript.AF.PayloadInfo.Stations[4].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10) + SendDataHW("111", (ExportScript.AF.PayloadInfo.Stations[2].count > 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 11) -- weapon stations (panel) 1 (left) - 11 (right) empty - SendDataHW("121", (gES_PayloadInfo.Stations[1].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1) - SendDataHW("122", (gES_PayloadInfo.Stations[3].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2) - SendDataHW("123", (gES_PayloadInfo.Stations[5].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3) - SendDataHW("124", (gES_PayloadInfo.Stations[7].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4) - SendDataHW("125", (gES_PayloadInfo.Stations[9].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5) - SendDataHW("126", (gES_PayloadInfo.Stations[11].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6, center station) - SendDataHW("127", (gES_PayloadInfo.Stations[10].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7) - SendDataHW("128", (gES_PayloadInfo.Stations[8].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8) - SendDataHW("129", (gES_PayloadInfo.Stations[6].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9) - SendDataHW("130", (gES_PayloadInfo.Stations[4].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10) - SendDataHW("131", (gES_PayloadInfo.Stations[2].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 11) - --SendDataHW("CurrentStation", gES_PayloadInfo.CurrentStation, lHardware ) + SendDataHW("121", (ExportScript.AF.PayloadInfo.Stations[1].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 1) + SendDataHW("122", (ExportScript.AF.PayloadInfo.Stations[3].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 2) + SendDataHW("123", (ExportScript.AF.PayloadInfo.Stations[5].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 3) + SendDataHW("124", (ExportScript.AF.PayloadInfo.Stations[7].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 4) + SendDataHW("125", (ExportScript.AF.PayloadInfo.Stations[9].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 5) + SendDataHW("126", (ExportScript.AF.PayloadInfo.Stations[11].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 6, center station) + SendDataHW("127", (ExportScript.AF.PayloadInfo.Stations[10].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 7) + SendDataHW("128", (ExportScript.AF.PayloadInfo.Stations[8].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 8) + SendDataHW("129", (ExportScript.AF.PayloadInfo.Stations[6].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 9) + SendDataHW("130", (ExportScript.AF.PayloadInfo.Stations[4].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 10) + SendDataHW("131", (ExportScript.AF.PayloadInfo.Stations[2].count == 0 and 1 or 0), lHardware ) -- weapon presend > 0 (panel 11) + --SendDataHW("CurrentStation", ExportScript.AF.PayloadInfo.CurrentStation, lHardware ) -- air-to-air missils panel 1 and 11, air combat modus, CurrentStation = 1, panel 1 and 11 on -- wenn die Waffenstationen gleichmässig belegt sind, hat bei Auswahl CurrentStation immer den Wert der linken Station -- bei ungleichmäßiger Belegung, hat CurrentStation immer den Wert der jeweiligen Station - -- Waffenbezeichnung als UUID, gES_PayloadInfo.Stations[X].CLSID + -- Waffenbezeichnung als UUID, ExportScript.AF.PayloadInfo.Stations[X].CLSID -- defination - if gES_CurrentStationTmp == nil then - gES_CurrentStationTmp = -1 + if ExportScript.AF.CurrentStationTmp == nil then + ExportScript.AF.CurrentStationTmp = -1 end - if gES_PayloadInfo.CurrentStation > 0 and - gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then - gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation + if ExportScript.AF.PayloadInfo.CurrentStation > 0 and + ExportScript.AF.CurrentStationTmp ~= ExportScript.AF.PayloadInfo.CurrentStation then + ExportScript.AF.CurrentStationTmp = ExportScript.AF.PayloadInfo.CurrentStation gTmpStationToPanel = {} gTmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201, CurrentID2 = 221, HardwareID = lHardware } -- left @@ -1232,30 +1232,30 @@ function WeaponStatusPanel(hardware) WeaponStatusPanel_Reset(201, 211, lHardware) WeaponStatusPanel_Reset(221, 231, lHardware) - SendDataHW(gTmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID, 1, lHardware) -- eigentliche Auswahl - --WriteToLog('aktiv: '..gTmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID) - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].container then - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].count > 1 then - SendDataHW(gTmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID2, 1, lHardware) -- eigentliche Auswahl - --WriteToLog('aktiv2: '..gTmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID2) + SendDataHW(gTmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID, 1, lHardware) -- eigentliche Auswahl + --WriteToLog('aktiv: '..gTmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID) + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].container then + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].count > 1 then + SendDataHW(gTmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID2, 1, lHardware) -- eigentliche Auswahl + --WriteToLog('aktiv2: '..gTmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID2) end end - table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen - elseif gES_PayloadInfo.CurrentStation == 0 and gES_CurrentStationTmp > 0 then + table.foreach(ExportScript.AF.PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStation) -- zugehörige Stationen + elseif ExportScript.AF.PayloadInfo.CurrentStation == 0 and ExportScript.AF.CurrentStationTmp > 0 then WeaponStatusPanel_Reset(201, 211, lHardware) WeaponStatusPanel_Reset(221, 231, lHardware) - gES_CurrentStationTmp = -1 + ExportScript.AF.CurrentStationTmp = -1 end end -- Helper functions function WeaponStatusPanel_selectCurrentPayloadStation(_index) - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].CLSID == gES_PayloadInfo.Stations[_index].CLSID and gES_PayloadInfo.CurrentStation ~= _index then + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].CLSID == ExportScript.AF.PayloadInfo.Stations[_index].CLSID and ExportScript.AF.PayloadInfo.CurrentStation ~= _index then SendDataHW(gTmpStationToPanel[_index].CurrentID, 1, gTmpStationToPanel[_index].HardwareID) --WriteToLog('aktiv3: '..gTmpStationToPanel[_index].CurrentID) - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].container then - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].count > 1 then + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].container then + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].count > 1 then SendDataHW(gTmpStationToPanel[_index].CurrentID2, 1, gTmpStationToPanel[_index].HardwareID) --WriteToLog('aktiv3: '..gTmpStationToPanel[_index].CurrentID2) end @@ -1271,7 +1271,7 @@ function WeaponStatusPanel_Reset(lMinId, lMaxID, lHardware) end function WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit_A10A(_index) - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].CLSID == gES_PayloadInfo.Stations[_index].CLSID and gES_PayloadInfo.CurrentStation ~= _index then - gES_TmpWeaponPanelActive[_index] = 0.3 + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].CLSID == ExportScript.AF.PayloadInfo.Stations[_index].CLSID and ExportScript.AF.PayloadInfo.CurrentStation ~= _index then + ExportScript.AF.TmpWeaponPanelActive[_index] = 0.3 end -end \ No newline at end of file +end diff --git a/ExportsModules/A-10C.lua b/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua similarity index 51% rename from ExportsModules/A-10C.lua rename to Scripts/DCS-ExportScript/ExportsModules/A-10C.lua index 0d3710c..cb39206 100644 --- a/ExportsModules/A-10C.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/A-10C.lua @@ -1,15 +1,30 @@ -- A-10C Export --- Version 0.9.9 BETA +-- Version 1.0.0 BETA -gES_FoundDCSModule = true +ExportScript.FoundDCSModule = true -gES_GlassCockpitConfigEveryFrameArguments = -{ +ExportScript.ConfigEveryFrameArguments = +{ + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] + -- AOA Gauges [4] = "%.4f", -- AOA + [55] = "%0.1f", -- AOA Power Flag + -- VVI [12] = "%.4f", -- Variometer (VVI) {-1.0, -0.5, -0.29, 0.29, 0.5, 1.0} {-6000, -2000, -1000, 1000, 2000, 6000} + -- APU [13] = "%.4f", -- APU RPM [14] = "%.4f", -- APU Temperature [15] = "%.4f", -- Accelerometer_main + -- ADI [17] = "%.4f", -- ADI Pitch [18] = "%.4f", -- ADI Bank [19] = "%0.1f", -- ADI Course Warning Flag @@ -20,6 +35,11 @@ gES_GlassCockpitConfigEveryFrameArguments = [25] = "%0.1f", -- ADI Attitude Warning Flag [26] = "%0.1f", -- ADI Glide-Slope Warning Flag [27] = "%.4f", -- ADI Glide-Slope Indicator + -- HSI + [28] = "%0.4f", -- HSI_range_counter_1000 + [29] = "%0.4f", -- HSI_range_counter_100 + [30] = "%0.4f", -- HSI_range_counter_10 + [31] = "%0.4f", -- HSI_range_counter_1 [32] = "%0.1f", -- HSI Range Flag [33] = "%.4f", -- HSI Bearing #1 [34] = "%.4f", -- HSI Heading @@ -29,13 +49,25 @@ gES_GlassCockpitConfigEveryFrameArguments = [41] = "%.4f", -- HSI Deviation [46] = "%0.1f", -- HSI Bearing Flag [47] = "%.4f", -- HSI Course Arrow + -- Airspeed [48] = "%.4f", -- Airspeed Needle [49] = "%.4f", -- Airspeed Dial - [55] = "%0.1f", -- AOA Power Flag + -- Altimeter + [51] = "%.4f", -- Altimeter_100_footPtr + [52] = "%.4f", -- Altimeter_10000_footCount + [53] = "%.4f", -- Altimeter_1000_footCount + [54] = "%.4f", -- Altimeter_100_footCount + [59] = "%.4f", -- pressure_setting_0 + [58] = "%.4f", -- pressure_setting_1 + [57] = "%.4f", -- pressure_setting_2 + [56] = "%.4f", -- pressure_setting_3 + [61] = "%.1f", -- AAU34_PNEU_flag + -- Stby Attitude Indicator [63] = "%.4f", -- Standby Attitude Indicator pitch [64] = "%.4f", -- Standby Attitude Indicator bank [65] = "%0.1f", -- Standby Attitude Indicator warning flag [715] = "%.4f", -- Standby Attitude Indicator manual pitch adjustment + -- Engine Gauges [70] = "%.4f", -- Left Engine Temperature [73] = "%.4f", -- Right Engine Temperature [76] = "%.4f", -- EngineLeftFanSpeed @@ -46,6 +78,7 @@ gES_GlassCockpitConfigEveryFrameArguments = [83] = "%.4f", -- Right Engine Oil Pressure [84] = "%.4f", -- EngineLeftFuelFlow [85] = "%.4f", -- EngineRightFuelFlow + -- Fuel Gauges [88] = "%.4f", -- Fuel Indicator, FuelQuantityLeft [89] = "%.4f", -- Fuel Indicator, FuelQuantityRight [90] = "%.4f", -- FuelQuantityCounterTenthOfThous @@ -53,99 +86,99 @@ gES_GlassCockpitConfigEveryFrameArguments = [92] = "%.4f", -- FuelQuantityCounterHundreds [129] = "%1d", -- PTR-LCP-EAC (EAC On/Off) -- Misc lamps - [178] = "%0.1f", -- L_AILERON_EMER_DISENGAGE - [179] = "%0.1f", -- R_AILERON_EMER_DISENGAGE - [181] = "%0.1f", -- L_ELEVATOR_EMER_DISENGAGE - [182] = "%0.1f", -- R_ELEVATOR_EMER_DISENGAGE - --STABILITY AUGMENTATION SYSTEM PANEL + [178] = "%.f", -- L_AILERON_EMER_DISENGAGE + [179] = "%.f", -- R_AILERON_EMER_DISENGAGE + [181] = "%.f", -- L_ELEVATOR_EMER_DISENGAGE + [182] = "%.f", -- R_ELEVATOR_EMER_DISENGAGE + -- STABILITY AUGMENTATION SYSTEM PANEL [185] = "%1d", -- PTR-SASP-YAW-SASENGAGE-L (Yaw SAS Engage left) [186] = "%1d", -- PTR-SASP-YAW-SASENGAGE-R (Yaw SAS Engage right) [187] = "%1d", -- PTR-SASP-PITCH-SASENGAGE-L (Pitch SAS Engage left) [188] = "%1d", -- PTR-SASP-PITCH-SASENGAGE-R (Pitch SAS Engage right) -- Misc lamps - [191] = "%0.1f", -- TAKE_OFF_TRIM - [215] = "%0.1f", -- L_ENG_FIRE - [216] = "%0.1f", -- APU_FIRE - [217] = "%0.1f", -- R_ENG_FIRE - [260] = "%0.1f", -- TACAN_test_light {0.0, 1.0} + [191] = "%.f", -- TAKE_OFF_TRIM + [215] = "%.f", -- L_ENG_FIRE + [216] = "%.f", -- APU_FIRE + [217] = "%.f", -- R_ENG_FIRE + [260] = "%.f", -- TACAN_test_light {0.0, 1.0} -- [269] = "%.4f", -- HARS_sync {-1.0, 1.0} [274] = "%.4f", -- OxygenVolume {0.0, 1.0} [281] = "%.4f", -- CabinPressAlt {0.0, 1.0} - --Light System Control Panel + -- Light System Control Panel [289] = "%1d", -- PTR-LGHTCP-ANTICOLLISION (Anticollision Lights) -- CMSC lamps - [372] = "%0.1f", -- CMSC_MissileLaunchIndicator {0.0, 1.0} - [373] = "%0.1f", -- CMSC_PriorityStatusIndicator {0.0, 1.0} - [374] = "%0.1f", -- CMSC_UnknownStatusIndicator {0.0, 1.0} - -- Master Warning Lamp UFCP - [404] = "%0.1f", -- MASTER_WARNING_STUB MASTER WARNING - -- Caution Panel LAMPS - [480] = "%0.1f", -- ENG_START_CYCLE - [481] = "%0.1f", -- L_HYD_PRESS - [482] = "%0.1f", -- R_HYD_PRESS - [483] = "%0.1f", -- GUN_UNSAFE - [484] = "%0.1f", -- ANTISKID - [485] = "%0.1f", -- L_HYD_RES - [486] = "%0.1f", -- R_HYD_RES - [487] = "%0.1f", -- OXY_LOW - [488] = "%0.1f", -- ELEV_DISENG - [489] = "%0.1f", -- VOID1 - [490] = "%0.1f", -- SEAT_NOT_ARMED - [491] = "%0.1f", -- BLEED_AIR_LEAK - [492] = "%0.1f", -- AIL_DISENG - [493] = "%0.1f", -- L_AIL_TAB - [494] = "%0.1f", -- R_AIL_TAB - [495] = "%0.1f", -- SERVICE_AIR_HOT - [496] = "%0.1f", -- PITCH_SAS - [497] = "%0.1f", -- L_ENG_HOT - [498] = "%0.1f", -- R_ENG_HOT - [499] = "%0.1f", -- WINDSHIELD_HOT - [500] = "%0.1f", -- YAW_SAS - [501] = "%0.1f", -- L_ENG_OIL_PRESS - [502] = "%0.1f", -- R_ENG_OIL_PRESS - [503] = "%0.1f", -- CICU - [504] = "%0.1f", -- GCAS - [505] = "%0.1f", -- L_MAIN_PUMP - [506] = "%0.1f", -- R_MAIN_PUMP - [507] = "%0.1f", -- VOID2 - [508] = "%0.1f", -- LASTE - [509] = "%0.1f", -- L_WING_PUMP - [510] = "%0.1f", -- R_WING_PUMP - [511] = "%0.1f", -- HARS - [512] = "%0.1f", -- IFF_MODE_4 - [513] = "%0.1f", -- L_MAIN_FUEL_LOW - [514] = "%0.1f", -- R_MAIN_FUEL_LOW - [515] = "%0.1f", -- L_R_TKS_UNEQUAL - [516] = "%0.1f", -- EAC - [517] = "%0.1f", -- L_FUEL_PRESS - [518] = "%0.1f", -- R_FUEL_PRESS - [519] = "%0.1f", -- NAV - [520] = "%0.1f", -- STALL_SYS - [521] = "%0.1f", -- L_CONV - [522] = "%0.1f", -- R_CONV - [523] = "%0.1f", -- CADC - [524] = "%0.1f", -- APU_GEN - [525] = "%0.1f", -- L_GEN - [526] = "%0.1f", -- R_GEN - [527] = "%0.1f", -- INST_INV + [372] = "%.f", -- CMSC_MissileLaunchIndicator {0.0, 1.0} + [373] = "%.f", -- CMSC_PriorityStatusIndicator {0.0, 1.0} + [374] = "%.f", -- CMSC_UnknownStatusIndicator {0.0, 1.0} + -- Master Warning Lamp UFCP + [404] = "%.f", -- MASTER_WARNING_STUB MASTER WARNING + -- Caution Panel LAMPS + [480] = "%.f", -- ENG_START_CYCLE + [481] = "%.f", -- L_HYD_PRESS + [482] = "%.f", -- R_HYD_PRESS + [483] = "%.f", -- GUN_UNSAFE + [484] = "%.f", -- ANTISKID + [485] = "%.f", -- L_HYD_RES + [486] = "%.f", -- R_HYD_RES + [487] = "%.f", -- OXY_LOW + [488] = "%.f", -- ELEV_DISENG + [489] = "%.f", -- VOID1 + [490] = "%.f", -- SEAT_NOT_ARMED + [491] = "%.f", -- BLEED_AIR_LEAK + [492] = "%.f", -- AIL_DISENG + [493] = "%.f", -- L_AIL_TAB + [494] = "%.f", -- R_AIL_TAB + [495] = "%.f", -- SERVICE_AIR_HOT + [496] = "%.f", -- PITCH_SAS + [497] = "%.f", -- L_ENG_HOT + [498] = "%.f", -- R_ENG_HOT + [499] = "%.f", -- WINDSHIELD_HOT + [500] = "%.f", -- YAW_SAS + [501] = "%.f", -- L_ENG_OIL_PRESS + [502] = "%.f", -- R_ENG_OIL_PRESS + [503] = "%.f", -- CICU + [504] = "%.f", -- GCAS + [505] = "%.f", -- L_MAIN_PUMP + [506] = "%.f", -- R_MAIN_PUMP + [507] = "%.f", -- VOID2 + [508] = "%.f", -- LASTE + [509] = "%.f", -- L_WING_PUMP + [510] = "%.f", -- R_WING_PUMP + [511] = "%.f", -- HARS + [512] = "%.f", -- IFF_MODE_4 + [513] = "%.f", -- L_MAIN_FUEL_LOW + [514] = "%.f", -- R_MAIN_FUEL_LOW + [515] = "%.f", -- L_R_TKS_UNEQUAL + [516] = "%.f", -- EAC + [517] = "%.f", -- L_FUEL_PRESS + [518] = "%.f", -- R_FUEL_PRESS + [519] = "%.f", -- NAV + [520] = "%.f", -- STALL_SYS + [521] = "%.f", -- L_CONV + [522] = "%.f", -- R_CONV + [523] = "%.f", -- CADC + [524] = "%.f", -- APU_GEN + [525] = "%.f", -- L_GEN + [526] = "%.f", -- R_GEN + [527] = "%.f", -- INST_INV -- Angle of attack indicator [540] = "%0.1f", -- AOA_INDEXER_HIGH - [541] = "%0.1f", -- AOA_INDEXER_NORM + [541] = "%0.4f", -- AOA_INDEXER_NORM [542] = "%0.1f", -- AOA_INDEXER_LOW -- Misc Data [600] = "%0.1f", -- BreathFlow {0.0, 1.0} [604] = "%.4f", -- OxygenPress {0.0, 0.5, 1.0} -- NMSP Panel lamps - [606] = "%0.1f", -- HARS - [608] = "%0.1f", -- EGI - [610] = "%0.1f", -- TISL - [612] = "%0.1f", -- STRPT - [614] = "%0.1f", -- ANCHR - [616] = "%0.1f", -- TCN - [618] = "%0.1f", -- ILS - [619] = "%0.1f", -- UHF - [620] = "%0.1f", -- FM + [606] = "%.f", -- HARS + [608] = "%.f", -- EGI + [610] = "%.f", -- TISL + [612] = "%.f", -- STRPT + [614] = "%.f", -- ANCHR + [616] = "%.f", -- TCN + [618] = "%.f", -- ILS + [619] = "%.f", -- UHF + [620] = "%.f", -- FM -- Hydraulic Pressure [647] = "%.4f", -- HydraulicPressureLeft {0.0,1.0} [648] = "%.4f", -- HydraulicPressureRight {0.0,1.0} @@ -154,21 +187,21 @@ gES_GlassCockpitConfigEveryFrameArguments = -- CPT MECH [654] = "%1d", -- PTR-ANTI-SKID (Anti Skid) -- Landing Gear Lamps - [659] = "%0.1f", -- GEAR_N_SAFE - [660] = "%0.1f", -- GEAR_L_SAFE - [661] = "%0.1f", -- GEAR_R_SAFE + [659] = "%.f", -- GEAR_N_SAFE + [660] = "%.f", -- GEAR_L_SAFE + [661] = "%.f", -- GEAR_R_SAFE -- Misc lamps - [662] = "%0.1f", -- GUN_READY - [663] = "%0.1f", -- NOSEWHEEL_STEERING - [664] = "%0.1f", -- MARKER_BEACON - [665] = "%0.1f", -- CANOPY_UNLOCKED - [730] = "%0.1f", -- AIR_REFUEL_READY - [731] = "%0.1f", -- AIR_REFUEL_LATCHED - [732] = "%0.1f", -- AIR_REFUEL_DISCONNECT - [737] = "%0.1f", -- HANDLE_GEAR_WARNING + [662] = "%.f", -- GUN_READY + [663] = "%.f", -- NOSEWHEEL_STEERING + [664] = "%.f", -- MARKER_BEACON + [665] = "%.f", -- CANOPY_UNLOCKED + [730] = "%.f", -- AIR_REFUEL_READY + [731] = "%.f", -- AIR_REFUEL_LATCHED + [732] = "%.f", -- AIR_REFUEL_DISCONNECT + [737] = "%.f", -- HANDLE_GEAR_WARNING -- IFF Panel lamps - [798] = "%0.1f", -- IFF_reply_lamp {0, 1} - [799] = "%0.1f", -- IFF_test_lamp {0, 1} + [798] = "%.f", -- IFF_reply_lamp {0, 1} + [799] = "%.f", -- IFF_test_lamp {0, 1} -- [902] = "%.4f", -- Accelerometer_min [903] = "%.4f", -- Accelerometer_max @@ -177,12 +210,16 @@ gES_GlassCockpitConfigEveryFrameArguments = [720] = "%.4f", -- pitch [721] = "%.4f", -- bank } -gES_GlassCockpitConfigArguments = +ExportScript.ConfigArguments = { + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] [22] = "%.3f", -- AAP ?? -- Emergency Jettison Button [101] = "%.1f", -- PTR-EXT-STORES-JETT (mergency Jettison External Stores) - --Fire Extinguishers Panel + -- Fire Extinguishers Panel [102] = "%1d", -- PTR-FIRE-LENG-PULL (Left Engine Fire T-Handle) [103] = "%1d", -- PTR-FIRE-APU-PULL (APU Fire T-Handle) [104] = "%1d", -- PTR-FIRE-RENG-PULL (Right Engine Fire T-Handle) @@ -255,7 +292,7 @@ gES_GlassCockpitConfigArguments = [173] = "%.1f", -- PTR-ANARC164-STATUS (Status) [734] = "%1d", -- PTR-ANARC164-COVER [735] = "%.1f", -- PTR-ANARC164-LOAD (Load button) - --Emergency Flight Control Panel + -- Emergency Flight Control Panel [174] = "%1d", -- PTR-EFCP-SPDBK-EMER-RETR (Speed Brake Emergency Retract) [175] = "%1d", -- Speed Brake Emergency Retract (Pitch/Roll Trim Norm/Emergency Override) [176] = "%0.1f", -- PTR-EFCP-TRIM (Trim Emergency ...) @@ -263,20 +300,20 @@ gES_GlassCockpitConfigArguments = [180] = "%1d", -- PTR-EFCP-ELEVATOR-EMER-DISENGAGE (Elevator Emergency Disengage) [183] = "%1d", -- PTR-EFCP-FLAP-EMER-RETR (Flaps Emergency Retract) [184] = "%1d", -- PTR-EFCP-MRFCS (Manual Reversion Flight Control System (MRFCS)) - --STABILITY AUGMENTATION SYSTEM PANEL + -- STABILITY AUGMENTATION SYSTEM PANEL [189] = "%1d", -- PTR-SASP-MONITOR-TEST (Monitor Test Left/Right) [190] = "%.1f", -- PTR-SASP-TO-TRIM (Set Takeoff Trim) [192] = "%.3f", -- PTR-SASP-YAW-TRIM (Yaw Trim) - --Light System Control Panel + -- Light System Control Panel [193] = "%.3f", -- PTR-ALCP-RSIL (Refuel Status Indexer Lights) [194] = "%0.1f", -- PTR-ALCP-NVIS-LTS (Nightvision Lights) [195] = "%.3f", -- PTR-ALCP-WPNSTA (Weapon Station Lights. No function) [196] = "%1d", -- PTR-ALCP-HARSSAS (HARS-SAS Override/NORM) -- ALCP [197] = "%.1f", -- "PTR-ALCP-SIGLIGHTS-LAMP-TEST (Test Cockpit Indication Lights) - --Light System Control Panel + -- Light System Control Panel [198] = "%.1f", -- PTR-ALCP-FDBAL-TEST (Fire Detect Bleed Air Test) - --IFF + -- IFF [199] = "%0.1f", -- PTR-IFFCP-CODE (Code) [200] = "%0.1f", -- PTR-IFFCP-MASTER (Master) [201] = "%1d", -- PTR-IFFCP-OUT-AUDIO-LIGHT (Audio/light) @@ -293,7 +330,7 @@ gES_GlassCockpitConfigArguments = [212] = "%0.2f", -- PTR-IFFCP-MODE3A-WHEEL2 (MODE3A-WHEEL2) [213] = "%0.2f", -- PTR-IFFCP-MODE3A-WHEEL3 (MODE3A-WHEEL3) [214] = "%0.2f", -- PTR-IFFCP-MODE3A-WHEEL4 (MODE3A-WHEEL4) - --Inercom Panel + -- Inercom Panel [221] = "%.3f", -- PTR-INTERCOM-INT (INT Switch) [222] = "%1d", -- PTR-INTERCOM-INT (INT Switch) [223] = "%.3f", -- PTR-INTERCOM-FM (FM Switch) @@ -314,27 +351,30 @@ gES_GlassCockpitConfigArguments = [238] = "%.3f", -- PTR-INTERCOM-VOL (Intercom volume) [239] = "%0.1f", -- PTR-INTERCOM-MODE (Selector switch) [240] = "%.1f", -- PTR-INTERCOM-CALL (Call button) - --Electrical Power Panel + -- Electrical Power Panel [241] = "%1d", -- PTR-EPP-APU-GEN-PWR (APU Generator On/Off) [242] = "%1d", -- PTR-EPP-INVERTER (Inverter Switch) [243] = "%1d", -- PTR-EPP-EMER-FLOOD (Emergency Flood Light) [244] = "%1d", -- PTR-EPP-AC-GEN-PWR-L (Left AC Generator Power) [245] = "%1d", -- PTR-EPP-AC-GEN-PWR-R (Right AC Generator Power) [246] = "%1d", -- PTR-EPP-BATTERY-PWR (Battery Power) - --ILS + -- ILS [247] = "%1d", -- PTR-ILSCP-PWR (ILS Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value) [248] = "%0.1f", -- PTR-ILSCP-PWR (ILS Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value) [249] = "%.3f", -- PTR-ILSCP-VOL (ILS Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click and hold while moving mouse to adjust volumeILS Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click and hold while moving mouse to adjust) [250] = "%0.1f", -- PTR-ILSCP-VOL (ILS Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click and hold while moving mouse to adjust volumeILS Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click and hold while moving mouse to adjust) [251] = "%0.1f", -- ILS_window_wheel_MHz [252] = "%0.1f", -- ILS_window_wheel_KHz - --TACAN + -- TACAN [258] = "%0.2f", -- PTR-TACAN-CHANNEL-SELECTOR-2 (Channel Selector (Ones) / X/Y Mode. Right mouse click to select X/Y. Rotate mouse wheel to make channel selection) [259] = "%.1f", -- PTR-TACAN-TEST (Test TACAN Signal on HSI) [261] = "%.3f", -- PTR-TACAN-VOL (Signal Volume) [262] = "%0.1f", -- PTR-TACAN-MODE (Mode Dial) [266] = "%1d", -- XYwheel - --HARS + [263] = "%.1f", -- TACAN_digit_pos.hundreds + [264] = "%.1f", -- TACAN_digit_pos.tens + [265] = "%.1f", -- TACAN_digit_pos.ones + -- HARS [267] = "%.1f", -- PTR-HARS-CP-PUSH-TO-SYNC (HARS Push-To-Sync) [268] = "%.3f", -- PTR-HARS-CP-PUSH-TO-SYNC (HARS Push-To-Sync) [270] = "%1d", -- PTR-HARS-CP-SLAVE (HARS SLAVE-DG mode) @@ -342,7 +382,7 @@ gES_GlassCockpitConfigArguments = [272] = "%1d", -- PTR-HARS-CP-MAG-VAR (HARS MAG VAR) [273] = "%1d", -- PTR-HARS-CP-N-S (HARS N/S toggle switch) [711] = "%.1f", -- PTR-HARS-FAST-ERECT (HARS Fast Erect) - --Environment Control Panel + -- Environment Control Panel [275] = "%.1f", -- PTR-ENVCP-OXY-TEST (Oxygen Indicator Test) [276] = "%1d", -- PTR-ENVCP-WINDSHIELD-DEFOG (Windshield Defog/Deice) [277] = "%.3f", -- PTR-ENVCP-CANOPY-DEFOG (Canopy Defog) @@ -352,7 +392,7 @@ gES_GlassCockpitConfigArguments = [282] = "%1d", -- PTR-ENVCP-TEMP-PRESS (Temperature/Pressure Control) [283] = "%1d", -- PTR-ENVCP-MAIN-AIR-SUPPLY (Main Air Supply) [284] = "%.3f", -- PTR-ENVCP-FLOW-LEVEL (Flow Level Control) - --Light System Control Panel + -- Light System Control Panel [287] = "%1d", -- PTR-LGHTCP-POSITION (Position Lights, FLASH/OFF/STEADY) [288] = "%.3f", -- PTR-LGHTCP-FORMATION (Formation Lights) [290] = "%.3f", -- PTR-LGHTCP-ENG-INST (Engine Instruments Lights) @@ -548,7 +588,7 @@ gES_GlassCockpitConfigArguments = [531] = "%.1f", -- PNT-BTN-UFC-FWD [532] = "%.1f", -- PNT-BTN-UFC-MID [533] = "%.1f", -- PNT-BTN-UFC-AFT - --Oxygen System Control Panel + -- Oxygen System Control Panel [601] = "%1d", -- PTR-OXYGENCP-EMERGENCY (Oxygen Flow Emergency/Normal/Test Mask) [602] = "%1d", -- PTR-OXYGENCP-OXYGEN-DILUTER (Oxygen Normal/100%) [603] = "%1d", -- PTR-OXYGENCP-SUPPLY (Oxygen Supply On/Off) @@ -561,7 +601,7 @@ gES_GlassCockpitConfigArguments = [615] = "%.1f", -- PTR-NMSP-TCN (TCN Mode) [617] = "%.1f", -- PTR-NMSP-ILS (ILS Mode) [621] = "%1d", -- PTR-NMSP-ABLE-STOW (ABLE-STOW ADI Localizer Bar) - --TISL Control Panel + -- TISL Control Panel [622] = "%0.1f", -- PTR-TISLCP-MODE (TISL Mode) [623] = "%1d", -- PTR-TISLCP-SLANT-RNG (Slant range) [624] = "%.3f", -- PTR-TISLCP-ALT-ABV-TGT-WH1 (Altitude above target tens of thousands of feet) @@ -576,15 +616,15 @@ gES_GlassCockpitConfigArguments = [642] = "%0.2f", -- PTR-TISLCP-CODE-WH4 (TISL Code wheel 4) [644] = "%1d", -- PTR-TISLCP-TISL-AUX (TISL AUX) -- Fuel System Control Panel - --Fuel Quantity Indicator and Selector + -- Fuel Quantity Indicator and Selector [645] = "%0.1f", -- PTR-FQIS-SELECT (Fuel display selector) [646] = "%.1f", -- PTR-FQIS-TEST (Fuel Gauge Test) -- CPT MECH [651] = "%.1f", -- PTR-DOWNLOCK-OVERRIDE (Downlock Override) [716] = "%1d", -- PNT-LNDGEAR (Landing Gear Lever) - --Light System Control Panel + -- Light System Control Panel [655] = "%0.1f", -- PTR-LIGHTS-LAND (Land Taxi Lights) - --STALL + -- STALL [704] = "%.3f", -- PTR-STALLWCP-STALL (Stall Volume) [705] = "%.3f", -- PTR-STALLWCP-PEAK (Peak Volume) -- Canopy @@ -611,326 +651,17 @@ gES_GlassCockpitConfigArguments = -- done every export event -- ----------------------------- --- Pointed to by ProcessGlassCockpitDCSHighImportance, if the player aircraft is an A-10 -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - -- Send Altimeter Values - SendData(2051, string.format("%0.4f;%0.4f;%0.5f", - mainPanelDevice:get_argument_value(52), - mainPanelDevice:get_argument_value(53), - mainPanelDevice:get_argument_value(51))) - -- Barometric Pressure Setting - SendData(2059, string.format("%0.2f;%0.2f;%0.2f;%0.3f", - mainPanelDevice:get_argument_value(56), - mainPanelDevice:get_argument_value(57), - mainPanelDevice:get_argument_value(58), - mainPanelDevice:get_argument_value(59))) - -- Calcuate HSI Value - SendData(2029, string.format("%0.2f;%0.2f;%0.4f", - mainPanelDevice:get_argument_value(29), - mainPanelDevice:get_argument_value(30), - mainPanelDevice:get_argument_value(31))) - -- Calculate Total Fuel - SendData(2090, string.format("%0.2f;%0.2f;%0.5f", - mainPanelDevice:get_argument_value(90), - mainPanelDevice:get_argument_value(91), - mainPanelDevice:get_argument_value(92))) - - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - - -- FuelGauge - -- [90] = "%.4f", -- FuelQuantityCounterTenthOfThous - -- [91] = "%.4f", -- FuelQuantityCounterThousands - -- [92] = "%.4f", -- FuelQuantityCounterHundreds - -- [88] = "%.4f", -- Fuel Indicator, FuelQuantityLeft - -- [89] = "%.4f", -- Fuel Indicator, FuelQuantityRight - SendData(2000, string.format("%0.2f;%0.2f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(90), - mainPanelDevice:get_argument_value(91), - mainPanelDevice:get_argument_value(92), - mainPanelDevice:get_argument_value(88), - mainPanelDevice:get_argument_value(89))) - - -- HSI - --[[ - [34] = "%.4f", -- HSI Heading - [33] = "%.4f", -- HSI Bearing #1 - [35] = "%.4f", -- HSI Bearing #2 - [36] = "%.4f", -- HSI Heading Marker - [47] = "%.4f", -- HSI Course Arrow - [41] = "%.4f", -- HSI Deviation - [29] = "%.2f", -- HSI range_counter_100 - [30] = "%.2f", -- HSI range_counter_10 - [31] = "%.2f", -- HSI range_counter_1 - [42] = "%0.1f", -- HSI Bearing to_from_1 - [43] = "%0.1f", -- HSI Bearing to_from_2 - [46] = "%0.1f", -- HSI Bearing Flag - [40] = "%0.1f", -- HSI Power Flag - [32] = "%0.1f", -- HSI Range Flag - ]] - SendData(2001, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.2f;%0.2f;%0.2f;%0.1f;%0.1f;%0.1f;%0.1f;%0.1f", - mainPanelDevice:get_argument_value(34), - mainPanelDevice:get_argument_value(33), - mainPanelDevice:get_argument_value(35), - mainPanelDevice:get_argument_value(36), - mainPanelDevice:get_argument_value(47), - mainPanelDevice:get_argument_value(41), - mainPanelDevice:get_argument_value(29), - mainPanelDevice:get_argument_value(30), - mainPanelDevice:get_argument_value(31), - mainPanelDevice:get_argument_value(42), - mainPanelDevice:get_argument_value(43), - mainPanelDevice:get_argument_value(46), - mainPanelDevice:get_argument_value(40), - mainPanelDevice:get_argument_value(32))) - -- Altimeter - -- [51] = "%.4f", -- Altimeter_100_footPtr - -- [52] = "%.4f", -- Altimeter_10000_footCount - -- [53] = "%.4f", -- Altimeter_1000_footCount - -- [54] = "%.4f", -- Altimeter_100_footCount - -- [59] = "%.4f", -- pressure_setting_0 - -- [58] = "%.4f", -- pressure_setting_1 - -- [57] = "%.4f", -- pressure_setting_2 - -- [56] = "%.4f", -- pressure_setting_3 - SendData(2002, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(51), - mainPanelDevice:get_argument_value(52), - mainPanelDevice:get_argument_value(53), - mainPanelDevice:get_argument_value(54), - mainPanelDevice:get_argument_value(59), - mainPanelDevice:get_argument_value(58), - mainPanelDevice:get_argument_value(57), - mainPanelDevice:get_argument_value(56))) - -- ADI - --[[ - [17] = "%.4f", -- ADI Pitch - [18] = "%.4f", -- ADI Bank - [24] = "%.4f", -- ADI Slip Ball - [20] = "%.4f", -- ADI Bank Steering Bar - [21] = "%.4f", -- ADI Pitch Steering Bar - [23] = "%.4f", -- ADI Turn Needle - [27] = "%.4f", -- ADI Glide-Slope Indicator - [26] = "%0.1f", -- ADI Glide-Slope Warning Flag - [25] = "%0.1f", -- ADI Attitude Warning Flag - [19] = "%0.1f", -- ADI Course Warning Flag - ]] - SendData(2003, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.1f;%0.1f;%0.1f", - mainPanelDevice:get_argument_value(17), - mainPanelDevice:get_argument_value(18), - mainPanelDevice:get_argument_value(24), - mainPanelDevice:get_argument_value(20), - mainPanelDevice:get_argument_value(21), - mainPanelDevice:get_argument_value(23), - mainPanelDevice:get_argument_value(27), - mainPanelDevice:get_argument_value(26), - mainPanelDevice:get_argument_value(25), - mainPanelDevice:get_argument_value(19))) - - -- Airspeed - local lAltimeter = math.round(mainPanelDevice:get_argument_value(52) * 10000, 1) + math.round(mainPanelDevice:get_argument_value(53) * 1000, 1) + math.round(mainPanelDevice:get_argument_value(54) * 100, 1) - lAltimeter = lAltimeter * 10 - -- [48] = "%.4f", -- AirspeedNeedle {0.0, 0.053, 0.146, 0.234, 0.322, 0.412, 0.517, 0.620, 0.719, 0.811, 0.906, 1.0} { 0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550} - -- [49] = "%.4f", -- AirspeedDial {0.0, 1.0} {0.0, 100.0} - -- Barometric Altimeter in Feeds for calculate max Air Speed - SendData(2004, string.format("%0.4f;%0.4f;%d", - mainPanelDevice:get_argument_value(48), - mainPanelDevice:get_argument_value(49), - lAltimeter)) - -- Standby AID - -- [63] = "%.4f", -- Standby Attitude Indicator pitch {-1.0, 1.0} - -- [64] = "%.4f", -- Standby Attitude Indicator bank {-1.0, 1.0} - -- [65] = "%0.1f", -- Standby Attitude Indicator warning flag {0.0, 1.0} - SendData(2005, string.format("%0.4f;%0.4f;%d", - mainPanelDevice:get_argument_value(63), - mainPanelDevice:get_argument_value(64), - mainPanelDevice:get_argument_value(65))) - -- AOA - -- [4] = "%.4f", -- AOA {0.0, 1.0} {0.0, 30.0} - -- [55] = "%0.1f", -- AOA Power Flag {0.0, 1.0} - SendData(2006, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(4), - mainPanelDevice:get_argument_value(55))) - -- Flap Indicator - -- [653] = "%.4f", -- FlapPositionIndicator {0,20} {0,2/3,1} - - -- Hydraulic Pressure - -- [647] = "%.4f", -- HydraulicPressureLeft {0.0,1.0} - -- [648] = "%.4f", -- HydraulicPressureRight {0.0,1.0} - -- Variometer VVI - -- [12] = "%.4f", -- Variometer {-1.0, -0.5, -0.29, 0.29, 0.5, 1.0} {-6000, -2000, -1000, 1000, 2000, 6000} - -- Engine Monitoring Instruments (EMI) - -- [76] = "%.4f", -- EngineLeftFanSpeed - -- [77] = "%.4f", -- EngineRightFanSpeed - -- [82] = "%.4f", -- Left Engine Oil Pressure - -- [83] = "%.4f", -- Right Engine Oil Pressure - -- [84] = "%.4f", -- EngineLeftFuelFlow - -- [85] = "%.4f", -- EngineRightFuelFlow - -- [13] = "%.4f", -- APU RPM - -- [14] = "%.4f", -- APU Temperature - - -- [70] = "%.4f", -- Left Engine Temperature (big needle) {0.005, 0.095, 0.183, 0.275, 0.365, 0.463, 0.560, 0.657, 0.759, 0.855, 0.995} { 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100} - -- [71] = "%.4f", -- EngineLeftTemperatureUnits (small needle) - SendData(2008, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(70), - mainPanelDevice:get_argument_value(71))) - -- [73] = "%.4f", -- Right Engine Temperature (big needle) {0.005, 0.095, 0.183, 0.275, 0.365, 0.463, 0.560, 0.657, 0.759, 0.855, 0.995} { 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100} - -- [74] = "%.4f", -- EngineRightTemperatureUnits (small needle) - SendData(2009, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(73), - mainPanelDevice:get_argument_value(74))) - - -- [78] = "%.4f", -- EngineLeftCoreSpeedTenth (big needle) - -- [79] = "%.4f", -- EngineLeftCoreSpeedUnits (small needle) - SendData(2010, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(78), - mainPanelDevice:get_argument_value(79))) - -- [80] = "%.4f", -- EngineRightCoreSpeedTenth (big needle) - -- [81] = "%.4f", -- EngineRightCoreSpeedUnits (small needle) - SendData(2011, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(80), - mainPanelDevice:get_argument_value(81))) - -- Accelerometer (G-meter) - -- [15] = "%.4f", -- Accelerometer_main {0.0, 1.0} {-5.0, 10.0} - -- [902] = "%.4f", -- Accelerometer_min {0.0, 1.0} {-5.0, 10.0} - -- [903] = "%.4f", -- Accelerometer_max {0.0, 1.0} {-5.0, 10.0} - SendData(2012, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(15), - mainPanelDevice:get_argument_value(902), - mainPanelDevice:get_argument_value(903))) - -- Standby Compass - -- [6] = "%.4f", -- heading - -- [720] = "%.4f", -- pitch - -- [721] = "%.4f", -- bank - SendData(2013, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(6), - mainPanelDevice:get_argument_value(720), - mainPanelDevice:get_argument_value(721))) - -- Digital Clock - ------------------------------------------------- - local lDigitalClock = list_indication(4) - lDigitalClock = lDigitalClock:gsub("-----------------------------------------", "") - lDigitalClock = lDigitalClock:gsub("txtHours", "") - lDigitalClock = lDigitalClock:gsub("txtColon", "") - lDigitalClock = lDigitalClock:gsub(":", "") - lDigitalClock = lDigitalClock:gsub("txtMinutes", "") - lDigitalClock = lDigitalClock:gsub("txtSeconds", "") - lDigitalClock = lDigitalClock:gsub("%c", "") - lDigitalClock = lDigitalClock:gsub("txt", "") - lDigitalClock = lDigitalClock:sub(1, 8) - if lDigitalClock:sub(7, 7) == "C" then - lDigitalClock = lDigitalClock:sub(1, 6).."; C" - elseif lDigitalClock:sub(7, 8) == "ET" then - lDigitalClock = lDigitalClock:sub(1, 6)..";ET" - else - lDigitalClock = "" - end - SendData(2014, string.format("%s", lDigitalClock)) - - --local lCDU = list_indication(3) - --WriteToLog('CDU: '..dump(lCDU)) - end -end - -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) - - -- Misc lamps - SendDataHW("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE - SendDataHW("179", mainPanelDevice:get_argument_value(179)) -- R_AILERON_EMER_DISENGAGE - SendDataHW("181", mainPanelDevice:get_argument_value(181)) -- L_ELEVATOR_EMER_DISENGAGE - SendDataHW("182", mainPanelDevice:get_argument_value(182)) -- R_ELEVATOR_EMER_DISENGAGE - SendDataHW("191", mainPanelDevice:get_argument_value(191)) -- TAKE_OFF_TRIM - SendDataHW("215", mainPanelDevice:get_argument_value(215)) -- L_ENG_FIRE - SendDataHW("216", mainPanelDevice:get_argument_value(216)) -- APU_FIRE - SendDataHW("217", mainPanelDevice:get_argument_value(217)) -- R_ENG_FIRE - SendDataHW("260", mainPanelDevice:get_argument_value(260)) -- TACAN_test_light {0.0, 1.0} - -- CMSC lamps - SendDataHW("372", mainPanelDevice:get_argument_value(372)) -- CMSC_MissileLaunchIndicator {0.0, 1.0} - SendDataHW("373", mainPanelDevice:get_argument_value(373)) -- CMSC_PriorityStatusIndicator {0.0, 1.0} - SendDataHW("374", mainPanelDevice:get_argument_value(374)) -- CMSC_UnknownStatusIndicator {0.0, 1.0} - -- Master Warning Lamp UFCP - SendDataHW("404", mainPanelDevice:get_argument_value(404)) -- MASTER_WARNING_STUB MASTER WARNING - -- Caution Panel LAMPS - SendDataHW("480", mainPanelDevice:get_argument_value(480)) -- ENG_START_CYCLE - SendDataHW("481", mainPanelDevice:get_argument_value(481)) -- L_HYD_PRESS - SendDataHW("482", mainPanelDevice:get_argument_value(482)) -- R_HYD_PRESS - SendDataHW("483", mainPanelDevice:get_argument_value(483)) -- GUN_UNSAFE - SendDataHW("484", mainPanelDevice:get_argument_value(484)) -- ANTISKID - SendDataHW("485", mainPanelDevice:get_argument_value(485)) -- L_HYD_RES - SendDataHW("486", mainPanelDevice:get_argument_value(486)) -- R_HYD_RES - SendDataHW("487", mainPanelDevice:get_argument_value(487)) -- OXY_LOW - SendDataHW("488", mainPanelDevice:get_argument_value(488)) -- ELEV_DISENG - SendDataHW("489", mainPanelDevice:get_argument_value(489)) -- VOID1 - SendDataHW("490", mainPanelDevice:get_argument_value(490)) -- SEAT_NOT_ARMED - SendDataHW("491", mainPanelDevice:get_argument_value(491)) -- BLEED_AIR_LEAK - SendDataHW("492", mainPanelDevice:get_argument_value(492)) -- AIL_DISENG - SendDataHW("493", mainPanelDevice:get_argument_value(493)) -- L_AIL_TAB - SendDataHW("494", mainPanelDevice:get_argument_value(494)) -- R_AIL_TAB - SendDataHW("495", mainPanelDevice:get_argument_value(495)) -- SERVICE_AIR_HOT - SendDataHW("496", mainPanelDevice:get_argument_value(496)) -- PITCH_SAS - SendDataHW("497", mainPanelDevice:get_argument_value(497)) -- L_ENG_HOT - SendDataHW("498", mainPanelDevice:get_argument_value(498)) -- R_ENG_HOT - SendDataHW("499", mainPanelDevice:get_argument_value(499)) -- WINDSHIELD_HOT - SendDataHW("500", mainPanelDevice:get_argument_value(500)) -- YAW_SAS - SendDataHW("501", mainPanelDevice:get_argument_value(501)) -- L_ENG_OIL_PRESS - SendDataHW("502", mainPanelDevice:get_argument_value(502)) -- R_ENG_OIL_PRESS - SendDataHW("503", mainPanelDevice:get_argument_value(503)) -- CICU - SendDataHW("504", mainPanelDevice:get_argument_value(504)) -- GCAS - SendDataHW("505", mainPanelDevice:get_argument_value(505)) -- L_MAIN_PUMP - SendDataHW("506", mainPanelDevice:get_argument_value(506)) -- R_MAIN_PUMP - SendDataHW("507", mainPanelDevice:get_argument_value(507)) -- VOID2 - SendDataHW("508", mainPanelDevice:get_argument_value(508)) -- LASTE - SendDataHW("509", mainPanelDevice:get_argument_value(509)) -- L_WING_PUMP - SendDataHW("510", mainPanelDevice:get_argument_value(510)) -- R_WING_PUMP - SendDataHW("511", mainPanelDevice:get_argument_value(511)) -- HARS - SendDataHW("512", mainPanelDevice:get_argument_value(512)) -- IFF_MODE_4 - SendDataHW("513", mainPanelDevice:get_argument_value(513)) -- L_MAIN_FUEL_LOW - SendDataHW("514", mainPanelDevice:get_argument_value(514)) -- R_MAIN_FUEL_LOW - SendDataHW("515", mainPanelDevice:get_argument_value(515)) -- L_R_TKS_UNEQUAL - SendDataHW("516", mainPanelDevice:get_argument_value(516)) -- EAC - SendDataHW("517", mainPanelDevice:get_argument_value(517)) -- L_FUEL_PRESS - SendDataHW("518", mainPanelDevice:get_argument_value(518)) -- R_FUEL_PRESS - SendDataHW("519", mainPanelDevice:get_argument_value(519)) -- NAV - SendDataHW("520", mainPanelDevice:get_argument_value(520)) -- STALL_SYS - SendDataHW("521", mainPanelDevice:get_argument_value(521)) -- L_CONV - SendDataHW("522", mainPanelDevice:get_argument_value(522)) -- R_CONV - SendDataHW("523", mainPanelDevice:get_argument_value(523)) -- CADC - SendDataHW("524", mainPanelDevice:get_argument_value(524)) -- APU_GEN - SendDataHW("525", mainPanelDevice:get_argument_value(525)) -- L_GEN - SendDataHW("526", mainPanelDevice:get_argument_value(526)) -- R_GEN - SendDataHW("527", mainPanelDevice:get_argument_value(527)) -- INST_INV - -- Angle of attack indicator - SendDataHW("540", mainPanelDevice:get_argument_value(540)) -- AOA_INDEXER_HIGH - SendDataHW("541", mainPanelDevice:get_argument_value(541)) -- AOA_INDEXER_NORM - SendDataHW("542", mainPanelDevice:get_argument_value(542)) -- AOA_INDEXER_LOW - -- NMSP Panel lamps - SendDataHW("606", mainPanelDevice:get_argument_value(606)) -- HARS - SendDataHW("608", mainPanelDevice:get_argument_value(608)) -- EGI - SendDataHW("610", mainPanelDevice:get_argument_value(610)) -- TISL - SendDataHW("612", mainPanelDevice:get_argument_value(612)) -- STRPT - SendDataHW("614", mainPanelDevice:get_argument_value(614)) -- ANCHR - SendDataHW("616", mainPanelDevice:get_argument_value(616)) -- TCN - SendDataHW("618", mainPanelDevice:get_argument_value(618)) -- ILS - SendDataHW("619", mainPanelDevice:get_argument_value(619)) -- UHF - SendDataHW("620", mainPanelDevice:get_argument_value(620)) -- FM - -- Landing Gear - SendDataHW("659", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE - SendDataHW("660", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE - SendDataHW("661", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE - -- Misc lamps - SendDataHW("662", mainPanelDevice:get_argument_value(662)) -- GUN_READY - SendDataHW("663", mainPanelDevice:get_argument_value(663)) -- NOSEWHEEL_STEERING - SendDataHW("664", mainPanelDevice:get_argument_value(664)) -- MARKER_BEACON - SendDataHW("665", mainPanelDevice:get_argument_value(665)) -- CANOPY_UNLOCKED - SendDataHW("730", mainPanelDevice:get_argument_value(730)) -- AIR_REFUEL_READY - SendDataHW("731", mainPanelDevice:get_argument_value(731)) -- AIR_REFUEL_LATCHED - SendDataHW("732", mainPanelDevice:get_argument_value(732)) -- AIR_REFUEL_DISCONNECT - SendDataHW("737", mainPanelDevice:get_argument_value(737)) -- HANDLE_GEAR_WARNING - -- IFF Panel lamps - SendDataHW("798", mainPanelDevice:get_argument_value(798)) -- IFF_reply_lamp {0, 1} - SendDataHW("799", mainPanelDevice:get_argument_value(799)) -- IFF_test_lamp {0, 1} - +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] -- Digital Clock ------------------------------------------------- local lDigitalClock = list_indication(4) @@ -941,7 +672,44 @@ function ProcessHARDWAREConfigHighImportance(mainPanelDevice) lDigitalClock = lDigitalClock:gsub("txtMinutes", "") lDigitalClock = lDigitalClock:gsub("txtSeconds", "") lDigitalClock = lDigitalClock:gsub("%c", "") - SendDataHW("2010", string.format("%s", lDigitalClock:sub(1, 6))) -- with : lDigitalClock:sub(1, 7) + lDigitalClock = lDigitalClock:gsub("txt", "") + lDigitalClock = lDigitalClock:sub(1, 8) + if lDigitalClock:sub(7, 7) == "C" then + lDigitalClock = lDigitalClock:sub(1, 6).."; C" + elseif lDigitalClock:sub(7, 8) == "ET" then + lDigitalClock = lDigitalClock:sub(1, 6)..";ET" + else + lDigitalClock = "" + end + ExportScript.Tools.SendData(2001, string.format("%s", lDigitalClock)) + + --local lCDU = list_indication(3) + --ExportScript.Tools.WriteToLog('CDU: '..ExportScript.Tools.dump(lCDU)) +end + +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + -- Digital Clock + ------------------------------------------------- + local lDigitalClock = list_indication(4) + lDigitalClock = lDigitalClock:gsub("-----------------------------------------", "") + lDigitalClock = lDigitalClock:gsub("txtHours", "") + lDigitalClock = lDigitalClock:gsub("txtColon", "") + lDigitalClock = lDigitalClock:gsub(":", "") + lDigitalClock = lDigitalClock:gsub("txtMinutes", "") + lDigitalClock = lDigitalClock:gsub("txtSeconds", "") + lDigitalClock = lDigitalClock:gsub("%c", "") + ExportScript.Tools.SendDataDAC("2010", string.format("%s", lDigitalClock:sub(1, 6))) -- with : lDigitalClock:sub(1, 7) end ----------------------------------------------------- @@ -949,160 +717,102 @@ end -- done every gExportLowTickInterval export events -- ----------------------------------------------------- --- Pointed to by ProcessGlassCockpitDCSConfigLowImportance, if the player aircraft is an A-10 -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - -- Get Radio Frequencies - local lUHFRadio = GetDevice(54) - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] + --AN/ARC-164 UHF + --------------------------------------------------- + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData(2002, string.format("%.3f", lUHFRadio:get_frequency()/1000000)) - -- TACAN Channel - SendData(2263, string.format("%0.2f;%0.2f;%0.2f", mainPanelDevice:get_argument_value(263), - mainPanelDevice:get_argument_value(264), - mainPanelDevice:get_argument_value(265))) - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - -- TACAN Channel - SendData(2015, string.format("%0.1f;%0.1f;%0.1f;%0.1f", mainPanelDevice:get_argument_value(263), - mainPanelDevice:get_argument_value(264), - mainPanelDevice:get_argument_value(265), - mainPanelDevice:get_argument_value(266))) - -- ILS - SendData(2016, string.format("%0.1f;%0.1f;%0.1f;%0.1f;%0.1f", mainPanelDevice:get_argument_value(251), - mainPanelDevice:get_argument_value(252), - mainPanelDevice:get_argument_value(253), - mainPanelDevice:get_argument_value(254), - mainPanelDevice:get_argument_value(255))) - -- UHF Radio (AN/ARC-164 UHF) - local lUHFRadio = GetDevice(54) - --WriteToLog('lUHFRadio: '..dump(string.format("%7.3f", lUHFRadio:get_frequency()/1000000))) - SendData(2017, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) - -- AM Radio (AN/ARC-186(V) VHF AM) - local lAMRadio = GetDevice(55) - --WriteToLog('lAMRadio: '..dump(string.format("%7.3f", lAMRadio:get_frequency()/1000000))) - SendData(2018, string.format("%7.3f", lAMRadio:get_frequency()/1000000)) - -- FM Radio (AN/ARC-186(V) VHF FM) - local lFMRadio = GetDevice(56) - --WriteToLog('lFMRadio: '..dump(string.format("%7.3f", lFMRadio:get_frequency()/1000000))) - SendData(2019, string.format("%7.3f", lFMRadio:get_frequency()/1000000)) - -- Landing Gear Lamps - -- [659] = "%0.1f", -- GEAR_N_SAFE - -- [660] = "%0.1f", -- GEAR_L_SAFE - -- [661] = "%0.1f", -- GEAR_R_SAFE - SendData(2007, string.format("%0.1f;%0.1f;%0.1f", - mainPanelDevice:get_argument_value(659), - mainPanelDevice:get_argument_value(660), - mainPanelDevice:get_argument_value(661))) - -- CMSC 2020 - ------------------------------------------------- - --[372] -- CMSC_MissileLaunchIndicator {0.0, 1.0} -- bottom middle, red light - --[373] -- CMSC_PriorityStatusIndicator {0.0, 1.0} -- ower PRI button, green light - --[374] -- CMSC_UnknownStatusIndicator {0.0, 1.0} -- over UNK button, ... - local lCMSC = list_indication(8) - lCMSC = lCMSC:gsub("-----------------------------------------", "") - lCMSC = lCMSC:gsub("txt_CHAFF_FLARE", "") - lCMSC = lCMSC:gsub("txt_JMR", "") - lCMSC = lCMSC:gsub("txt_MWS", "") - lCMSC = lCMSC:gsub("%c%c(%C)", "%1") - lCMSC = lCMSC.."\n" + -- AN/ARC-186(V) VHF AM + --------------------------------------------------- + local lVHF_AM_RADIO = GetDevice(55) + ExportScript.Tools.SendData(2003, string.format("%.3f", lVHF_AM_RADIO:get_frequency()/1000000)) - local lCMSCTable = {} - lCMSCTable = string.split(lCMSC, "%c") + -- AN/ARC-186(V) VHF FM + ------------------------------------------------- + local lVHF_FM_RADIO = GetDevice(56) + ExportScript.Tools.SendData(2004, string.format("%.3f", lVHF_FM_RADIO:get_frequency()/1000000)) - if lCMSCTable[2] ~= nil then - SendData(2020, string.format("%s;%s;%s;%.1f;%.1f;%.1f", - lCMSCTable[1], -- txt_CHAFF_FLARE - lCMSCTable[2], -- txt_JMR - lCMSCTable[3], -- txt_MWS - mainPanelDevice:get_argument_value(372), -- CMSC_MissileLaunchIndicator {0.0, 1.0} - mainPanelDevice:get_argument_value(373), -- CMSC_PriorityStatusIndicator {0.0, 1.0} - mainPanelDevice:get_argument_value(374))) -- CMSC_UnknownStatusIndicator {0.0, 1.0} - else - SendData(2020, string.format(";;;%.1f;%.1f;%.1f", - mainPanelDevice:get_argument_value(372), -- CMSC_MissileLaunchIndicator {0.0, 1.0} - mainPanelDevice:get_argument_value(373), -- CMSC_PriorityStatusIndicator {0.0, 1.0} - mainPanelDevice:get_argument_value(374))) -- CMSC_UnknownStatusIndicator {0.0, 1.0} - end - - -- ILS Channel 2021 - ------------------------------------------------- - local lILSFrequencyMHz = {[0]="108",[0.1]="109",[0.2]="110",[0.3]="111"} - local lILSFrequencyKHz = {[0]="10",[0.1]="15",[0.2]="30",[0.3]="35",[0.4]="50",[0.5]="55",[0.6]="70",[0.7]="75",[0.8]="90",[0.9]="95"} + -- CMSC 2020 (Text only) + ------------------------------------------------- + local lCMSC = list_indication(8) + lCMSC = lCMSC:gsub("-----------------------------------------", "") + lCMSC = lCMSC:gsub("txt_CHAFF_FLARE", "") + lCMSC = lCMSC:gsub("txt_JMR", "") + lCMSC = lCMSC:gsub("txt_MWS", "") + lCMSC = lCMSC:gsub("%c%c(%C)", "%1") + lCMSC = lCMSC.."\n" - SendData(2021, string.format("%.2f", - lILSFrequencyMHz[math.round(mainPanelDevice:get_argument_value(251), 1)].."."..lILSFrequencyKHz[math.round(mainPanelDevice:get_argument_value(252), 1)])) - - -- AN/ARC-186(V) VHF AM and Preset Channel - --------------------------------------------------- - local lVHF_AM_RADIO = GetDevice(55) - SendData(2022, string.format("%.3f", lVHF_AM_RADIO:get_frequency()/1000000)) + local lCMSCTable = {} + lCMSCTable = ExportScript.Tools.split(lCMSC, "%c") - --local lVHF_AM_RADIO_PRESET = {[0.0]="1",[0.01]="2",[0.02]="3",[0.03]="4",[0.04]="5",[0.05]="6",[0.06]="7",[0.07]="8",[0.08]="9",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="1"} - --SendDataHW("2003", lVHF_AM_RADIO_PRESET[math.round(mainPanelDevice:get_argument_value(137), 2)]) - - -- AN/ARC-186(V) VHF FM and Preset Channel - ------------------------------------------------- - local lVHF_FM_RADIO = GetDevice(56) - SendData(2023, string.format("%.3f", lVHF_FM_RADIO:get_frequency()/1000000)) - - -- Preset is buggy - --local lVHF_FM_RADIO_PRESET = {[0.0]="1",[0.01]="2",[0.02]="3",[0.03]="4",[0.04]="5",[0.05]="6",[0.06]="7",[0.07]="8",[0.08]="9",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="1"} - --SendDataHW("2005", lVHF_FM_RADIO_PRESET[math.round(mainPanelDevice:get_argument_value(151), 2, "ceil")]) - - -- TACAN Channel - ------------------------------------------------- - SendData(2024, (string.format("%0.2f", (mainPanelDevice:get_argument_value(263))) == "1.00" and "0" or "1")..math.round(mainPanelDevice:get_argument_value(264) * 10, 0)..math.round(mainPanelDevice:get_argument_value(265) * 10, 0)) - + if lCMSCTable[2] ~= nil then + ExportScript.Tools.SendData(2005, string.format("%s", lCMSCTable[1])) -- txt_CHAFF_FLARE + ExportScript.Tools.SendData(2006, string.format("%s", lCMSCTable[2])) -- txt_JMR + ExportScript.Tools.SendData(2007, string.format("%s", lCMSCTable[3])) -- txt_MWS + else + ExportScript.Tools.SendData(2005, "") -- txt_CHAFF_FLARE + ExportScript.Tools.SendData(2006, "") -- txt_JMR + ExportScript.Tools.SendData(2007, "") -- txt_MWS end end -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) --[[ - not every frame export to hardware + export in low tick interval to DAC Example from A-10C Get Radio Frequencies get data from device local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config ]] -- AN/ARC-164 UHF and UHF Preset Channel --------------------------------------------------- local lUHF_RADIO = GetDevice(54) if lUHF_RADIO:is_on() then - SendDataHW("2000", string.format("%.3f", lUHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%.3f", lUHF_RADIO:get_frequency()/1000000)) local lPresetChannel = list_indication(10) lPresetChannel = lPresetChannel:gsub("-----------------------------------------", "") lPresetChannel = lPresetChannel:gsub("txtPresetChannel", "") lPresetChannel = lPresetChannel:gsub("%c", "") - SendDataHW("2001", string.format("%s", lPresetChannel)) + ExportScript.Tools.SendDataDAC("2001", string.format("%s", lPresetChannel)) else - SendDataHW("2000", "-") - SendDataHW("2001", "-") + ExportScript.Tools.SendDataDAC("2000", "-") + ExportScript.Tools.SendDataDAC("2001", "-") end -- AN/ARC-186(V) VHF AM and Preset Channel --------------------------------------------------- local lVHF_AM_RADIO = GetDevice(55) - SendDataHW("2002", string.format("%.3f", lVHF_AM_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2002", string.format("%.3f", lVHF_AM_RADIO:get_frequency()/1000000)) local lVHF_AM_RADIO_PRESET = {[0.0]="1",[0.01]="2",[0.02]="3",[0.03]="4",[0.04]="5",[0.05]="6",[0.06]="7",[0.07]="8",[0.08]="9",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="1"} - SendDataHW("2003", lVHF_AM_RADIO_PRESET[math.round(mainPanelDevice:get_argument_value(137), 2)]) + ExportScript.Tools.SendDataDAC("2003", lVHF_AM_RADIO_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(137), 2)]) -- AN/ARC-186(V) VHF FM and Preset Channel ------------------------------------------------- local lVHF_FM_RADIO = GetDevice(56) - SendDataHW("2004", string.format("%.3f", lVHF_FM_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2004", string.format("%.3f", lVHF_FM_RADIO:get_frequency()/1000000)) -- Preset is buggy local lVHF_FM_RADIO_PRESET = {[0.0]="1",[0.01]="2",[0.02]="3",[0.03]="4",[0.04]="5",[0.05]="6",[0.06]="7",[0.07]="8",[0.08]="9",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="1"} - SendDataHW("2005", lVHF_FM_RADIO_PRESET[math.round(mainPanelDevice:get_argument_value(151), 2, "ceil")]) + ExportScript.Tools.SendDataDAC("2005", lVHF_FM_RADIO_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(151), 2, "ceil")]) -- Pressure setting -------------------------------------------------------- @@ -1111,7 +821,7 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice) local pressure_setting_1 = mainPanelDevice:get_argument_value(58) * 100 -- {0.0, 10.0} {0.0, 1.0} local pressure_setting_0 = mainPanelDevice:get_argument_value(59) * 10 -- {0.0, 10.0} {0.0, 1.0} local pressure_setting = ((pressure_setting_3 + pressure_setting_2 + pressure_setting_1 + pressure_setting_0) / 100) - SendDataHW("2006", string.format("%5.2f", pressure_setting)) + ExportScript.Tools.SendDataDAC("2006", string.format("%5.2f", pressure_setting)) -- Calculate Total Fuel -------------------------------------------------------- @@ -1120,25 +830,25 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice) local lFuelQuantityCounterHundreds = mainPanelDevice:get_argument_value(92) * 100 -- {0.0, 10.0} {0.0, 1.0} -- orginal local lFuelQuantityCounter = ((lFuelQuantityCounterTenthOfThous + lFuelQuantityCounterThousands + lFuelQuantityCounterHundreds) / 10) - SendDataHW("2007", string.format("%0.0f", lFuelQuantityCounter).."00") + ExportScript.Tools.SendDataDAC("2007", string.format("%0.0f", lFuelQuantityCounter).."00") -- exact --local lFuelQuantityCounter = ((lFuelQuantityCounterTenthOfThous + lFuelQuantityCounterThousands + lFuelQuantityCounterHundreds)) - --SendDataHW("2007", string.format("%1d", lFuelQuantityCounter).."0") + --ExportScript.Tools.SendDataDAC("2007", string.format("%1d", lFuelQuantityCounter).."0") -- TACAN Channel ------------------------------------------------- - SendDataHW("2008", (string.format("%0.2f", (mainPanelDevice:get_argument_value(263))) == "1.00" and "0" or "1")..math.round(mainPanelDevice:get_argument_value(264) * 10, 0)..math.round(mainPanelDevice:get_argument_value(265) * 10, 0)) + ExportScript.Tools.SendDataDAC("2008", (string.format("%0.2f", (mainPanelDevice:get_argument_value(263))) == "1.00" and "0" or "1")..ExportScript.Tools.round(mainPanelDevice:get_argument_value(264) * 10, 0)..ExportScript.Tools.round(mainPanelDevice:get_argument_value(265) * 10, 0)) -- ILS Channel ------------------------------------------------- local lILSFrequencyMHz = {[0]="108",[0.1]="109",[0.2]="110",[0.3]="111"} local lILSFrequencyKHz = {[0]="10",[0.1]="15",[0.2]="30",[0.3]="35",[0.4]="50",[0.5]="55",[0.6]="70",[0.7]="75",[0.8]="90",[0.9]="95"} - SendDataHW("2009", lILSFrequencyMHz[math.round(mainPanelDevice:get_argument_value(251), 1)].."."..lILSFrequencyKHz[math.round(mainPanelDevice:get_argument_value(252), 1)]) + ExportScript.Tools.SendDataDAC("2009", lILSFrequencyMHz[ExportScript.Tools.round(mainPanelDevice:get_argument_value(251), 1)].."."..lILSFrequencyKHz[ExportScript.Tools.round(mainPanelDevice:get_argument_value(252), 1)]) -- generic Radio display and frequency rotarys ------------------------------------------------- - genericRadio(nil, nil, gES_genericRadioHardwareID) + ExportScript.genericRadio(nil, nil, ExportScript.Config.genericRadioHardwareID) -- NOT FOR ARCAZE ------------------------------------------------- @@ -1156,10 +866,10 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice) lCMPS = lCMPS.."\n" local lCMPSTable = {} - lCMPSTable = string.split(lCMPS, "%c") + lCMPSTable = ExportScript.Tools.split(lCMPS, "%c") lCMPS = lCMPSTable[1].."\n"..table.concat(lCMPSTable, " ", 2) - SendDataHW("2011", lCMPS) + ExportScript.Tools.SendDataDAC("2011", lCMPS) -- CMSC @@ -1173,99 +883,122 @@ function ProcessHARDWAREConfigLowImportance(mainPanelDevice) lCMSC = lCMSC.."\n" local lCMSCTable = {} - lCMSCTable = string.split(lCMSC, "%c") + lCMSCTable = ExportScript.Tools.split(lCMSC, "%c") if lCMSCTable[2] ~= nil then - SendDataHW("2012", lCMSCTable[1]) -- txt_CHAFF_FLARE - SendDataHW("2013", lCMSCTable[2]) -- txt_JMR - SendDataHW("2014", lCMSCTable[3]) -- txt_MWS + ExportScript.Tools.SendDataDAC("2012", lCMSCTable[1]) -- txt_CHAFF_FLARE + ExportScript.Tools.SendDataDAC("2013", lCMSCTable[2]) -- txt_JMR + ExportScript.Tools.SendDataDAC("2014", lCMSCTable[3]) -- txt_MWS else - SendDataHW("2012", "") -- txt_CHAFF_FLARE - SendDataHW("2013", "") -- txt_JMR - SendDataHW("2014", "") -- txt_MWS + ExportScript.Tools.SendDataDAC("2012", "") -- txt_CHAFF_FLARE + ExportScript.Tools.SendDataDAC("2013", "") -- txt_JMR + ExportScript.Tools.SendDataDAC("2014", "") -- txt_MWS end ]] --===================================================================================== --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - WriteToLog('CMSP: '..dump(list_indication(7))) + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) local ltmp1 = 0 for ltmp2 = 0, 13, 1 do ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) end ]] --[[ -- LITENING_INTERFACE local lLITENING_INTERFACE = GetDevice(11) - WriteToLog('lLITENING_INTERFACE:get_station '..dump(lLITENING_INTERFACE:get_station())) - --WriteToLog('lLITENING_INTERFACE:add_masked_region '..dump(lLITENING_INTERFACE:add_masked_region())) -- test the parameters - --WriteToLog('lLITENING_INTERFACE:set_laser_designation_code '..dump(lLITENING_INTERFACE:set_laser_designation_code())) -- test the parameters - --WriteToLog('lLITENING_INTERFACE:set_laser_spot_search_code '..dump(lLITENING_INTERFACE:set_laser_spot_search_code())) -- test the parameters + ExportScript.Tools.WriteToLog('lLITENING_INTERFACE:get_station '..ExportScript.Tools.dump(lLITENING_INTERFACE:get_station())) + --ExportScript.Tools.WriteToLog('lLITENING_INTERFACE:add_masked_region '..ExportScript.Tools.dump(lLITENING_INTERFACE:add_masked_region())) -- test the parameters + --ExportScript.Tools.WriteToLog('lLITENING_INTERFACE:set_laser_designation_code '..ExportScript.Tools.dump(lLITENING_INTERFACE:set_laser_designation_code())) -- test the parameters + --ExportScript.Tools.WriteToLog('lLITENING_INTERFACE:set_laser_spot_search_code '..ExportScript.Tools.dump(lLITENING_INTERFACE:set_laser_spot_search_code())) -- test the parameters -- ADI local lADI = GetDevice(47) - WriteToLog('lADI:get_sideslip '..dump(lADI:get_sideslip())) - WriteToLog('lADI:get_bank '..dump(lADI:get_bank())) - WriteToLog('lADI:get_pitch '..dump(lADI:get_pitch())) + ExportScript.Tools.WriteToLog('lADI:get_sideslip '..ExportScript.Tools.dump(lADI:get_sideslip())) + ExportScript.Tools.WriteToLog('lADI:get_bank '..ExportScript.Tools.dump(lADI:get_bank())) + ExportScript.Tools.WriteToLog('lADI:get_pitch '..ExportScript.Tools.dump(lADI:get_pitch())) -- SAI local lSAI = GetDevice(48) - WriteToLog('lSAI:get_sideslip '..dump(lSAI:get_sideslip())) - WriteToLog('lSAI:get_bank '..dump(lSAI:get_bank())) - WriteToLog('lSAI:get_pitch '..dump(lSAI:get_pitch())) + ExportScript.Tools.WriteToLog('lSAI:get_sideslip '..ExportScript.Tools.dump(lSAI:get_sideslip())) + ExportScript.Tools.WriteToLog('lSAI:get_bank '..ExportScript.Tools.dump(lSAI:get_bank())) + ExportScript.Tools.WriteToLog('lSAI:get_pitch '..ExportScript.Tools.dump(lSAI:get_pitch())) -- UHF_RADIO local lUHF_RADIO = GetDevice(54) - WriteToLog('lUHF_RADIO:is_on '..dump(lUHF_RADIO:is_on())) - WriteToLog('lUHF_RADIO:get_frequency '..dump(lUHF_RADIO:get_frequency())) - --WriteToLog('lUHF_RADIO:set_frequency '..dump(lUHF_RADIO:set_frequency())) -- test the parameters - --WriteToLog('lUHF_RADIO:set_modulation '..dump(lUHF_RADIO:set_modulation())) -- test the parameters - --WriteToLog('lUHF_RADIO:set_channel '..dump(lUHF_RADIO:set_channel())) -- test the parameters + ExportScript.Tools.WriteToLog('lUHF_RADIO:is_on '..ExportScript.Tools.dump(lUHF_RADIO:is_on())) + ExportScript.Tools.WriteToLog('lUHF_RADIO:get_frequency '..ExportScript.Tools.dump(lUHF_RADIO:get_frequency())) + --ExportScript.Tools.WriteToLog('lUHF_RADIO:set_frequency '..ExportScript.Tools.dump(lUHF_RADIO:set_frequency())) -- test the parameters + --ExportScript.Tools.WriteToLog('lUHF_RADIO:set_modulation '..ExportScript.Tools.dump(lUHF_RADIO:set_modulation())) -- test the parameters + --ExportScript.Tools.WriteToLog('lUHF_RADIO:set_channel '..ExportScript.Tools.dump(lUHF_RADIO:set_channel())) -- test the parameters -- VHF_AM_RADIO local lVHF_AM_RADIO = GetDevice(55) - WriteToLog('lVHF_AM_RADIO:is_on '..dump(lVHF_AM_RADIO:is_on())) - WriteToLog('lVHF_AM_RADIO:get_frequency '..dump(lVHF_AM_RADIO:get_frequency())) - --WriteToLog('lVHF_AM_RADIO:set_frequency '..dump(lVHF_AM_RADIO:set_frequency())) -- test the parameters - --WriteToLog('lVHF_AM_RADIO:set_modulation '..dump(lVHF_AM_RADIO:set_modulation())) -- test the parameters - --WriteToLog('lVHF_AM_RADIO:set_channel '..dump(lVHF_AM_RADIO:set_channel())) -- test the parameters + ExportScript.Tools.WriteToLog('lVHF_AM_RADIO:is_on '..ExportScript.Tools.dump(lVHF_AM_RADIO:is_on())) + ExportScript.Tools.WriteToLog('lVHF_AM_RADIO:get_frequency '..ExportScript.Tools.dump(lVHF_AM_RADIO:get_frequency())) + --ExportScript.Tools.WriteToLog('lVHF_AM_RADIO:set_frequency '..ExportScript.Tools.dump(lVHF_AM_RADIO:set_frequency())) -- test the parameters + --ExportScript.Tools.WriteToLog('lVHF_AM_RADIO:set_modulation '..ExportScript.Tools.dump(lVHF_AM_RADIO:set_modulation())) -- test the parameters + --ExportScript.Tools.WriteToLog('lVHF_AM_RADIO:set_channel '..ExportScript.Tools.dump(lVHF_AM_RADIO:set_channel())) -- test the parameters -- VHF_FM_RADIO local lVHF_FM_RADIO = GetDevice(56) - WriteToLog('lVHF_FM_RADIO:is_on '..dump(lVHF_FM_RADIO:is_on())) - WriteToLog('lVHF_FM_RADIO:get_frequency '..dump(lVHF_FM_RADIO:get_frequency())) - --WriteToLog('lVHF_FM_RADIO:set_frequency '..dump(lVHF_FM_RADIO:set_frequency())) -- test the parameters - --WriteToLog('lVHF_FM_RADIO:set_modulation '..dump(lVHF_FM_RADIO:set_modulation())) -- test the parameters - --WriteToLog('lVHF_FM_RADIO:set_channel '..dump(lVHF_FM_RADIO:set_channel())) -- test the parameters + ExportScript.Tools.WriteToLog('lVHF_FM_RADIO:is_on '..ExportScript.Tools.dump(lVHF_FM_RADIO:is_on())) + ExportScript.Tools.WriteToLog('lVHF_FM_RADIO:get_frequency '..ExportScript.Tools.dump(lVHF_FM_RADIO:get_frequency())) + --ExportScript.Tools.WriteToLog('lVHF_FM_RADIO:set_frequency '..ExportScript.Tools.dump(lVHF_FM_RADIO:set_frequency())) -- test the parameters + --ExportScript.Tools.WriteToLog('lVHF_FM_RADIO:set_modulation '..ExportScript.Tools.dump(lVHF_FM_RADIO:set_modulation())) -- test the parameters + --ExportScript.Tools.WriteToLog('lVHF_FM_RADIO:set_channel '..ExportScript.Tools.dump(lVHF_FM_RADIO:set_channel())) -- test the parameters -- INTERCOM local lINTERCOM = GetDevice(58) - WriteToLog('lINTERCOM:is_communicator_available '..dump(lINTERCOM:is_communicator_available())) - WriteToLog('lINTERCOM:get_noise_level '..dump(lINTERCOM:get_noise_level())) - WriteToLog('lINTERCOM:get_signal_level '..dump(lINTERCOM:get_signal_level())) - --WriteToLog('lINTERCOM:set_communicator '..dump(lINTERCOM:set_communicator())) -- test the parameters - --WriteToLog('lINTERCOM:set_voip_mode '..dump(lINTERCOM:set_voip_mode())) -- test the parameters + ExportScript.Tools.WriteToLog('lINTERCOM:is_communicator_available '..ExportScript.Tools.dump(lINTERCOM:is_communicator_available())) + ExportScript.Tools.WriteToLog('lINTERCOM:get_noise_level '..ExportScript.Tools.dump(lINTERCOM:get_noise_level())) + ExportScript.Tools.WriteToLog('lINTERCOM:get_signal_level '..ExportScript.Tools.dump(lINTERCOM:get_signal_level())) + --ExportScript.Tools.WriteToLog('lINTERCOM:set_communicator '..ExportScript.Tools.dump(lINTERCOM:set_communicator())) -- test the parameters + --ExportScript.Tools.WriteToLog('lINTERCOM:set_voip_mode '..ExportScript.Tools.dump(lINTERCOM:set_voip_mode())) -- test the parameters ]] --[[ local ltmp1 = 0 for ltmp2 = 1, 73, 1 do ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) end ]] +--getIndicatorData(3) + +end + +nextCDUIndicatorTime = 0 +function getIndicatorData(indicator_number) + local pairData = "" + local curTime = LoGetModelTime() + if curTime >= nextCDUIndicatorTime then + nextCDUIndicatorTime = curTime + .15 + local indicator = list_indication(indicator_number) + if indicator ~= "" then + for brace in indicator:gmatch("%b{}") do + local lines = string.gsub(string.gsub(brace,"[{}]",""),"---+","") + for data in lines:gmatch("[%w_]+\n[^\n]+") do + pairData = pairData..string.gsub(data, "\n", "<==>")..'\n' + end + end + --sendCduData(pairData, cduAppHost, cduAppPort) + ExportScript.Tools.WriteToLog('indicator: '..ExportScript.Tools.dump(indicator)) + ExportScript.Tools.WriteToLog('pairData: '..ExportScript.Tools.dump(pairData)) + end + end end ----------------------------- -- Custom functions -- ----------------------------- -function genericRadio(key, value, hardware) +function ExportScript.genericRadio(key, value, hardware) local lHardware = hardware or 1 -- Werte werden per Encoder im Bereich von 0.0 bis 2.0 in 0.1 Schritten uebergeben -- im jeweiligen Abschnitt muessen die Eingangsdaten auf den Zulaessigen Bereich eingeschraengt werden @@ -1273,30 +1006,30 @@ function genericRadio(key, value, hardware) local lMainPanelDevice = GetDevice(0) local lMaxRadios = 3 - if gES_genericRadio == nil then - gES_genericRadio = 0 + if ExportScript.AF.genericRadio == nil then + ExportScript.AF.genericRadio = 0 end - if gES_genericRadioFrequency1 == nil then - gES_genericRadioFrequency1 = 0.0 + if ExportScript.AF.genericRadioFrequency1 == nil then + ExportScript.AF.genericRadioFrequency1 = 0.0 end - if gES_genericRadioFrequency2 == nil then - gES_genericRadioFrequency2 = 0.0 + if ExportScript.AF.genericRadioFrequency2 == nil then + ExportScript.AF.genericRadioFrequency2 = 0.0 end - if gES_genericRadioPresetChannel == nil then - gES_genericRadioPresetChannel = 0.0 + if ExportScript.AF.genericRadioPresetChannel == nil then + ExportScript.AF.genericRadioPresetChannel = 0.0 end - if gES_genericRadioPower == nil then - gES_genericRadioPower = {} + if ExportScript.AF.genericRadioPower == nil then + ExportScript.AF.genericRadioPower = {} end - if gES_genericRadioPresetManual == nil then - gES_genericRadioPresetManual = {} + if ExportScript.AF.genericRadioPresetManual == nil then + ExportScript.AF.genericRadioPresetManual = {} end - if gES_genericRadioSquelch == nil then - gES_genericRadioSquelch = {} + if ExportScript.AF.genericRadioSquelch == nil then + ExportScript.AF.genericRadioSquelch = {} end if key == "3001" then - gES_genericRadio = tonumber(value) + ExportScript.AF.genericRadio = tonumber(value) end if key == "3002" then lRotaryFrequency_1 = tonumber(value) @@ -1323,30 +1056,30 @@ function genericRadio(key, value, hardware) lPower = tonumber(value) end - if gES_genericRadio > lMaxRadios then - WriteToLog("Radio Nr. "..gES_genericRadio.." not defined.") + if ExportScript.AF.genericRadio > lMaxRadios then + ExportScript.Tools.WriteToLog("Radio Nr. "..ExportScript.AF.genericRadio.." not defined.") return end - if gES_genericRadio == 1 then + if ExportScript.AF.genericRadio == 1 then -- AN/ARC-164 UHF ###.### --------------------------------------------------- local lDeviceID = 54 local lUHF_RADIO = GetDevice(lDeviceID) -- check status of the radio - if gES_genericRadioPower[gES_genericRadio] == nil then + if ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == nil then if lUHF_RADIO:is_on() then - gES_genericRadioPower[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 else - gES_genericRadioPower[gES_genericRadio] = 0.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0.0 end end - if gES_genericRadioPresetManual[gES_genericRadio] == nil then - gES_genericRadioPresetManual[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(167), 1) == 0) and 0 or 1) + if ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(167), 1) == 0) and 0 or 1) end - if gES_genericRadioSquelch[gES_genericRadio] == nil then - gES_genericRadioSquelch[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(170), 1) == 0) and 1 or 0) + if ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(170), 1) == 0) and 1 or 0) end if lUHF_RADIO:is_on() then @@ -1355,15 +1088,15 @@ function genericRadio(key, value, hardware) lPresetChannel = lPresetChannel:gsub("txtPresetChannel", "") lPresetChannel = lPresetChannel:gsub("%c", "") - local lUHF_RADIO_FREQUENCY = math.round(lUHF_RADIO:get_frequency()/1000000 , 3, "floor") + local lUHF_RADIO_FREQUENCY = ExportScript.Tools.round(lUHF_RADIO:get_frequency()/1000000 , 3, "floor") - SendDataHW("3000", string.format("%s%.3f", lPresetChannel, lUHF_RADIO_FREQUENCY), lHardware) - SendDataHW("3001", string.format("%s", lPresetChannel), lHardware) - SendDataHW("3002", string.format("%.3f", lUHF_RADIO_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3000", string.format("%s%.3f", lPresetChannel, lUHF_RADIO_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3001", string.format("%s", lPresetChannel), lHardware) + ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lUHF_RADIO_FREQUENCY), lHardware) if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then - local lFrequency = StrSplit(lUHF_RADIO_FREQUENCY, "%.") -- %. um den Punkt als Punkt zu suchen + local lFrequency = ExportScript.Tools.StrSplit(lUHF_RADIO_FREQUENCY, "%.") -- %. um den Punkt als Punkt zu suchen if type(lFrequency) == "table" and lFrequency[1] ~= nil then lFrequency[1] = tonumber(lFrequency[1]) @@ -1374,18 +1107,18 @@ function genericRadio(key, value, hardware) local ltmp = string.format("%.0f", lFrequency[2] / 25) lFrequency[2] = ltmp * 25 end - if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then + if lRotaryFrequency_1 < ExportScript.AF.genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then lFrequency[1] = lFrequency[1] - 1 if lFrequency[1] == 219 then lFrequency[1] = 314 end - gES_genericRadioFrequency1 = lRotaryFrequency_1 + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 else lFrequency[1] = lFrequency[1] + 1 if lFrequency[1] == 315 then lFrequency[1] = 220 end - gES_genericRadioFrequency1 = lRotaryFrequency_1 + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 end lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) @@ -1395,13 +1128,13 @@ function genericRadio(key, value, hardware) Frequency = ltempFrequency * 1000000} else - WriteToLog("1. generic A-10C UHF Radio, don't split frequency: "..lFrequency) + ExportScript.Tools.WriteToLog("1. generic A-10C UHF Radio, don't split frequency: "..lFrequency) end end if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then - local lFrequency = StrSplit(lUHF_RADIO_FREQUENCY, "%.") + local lFrequency = ExportScript.Tools.StrSplit(lUHF_RADIO_FREQUENCY, "%.") if type(lFrequency) == "table" and lFrequency[1] ~= nil then lFrequency[1] = tonumber(lFrequency[1]) @@ -1412,18 +1145,18 @@ function genericRadio(key, value, hardware) local ltmp = string.format("%.0f", lFrequency[2] / 25) lFrequency[2] = ltmp * 25 end - if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then + if lRotaryFrequency_2 < ExportScript.AF.genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then lFrequency[2] = lFrequency[2] - 25 if lFrequency[2] == -25 then lFrequency[2] = 975 end - gES_genericRadioFrequency2 = lRotaryFrequency_2 + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 else lFrequency[2] = lFrequency[2] + 25 if lFrequency[2] == 1000 then lFrequency[2] = 0 end - gES_genericRadioFrequency2 = lRotaryFrequency_2 + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 end lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) @@ -1433,7 +1166,7 @@ function genericRadio(key, value, hardware) Frequency = ltempFrequency * 1000000} else - WriteToLog("2. generic A-10C UHF Radio, don't split frequency: "..lFrequency) + ExportScript.Tools.WriteToLog("2. generic A-10C UHF Radio, don't split frequency: "..lFrequency) end end if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 1.9) then @@ -1445,9 +1178,9 @@ function genericRadio(key, value, hardware) end else - SendDataHW("3000", "-", lHardware) - SendDataHW("3001", "-", lHardware) - SendDataHW("3002", "-", lHardware) + ExportScript.Tools.SendDataDAC("3000", "-", lHardware) + ExportScript.Tools.SendDataDAC("3001", "-", lHardware) + ExportScript.Tools.SendDataDAC("3002", "-", lHardware) end if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then @@ -1462,81 +1195,81 @@ function genericRadio(key, value, hardware) Value = lLoad} end if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then - if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then + if lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 1.0 then -- Squelch off lSquelch = 1.0 - gES_genericRadioSquelch[gES_genericRadio] = 0 - elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0 + elseif lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 0 then -- Squelch on lSquelch = 0.0 - gES_genericRadioSquelch[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3010, Value = lSquelch} end if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then - if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then + if lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 1.0 then -- Manual lManualPreset = 0.0 - gES_genericRadioPresetManual[gES_genericRadio] = 0 - elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0 + elseif lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 0 then -- Preset lManualPreset = 0.1 - gES_genericRadioPresetManual[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3007, Value = lManualPreset} end if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then - if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then + if lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 1.0 then -- Power off lPower = 0.0 - gES_genericRadioPower[gES_genericRadio] = 0 - elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0 + elseif lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 0 then --Power on lPower = 0.1 - gES_genericRadioPower[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3008, Value = lPower} end - elseif gES_genericRadio == 2 then + elseif ExportScript.AF.genericRadio == 2 then -- AN/ARC-186(V) VHF AM ###.### --------------------------------------------------- local lDeviceID = 55 local lVHF_AM_RADIO = GetDevice(lDeviceID) -- check status of the radio - if gES_genericRadioPower[gES_genericRadio] == nil then + if ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == nil then if lVHF_AM_RADIO:is_on() then - gES_genericRadioPower[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 else - gES_genericRadioPower[gES_genericRadio] = 0.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0.0 end end - if gES_genericRadioPresetManual[gES_genericRadio] == nil then - gES_genericRadioPresetManual[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(135), 1) == 0.1) and 1 or 0) + if ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(135), 1) == 0.1) and 1 or 0) end - if gES_genericRadioSquelch[gES_genericRadio] == nil then - gES_genericRadioSquelch[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(134), 1) == 1.0) and 0 or 1) + if ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(134), 1) == 1.0) and 0 or 1) end local lVHF_AM_RADIO_PRESET = {[0.0]="01",[0.01]="02",[0.02]="03",[0.03]="04",[0.04]="05",[0.05]="06",[0.06]="07",[0.07]="08",[0.08]="09",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="01"} - local lVHF_AM_RADIO_FREQUENCY = math.round(lVHF_AM_RADIO:get_frequency()/1000000 , 3, "floor") + local lVHF_AM_RADIO_FREQUENCY = ExportScript.Tools.round(lVHF_AM_RADIO:get_frequency()/1000000 , 3, "floor") - local lPresetChannel = math.round(lMainPanelDevice:get_argument_value(137), 2) + local lPresetChannel = ExportScript.Tools.round(lMainPanelDevice:get_argument_value(137), 2) - SendDataHW("3000", string.format("%s%.3f", lVHF_AM_RADIO_PRESET[lPresetChannel], lVHF_AM_RADIO_FREQUENCY), lHardware) - SendDataHW("3001", string.format("%s", lVHF_AM_RADIO_PRESET[lPresetChannel]), lHardware) - SendDataHW("3002", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3000", string.format("%s%.3f", lVHF_AM_RADIO_PRESET[lPresetChannel], lVHF_AM_RADIO_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3001", string.format("%s", lVHF_AM_RADIO_PRESET[lPresetChannel]), lHardware) + ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware) if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then - local lFrequency = StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.") + local lFrequency = ExportScript.Tools.StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.") if type(lFrequency) == "table" and lFrequency[1] ~= nil then lFrequency[1] = tonumber(lFrequency[1]) @@ -1547,18 +1280,18 @@ function genericRadio(key, value, hardware) local ltmp = string.format("%.0f", lFrequency[2] / 25) lFrequency[2] = ltmp * 25 end - if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then + if lRotaryFrequency_1 < ExportScript.AF.genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then lFrequency[1] = lFrequency[1] - 1 if lFrequency[1] == 29 then lFrequency[1] = 159 end - gES_genericRadioFrequency1 = lRotaryFrequency_1 + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 else lFrequency[1] = lFrequency[1] + 1 if lFrequency[1] == 160 then lFrequency[1] = 30 end - gES_genericRadioFrequency1 = lRotaryFrequency_1 + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 end lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) @@ -1568,13 +1301,13 @@ function genericRadio(key, value, hardware) Frequency = ltempFrequency * 1000000} else - WriteToLog("1. generic A-10C VHF AM Radio, don't split frequency: "..lFrequency) + ExportScript.Tools.WriteToLog("1. generic A-10C VHF AM Radio, don't split frequency: "..lFrequency) end end if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then - local lFrequency = StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.") + local lFrequency = ExportScript.Tools.StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.") if type(lFrequency) == "table" and lFrequency[1] ~= nil then lFrequency[1] = tonumber(lFrequency[1]) @@ -1585,18 +1318,18 @@ function genericRadio(key, value, hardware) local ltmp = string.format("%.0f", lFrequency[2] / 25) lFrequency[2] = ltmp * 25 end - if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then + if lRotaryFrequency_2 < ExportScript.AF.genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then lFrequency[2] = lFrequency[2] - 25 if lFrequency[2] == -25 then lFrequency[2] = 975 end - gES_genericRadioFrequency2 = lRotaryFrequency_2 + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 else lFrequency[2] = lFrequency[2] + 25 if lFrequency[2] == 1000 then lFrequency[2] = 0 end - gES_genericRadioFrequency2 = lRotaryFrequency_2 + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 end lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) @@ -1606,7 +1339,7 @@ function genericRadio(key, value, hardware) Frequency = ltempFrequency * 1000000} else - WriteToLog("2. generic A-10C VHF AM Radio, don't split frequency: "..lFrequency) + ExportScript.Tools.WriteToLog("2. generic A-10C VHF AM Radio, don't split frequency: "..lFrequency) end end if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then @@ -1617,16 +1350,16 @@ function genericRadio(key, value, hardware) end if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then -- Preset 0.0 to 0.20 in 0.01 steps - if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then + if lPreset < ExportScript.AF.genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then lClickAction = {DeviceID = lDeviceID, ButtonID = 3001, Value = 0.01} - gES_genericRadioPresetChannel = lPreset + ExportScript.AF.genericRadioPresetChannel = lPreset else lClickAction = {DeviceID = lDeviceID, ButtonID = 3002, Value = -0.01} - gES_genericRadioPresetChannel = lPreset + ExportScript.AF.genericRadioPresetChannel = lPreset end end if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then @@ -1635,70 +1368,70 @@ function genericRadio(key, value, hardware) Value = lLoad} end if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then - if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then + if lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 1.0 then -- Squelch off lSquelch = -1.0 - gES_genericRadioSquelch[gES_genericRadio] = 0 - elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0 + elseif lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 0 then -- Squelch on lSquelch = 0.0 - gES_genericRadioSquelch[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3008, Value = lSquelch} end if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then - if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then + if lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 1.0 then -- Manual on lManualPreset = 0.2 - gES_genericRadioPresetManual[gES_genericRadio] = 0 - elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0 + elseif lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 0 then -- Preset on lManualPreset = 0.3 - gES_genericRadioPresetManual[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3004, Value = lManualPreset} end if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then - if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then + if lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 1.0 then -- Power off lPower = 0.0 - gES_genericRadioPower[gES_genericRadio] = 0 - elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0 + elseif lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 0 then -- Power on lPower = 0.1 - gES_genericRadioPower[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3003, Value = lPower} end - elseif gES_genericRadio == 3 then + elseif ExportScript.AF.genericRadio == 3 then -- AN/ARC-186(V) VHF FM ##.### ------------------------------------------------- local lDeviceID = 56 local lVHF_FM_RADIO = GetDevice(lDeviceID) -- check status of the radio - if gES_genericRadioPower[gES_genericRadio] == nil then + if ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == nil then if lVHF_FM_RADIO:is_on() then - gES_genericRadioPower[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 else - gES_genericRadioPower[gES_genericRadio] = 0.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0.0 end end - if gES_genericRadioPresetManual[gES_genericRadio] == nil then - gES_genericRadioPresetManual[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(149), 1) == 0.1) and 1 or 0) + if ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(149), 1) == 0.1) and 1 or 0) end - if gES_genericRadioSquelch[gES_genericRadio] == nil then - gES_genericRadioSquelch[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(148), 1) == 1.0) and 0 or 1) + if ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(148), 1) == 1.0) and 0 or 1) end - local lVHF_FM_RADIO_Frequency = math.round(lVHF_FM_RADIO:get_frequency()/1000000 , 3, "floor") + local lVHF_FM_RADIO_Frequency = ExportScript.Tools.round(lVHF_FM_RADIO:get_frequency()/1000000 , 3, "floor") if lVHF_FM_RADIO_Frequency > 99.999 then lVHF_FM_RADIO_Frequency = string.format("%.3f", lVHF_FM_RADIO_Frequency) else @@ -1707,15 +1440,15 @@ function genericRadio(key, value, hardware) -- Preset is buggy local lVHF_FM_RADIO_PRESET = {[0.0]="01",[0.01]="02",[0.02]="03",[0.03]="04",[0.04]="05",[0.05]="06",[0.06]="07",[0.07]="08",[0.08]="09",[0.09]="10",[0.10]="11",[0.11]="12",[0.12]="13",[0.13]="14",[0.14]="15",[0.15]="16",[0.16]="17",[0.17]="18",[0.18]="19",[0.19]="20",[0.20]="01"} - local lPresetChannel = math.round(lMainPanelDevice:get_argument_value(151), 2, "ceil") + local lPresetChannel = ExportScript.Tools.round(lMainPanelDevice:get_argument_value(151), 2, "ceil") - SendDataHW("3000", string.format("%s%s", lVHF_FM_RADIO_PRESET[lPresetChannel], lVHF_FM_RADIO_Frequency), lHardware) - SendDataHW("3001", string.format("%s", lVHF_FM_RADIO_PRESET[lPresetChannel]), lHardware) - SendDataHW("3002", string.format("%s", lVHF_FM_RADIO_Frequency), lHardware) + ExportScript.Tools.SendDataDAC("3000", string.format("%s%s", lVHF_FM_RADIO_PRESET[lPresetChannel], lVHF_FM_RADIO_Frequency), lHardware) + ExportScript.Tools.SendDataDAC("3001", string.format("%s", lVHF_FM_RADIO_PRESET[lPresetChannel]), lHardware) + ExportScript.Tools.SendDataDAC("3002", string.format("%s", lVHF_FM_RADIO_Frequency), lHardware) if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then - local lFrequency = StrSplit(lVHF_FM_RADIO_Frequency, "%.") + local lFrequency = ExportScript.Tools.StrSplit(lVHF_FM_RADIO_Frequency, "%.") if type(lFrequency) == "table" and lFrequency[1] ~= nil then lFrequency[1] = tonumber(lFrequency[1]) @@ -1726,18 +1459,18 @@ function genericRadio(key, value, hardware) local ltmp = string.format("%.0f", lFrequency[2] / 25) lFrequency[2] = ltmp * 25 end - if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then + if lRotaryFrequency_1 < ExportScript.AF.genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then lFrequency[1] = lFrequency[1] - 1 if lFrequency[1] == 29 then lFrequency[1] = 76 end - gES_genericRadioFrequency1 = lRotaryFrequency_1 + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 else lFrequency[1] = lFrequency[1] + 1 if lFrequency[1] == 77 then lFrequency[1] = 30 end - gES_genericRadioFrequency1 = lRotaryFrequency_1 + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 end lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) @@ -1747,13 +1480,13 @@ function genericRadio(key, value, hardware) Frequency = ltempFrequency * 1000000} else - WriteToLog("1. generic A-10C VHF FM Radio, don't split frequency: "..lFrequency) + ExportScript.Tools.WriteToLog("1. generic A-10C VHF FM Radio, don't split frequency: "..lFrequency) end end if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then - local lFrequency = StrSplit(lVHF_FM_RADIO_Frequency, "%.") + local lFrequency = ExportScript.Tools.StrSplit(lVHF_FM_RADIO_Frequency, "%.") if type(lFrequency) == "table" and lFrequency[1] ~= nil then lFrequency[1] = tonumber(lFrequency[1]) @@ -1764,18 +1497,18 @@ function genericRadio(key, value, hardware) local ltmp = string.format("%.0f", lFrequency[2] / 25) lFrequency[2] = ltmp * 25 end - if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then + if lRotaryFrequency_2 < ExportScript.AF.genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then lFrequency[2] = lFrequency[2] - 25 if lFrequency[2] == -25 then lFrequency[2] = 975 end - gES_genericRadioFrequency2 = lRotaryFrequency_2 + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 else lFrequency[2] = lFrequency[2] + 25 if lFrequency[2] == 1000 then lFrequency[2] = 0 end - gES_genericRadioFrequency2 = lRotaryFrequency_2 + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 end lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) @@ -1785,7 +1518,7 @@ function genericRadio(key, value, hardware) Frequency = ltempFrequency * 1000000} else - WriteToLog("2. generic A-10C VHF FM Radio, don't split frequency: "..lFrequency) + ExportScript.Tools.WriteToLog("2. generic A-10C VHF FM Radio, don't split frequency: "..lFrequency) end end if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then @@ -1796,16 +1529,16 @@ function genericRadio(key, value, hardware) end if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then -- Preset 0.0 to 0.20 in 0.01 steps - if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then + if lPreset < ExportScript.AF.genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then lClickAction = {DeviceID = lDeviceID, ButtonID = 3001, Value = 0.01} - gES_genericRadioPresetChannel = lPreset + ExportScript.AF.genericRadioPresetChannel = lPreset else lClickAction = {DeviceID = lDeviceID, ButtonID = 3002, Value = -0.01} - gES_genericRadioPresetChannel = lPreset + ExportScript.AF.genericRadioPresetChannel = lPreset end end if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then @@ -1814,42 +1547,42 @@ function genericRadio(key, value, hardware) Value = lLoad} end if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then - if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then + if lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 1.0 then -- Squelch off lSquelch = -1.0 - gES_genericRadioSquelch[gES_genericRadio] = 0 - elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0 + elseif lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 0 then -- Squelch on lSquelch = 0.0 - gES_genericRadioSquelch[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3008, Value = lSquelch} end if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then - if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then + if lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 1.0 then -- Manual on lManualPreset = 0.2 - gES_genericRadioPresetManual[gES_genericRadio] = 0 - elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0 + elseif lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 0 then -- Preset on lManualPreset = 0.3 - gES_genericRadioPresetManual[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3004, Value = lManualPreset} end if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then - if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then + if lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 1.0 then -- Power off lPower = 0.0 - gES_genericRadioPower[gES_genericRadio] = 0 - elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0 + elseif lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 0 then -- Power on lPower = 0.1 - gES_genericRadioPower[gES_genericRadio] = 1.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 end lClickAction = {DeviceID = lDeviceID, ButtonID = 3003, @@ -1857,32 +1590,32 @@ function genericRadio(key, value, hardware) end else - SendDataHW("3000", "-", lHardware) - SendDataHW("3001", "-", lHardware) - SendDataHW("3002", "-", lHardware) - SendDataHW("3010", 0, lHardware) - SendDataHW("3011", 0, lHardware) - SendDataHW("3012", 0, lHardware) + ExportScript.Tools.SendDataDAC("3000", "-", lHardware) + ExportScript.Tools.SendDataDAC("3001", "-", lHardware) + ExportScript.Tools.SendDataDAC("3002", "-", lHardware) + ExportScript.Tools.SendDataDAC("3010", 0, lHardware) + ExportScript.Tools.SendDataDAC("3011", 0, lHardware) + ExportScript.Tools.SendDataDAC("3012", 0, lHardware) return end - SendDataHW("3010", gES_genericRadioPower[gES_genericRadio], lHardware) - SendDataHW("3011", gES_genericRadioPresetManual[gES_genericRadio], lHardware) - SendDataHW("3012", gES_genericRadioSquelch[gES_genericRadio], lHardware) + ExportScript.Tools.SendDataDAC("3010", ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio], lHardware) + ExportScript.Tools.SendDataDAC("3011", ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio], lHardware) + ExportScript.Tools.SendDataDAC("3012", ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio], lHardware) if lClickAction ~= nil then lDevice = GetDevice(lClickAction.DeviceID) if type(lDevice) == "table" then - --WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ") + --ExportScript.Tools.WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ") lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value) end elseif lSetFrequency ~= nil then lDevice = GetDevice(lSetFrequency.DeviceID) if type(lDevice) == "table" and lDevice:is_on() then - --WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ") + --ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ") lDevice:set_frequency(lSetFrequency.Frequency) else - WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on") + ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on") end end end diff --git a/ExportsModules/Bf-109K-4.lua b/Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua similarity index 55% rename from ExportsModules/Bf-109K-4.lua rename to Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua index c2e8c3e..febd1c6 100644 --- a/ExportsModules/Bf-109K-4.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Bf-109K-4.lua @@ -1,404 +1,314 @@ --- Bf-109K-4 Kurfürst --- Version 0.9.9 - -gES_FoundDCSModule = true - -gES_GlassCockpitConfigEveryFrameArguments = -{ - [1] = "%.4f", -- MW50 pressure {0.0, 3.0}kg/cm2 = {0.0, 1.0} - [2] = "%.4f", -- Airspeed Gauge {0, 100, 150, 200, 700, 750, 900, 1000} = {0.0, 0.1, 0.15, 0.2, 0.7, 0.75, 0.9, 1.0} - -- Artificial horizon Fl_22415 - [3] = "%.4f", -- turn indicator {-1.0, 1.0} - [4] = "%.4f", -- Bank {1.0, -1.0} - [5] = "%.4f", -- Pitch {1.0, -1.0} - [6] = "%.4f", -- Slipball {-1.0, 1.0} - [7] = "%.4f", -- Caged {0.0, 1.0} - --Altitude Gauge - [8] = "%.4f", -- Altimeter_FinePtr {0.0, 1000.0} = {0.0, 1.0} - [9] = "%.4f", -- Altimeter_CoarsePtr {0.0, 13000.0} = {0.0, 1.0} - [10] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0} - [11] = "%.4f", -- Pressure_Setter_Pinion {0.0, 1440.0} = {0.0, 1.0} - -- AN5730 remote compass - [13] = "%.4f", -- CompassHeading {0.0, 1.0} - [12] = "%.4f", -- CommandedCourse {0.0, 1.0} - -- AFN2 blind landing system - [14] = "%.4f", -- AFN2_Horizontal_Needle {-1.0, 1.0} - [15] = "%.4f", -- AFN2_Vertical_Needle {0.0, 1.0} - [16] = "%1d", -- AFN2_Signal_Lamp {0.0, 1.0} - --Dual-Range Pressure Gauge - [25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0} - [26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0} - [27] = "%.4f", -- Coolant_Temperature {-1, 0, 130} = {-1, 0, 1} - [28] = "%.4f", -- Oil_Temperature {-1, 0, 130} = {-1, 0, 1} - [29] = "%.4f", -- Engine_RPM {400.0, 3600.0} = {0.0, 1.0} - -- propeller pitch indicator, changed 1hour every 6degrees of pitch change - [30] = "%.4f", -- Propeller_Pitch_Hour {0.0, 12.0} = {0.0, 1.0} - [31] = "%.4f", -- Propeller_Pitch_Minute {0.0, 60.0} = {0.0, 1.0} - -- Manifold_Pressure - [32] = "%.4f", -- Manifold_Pressure {0.6, 1.8} = {0.0, 1.0} - --fuel system - [33] = "%.4f", -- Fuel_Tank_Fuselage {-1.0, 0.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0} -- Liters = {-1.0, 0.0, 0.07, 0.175, 0.31, 0.52, 0.73, 0.88, 1.0} - --oxygen pressure indicator - [34] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0} - [35] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0} - -- Variometer - [36] = "%.2f", -- Variometer {-30, -10, -5, 0, 5, 10, 30} = {-0.3, -0.1, -0.05, 0.0, 0.05, 0.1, 0.3} - --Weapon gauges - [40] = "%.4f", -- MG131_0_Shell_Counter {0.0, 500.0} = {0.0, 1.0} - [41] = "%.4f", -- MG131_1_Shell_Counter {0.0, 500.0} = {0.0, 1.0} - [42] = "%.4f", -- MG131_0_Klappanker {0.0, 60.0} = {0.0, 1.0} - [43] = "%.4f", -- MG131_1_Klappanker {0.0, 60.0} = {0.0, 1.0} - [44] = "%1d", -- LeftWing_MG151_Control_Lamp {0.0, 1.0} - [45] = "%1d", -- RightWing_MG151_Control_Lamp {0.0, 1.0} - --REVI_16B_Gunsight - [46] = "%4.f", -- BodyState {0.0, 0.15,0.25, 1.0} = {0.0, 0.15,0.25, 1.0} - [47] = "%4.f", -- SmokedScreen {0.0, 1.0} - [48] = "%4.f", -- SightBrightness {0.0, 1.0} - -- Landing Gear Light - [56] = "%1d", -- LandingGearRedLight {0.0, 1.0} - [57] = "%1d", -- LandingGearGreenLightLeft {0.0, 1.0} - [58] = "%1d", -- LandingGearGreenLightRight {0.0, 1.0} - -- Fuel_Reserve_Lamp - [135] = "%1d" -- Fuel_Reserve_Lamp {0.0, 29.0} = {0.0, 1.0} -} -gES_GlassCockpitConfigArguments = -{ - -- FuseBox Controls - Electrical Switches - -- RH Fuse Box Circuit Breakers - -- Left Row - -- A 100 - Generator Cut-Off Relay - [114] = "%1d", -- Generator On {0, 1} - [151] = "%1d", -- Generator OFF {0, 1} - -- D 100 - Heating CB - [115] = "%1d", -- Pitot/Windscreen Heating On {0, 1} - [152] = "%1d", -- Pitot/Windscreen Heating OFF {0, 1} - -- C 100 - Navigation Lights CB - [116] = "%1d", -- Nav. Lights On {0, 1} - [153] = "%1d", -- Nav. Lights OFF {0, 1} - -- C 101 - Instrument Panel Illumination CB {0, 1} - [117] = "%1d", -- UV Lights On {0, 1} - [154] = "%1d", -- UV Lights Off {0, 1} - -- V 101 - Drop Ordnance & Optional Armament CB - [118] = "%1d", -- Wing / Drop Ordnance On {0, 1} - [155] = "%1d", -- Wing / Drop Ordnance Off {0, 1} - -- V 100 - Systematic & Ignition CB - [119] = "%1d", -- Ignition On {0, 1} - [156] = "%1d", -- Ignition Off {0, 1} - -- Spotlights CB - TODO implement when landing lights rustsatz is available - --[] = "%1d", -- Spotlights On {0, 1} - --[] = "%1d", -- Spotlights Off {0, 1} - -- Right Row - -- A 101 - Battery Cut-Off Relay - [120] = "%1d", -- Battery On {0, 1} - [157] = "%1d", -- Battery Off {0, 1} - -- F 135 - Radio CB - Labelled "FuG 16" - [121] = "%1d", -- Radio On {0, 1} - [158] = "%1d", -- Radio Off {0, 1} - -- F 211 - IFF CB - Labelled "FuG 25a" - [122] = "%1d", -- IFF On {0, 1} - [159] = "%1d", -- IFF Off {0, 1} - -- E 101 - Fuel Pump CB - Labelled "Tankpumpe" - [123] = "%1d", -- Fuel Pump On {0, 1} - [160] = "%1d", -- Fuel Pump Off {0, 1} - -- Ignition Controls and Starter and Motor-Related Switches - -- Magneto Selector - [59] = "%.1f", -- Magnetos (Off, M1, M2, M1+M2) {0.0, 0.1, 0.2, 0.3} - -- Starter Handle Cover - [51] = "%.1d", -- Starter Handle Cover {0, 1} - -- Starter Turn Handle - [52] = "%.1d", -- Starter {0, 1} - -- WM-Kommandgerat Toggle - [62] = "%.1d", -- Governor Automation {0, 1} - -- Dashboard and Secondary Switches - -- A 104 - Kill Switch - [49] = "%.1d", -- Kill Switch {0, 1} - -- Button T - Gun Camera Trigger - [149] = "%.1d", -- Button T {0, 1} - -- SZKK3 Weapons Control Master Switch - [37] = "%.1d", -- Weapons Master {0, 1} - -- LH SZ 500 Ammo Counter - [38] = "%.1f", -- Left Ammo Counter Setter Pinion (axis) {0.0 - 0.0} - -- RH SZ 500 Ammo Counter - [39] = "%.1f", -- Right Ammo Counter Setter Pinion (axis) {0.0 - 0.0} - -- MW50 Operational Toggle - [60] = "%.1d", -- MW50 Boost {0, 1} - -- Wing Cannons Toggle - [61] = "%.1d", -- Wing Cannons {0, 1} - -- MK 108 / Wing Guns Toggle - [62] = "%.1d", -- MK 108 / R 21 {0, 1} - -- R 101 ZSK 244 A Bomb Panel Master Switch - -- Operated internally via ZSK 244 A Mode Control - -- R 101 ZSK 244 A Mode Selector - [64] = "%.1f", -- Bomb Fusing Selector (DIVE (INSTANT), DIVE (DELAYED), OFF, LEVEL (DELAYED), LEVEL (INSTANT)) {0.0, 0.25, 0.5, 0.75, 1.0} - -- Illumination Controls - -- C 102 LH UV Lamp Rheostat - [80] = "%.1f", -- Left UV Lamp Brightness (axis) {0.0 - 0.5} - -- C 103 RH UV Lamp Rheostat - [82] = "%.1f", -- Right UV Lamp Brightness (axis) {0.0 - 0.5} - -- Oxygen Apparatus Controls - -- Apparatus Connecting Valve - [127] = "%.1d", -- Oxygen Operating Valve {0, 1} - [126] = "%.1d", -- Oxygen Emergency By-Pass {0, 1} - -- Main Panel Controls - -- Undercarriage Controls - -- U/C Plungers Cover - [53] = "%.1d", -- Undercarriage Controls Cover {0, 1} - [54] = "%.1d", -- Undercarriage Raise {1.0, 1.0} - [55] = "%.1d", -- Undercarriage Lower {1.0, 1.0} - [63] = "%.1d", -- Undercarriage Emergency Release - -- Fuel and MW50 Systems Controls - -- Fuel Primer Hand Pump - [140] = "%.1d", -- Fuel Priming Pump {0, 1} - -- Schnellstop Lever - [88] = "%.1d", -- Engine Stop {0, 1} - -- Booster Pumps Lever - [87] = "%.1f", -- Booster Pumps (Off, P1, P2, P1+P2) {0.0, 0.1, 0.2, 0.3} - -- Stoff-Kraftstoff Ventilbatterie Lever - [96] = "%.1d", -- MW / Fuel {0, 1} - -- Fuel Jettison Knob - [112] = "%.1d", -- "Fuel / MW Jettison {0, 1} - -- Coolant System Controls - -- Radiator Mode Lever {0, 1} - [113] = "%.1f", -- Radiators Mode (Drive Off, Open, Automatic, Close) {0.0, 0.1, 0.2, 0.3} - -- LH Radiator Hose Cut-Off Pull Handle - [90] = "%.1d", -- LH Radiator Cut-Off {0, 1} - -- RH Radiator Hose Cut-Off Pull Handle - [91] = "%.1d", -- RH Radiator Cut-Off {0, 1} - -- Navigation Instruments - -- Altimeter - [11] = "%.2f", -- Altimeter Pressure Set (axis) 1.0 in 0.04 steps - -- Artificial Horizon - [7] = "%.2f", -- Horizon Cage (axis) {0.0, 0.511} in 0.04 steps - -- Repeater Compass - [12] = "%.2f", -- Course Set (axis) 0.0 in 0.04 steps - -- Instruments - -- Clock Scale - [21] = "%.8f", -- Scale Set (axis) 0.0 in 0.01612434 steps - -- Clock Setter Pinion - [22] = "%.1f", -- Adjusting Knob (axis) 0.0 in 0.1 steps - -- Clock Freeze Lever - [23] = "%.1d", -- Time Setting Lever {0, 1} - -- Clock Stopwatch Button - [24] = "%.1d", -- Start/Stop/Reset Chronometer - -- P 112 Gun Sight Brightness Rheostat {0, 1} - [48] = "%.1f", -- Gun Sight Brightness (axis) 0.5 in 0.1 steps - -- P 112 Gun Sight Folding Controls - [139] = "%.1d", -- Gunsight Fold {0, 1} - -- P 112 Gun Sight Smoked Screen Controls - [47] = "%.1d", -- Gunsight Smoked Screen {0, 1} - -- Radio Controls - -- FUG16 - [128] = "%.1f", -- FuG16ZY Preset Selector (1, 2, TR, SQ) {0.0, 0.1, 0.2, 0.3} - [129] = "%.2f", -- FuG16 ZY Fine Tune (axis) 0.5 in 0.05 steps - [130] = "%.2f", -- FuG16 ZY Volume (axis) 0.0 in 0.04 steps - [131] = "%.1d", -- "Mic. On/Off {0, 1} - -- FUG25 - [132] = "%.1f", -- FuG25 Mode Selector (1, 2) {0.0, 1.0} - [133] = "%.1d", -- FuG25 Test {0, 1} - -- Left Wall Controls - -- Tail Wheel Lock Handle - [97] = "%.1d", -- Tail Wheel Lock {0, 1} - -- Cockpit Open/Close Control - [136] = "%.1d", -- Canopy (Open/Close) {0, 1} - [137] = "%.1d", -- Canopy (Open/Close) H {0, 1} - [138] = "%.1d", -- Canopy (Open/Close) S {0, 1} - -- Cockpit Jettison Pull Handle - [83] = "%.1d", -- Jettison Canopy {0, 1} - -- Trim Wheel - [141] = "%.1d", -- Stabilizer Trim Nose Up {0, 1} - [142] = "%.1d", -- Stabilizer Trim Nose Down {0, 1} - -- Flaps Wheel - [143] = "%.1d", -- Extend Flaps {0, 1} - [144] = "%.1d", -- Retract Flaps {0, 1} - -- Notwurf / Ordinance Dump - [92] = "%.1d", -- Ordinance Emergency Release - --[98] = "$.1d", -- Cockpit Left Vent {0, 1} - -- Right Wall Controls - -- RH Cockpit Vent - --[99] = "%.1d", -- Cockpit Right Vent {0, 1} - -- Flare Gun Trigger - [72] = "%.1d", -- Fire Flare Gun - -- Engine Controls & Quadrant - -- Propellor Control Rocker - [85] = "%.1f", -- Decrease RPM {1.0, -1.0} - -- Radio Transmit Button - [150] = "%.1d", -- Microphone On {0, 1} - -- E 103 Propellor Automation Switch - [89] = "%.1d", -- Governor Automation {0, 1} - -- Cold Weather Start Valve Handle - [86] = "%.1d" -- Cold Weather Start {0, 1} -} - ------------------------------ --- HIGH IMPORTANCE EXPORTS -- --- done every export event -- ------------------------------ - --- Pointed to by ProcessGlassCockpitDCSHighImportance -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - -- LwMW50P - --SendData("1", string.format("%0.4f", mainPanelDevice:get_argument_value(1))) - -- LwASI - --SendData("2", string.format("%0.4f", mainPanelDevice:get_argument_value(2))) - -- ME4KH2OTemp - --SendData("27", string.format("%0.4f", mainPanelDevice:get_argument_value(27))) - -- ME4KOilTemp - --SendData("28", string.format("%0.4f", mainPanelDevice:get_argument_value(28))) - -- LwMAP - --SendData("32", string.format("%0.4f", mainPanelDevice:get_argument_value(32))) - -- ME4KFuel - --SendData("33", string.format("%0.4f", mainPanelDevice:get_argument_value(33))) - -- LwO2P - --SendData("34", string.format("%0.4f", mainPanelDevice:get_argument_value(34))) - -- LwBlink - --SendData("35", string.format("%0.4f", mainPanelDevice:get_argument_value(35))) - -- LwVSI - --SendData("36", string.format("%0.4f", mainPanelDevice:get_argument_value(36))) - -- LwALT - --Altimeter_km, Altimeter_m, Altimeter_Pressure - --[8] = "%.4f", -- Altimeter_FinePtr {0.0, 1000.0} = {0.0, 1.0} - --[9] = "%.4f", -- Altimeter_CoarsePtr {0.0, 13000.0} = {0.0, 1.0} - --[10] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0} - --[11] = "%.4f", -- Pressure_Setter_Pinion {0.0, 1440.0} = {0.0, 1.0} - SendData("2000", string.format("%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(9), - mainPanelDevice:get_argument_value(8), - mainPanelDevice:get_argument_value(10))) - -- LwAtt - --AHorizon_Bank, AHorizon_Pitch, TurnNeedle, Slipball - --[3] = "%.4f", -- turn indicator {-1.0, 1.0} - --[4] = "%.4f", -- Bank {1.0, -1.0} - --[5] = "%.4f", -- Pitch {1.0, -1.0} - --[6] = "%.4f", -- Slipball {-1.0, 1.0} - --[7] = "%.4f", -- Caged {0.0, 1.0} - SendData("2001", string.format("%0.3f;%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(4), - mainPanelDevice:get_argument_value(5), - mainPanelDevice:get_argument_value(3), - mainPanelDevice:get_argument_value(6))) - -- LwHead - --CompassHeading, CommandedCourse - --[13] = "%.4f", -- CompassHeading {0.0, 1.0} - --[12] = "%.4f", -- CommandedCourse {0.0, 1.0} - SendData("2002", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(13), - mainPanelDevice:get_argument_value(12))) - -- LwClock, - -- No Id for Clock - --CLOCK_currtime_hours, CLOCK_currtime_minutes, CLOCK_currtime_seconds, CLOCK_chrono_minutes - --SendData("2003", string.format("%0.2f;%0.2f;%0.2f;%0.2f", mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value(), mainPanelDevice:get_argument_value())) - -- LwDblP - --Oil_Pressure; Fuel_Pressure; - --[25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0} - --[26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0} - SendData("2004", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(26), - mainPanelDevice:get_argument_value(25))) - -- LwAFN2 - --AFN2_Horizontal_Needle, AFN2_Vertical_Needle, AFN2_Signal_Lamp - --[14] = "%.4f", -- AFN2_Horizontal_Needle {0.0, 1.0} - --[15] = "%.4f", -- AFN2_Vertical_Needle {-1.0, 1.0} - --[16] = "%1d", -- AFN2_Signal_Lamp {0.0, 1.0} - SendData("2005", string.format("%0.3f;%0.3f;%0.3f", mainPanelDevice:get_argument_value(14), - mainPanelDevice:get_argument_value(15), - mainPanelDevice:get_argument_value(16))) - -- LwProp - --Propeller_Pitch_Hour; Propeller_Pitch_Minute - --[30] = "%.4f", -- Propeller_Pitch_Hour {0.0, 12.0} = {0.0, 1.0} - --[31] = "%.4f", -- Propeller_Pitch_Minute {0.0, 60.0} = {0.0, 1.0} - SendData("2006", string.format("%0.3f;%0.3f", mainPanelDevice:get_argument_value(30), - mainPanelDevice:get_argument_value(31))) - end -end - -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) --- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll --- In der Regel sind das die Statusanzeigen - --- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware --- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen --- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der übergeben DCS ID aus dem Spiel ausliest --- 178 ist die DCS ID von dem man die Werte haben will --- Description - --SendDataHW("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE - --SendDataHW("", mainPanelDevice:get_argument_value()) -- - - SendDataHW("16", mainPanelDevice:get_argument_value(16)) -- AFN2_Signal_Lamp - SendDataHW("35", mainPanelDevice:get_argument_value(35) > 0.8 and 1 or 0) -- Oxygen_Flow_Blinker - SendDataHW("42", mainPanelDevice:get_argument_value(42) > 0.8 and 1 or 0) -- MG131_0_Klappanker - SendDataHW("43", mainPanelDevice:get_argument_value(43) > 0.8 and 1 or 0) -- MG131_1_Klappanker - SendDataHW("44", mainPanelDevice:get_argument_value(44)) -- LeftWing_MG151_Control_Lamp - SendDataHW("45", mainPanelDevice:get_argument_value(45)) -- RightWing_MG151_Control_Lamp - SendDataHW("56", mainPanelDevice:get_argument_value(56)) -- LandingGearRedLight - SendDataHW("57", mainPanelDevice:get_argument_value(57)) -- LandingGearGreenLightLeft - SendDataHW("58", mainPanelDevice:get_argument_value(58)) -- LandingGearGreenLightRight - SendDataHW("135", mainPanelDevice:get_argument_value(135) > 0.8 and 1 or 0) -- Pitot_Heat_Lamp - -- ??? SendDataHW("135", mainPanelDevice:get_argument_value(135)) -- Fuel_Reserve_Lamp - -- Bomb lamps ???? ---[[ - WriteToLog('AFN2_Signal_Lamp: '..dump(mainPanelDevice:get_argument_value(16))) - WriteToLog('Oxygen_Flow_Blinker: '..dump(mainPanelDevice:get_argument_value(mainPanelDevice:get_argument_value(35)))) - WriteToLog('MG131_0_Klappanker: '..dump(mainPanelDevice:get_argument_value(42))) - WriteToLog('MG131_1_Klappanker: '..dump(mainPanelDevice:get_argument_value(43))) - WriteToLog('LeftWing_MG151_Control_Lamp: '..dump(mainPanelDevice:get_argument_value(44))) - WriteToLog('RightWing_MG151_Control_Lamp: '..dump(mainPanelDevice:get_argument_value(46))) - WriteToLog('LandingGearRedLight: '..dump(mainPanelDevice:get_argument_value(56))) - WriteToLog('LandingGearGreenLightLeft: '..dump(mainPanelDevice:get_argument_value(57))) - WriteToLog('LandingGearGreenLightRight: '..dump(mainPanelDevice:get_argument_value(58))) - WriteToLog('Pitot_Heat_Lamp: '..dump(mainPanelDevice:get_argument_value(135))) -]] -end - ------------------------------------------------------ --- LOW IMPORTANCE EXPORTS -- --- done every gExportLowTickInterval export events -- ------------------------------------------------------ - --- Pointed to by ProcessGlassCockpitDCSConfigLowImportance -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) -end - -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) - --[[ - every frame export to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config - ]] - - local lRADIO = GetDevice(14) - SendDataHW("2000", string.format("%7.3f", lRADIO:get_frequency()/1000000)) - - --===================================================================================== - --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - WriteToLog('CMSP: '..dump(list_indication(7))) - - local ltmp1 = 0 - for ltmp2 = 0, 13, 1 do - ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] ---[[ - local ltmp1 = 0 - for ltmp2 = 1, 16, 1 do - ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end -]] -end - ------------------------------ --- Custom functions -- ------------------------------ - -function genericRadio(key, value, hardware) -end +-- Bf-109K-4 Kurfürst +-- Version 1.0.0 BETA + +ExportScript.FoundDCSModule = true + +ExportScript.ConfigEveryFrameArguments = +{ + [1] = "%.4f", -- MW50 pressure {0.0, 3.0}kg/cm2 = {0.0, 1.0} + [2] = "%.4f", -- Airspeed Gauge {0, 100, 150, 200, 700, 750, 900, 1000} = {0.0, 0.1, 0.15, 0.2, 0.7, 0.75, 0.9, 1.0} + -- Artificial horizon Fl_22415 + [3] = "%.4f", -- turn indicator {-1.0, 1.0} + [4] = "%.4f", -- Bank {1.0, -1.0} + [5] = "%.4f", -- Pitch {1.0, -1.0} + [6] = "%.4f", -- Slipball {-1.0, 1.0} + [7] = "%.4f", -- Caged {0.0, 1.0} + --Altitude Gauge + [8] = "%.4f", -- Altimeter_FinePtr {0.0, 1000.0} = {0.0, 1.0} + [9] = "%.4f", -- Altimeter_CoarsePtr {0.0, 13000.0} = {0.0, 1.0} + [10] = "%.4f", -- Altimeter_Pressure {712.56, 780.07} = {0.0, 1.0} + [11] = "%.4f", -- Pressure_Setter_Pinion {0.0, 1440.0} = {0.0, 1.0} + -- AN5730 remote compass + [13] = "%.4f", -- CompassHeading {0.0, 1.0} + [12] = "%.4f", -- CommandedCourse {0.0, 1.0} + -- AFN2 blind landing system + [14] = "%.4f", -- AFN2_Horizontal_Needle {-1.0, 1.0} + [15] = "%.4f", -- AFN2_Vertical_Needle {0.0, 1.0} + [16] = "%f", -- AFN2_Signal_Lamp {0.0, 1.0} + --Dual-Range Pressure Gauge + [25] = "%.4f", -- Fuel_Pressure {0.0, 2.0} -- kg/cm2 = {0.0, 1.0} + [26] = "%.4f", -- Oil_Pressure {0.0, 10.0} = {0, 1.0} + [27] = "%.4f", -- Coolant_Temperature {-1, 0, 130} = {-1, 0, 1} + [28] = "%.4f", -- Oil_Temperature {-1, 0, 130} = {-1, 0, 1} + [29] = "%.4f", -- Engine_RPM {400.0, 3600.0} = {0.0, 1.0} + -- propeller pitch indicator, changed 1hour every 6degrees of pitch change + [30] = "%.4f", -- Propeller_Pitch_Hour {0.0, 12.0} = {0.0, 1.0} + [31] = "%.4f", -- Propeller_Pitch_Minute {0.0, 60.0} = {0.0, 1.0} + -- Manifold_Pressure + [32] = "%.4f", -- Manifold_Pressure {0.6, 1.8} = {0.0, 1.0} + --fuel system + [33] = "%.4f", -- Fuel_Tank_Fuselage {-1.0, 0.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0} -- Liters = {-1.0, 0.0, 0.07, 0.175, 0.31, 0.52, 0.73, 0.88, 1.0} + --oxygen pressure indicator + [34] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0} + --[35] = "%.1f", -- Oxygen_Flow_Blinker {0.0, 1.0} + -- Variometer + [36] = "%.2f", -- Variometer {-30, -10, -5, 0, 5, 10, 30} = {-0.3, -0.1, -0.05, 0.0, 0.05, 0.1, 0.3} + --Weapon gauges + [40] = "%.4f", -- MG131_0_Shell_Counter {0.0, 500.0} = {0.0, 1.0} + [41] = "%.4f", -- MG131_1_Shell_Counter {0.0, 500.0} = {0.0, 1.0} + --[42] = "%.4f", -- MG131_0_Klappanker {0.0, 60.0} = {0.0, 1.0} + --[43] = "%.4f", -- MG131_1_Klappanker {0.0, 60.0} = {0.0, 1.0} + [44] = "%.f", -- LeftWing_MG151_Control_Lamp {0.0, 1.0} + [45] = "%.f", -- RightWing_MG151_Control_Lamp {0.0, 1.0} + --REVI_16B_Gunsight + [46] = "%4.f", -- BodyState {0.0, 0.15,0.25, 1.0} = {0.0, 0.15,0.25, 1.0} + [47] = "%4.f", -- SmokedScreen {0.0, 1.0} + [48] = "%4.f", -- SightBrightness {0.0, 1.0} + -- Landing Gear Light + [56] = "%.f", -- LandingGearRedLight {0.0, 1.0} + [57] = "%.f", -- LandingGearGreenLightLeft {0.0, 1.0} + [58] = "%.f", -- LandingGearGreenLightRight {0.0, 1.0} + -- Fuel_Reserve_Lamp + [135] = "%.f" -- Fuel_Reserve_Lamp {0.0, 29.0} = {0.0, 1.0} +} +ExportScript.ConfigArguments = +{ + -- FuseBox Controls - Electrical Switches + -- RH Fuse Box Circuit Breakers + -- Left Row + -- A 100 - Generator Cut-Off Relay + [114] = "%1d", -- Generator On {0, 1} + [151] = "%1d", -- Generator OFF {0, 1} + -- D 100 - Heating CB + [115] = "%1d", -- Pitot/Windscreen Heating On {0, 1} + [152] = "%1d", -- Pitot/Windscreen Heating OFF {0, 1} + -- C 100 - Navigation Lights CB + [116] = "%1d", -- Nav. Lights On {0, 1} + [153] = "%1d", -- Nav. Lights OFF {0, 1} + -- C 101 - Instrument Panel Illumination CB {0, 1} + [117] = "%1d", -- UV Lights On {0, 1} + [154] = "%1d", -- UV Lights Off {0, 1} + -- V 101 - Drop Ordnance & Optional Armament CB + [118] = "%1d", -- Wing / Drop Ordnance On {0, 1} + [155] = "%1d", -- Wing / Drop Ordnance Off {0, 1} + -- V 100 - Systematic & Ignition CB + [119] = "%1d", -- Ignition On {0, 1} + [156] = "%1d", -- Ignition Off {0, 1} + -- Spotlights CB - TODO implement when landing lights rustsatz is available + --[] = "%1d", -- Spotlights On {0, 1} + --[] = "%1d", -- Spotlights Off {0, 1} + -- Right Row + -- A 101 - Battery Cut-Off Relay + [120] = "%1d", -- Battery On {0, 1} + [157] = "%1d", -- Battery Off {0, 1} + -- F 135 - Radio CB - Labelled "FuG 16" + [121] = "%1d", -- Radio On {0, 1} + [158] = "%1d", -- Radio Off {0, 1} + -- F 211 - IFF CB - Labelled "FuG 25a" + [122] = "%1d", -- IFF On {0, 1} + [159] = "%1d", -- IFF Off {0, 1} + -- E 101 - Fuel Pump CB - Labelled "Tankpumpe" + [123] = "%1d", -- Fuel Pump On {0, 1} + [160] = "%1d", -- Fuel Pump Off {0, 1} + -- Ignition Controls and Starter and Motor-Related Switches + -- Magneto Selector + [59] = "%.1f", -- Magnetos (Off, M1, M2, M1+M2) {0.0, 0.1, 0.2, 0.3} + -- Starter Handle Cover + [51] = "%.1d", -- Starter Handle Cover {0, 1} + -- Starter Turn Handle + [52] = "%.1d", -- Starter {0, 1} + -- WM-Kommandgerat Toggle + [62] = "%.1d", -- Governor Automation {0, 1} + -- Dashboard and Secondary Switches + -- A 104 - Kill Switch + [49] = "%.1d", -- Kill Switch {0, 1} + -- Button T - Gun Camera Trigger + [149] = "%.1d", -- Button T {0, 1} + -- SZKK3 Weapons Control Master Switch + [37] = "%.1d", -- Weapons Master {0, 1} + -- LH SZ 500 Ammo Counter + [38] = "%.1f", -- Left Ammo Counter Setter Pinion (axis) {0.0 - 0.0} + -- RH SZ 500 Ammo Counter + [39] = "%.1f", -- Right Ammo Counter Setter Pinion (axis) {0.0 - 0.0} + -- MW50 Operational Toggle + [60] = "%.1d", -- MW50 Boost {0, 1} + -- Wing Cannons Toggle + [61] = "%.1d", -- Wing Cannons {0, 1} + -- MK 108 / Wing Guns Toggle + [62] = "%.1d", -- MK 108 / R 21 {0, 1} + -- R 101 ZSK 244 A Bomb Panel Master Switch + -- Operated internally via ZSK 244 A Mode Control + -- R 101 ZSK 244 A Mode Selector + [64] = "%.1f", -- Bomb Fusing Selector (DIVE (INSTANT), DIVE (DELAYED), OFF, LEVEL (DELAYED), LEVEL (INSTANT)) {0.0, 0.25, 0.5, 0.75, 1.0} + -- Illumination Controls + -- C 102 LH UV Lamp Rheostat + [80] = "%.1f", -- Left UV Lamp Brightness (axis) {0.0 - 0.5} + -- C 103 RH UV Lamp Rheostat + [82] = "%.1f", -- Right UV Lamp Brightness (axis) {0.0 - 0.5} + -- Oxygen Apparatus Controls + -- Apparatus Connecting Valve + [127] = "%.1d", -- Oxygen Operating Valve {0, 1} + [126] = "%.1d", -- Oxygen Emergency By-Pass {0, 1} + -- Main Panel Controls + -- Undercarriage Controls + -- U/C Plungers Cover + [53] = "%.1d", -- Undercarriage Controls Cover {0, 1} + [54] = "%.1d", -- Undercarriage Raise {1.0, 1.0} + [55] = "%.1d", -- Undercarriage Lower {1.0, 1.0} + [63] = "%.1d", -- Undercarriage Emergency Release + -- Fuel and MW50 Systems Controls + -- Fuel Primer Hand Pump + [140] = "%.1d", -- Fuel Priming Pump {0, 1} + -- Schnellstop Lever + [88] = "%.1d", -- Engine Stop {0, 1} + -- Booster Pumps Lever + [87] = "%.1f", -- Booster Pumps (Off, P1, P2, P1+P2) {0.0, 0.1, 0.2, 0.3} + -- Stoff-Kraftstoff Ventilbatterie Lever + [96] = "%.1d", -- MW / Fuel {0, 1} + -- Fuel Jettison Knob + [112] = "%.1d", -- "Fuel / MW Jettison {0, 1} + -- Coolant System Controls + -- Radiator Mode Lever {0, 1} + [113] = "%.1f", -- Radiators Mode (Drive Off, Open, Automatic, Close) {0.0, 0.1, 0.2, 0.3} + -- LH Radiator Hose Cut-Off Pull Handle + [90] = "%.1d", -- LH Radiator Cut-Off {0, 1} + -- RH Radiator Hose Cut-Off Pull Handle + [91] = "%.1d", -- RH Radiator Cut-Off {0, 1} + -- Navigation Instruments + -- Altimeter + [11] = "%.2f", -- Altimeter Pressure Set (axis) 1.0 in 0.04 steps + -- Artificial Horizon + [7] = "%.2f", -- Horizon Cage (axis) {0.0, 0.511} in 0.04 steps + -- Repeater Compass + [12] = "%.2f", -- Course Set (axis) 0.0 in 0.04 steps + -- Instruments + -- Clock Scale + [21] = "%.8f", -- Scale Set (axis) 0.0 in 0.01612434 steps + -- Clock Setter Pinion + [22] = "%.1f", -- Adjusting Knob (axis) 0.0 in 0.1 steps + -- Clock Freeze Lever + [23] = "%.1d", -- Time Setting Lever {0, 1} + -- Clock Stopwatch Button + [24] = "%.1d", -- Start/Stop/Reset Chronometer + -- P 112 Gun Sight Brightness Rheostat {0, 1} + [48] = "%.1f", -- Gun Sight Brightness (axis) 0.5 in 0.1 steps + -- P 112 Gun Sight Folding Controls + [139] = "%.1d", -- Gunsight Fold {0, 1} + -- P 112 Gun Sight Smoked Screen Controls + [47] = "%.1d", -- Gunsight Smoked Screen {0, 1} + -- Radio Controls + -- FUG16 + [128] = "%.1f", -- FuG16ZY Preset Selector (1, 2, TR, SQ) {0.0, 0.1, 0.2, 0.3} + [129] = "%.2f", -- FuG16 ZY Fine Tune (axis) 0.5 in 0.05 steps + [130] = "%.2f", -- FuG16 ZY Volume (axis) 0.0 in 0.04 steps + [131] = "%.1d", -- "Mic. On/Off {0, 1} + -- FUG25 + [132] = "%.1f", -- FuG25 Mode Selector (1, 2) {0.0, 1.0} + [133] = "%.1d", -- FuG25 Test {0, 1} + -- Left Wall Controls + -- Tail Wheel Lock Handle + [97] = "%.1d", -- Tail Wheel Lock {0, 1} + -- Cockpit Open/Close Control + [136] = "%.1d", -- Canopy (Open/Close) {0, 1} + [137] = "%.1d", -- Canopy (Open/Close) H {0, 1} + [138] = "%.1d", -- Canopy (Open/Close) S {0, 1} + -- Cockpit Jettison Pull Handle + [83] = "%.1d", -- Jettison Canopy {0, 1} + -- Trim Wheel + [141] = "%.1d", -- Stabilizer Trim Nose Up {0, 1} + [142] = "%.1d", -- Stabilizer Trim Nose Down {0, 1} + -- Flaps Wheel + [143] = "%.1d", -- Extend Flaps {0, 1} + [144] = "%.1d", -- Retract Flaps {0, 1} + -- Notwurf / Ordinance Dump + [92] = "%.1d", -- Ordinance Emergency Release + --[98] = "$.1d", -- Cockpit Left Vent {0, 1} + -- Right Wall Controls + -- RH Cockpit Vent + --[99] = "%.1d", -- Cockpit Right Vent {0, 1} + -- Flare Gun Trigger + [72] = "%.1d", -- Fire Flare Gun + -- Engine Controls & Quadrant + -- Propellor Control Rocker + [85] = "%.1f", -- Decrease RPM {1.0, -1.0} + -- Radio Transmit Button + [150] = "%.1d", -- Microphone On {0, 1} + -- E 103 Propellor Automation Switch + [89] = "%.1d", -- Governor Automation {0, 1} + -- Cold Weather Start Valve Handle + [86] = "%.1d" -- Cold Weather Start {0, 1} +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + ExportScript.Tools.SendData(35, string.format("%0.4f", mainPanelDevice:get_argument_value(35))) -- Oxygen_Flow_Blinker + ExportScript.Tools.SendData(42, string.format("%0.4f", mainPanelDevice:get_argument_value(42))) -- MG131_0_Klappanker + ExportScript.Tools.SendData(43, string.format("%0.4f", mainPanelDevice:get_argument_value(43))) -- MG131_1_Klappanker +end + +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) +-- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll +-- In der Regel sind das die Statusanzeigen + +-- ExportScript.Tools.SendDataDAC(), ist die Funktion zur Ausgabe der Werte an die Hardware +-- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen +-- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der übergeben DCS ID aus dem Spiel ausliest +-- 178 ist die DCS ID von dem man die Werte haben will +-- Description + --ExportScript.Tools.SendDataDAC("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE + --ExportScript.Tools.SendDataDAC("", mainPanelDevice:get_argument_value()) -- +end + +----------------------------------------------------- +-- LOW IMPORTANCE EXPORTS -- +-- done every gExportLowTickInterval export events -- +----------------------------------------------------- + +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) +end + +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) + --[[ + every frame export to hardware + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + + local lRADIO = GetDevice(14) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lRADIO:get_frequency()/1000000)) + + -- Lamps + ExportScript.Tools.SendDataDAC("35", mainPanelDevice:get_argument_value(35) > 0.8 and 1 or 0) -- Oxygen_Flow_Blinker + ExportScript.Tools.SendDataDAC("42", mainPanelDevice:get_argument_value(42) > 0.8 and 1 or 0) -- MG131_0_Klappanker + ExportScript.Tools.SendDataDAC("43", mainPanelDevice:get_argument_value(43) > 0.8 and 1 or 0) -- MG131_1_Klappanker + + --===================================================================================== + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) + + local ltmp1 = 0 + for ltmp2 = 0, 13, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] +--[[ + local ltmp1 = 0 + for ltmp2 = 1, 16, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end +]] +end + +----------------------------- +-- Custom functions -- +----------------------------- + +function ExportScript.genericRadio(key, value, hardware) +end diff --git a/Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua b/Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua new file mode 100644 index 0000000..6a68efc --- /dev/null +++ b/Scripts/DCS-ExportScript/ExportsModules/Empty-DCS.lua @@ -0,0 +1,117 @@ +-- modul name +-- Version + +ExportScript.FoundDCSModule = true + +ExportScript.ConfigEveryFrameArguments = +{ + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] +} +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] +end + +----------------------------------------------------- +-- LOW IMPORTANCE EXPORTS -- +-- done every gExportLowTickInterval export events -- +----------------------------------------------------- + +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + + --===================================================================================== + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) + + local ltmp1 = 0 + for ltmp2 = 0, 13, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] +--[[ + local ltmp1 = 0 + for ltmp2 = 1, 73, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end +]] +end + +----------------------------- +-- Custom functions -- +----------------------------- + +function ExportScript.genericRadio(key, value, hardware) +end diff --git a/ExportsModules/F-15C.lua b/Scripts/DCS-ExportScript/ExportsModules/F-15C.lua similarity index 100% rename from ExportsModules/F-15C.lua rename to Scripts/DCS-ExportScript/ExportsModules/F-15C.lua diff --git a/ExportsModules/F-86F Sabre.lua b/Scripts/DCS-ExportScript/ExportsModules/F-86F Sabre.lua similarity index 68% rename from ExportsModules/F-86F Sabre.lua rename to Scripts/DCS-ExportScript/ExportsModules/F-86F Sabre.lua index e14221f..6db4e5d 100644 --- a/ExportsModules/F-86F Sabre.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/F-86F Sabre.lua @@ -1,10 +1,20 @@ -- F-86 Export --- Version 0.9.9 BETA +-- Version 1.0.0 BETA -gES_FoundDCSModule = true +ExportScript.FoundDCSModule = true -gES_GlassCockpitConfigEveryFrameArguments = +ExportScript.ConfigEveryFrameArguments = { + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] -- Mechanic clock [19] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0} = {0.0, 1.0} [18] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0} = {0.0, 1.0} @@ -74,36 +84,41 @@ gES_GlassCockpitConfigEveryFrameArguments = [814] = "%.4f", -- ARN6_Scale {1.0, 0.0} [830] = "%.4f", -- ARN6_FreqScale {0.0, 1.0} -- light system - [182] = "%.4f", -- IlluminationLights {0.0, 1.0} - [825] = "%.4f", -- StandByCompassLight {0.0, 1.0} - [180] = "%.4f", -- PrimaryInstLights {0.0, 1.0} - [185] = "%.4f", -- AuxiliaryInstrumentLights {0.0, 1.0} + [182] = "%.f", -- IlluminationLights {0.0, 1.0} + [825] = "%.f", -- StandByCompassLight {0.0, 1.0} + [180] = "%.f", -- PrimaryInstLights {0.0, 1.0} + [185] = "%.f", -- AuxiliaryInstrumentLights {0.0, 1.0} + -- [603] = "%.4f", -- LABS_roll_needle {-1.0, 1.0} [604] = "%.4f", -- LABS_pitch_needle {-1.0, 1.0} -- LAMPS -- electric system - [617] = "%.1f", -- lamp_ELEC_GenOff {-1.0, 1.0} - [610] = "%.1f", -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0} - [611] = "%.1f", -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0} - [612] = "%.1f", -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0} + [617] = "%.f", -- lamp_ELEC_GenOff {-1.0, 1.0} + [610] = "%.f", -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0} + [611] = "%.f", -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0} + [612] = "%.f", -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0} -- hydraulic system - [614] = "%.1f", -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0} - [39] = "%.1f", -- lamp_HYDRO_LeftGear {-1.0, 1.0} - [41] = "%.1f", -- lamp_HYDRO_RightGear {-1.0, 1.0} - [40] = "%.1f", -- lamp_HYDRO_NoseGear {-1.0, 1.0} + [614] = "%.f", -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0} + [39] = "%.f", -- lamp_HYDRO_LeftGear {-1.0, 1.0} + [41] = "%.f", -- lamp_HYDRO_RightGear {-1.0, 1.0} + [40] = "%.f", -- lamp_HYDRO_NoseGear {-1.0, 1.0} -- fuel system - [625] = "%.1f", -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0} + [625] = "%.f", -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0} -- fire detection system - [615] = "%.1f", -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0} - [616] = "%.1f", -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0} + [615] = "%.f", -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0} + [616] = "%.f", -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0} -- control system - [613] = "%.1f", -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0} + [613] = "%.f", -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0} -- air system - [614] = "%.1f" -- lamp_WindshieldAntiIceOverheatWarning {-1.0, 1.0} + [614] = "%.f" -- lamp_WindshieldAntiIceOverheatWarning {-1.0, 1.0} } -gES_GlassCockpitConfigArguments = +ExportScript.ConfigArguments = { + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] -- cockpit mechanics [718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 1.0} [818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0} @@ -280,109 +295,31 @@ gES_GlassCockpitConfigArguments = -- done every export event -- ----------------------------- --- Pointed to by ProcessGlassCockpitDCSHighImportance -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - - -- ACC - -- Accelerometer; AccelerometerMin; AccelerometerMax; - SendData(2001, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(6), - mainPanelDevice:get_argument_value(1003), - mainPanelDevice:get_argument_value(1002))) - -- ADI - -- AttitudeIndicatorPitch; AttitudeIndicatorBank; AttitudeIndicatorPitchSphere; AttitudeIndicatorBankNeedle; AttitudeIndicatorOffFlag - SendData(2002, string.format("%.4f;%.4f;%.4f;%.4f;%.1f", - mainPanelDevice:get_argument_value(605), - mainPanelDevice:get_argument_value(606), - mainPanelDevice:get_argument_value(81), - mainPanelDevice:get_argument_value(1005), - mainPanelDevice:get_argument_value(713))) - -- Altimeter - -- Altimeter10000; Altimeter1000; Altimeter100; AltimeterHG - SendData(2003, string.format("%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(707), - mainPanelDevice:get_argument_value(523), - mainPanelDevice:get_argument_value(524), - mainPanelDevice:get_argument_value(700))) - -- Airspeed - -- Airspeed; AirspeedDrum; AirspeedM1 - SendData(2004, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(178), - mainPanelDevice:get_argument_value(709), - mainPanelDevice:get_argument_value(8))) - -- RMI - -- ARN6_Bearing; ARN6_Scale - SendData(2008, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(600), - mainPanelDevice:get_argument_value(814))) - -- Clock - -- CLOCK_currtime_hours; CLOCK_currtime_minutes; CLOCK_currtime_seconds; CLOCK_seconds_meter_time_minutes; CLOCK_seconds_meter_time_seconds - -- CLOCK_currtime_hours; CLOCK_currtime_minutes; <= Beta - SendData(2005, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(19), - mainPanelDevice:get_argument_value(18))) - -- GyroCompass - -- GyroCompassNeedle; GyroCompassScale - SendData(2006, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(711), - mainPanelDevice:get_argument_value(712))) - -- Labs - -- LABS_roll_needle; LABS_pitch_needle - SendData(2007, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(603), - mainPanelDevice:get_argument_value(604))) - -- RMI - -- ARN6_Bearing; ARN6_Scale - SendData(2008, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(600), - mainPanelDevice:get_argument_value(814))) - -- Gear - -- Left; Right; Front - SendData(2010, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(39), - mainPanelDevice:get_argument_value(41), - mainPanelDevice:get_argument_value(40))) - end +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] end -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) --- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll --- In der Regel sind das die Statusanzeigen - --- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware --- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen --- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der �bergeben DCS ID aus dem Spiel ausliest --- 178 ist die DCS ID von dem man die Werte haben will --- Description - - -- light system - SendDataHW("182", mainPanelDevice:get_argument_value(182)) -- IlluminationLights {0.0, 1.0} - SendDataHW("825", mainPanelDevice:get_argument_value(825)) -- StandByCompassLight {0.0, 1.0} - SendDataHW("180", mainPanelDevice:get_argument_value(180)) -- PrimaryInstLights {0.0, 1.0} - SendDataHW("185", mainPanelDevice:get_argument_value(185)) -- AuxiliaryInstrumentLights {0.0, 1.0} - -- LAMPS - -- electric system - SendDataHW("617", mainPanelDevice:get_argument_value(617)) -- lamp_ELEC_GenOff {-1.0, 1.0} - SendDataHW("610", mainPanelDevice:get_argument_value(610)) -- lamp_ELEC_MainInstInverterOffSelectAlt {-1.0, 1.0} - SendDataHW("611", mainPanelDevice:get_argument_value(611)) -- lamp_ELEC_BothInstInvertersOff {-1.0, 1.0} - SendDataHW("612", mainPanelDevice:get_argument_value(612)) -- lamp_ELEC_MainRadarInverterOff {-1.0, 1.0} - -- hydraulic system - SendDataHW("614", mainPanelDevice:get_argument_value(614)) -- lamp_HYDRO_AltFltContSysOper {-1.0, 1.0} - SendDataHW("39", mainPanelDevice:get_argument_value(39)) -- lamp_HYDRO_LeftGear {-1.0, 1.0} - SendDataHW("41", mainPanelDevice:get_argument_value(41)) -- lamp_HYDRO_RightGear {-1.0, 1.0} - SendDataHW("40", mainPanelDevice:get_argument_value(40)) -- lamp_HYDRO_NoseGear {-1.0, 1.0} - -- fuel system - SendDataHW("625", mainPanelDevice:get_argument_value(625)) -- lamp_FUEL_OutbdTanksEmpty {-1.0, 1.0} - -- fire detection system - SendDataHW("615", mainPanelDevice:get_argument_value(615)) -- lamp_FIRE_DETECTION_FwdFireWarning {-1.0, 1.0} - SendDataHW("616", mainPanelDevice:get_argument_value(616)) -- lamp_FIRE_DETECTION_AftFireWarning {-1.0, 1.0} - -- control system - SendDataHW("613", mainPanelDevice:get_argument_value(613)) -- lamp_CONTROL_TakeOffPosInd {-1.0, 1.0} - +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] end ----------------------------------------------------- @@ -390,46 +327,50 @@ end -- done every gExportLowTickInterval export events -- ----------------------------------------------------- --- Pointed to by ProcessGlassCockpitDCSConfigLowImportance -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - end +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] end -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) --[[ - every frame export to hardware + export in low tick interval to DAC Example from A-10C Get Radio Frequencies get data from device local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config ]] --===================================================================================== --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - WriteToLog('CMSP: '..dump(list_indication(7))) + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) local ltmp1 = 0 for ltmp2 = 0, 13, 1 do ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) end ]] --[[ local ltmp1 = 0 for ltmp2 = 1, 73, 1 do ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) end ]] end @@ -438,6 +379,6 @@ end -- Custom functions -- ----------------------------- -function genericRadio(key, value, hardware) +function ExportScript.genericRadio(key, value, hardware) end diff --git a/ExportsModules/FC_AuxiliaryFuntions.lua b/Scripts/DCS-ExportScript/ExportsModules/FC_AuxiliaryFuntions.lua similarity index 70% rename from ExportsModules/FC_AuxiliaryFuntions.lua rename to Scripts/DCS-ExportScript/ExportsModules/FC_AuxiliaryFuntions.lua index 714849a..b5d0bd4 100644 --- a/ExportsModules/FC_AuxiliaryFuntions.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/FC_AuxiliaryFuntions.lua @@ -2,234 +2,269 @@ -- Version 0.9.9 -- Weapon Panel for Su-25A and Su-25T -function FC_WeaponPanel_SU25(exportid) - local lExportID = exportid or 14 +function ExportScript.AF.WeaponPanel_SU25(FunctionTyp) + local lFunctionTyp = FunctionTyp or "Ikarus" - -- defination - gES_PayloadInfo = LoGetPayloadInfo() - if gES_PayloadInfo ~= nil then - if gES_CurrentStationTmp == nil then - gES_CurrentStationTmp = -1 - end - if gES_CannonContainer == nil then -- Find Cannon-Containers, aka SPPU_22 - gES_CannonContainer = {} - gES_CannonContainer.counter = 0 - table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_FindCannonContainer) - end - if gES_TmpWeaponPanelActive == nil then - gES_TmpWeaponPanelActive = {[201] = 0, [202] = 0, [203] = 0, [204] = 0, [205] = 0, [206] = 0, [207] = 0, [208] = 0, [209] = 0, [210] = 0} - end + if ExportScript.AF.TmpWeaponPanelPresend == nil then + ExportScript.AF.TmpWeaponPanelPresend = {[101] = 0, [102] = 0, [103] = 0, [104] = 0, [105] = 0, [106] = 0, [107] = 0, [108] = 0, [109] = 0, [110] = 0} + end - if gES_PayloadInfo.CurrentStation > 0 and - gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then - gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation + if ExportScript.AF.TmpWeaponPanelActive == nil then + ExportScript.AF.TmpWeaponPanelActive = {[201] = 0, [202] = 0, [203] = 0, [204] = 0, [205] = 0, [206] = 0, [207] = 0, [208] = 0, [209] = 0, [210] = 0} + end - gES_TmpStationToPanel = {} - gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201 } -- left - gES_TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210 } -- right - gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202 } - gES_TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209 } - gES_TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203 } - gES_TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208 } - gES_TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204 } - gES_TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207 } - gES_TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205 } - gES_TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206 } + if ExportScript.AF.TmpWeaponPanel == nil then + ExportScript.AF.TmpWeaponPanel = {[231] = 0, [232] = 0, [233] = 0, [234] = 0, [235] = 0} + end - -- gES_TmpWeaponPanelActive reset - for i = 201, 210, 1 do - gES_TmpWeaponPanelActive[i] = 0 + if(ExportScript.AF.EventNumberOLD < ExportScript.AF.EventNumber) then + ExportScript.AF.EventNumberOLD = ExportScript.AF.EventNumber + + -- defination + ExportScript.AF.PayloadInfo = LoGetPayloadInfo() + if ExportScript.AF.PayloadInfo ~= nil then + if ExportScript.AF.CurrentStationTmp == nil then + ExportScript.AF.CurrentStationTmp = -1 + end + if ExportScript.AF.CannonContainer == nil then -- Find Cannon-Containers, aka SPPU_22 + ExportScript.AF.CannonContainer = {} + ExportScript.AF.CannonContainer.counter = 0 + table.foreach(ExportScript.AF.PayloadInfo.Stations, WeaponStatusPanel_FindCannonContainer) end - if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then - gES_TmpWeaponPanelActive[gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID] = 1 -- currrent value + if ExportScript.AF.PayloadInfo.CurrentStation > 0 and + ExportScript.AF.CurrentStationTmp ~= ExportScript.AF.PayloadInfo.CurrentStation then + ExportScript.AF.CurrentStationTmp = ExportScript.AF.PayloadInfo.CurrentStation + + ExportScript.AF.TmpStationToPanel = {} + ExportScript.AF.TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201 } -- left + ExportScript.AF.TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210 } -- right + ExportScript.AF.TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202 } + ExportScript.AF.TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209 } + ExportScript.AF.TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203 } + ExportScript.AF.TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208 } + ExportScript.AF.TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204 } + ExportScript.AF.TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207 } + ExportScript.AF.TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205 } + ExportScript.AF.TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206 } + + -- ExportScript.AF.TmpWeaponPanelActive reset + for i = 201, 210, 1 do + ExportScript.AF.TmpWeaponPanelActive[i] = 0 + end + + if ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation] ~= nil then + ExportScript.AF.TmpWeaponPanelActive[ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID] = 1 -- currrent value + + table.foreach(ExportScript.AF.PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit) -- corresponding station + end - table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit) -- corresponding station end - end + local lMainGun = 1.0 -- Full max 250 Rounds "F" + local lReserve = 1.0 + if ExportScript.AF.PayloadInfo.Cannon.shells == 0 then + lMainGun = 0.0 -- transversely striped + lReserve = 0.0 -- transversely striped + elseif ExportScript.AF.PayloadInfo.Cannon.shells < 65 then + lMainGun = 0.1 -- "E" + elseif ExportScript.AF.PayloadInfo.Cannon.shells < 125 then + lMainGun = 0.3 -- "1/2" -- "3/4" + elseif ExportScript.AF.PayloadInfo.Cannon.shells < 187 then + lMainGun = 0.6 -- "1/4" + end - local lMainGun = 1.0 -- Full max 250 Rounds "F" - local lReserve = 1.0 - if gES_PayloadInfo.Cannon.shells == 0 then - lMainGun = 0.0 -- transversely striped - lReserve = 0.0 -- transversely striped - elseif gES_PayloadInfo.Cannon.shells < 65 then - lMainGun = 0.1 -- "E" - elseif gES_PayloadInfo.Cannon.shells < 125 then - lMainGun = 0.3 -- "1/2" -- "3/4" - elseif gES_PayloadInfo.Cannon.shells < 187 then - lMainGun = 0.6 -- "1/4" - end - - local lWeaponType = 0.0 -- transversely striped - if gES_PayloadInfo.CurrentStation > 0 then - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level1 == 4 then - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level2 == 4 then -- Weapon type Missle - lWeaponType = 0.1 -- MSL - elseif gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level2 == 7 then -- Weapon type NURS with Container - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level3 == 33 then -- Weapon type Rocket - lWeaponType = 0.2 -- RCT + local lWeaponType = 0.0 -- transversely striped + if ExportScript.AF.PayloadInfo.CurrentStation > 0 then + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level1 == 4 then + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 4 then -- Weapon type Missle + lWeaponType = 0.1 -- MSL + elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 7 then -- Weapon type NURS with Container + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level3 == 33 then -- Weapon type Rocket + lWeaponType = 0.2 -- RCT + end + elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 5 then -- Weapon type Bomb + lWeaponType = 0.3 -- BB end - elseif gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level2 == 5 then -- Weapon type Bomb - lWeaponType = 0.3 -- BB end end - end - local lOuterCannon = 0.0 -- transversely striped - local lInnerCannon = 0.0 -- transversely striped - if gES_CannonContainer.counter > 0 then - for i = 7, 10, 1 do - if gES_CannonContainer[i] == "{E92CBFE5-C153-11d8-9897-000476191836}" then -- SPPU_22 with 260 rounds - if i == 7 or i == 8 then - lOuterCannon = 1.0 -- Full max 260 Rounds "F" - if gES_PayloadInfo.Stations[i].count == 0 then - lOuterCannon = 0.0 -- transversely striped - gES_CannonContainer[i] = "empty" -- do not check - elseif gES_PayloadInfo.Stations[i].count < 65 then - lOuterCannon = 0.1 -- "E" - elseif gES_PayloadInfo.Stations[i].count < 130 then - lOuterCannon = 0.3 -- "3/4" -- "1/2" - elseif gES_PayloadInfo.Stations[i].count < 195 then - lOuterCannon = 0.6 -- "1/4" - end - else - lInnerCannon = 1.0 -- Full max 260 Rounds "F" - if gES_PayloadInfo.Stations[i].count == 0 then - lInnerCannon = 0.0 -- transversely striped - gES_CannonContainer[i] = "empty" -- do not check - elseif gES_PayloadInfo.Stations[i].count < 65 then - lInnerCannon = 0.1 -- "E" - elseif gES_PayloadInfo.Stations[i].count < 130 then - lInnerCannon = 0.3 -- "3/4" -- "1/2" - elseif gES_PayloadInfo.Stations[i].count < 195 then - lInnerCannon = 0.6 -- "1/4" + local lOuterCannon = 0.0 -- transversely striped + local lInnerCannon = 0.0 -- transversely striped + if ExportScript.AF.CannonContainer.counter > 0 then + for i = 7, 10, 1 do + if ExportScript.AF.CannonContainer[i] == "{E92CBFE5-C153-11d8-9897-000476191836}" then -- SPPU_22 with 260 rounds + if i == 7 or i == 8 then + lOuterCannon = 1.0 -- Full max 260 Rounds "F" + if ExportScript.AF.PayloadInfo.Stations[i].count == 0 then + lOuterCannon = 0.0 -- transversely striped + ExportScript.AF.CannonContainer[i] = "empty" -- do not check + elseif ExportScript.AF.PayloadInfo.Stations[i].count < 65 then + lOuterCannon = 0.1 -- "E" + elseif ExportScript.AF.PayloadInfo.Stations[i].count < 130 then + lOuterCannon = 0.3 -- "3/4" -- "1/2" + elseif ExportScript.AF.PayloadInfo.Stations[i].count < 195 then + lOuterCannon = 0.6 -- "1/4" + end + else + lInnerCannon = 1.0 -- Full max 260 Rounds "F" + if ExportScript.AF.PayloadInfo.Stations[i].count == 0 then + lInnerCannon = 0.0 -- transversely striped + ExportScript.AF.CannonContainer[i] = "empty" -- do not check + elseif ExportScript.AF.PayloadInfo.Stations[i].count < 65 then + lInnerCannon = 0.1 -- "E" + elseif ExportScript.AF.PayloadInfo.Stations[i].count < 130 then + lInnerCannon = 0.3 -- "3/4" -- "1/2" + elseif ExportScript.AF.PayloadInfo.Stations[i].count < 195 then + lInnerCannon = 0.6 -- "1/4" + end end end end end + + --[[ + Weapon Panel + | + --------------------------------------------------- + | | | | | | | | | | | + 1 2 3 4 5 C 6 7 8 9 10 + ]] + -- Payload Info + -- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station + + -- WeaponPresend1 {0, 1} + -- WeaponPresend2 {0, 1} + -- WeaponPresend3 {0, 1} + -- WeaponPresend4 {0, 1} + -- WeaponPresend5 {0, 1} + -- WeaponPresend6 {0, 1} + -- WeaponPresend7 {0, 1} + -- WeaponPresend8 {0, 1} + -- WeaponPresend9 {0, 1} + -- WeaponPresend10 {0, 1} + -- WeaponActive1 {0, 1} + -- WeaponActive2 {0, 1} + -- WeaponActive3 {0, 1} + -- WeaponActive4 {0, 1} + -- WeaponActive5 {0, 1} + -- WeaponActive6 {0, 1} + -- WeaponActive7 {0, 1} + -- WeaponActive8 {0, 1} + -- WeaponActive9 {0, 1} + -- WeaponActive10 {0, 1} + -- MainCannon {transversely striped = 0.0, 1/4 = 01, 1/2 = 03, 3/4 = 0.6, Full = 1.0} + -- WeaponType {transversely striped = 0.0, Missle = 0.1, Rocket = 0.2, Bomb = 0.3} + -- OuterCannon {transversely striped = 0.0, 1/4 = 01, 1/2 = 03, 3/4 = 0.6, Full = 1.0} + -- InnerCannon {transversely striped = 0.0, 1/4 = 01, 1/2 = 03, 3/4 = 0.6, Full = 1.0} + -- ReserveWeapon {transversely striped = 0.0, Gun = 1.0} + + ExportScript.AF.TmpWeaponPanelPresend[101] = (ExportScript.AF.PayloadInfo.Stations[1].count > 0 and 1 or 0) -- weapon presend panel 1 + ExportScript.AF.TmpWeaponPanelPresend[102] = (ExportScript.AF.PayloadInfo.Stations[3].count > 0 and 1 or 0) -- weapon presend panel 2 + ExportScript.AF.TmpWeaponPanelPresend[103] = (ExportScript.AF.PayloadInfo.Stations[5].count > 0 and 1 or 0) -- weapon presend panel 3 + ExportScript.AF.TmpWeaponPanelPresend[104] = (ExportScript.AF.PayloadInfo.Stations[7].count > 0 and 1 or 0) -- weapon presend panel 4 + ExportScript.AF.TmpWeaponPanelPresend[105] = (ExportScript.AF.PayloadInfo.Stations[9].count > 0 and 1 or 0) -- weapon presend panel 5 + ExportScript.AF.TmpWeaponPanelPresend[106] = (ExportScript.AF.PayloadInfo.Stations[10].count > 0 and 1 or 0) -- weapon presend panel 6 + ExportScript.AF.TmpWeaponPanelPresend[107] = (ExportScript.AF.PayloadInfo.Stations[8].count > 0 and 1 or 0) -- weapon presend panel 7 + ExportScript.AF.TmpWeaponPanelPresend[108] = (ExportScript.AF.PayloadInfo.Stations[6].count > 0 and 1 or 0) -- weapon presend panel 8 + ExportScript.AF.TmpWeaponPanelPresend[109] = (ExportScript.AF.PayloadInfo.Stations[4].count > 0 and 1 or 0) -- weapon presend panel 9 + ExportScript.AF.TmpWeaponPanelPresend[110] = (ExportScript.AF.PayloadInfo.Stations[2].count > 0 and 1 or 0) -- weapon presend panel 10 + --ExportScript.AF.TmpWeaponPanelActive[201] -- weapon active panel 1 + --ExportScript.AF.TmpWeaponPanelActive[202] -- weapon active panel 2 + --ExportScript.AF.TmpWeaponPanelActive[203] -- weapon active panel 3 + --ExportScript.AF.TmpWeaponPanelActive[204] -- weapon active panel 4 + --ExportScript.AF.TmpWeaponPanelActive[205] -- weapon active panel 5 + --ExportScript.AF.TmpWeaponPanelActive[206] -- weapon active panel 6 + --ExportScript.AF.TmpWeaponPanelActive[207] -- weapon active panel 7 + --ExportScript.AF.TmpWeaponPanelActive[208] -- weapon active panel 8 + --ExportScript.AF.TmpWeaponPanelActive[209] -- weapon active panel 9 + --ExportScript.AF.TmpWeaponPanelActive[210] -- weapon active panel 10 + ExportScript.AF.TmpWeaponPanel = {} + ExportScript.AF.TmpWeaponPanel[231] = lMainGun -- main cannon shells + ExportScript.AF.TmpWeaponPanel[232] = lWeaponType -- current weapon type + ExportScript.AF.TmpWeaponPanel[233] = lOuterCannon -- outer cannon shells + ExportScript.AF.TmpWeaponPanel[234] = lInnerCannon -- inner cannon shells + ExportScript.AF.TmpWeaponPanel[235] = lReserve -- reserve weapon + end + end + + if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then +ExportScript.Tools.WriteToLog("WeaponPanel_SU25: "..ExportScript.Tools.dump(ExportScript.AF.TmpWeaponPanelPresend)) + for key, value in pairs(ExportScript.AF.TmpWeaponPanelPresend) do + ExportScript.Tools.SendData(key, value) + end + for key, value in pairs(ExportScript.AF.TmpWeaponPanelActive) do + ExportScript.Tools.SendData(key, value) + end + for key, value in pairs(ExportScript.AF.TmpWeaponPanel) do + ExportScript.Tools.SendData(key, value) + end + end + + if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then + for key, value in pairs(ExportScript.AF.TmpWeaponPanelPresend) do + ExportScript.Tools.SendData(key, value) + end + for key, value in pairs(ExportScript.AF.TmpWeaponPanelActive) do + ExportScript.Tools.SendData(key, value) end - - --[[ - Weapon Panel - | - --------------------------------------------------- - | | | | | | | | | | | - 1 2 3 4 5 C 6 7 8 9 10 - ]] - -- Payload Info - -- weapon stations (panel) 1 (left) - 10 (right), no lamp for center station - - -- MainCannon {transversely striped = 0.0, 1/4 = 01, 1/2 = 03, 3/4 = 0.6, Full = 1.0} - -- WeaponPresend1 {0, 1} - -- WeaponPresend2 {0, 1} - -- WeaponPresend3 {0, 1} - -- WeaponPresend4 {0, 1} - -- WeaponPresend5 {0, 1} - -- WeaponPresend6 {0, 1} - -- WeaponPresend7 {0, 1} - -- WeaponPresend8 {0, 1} - -- WeaponPresend9 {0, 1} - -- WeaponPresend10 {0, 1} - -- WeaponActive1 {0, 1} - -- WeaponActive2 {0, 1} - -- WeaponActive3 {0, 1} - -- WeaponActive4 {0, 1} - -- WeaponActive5 {0, 1} - -- WeaponActive6 {0, 1} - -- WeaponActive7 {0, 1} - -- WeaponActive8 {0, 1} - -- WeaponActive9 {0, 1} - -- WeaponActive10 {0, 1} - -- WeaponType {transversely striped = 0.0, Missle = 0.1, Rocket = 0.2, Bomb = 0.3} - -- OuterCannon {transversely striped = 0.0, 1/4 = 01, 1/2 = 03, 3/4 = 0.6, Full = 1.0} - -- InnerCannon {transversely striped = 0.0, 1/4 = 01, 1/2 = 03, 3/4 = 0.6, Full = 1.0} - -- ReserveWeapon {transversely striped = 0.0, Gun = 1.0} - SendData(lExportID, string.format("%.1f;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%.1f;%.1f;%.1f;%.1f", - lMainGun, -- main cannon shells - (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), -- weapon presend panel 1 - (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), -- weapon presend panel 2 - (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), -- weapon presend panel 3 - (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), -- weapon presend panel 4 - (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), -- weapon presend panel 5 - (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), -- weapon presend panel 6 - (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), -- weapon presend panel 7 - (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), -- weapon presend panel 8 - (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), -- weapon presend panel 9 - (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), -- weapon presend panel 10 - gES_TmpWeaponPanelActive[201], -- weapon active panel 1 - gES_TmpWeaponPanelActive[202], -- weapon active panel 2 - gES_TmpWeaponPanelActive[203], -- weapon active panel 3 - gES_TmpWeaponPanelActive[204], -- weapon active panel 4 - gES_TmpWeaponPanelActive[205], -- weapon active panel 5 - gES_TmpWeaponPanelActive[206], -- weapon active panel 6 - gES_TmpWeaponPanelActive[207], -- weapon active panel 7 - gES_TmpWeaponPanelActive[208], -- weapon active panel 8 - gES_TmpWeaponPanelActive[209], -- weapon active panel 9 - gES_TmpWeaponPanelActive[210], -- weapon active panel 10 - lWeaponType, -- current weapon type - lOuterCannon, -- outer cannon shells - lInnerCannon, -- inner cannon shells - lReserve)) -- reserve weapon - end end -- Weapon Panel for Su-27 and Su-33 -function FC_WeaponPanel_SU2733(exportid) +function ExportScript.AF.FC_WeaponPanel_SU2733(exportid) local lExportID = exportid or 13 -- defination - gES_PayloadInfo = LoGetPayloadInfo() - if gES_PayloadInfo ~= nil then - if gES_CurrentStationTmp == nil then - gES_CurrentStationTmp = -1 + ExportScript.AF.PayloadInfo = LoGetPayloadInfo() + if ExportScript.AF.PayloadInfo ~= nil then + if ExportScript.AF.CurrentStationTmp == nil then + ExportScript.AF.CurrentStationTmp = -1 end - if gES_TmpWeaponPanelActive == nil then - gES_TmpWeaponPanelActive = {[201] = 0, [202] = 0, [203] = 0, [204] = 0, [205] = 0, [206] = 0, [207] = 0, [208] = 0, [209] = 0, [210] = 0} + if ExportScript.AF.TmpWeaponPanelActive == nil then + ExportScript.AF.TmpWeaponPanelActive = {[201] = 0, [202] = 0, [203] = 0, [204] = 0, [205] = 0, [206] = 0, [207] = 0, [208] = 0, [209] = 0, [210] = 0} end - if gES_PayloadInfo.CurrentStation > 0 and - gES_CurrentStationTmp ~= gES_PayloadInfo.CurrentStation then - gES_CurrentStationTmp = gES_PayloadInfo.CurrentStation + if ExportScript.AF.PayloadInfo.CurrentStation > 0 and + ExportScript.AF.CurrentStationTmp ~= ExportScript.AF.PayloadInfo.CurrentStation then + ExportScript.AF.CurrentStationTmp = ExportScript.AF.PayloadInfo.CurrentStation - gES_TmpStationToPanel = {} - gES_TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201 } -- left - gES_TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210 } -- right - gES_TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202 } - gES_TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209 } - gES_TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203 } - gES_TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208 } - gES_TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204 } - gES_TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207 } - gES_TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205 } - gES_TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206 } + ExportScript.AF.TmpStationToPanel = {} + ExportScript.AF.TmpStationToPanel[1] = {Panel = 1, StationID = 101, CurrentID = 201 } -- left + ExportScript.AF.TmpStationToPanel[2] = {Panel = 10, StationID = 110, CurrentID = 210 } -- right + ExportScript.AF.TmpStationToPanel[3] = {Panel = 2, StationID = 102, CurrentID = 202 } + ExportScript.AF.TmpStationToPanel[4] = {Panel = 9, StationID = 109, CurrentID = 209 } + ExportScript.AF.TmpStationToPanel[5] = {Panel = 3, StationID = 103, CurrentID = 203 } + ExportScript.AF.TmpStationToPanel[6] = {Panel = 8, StationID = 108, CurrentID = 208 } + ExportScript.AF.TmpStationToPanel[7] = {Panel = 4, StationID = 104, CurrentID = 204 } + ExportScript.AF.TmpStationToPanel[8] = {Panel = 7, StationID = 107, CurrentID = 207 } + ExportScript.AF.TmpStationToPanel[9] = {Panel = 5, StationID = 105, CurrentID = 205 } + ExportScript.AF.TmpStationToPanel[10] = {Panel = 6, StationID = 106, CurrentID = 206 } - -- gES_TmpWeaponPanelActive reset + -- ExportScript.AF.TmpWeaponPanelActive reset for i = 201, 210, 1 do - gES_TmpWeaponPanelActive[i] = 0 + ExportScript.AF.TmpWeaponPanelActive[i] = 0 end - if gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation] ~= nil then - gES_TmpWeaponPanelActive[gES_TmpStationToPanel[gES_PayloadInfo.CurrentStation].CurrentID] = 1 -- currrent value + if ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation] ~= nil then + ExportScript.AF.TmpWeaponPanelActive[ExportScript.AF.TmpStationToPanel[ExportScript.AF.PayloadInfo.CurrentStation].CurrentID] = 1 -- currrent value - table.foreach(gES_PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit) -- corresponding station + table.foreach(ExportScript.AF.PayloadInfo.Stations, WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit) -- corresponding station end end local lWeaponType = 0.0 -- transversely striped - if gES_PayloadInfo.CurrentStation > 0 then - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level1 == 4 then - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level2 == 4 then -- Weapon type Missle + if ExportScript.AF.PayloadInfo.CurrentStation > 0 then + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level1 == 4 then + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 4 then -- Weapon type Missle lWeaponType = 0.1 -- MSL - elseif gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level2 == 7 then -- Weapon type NURS with Container - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level3 == 33 then -- Weapon type Rocket + elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 7 then -- Weapon type NURS with Container + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level3 == 33 then -- Weapon type Rocket lWeaponType = 0.2 -- RCT end - elseif gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].weapon.level2 == 5 then -- Weapon type Bomb + elseif ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].weapon.level2 == 5 then -- Weapon type Bomb lWeaponType = 0.3 -- BB end end @@ -266,32 +301,32 @@ function FC_WeaponPanel_SU2733(exportid) -- WeaponActive9 {0, 1} -- WeaponActive10 {0, 1} SendData(lExportID, string.format("%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d", - (gES_PayloadInfo.Stations[1].count > 0 and 1 or 0), -- weapon presend panel 1 - (gES_PayloadInfo.Stations[3].count > 0 and 1 or 0), -- weapon presend panel 2 - (gES_PayloadInfo.Stations[5].count > 0 and 1 or 0), -- weapon presend panel 3 - (gES_PayloadInfo.Stations[7].count > 0 and 1 or 0), -- weapon presend panel 4 - (gES_PayloadInfo.Stations[9].count > 0 and 1 or 0), -- weapon presend panel 5 - (gES_PayloadInfo.Stations[10].count > 0 and 1 or 0), -- weapon presend panel 6 - (gES_PayloadInfo.Stations[8].count > 0 and 1 or 0), -- weapon presend panel 7 - (gES_PayloadInfo.Stations[6].count > 0 and 1 or 0), -- weapon presend panel 8 - (gES_PayloadInfo.Stations[4].count > 0 and 1 or 0), -- weapon presend panel 9 - (gES_PayloadInfo.Stations[2].count > 0 and 1 or 0), -- weapon presend panel 10 - gES_TmpWeaponPanelActive[201], -- weapon active panel 1 - gES_TmpWeaponPanelActive[202], -- weapon active panel 2 - gES_TmpWeaponPanelActive[203], -- weapon active panel 3 - gES_TmpWeaponPanelActive[204], -- weapon active panel 4 - gES_TmpWeaponPanelActive[205], -- weapon active panel 5 - gES_TmpWeaponPanelActive[206], -- weapon active panel 6 - gES_TmpWeaponPanelActive[207], -- weapon active panel 7 - gES_TmpWeaponPanelActive[208], -- weapon active panel 8 - gES_TmpWeaponPanelActive[209], -- weapon active panel 9 - gES_TmpWeaponPanelActive[210])) -- weapon active panel 10 + (ExportScript.AF.PayloadInfo.Stations[1].count > 0 and 1 or 0), -- weapon presend panel 1 + (ExportScript.AF.PayloadInfo.Stations[3].count > 0 and 1 or 0), -- weapon presend panel 2 + (ExportScript.AF.PayloadInfo.Stations[5].count > 0 and 1 or 0), -- weapon presend panel 3 + (ExportScript.AF.PayloadInfo.Stations[7].count > 0 and 1 or 0), -- weapon presend panel 4 + (ExportScript.AF.PayloadInfo.Stations[9].count > 0 and 1 or 0), -- weapon presend panel 5 + (ExportScript.AF.PayloadInfo.Stations[10].count > 0 and 1 or 0), -- weapon presend panel 6 + (ExportScript.AF.PayloadInfo.Stations[8].count > 0 and 1 or 0), -- weapon presend panel 7 + (ExportScript.AF.PayloadInfo.Stations[6].count > 0 and 1 or 0), -- weapon presend panel 8 + (ExportScript.AF.PayloadInfo.Stations[4].count > 0 and 1 or 0), -- weapon presend panel 9 + (ExportScript.AF.PayloadInfo.Stations[2].count > 0 and 1 or 0), -- weapon presend panel 10 + ExportScript.AF.TmpWeaponPanelActive[201], -- weapon active panel 1 + ExportScript.AF.TmpWeaponPanelActive[202], -- weapon active panel 2 + ExportScript.AF.TmpWeaponPanelActive[203], -- weapon active panel 3 + ExportScript.AF.TmpWeaponPanelActive[204], -- weapon active panel 4 + ExportScript.AF.TmpWeaponPanelActive[205], -- weapon active panel 5 + ExportScript.AF.TmpWeaponPanelActive[206], -- weapon active panel 6 + ExportScript.AF.TmpWeaponPanelActive[207], -- weapon active panel 7 + ExportScript.AF.TmpWeaponPanelActive[208], -- weapon active panel 8 + ExportScript.AF.TmpWeaponPanelActive[209], -- weapon active panel 9 + ExportScript.AF.TmpWeaponPanelActive[210])) -- weapon active panel 10 end end -- radar warner SPO-15 for all russian planes -function FC_RadarWarning_SPO15(exportid) +function ExportScript.AF.FC_RadarWarning_SPO15(exportid) local lExportID = exportid or 14 local lTWSInfo = LoGetTWSInfo() -- SPO15 Information @@ -328,7 +363,7 @@ function FC_RadarWarning_SPO15(exportid) local lSecondaryType = {AIR = 0, LRR = 0, MRR = 0, SRR = 0, EWR = 0, AWACS = 0} local lPriorityTmp, lPrimaryThreatTmp = 0,0 local lHemisphere = 0 - gES_SPO15_FoundErmitter = true + ExportScript.AF.SPO15_FoundErmitter = true -- sucht den Primär Sender raus for EmitterIndex = 1, #lTWSInfo.Emitters, 1 do @@ -340,7 +375,7 @@ function FC_RadarWarning_SPO15(exportid) for EmitterIndex = 1, #lTWSInfo.Emitters, 1 do - local lAzimut = math.round(lTWSInfo.Emitters[EmitterIndex].Azimuth * 90, 1) + local lAzimut = ExportScript.Tools.round(lTWSInfo.Emitters[EmitterIndex].Azimuth * 90, 1) if EmitterIndex == lPrimaryThreatTmp then -- primary threat @@ -366,7 +401,7 @@ function FC_RadarWarning_SPO15(exportid) lPrimaryDirection2 = ((lAzimut >= 170.0 and lPrimaryDirection1 < 1.0 ) and 1.0 or lPrimaryDirection2) -- right back side -- power of the threat - lErmitterPower = math.round(lTWSInfo.Emitters[EmitterIndex].Power * 0.15, 2) + 0.01 + lErmitterPower = ExportScript.Tools.round(lTWSInfo.Emitters[EmitterIndex].Power * 0.15, 2) + 0.01 -- type of the threat local lPrimaryTypeTmp = FC_FindRadarTypeForSPO15(lTWSInfo, lPrimaryThreatTmp) @@ -470,7 +505,7 @@ function FC_RadarWarning_SPO15(exportid) end -- HSI for SU25T, SU-27, SU-33, MIG-29 -function FC_Russian_HSI(distancetoway, exportid) +function ExportScript.AF.FC_Russian_HSI(distancetoway, exportid) local lDistanceToWay = distancetoway or 999 local lExportID = exportid or 5 @@ -512,25 +547,25 @@ function FC_Russian_HSI(distancetoway, exportid) [121] = "%0.1f", -- HSI_course_unavailable_flag{0.0, 1.0} ]] local lAltCounter = {[0] = 0.0, [1] = 0.11, [2] = 0.22, [3] = 0.33, [4] = 0.44, [5] = 0.55, [6] = 0.66, [7] = 0.77, [8] = 0.88, [9] = 0.99} - lDistanceToWay = math.round(lDistanceToWay / 1000, 1) + lDistanceToWay = ExportScript.Tools.round(lDistanceToWay / 1000, 1) local lDistanceToWayTmp = string.format("%03d", lDistanceToWay) local lRangeCounter1 = 0 local lRangeCounter2 = 0 local lRangeCounter3 = 0 if lDistanceToWay > 100 then - lRangeCounter1 = math.round((lDistanceToWay / 100), 0, "floor") * 0.11 - lRangeCounter1 = lRangeCounter1 - math.round(lRangeCounter1, 0, "floor") + lRangeCounter1 = ExportScript.Tools.round((lDistanceToWay / 100), 0, "floor") * 0.11 + lRangeCounter1 = lRangeCounter1 - ExportScript.Tools.round(lRangeCounter1, 0, "floor") end if lDistanceToWay > 10 then if lDistanceToWay > 100 then - lRangeCounter2 = (math.round((lDistanceToWay - (math.round(lDistanceToWay / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.11 + lRangeCounter2 = (ExportScript.Tools.round((lDistanceToWay - (ExportScript.Tools.round(lDistanceToWay / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.11 else lRangeCounter2 = (lDistanceToWay / 10) * 0.11 - lRangeCounter2 = lRangeCounter2 - math.round(lRangeCounter2, 0, "floor") + lRangeCounter2 = lRangeCounter2 - ExportScript.Tools.round(lRangeCounter2, 0, "floor") end end if lDistanceToWay > 10 then - lRangeCounter3 = (lDistanceToWay - (math.round(lDistanceToWay / 10, 0, "floor") * 10)) * 0.11 + lRangeCounter3 = (lDistanceToWay - (ExportScript.Tools.round(lDistanceToWay / 10, 0, "floor") * 10)) * 0.11 else lRangeCounter3 = lDistanceToWay * 0.11 end @@ -568,7 +603,7 @@ function FC_Russian_HSI(distancetoway, exportid) end -- HSI for SU25A -function FC_Russian_HSI_old(exportid) +function ExportScript.AF.FC_Russian_HSI_old(exportid) local lDistanceToWay = distancetoway or 999 local lExportID = exportid or 5 @@ -610,30 +645,30 @@ function FC_Russian_HSI_old(exportid) end -- HSI-Distance for SU25A -function FC_Russian_HSI_Distance_old(distancetoway, exportid) +function ExportScript.AF.FC_Russian_HSI_Distance_old(distancetoway, exportid) local lDistanceToWay = distancetoway or 999 local lExportID = exportid or 21 local lAltCounter = {[0] = 0.0, [1] = 0.11, [2] = 0.22, [3] = 0.33, [4] = 0.44, [5] = 0.55, [6] = 0.66, [7] = 0.77, [8] = 0.88, [9] = 0.99} - lDistanceToWay = math.round(lDistanceToWay / 1000, 1) + lDistanceToWay = ExportScript.Tools.round(lDistanceToWay / 1000, 1) local lDistanceToWayTmp = string.format("%03d", lDistanceToWay) local lRangeCounter1 = 0 local lRangeCounter2 = 0 local lRangeCounter3 = 0 if lDistanceToWay > 100 then - lRangeCounter1 = math.round((lDistanceToWay / 100), 0, "floor") * 0.11 - lRangeCounter1 = lRangeCounter1 - math.round(lRangeCounter1, 0, "floor") + lRangeCounter1 = ExportScript.Tools.round((lDistanceToWay / 100), 0, "floor") * 0.11 + lRangeCounter1 = lRangeCounter1 - ExportScript.Tools.round(lRangeCounter1, 0, "floor") end if lDistanceToWay > 10 then if lDistanceToWay > 100 then - lRangeCounter2 = (math.round((lDistanceToWay - (math.round(lDistanceToWay / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.11 + lRangeCounter2 = (ExportScript.Tools.round((lDistanceToWay - (ExportScript.Tools.round(lDistanceToWay / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.11 else lRangeCounter2 = (lDistanceToWay / 10) * 0.11 - lRangeCounter2 = lRangeCounter2 - math.round(lRangeCounter2, 0, "floor") + lRangeCounter2 = lRangeCounter2 - ExportScript.Tools.round(lRangeCounter2, 0, "floor") end end if lDistanceToWay > 10 then - lRangeCounter3 = (lDistanceToWay - (math.round(lDistanceToWay / 10, 0, "floor") * 10)) * 0.11 + lRangeCounter3 = (lDistanceToWay - (ExportScript.Tools.round(lDistanceToWay / 10, 0, "floor") * 10)) * 0.11 else lRangeCounter3 = lDistanceToWay * 0.11 end @@ -645,7 +680,7 @@ function FC_Russian_HSI_Distance_old(distancetoway, exportid) end -- ADI for SU-25, SU25T, SU-27, MIG-29A and MIG-29S -function FC_Russian_ADI_Old(exportid) +function ExportScript.AF.FC_Russian_ADI_Old(exportid) local lExportID = exportid or 4 local lDefaultNull = 0.0 @@ -687,7 +722,7 @@ function FC_Russian_ADI_Old(exportid) end -- ADI for SU-33 -function FC_Russian_ADI_New(exportid) +function ExportScript.AF.FC_Russian_ADI_New(exportid) local lExportID = exportid or 4 local lDefaultNull = 0.0 @@ -729,7 +764,7 @@ function FC_Russian_ADI_New(exportid) end -- Radar Altimeter for SU-25A, SU25-T, SU-27, SU-33 -function FC_Russian_RadarAltimeter_1500m(warningflag, exportid) +function ExportScript.AF.FC_Russian_RadarAltimeter_1500m(warningflag, exportid) local lWarning_Flag = warningflag or 100 local lExportID = exportid or 7 @@ -753,7 +788,7 @@ function FC_Russian_RadarAltimeter_1500m(warningflag, exportid) end -- Radar Altimeter for MiG-29A, MiG-29S -function FC_Russian_RadarAltimeter_1000m(warningflag, exportid) +function ExportScript.AF.FC_Russian_RadarAltimeter_1000m(warningflag, exportid) local lWarning_Flag = warningflag or 100 local lExportID = exportid or 7 @@ -777,7 +812,7 @@ function FC_Russian_RadarAltimeter_1000m(warningflag, exportid) end -- Barometric Altimeter for -function FC_Russian_BarometricAltimeter(exportid) +function ExportScript.AF.FC_Russian_BarometricAltimeter(exportid) local lExportID = exportid or 8 local lScaleValue = 1000 @@ -790,7 +825,7 @@ function FC_Russian_BarometricAltimeter(exportid) lBasicAtmospherePressure = string.format("%03d", lBasicAtmospherePressure) lAltBar = lAltBar / lScaleValue - lAltBar = lAltBar - math.round(lAltBar, 0, "floor") + lAltBar = lAltBar - ExportScript.Tools.round(lAltBar, 0, "floor") -- AltBar {0.0,1.0} -- AltBar_1000 {0.0,1.0} @@ -812,7 +847,7 @@ function FC_Russian_BarometricAltimeter(exportid) end -- Barometric Altimeter for -function FC_Russian_BarometricAltimeter(exportid) +function ExportScript.AF.FC_Russian_BarometricAltimeter(exportid) local lExportID = exportid or 8 local lScaleValue = 1000 @@ -825,7 +860,7 @@ function FC_Russian_BarometricAltimeter(exportid) lBasicAtmospherePressure = string.format("%03d", lBasicAtmospherePressure) lAltBar = lAltBar / lScaleValue - lAltBar = lAltBar - math.round(lAltBar, 0, "floor") + lAltBar = lAltBar - ExportScript.Tools.round(lAltBar, 0, "floor") -- AltBar {0.0,1.0} -- AltBar_1000 {0.0,1.0} @@ -847,7 +882,7 @@ function FC_Russian_BarometricAltimeter(exportid) end -- Barometric Altimeter for SU-25A, SU25-T -function FC_Russian_BarometricAltimeter_late(exportid) +function ExportScript.AF.FC_Russian_BarometricAltimeter_late(exportid) local lExportID = exportid or 8 local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE (mm Hg) @@ -864,7 +899,7 @@ function FC_Russian_BarometricAltimeter_late(exportid) end if lAltBar > 1000 then lAltBar_meter_needle = lAltBar / 1000 - lAltBar_meter_needle = lAltBar_meter_needle - math.round(lAltBar_meter_needle, 0, "floor") + lAltBar_meter_needle = lAltBar_meter_needle - ExportScript.Tools.round(lAltBar_meter_needle, 0, "floor") else lAltBar_meter_needle = lAltBar / 1000 end @@ -882,7 +917,7 @@ function FC_Russian_BarometricAltimeter_late(exportid) end -- Barometric Altimeter for SU-27, SU-33 -function FC_Russian_BarometricAltimeter_20000(exportid) +function ExportScript.AF.FC_Russian_BarometricAltimeter_20000(exportid) local lExportID = exportid or 8 local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE (mm Hg) @@ -899,7 +934,7 @@ function FC_Russian_BarometricAltimeter_20000(exportid) end if lAltBar > 1000 then lAltBar_meter_needle = lAltBar / 1000 - lAltBar_meter_needle = lAltBar_meter_needle - math.round(lAltBar_meter_needle, 0, "floor") + lAltBar_meter_needle = lAltBar_meter_needle - ExportScript.Tools.round(lAltBar_meter_needle, 0, "floor") else lAltBar_meter_needle = lAltBar / 1000 end @@ -915,7 +950,7 @@ function FC_Russian_BarometricAltimeter_20000(exportid) end -- Barometric Altimeter for MiG-29A, MiG-29S -function FC_Russian_BarometricAltimeter_30000(exportid) +function ExportScript.AF.FC_Russian_BarometricAltimeter_30000(exportid) local lExportID = exportid or 8 local lBasicAtmospherePressure = LoGetBasicAtmospherePressure() -- BAROMETRIC PRESSURE (mm Hg) @@ -932,7 +967,7 @@ function FC_Russian_BarometricAltimeter_30000(exportid) end if lAltBar > 1000 then lAltBar_meter_needle = lAltBar / 1000 - lAltBar_meter_needle = lAltBar_meter_needle - math.round(lAltBar_meter_needle, 0, "floor") + lAltBar_meter_needle = lAltBar_meter_needle - ExportScript.Tools.round(lAltBar_meter_needle, 0, "floor") else lAltBar_meter_needle = lAltBar / 1000 end @@ -948,7 +983,7 @@ function FC_Russian_BarometricAltimeter_30000(exportid) end -- Air Speed Indicator for SU-25A, SU-25T -function FC_Russian_AirSpeed_1100hkm(exportid) +function ExportScript.AF.FC_Russian_AirSpeed_1100hkm(exportid) local lExportID = exportid or 1 local lIAS = LoGetIndicatedAirSpeed() * 3.6 -- INDICATED AIRSPEED (Meter/Second to Km/h) @@ -1000,7 +1035,7 @@ function FC_Russian_AirSpeed_1100hkm(exportid) end -- Air Speed Indicator for SU-27, SU-33 -function FC_Russian_AirSpeed_1600hkm(exportid) +function ExportScript.AF.FC_Russian_AirSpeed_1600hkm(exportid) local lExportID = exportid or 1 local lScaleValueIAS = 1600 @@ -1164,7 +1199,7 @@ function FC_Russian_AirSpeed_1600hkm(exportid) end -- Air Speed Indicator for MiG-29A, MiG-29S -function FC_Russian_AirSpeed_1000hkm(exportid) +function ExportScript.AF.FC_Russian_AirSpeed_1000hkm(exportid) local lExportID = exportid or 1 local lIAS = LoGetIndicatedAirSpeed() * 3.6 -- INDICATED AIRSPEED (Meter/Second to Km/h) @@ -1212,7 +1247,7 @@ function FC_Russian_AirSpeed_1000hkm(exportid) end -- Vertical Velocity Indicator (Old Style) for SU-25, SU25T, SU-27, MIG-29A and MIG-29S -function FC_Russian_VVI_Old(exportid) +function ExportScript.AF.FC_Russian_VVI_Old(exportid) local lExportID = exportid or 6 local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second) @@ -1250,7 +1285,7 @@ function FC_Russian_VVI_Old(exportid) end -- VVI for SU-33 -function FC_Russian_VVI_New(exportid) +function ExportScript.AF.FC_Russian_VVI_New(exportid) local lExportID = exportid or 6 local lVVI = LoGetVerticalVelocity() -- VERTICAL SPEED (Meter/Second) @@ -1290,7 +1325,7 @@ function FC_Russian_VVI_New(exportid) end -- Airintake for SU-27 and SU-33 -function FC_Russian_AirIntake(exportid) +function ExportScript.AF.FC_Russian_AirIntake(exportid) local lExportID = exportid or 21 local lAirI = LoGetMechInfo().airintake.value @@ -1299,7 +1334,7 @@ function FC_Russian_AirIntake(exportid) end -- AOA Indicator and Accelerometer (AOA, GLoad) for SU-25, SU25T -function FC_Russian_AOA_Su25(exportid) +function ExportScript.AF.FC_Russian_AOA_Su25(exportid) local lExportID = exportid or 3 local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian) @@ -1380,7 +1415,7 @@ function FC_Russian_AOA_Su25(exportid) end -- AOA Indicator and Accelerometer (AOA, GLoad) for SU-27, SU33 -function FC_Russian_AOA_Su2733(exportid) +function ExportScript.AF.FC_Russian_AOA_Su2733(exportid) local lExportID = exportid or 3 local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian) @@ -1460,7 +1495,7 @@ function FC_Russian_AOA_Su2733(exportid) end -- AOA Indicator and Accelerometer (AOA, GLoad) for MiG-29A, MiG-29S -function FC_Russian_AOA_MiG29(exportid) +function ExportScript.AF.FC_Russian_AOA_MiG29(exportid) local lExportID = exportid or 3 local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian) @@ -1540,7 +1575,7 @@ function FC_Russian_AOA_MiG29(exportid) end -- Russian Clock ACS-1 for KA-50, SU-25A, MIG-29A , MIG-29S -function FC_Russian_Clock_ACS1(exportid) +function ExportScript.AF.FC_Russian_Clock_ACS1(exportid) local lExportID = exportid or 12 local lDefaultOne = 1.0 @@ -1548,15 +1583,15 @@ function FC_Russian_Clock_ACS1(exportid) local lCurrentClock = LoGetMissionStartTime() + LoGetModelTime() -- in seconds local lCurrentHours = lCurrentClock / 43200 -- (3600 * 12) - lCurrentHours = lCurrentHours - math.round(lCurrentHours, 0, "floor") + lCurrentHours = lCurrentHours - ExportScript.Tools.round(lCurrentHours, 0, "floor") local lCurrentMinutes = lCurrentClock / 3600 -- (60 * 60) - lCurrentMinutes = lCurrentMinutes - math.round(lCurrentMinutes, 0, "floor") + lCurrentMinutes = lCurrentMinutes - ExportScript.Tools.round(lCurrentMinutes, 0, "floor") local lCurrentSeconds = lCurrentClock / 60 - lCurrentSeconds = lCurrentSeconds - math.round(lCurrentSeconds, 0, "floor") + lCurrentSeconds = lCurrentSeconds - ExportScript.Tools.round(lCurrentSeconds, 0, "floor") local lFlightTimeHours = LoGetModelTime() / 43200 - lFlightTimeHours = lFlightTimeHours - math.round(lFlightTimeHours, 0, "floor") + lFlightTimeHours = lFlightTimeHours - ExportScript.Tools.round(lFlightTimeHours, 0, "floor") local lFlightTimeMinutes = LoGetModelTime() / 3600 - lFlightTimeMinutes = lFlightTimeMinutes - math.round(lFlightTimeMinutes, 0, "floor") + lFlightTimeMinutes = lFlightTimeMinutes - ExportScript.Tools.round(lFlightTimeMinutes, 0, "floor") -- currtime_hours {0.0,1.0} -- currtime_minutes {0.0,1.0} -- currtime_seconds {0.0,1.0} @@ -1577,7 +1612,7 @@ function FC_Russian_Clock_ACS1(exportid) end -- Russian Clock (latest Model) for SU-25T, SU-27, SU-33 -function FC_Russian_Clock_late(exportid) +function ExportScript.AF.FC_Russian_Clock_late(exportid) local lExportID = exportid or 12 local lDefaultOne = 1.0 @@ -1585,15 +1620,15 @@ function FC_Russian_Clock_late(exportid) local lCurrentClock = LoGetMissionStartTime() + LoGetModelTime() -- in seconds local lCurrentHours = lCurrentClock / 43200 -- (3600 * 12) - lCurrentHours = lCurrentHours - math.round(lCurrentHours, 0, "floor") + lCurrentHours = lCurrentHours - ExportScript.Tools.round(lCurrentHours, 0, "floor") local lCurrentMinutes = lCurrentClock / 3600 -- (60 * 60) - lCurrentMinutes = lCurrentMinutes - math.round(lCurrentMinutes, 0, "floor") + lCurrentMinutes = lCurrentMinutes - ExportScript.Tools.round(lCurrentMinutes, 0, "floor") local lCurrentSeconds = lCurrentClock / 60 - lCurrentSeconds = lCurrentSeconds - math.round(lCurrentSeconds, 0, "floor") + lCurrentSeconds = lCurrentSeconds - ExportScript.Tools.round(lCurrentSeconds, 0, "floor") local lFlightTimeHours = LoGetModelTime() / 43200 - lFlightTimeHours = lFlightTimeHours - math.round(lFlightTimeHours, 0, "floor") + lFlightTimeHours = lFlightTimeHours - ExportScript.Tools.round(lFlightTimeHours, 0, "floor") local lFlightTimeMinutes = LoGetModelTime() / 3600 - lFlightTimeMinutes = lFlightTimeMinutes - math.round(lFlightTimeMinutes, 0, "floor") + lFlightTimeMinutes = lFlightTimeMinutes - ExportScript.Tools.round(lFlightTimeMinutes, 0, "floor") -- currtime_hours {0.0,1.0} -- currtime_minutes {0.0,1.0} -- currtime_seconds {0.0,1.0} @@ -1612,7 +1647,7 @@ function FC_Russian_Clock_late(exportid) end -- Russian Enging RPM (Tachometer) for SU-25A+T, SU-27, SU-33, MIG-29 -function FC_Russian_EngineRPM(exportid) +function ExportScript.AF.FC_Russian_EngineRPM(exportid) local lExportID = exportid or 9 local lScaleValue = 110 @@ -1629,7 +1664,7 @@ function FC_Russian_EngineRPM(exportid) end -- Russian Exthaus Gas Temperature 1.000GradC for SU-25A, SU25T, MIG-29 -function FC_Russian_EGT_1000gc(egttemp, exportid) +function ExportScript.AF.FC_Russian_EGT_1000gc(egttemp, exportid) local lEGTtemp = egttemp or 1 local lExportID = exportid or 10 @@ -1659,7 +1694,7 @@ function FC_Russian_EGT_1000gc(egttemp, exportid) end -- Russian Mechanical Device Indicator for SU-25A+T -function FC_Russian_MDI_SU25(exportid) +function ExportScript.AF.FC_Russian_MDI_SU25(exportid) local lExportID = exportid or 2 local lMechInfo = LoGetMechInfo() -- mechanical components, e.g. Flaps, Wheelbrakes,... @@ -1693,7 +1728,7 @@ function FC_Russian_MDI_SU25(exportid) end -- Russian System Test EKRAN -function FC_EKRAN(exportid) +function ExportScript.AF.FC_EKRAN(exportid) local lExportID = exportid or 16 local lMCPState = LoGetMCPState() -- Warning Lights @@ -1801,7 +1836,7 @@ function FC_EKRAN(exportid) end -- ADI for A-10A, F-15C -function FC_US_ADI(exportid) +function ExportScript.AF.FC_US_ADI(exportid) local lExportID = exportid or 20 local lDefaultNull = 0.0 @@ -1844,7 +1879,7 @@ function FC_US_ADI(exportid) end -- Standby ADI for A-10A, F-15C -function FC_US_stbyADI(exportid) +function ExportScript.AF.FC_US_stbyADI(exportid) local lExportID = exportid or 21 local lDefaultNull = 0.0 @@ -1865,7 +1900,7 @@ function FC_US_stbyADI(exportid) end -- HSI for A-10A, F-15C -function FC_US_HSI(distancetoway, exportid) +function ExportScript.AF.FC_US_HSI(distancetoway, exportid) local lDistanceToWay = distancetoway or 999 local lExportID = exportid or 22 @@ -1904,24 +1939,24 @@ function FC_US_HSI(distancetoway, exportid) [32] = "%0.1f", -- HSI Range Flag ]] lDistanceToWay = lDistanceToWay * 0.00062136994937697 -- meter to miles - --lDistanceToWay = math.round(lDistanceToWay / 1000, 1) + --lDistanceToWay = ExportScript.Tools.round(lDistanceToWay / 1000, 1) local lRangeCounter1 = 0 local lRangeCounter2 = 0 local lRangeCounter3 = 0 if lDistanceToWay > 100 then - lRangeCounter1 = math.round((lDistanceToWay / 100), 0, "floor") * 0.11 - lRangeCounter1 = lRangeCounter1 - math.round(lRangeCounter1, 0, "floor") + lRangeCounter1 = ExportScript.Tools.round((lDistanceToWay / 100), 0, "floor") * 0.11 + lRangeCounter1 = lRangeCounter1 - ExportScript.Tools.round(lRangeCounter1, 0, "floor") end if lDistanceToWay > 10 then if lDistanceToWay > 100 then - lRangeCounter2 = (math.round((lDistanceToWay - (math.round(lDistanceToWay / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.11 + lRangeCounter2 = (ExportScript.Tools.round((lDistanceToWay - (ExportScript.Tools.round(lDistanceToWay / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.11 else lRangeCounter2 = (lDistanceToWay / 10) * 0.11 - lRangeCounter2 = lRangeCounter2 - math.round(lRangeCounter2, 0, "floor") + lRangeCounter2 = lRangeCounter2 - ExportScript.Tools.round(lRangeCounter2, 0, "floor") end end if lDistanceToWay > 10 then - lRangeCounter3 = (lDistanceToWay - (math.round(lDistanceToWay / 10, 0, "floor") * 10)) * 0.11 + lRangeCounter3 = (lDistanceToWay - (ExportScript.Tools.round(lDistanceToWay / 10, 0, "floor") * 10)) * 0.11 else lRangeCounter3 = lDistanceToWay * 0.11 end @@ -1961,7 +1996,7 @@ function FC_US_HSI(distancetoway, exportid) end -- VVI for A-10A, F-15C -function FC_US_VVI(exportid) +function ExportScript.AF.FC_US_VVI(exportid) local lExportID = exportid or 15 local lVVITmp = LoGetVerticalVelocity() * 196.8504 -- VERTICAL SPEED (Meter/Second to Foots/Minute) -- {-1.0, -0.5, -0.29, 0.29, 0.5, 1.0} @@ -2023,7 +2058,7 @@ function FC_US_VVI(exportid) end -- AOA Indicator (AOA) for A-10A, F-15C -function FC_US_AOA(exportid) +function ExportScript.AF.FC_US_AOA(exportid) local lExportID = exportid or 16 local lRadToDCSsignd = math.pi local lAoA = LoGetAngleOfAttack() -- ANGLE OF ATTACK AoA (Radian) @@ -2045,7 +2080,7 @@ function FC_US_AOA(exportid) end -- Accelerometer (GLoad) for A-10A, F-15C -function FC_US_GLOAD(exportid) +function ExportScript.AF.FC_US_GLOAD(exportid) local lExportID = exportid or 17 local lAccelerationUnits = LoGetAccelerationUnits().y -- G-LOAD @@ -2056,7 +2091,7 @@ function FC_US_GLOAD(exportid) end -- US Clock for A-10A, F-15C -function FC_US_Clock(exportid) +function ExportScript.AF.FC_US_Clock(exportid) local lExportID = exportid or 18 local lDefaultOne = 1.0 @@ -2064,11 +2099,11 @@ function FC_US_Clock(exportid) local lCurrentClock = LoGetMissionStartTime() + LoGetModelTime() -- in seconds local lCurrentHours = lCurrentClock / 43200 -- (3600 * 12) - lCurrentHours = lCurrentHours - math.round(lCurrentHours, 0, "floor") + lCurrentHours = lCurrentHours - ExportScript.Tools.round(lCurrentHours, 0, "floor") local lCurrentMinutes = lCurrentClock / 3600 -- (60 * 60) - lCurrentMinutes = lCurrentMinutes - math.round(lCurrentMinutes, 0, "floor") + lCurrentMinutes = lCurrentMinutes - ExportScript.Tools.round(lCurrentMinutes, 0, "floor") local lCurrentSeconds = lCurrentClock / 60 - lCurrentSeconds = lCurrentSeconds - math.round(lCurrentSeconds, 0, "floor") + lCurrentSeconds = lCurrentSeconds - ExportScript.Tools.round(lCurrentSeconds, 0, "floor") -- currtime_hours {0.0,1.0} -- currtime_minutes {0.0,1.0} -- currtime_seconds {0.0,1.0} @@ -2079,7 +2114,7 @@ function FC_US_Clock(exportid) end -- US Standby Compass for A-10A, F-15C -function FC_US_Compass(exportid) +function ExportScript.AF.FC_US_Compass(exportid) local lExportID = exportid or 19 local lDefaultNull = 0.0 @@ -2110,7 +2145,7 @@ function FC_US_Compass(exportid) end -- US F-15C Exaust Gas Temperature -function FC_F15C_ExaustGasTemp(value, exportid) +function ExportScript.AF.FC_F15C_ExaustGasTemp(value, exportid) local lValue = value or 1 local lExportID = exportid or 1 local lValueTmp = lValue @@ -2123,7 +2158,7 @@ function FC_F15C_ExaustGasTemp(value, exportid) lValueTmp2 = string.format("%02d", lValueTmp2) if lValueTmp > 100 then - lCounter3 = (lValueTmp - (math.round(lValueTmp / 100, 0, "floor") * 100)) * 0.01 + lCounter3 = (lValueTmp - (ExportScript.Tools.round(lValueTmp / 100, 0, "floor") * 100)) * 0.01 else lCounter3 = lValueTmp * 0.01 end @@ -2157,7 +2192,7 @@ function FC_F15C_ExaustGasTemp(value, exportid) end -- A-10A Exaust Gas Temperature -function FC_A10A_ExaustGasTemp(value, exportid) +function ExportScript.AF.FC_A10A_ExaustGasTemp(value, exportid) local lValue = value or 1 local lExportID = exportid or 1 local lValueTmp = lValue @@ -2187,7 +2222,7 @@ end -- for example: -- A-10A RPM Engine -- Su-27/33 Exthaus Gas Temperature 1.200GradC -function FC_TwoNeedlesGauge(value, mainscala, secondscale, exportid) +function ExportScript.AF.FC_TwoNeedlesGauge(value, mainscala, secondscale, exportid) local lValue = value or 1 local lMainScala = mainscala or 100 local lSecondScale = secondscale or 10 @@ -2197,7 +2232,7 @@ function FC_TwoNeedlesGauge(value, mainscala, secondscale, exportid) lValue = lValue / lMainScala lValue = (lValue > 1.0 and 1.0 or lValue) -- the result is limited to 1.0 - --lValueTmp = lValueTmp - (math.round((lValueTmp / lSecondScale), 0, "floor") * lSecondScale) + --lValueTmp = lValueTmp - (ExportScript.Tools.round((lValueTmp / lSecondScale), 0, "floor") * lSecondScale) --lValueTmp = lValueTmp / lSecondScale --lValueTmp = (lValueTmp > 1.0 and 1.0 or lValueTmp) -- the result is limited to 1.0 local lv1, lValueTmp = math.modf(lValueTmp / lSecondScale) @@ -2210,7 +2245,7 @@ end -- A-10A RPM FAN, RPM APU, Exaust Gas Temperature APU, Fuel Flow, Oil Pressure, Hydraulic Pressure -- F-15C Oil Pressure, Hydraulic Pressure, Engine Exhaust Nozzle Position Indicator -- Su-25A/T, Russian Hydraulic Pressure Gauges -function FC_OneNeedleGauge(value, scala, exportid) +function ExportScript.AF.FC_OneNeedleGauge(value, scala, exportid) local lValue = value or 1 local lScala = scala or 100 local lExportID = exportid or 1 @@ -2224,7 +2259,7 @@ end -- Gauges with 1 needle and 2 digits display -- for example: -- -function FC_OneNeedleGauge2Digits(value, scala, fixdigits, exportid) +function ExportScript.AF.FC_OneNeedleGauge2Digits(value, scala, fixdigits, exportid) local lValue = value or 1 local lScala = scala or 100 local lExportID = exportid or 1 @@ -2243,14 +2278,14 @@ function FC_OneNeedleGauge2Digits(value, scala, fixdigits, exportid) --[[ if lValueTmp > 10 then if lValueTmp > 100 then - lCounter1 = (math.round((lValueTmp - (math.round(lValueTmp / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.1 + lCounter1 = (ExportScript.Tools.round((lValueTmp - (ExportScript.Tools.round(lValueTmp / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.1 else lCounter1 = (lValueTmp / 10) * 0.1 - lCounter1 = lCounter2 - math.round(lCounter2, 0, "floor") + lCounter1 = lCounter2 - ExportScript.Tools.round(lCounter2, 0, "floor") end end]] if lValueTmp > 10 then - lCounter2 = (lValueTmp - (math.round(lValueTmp / 10, 0, "floor") * 10)) * 0.1 + lCounter2 = (lValueTmp - (ExportScript.Tools.round(lValueTmp / 10, 0, "floor") * 10)) * 0.1 else lCounter2 = lValueTmp * 0.1 end @@ -2268,7 +2303,7 @@ end -- Gauges with 1 needle and 3 digits display -- for example: -- F-15C RPM, Fuel Flow -function FC_OneNeedleGauge3Digits_alt(value, scala, fixdigits, exportid) +function ExportScript.AF.FC_OneNeedleGauge3Digits_alt(value, scala, fixdigits, exportid) local lValue = value or 1 local lScala = scala or 100 local lExportID = exportid or 1 @@ -2288,7 +2323,7 @@ function FC_OneNeedleGauge3Digits_alt(value, scala, fixdigits, exportid) lValueTmp2 = string.format("%03d", lValueTmp2) if lValueTmp > 1000 then - lCounter3 = (lValueTmp - (math.round(lValueTmp / 1000, 0, "floor") * 1000)) * math.pow(0.1, lFixDigits + 1) --0.1 + lCounter3 = (lValueTmp - (ExportScript.Tools.round(lValueTmp / 1000, 0, "floor") * 1000)) * math.pow(0.1, lFixDigits + 1) --0.1 else lCounter3 = lValueTmp * math.pow(0.1, lFixDigits + 1) --0.1 end @@ -2306,7 +2341,7 @@ end -- Gauges with 1 needle and 3 digits display -- for example: -- F-15C RPM, Fuel Flow -function FC_OneNeedleGauge3Digits(value, scala, fixdigits, exportid) +function ExportScript.AF.FC_OneNeedleGauge3Digits(value, scala, fixdigits, exportid) local lValue = value or 1 local lScala = scala or 100 local lExportID = exportid or 1 @@ -2340,7 +2375,7 @@ end -- Gauges with 1 needle and 4 digits display -- for example: -- -function FC_OneNeedleGauge4Digits(value, scala, fixdigits, exportid) +function ExportScript.AF.FC_OneNeedleGauge4Digits(value, scala, fixdigits, exportid) local lValue = value or 1 local lScala = scala or 100 local lExportID = exportid or 1 @@ -2361,27 +2396,27 @@ function FC_OneNeedleGauge4Digits(value, scala, fixdigits, exportid) lValueTmp2 = string.format("%04d", lValueTmp2) --[[ if lValueTmp > 10000 then - lCounter1 = math.round((lValueTmp / 1000), 0, "floor") * 0.1 - lCounter1 = lCounter1 - math.round(lCounter1, 0, "floor") + lCounter1 = ExportScript.Tools.round((lValueTmp / 1000), 0, "floor") * 0.1 + lCounter1 = lCounter1 - ExportScript.Tools.round(lCounter1, 0, "floor") end if lValueTmp > 1000 then if lValueTmp > 100 then - lCounter2 = (math.round((lValueTmp - (math.round(lValueTmp / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.1 + lCounter2 = (ExportScript.Tools.round((lValueTmp - (ExportScript.Tools.round(lValueTmp / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.1 else lCounter2 = (lValueTmp / 10) * 0.1 - lCounter2 = lCounter2 - math.round(lCounter2, 0, "floor") + lCounter2 = lCounter2 - ExportScript.Tools.round(lCounter2, 0, "floor") end end if lValueTmp > 100 then if lValueTmp > 10 then - lCounter3 = (math.round((lValueTmp - (math.round(lValueTmp / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.1 + lCounter3 = (ExportScript.Tools.round((lValueTmp - (ExportScript.Tools.round(lValueTmp / 100, 0, "floor") * 100)), 0, "floor") / 10) * 0.1 else lCounter3 = (lValueTmp / 10) * 0.1 - lCounter3 = lCounter3 - math.round(lCounter3, 0, "floor") + lCounter3 = lCounter3 - ExportScript.Tools.round(lCounter3, 0, "floor") end end]] if lValueTmp > 10 then - lCounter4 = (lValueTmp - (math.round(lValueTmp / 10, 0, "floor") * 10)) * 0.1 + lCounter4 = (lValueTmp - (ExportScript.Tools.round(lValueTmp / 10, 0, "floor") * 10)) * 0.1 else lCounter4 = lValueTmp * 0.1 end @@ -2401,7 +2436,7 @@ end -- Auxiliary Functions for Hardware export -function SPO15RWR(hardware) +function ExportScript.AF.SPO15RWR(FunctionTyp) -- The RWR display indicates any threat radars illuminating ("painting") the aircraft. -- Information is presented as symbols representing the type and direction to the threat. -- Six illuminated symbols at the bottom of the display notify the pilot of the threat radar type. @@ -2424,7 +2459,7 @@ emitter_table = SignalType =, -- string with vlues: "scan" ,"lock", "missile_radio_guided","track_while_scan"; }]] - local lHardware = hardware or 1 + local lFunctionTyp = FunctionTyp or "Ikarus" local lTWSInfo = LoGetTWSInfo() -- SPO15 Information if lTWSInfo == nil then return @@ -2461,114 +2496,136 @@ emitter_table = } [Mode] = number: "0" ]] - - local lPriorityTmp = 0 - local lPrimaryThreatTmp = 0 - local lActiveLamp = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -- 10 x for direction - if(#lTWSInfo.Emitters > 0) then - - gES_SPO15_FoundErmitter = true - - for EmitterIndex = 1, #lTWSInfo.Emitters, 1 do - if(lTWSInfo.Emitters[EmitterIndex].Priority > lPriorityTmp) then - lPriorityTmp = lTWSInfo.Emitters[EmitterIndex].Priority - lPrimaryThreatTmp = EmitterIndex - end +ExportScript.Tools.WriteToLog("SPO15RWR: "..ExportScript.AF.EventNumberOLD.." < "..ExportScript.AF.EventNumber) + if(ExportScript.AF.EventNumberOLD < ExportScript.AF.EventNumber) then + ExportScript.AF.EventNumberOLD = ExportScript.AF.EventNumber + local lPriorityTmp = 0 + local lPrimaryThreatTmp = 0 + local lActiveLamp = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -- 10 x for direction + if ExportScript.AF.SPO15RWRData == nil then + ExportScript.AF.SPO15RWRData = {} end - - for EmitterIndex = 1, #lTWSInfo.Emitters, 1 do - - local lAzimut = math.round(lTWSInfo.Emitters[EmitterIndex].Azimuth * 90, 1) - - if EmitterIndex == lPrimaryThreatTmp then - -- primary threat - -- direction to the threat - SendDataHW("401", (lAzimut <= -170.0 and 1 or 0), lHardware ) -- left back side - SendDataHW("402", ((lAzimut <= -90.0 and lAzimut >= -170.0 ) and 1 or 0), lHardware ) -- left 90 degree - SendDataHW("403", ((lAzimut <= -55.0 and lAzimut >= -125.0 ) and 1 or 0), lHardware ) -- left 50 degree - SendDataHW("404", ((lAzimut <= -30.0 and lAzimut >= -70.0 ) and 1 or 0), lHardware ) -- left 30 degree - SendDataHW("405", ((lAzimut <= 5.0 and lAzimut >= -40.0 ) and 1 or 0), lHardware ) -- left 10 degree - SendDataHW("406", ((lAzimut >= -5.0 and lAzimut <= 40.0 ) and 1 or 0), lHardware ) -- right 10 degree - SendDataHW("407", ((lAzimut >= 30.0 and lAzimut <= 70.0 ) and 1 or 0), lHardware ) -- right 30 degree - SendDataHW("408", ((lAzimut >= 55.0 and lAzimut <= 125.0 ) and 1 or 0), lHardware ) -- right 50 degree - SendDataHW("409", ((lAzimut >= 90.0 and lAzimut <= 170.0 ) and 1 or 0), lHardware ) -- right 90 degree - SendDataHW("410", (lAzimut >= 170.0 and 1 or 0), lHardware ) -- right back side - - -- power of the threat - local lPower = math.round(lTWSInfo.Emitters[EmitterIndex].Power * 15, 0, "ceil") + 1 - --WriteToLog("lPower: "..lPower) - SendDataHW("411", (lPower <= 1 and 0 or 1), lHardware ) -- 1. power lamp - SendDataHW("412", (lPower <= 2 and 0 or 1), lHardware ) -- 2. power lamp - SendDataHW("413", (lPower <= 3 and 0 or 1), lHardware ) -- 3. power lamp - SendDataHW("414", (lPower <= 4 and 0 or 1), lHardware ) -- 4. power lamp - SendDataHW("415", (lPower <= 5 and 0 or 1), lHardware ) -- 5. power lamp - SendDataHW("416", (lPower <= 6 and 0 or 1), lHardware ) -- 6. power lamp - SendDataHW("417", (lPower <= 7 and 0 or 1), lHardware ) -- 7. power lamp - SendDataHW("418", (lPower <= 8 and 0 or 1), lHardware ) -- 8. power lamp - SendDataHW("419", (lPower <= 9 and 0 or 1), lHardware ) -- 9. power lamp - SendDataHW("420", (lPower <= 10 and 0 or 1), lHardware ) -- 10. power lamp - SendDataHW("421", (lPower <= 11 and 0 or 1), lHardware ) -- 11. power lamp - SendDataHW("422", (lPower <= 12 and 0 or 1), lHardware ) -- 12. power lamp - SendDataHW("423", (lPower <= 13 and 0 or 1), lHardware ) -- 13. power lamp - SendDataHW("424", (lPower <= 14 and 0 or 1), lHardware ) -- 14. power lamp - SendDataHW("425", (lPower <= 15 and 0 or 1), lHardware ) -- 15. power lamp - - -- type of the threat - local lPrimaryTypeTmp = FC_FindRadarTypeForSPO15(lTWSInfo, lPrimaryThreatTmp) - SendDataHW("430", (lPrimaryTypeTmp.AIR == 1 and 1 or 0), lHardware ) -- primary Air or Weapon - SendDataHW("431", (lPrimaryTypeTmp.LRR == 1 and 1 or 0), lHardware ) -- long range radar - SendDataHW("432", (lPrimaryTypeTmp.MRR == 1 and 1 or 0), lHardware ) -- mid range radar - SendDataHW("433", (lPrimaryTypeTmp.SRR == 1 and 1 or 0), lHardware ) -- short range radar - SendDataHW("434", (lPrimaryTypeTmp.EWR == 1 and 1 or 0), lHardware ) -- EWR - SendDataHW("435", (lPrimaryTypeTmp.AWACS == 1 and 1 or 0), lHardware ) -- AWACS - - -- look or missil on air - if lPrimaryTypeTmp.Lock == 0.1 then - SendDataHW("440", 0, lHardware ) - SendDataHW("441", 1, lHardware ) -- blinking lights on - elseif lPrimaryTypeTmp.Lock == 0.2 then - SendDataHW("440", 1, lHardware ) - SendDataHW("441", 0, lHardware ) -- blinking lights off - end - -- hemisphere - SendDataHW("442", lPrimaryTypeTmp.TopHemisphere, lHardware ) -- top hemisphere - SendDataHW("443", lPrimaryTypeTmp.BottomHemisphere, lHardware ) -- bottom hemisphere - - lPrimaryTypeTmp = nil - - end - - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 1, "451", lAzimut <= -170.0, lHardware ) -- left back side - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 2, "452", (lAzimut <= -90.0 and lAzimut >= -170.0 ), lHardware ) -- left 90 degree - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 3, "453", (lAzimut <= -55.0 and lAzimut >= -125.0 ), lHardware ) -- left 50 degree - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 4, "454", (lAzimut <= -30.0 and lAzimut >= -70.0 ), lHardware ) -- left 30 degree - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 5, "455", (lAzimut <= 5.0 and lAzimut >= -40.0 ), lHardware ) -- left 10 degree - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 6, "456", (lAzimut >= -5.0 and lAzimut <= 40.0 ), lHardware ) -- right 10 degree - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 7, "457", (lAzimut >= 30.0 and lAzimut <= 70.0 ), lHardware ) -- right 30 degree - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 8, "458", (lAzimut >= 55.0 and lAzimut <= 125.0 ), lHardware ) -- right 50 degree - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 9, "459", (lAzimut >= 90.0 and lAzimut <= 170.0 ), lHardware ) -- right 90 degree - lActiveLamp = SPO15RWR_SendDataHW(lActiveLamp, 10, "460", lAzimut >= 170.0, lHardware ) -- right back side - - end - - -- type of the secondary threat - local lSecondaryTypeTmp = FC_FindRadarTypeForSPO15(lTWSInfo) - SendDataHW("470", (lSecondaryTypeTmp.AIR == 1 and 1 or 0), lHardware ) -- primary Air or Weapon - SendDataHW("471", (lSecondaryTypeTmp.LRR == 1 and 1 or 0), lHardware ) -- long range radar - SendDataHW("472", (lSecondaryTypeTmp.MRR == 1 and 1 or 0), lHardware ) -- mid range radar - SendDataHW("473", (lSecondaryTypeTmp.SRR == 1 and 1 or 0), lHardware ) -- short range radar - SendDataHW("474", (lSecondaryTypeTmp.EWR == 1 and 1 or 0), lHardware ) -- EWR - SendDataHW("475", (lSecondaryTypeTmp.AWACS == 1 and 1 or 0), lHardware ) -- AWACS - lSecondaryTypeTmp = nil +ExportScript.Tools.WriteToLog("1") + if(#lTWSInfo.Emitters > 0) then +ExportScript.Tools.WriteToLog("2") + ExportScript.AF.SPO15_FoundErmitter = true - else - lPriorityTmp = 0 - lPrimaryThreatTmp = 0 + for EmitterIndex = 1, #lTWSInfo.Emitters, 1 do + if(lTWSInfo.Emitters[EmitterIndex].Priority > lPriorityTmp) then + lPriorityTmp = lTWSInfo.Emitters[EmitterIndex].Priority + lPrimaryThreatTmp = EmitterIndex + end + end + + for EmitterIndex = 1, #lTWSInfo.Emitters, 1 do +ExportScript.Tools.WriteToLog("3") + local lAzimut = ExportScript.Tools.round(lTWSInfo.Emitters[EmitterIndex].Azimuth * 90, 1) + + if EmitterIndex == lPrimaryThreatTmp then +ExportScript.Tools.WriteToLog("3.1") + -- primary threat + -- direction to the threat + ExportScript.AF.SPO15RWRData[401] = (lAzimut <= -170.0 and 1 or 0) -- left back side + ExportScript.AF.SPO15RWRData[402] = ((lAzimut <= -90.0 and lAzimut >= -170.0 ) and 1 or 0) -- left 90 degree + ExportScript.AF.SPO15RWRData[403] = ((lAzimut <= -55.0 and lAzimut >= -125.0 ) and 1 or 0) -- left 50 degree + ExportScript.AF.SPO15RWRData[404] = ((lAzimut <= -30.0 and lAzimut >= -70.0 ) and 1 or 0) -- left 30 degree + ExportScript.AF.SPO15RWRData[405] = ((lAzimut <= 5.0 and lAzimut >= -40.0 ) and 1 or 0) -- left 10 degree + ExportScript.AF.SPO15RWRData[406] = ((lAzimut >= -5.0 and lAzimut <= 40.0 ) and 1 or 0) -- right 10 degree + ExportScript.AF.SPO15RWRData[407] = ((lAzimut >= 30.0 and lAzimut <= 70.0 ) and 1 or 0) -- right 30 degree + ExportScript.AF.SPO15RWRData[408] = ((lAzimut >= 55.0 and lAzimut <= 125.0 ) and 1 or 0) -- right 50 degree + ExportScript.AF.SPO15RWRData[409] = ((lAzimut >= 90.0 and lAzimut <= 170.0 ) and 1 or 0) -- right 90 degree + ExportScript.AF.SPO15RWRData[410] = (lAzimut >= 170.0 and 1 or 0) -- right back side + + -- power of the threat + local lPower = ExportScript.Tools.round(lTWSInfo.Emitters[EmitterIndex].Power * 15, 0, "ceil") + 1 + --WriteToLog("lPower: "..lPower) + ExportScript.AF.SPO15RWRData[411] = (lPower <= 1 and 0 or 1) -- 1. power lamp + ExportScript.AF.SPO15RWRData[412] = (lPower <= 2 and 0 or 1) -- 2. power lamp + ExportScript.AF.SPO15RWRData[413] = (lPower <= 3 and 0 or 1) -- 3. power lamp + ExportScript.AF.SPO15RWRData[414] = (lPower <= 4 and 0 or 1) -- 4. power lamp + ExportScript.AF.SPO15RWRData[415] = (lPower <= 5 and 0 or 1) -- 5. power lamp + ExportScript.AF.SPO15RWRData[416] = (lPower <= 6 and 0 or 1) -- 6. power lamp + ExportScript.AF.SPO15RWRData[417] = (lPower <= 7 and 0 or 1) -- 7. power lamp + ExportScript.AF.SPO15RWRData[418] = (lPower <= 8 and 0 or 1) -- 8. power lamp + ExportScript.AF.SPO15RWRData[419] = (lPower <= 9 and 0 or 1) -- 9. power lamp + ExportScript.AF.SPO15RWRData[420] = (lPower <= 10 and 0 or 1) -- 10. power lamp + ExportScript.AF.SPO15RWRData[421] = (lPower <= 11 and 0 or 1) -- 11. power lamp + ExportScript.AF.SPO15RWRData[422] = (lPower <= 12 and 0 or 1) -- 12. power lamp + ExportScript.AF.SPO15RWRData[423] = (lPower <= 13 and 0 or 1) -- 13. power lamp + ExportScript.AF.SPO15RWRData[424] = (lPower <= 14 and 0 or 1) -- 14. power lamp + ExportScript.AF.SPO15RWRData[425] = (lPower <= 15 and 0 or 1) -- 15. power lamp + + -- type of the threat + local lPrimaryTypeTmp = ExportScript.AF.FindRadarTypeForSPO15(lTWSInfo, lPrimaryThreatTmp) + ExportScript.AF.SPO15RWRData[430] = (lPrimaryTypeTmp.AIR == 1 and 1 or 0) -- primary Air or Weapon + ExportScript.AF.SPO15RWRData[431] = (lPrimaryTypeTmp.LRR == 1 and 1 or 0) -- long range radar + ExportScript.AF.SPO15RWRData[432] = (lPrimaryTypeTmp.MRR == 1 and 1 or 0) -- mid range radar + ExportScript.AF.SPO15RWRData[433] = (lPrimaryTypeTmp.SRR == 1 and 1 or 0) -- short range radar + ExportScript.AF.SPO15RWRData[434] = (lPrimaryTypeTmp.EWR == 1 and 1 or 0) -- EWR + ExportScript.AF.SPO15RWRData[435] = (lPrimaryTypeTmp.AWACS == 1 and 1 or 0) -- AWACS + + -- look or missil on air + if lPrimaryTypeTmp.Lock == 0.1 then + ExportScript.AF.SPO15RWRData[440] = 0 + ExportScript.AF.SPO15RWRData[441] = 1 -- blinking lights on + elseif lPrimaryTypeTmp.Lock == 0.2 then + ExportScript.AF.SPO15RWRData[440] = 1 + ExportScript.AF.SPO15RWRData[441] = 0 -- blinking lights off + end + -- hemisphere + ExportScript.AF.SPO15RWRData[442] = lPrimaryTypeTmp.TopHemisphere -- top hemisphere + ExportScript.AF.SPO15RWRData[443] = lPrimaryTypeTmp.BottomHemisphere -- bottom hemisphere + + lPrimaryTypeTmp = nil - if gES_SPO15_FoundErmitter ~= nil and gES_SPO15_FoundErmitter then - SPO15RWR_Reset(401, 480, lHardware) + end +ExportScript.Tools.WriteToLog("3.2") + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 1, 451, lAzimut <= -170.0) -- left back side + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 2, 452, (lAzimut <= -90.0 and lAzimut >= -170.0 )) -- left 90 degree + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 3, 453, (lAzimut <= -55.0 and lAzimut >= -125.0 )) -- left 50 degree + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 4, 454, (lAzimut <= -30.0 and lAzimut >= -70.0 )) -- left 30 degree + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 5, 455, (lAzimut <= 5.0 and lAzimut >= -40.0 )) -- left 10 degree + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 6, 456, (lAzimut >= -5.0 and lAzimut <= 40.0 )) -- right 10 degree + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 7, 457, (lAzimut >= 30.0 and lAzimut <= 70.0 )) -- right 30 degree + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 8, 458, (lAzimut >= 55.0 and lAzimut <= 125.0 )) -- right 50 degree + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 9, 459, (lAzimut >= 90.0 and lAzimut <= 170.0 )) -- right 90 degree + lActiveLamp = ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, 10, 460, lAzimut >= 170.0) -- right back side + + end + + -- type of the secondary threat + local lSecondaryTypeTmp = ExportScript.AF.FindRadarTypeForSPO15(lTWSInfo) + ExportScript.AF.SPO15RWRData[470] = (lSecondaryTypeTmp.AIR == 1 and 1 or 0) -- primary Air or Weapon + ExportScript.AF.SPO15RWRData[471] = (lSecondaryTypeTmp.LRR == 1 and 1 or 0) -- long range radar + ExportScript.AF.SPO15RWRData[472] = (lSecondaryTypeTmp.MRR == 1 and 1 or 0) -- mid range radar + ExportScript.AF.SPO15RWRData[473] = (lSecondaryTypeTmp.SRR == 1 and 1 or 0) -- short range radar + ExportScript.AF.SPO15RWRData[474] = (lSecondaryTypeTmp.EWR == 1 and 1 or 0) -- EWR + ExportScript.AF.SPO15RWRData[475] = (lSecondaryTypeTmp.AWACS == 1 and 1 or 0) -- AWACS + lSecondaryTypeTmp = nil + + else + lPriorityTmp = 0 + lPrimaryThreatTmp = 0 +ExportScript.Tools.WriteToLog("4") + if ExportScript.AF.SPO15_FoundErmitter == nil or ExportScript.AF.SPO15_FoundErmitter then + ExportScript.AF.SPO15RWR_Reset(401, 480) + end end end + + if ExportScript.Config.IkarusExport and lFunctionTyp == "Ikarus" then +ExportScript.Tools.WriteToLog("SPO15RWRData: "..ExportScript.Tools.dump(ExportScript.AF.SPO15RWRData)) + for key, value in pairs(ExportScript.AF.SPO15RWRData) do + ExportScript.Tools.SendData(key, value) + end + end + + if ExportScript.Config.DACExport and lFunctionTyp == "DAC" then + for key, value in pairs(ExportScript.AF.SPO15RWRData) do + ExportScript.Tools.SendDataDAC(key, value) + end + end + --[[ level: 2, 16, 101, 39 lNameByType: string: "hawk sr" @@ -2586,7 +2643,7 @@ end -- Auxiliary Functions -function FC_FindRadarTypeForSPO15(lTWSInfo, PrimaryThreat) +function ExportScript.AF.FindRadarTypeForSPO15(lTWSInfo, PrimaryThreat) local lPrimaryThreat = PrimaryThreat or 0 local lReturn = {AIR = 0, LRR = 0, MRR = 0, SRR = 0, EWR = 0, AWACS = 0, Lock = 0, TopHemisphere = 0, BottomHemisphere = 0} @@ -2595,9 +2652,9 @@ function FC_FindRadarTypeForSPO15(lTWSInfo, PrimaryThreat) EmitterIndex = lPrimaryThreat end local lType = lTWSInfo.Emitters[EmitterIndex].Type - --WriteToLog('level: '..lType.level1..', '..lType.level2..', '..lType.level3..', '..lType.level4) + --ExportScript.Tools.WriteToLog('level: '..lType.level1..', '..lType.level2..', '..lType.level3..', '..lType.level4) local lNameByType = LoGetNameByType(lType.level1, lType.level2, lType.level3, lType.level4) -- world database classification of emitter, args 4 (number : level1,level2,level3,level4), result string - --WriteToLog('lNameByType: '..dump(lNameByType)) + --ExportScript.Tools.WriteToLog('lNameByType: '..ExportScript.Tools.dump(lNameByType)) -- threat type if (lType.level1 == 1 or lType.level1 == 4) and @@ -2693,13 +2750,13 @@ function FC_FindRadarTypeForSPO15(lTWSInfo, PrimaryThreat) end local lSelfData = LoGetSelfData() - local lSelfDataAlt = math.round(lSelfData.LatLongAlt.Alt, 0) + local lSelfDataAlt = ExportScript.Tools.round(lSelfData.LatLongAlt.Alt, 0) if lErmitterObjectAlt and lSelfDataAlt then - --WriteToLog('lErmitterObjectAlt: '..lErmitterObjectAlt..', lSelfDataAlt: '..lSelfDataAlt) - if lErmitterObjectAlt > (lSelfDataAlt + 200) then + --ExportScript.Tools.WriteToLog('lErmitterObjectAlt: '..lErmitterObjectAlt..', lSelfDataAlt: '..lSelfDataAlt) + if lErmitterObjectAlt > (lSelfDataAlt + 400) then lReturn.TopHemisphere = 1 -- top hemisphere - elseif lErmitterObjectAlt < (lSelfDataAlt - 200) then + elseif lErmitterObjectAlt < (lSelfDataAlt - 400) then lReturn.BottomHemisphere = 1 -- bottom hemisphere else lReturn.TopHemisphere = 1 -- top hemisphere @@ -2716,26 +2773,26 @@ function FC_FindRadarTypeForSPO15(lTWSInfo, PrimaryThreat) return lReturn end -function WeaponStatusPanel_selectCurrentPayloadStation(_index) - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].CLSID == gES_PayloadInfo.Stations[_index].CLSID and gES_PayloadInfo.CurrentStation ~= _index then - SendDataHW(gES_TmpStationToPanel[_index].CurrentID, 1, gES_TmpStationToPanel[_index].HardwareID) +function ExportScript.AF.WeaponStatusPanel_selectCurrentPayloadStation(_index) + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].CLSID == ExportScript.AF.PayloadInfo.Stations[_index].CLSID and ExportScript.AF.PayloadInfo.CurrentStation ~= _index then + SendDataHW(ExportScript.AF.TmpStationToPanel[_index].CurrentID, 1, ExportScript.AF.TmpStationToPanel[_index].HardwareID) end end -function SPO15RWR_Reset(lMinId, lMaxID, lHardware) ---WriteToLog('SPO15RWR_Reset') +function ExportScript.AF.SPO15RWR_Reset(lMinId, lMaxID) +ExportScript.Tools.WriteToLog('SPO15RWR_Reset') for lCounter = lMinId, lMaxID, 1 do - SendDataHW(lCounter, 0, lHardware) + ExportScript.AF.SPO15RWRData[lCounter] = 0 end - gES_SPO15_FoundErmitter = false + ExportScript.AF.SPO15_FoundErmitter = false end -function SPO15RWR_SendDataHW(lActiveLamp, lLamp, lKey, lValue, lHardware) ---WriteToLog('SPO15RWR_SendDataHW: '..dump(lActiveLamp)..', '..dump(lLamp)..', '..dump(lKey)..', '..dump(lValue)) +function ExportScript.AF.SPO15RWR_SendDataHW(lActiveLamp, lLamp, lKey, lValue) +--ExportScript.Tools.WriteToLog('SPO15RWR_SendDataHW: '..ExportScript.Tools.dump(lActiveLamp)..', '..ExportScript.Tools.dump(lLamp)..', '..ExportScript.Tools.dump(lKey)..', '..ExportScript.Tools.dump(lValue)) if lActiveLamp[lLamp] == 0 then if lValue then - SendDataHW(lKey, 1, lHardware ) + ExportScript.AF.SPO15RWRData[lKey] = 1 lActiveLamp[lLamp] = 1 end end @@ -2743,23 +2800,23 @@ function SPO15RWR_SendDataHW(lActiveLamp, lLamp, lKey, lValue, lHardware) return lActiveLamp end -function WeaponStatusPanel_Reset(lMinId, lMaxID, lHardware) ---WriteToLog('WeaponStatusPanel_Reset') +function ExportScript.AF.WeaponStatusPanel_Reset(lMinId, lMaxID, lHardware) +--ExportScript.Tools.WriteToLog('WeaponStatusPanel_Reset') for lCounter = lMinId, lMaxID, 1 do SendDataHW(lCounter, 0, lHardware) end end -function WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit(_index) - if gES_PayloadInfo.Stations[gES_PayloadInfo.CurrentStation].CLSID == gES_PayloadInfo.Stations[_index].CLSID and gES_PayloadInfo.CurrentStation ~= _index then - gES_TmpWeaponPanelActive[gES_TmpStationToPanel[_index].CurrentID] = 1 +function ExportScript.AF.WeaponStatusPanel_selectCurrentPayloadStationGlassCockpit(_index) + if ExportScript.AF.PayloadInfo.Stations[ExportScript.AF.PayloadInfo.CurrentStation].CLSID == ExportScript.AF.PayloadInfo.Stations[_index].CLSID and ExportScript.AF.PayloadInfo.CurrentStation ~= _index then + ExportScript.AF.TmpWeaponPanelActive[ExportScript.AF.TmpStationToPanel[_index].CurrentID] = 1 end end -function WeaponStatusPanel_FindCannonContainer(_index) - if gES_PayloadInfo.Stations[_index].weapon.level1 == 4 and -- weapon - gES_PayloadInfo.Stations[_index].weapon.level2 == 6 then -- Shell - gES_CannonContainer[_index] = gES_PayloadInfo.Stations[_index].CLSID - gES_CannonContainer.counter = gES_CannonContainer.counter + 1 +function ExportScript.AF.WeaponStatusPanel_FindCannonContainer(_index) + if ExportScript.AF.PayloadInfo.Stations[_index].weapon.level1 == 4 and -- weapon + ExportScript.AF.PayloadInfo.Stations[_index].weapon.level2 == 6 then -- Shell + ExportScript.AF.CannonContainer[_index] = ExportScript.AF.PayloadInfo.Stations[_index].CLSID + ExportScript.AF.CannonContainer.counter = ExportScript.AF.CannonContainer.counter + 1 end -end \ No newline at end of file +end diff --git a/ExportsModules/FW-190D9.lua b/Scripts/DCS-ExportScript/ExportsModules/FW-190D9.lua similarity index 62% rename from ExportsModules/FW-190D9.lua rename to Scripts/DCS-ExportScript/ExportsModules/FW-190D9.lua index 79a1d57..d198e35 100644 --- a/ExportsModules/FW-190D9.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/FW-190D9.lua @@ -1,10 +1,20 @@ -- FW-190D9 Dora --- Version 0.9.9 +-- Version 1.0.0 -gES_FoundDCSModule = true +ExportScript.FoundDCSModule = true -gES_GlassCockpitConfigEveryFrameArguments = +ExportScript.ConfigEveryFrameArguments = { + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] -- Flight Instruments [36] = "%.4f", -- AirspeedNeedle {0, 100, 150, 200, 250, 300, 350, 400, 500, 600, 700, 750, 800, 850, 900} = {0.0, 0.038, 0.088, 0.150, 0.216, 0.278, 0.333, 0.395, 0.530, 0.660, 0.777,0.836, 0.892, 0.938, 0.988} [42] = "%.4f", -- Variometer {-30, -20, -10, -5, 5, 10, 20, 30} = {-1, -0.770, -0.558, -0.338,0.338,0.558, 0.770, 1.0} @@ -24,7 +34,7 @@ gES_GlassCockpitConfigEveryFrameArguments = [41] = "%.4f", -- Slipball {-1.0, 1.0} --oxygen pressure indicator [112] = "%.4f", -- Oxygen_Pressure {0.0, 250.0} = {0.0, 1.0} - [113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0} + --[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0} --Remote compass [45] = "%.4f", -- CompassHeading {0.0, 1.0} [44] = "%.4f", -- CommandedCourse {0.0, 1.0} @@ -53,30 +63,34 @@ gES_GlassCockpitConfigEveryFrameArguments = [58] = "%.4f", -- Ammo_Counter_3 {0.0, 500.0} = {0.0, 1.0} [61] = "%.4f", -- Ammo_Counter_4 {0.0, 500.0} = {0.0, 1.0} -- Gun_Fire - [50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0} - [164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0} - [165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0} - [166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0} + --[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0} + --[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0} + --[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0} + --[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0} --Target System [133] = "%.4f", -- TargetDist {0.0, 10.0, 100.0, 300.0, 600.0, 700.0, 800.0, 1000.0} = {0.0, 0.0, 0.323, 0.568, 0.709, 0.813, 0.917, 1.0} --Bomb Lamps - [196] = "%1d", -- BombLamp_1 {0.0, 1.0} - [197] = "%1d", -- BombLamp_2 {0.0, 1.0} - [198] = "%1d", -- BombLamp_3 {0.0, 1.0} - [199] = "%1d", -- BombLamp_4 {0.0, 1.0} - [137] = "%1d", -- RocketEmCvr {0.0, 1.0} + [196] = "%.f", -- BombLamp_1 {0.0, 1.0} + [197] = "%.f", -- BombLamp_2 {0.0, 1.0} + [198] = "%.f", -- BombLamp_3 {0.0, 1.0} + [199] = "%.f", -- BombLamp_4 {0.0, 1.0} + [137] = "%.f", -- RocketEmCvr {0.0, 1.0} --Gear Lamps - [68] = "%1d", -- L_GEAR_UP {0.0, 1.0} - [69] = "%1d", -- L_GEAR_DOWN {0.0, 1.0} - [70] = "%1d", -- R_GEAR_UP {0.0, 1.0} - [71] = "%1d", -- R_GEAR_DOWN {0.0, 1.0} + [68] = "%.f", -- L_GEAR_UP {0.0, 1.0} + [69] = "%.f", -- L_GEAR_DOWN {0.0, 1.0} + [70] = "%.f", -- R_GEAR_UP {0.0, 1.0} + [71] = "%.f", -- R_GEAR_DOWN {0.0, 1.0} --Flaps Lamps - [72] = "%1d", -- FLAPS_UP {0.0, 1.0} - [73] = "%1d", -- FLAPS_START {0.0, 1.0} + [72] = "%.f", -- FLAPS_UP {0.0, 1.0} + [73] = "%.f", -- FLAPS_START {0.0, 1.0} [74] = "%1d" -- FLAPS_DOWN {0.0, 1.0} } -gES_GlassCockpitConfigArguments = +ExportScript.ConfigArguments = { + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] [159] = "%.2f", -- Radiator Flaps Control (axis) 1.0 in 0.4 steps [160] = "%1d", -- Cold Start/Wind Screen Washer {0, 1} --Engine Control Panel @@ -184,88 +198,46 @@ gES_GlassCockpitConfigArguments = -- done every export event -- ----------------------------- --- Pointed to by ProcessGlassCockpitDCSHighImportance -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch Version 1.6 - -- Altimeter_km, Altimeter_m, Altimeter_Pressure - SendData("2000", string.format("%0.3f;%0.3f;%0.3f", - mainPanelDevice:get_argument_value(35), - mainPanelDevice:get_argument_value(32), - mainPanelDevice:get_argument_value(33))) - - -- LwAtt - AHorizon_Bank, AHorizon_Pitch, TurnNeedle, Slipball - SendData("2001", string.format("%0.3f;%0.3f;%0.3f;%0.3f", - mainPanelDevice:get_argument_value(38), - mainPanelDevice:get_argument_value(37), - mainPanelDevice:get_argument_value(40), - mainPanelDevice:get_argument_value(41))) - - -- LwHead - CompassHeading, CommandedCourse liefert nur 0.000 - SendData("2002", string.format("%0.3f;%0.3f", - mainPanelDevice:get_argument_value(45), - mainPanelDevice:get_argument_value(44))) - - -- LwClock - CLOCK_currtime_hours, CLOCK_currtime_minutes, CLOCK_currtime_seconds, CLOCK_chrono_minutes - SendData("2003", string.format("%0.3f;%0.3f;%0.3f;%0.3f", - mainPanelDevice:get_argument_value(21), - mainPanelDevice:get_argument_value(22), - mainPanelDevice:get_argument_value(23), - mainPanelDevice:get_argument_value(27))) - - -- LwDblP - Oil_Pressure; Fuel_Pressure; - SendData("2004", string.format("%0.3f;%0.3f", - mainPanelDevice:get_argument_value(95), - mainPanelDevice:get_argument_value(94))) - - -- now not ID - -- LwAFN2 - AFN2_Horizontal_Needle, AFN2_Vertical_Needle, AFN2_Signal_Lamp - --SendData("2005", string.format("%0.3f;%0.3f;%0.3f", - -- mainPanelDevice:get_argument_value(), - -- mainPanelDevice:get_argument_value(), - -- mainPanelDevice:get_argument_value())) - - -- Gear - L_GEAR_UP, L_GEAR_DOWN, R_GEAR_UP, R_GEAR_DOWN, FLAPS_UP, FLAPS_START, FLAPS_DOWN - SendData("2007", string.format("%0.3f;%0.3f;%0.3f;%0.3f;%0.3f;%0.3f;%0.3f", - mainPanelDevice:get_argument_value(68), - mainPanelDevice:get_argument_value(69), - mainPanelDevice:get_argument_value(70), - mainPanelDevice:get_argument_value(71), - mainPanelDevice:get_argument_value(72), - mainPanelDevice:get_argument_value(73), - mainPanelDevice:get_argument_value(74))) - -- Ammo counter 1 - SendData("2008", string.format("%0.3f;%0.3f", - mainPanelDevice:get_argument_value(52), - mainPanelDevice:get_argument_value(50))) - -- Ammo counter 2 - SendData("2009", string.format("%0.3f;%0.3f", - mainPanelDevice:get_argument_value(55), - mainPanelDevice:get_argument_value(164))) - -- Ammo counter 3 - SendData("2010", string.format("%0.3f;%0.3f", - mainPanelDevice:get_argument_value(58), - mainPanelDevice:get_argument_value(165))) - -- Ammo counter 4 - SendData("2011", string.format("%0.3f;%0.3f", - mainPanelDevice:get_argument_value(61), - mainPanelDevice:get_argument_value(166))) - end +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] + --[50] = "%.4f", -- Gun_Fire_1 {0.0, 1.0} + --[164] = "%.4f", -- Gun_Fire_2 {0.0, 1.0} + --[165] = "%.4f", -- Gun_Fire_3 {0.0, 1.0} + --[166] = "%.4f", -- Gun_Fire_4 {0.0, 1.0} + --[113] = "%.4f", -- Oxygen_Flow_Blinker {0.0, 1.0} + ExportScript.Tools.SendData(50, string.format("%.4f", mainPanelDevice:get_argument_value(50))) -- Gun_Fire_1 {0.0, 1.0} + ExportScript.Tools.SendData(164, string.format("%.4f", mainPanelDevice:get_argument_value(164))) -- Gun_Fire_2 {0.0, 1.0} + ExportScript.Tools.SendData(165, string.format("%.4f", mainPanelDevice:get_argument_value(165))) -- Gun_Fire_3 {0.0, 1.0} + ExportScript.Tools.SendData(166, string.format("%.4f", mainPanelDevice:get_argument_value(166))) -- Gun_Fire_4 {0.0, 1.0} + ExportScript.Tools.SendData(113, string.format("%.4f", mainPanelDevice:get_argument_value(113))) -- Oxygen_Flow_Blinker {0.0, 1.0} end -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) --- Hier kommen alle Daten rein die ueber die Hardware in schneller folge ausgeben werden soll --- In der Regel sind das die Statusanzeigen - --- SendDataHW(), ist die Funktion zur Ausgabe der Werte an die Hardware --- "178" ist die ID des Wertes die in der entsprechenden XML Datei festgelegt wird, sollte der DCS ID entsprechen --- mainPanelDevice:get_argument_value() ist eine Funktion die die Werte der �bergeben DCS ID aus dem Spiel ausliest --- 178 ist die DCS ID von dem man die Werte haben will --- Description --- SendDataHW("178", mainPanelDevice:get_argument_value(178)) -- L_AILERON_EMER_DISENGAGE --- SendDataHW("", mainPanelDevice:get_argument_value()) -- +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + ExportScript.Tools.SendData(50, mainPanelDevice:get_argument_value(50) > 0.3 and 1 or 0) -- Gun_Fire_1 {0.0, 1.0} + ExportScript.Tools.SendData(164, mainPanelDevice:get_argument_value(164) > 0.3 and 1 or 0) -- Gun_Fire_2 {0.0, 1.0} + ExportScript.Tools.SendData(165, mainPanelDevice:get_argument_value(165) > 0.3 and 1 or 0) -- Gun_Fire_3 {0.0, 1.0} + ExportScript.Tools.SendData(166, mainPanelDevice:get_argument_value(166) > 0.3 and 1 or 0) -- Gun_Fire_4 {0.0, 1.0} + ExportScript.Tools.SendData(113, mainPanelDevice:get_argument_value(113) > 0.3 and 1 or 0) -- Oxygen_Flow_Blinker {0.0, 1.0} end ----------------------------------------------------- @@ -273,41 +245,50 @@ end -- done every gExportLowTickInterval export events -- ----------------------------------------------------- --- Pointed to by ProcessGlassCockpitDCSConfigLowImportance -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] end -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) --[[ - every frame export to hardware + export in low tick interval to DAC Example from A-10C Get Radio Frequencies get data from device local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config ]] --===================================================================================== --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - WriteToLog('CMSP: '..dump(list_indication(7))) + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) local ltmp1 = 0 for ltmp2 = 0, 13, 1 do ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) end ]] --[[ local ltmp1 = 0 for ltmp2 = 1, 73, 1 do ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) end ]] end @@ -316,5 +297,5 @@ end -- Custom functions -- ----------------------------- -function genericRadio(key, value, hardware) -end +function ExportScript.genericRadio(key, value, hardware) +end \ No newline at end of file diff --git a/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua b/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua new file mode 100644 index 0000000..46484ec --- /dev/null +++ b/Scripts/DCS-ExportScript/ExportsModules/Ka-50.lua @@ -0,0 +1,1622 @@ +-- Ka-50 Export +-- Version 1.0.0 BETA + +ExportScript.FoundDCSModule = true + +ExportScript.ConfigEveryFrameArguments = +{ + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] + -- LAMPS + --------------------------------------------------- + --[44] = "%.1f", -- lamp_MasterWarning {0.0,0.3} + --[46] = "%.1f", -- lamp_RotorRPM {0.0,1.0} + [47] = "%.f", -- lamp_UNDERFIREwarning {0.0,1.0} + [48] = "%.f", -- lamp_LowerGear {0.0,1.0} + [78] = "%.f", -- lamp_RPM_leftEngineMax {0.0,1.0} + [79] = "%.f", -- lamp_RPM_rightEngineMax {0.0,1.0} + [80] = "%.f", -- lamp_NyMax {0.0,1.0} + [81] = "%.f", -- lamp_vibr_leftEngine {0.0,1.0} + [82] = "%.f", -- lamp_vibr_rightEngine {0.0,1.0} + [83] = "%.f", -- lamp_IAS_max {0.0,1.0} + [84] = "%.f", -- lamp_mainTransmission {0.0,1.0} + [85] = "%.f", -- lamp_Fire {0.0,1.0} + [86] = "%.f", -- lamp_IFFfailure {0.0,1.0} + -- VVI + --------------------------------------------------- + [24] = "%.4f", -- vy (Vertical Velocity Indicator) {-1.0,1.0} + -- ADI (IKP-81) + --------------------------------------------------- + [100] = "%.4f", -- ADI_Roll {-1.0,1.0} + [101] = "%.4f", -- ADI_Pitch {-math.pi/2.0,math.pi/2.0}{1.0,-1.0} + [102] = "%0.1f", -- ADI_steering_warning_flag {0.0,1.0} + [109] = "%0.1f", -- ADI_attitude_warning_flag {0.0,1.0} + [107] = "%.4f", -- ADI_bank_steering {-1.0,1.0} + [106] = "%.4f", -- ADI_pitch_steering {-1.0,1.0} + [111] = "%.4f", -- ADI_airspeed_deviation {-1.0,1.0} + [103] = "%.4f", -- ADI_track_deviation {-1.0,1.0} + [526] = "%.4f", -- ADI_height_deviation {-1.0,1.0} + [108] = "%.4f", -- ADI_sideslip {-1.0,1.0} + -- Barometric Altimeter (VM_15PV) + -------------------------------------------------- + [87] = "%.4f", -- VM_15PV_BALT_thousands {0.0,1.0} + [88] = "%0.2f", -- VM_15PV_BaroPressure {0.0,1.0} + [89] = "%.4f", -- VM_15PV_BALT_CommandedAlt {0.0,1.0} + -- HSI (PNP-72-16) + --------------------------------------------------- + [112] = "%.4f", -- HSI_heading {0.0, 1.0} + [118] = "%.4f", -- HSI_commanded_course_needle {0.0, 1.0} + [124] = "%.4f", -- HSI_commanded_heading_needle {0.0, 1.0} + [115] = "%.4f", -- HSI_bearing_needle {0.0, 1.0} + [119] = "%0.1f", -- HSI_heading_warning_flag{0.0,1.0} + [114] = "%0.1f", -- HSI_course_warning_flag{0.0, 1.0} + [125] = "%0.1f", -- HSI_glideslope_warning_flag{0.0, 1.0} + [117] = "%0.4f", -- HSI_range_counter_100 {0.0,1.0} + [527] = "%0.4f", -- HSI_range_counter_10 {0.0,1.0} + [528] = "%0.4f", -- HSI_range_counter_1 {0.0,1.0} + [127] = "%.4f", -- HSI_longitudinal_deviation{-1.0, 1.0} + [128] = "%.4f", -- HSI_lateral_deviation{-1.0, 1.0} + [116] = "%0.1f", -- HSI_range_unavailable_flag{0.0, 1.0} + [121] = "%0.1f", -- HSI_course_unavailable_flag{0.0, 1.0} + -- Rotor Pitch + --------------------------------------------------- + [53] = "%.4f", -- RotorPitch {0.0,1.0} + -- Rotor RPM + --------------------------------------------------- + [52] = "%.4f", -- RotorRPM {0.0,1.0} + -- Radar Altimeter ( A_036) + --------------------------------------------------- + [94] = "%.4f", -- A_036_RALT {0.0,1.0} + [93] = "%.4f", -- A_036_DangerRALT {0.0,1.0} + [95] = "%0.1f", -- A_036_warning_flag {0.0,1.0} + [92] = "%.f", -- A_036_DangerRALT_lamp {0.0,1.0} + -- Indicated Airspeed + --------------------------------------------------- + [51] = "%.4f", -- IAS {0.0,1.0} + -- Accelerometer (ADP_4) + --------------------------------------------------- + [97] = "%0.4f", -- ADP_4_acceleration {0.0,1.0} + [98] = "%0.2f", -- ADP_4_max_achieved_acc {0.0,1.0} + [99] = "%0.2f", -- ADP_4_min_achieved_acc {0.0,1.0} + -- Mechanic Clock + --------------------------------------------------- + [68] = "%.4f", -- CLOCK_currtime_hours {0.0,1.0} + [69] = "%.4f", -- CLOCK_currtime_minutes {0.0,1.0} + [70] = "%.4f", -- CLOCK_currtime_seconds {0.0,1.0} + [75] = "%0.1f", -- CLOCK_flight_time_meter_status{0.0,0.2} + [72] = "%.4f", -- CLOCK_flight_hours {0.0,1.0} + [531] = "%.4f", -- CLOCK_flight_minutes {0.0,1.0} + [73] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0,1.0} + [532] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0,1.0} + -- backup ADI (AGR-81) + --------------------------------------------------- + [142] = "%.4f", -- AGR_81_Roll {1.0, -1.0} + [143] = "%.4f", -- AGR_81_Pitch {-1.0, 1.0} + [144] = "%.4f", -- AGR_81_sideslip {-1.0, 1.0} + [145] = "%0.1f", -- AGR_81_failure_flag{0.0, 1.0} + -- Engines temperature + --------------------------------------------------- + [133] = "%.4f", -- LeftEngineTemperatureHund {0.0,1.0} + [566] = "%.4f", -- LeftEngineTemperatureTenth {0.0,1.0} + [134] = "%.4f", -- RightEngineTemperatureHund {0.0,1.0} + [567] = "%.4f", -- RightEngineTemperatureHund {0.0,1.0} + -- Engine RPM + --------------------------------------------------- + [135] = "%.4f", -- LeftEngineRPM {0.0,1.0} + [136] = "%.4f", -- RightEngineRPM {0.0,1.0} + -- Fuel tanks + --------------------------------------------------- + [138] = "%.4f", -- RearTankAmount {0.0,1.0} + [137] = "%.4f", -- ForwardTankAmount {0.0,1.0} + [139] = "%0.1f", -- lamp_ForwardTankTest {0.0,1.0} + [140] = "%0.1f", -- lamp_RearTankTest {0.0,1.0} + -- PUI-800 Weapon panel + --------------------------------------------------- + [392] = "%.f", -- lamp_PUI800_Sta1_WeapIsPresent{0.0, 1.0} + [393] = "%.f", -- lamp_PUI800_Sta2_WeapIsPresent{0.0, 1.0} + [394] = "%.f", -- lamp_PUI800_Sta3_WeapIsPresent{0.0, 1.0} + [395] = "%.f", -- lamp_PUI800_Sta4_WeapIsPresent{0.0, 1.0} + [388] = "%.f", -- lamp_PUI800_Sta1_WeapIsReady{0.0, 1.0} + [389] = "%.f", -- lamp_PUI800_Sta2_WeapIsReady{0.0, 1.0} + [390] = "%.f", -- lamp_PUI800_Sta3_WeapIsReady{0.0, 1.0} + [391] = "%.f", -- lamp_PUI800_Sta4_WeapIsReady{0.0, 1.0} + -- LGCP - Landing gear control panel + --------------------------------------------------- + [63] = "%.f", -- LGCP_Lamp_NoseGearUp {0.0,1.0} + [64] = "%.f", -- LGCP_Lamp_NoseGearDown {0.0,1.0} + [61] = "%.f", -- LGCP_Lamp_RightMainGearUp {0.0,1.0} + [62] = "%.f", -- LGCP_Lamp_RightMainGearDown {0.0,1.0} + [59] = "%.f", -- LGCP_Lamp_LeftMainGearUp {0.0,1.0} + [60] = "%.f", -- LGCP_Lamp_LeftMainGearDown{0.0, 1.0} + -- LAMPS + --------------------------------------------------- + [170] = "%.f", -- lamp_H_RALT_stab {0.0,1.0} + [175] = "%.f", -- lamp_Hover {0.0,1.0} + [172] = "%.f", -- lamp_Descent {0.0,1.0} + [165] = "%.f", -- lamp_RouteHeadingSteering {0.0,1.0} + [171] = "%.f", -- lamp_RouteCourseSteering {0.0,1.0} + [176] = "%.f", -- lamp_Waypoint {0.0,1.0} + [166] = "%.f", -- lamp_EndOfRoute {0.0,1.0} + [164] = "%.f", -- lamp_RoughNAVcalc {0.0,1.0} + [178] = "%.f", -- lamp_Burst {0.0,1.0} + [173] = "%.f", -- lamp_CannonMovingBarr {0.0,1.0} + [177] = "%.f", -- lamp_CannonMovingBarr2 {0.0,1.0} + [211] = "%.f", -- lamp_FuelCrossfeedOn {0.0,1.0} + [187] = "%.f", -- lamp_CouplerOff {0.0,1.0} + [204] = "%.f", -- lamp_ActuatorsOilPress {0.0,1.0} + [213] = "%.f", -- lamp_LockOff {0.0,1.0} + -- Magnetic Compass (KI-13) + --------------------------------------------------- + [11] = "%.4f", -- KI_13_course {-1,1} + [12] = "%.4f", -- KI_13_pitch {-1,1} + [14] = "%.4f", -- KI_13_bank {-1,1} + -- LAMPS + --------------------------------------------------- + [167] = "%.f", -- lamp_WeapSysBUS_ON {0.0,1.0} + [180] = "%.f", -- lamp_TrainingMode {0.0,1.0} + [179] = "%.f", -- lamp_OBZOR_800 {0.0,1.0} + [188] = "%.f", -- lamp_RANET {0.0,1.0} + [189] = "%.f", -- lamp_CC_test {0.0,1.0} + [206] = "%.f", -- lamp_CC_failure {0.0,1.0} + [212] = "%.f", -- lamp_DC_AC_Inverter {0.0,1.0} + [205] = "%.f", -- lamp_I_251V {0.0,1.0} + [181] = "%.f", -- lamp_AntiIceLeftEngine {0.0,1.0} + [190] = "%.f", -- lamp_DustProtectLeftEngine {0.0,1.0} + [207] = "%.f", -- lamp_BackupModeLeftEngine {0.0,1.0} + [183] = "%.f", -- lamp_AntiIceRotors {0.0,1.0} + [182] = "%.f", -- lamp_AntiIceRightEngine {0.0,1.0} + [191] = "%.f", -- lamp_DustProtectRightEngine {0.0,1.0} + [208] = "%.f", -- lamp_BackupModeRightEngine {0.0,1.0} + [184] = "%.f", -- lamp_VUO_Heat {0.0,1.0} + [200] = "%.f", -- lamp_ForwardTank {0.0,1.0} + [209] = "%.f", -- lamp_LeftValveClosed {0.0,1.0} + [185] = "%.f", -- lamp_LeftOuterTank {0.0,1.0} + [202] = "%.f", -- lamp_LeftInnerTank {0.0,1.0} + [201] = "%.f", -- lamp_RearTank {0.0,1.0} + [210] = "%.f", -- lamp_RightValveClosed {0.0,1.0} + [186] = "%.f", -- lamp_RightOuterTank {0.0,1.0} + [203] = "%.f", -- lamp_RightInnerTank {0.0,1.0} + -- DATALINK + --------------------------------------------------- + [159] = "%.f", -- PRC_button_SEND {0.0,0.3} + [150] = "%.f", -- PRC_button_ESCAPE {0.0,0.3} + [161] = "%.f", -- PRC_button_ERASE {0.0,0.3} + [15] = "%.f", -- PRC_button_CLEAN {0.0,0.3} + [16] = "%.f", -- PRC_button_WINGMAN_ALL {0.0,0.3} + [17] = "%.f", -- PRC_button_WINGMAN_1 {0.0,0.3} + [18] = "%.f", -- PRC_button_WINGMAN_2 {0.0,0.3} + [19] = "%.f", -- PRC_button_WINGMAN_3 {0.0,0.3} + [20] = "%.f", -- PRC_button_WINGMAN_4 {0.0,0.3} + [21] = "%.f", -- PRC_button_TARGET_1 {0.0,0.3} + [22] = "%.f", -- PRC_button_TARGET_2 {0.0,0.3} + [23] = "%.f", -- PRC_button_TARGET_3 {0.0,0.3} + [50] = "%.f", -- PRC_button_TARGET_POINT {0.0,0.3} + -- Laser warning system + --------------------------------------------------- + [25] = "%.f", -- LWS_LampAzimuth_0 {0.0,1.0} + [28] = "%.f", -- LWS_LampAzimuth_90 {0.0,1.0} + [26] = "%.f", -- LWS_LampAzimuth_180 {0.0,1.0} + [27] = "%.f", -- LWS_LampAzimuth_270 {0.0,1.0} + [31] = "%.f", -- LWS_LampAzimuth_UpperHemisphere {0.0,1.0} + [32] = "%.f", -- LWS_LampAzimuth_LowerHemisphere {0.0,1.0} + [33] = "%.f", -- LWS_LampAzimuth_LaserRangefinder {0.0,1.0} + [34] = "%.f", -- LWS_LampAzimuth_LaserTargetingSystem {0.0,1.0} + [582] = "%.f", -- LWS_LampReady {0.0,1.0} + -- UV-26 + --------------------------------------------------- + [541] = "%.f", -- UV26_lampLeftBoard {0.0,1.0} + [542] = "%.f", -- UV26_lampRightBoard {0.0,1.0} + -- PVI (Nav Control Panel) + --------------------------------------------------- + [315] = "%0.1f", -- PVI_button_WPT{0.0, 0.3} + [519] = "%0.1f", -- PVI_button_INSREALN{0.0, 0.3} + [316] = "%0.1f", -- PVI_button_FIXPT{0.0, 0.3} + [520] = "%0.1f", -- PVI_button_PRECALN{0.0, 0.3} + [317] = "%0.1f", -- PVI_button_AERDR{0.0, 0.3} + [521] = "%0.1f", -- PVI_button_NORMALN{0.0, 0.3} + [318] = "%0.1f", -- PVI_button_TGT{0.0, 0.3} + [313] = "%0.1f", -- PVI_button_ENTER{0.0, 0.3} + [314] = "%0.1f", -- PVI_button_CANCEL{0.0, 0.3} + [522] = "%0.1f", -- PVI_button_INITCOORD{0.0, 0.3} + [319] = "%0.1f", -- PVI_button_FILAMBDA{0.0, 0.3} + [320] = "%0.1f", -- PVI_button_FIZ{0.0, 0.3} + [321] = "%0.1f", -- PVI_button_DU{0.0, 0.3} + [322] = "%0.1f", -- PVI_button_FII{0.0, 0.3} + [323] = "%0.1f", -- PVI_button_BRGRNG{0.0, 0.3} + [330] = "%0.1f", -- PPR_button_K{0.0, 0.3} + [332] = "%0.1f", -- PPR_button_H{0.0, 0.3} + [331] = "%0.1f", -- PPR_button_T{0.0, 0.3} + [333] = "%0.1f", -- PPR_button_B{0.0, 0.3} + [334] = "%0.1f", -- PPR_button_DIR{0.0, 0.3} + -- RadioCommunicator R-828 + --------------------------------------------------- + [375] = "%0.1f", -- Radio_ASU_lamp{0.0,1.0} + -- RadioCommunicator R-800 + --------------------------------------------------- + [419] = "%0.1f", -- Radio_Test_lamp {0.0,1.0} + [577] = "%.3f", -- R800Rotary1 {0.0,1.0} + [574] = "%.2f", -- R800Rotary2 {0.0,1.0} + [575] = "%.2f", -- R800Rotary3 {0.0,1.0} + [576] = "%.2f", -- R800Rotary4 {0.0,1.0} + -- WEAPON INTERFACE + --------------------------------------------------- + [437] = "%0.1f", -- PRC_button_AUTO_TURN {0.0,0.3} + [438] = "%0.1f", -- PRC_button_AIRBORNE_TARGET {0.0,0.3} + [439] = "%0.1f", -- PRC_button_FORWARD_HEMISPHERE {0.0,0.3} + [440] = "%0.1f", -- PRC_button_GROUND_MOVING_TARGET {0.0,0.3} + [441] = "%0.1f", -- PRC_button_CLEAR {0.0,0.3} + -- Engines start panel + --------------------------------------------------- + [163] = "%.f", -- lamp_EnginesStartValve{0.0, 1.0} + -- APU control panel + --------------------------------------------------- + [162] = "%.f", -- lamp_APUValveOpen{0.0, 1.0}{0.0, 1.0} + [168] = "%.f", -- lamp_APUOilPres{0.0, 1.0}{0.0, 1.0} + [169] = "%.f", -- lamp_APUStoppedByRPM{0.0, 1.0} + [174] = "%.f", -- lamp_APU_IsON{0.0, 1.0} + -- APU Temperature + --------------------------------------------------- + [6] = "%.4f", -- APUTemperature {0.0, 900.0} = {0.0, 1.0} + -- Right Side Panel + --------------------------------------------------- + [586] = "%.f", -- lamp_AC_Ground_Power{0.0, 1.0} + [261] = "%.f", -- lamp_DC_Ground_Power{0.0, 1.0} + -- Eject system + --------------------------------------------------- + [461] = "%0.1f", -- EjectSystemTestLamp{0.0, 1.0} + -- Fire Extinguishers panel + --------------------------------------------------- + [237] = "%.f", -- lamp_Exting_LeftEngineFire{0.0, 1.0} + [239] = "%.f", -- lamp_Exting_APU_Fire{0.0, 1.0} + [568] = "%.f", -- lamp_Exting_HydraulicsFire{0.0, 1.0} + [241] = "%.f", -- lamp_Exting_RightEngineFire{0.0, 1.0} + [243] = "%.f", -- lamp_Exting_VentilatorFire{0.0, 1.0} + [244] = "%.f", -- lamp_Exting_Lamp1{0.0, 1.0} + [245] = "%.f", -- lamp_Exting_Lamp2{0.0, 1.0} + -- Engines mode indicator + --------------------------------------------------- + [592] = "%.4f", -- EnginesMode {0.0,1.0} + [234] = "%0.2f", -- LeftEngineMode{0.0,1.0} + [235] = "%0.2f", -- RightEngineMode {0.0,1.0} + -- Oil pressure and temperature indicators group (Right Panel) + --------------------------------------------------- + [252] = "%.4f", -- NeedleOilPressureEngineLeft {0.0,1.0} + [253] = "%.4f", -- NeedleOilPressureEngineRight {0.0, 1.0} + [254] = "%.4f", -- NeedleOilPressureGearBox {0.0,1.0} + [255] = "%.4f", -- NeedleOilTemperatureEngineLeft {0.0,1.0} + [256] = "%.4f", -- NeedleOilTemperatureEngineRight {0.0,1.0} + [257] = "%.4f", -- NeedleOilTemperatureGearBox {0.0,1.0} + -- Right Back Panel + --------------------------------------------------- + [469] = "%.f", -- lamp_flap_hydro_1{0.0, 1.0} + [470] = "%.f", -- lamp_flap_hydro_2{0.0, 1.0} + -- Hydraulics Gauges (Back Panel) + --------------------------------------------------- + [471] = "%.4f", -- hydro_common_pressure {0.0,1.0} + [472] = "%.4f", -- hydro_main_pressure {0.0,1.0} + [473] = "%.4f", -- hydro_acc_brake_pressure {0.0,1.0} + [474] = "%.4f", -- hydro_gear_brake_pressure {0.0,1.0} + [475] = "%.4f", -- hydro_common_temperature {0.0,1.0} + [476] = "%.4f", -- hydro_main_temperature {0.0,1.0} + -- Latitude Entry Panel (PShK_7) + --------------------------------------------------- + [342] = "%.f", -- PShK7_LampAuto {0.0,1.0} + [339] = "%0.4f", -- PShK7_Latitude_counter_tenth {0.0,10.0} + [594] = "%0.4f", -- PShK7_Latitude_counter_units {0.0,10.0} + -- Magnetic Variation Entry Panel (ZMS_3) + --------------------------------------------------- + [337] = "%0.4f", -- ZMS3_MagVar_counter_hundreds_tenth {-1.0,1.0} + [596] = "%0.4f", -- ZMS3_MagVar_counter_units {0.0,1.0} + -- Ambient Temperature + --------------------------------------------------- + [587] = "%0.4f" -- Ambient Temperature {-60, 50} = {-0.946, 0.788} +} + +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + -- ADI + --------------------------------------------------- + [110] = "%.1f", -- TEST-IKP-PTR (ADI Test Button) {0.0,1.0} + -- HSI + --------------------------------------------------- + [113] = "%.1f", -- TEST-PNP-PTR03 (HSI test Button) + [54] = "%1d", -- ZPU-ZK-PTR (HSI Desired track angle - Desired heading, Auto - Manual) {0,1} + --laser ranger + --------------------------------------------------- + [56] = "%1d", -- LDP-LD-PTR (Laser rangefinder / designator - mode switch) + [57] = "%1d", -- LD-LDP-COVER-PTR (Laser rangefinder Cover) + [55] = "%.1f", -- CHOP-LDP-PTR (Laser designator reset) + -- RADIOALTIMETER + --------------------------------------------------- + [96] = "%.1f", -- TEST-RADIO-HIGHT-PTR (Radar altimeter test) + -- CPT MECH + --------------------------------------------------- + [572] = "%.1f", -- G--PTR (Accelerometer reset) + -- SYSTEM CONTROLLER + --------------------------------------------------- + [45] = "%.1f", -- CONTROL-ALARM-PTR (Lamps test) + -- STANDBY ADI (AGR-81) + --------------------------------------------------- + [230] = "%1d", -- RES-AG-PTR (Standby Attitude Indicator power switch) + -- Engines Start-Up Control Panel + --------------------------------------------------- + [131] = "%.1f", -- CONTROL-TEMP-WORK-PTR (Running engines exhaust gas temperature indicator test button) + [132] = "%.1f", -- CONTROL-TEMP-NOTWORK-PTR (Stopped engines exhaust gas temperature indicator test button) + -- FUEL SYSTEM + --------------------------------------------------- + [616] = "%.1f", -- CONTROL-OIL-PTR (Fuel quantity indicator self test button) + -- ABRIS Display + --------------------------------------------------- + [512] = "%.1f", -- PTR_BTN-ABRIS-01 (ABRIS Pushbutton 1) {start value 0.01 the same index for -2,-3,-4,-5,-6,-7,-8,-9,-RCL,-ENTR with increment 0.01} + [513] = "%.1f", -- PTR_BTN-ABRIS-02 (ABRIS Pushbutton 2) + [514] = "%.1f", -- PTR_BTN-ABRIS-03 (ABRIS Pushbutton 3) + [515] = "%.1f", -- PTR_BTN-ABRIS-04 (ABRIS Pushbutton 4) + [516] = "%.1f", -- PTR_BTN-ABRIS-05 (ABRIS Pushbutton 5) + [523] = "%.1f", -- ABRIS_SHUNT_PTR (ABRIS Cursor Control (rot/push)) + [517] = "%.3f", -- ABRIS_BRIGHTNESS_PTR (ABRIS Brightness) {0.0,1.0} (0.05) + [130] = "%0.1f", -- ABRIS-POWER_PTR (ABRIS Power) + -- HUD + --------------------------------------------------- + [8] = "%.3f", -- PTR_HUD-BRIGHTNESS (HUD Brightness) + [9] = "%1d", -- PTR_HUD-TMB-SETKA02 (HUD Modes Reticle/Night/Day) + [7] = "%.1f", -- PTR-HUD-TEST (HUD Test) + [510] = "%0.1f", -- PTR_HUD-FILTER (HUD Filter) + -- PUI-800 Weapons Control Panel + --------------------------------------------------- + [387] = "%1d", -- MASTER-ARM-PTR (Master Arm) + [402] = "%.1f", -- UI800-AVARCHOP-PTR (External stores jettison) + [396] = "%1d", -- MASTER-EXPLODE-PTR (Jettison arm mode - arm fuse/disarm fuse) + [403] = "%1d", -- PUI800-AUTO-PTR (Manual/Auto weapon system control switch) + [399] = "%1d", -- PUI800-OFBR-PTR (Cannon round selector switch HE/AP) + [400] = "%0.1f", -- SR-PTR (Weapon mode switch - Burst Length) + [398] = "%1d", -- MT-PTR (Cannon rate of fire setting) + [397] = "%.1f", -- MASTER-UNLOAD-PTR (Expedite emergency ATGM launch) + -- PUR Weapons Aux Panel + -- SHKVAL + --------------------------------------------------- + [404] = "%1d", -- PUR-BACKGROUND-PTR (IT-23 Black-White indication switch) + [406] = "%.3f", -- PUR-LIGHTIT-PTR (IT-23 display brightness) + [407] = "%.3f", -- PUR-CONTRAST-PTR (IT-23 display contrast) + -- SHKVAL windscreen wiper + [224] = "%.1f", -- WIPER-PTR (SHKVAL windscreen wiper) + -- HELMET + [405] = "%.3f", -- PUR-LIGHTNVU-PTR (Helmet device brightness) + -- WEAPON SYSTEM + [408] = "%0.1f", -- PUR-LIT-PTR (Laser code selector) + [409] = "%1d", -- PUR-OGR-INF-PTR (HUD/TV declutter switch) + -- Outside illumination + --------------------------------------------------- + [382] = "%0.1f", -- LANDING LIGHTS-DIR-LIGHT-PTR (Light landing-search. On/Retraction/Off) + [383] = "%1d", -- LANDING LIGHTS-BASE-RESERV-PTR (Lights landing-search change. Main/Reserved) + -- ALMAZ system + --------------------------------------------------- + [384] = "%.1f", -- SPEECH-INFO-OFF-PTR01 (Voice message system messages off) + [385] = "%.1f", -- SPEECH-INFO-RETRY-PTR (Voice message system messages repeat) + [386] = "%0.1f", -- SPEECH-INFO-AVAR-PTR (Voice message system emergency on) + [442] = "%.1f", -- SPEECH-BIT-PTR (Voice message system check) + -- CPT MECH + --------------------------------------------------- + [65] = "%1d", -- GEAR-PTR (Gear lever) + [66] = "%1d", -- AVAR-GEAR-PTR (Main/Common hydraulics for emergency gear) + [67] = "%1d", -- AVAR-GEAR-COVER-PTR (Main/Common hydraulics for emergency gear Cover) + -- OVERHEAD PANEL + --------------------------------------------------- + [146] = "%0.1f", -- ANO-PTR (Navigation Lights 10\% / 30\% / 100\% / Off) + [147] = "%0.1f", -- WINDSCREEN-WIPER-PTR (Windshield wiper switch) + [539] = "%1d", -- PPD-DUAS-PTR (Pitot static port and AoA sensors heat switch) + [151] = "%1d", -- PVD-CLOCK-PTR (Pitot ram air and clock heat switch) + [153] = "%1d", -- POS-ROTORS-PTR (Rotor de-icing system switch) + [154] = "%0.1f", -- POS-ENGINE-PZU-PTR (Engines de-icing / dust-protection systems switch) + [156] = "%.1f", -- KONTR-PVD-PTR (Pitot heat system test) + -- Laser Warning System + --------------------------------------------------- + [35] = "%.1f", -- L-140-RESET-PTR (LWS Reset button) + [583] = "%1d", -- L140-SWITCH (LWS Power switch) + [584] = "%.1f", -- L140-CNOB (LWS self-test button) + -- UV-26 CMD Control Panel + --------------------------------------------------- + [36] = "%0.1f", -- UV26-BOARD-PTR (CMD Select Left/Both/Right board flares dispensers) + [37] = "%0.1f", -- UV26-PROGR-PTR (CMD Amount flares counter/Programming) + [38] = "%.1f", -- UV26-SERIES-PTR (CMD Num of sequences) + [39] = "%.1f", -- UV26-BURST-PTR (CMD Num in sequence) + [41] = "%.1f", -- UV26-INTERVAL-PTR (CMD Dispense interval) + [43] = "%.1f", -- UV26-START-PTR (CMD Start dispense) + [42] = "%.1f", -- UV26-CANCELPRG-PTR (CMD Reset to default program) + [40] = "%.1f", -- UV26-STOP-PTR (CMD Stop dispense) + -- UV-26 related (REAR PANEL) + [496] = "%1d", -- UV26-POWER-PTR (CMD Power) + [497] = "%1d", -- UV26-POWER-COVER-PTR (CMD Power Cover) + [498] = "%1d", -- UV26-TEST-PTR (CMD BIT) + [499] = "%1d", -- UV26-TEST-COVER-PTR (CMD BIT Cover) + -- PVI NAV Panel + --------------------------------------------------- + [312] = "%0.1f", -- PVI-0-PTR (NAV '0' Btn) + [303] = "%0.1f", -- PVI-1-PTR (NAV '1' Btn) + [304] = "%0.1f", -- PVI-2-PTR (NAV '2' Btn) + [305] = "%0.1f", -- PVI-3-PTR (NAV '3' Btn) + [306] = "%0.1f", -- PVI-4-PTR (NAV '4' Btn) + [307] = "%0.1f", -- PVI-5-PTR (NAV '5' Btn) + [308] = "%0.1f", -- PVI-6-PTR (NAV '6' Btn) + [309] = "%0.1f", -- PVI-7-PTR (NAV '7' Btn) + [310] = "%0.1f", -- PVI-8-PTR (NAV '8' Btn) + [311] = "%0.1f", -- PVI-9-PTR (NAV '9' Btn) + [324] = "%0.1f", -- PVI-SWITCH-PTR (NAV Master modes) + [325] = "%1d", -- PVI_I251V_PTR (NAV INU fixtaking method) + [326] = "%1d", -- PVI_VCU_PTR (NAV Datalink power) + [327] = "%.3f", -- PVI-BRIGHTNESS-PTR (NAV Brightness) + -- DATALINK + --------------------------------------------------- + -- Datalink Mode Controls + [328] = "%0.1f", -- DTLK-SELF-ID-PTR (Datalink self ID) + [329] = "%0.1f", -- DTLK-MASTER-MODES-PTR (Datalink Master mode) + -- PPR - Autopilot Control Panel + -- AUTOPILOT + --------------------------------------------------- + [335] = "%0.1f", -- BAR-RV-PTR (Autopilot BARO/RALT altitude hold mode) + -- NAV SYSTEM + [336] = "%0.1f", -- ZK-LZP-PTR (Autopilot Desired heading - Desired track) + --ARK-22 + --------------------------------------------------- + [381] = "%0.2f", -- IANDING LIGHTS-DIR-LIGHT-PTR01 (ADF Inner-Auto-Outer NDB switch) + [355] = "%.1f", -- ARK-CONTROL-PTR (ADF Test) + [354] = "%1d", -- TLF-TLG-PTR (TLF-TLG modes) + [353] = "%.3f", -- VARK-VOLUME-PTR (ADF Volume) + [356] = "%1d", -- TLF-TLG-PTR01 (COMPASS-ANTENNA modes) + [357] = "%0.1f", -- VARK-VOLUME-PTR01 (ADF channel switch) + --R-828 + --------------------------------------------------- + [371] = "%0.1f", -- CHANNEL-PTR (R-828 (VHF-1) Radio channel selector) + [372] = "%.3f", -- RADIO-VOLUME-PTR (R-828 (VHF-1) Radio Volume) + [373] = "%.1f", -- ASU-PTR (R-828 (VHF-1) Tuner button) + [374] = "%1d", -- RADIO-PSH-SWITCH-PTR (R-828 (VHF-1) Squelch) + -- Signal Flares + --------------------------------------------------- + [376] = "%.1f", -- SIGNAL-FLARE-1-PTR (Signal flare red) + [377] = "%.1f", -- SIGNAL-FLARE-2-PTR (Signal flare green) + [378] = "%.1f", -- SIGNAL-FLARE-3-PTR (Signal flare white) + [379] = "%.1f", -- SIGNAL-FLARE-4-PTR (Signal flare yellow) + [380] = "%1d", -- SIGNAL-FLARE-SWITCH-PTR (Signal flare system power) + --R-800 + --------------------------------------------------- + [418] = "%.1f", -- START-PANEL-CONTROL-PTR (R-800 (VHF-2) BIT button) + [417] = "%1d", -- CONTR-RADIO-CHM-AM-PTR (R-800 (VHF-2) AM-FM toggle switch) + [421] = "%1d", -- CONTR-RADIO-AP-PTR (R-800 (VHF-2) Emergency receiver) + [422] = "%1d", -- CONTR-RADIO-ARK-PTR (R-800 (VHF-2) ADF switch) + [420] = "%1d", -- CONTR-RADIO-50-100-PTR01 (R-800 (VHF-2) Data transfer rate switch) + [423] = "%1d", -- CONTR-RADIO-PSH-PTR (R-800 (VHF-2) Squelch) + -- PVR + --------------------------------------------------- + -- WEAPONS + [432] = "%1d", -- PVR-DRILL-PTR (Training mode) + [431] = "%0.1f", -- PVR-MODE-PTR (Weapon system mode selector) + [436] = "%1d", -- PVR-AS-PM-PTR (Automatic Tracking / gun sight) + -- K041 + [433] = "%1d", -- K-041-PTR (K-041 Targeting-navigation system power switch) + -- LASERRANGER + [435] = "%1d", -- PVR-IZL-PTR (Laser standby ON/OFF switch) + -- HELMET + [434] = "%1d", -- PVR-OBZ-PTR (Helmet-mounted sight system power switch) + -- SHKVAL + [301] = "%0.1f", -- V-SCAN-PTR (Shkval scan rate) + -- Engines Start-Up Control Panel + --------------------------------------------------- + [412] = "%.1f", -- START-PANEL-START-PTR (Start-up selected engine button) + [413] = "%.1f", -- START-PANEL-STOP-START-PTR ("Interrupt start-up button) + [414] = "%.1f", -- START-PANEL-STOP-START-PTR01 (Stop APU button) + [415] = "%0.1f", -- START-PANEL-ROLLING-PTR (Engine Startup/Crank/False Start selector) + [416] = "%0.1f", -- START-ENGINE-SELECTOR-PTR (Engine selector) + [554] = "%1d", -- EMERGENCY-BRAKE ENGINE-LEFT-PTR (Left engine cut-off valve) + [555] = "%1d", -- EMERGENCY-BRAKE ENGINE-RIGHT-PTR (Right engine cut-off valve) + [556] = "%1d", -- BRAKE-ROTOR-LOW-PTR01 (Rotor brake) + --Radio switcher + --------------------------------------------------- + [428] = "%0.2f", -- RADIO-RATE-PTR (SPU-9 Radio communicator selector) + -- Right Side Panel + --------------------------------------------------- + -- ELECTRICS POWER + [262] = "%1d", -- ENERG-AER-RIT-PTR (DC ground power) + [263] = "%1d", -- ENERG-COVER-AER-RIT-PTR (DC ground power Cover) + [543] = "%1d", -- ENERG-AKK2-PTR (Battery 2) + [544] = "%1d", -- ENERG-COVER-AKK2-PTR (Battery 2 Cover) + [264] = "%1d", -- ENERG-AKK1-PTR (Battery 1) + [265] = "%1d", -- ENERG-COVER-AKK1-PTR (Battery 1 Cover) + [267] = "%1d", -- RAMP-POWER-PTR (AC ground power) + [268] = "%1d", -- GEN-LEFT-PTR (AC left generator) + [269] = "%1d", -- GEN-RIGHT-PTR (AC right generator) + [270] = "%01.f", -- CONVERTER-PTR (DC/AC inverter) {0.0, 0.2} + -- FUEL SYSTEM + [271] = "%1d", -- FUEL-PUMP-FRONT-PTR (Forward fuel tank pumps) + [272] = "%1d", -- FUEL-PUMP-BACK-PTR (Rear fuel tank pumps) + [273] = "%1d", -- FUEL-PUMP-INNER-PTR (Inner external fuel tanks pumps) + [274] = "%1d", -- FUEL-PUMP-OUTER-PTR (Outer external fuel tanks pumps) + [275] = "%1d", -- FUEL-METER-PTR (Fuelmeter power) + [276] = "%1d", -- PAV-CRANE-ENGINE-LEFT-PTR (Left engine fuel shutoff valve) + [277] = "%1d", -- PAV-CRANE-COVER-ENGINE-LEFT-PTR (Left engine fuel shutoff valve) + [278] = "%1d", -- PAV-CRANE-ENGINE-RIGHT-PTR (Right engine fuel shutoff valve) + [279] = "%1d", -- PAV-CRANE-COVER-ENGINE-RIGHT-PTR (Right engine fuel shutoff valve) + [280] = "%1d", -- PAV-CRANE-VSU-PTR (APU fuel shutoff valve) + [281] = "%1d", -- PAV-CRANE-COVER-VSU-PTR (APU fuel shutoff valve Cover) + [282] = "%1d", -- PAV-CRANE-CYKLIZATION-PTR (Fuel crossfeed valve) + [283] = "%1d", -- PAV-CRANE-COVER-CYKLIZATION-PTR (Fuel crossfeed valve Cover) + -- COMMS POWER + [284] = "%1d", -- COMM-PWR-AVSK-PTR (Intercom) + [285] = "%1d", -- COMM-PWR-UKV-1-PTR (VHF-1 (R828) power switch) + [286] = "%1d", -- COMM-PWR-UKV-2-PTR (VHF-2 (R-800) power switch) + [287] = "%1d", -- COMM-PWR-TLK-PTR (Radio equipment datalink TLK power switch) + [288] = "%1d", -- COMM-PWR-UKV-TLK-PTR (Radio equipment datalink UHF TLK power switch) + [289] = "%1d", -- COMM-PWR-SA-TLF-PTR (Radio equipment datalink SA-TLF power switch) + -- WEAPON SYS + [547] = "%1d", -- SUO-PTR (Weapons Control system) + [548] = "%1d", -- SUO-COVER-PTR (Weapons Control system Cover) + -- EJECT SYSTEM + [214] = "%1d", -- RIGHT-EMERG-SW1-PTR (Ejecting system power 1) + [215] = "%1d", -- RIGHT-EMERG-SW2-PTR (Ejecting system power 2) + [216] = "%1d", -- RIGHT-EMERG-SW3-PTR (Ejecting system power 3) + [217] = "%1d", -- RIGHT-COVER-EMERG-VACATION-PTR (Ejecting system power Cover) + [462] = "%0.1f", -- CONTR-SAPROTATE-PTR (Ejecting system circuit selector) + [460] = "%.1f", -- CONTR-SAP-PTR (Ejecting system circuit test) + -- HYDRAULICS + [220] = "%1d", -- HYDRO-PTR (Main hydraulics) + [221] = "%1d", -- HYDRO-COVER-PTR02 (Main hydraulics Cover) + -- IFF + [218] = "%1d", -- SRO-PTR (IFF power) + [219] = "%1d", -- COVER-SRO-PTR (IFF power Cover) + -- NAV SYSTEM + [222] = "%1d", -- PNK-PTR (Navigation system power) + [229] = "%0.1f", -- GYRO-MAG-MAN-HEADING-PTR (Gyro/Mag/Manual heading) + -- Outside illumination + [228] = "%1d", -- FLASHER-PTR (Anticollision Light) + [296] = "%1d", -- CONTUR-LIGHT-PTR (Tip Lights) + [297] = "%0.1f", -- FORMATION-PTR (Formation Lights) + -- ENGINES + [290] = "%1d", -- ERD-LEFT-PTR (EEG Left engine Electronic Engine Governor) + [291] = "%1d", -- ERD-LEFT-COVER-PTR (EEG Left engine Electronic Engine Governor Cover) + [292] = "%1d", -- ERD-RIGHT-PTR (EEG Right engine Electronic Engine Governor) + [293] = "%1d", -- ERD-RIGHT-COVER-PTR (EEG Right engine Electronic Engine Governor Cover) + [294] = "%1d", -- PAV-CRANE-VSU-PTR01 (EEG gas generator test Operate switch) + [569] = "%1d", -- PAV-CRANE-COVER-VSU-PTR01 (EEG gas generator test Operate switch Cover) + [295] = "%0.1f", -- PAV-CRANE-VSU-PTR02 (EEG power turbine channel 1 test Operate EEG power turbine channel 2 test, three-switch contactor) + [570] = "%0.1f", -- PAV-CRANE-COVER-VSU-PTR02 (EEG power turbine channel 1 test Operate EEG power turbine channel 2 test, three-switch contactor Cover) + [457] = "%.1f", -- RT-12-6-LEFT-PTR (Left EGT control threshold governor button) + [458] = "%.1f", -- RT-12-6-RIGHT-PTR (Right EGT control threshold governor button) + [459] = "%.1f", -- RT-12-6-IV-PTR (Engines vibrations monitoring system control button) + -- Lighting + [300] = "%1d", -- DESK-PTR (Lighting cockpit panel switch) + [299] = "%1d", -- DEVICES-PTR (Lighting night vision cockpit switch) + [298] = "%1d", -- AGR-PKP-PTR (Lighting ADI and SAI switch) + -- Fire Extinguishers Control Panel + [236] = "%.1f", -- PUI800-AVARCHOP-PTR01 (Left engine extinguisher) + [238] = "%.1f", -- PUI800-AVARCHOP-PTR02 (APU extinguisher) + [240] = "%.1f", -- PUI800-AVARCHOP-PTR03 (Right engine extinguisher) + [242] = "%.1f", -- PUI800-AVARCHOP-PTR04 (Ventilator extinguisher) + [248] = "%0.1f", -- FIREEXT-PTR (Fire extinguisher Work Off Test switch) + [249] = "%0.1f", -- FIREEXT-COVER-PTR (Fire extinguisher Work Off Test switch Cover) + [250] = "%1d", -- FIREEXT-INDICATION-PTR (Fire signaling) + [246] = "%1d", -- BALOONS-PTR (Fire extinguisher First (Auto) / Second (Manual) selector) + [247] = "%1d", -- BALOONS-COVER-PTR (Fire extinguisher First (Auto) / Second (Manual) selector Cover) + -- Misc. systems + [258] = "%0.1f", -- REDUCTOR-PTR (Reducing gear box oil pressure indication selector) + [259] = "%1d", -- HANGER-PTR (Sling load Auto/Manual) + -- Auxiliary panel + --------------------------------------------------- + -- Preflight Set and Check Panel + [483] = "%0.1f", -- PPK-BBTZ-PTR (ATGM Temperature selector) + [484] = "%0.1f", -- PPK-NRAKS-PTR (Unguided rocket and gun pods ballistics data settings selector) + [485] = "%1d", -- PPK-RNP-PTR (Systems BIT selector) + [486] = "%1d", -- KCVM-PTR (Control computers BIT switch) + [489] = "%.1f", -- AKS-PTR (Self test system push-button) + [490] = "%1d", -- VnK-PTR (Emergency INU alignment switch) + [491] = "%1d", -- ROPE-PTR (Stabilisation and indication of hanger cable switch) + [492] = "%1d", -- FKP-PTR (Video Tape Recorder switch) + [487] = "%1d", -- IKV-PTR (INU Power switch) + [488] = "%1d", -- HEAT_IKV-PTR (INU Heater switch) + [452] = "%1d", -- P-CONTR-VMG-HYDRO-PTR (Power plant, hydraulics, EKRAN self-test systems switch) + [453] = "%1d", -- P-CONTR-VMG-HYDRO-COVER-PTR (Power plant, hydraulics, EKRAN self-test systems switch Cover) + -- PShK_7 (Latitude Entry Panel) + [340] = "%.3f", -- LATITUDE-PTR (Latitude selection rotaty) + [341] = "%1d", -- N-S-PTR (North/South latitude selection) + -- ZMS_3 (Magnetic Variation Entry Panel) + [338] = "%.3f" -- DCLIN-PTR (Magnetic variation selection rotaty) +} + +-- Lookup tables for weapons store type display +ExportScript.AF.Ka50StationTypes = +{ + ["9A4172"] = "NC", + ["S-8KOM"] = "HP", + ["S-13"] = "HP", + ["UPK-23-250"] = "NN", + ["AO-2.5RT"] = "A6", + ["PTAB-2.5KO"] = "A6", + ["FAB-250"] = "A6", + ["FAB-500"] = "A6" +} + +-- State data +ExportScript.AF.Ka50Trigger = 0 + +----------------------------------------------------- +-- LOW IMPORTANCE EXPORTS -- +-- done every gExportLowTickInterval export events -- +----------------------------------------------------- + +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] + -- function for Ikarus + + local lWeaponSystem = GetDevice(12) + local lEKRAN = GetDevice(10) + local lCannonAmmoCount = "" + local lStationNumbers = lWeaponSystem:get_selected_weapon_stations() + local lStationCount = "" + local lStationType = "" + local lTargetingPower = mainPanelDevice:get_argument_value(433) + local lTrigger = mainPanelDevice:get_argument_value(615) + if lTrigger == 0 then + ExportScript.AF.Ka50Trigger = 1 + end + if lTrigger == -1 then + ExportScript.AF.Ka50Trigger = 0 + end + + if lTargetingPower == 1 then + lCannonAmmoCount = string.format("%02d",string.match(lWeaponSystem:get_selected_gun_ammo_count() / 10,"(%d+)")) + + if #lStationNumbers ~= 0 and ExportScript.AF.Ka50Trigger == 0 then + lStationCount = 0 + for i=1,#lStationNumbers do + lStationCount = lStationCount + lWeaponSystem:get_weapon_count_on_station(lStationNumbers[i]) + end + + lStationCount = string.format("%02d", lStationCount); + + lStationType = ExportScript.AF.Ka50StationTypes[lWeaponSystem:get_weapon_type_on_station(lStationNumbers[1])] + if lStationType == nil then + lStationType = "" + end + end + end + + local lEkranSendString = "" + local lEkranText = lEKRAN:get_actual_text_frame() + if lEkranText ~= "" then + lEkranSendString = string.sub(lEkranText,1,8).."\n"..string.sub(lEkranText,12,19).."\n"..string.sub(lEkranText,23,30).."\n"..string.sub(lEkranText,34,41) + end + + local lFAILlight = "" -- FAILURE + local lMEMORYlight = "" -- MEMORY + local lTURNlight = "" -- TURN + if lEkranSendString ~= "" then + lFAILlight = "FAILURE" + end + -- DisplayWindow (main message) + -- FAILlight (failure text) + -- MEMORYlight (memmory text) + -- TURNlight (turn text) + --ExportScript.Tools.SendData(2001, string.format("%s", lEkranSendString)) + --ExportScript.Tools.SendData(2002, string.format("%s", lFAILlight)) + --ExportScript.Tools.SendData(2003, string.format("%s", lMEMORYlight)) + --ExportScript.Tools.SendData(2004, string.format("%s", lTURNlight)) + -- PUI-800 Weapon panel + --------------------------------------------------- + ExportScript.Tools.SendData(2005, string.format("%s", lStationType)) + ExportScript.Tools.SendData(2006, string.format("%s", lStationCount)) + ExportScript.Tools.SendData(2007, string.format("%s", lCannonAmmoCount)) + + --ExportScript.Tools.WriteToLog('lEkranSendString: '..ExportScript.Tools.dump(lEkranSendString)) + --ExportScript.Tools.WriteToLog('lFAILlight: '..ExportScript.Tools.dump(lFAILlight)) + --ExportScript.Tools.WriteToLog('lMEMORYlight: '..ExportScript.Tools.dump(lMEMORYlight)) + --ExportScript.Tools.WriteToLog('lTURNlight: '..ExportScript.Tools.dump(lTURNlight)) + + --ExportScript.Tools.WriteToLog('EKRAN: '..ExportScript.Tools.dump(list_indication(4))) + local lEKRAN = list_indication(4) + lEKRAN = lEKRAN:gsub("-----------------------------------------", "") + lEKRAN = lEKRAN:gsub("\n", "") -- oder %c + + + local to1, to2, from1, from2, lEKRANframe, lEKRANtxtqueue, lEKRANtxt1, lEKRANtxt2 = nil, nil, nil, nil, "", "", "", "" + to1, to2 = lEKRAN:find("txt_queue") + if (to1 == nil) then + from1, from2 = 1,5 -- lEKRAN:find("frame") + to1, to2 = lEKRAN:find("txt_1") + lEKRANframe = lEKRAN:sub(from2+1, to1-1) + else + from1, from2 = 1,5 -- lEKRAN:find("frame") + --to1, to2 = lEKRAN:find("txt_queue") + lEKRANframe = lEKRAN:sub(from2+1, to1-1) + + from1, from2 = lEKRAN:find("txt_queue") + to1, to2 = lEKRAN:find("txt_1") + lEKRANtxtqueue = lEKRAN:sub(from2+1, to1-1) + end + from1, from2 = lEKRAN:find("txt_1") + to1, to2 = lEKRAN:find("txt_2") + lEKRANtxt1 = lEKRAN:sub(from2+1, to1-1) + from1, from2 = lEKRAN:find("txt_2") + --to1, to2 = lEKRAN:find("txt_2") + lEKRANtxt2 = lEKRAN:sub(from2+1, -1) + + --ExportScript.Tools.WriteToLog('lEKRANframe: '..ExportScript.Tools.dump(lEKRANframe)) + --ExportScript.Tools.WriteToLog('lEKRANtxtqueue: '..ExportScript.Tools.dump(lEKRANtxtqueue)) + --ExportScript.Tools.WriteToLog('lEKRANtxt1: '..ExportScript.Tools.dump(lEKRANtxt1)) + --ExportScript.Tools.WriteToLog('lEKRANtxt2: '..ExportScript.Tools.dump(lEKRANtxt2)) + + lEkranSendString = string.sub(lEKRANtxt2,1,9).."\n"..string.sub(lEKRANtxt2,11,19).."\n"..string.sub(lEKRANtxt2,21,29).."\n"..string.sub(lEKRANtxt2,31,39) + ExportScript.Tools.SendData(2001, string.format("%s", lEkranSendString)) + ExportScript.Tools.SendData(2004, string.format("%s", lEKRANtxtqueue)) +end + +-- Pointed to by ProcessDACLowImportance, if the player aircraft is a Ka-50 +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + -- Radio comunication + -- ARK_22 (ADF) Frequncy + local lARK_22 = GetDevice(46) + ExportScript.Tools.SendDataDAC("2000", string.format("%1d", lARK_22:get_channel())) + + -- R_800 + local lR_800 = GetDevice(48) + ExportScript.Tools.SendDataDAC("2001", string.format("%7.3f", lR_800:get_frequency()/1000000)) + + -- R_828 Channel + local lR_828 = {[0.0]="1",[0.1]="2",[0.2]="3",[0.3]="4",[0.4]="5",[0.5]="6",[0.6]="7",[0.7]="8",[0.8]="9",[0.9]="10"} + ExportScript.Tools.SendDataDAC("2002", lR_828[ExportScript.Tools.round(mainPanelDevice:get_argument_value(371), 1)]) + + -- R_828 Frequency + local lR_828_F = GetDevice(49) + if lR_828_F:is_on() then + ExportScript.Tools.SendDataDAC("2003", string.format("%7.3f", lR_828_F:get_frequency()/1000000)) + else + ExportScript.Tools.SendDataDAC("2003", "-") + end + + -- Weapon + local lWeaponSystem = GetDevice(12) + local lCannonAmmoCount = " " + local lStationNumbers = lWeaponSystem:get_selected_weapon_stations() + local lStationCount = " " + local lStationType = " " + local lTargetingPower = mainPanelDevice:get_argument_value(433) + local lTrigger = mainPanelDevice:get_argument_value(615) + if lTrigger == 0 then + ExportScript.AF.Ka50Trigger = 1 + end + if lTrigger == -1 then + ExportScript.AF.Ka50Trigger = 0 + end + + if lTargetingPower == 1 then + lCannonAmmoCount = string.format("%02d",string.match(lWeaponSystem:get_selected_gun_ammo_count() / 10,"(%d+)")) + + if #lStationNumbers ~= 0 and ExportScript.AF.Ka50Trigger == 0 then + lStationCount = 0 + for i=1,#lStationNumbers do + lStationCount = lStationCount + lWeaponSystem:get_weapon_count_on_station(lStationNumbers[i]) + end + + lStationCount = string.format("%02d", lStationCount); + + lStationType = ExportScript.AF.Ka50StationTypes[lWeaponSystem:get_weapon_type_on_station(lStationNumbers[1])] + if lStationType == nil then + lStationType = " " + end + end + end + + --ExportScript.Tools.SendDataDAC("2004",lStationType) + ExportScript.Tools.SendDataDAC("2005",lStationCount) + ExportScript.Tools.SendDataDAC("2006",lCannonAmmoCount) + + local lUV26 = list_indication(7) + lUV26 = lUV26:gsub("-----------------------------------------", "") + lUV26 = lUV26:gsub("txt_digits", "") + lUV26 = lUV26:gsub("%c", "") + + ExportScript.Tools.SendDataDAC("2007", string.format("%s", lUV26)) + + + local lPVI800 = list_indication(5) + --[[ + txt_VIT Inhalt obere Zeile + txt_NIT Inhalt untere Zeile + txt_OIT_PPM Punkt obere Zeile + txt_OIT_NOT Punkt untere Zeile + txt_VIT_apostrophe1 1. Apostroph obere Zeile 3. Ziffer + txt_VIT_apostrophe2 2. Apostroph obere Zeile 5. Ziffer + txt_NIT_apostrophe1 1. Apostroph untere Zeile 3. Ziffer + txt_NIT_apostrophe2 2. Apostroph untere Zeile 5. Ziffer + ]] + local ltxt_upper_row, ltxt_lower_row = "" + local lpos1, pos2, lpos3, pos4, ltxt_VIT, ltxt_NIT, ltxt_OIT_PPM, ltxt_OIT_NOT + local ltxt_VIT_apostrophe1, ltxt_VIT_apostrophe2, ltxt_NIT_apostrophe1, ltxt_NIT_apostrophe2 = false + lpos1, pos2 = lPVI800:find("txt_VIT%c", 1) + if pos2 ~= nil then + lpos3, pos4 = lPVI800:find("-----------------------------------------", pos2) + if lpos3 ~= nil then + ltxt_VIT = lPVI800:sub(pos2 + 1, lpos3 - 2) + else + ltxt_VIT = lPVI800:sub(pos2 + 1) + end + end + lpos1, pos2 = lPVI800:find("txt_NIT%c", 1) + if pos2 ~= nil then + lpos3, pos4 = lPVI800:find("-----------------------------------------", pos2) + if lpos3 ~= nil then + ltxt_NIT = lPVI800:sub(pos2 + 1, lpos3 - 2) + else + ltxt_NIT = lPVI800:sub(pos2 + 1) + end + end + lpos1, pos2 = lPVI800:find("txt_OIT_PPM%c", 1) + if pos2 ~= nil then + lpos3, pos4 = lPVI800:find("-----------------------------------------", pos2) + if lpos3 ~= nil then + ltxt_OIT_PPM = lPVI800:sub(pos2 + 1, lpos3 - 2) + else + ltxt_OIT_PPM = lPVI800:sub(pos2 + 1) + end + end + lpos1, pos2 = lPVI800:find("txt_OIT_NOT%c", 1) + if pos2 ~= nil then + lpos3, pos4 = lPVI800:find("-----------------------------------------", pos2) + if lpos3 ~= nil then + ltxt_OIT_NOT = lPVI800:sub(pos2 + 1, lpos3 - 2) + else + ltxt_OIT_NOT = lPVI800:sub(pos2 + 1) + end + end + lpos1, pos2 = lPVI800:find("txt_VIT_apostrophe1", 1) + if pos2 ~= nil then + ltxt_VIT_apostrophe1 = true + end + lpos1, pos2 = lPVI800:find("txt_VIT_apostrophe2", 1) + if pos2 ~= nil then + ltxt_VIT_apostrophe2 = true + end + lpos1, pos2 = lPVI800:find("txt_NIT_apostrophe1", 1) + if pos2 ~= nil then + ltxt_NIT_apostrophe1 = true + end + lpos1, pos2 = lPVI800:find("txt_NIT_apostrophe2", 1) + if pos2 ~= nil then + ltxt_NIT_apostrophe2 = true + end + + if ltxt_VIT ~= nil then + ltxt_VIT = ltxt_VIT:gsub("%c", "") + ltxt_upper_row = ltxt_VIT:sub(1, 3) + if ltxt_VIT_apostrophe1 then + ltxt_upper_row = ltxt_upper_row.."." + end + ltxt_upper_row = ltxt_upper_row..ltxt_VIT:sub(4, 5) + if ltxt_VIT_apostrophe2 then + ltxt_upper_row = ltxt_upper_row.."." + end + ltxt_upper_row = ltxt_upper_row..ltxt_VIT:sub(6) + end + + if ltxt_NIT ~= nil then + ltxt_NIT = ltxt_NIT:gsub("%c", "") + ltxt_lower_row = ltxt_NIT:sub(1, 3) + if ltxt_NIT_apostrophe1 then + ltxt_lower_row = ltxt_lower_row.."." + end + ltxt_lower_row = ltxt_lower_row..ltxt_NIT:sub(4, 5) + if ltxt_NIT_apostrophe2 then + ltxt_lower_row = ltxt_lower_row.."." + end + ltxt_lower_row = ltxt_lower_row..ltxt_NIT:sub(6) + end + + if ltxt_VIT ~= nil then + ltxt_upper_row = ltxt_upper_row..string.rep(" ", 7 - ltxt_VIT:len()) + else + ltxt_upper_row = string.rep(" ", 7) + end + + if ltxt_OIT_PPM ~= nil then + ltxt_OIT_PPM = ltxt_OIT_PPM:gsub("%c", "") + ltxt_upper_row = ltxt_upper_row..ltxt_OIT_PPM + else + ltxt_upper_row = ltxt_upper_row.." " + end + + if ltxt_NIT ~= nil then + ltxt_lower_row = ltxt_lower_row..string.rep(" ", 7 - ltxt_NIT:len()) + else + ltxt_lower_row = string.rep(" ", 7) + end + + if ltxt_OIT_NOT ~= nil then + ltxt_OIT_NOT = ltxt_OIT_NOT:gsub("%c", "") + ltxt_lower_row = ltxt_lower_row..ltxt_OIT_NOT + else + ltxt_lower_row = ltxt_lower_row.." " + end + + ExportScript.Tools.SendDataDAC("2008", string.format("%s", ltxt_upper_row)) + ExportScript.Tools.SendDataDAC("2009", string.format("%s", ltxt_lower_row)) + + --[[ + --ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + + local ltmp1 = 0 + for ltmp2 = 1, 14, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] +end + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] + ExportScript.Tools.SendData(44, string.format("%.1f", mainPanelDevice:get_argument_value(44))) -- lamp_MasterWarning {0.0,0.3} + ExportScript.Tools.SendData(46, string.format("%.1f", mainPanelDevice:get_argument_value(46))) -- lamp_RotorRPM {0.0,0.1} +end + +-- Pointed to by ProcessDACHighImportance, if the player aircraft is a Ka-50 +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to hardware + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + + ExportScript.Tools.SendDataDAC("44", mainPanelDevice:get_argument_value(44) > 0.0 and 1 or 0) -- lamp_MasterWarning {0.0,0.3} + ExportScript.Tools.SendDataDAC("46", mainPanelDevice:get_argument_value(46) > 0.0 and 1 or 0) -- lamp_RotorRPM {0.0,0.1} + + -- generic Radio display and frequency rotarys + ------------------------------------------------- + ExportScript.genericRadio(nil, nil, ExportScript.Config.genericRadioHardwareID) + +--[[ + -- ENGINE_INTERFACE + local lENGINE_INTERFACE = GetDevice(4) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_left_engine_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_left_engine_temp())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_left_engine_rpm '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_left_engine_rpm())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_right_engine_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_right_engine_temp())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_right_engine_rpm '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_right_engine_rpm())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_apu_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_apu_temp())) + + -- ABRIS + local lABRIS = GetDevice(9) + ExportScript.Tools.WriteToLog('lABRIS:get_active_route '..ExportScript.Tools.dump(lABRIS:get_active_route())) + ExportScript.Tools.WriteToLog('lABRIS:get_edited_route '..ExportScript.Tools.dump(lABRIS:get_edited_route())) + ExportScript.Tools.WriteToLog('lABRIS:get_sns_mode '..ExportScript.Tools.dump(lABRIS:get_sns_mode())) + ExportScript.Tools.WriteToLog('lABRIS:get_current_route '..ExportScript.Tools.dump(lABRIS:get_current_route())) + --ExportScript.Tools.WriteToLog('lABRIS:get_current_route_segment_info '..ExportScript.Tools.dump(lABRIS:get_current_route_segment_info())) -- DCS Error + ExportScript.Tools.WriteToLog('lABRIS:get_mode '..ExportScript.Tools.dump(lABRIS:get_mode())) + ExportScript.Tools.WriteToLog('lABRIS:print_to_console '..ExportScript.Tools.dump(lABRIS:print_to_console())) + --ExportScript.Tools.WriteToLog('lABRIS:replace_last_console_line '..ExportScript.Tools.dump(lABRIS:replace_last_console_line())) -- DCS Error + + -- EKRAN + local lEKRAN = GetDevice(10) + ExportScript.Tools.WriteToLog('lEKRAN:get_actual_text_frame '..ExportScript.Tools.dump(lEKRAN:get_actual_text_frame())) + + -- WEAP_INTERFACE + local lWEAP_INTERFACE = GetDevice(12) + ExportScript.Tools.WriteToLog('lWEAP_INTERFACE:get_weapon_type_on_station '..ExportScript.Tools.dump(lWEAP_INTERFACE:get_weapon_type_on_station())) + ExportScript.Tools.WriteToLog('lWEAP_INTERFACE:get_selected_weapon_stations '..ExportScript.Tools.dump(lWEAP_INTERFACE:get_selected_weapon_stations())) + ExportScript.Tools.WriteToLog('lWEAP_INTERFACE:get_selected_gun_ammo '..ExportScript.Tools.dump(lWEAP_INTERFACE:get_selected_gun_ammo())) + ExportScript.Tools.WriteToLog('lWEAP_INTERFACE:get_selected_gun_ammo_count '..ExportScript.Tools.dump(lWEAP_INTERFACE:get_selected_gun_ammo_count())) + ExportScript.Tools.WriteToLog('lWEAP_INTERFACE:get_weapon_count_on_station '..ExportScript.Tools.dump(lWEAP_INTERFACE:get_weapon_count_on_station())) + + -- DISS + local lDISS = GetDevice(16) + ExportScript.Tools.WriteToLog('lDISS:get_w_vector '..ExportScript.Tools.dump(lDISS:get_w_vector())) + ExportScript.Tools.WriteToLog('lDISS:get_drift_angle '..ExportScript.Tools.dump(lDISS:get_drift_angle())) + + -- NAV_INTERFACE + local lNAV_INTERFACE = GetDevice(28) + ExportScript.Tools.WriteToLog('lNAV_INTERFACE:get_indicated_air_speed '..ExportScript.Tools.dump(lNAV_INTERFACE:get_indicated_air_speed())) + ExportScript.Tools.WriteToLog('lNAV_INTERFACE:get_vertical_velocity '..ExportScript.Tools.dump(lNAV_INTERFACE:get_vertical_velocity())) + + -- HSI + local lHSI = GetDevice(30) + ExportScript.Tools.WriteToLog('lHSI:get_course '..ExportScript.Tools.dump(lHSI:get_course())) + ExportScript.Tools.WriteToLog('lHSI:get_course_dev_warning_flag '..ExportScript.Tools.dump(lHSI:get_course_dev_warning_flag())) + ExportScript.Tools.WriteToLog('lHSI:get_heading '..ExportScript.Tools.dump(lHSI:get_heading())) + ExportScript.Tools.WriteToLog('lHSI:get_heading_warning_flag '..ExportScript.Tools.dump(lHSI:get_heading_warning_flag())) + ExportScript.Tools.WriteToLog('lHSI:get_glideslope_dev_warning_flag '..ExportScript.Tools.dump(lHSI:get_glideslope_dev_warning_flag())) + ExportScript.Tools.WriteToLog('lHSI:get_range '..ExportScript.Tools.dump(lHSI:get_range())) + ExportScript.Tools.WriteToLog('lHSI:get_commanded_course '..ExportScript.Tools.dump(lHSI:get_commanded_course())) + ExportScript.Tools.WriteToLog('lHSI:get_bearing '..ExportScript.Tools.dump(lHSI:get_bearing())) + ExportScript.Tools.WriteToLog('lHSI:get_commanded_heading '..ExportScript.Tools.dump(lHSI:get_commanded_heading())) + + -- ADI + local lADI = GetDevice(31) + ExportScript.Tools.WriteToLog('lADI:get_sideslip '..ExportScript.Tools.dump(lADI:get_sideslip())) + ExportScript.Tools.WriteToLog('lADI:get_attitude_warn_flag_val '..ExportScript.Tools.dump(lADI:get_attitude_warn_flag_val())) + ExportScript.Tools.WriteToLog('lADI:get_pitch_steering '..ExportScript.Tools.dump(lADI:get_pitch_steering())) + ExportScript.Tools.WriteToLog('lADI:get_track_deviation '..ExportScript.Tools.dump(lADI:get_track_deviation())) + ExportScript.Tools.WriteToLog('lADI:get_airspeed_deviation '..ExportScript.Tools.dump(lADI:get_airspeed_deviation())) + ExportScript.Tools.WriteToLog('lADI:get_height_deviation '..ExportScript.Tools.dump(lADI:get_height_deviation())) + ExportScript.Tools.WriteToLog('lADI:get_bank_steering '..ExportScript.Tools.dump(lADI:get_bank_steering())) + ExportScript.Tools.WriteToLog('lADI:get_pitch '..ExportScript.Tools.dump(lADI:get_pitch())) + ExportScript.Tools.WriteToLog('lADI:get_steering_warn_flag_val '..ExportScript.Tools.dump(lADI:get_steering_warn_flag_val())) + ExportScript.Tools.WriteToLog('lADI:get_bank '..ExportScript.Tools.dump(lADI:get_bank())) + + -- AUTOPILOT + local lAUTOPILOT = GetDevice(33) + ExportScript.Tools.WriteToLog('lAUTOPILOT:get_channel_status_Bank '..ExportScript.Tools.dump(lAUTOPILOT:get_channel_status_Bank())) + ExportScript.Tools.WriteToLog('lAUTOPILOT:get_directional_mode '..ExportScript.Tools.dump(lAUTOPILOT:get_directional_mode())) + ExportScript.Tools.WriteToLog('lAUTOPILOT:get_channel_status_Yaw '..ExportScript.Tools.dump(lAUTOPILOT:get_channel_status_Yaw())) + ExportScript.Tools.WriteToLog('lAUTOPILOT:get_channel_status_Pitch '..ExportScript.Tools.dump(lAUTOPILOT:get_channel_status_Pitch())) + ExportScript.Tools.WriteToLog('lAUTOPILOT:get_channel_status_Height '..ExportScript.Tools.dump(lAUTOPILOT:get_channel_status_Height())) + + -- RADAR_ALTIMETER + local lRADAR_ALTIMETER = GetDevice(38) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_altitude '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_altitude())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_dangerous_height_flag '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_dangerous_height_flag())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_distance_limit())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_dangerous_height '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_dangerous_height())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_warning_flag '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_warning_flag())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_mode '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_mode())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_aperture_size())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_needle_value '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_needle_value())) + + -- MISC_SYSTEMS_INTERFACE + local lMISC_SYSTEMS_INTERFACE = GetDevice(41) + ExportScript.Tools.WriteToLog('lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch '..ExportScript.Tools.dump(lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch())) + ExportScript.Tools.WriteToLog('lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm '..ExportScript.Tools.dump(lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm())) + + -- ARK_22 + local lARK_22 = GetDevice(46) + ExportScript.Tools.WriteToLog('lARK_22:get_channel '..ExportScript.Tools.dump(lARK_22:get_channel())) + ExportScript.Tools.WriteToLog('lARK_22:get_mode '..ExportScript.Tools.dump(lARK_22:get_mode())) + ExportScript.Tools.WriteToLog('lARK_22:get_homer_selector_pos '..ExportScript.Tools.dump(lARK_22:get_homer_selector_pos())) + + -- R_800 + local lR_800 = GetDevice(48) + ExportScript.Tools.WriteToLog('lR_800:is_on '..ExportScript.Tools.dump(lR_800:is_on())) + ExportScript.Tools.WriteToLog('lR_800:get_frequency '..ExportScript.Tools.dump(lR_800:get_frequency())) + --ExportScript.Tools.WriteToLog('lR_800:set_modulation '..ExportScript.Tools.dump(lR_800:set_modulation())) -- test the parameters + --ExportScript.Tools.WriteToLog('lR_800:set_frequency '..ExportScript.Tools.dump(lR_800:(set_frequency))) -- test the parameters + + -- R_828 + local R_828 = GetDevice(49) + ExportScript.Tools.WriteToLog('R_828:is_on '..ExportScript.Tools.dump(R_828:is_on())) + ExportScript.Tools.WriteToLog('R_828:get_frequency '..ExportScript.Tools.dump(R_828:get_frequency())) + --ExportScript.Tools.WriteToLog('R_828:set_modulation '..ExportScript.Tools.dump(R_828:set_modulation())) -- test the parameters + --ExportScript.Tools.WriteToLog('R_828:set_frequency '..ExportScript.Tools.dump(R_828:(set_frequency))) -- test the parameters + --ExportScript.Tools.WriteToLog('R_828:set_channel '..ExportScript.Tools.dump(R_828:(set_channel))) -- test the parameters + + -- SPU_9 + local lSPU_9 = GetDevice(50) + ExportScript.Tools.WriteToLog('lSPU_9:get_is_on '..ExportScript.Tools.dump(lSPU_9:get_is_on())) + ExportScript.Tools.WriteToLog('lSPU_9:is_communicator_available '..ExportScript.Tools.dump(lSPU_9:is_communicator_available())) + ExportScript.Tools.WriteToLog('lSPU_9:get_selector_pos '..ExportScript.Tools.dump(lSPU_9:get_selector_pos())) + ExportScript.Tools.WriteToLog('lSPU_9:get_noise_level '..ExportScript.Tools.dump(lSPU_9:get_noise_level())) + ExportScript.Tools.WriteToLog('lSPU_9:get_signal_level '..ExportScript.Tools.dump(lSPU_9:get_signal_level())) + --ExportScript.Tools.WriteToLog('lSPU_9:set_communicator '..ExportScript.Tools.dump(lSPU_9:set_communicator())) -- test the parameters + --ExportScript.Tools.WriteToLog('lSPU_9:set_voip_mode '..ExportScript.Tools.dump(lSPU_9:set_voip_mode())) -- test the parameters + + -- STBY_ADI + local lSTBY_ADI = GetDevice(55) + ExportScript.Tools.WriteToLog('lSTBY_ADI:get_sideslip '..ExportScript.Tools.dump(lSTBY_ADI:get_sideslip())) + ExportScript.Tools.WriteToLog('lSTBY_ADI:get_bank '..ExportScript.Tools.dump(lSTBY_ADI:get_bank())) + ExportScript.Tools.WriteToLog('lSTBY_ADI:get_pitch '..ExportScript.Tools.dump(lSTBY_ADI:get_pitch())) + ]] +--[[ + local ltmp1 = 0 + for ltmp2 = 0, 62, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end +]] +end + +----------------------------- +-- Custom functions -- +----------------------------- + +function ExportScript.genericRadio(key, value, hardware) + local lHardware = hardware or 1 + -- Werte werden per Encoder im Bereich von 0.0 bis 2.0 in 0.1 Schritten uebergeben + -- im jeweiligen Abschnitt muessen die Eingangsdaten auf den Zulaessigen Bereich eingeschraengt werden + local lRotaryFrequency_1, lRotaryFrequency_2, lVolume, lPreset, lLoad, lSquelch, lManualPreset, lPower, lDevice, lClickAction, lSetFrequency = nil + local lMainPanelDevice = GetDevice(0) + local lMaxRadios = 2 + + if ExportScript.AF.genericRadio == nil then + ExportScript.AF.genericRadio = 0 + end + if ExportScript.AF.genericRadioFrequency1 == nil then + ExportScript.AF.genericRadioFrequency1 = 0.0 + end + if ExportScript.AF.genericRadioFrequency2 == nil then + ExportScript.AF.genericRadioFrequency2 = 0.0 + end + if ExportScript.AF.genericRadioPresetChannel == nil then + ExportScript.AF.genericRadioPresetChannel = 0.0 + end + if ExportScript.AF.genericRadioPower == nil then + ExportScript.AF.genericRadioPower = {} + end + if ExportScript.AF.genericRadioPresetManual == nil then + ExportScript.AF.genericRadioPresetManual = {} + end + if ExportScript.AF.genericRadioSquelch == nil then + ExportScript.AF.genericRadioSquelch = {} + end + + if key == "3001" then + ExportScript.AF.genericRadio = tonumber(value) + end + if key == "3002" then + lRotaryFrequency_1 = tonumber(value) + end + if key == "3003" then + lRotaryFrequency_2 = tonumber(value) + end + if key == "3004" then + lVolume = tonumber(value) + end + if key == "3005" then + lPreset = tonumber(value) + end + if key == "3006" then + lLoad = tonumber(value) + end + if key == "3007" then + lSquelch = tonumber(value) + end + if key == "3008" then + lManualPreset = tonumber(value) + end + if key == "3009" then + lPower = tonumber(value) + end + + if ExportScript.AF.genericRadio > lMaxRadios then + ExportScript.Tools.WriteToLog("Radio Nr. "..ExportScript.AF.genericRadio.." not defined.") + return + end + + if ExportScript.AF.genericRadio == 1 then + -- R_800 FM/AM Radio###.### + local lDeviceID = 48 + local lR_800 = GetDevice(lDeviceID) + + -- check status of the radio + if ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == nil then + if lR_800:is_on() then + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 + else + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0.0 + end + end + if ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(167), 1) == 0) and 1 or 0) + end + if ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(170), 1) == 0) and 1 or 0) + end + + local lR_800_FREQUENCY = ExportScript.Tools.round(lR_800:get_frequency()/1000000 , 3, "floor") + + ExportScript.Tools.SendDataDAC("3000", string.format("%.3f", lR_800_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3001", string.format("-"), lHardware) + ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lR_800_FREQUENCY), lHardware) + + if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lR_800_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 25) + lFrequency[2] = ltmp * 25 + end + if lRotaryFrequency_1 < ExportScript.AF.genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then + lFrequency[1] = lFrequency[1] - 1 + if lFrequency[1] == 99 then + lFrequency[1] = 399 + end + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 + else + lFrequency[1] = lFrequency[1] + 1 + if lFrequency[1] == 400 then + lFrequency[1] = 100 + end + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("1. generic Ka-50 R_800 Radio, don't split frequency: "..lFrequency) + end + end + + if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lR_800_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 25) + lFrequency[2] = ltmp * 25 + end + if lRotaryFrequency_2 < ExportScript.AF.genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then + lFrequency[2] = lFrequency[2] - 25 + if lFrequency[2] == -25 then + lFrequency[2] = 975 + end + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 + else + lFrequency[2] = lFrequency[2] + 25 + if lFrequency[2] == 1000 then + lFrequency[2] = 0 + end + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("2. generic Ka-50 R_800 Radio, don't split frequency: "..lFrequency) + end + end +--[[ + if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then + lVolume = lVolume / 2 + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3005, + Value = lVolume} + end + if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then + -- Preset 0.0 to 0.20 in 0.01 steps + if lPreset < ExportScript.AF.genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3001, + Value = 0.01} + ExportScript.AF.genericRadioPresetChannel = lPreset + else + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3002, + Value = -0.01} + ExportScript.AF.genericRadioPresetChannel = lPreset + end + end + if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3006, + Value = lLoad} + end +]] + if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then + if lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 1.0 then + -- Squelch off + lSquelch = 0.0 + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0 + elseif lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 0 then + -- Squelch on + lSquelch = 1.0 + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3006, + Value = lSquelch} + end + -- ManualPreset is AM FM modus switch + if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then + if lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 0.0 then + -- AM + lManualPreset = 1.0 + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 1.0 + elseif lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 1.0 then + -- FM + lManualPreset = 0.0 + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3002, + Value = lManualPreset} + end + if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then + if lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 1.0 then + -- Power off + lPower = 0.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0 + elseif lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 0 then + -- Power on + lPower = 1.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3011, + Value = lPower} + end + + elseif ExportScript.AF.genericRadio == 2 then + -- R_828 VHF ###.### + --------------------------------------------------- + local lDeviceID = 49 + local lR_828_RADIO = GetDevice(lDeviceID) + + -- check status of the radio + if ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == nil then + if lR_828_RADIO:is_on() then + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 + else + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0.0 + end + end + if ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(135), 1) == 0.1) and 1 or 0) + end + if ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == nil then + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(134), 1) == 1.0) and 0 or 1) + end + + local lR_828_RADIO_PRESET = {[0.0]="1",[0.1]="2",[0.2]="3",[0.3]="4",[0.4]="5",[0.5]="6",[0.6]="7",[0.7]="8",[0.8]="9",[0.9]="10"} + local lR_828_RADIO_FREQUENCY = ExportScript.Tools.round(lR_828_RADIO:get_frequency()/1000000 , 3, "floor") + + local lPresetChannel = ExportScript.Tools.round(lMainPanelDevice:get_argument_value(371), 1) + + ExportScript.Tools.SendDataDAC("3000", string.format("%s0%.3f", lR_828_RADIO_PRESET[lPresetChannel], lR_828_RADIO_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3001", string.format("%s0", lR_828_RADIO_PRESET[lPresetChannel]), lHardware) + ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lR_828_RADIO_FREQUENCY), lHardware) + +--[[ + if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lR_828_RADIO_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 25) + lFrequency[2] = ltmp * 25 + end + if lRotaryFrequency_1 < ExportScript.AF.genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then + lFrequency[1] = lFrequency[1] - 1 + if lFrequency[1] == 29 then + lFrequency[1] = 159 + end + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 + else + lFrequency[1] = lFrequency[1] + 1 + if lFrequency[1] == 160 then + lFrequency[1] = 30 + end + ExportScript.AF.genericRadioFrequency1 = lRotaryFrequency_1 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("1. generic Ka-50 VHF Radio, don't split frequency: "..lFrequency) + end + end + + if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lR_828_RADIO_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 25) + lFrequency[2] = ltmp * 25 + end + if lRotaryFrequency_2 < ExportScript.AF.genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then + lFrequency[2] = lFrequency[2] - 25 + if lFrequency[2] == -25 then + lFrequency[2] = 975 + end + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 + else + lFrequency[2] = lFrequency[2] + 25 + if lFrequency[2] == 1000 then + lFrequency[2] = 0 + end + ExportScript.AF.genericRadioFrequency2 = lRotaryFrequency_2 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("2. generic Ka-50 VHF Radio, don't split frequency: "..lFrequency) + end + end +]] + if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then + lVolume = lVolume / 2 + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3002, + Value = lVolume} + end + if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then +--[[ + -- Preset 0.0 to 0.9 in 0.1 steps + lPreset = (lPreset / 2) - 0.1 + if lPreset < ExportScript.AF.genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3001, + Value = 0.1} + ExportScript.AF.genericRadioPresetChannel = lPreset + else + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3001, + Value = -0.1} + ExportScript.AF.genericRadioPresetChannel = lPreset + end +]] + -- Preset 0.0 to 0.9 in 0.1 steps + lPreset = lPreset / 2 + if lPreset == 1.0 then + lPreset = 0.9 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3001, + Value = lPreset} + end + -- Load Button change the Frequence + if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3003, + Value = lLoad} + end + if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then + if lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 1.0 then + -- Squelch off + lSquelch = 0.0 + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 0 + elseif lSquelch == 1.0 and ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] == 0 then + -- Squelch on + lSquelch = 1.0 + ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3004, + Value = lSquelch} + end +--[[ + if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then + if lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 1.0 then + -- Manual on + lManualPreset = 0.2 + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 0 + elseif lManualPreset == 1.0 and ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] == 0 then + -- Preset on + lManualPreset = 0.3 + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3003, + Value = lManualPreset} + end +]] + if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then + if lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 1.0 then + -- Power off + lPower = 0.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 0 + elseif lPower == 1.0 and ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] == 0 then + -- Power on + lPower = 1.0 + ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3005, + Value = lPower} + end + + --ExportScript.Tools.SendDataDAC("3011", lMainPanelDevice:get_argument_value(375), lHardware) + ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio] = lMainPanelDevice:get_argument_value(375) + + else + ExportScript.Tools.SendDataDAC("3000", "-", lHardware) + ExportScript.Tools.SendDataDAC("3001", "-", lHardware) + ExportScript.Tools.SendDataDAC("3002", "-", lHardware) + ExportScript.Tools.SendDataDAC("3010", 0, lHardware) + ExportScript.Tools.SendDataDAC("3011", 0, lHardware) + ExportScript.Tools.SendDataDAC("3012", 0, lHardware) + return + end + + ExportScript.Tools.SendDataDAC("3010", ExportScript.AF.genericRadioPower[ExportScript.AF.genericRadio], lHardware) + ExportScript.Tools.SendDataDAC("3011", ExportScript.AF.genericRadioPresetManual[ExportScript.AF.genericRadio], lHardware) + ExportScript.Tools.SendDataDAC("3012", ExportScript.AF.genericRadioSquelch[ExportScript.AF.genericRadio], lHardware) + + if lClickAction ~= nil then + lDevice = GetDevice(lClickAction.DeviceID) + if type(lDevice) == "table" then + --ExportScript.Tools.WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ") + lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value) + end + elseif lSetFrequency ~= nil then + lDevice = GetDevice(lSetFrequency.DeviceID) + if type(lDevice) == "table" and lDevice:is_on() then + --ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ") + lDevice:set_frequency(lSetFrequency.Frequency) + else + ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on") + end + end +end diff --git a/ExportsModules/Mi-8MT.lua b/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua similarity index 59% rename from ExportsModules/Mi-8MT.lua rename to Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua index 71aa574..df2c83c 100644 --- a/ExportsModules/Mi-8MT.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Mi-8MT.lua @@ -1,1407 +1,1172 @@ --- Mi-8MTV2 Export --- Version 0.9.9 BETA - -gES_FoundDCSModule = true - -gES_GlassCockpitConfigEveryFrameArguments = -{ - --[[ - every frames arguments - based of "mainpanel_init.lua" - Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) - [DeviceID] = "Format" - [4] = "%.4f", <- floating-point number with 4 digits after point - [19] = "%0.1f", <- floating-point number with 1 digit after point - [129] = "%1d", <- decimal number - ]] - - -- CONTROLLERS - --------------------------------------------------------------- - ----[209] = "%.4f", -- rudder { -1, 1} - --[266] = "%.4f", -- rudder_add { 1, -1} - --[181] = "%.4f", -- stick_roll {1, -1} - --[180] = "%.4f", -- stick_pitch {1, -1} - --[191] = "%.4f", -- collective_position {0, 1} - --[192] = "%1d", -- correction_position {1, 0} - --[230] = "%1d", -- collective_position_operator {0, 1} - --[231] = "%1d", -- correction_position_operator {1, 0} - --[560] = "%1d", -- coll_ROUTE_DESCENT_sw {0, 1} - --[558] = "%1d", -- coll_ReadjustFreeTurbRPM_sw {0, 1} - ----[208] = "%1d", -- collective_stopper {0, 1} - --[187] = "%.4f", -- left_engine_throttle {0.0, 1.0} - --[189] = "%.4f", -- right_engine_throttle {0.0, 1.0} - --[881] = "%.4f", -- wheelBrakes {0.0, 1.0} - ----[579] = "", -- throttle_cover {0.0, 1.0} - ----[208] = "", -- rotor_brake_handle {0.0, 1.0} - -- Left main panel - --------------------------------------------------------------- - [16] = "%.2f", -- Variometer_L {-30, -20, -10, -5, -2, -1, 0, 1, 2, 5, 10, 20, 30} {-1.0, -0.71, -0.43, -0.23, -0.09, -0.05, 0, 0.05, 0.09, 0.23, 0.43, 0.71, 1.0} - [95] = "%.2f", -- Variometer_R {-30, -20, -10, -5, -2, -1, 0, 1, 2, 5, 10, 20, 30} {-1.0, -0.71, -0.43, -0.23, -0.09, -0.05, 0, 0.05, 0.09, 0.23, 0.43, 0.71, 1.0} - [24] = "%.3f", -- IAS_L {-10.0, 0.0, 13.889, 27.78, 41.67, 55.56, 69.44, 83.33, 111.1, 125.0, 129.2} {0.0, 0.001, 0.028, 0.165, 0.277, 0.393, 1.0} - [790] = "%.3f", -- IAS_R {-10.0, 0.0, 13.889, 27.78, 41.67, 55.56, 69.44, 83.33, 111.1, 125.0, 129.2} {0.0, 0.001, 0.028, 0.165, 0.277, 0.393, 1.0} - -- AGB-3k - --------------------------------------------------------------- - [13] = "%.4f", -- AGB_3K_Left_roll {-1.0, 1.0} - [12] = "%.4f", -- AGB_3K_Left_pitch {1.0, -1.0} - [14] = "%.4f", -- AGB_3K_Left_failure_flag {0.0, 1.0} - [15] = "%.4f", -- AGB_3K_Left_sideslip {1.0, -1.0} - [820] = "%.4f", -- AGB_3K_Left_index {0.5, -0.5} - ------ - [92] = "%.4f", -- AGB_3K_Right_roll {-1.0, 1.0} - [91] = "%.4f", -- AGB_3K_Right_pitch {1.0, -1.0} - [93] = "%.4f", -- AGB_3K_Right_failure_flag {0.0, 1.0} - [94] = "%.4f", -- AGB_3K_Right_sideslip {1.0, -1.0} - [821] = "%.4f", -- AGB_3K_Right_index {0.5, -0.5} - -- EUP-53 - --------------------------------------------------------------- - [22] = "%.4f", -- EUP_speed {-1.0, 1.0} - [23] = "%.4f", -- EUP_sideslip {-1.0, 1.0} - -- UGR-4K - --------------------------------------------------------------- - [25] = "%.4f", -- UGR_4K_heading_L {0.0, 1.0} - [27] = "%.4f", -- UGR_4K_commanded_course_L {0.0, 1.0} - [28] = "%.4f", -- UGR_4K_bearing_needle_L {0.0, 1.0} - ---- - [101] = "%.4f", -- UGR_4K_heading_R {0.0, 1.0} - [103] = "%.4f", -- UGR_4K_commanded_course_R {0.0, 1.0} - [104] = "%.4f", -- UGR_4K_bearing_needle_R {0.0, 1.0} - -- Barometric altimeter VD-10K - --------------------------------------------------------------- - [19] = "%.4f", -- VD_10K_L_100 {0.0, 1.0} - [20] = "%.4f", -- VD_10K_L_10 {0.0, 1.0} - [833] = "%.4f", -- VD_10K_L_100_Ind {0.0, 1.0} - [832] = "%.4f", -- VD_10K_L_10_Ind {0.0, 1.0} - [916] = "%.4f", -- VD_10K_L_Shutter {0.822, 0.75} - [21] = "%.4f", -- VD_10K_L_PRESS {0.0, 1.0} - ----- - [98] = "%.4f", -- VD_10K_R_100 {0.0, 1.0} - [99] = "%.4f", -- VD_10K_R_10 {0.0, 1.0} - [835] = "%.4f", -- VD_10K_R_100_Ind {0.0, 1.0} - [917] = "%.4f", -- VD_10K_R_Shutter {0.822, 0.75} - [834] = "%.4f", -- VD_10K_R_10_Ind {0.0, 1.0} - [100] = "%.4f", -- VD_10K_R_PRESS {0.0, 1.0} - -- Rotor RPM - --------------------------------------------------------------- - [42] = "%.4f", -- RotorRPM {0.0, 1.0} - [787] = "%.4f", -- RotorRPM_Oper {0.0, 1.0} - -- Rotor Pitch - --------------------------------------------------------------- - [36] = "%.2f", -- RotorPitch {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0} {0.0, 0.07, 0.14, 0.21, 0.29, 0.35, 0.43, 0.5, 0.57, 0.64, 0.71, 0.79, 0.86, 0.93, 1.0} - -- Radar altimeter A-036 - --------------------------------------------------------------- - [34] = "%.3f", -- A_036_RALT {0, 100, 300, 800} {0.0, 0.475, 0.625, 1.0} - [31] = "%.3f", -- A_036_DangerRALT_index {0, 100, 300, 800} {0.0, 0.475, 0.625, 1.0} - [30] = "%.1f", -- A_036_DangerRALT_lamp {0.0, 1.0} - [33] = "%.1f", -- A_036_warning_flag {0.0, 1.0} - -- Engines RPM - --------------------------------------------------------------- - [40] = "%.4f", -- LeftEngineRPM {0.0, 110.0} {0.0, 1.0} - [41] = "%.4f", -- RightEngineRPM {0.0, 110.0} {0.0, 1.0} - [788] = "%.4f", -- LeftEngineRPM_Oper {0.0, 110.0} {0.0, 1.0} - [789] = "%.4f", -- RightEngineRPM_Oper {0.0, 110.0} {0.0, 1.0} - -- Engines temperature - --------------------------------------------------------------- - [43] = "%.4f", -- LeftEngineTemperatureHund {0.0, 1200.0} {0.0, 1.0} - [44] = "%.4f", -- LeftEngineTemperatureTenth {0.0, 100.0} {0.0, 1.0} - [45] = "%.4f", -- RightEngineTemperatureHund {0.0, 1200.0} {0.0, 1.0} - [46] = "%.4f", -- RightEngineTemperatureTenth {0.0, 100.0} {0.0, 1.0} - -- Engines mode indicator - --------------------------------------------------------------- - [39] = "%.4f", -- EnginesMode {0.0, 1.0} - [37] = "%.4f", -- LeftEngineMode {0.0, 1.0} - [38] = "%.4f", -- RightEngineMode {0.0, 1.0} - -- Engines brakes - --------------------------------------------------------------- - [204] = "%.1f", -- left_engine_brake_handle {0.0, 1.0} - [206] = "%.1f", -- right_engine_brake_handle {0.0, 1.0} - [203] = "%.1f", -- left_engine_brake_handle_holder {0.0, 1.0} - [205] = "%.1f", -- right_engine_brake_handle_holder {0.0, 1.0} - -- DISS 15 - --------------------------------------------------------------- - [830] = "%.4f", -- diss15_hover_x {-1.0, 0, 1.0} - [828] = "%.4f", -- diss15_hover_y {-1.0, 1.0} - [829] = "%.4f", -- diss15_hover_z {-1.0, 1.0} - [831] = "%.4f", -- diss15_hover_lamp_off {0.0, 0.9} - ---- - [791] = "%.4f", -- diss15_drift_angle {-1.0, 1.0} - ---- - [795] = "%.4f", -- diss15_W_shutter {0.0, 1.0} - [796] = "%.1f", -- diss15_W_memory_lamp {1.0, 0.0} - [792] = "%.4f", -- diss15_W_hundreds {0.0, 1.0} - [793] = "%.4f", -- diss15_W_tens {0.0, 1.0} - [794] = "%.4f", -- diss15_W_ones {0.0, 1.0} - ---- - [817] = "%.4f", -- diss15_coord_on_lamp {1.0, 0.0} - [805] = "%.4f", -- diss15_coord_forward {1.0, 0.0} - [806] = "%.4f", -- diss15_coord_X_hundreds {0.0, 1.0} - [807] = "%.4f", -- diss15_coord_X_tens {0.0, 1.0} - [808] = "%.4f", -- diss15_coord_X_ones {0.0, 1.0} - [802] = "%.4f", -- diss15_coord_right {0.0, 1.0} - [799] = "%.4f", -- diss15_coord_Z_hundreds {0.0, 1.0} - [800] = "%.4f", -- diss15_coord_Z_tens {0.0, 1.0} - [801] = "%.4f", -- diss15_coord_Z_ones {0.0, 1.0} - [811] = "%.4f", -- diss15_coord_angle_hundreds {0.0, 1.0} - [812] = "%.4f", -- diss15_coord_angle_tens {0.0, 1.0} - [813] = "%.4f", -- diss15_coord_angle_ones {0.0, 1.0} - [814] = "%.4f", -- diss15_coord_angle_minutes {0.0, 1.0} - ---- - [822] = "%.4f", -- diss15_check_control_lamp {0.0, 0.9} - [823] = "%.4f", -- diss15_check_work_lamp {0.0, 0.9} - [824] = "%.4f", -- diss15_check_failM_lamp {0.0, 0.9} - [825] = "%.4f", -- diss15_check_failC_lamp {0.0, 0.9} - -- Oil - --------------------------------------------------------------- - [111] = "%.4f", -- oils_p_main_reductor {0.0, 1.0} - [114] = "%.2f", -- oils_t_main_reductor {0.0, 1.0} {-0.25, 0.75} - [113] = "%.2f", -- oils_temp_tail_reductor {0.0, 1.0} {-0.25, 0.75} - [112] = "%.2f", -- oils_temp_intermediate_reductor {0.0, 1.0} {-0.25, 0.75} - [115] = "%.4f", -- oils_p_left_engine {0.0, 1.0} - [116] = "%.2f", -- oils_t_left_engine {-0.25, 0.75} - [117] = "%.4f", -- oils_p_right_engine {0.0, 1.0} - [118] = "%.2f", -- oils_t_right_engine {-0.25, 0.75} - -- Autopilot - --------------------------------------------------------------- - [122] = "%.4f", -- autopilot_yaw_indicator {-1.0, 1.0} - [124] = "%.4f", -- autopilot_pitch_indicator {-1.0, 1.0} - [123] = "%.2f", -- autopilot_roll_indicator {-0.33, 0.33} - [125] = "%.4f", -- autopilot_altitude_indicator {-1.0, 1.0} - [119] = "%.4f", -- autopilot_yaw_scale {0.0, 1.0} - [120] = "%.4f", -- autopilot_roll_scale {0.0, 1.0} - [121] = "%.4f", -- autopilot_pitch_scale {0.0, 1.0} - -- Center upper panel - --------------------------------------------------------------- - [404] = "%.2f", -- hydro_pressure_main {0.05, 0.33, 0.52, 0.69, 1.0} - [405] = "%.2f", -- hydro_pressure_aux {0.05, 0.33, 0.52, 0.69, 1.0} - [402] = "%.2f", -- APU_temperature {0.0, 0.2, 0.42, 0.69, 0.94, 1.0} - [403] = "%.2f", -- APU_pressure {0.04, 0.95} - -- Mechanic clock - --------------------------------------------------------------- - [49] = "%.4f", -- CLOCK_currtime_hours {0.0, 1.0} - [50] = "%.4f", -- CLOCK_currtime_minutes {0.0, 1.0} - [51] = "%.4f", -- CLOCK_currtime_seconds {0.0, 1.0} - [56] = "%.4f", -- CLOCK_flight_time_meter_status {0.0, 1.0} - [52] = "%.4f", -- CLOCK_flight_hours {0.0, 1.0} - [53] = "%.4f", -- CLOCK_flight_minutes {0.0, 1.0} - [54] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0, 1.0} - [55] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0, 1.0} - -- Fuel tanks - --------------------------------------------------------------- - [62] = "%.3f", -- FuelScaleUpper {0.0, 200.0, 400.0, 800.0, 1600.0, 2000.0, 2400.0, 2800.0} {0.0, 0.131, 0.244, 0.414, 0.647, 0.705, 0.9, 1.0} - [62] = "%.3f", -- FuelScaleLower {0.0, 200.0, 300.0, 400.0, 600.0, 1200.0, 2240.0} {0.0, 0.165, 0.283, 0.393, 0.618, 1.0} - -- Air system gauges - --------------------------------------------------------------- - [320] = "%.2f", -- air_system_pressure {0.0, 25.0, 50.0, 100.0} {0.0, 0.23, 0.48, 1.0} - [321] = "%.4f", -- air_system_brake_pressure {0.0, 1.0} - -- SPUU-52 - --------------------------------------------------------------- - [126] = "%.4f", -- SPUU_pointer {-1.0, 1.0} - [786] = "%.1f", -- SPUU52_lamp {0.0, 1.0} - -- PU-26 LAMP - --------------------------------------------------------------- - [827] = "%.1f", -- PU_26_GA_Lamp {0.0, 1.0} {0.0, 0.5} - -- ARC-UD - --------------------------------------------------------------- - [458] = "%.1f", -- ARC_UD_Narrow_Lamp {0.0, 0.9} - [459] = "%.1f", -- ARC_UD_Wide_Lamp {0.0, 0.9} - [460] = "%.1f", -- ARC_UD_Pulse_Lamp {0.0, 0.9} - -- ARC-9 - --------------------------------------------------------------- - [681] = "%.4f", -- ARC_9_Signal {0.0, 1.0} - ---- - [857] = "%.4f", -- PKV_Reflector {0.0, 1.0} - ---- - [778] = "%.4f", -- SAFE_WEAP {0.0, 1.0} - ---- - [577] = "%.4f", -- AMMO_CNT1_1 {0.0, 1.0} - [578] = "%.4f", -- AMMO_CNT1_2 {0.0, 1.0} - [580] = "%.4f", -- AMMO_CNT2_1 {0.0, 1.0} - [581] = "%.4f", -- AMMO_CNT2_2 {0.0, 1.0} - [583] = "%.4f", -- AMMO_CNT3_1 {0.0, 1.0} - [584] = "%.4f", -- AMMO_CNT3_2 {0.0, 1.0} - -- Radio R-828 - --------------------------------------------------------------- - [740] = "%.2f", -- R828_ASU {0.0, 1.0} {0.0, 0.95} - [736] = "%.3f", -- R828_channel {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} {0.0, 0.101, 0.199, 0.302, 0.400, 0.502, 0.601, 0.697, 0.801, 0.898} - -- Damage - --------------------------------------------------------------- - --[215] = "%0.1f", -- Blister_LEFT {0.0, 1.0} {0.0, 0.8} - --[216] = "%0.1f", -- Blister_RIGHT {0.0, 1.0} {0.0, 0.8} - ---- - --[878] = "%.1f", -- WindShiels_Up {0.0, 1.0} - --[879] = "%.1f", -- WindShiels_Down {0.0, 1.0} - -- UV-26 - --------------------------------------------------------------- - --[892] = "%.1f", -- UV26_Left {0.0, 1.0} - --[891] = "%.1f", -- UV26_Right {0.0, 1.0} - -- Pilots - --------------------------------------------------------------- - --[245] = "%.1f", -- Pilot_Body {0.0, 1.0} - --[242] = "%.1f", -- Operator_Body {0.0, 1.0} - --[262] = "%.1f", -- Crew_Body {0.0, 1.0} - -- Damage - --------------------------------------------------------------- - --[876] = "%.1f", -- Upper_Windshield {0.0, 1.0} - --[877] = "%.1f", -- Down_Windshield {0.0, 1.0} - --[879] = "%.1f", -- Left_Windshield {0.0, 1.0} - --[878] = "%.1f", -- Right_Windshield {0.0, 1.0} - -- Jadro 1A - --------------------------------------------------------------- - [849] = "%.1f", -- Jadro_ASU_Lamp {0.0, 1.0} - [848] = "%.1f", -- Jadro_Ctl_Lamp {0.0, 1.0} - [850] = "%.1f", -- Jadro_Breakdown_Lamp {0.0, 1.0} - ---- - [904] = "%.4f", -- RAM_Temp {-50.0, 0.0, 70.0} {-1.0, 0.0, 1.0} - ---- - [907] = "%.4f", -- G_Meter {-1.0, 1.0, 3.0} {-1.0, 0.343, 1.0} - [908] = "%.4f", -- G_Meter_Max {1.0, 3.0} {0.343, 1.0} - [909] = "%.4f", -- G_Meter_Min {-1.0, 1.0} {-1.0, 0.343} - ---- - [903] = "%1d", -- filter_handle {0,1} - ---- - [63] = "%.4f", -- SalonTemperature {-70.0, -60.0, -30.0, -20.0, -10.0, 0.0, 10.0, 20.0, 30.0, 60.0, 70.0} {-0.7, -0.593, -0.296, -0.227, -0.125, 0.003, 0.132, 0.233, 0.302, 0.603, 0.693} - -- electric system gauges - --------------------------------------------------------------- - [526] = "%.4f", -- DC_voltage {0.0, 30.0} {0.0, 1.0} - [532] = "%.2f", -- AC_voltage {0.0, 100.0, 150.0, 200.0, 250.0} {0.0, 0.14, 0.31, 0.56, 1.0} - [493] = "%.4f", -- DC_APU_current {0.0, 400.0} {0.0, 1.0} - [527] = "%.4f", -- DC_battery_I_current {0.0, 400.0} {0.0, 1.0} - [528] = "%.4f", -- DC_battery_II_current {0.0, 400.0} {0.0, 1.0} - [529] = "%.4f", -- DC_VU_I_current {0.0, 400.0} {0.0, 1.0} - [530] = "%.4f", -- DC_VU_II_current {0.0, 400.0} {0.0, 1.0} - [531] = "%.4f", -- DC_VU_III_current {0.0, 400.0} {0.0, 1.0} - [533] = "%.2f", -- AC_generator_I_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} - [534] = "%.2f", -- AC_generator_II_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} - [371] = "%.2f", -- AntiIce_ampermeter {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} - -- LAMPS - --------------------------------------------------------------- - [781] = "%.1f", -- lamp_AP_heading_on - [782] = "%.1f", -- lamp_AP_heading_off - [783] = "%.1f", -- lamp_AP_pitch_roll_on - [784] = "%.1f", -- lamp_AP_height_on - [785] = "%.1f", -- lamp_AP_height_off - [316] = "%.1f", -- lamp_ENGINE_RT_LEFT_ON - [317] = "%.1f", -- lamp_ENGINE_RT_RIGHT_ON - [318] = "%.1f", -- lamp_SARPP_ON - [325] = "%.1f", -- lamp_Descent_Siren - [326] = "%.1f", -- lamp_LOCK_OPEN - [327] = "%.1f", -- lamp_DOORS_OPEN - [340] = "%.1f", -- lamp_TURN_ON_RI_65 - [360] = "%.1f", -- lamp_FROST - [362] = "%.1f", -- lamp_LEFT_ENG_HEATING - [363] = "%.1f", -- lamp_RIGHT_ENG_HEATING - [361] = "%.1f", -- lamp_ANTI_ICE_ON - [364] = "%.1f", -- lamp_LEFT_PZU_FRONT - [365] = "%.1f", -- lamp_RIGHT_PZU_FRONT - [366] = "%.1f", -- lamp_LEFT_PZU_BACK - [367] = "%.1f", -- lamp_RIGHT_PZU_BACK - [373] = "%.1f", -- lamp_SECTION_1 - [375] = "%.1f", -- lamp_SECTION_2 - [374] = "%.1f", -- lamp_SECTION_3 - [376] = "%.1f", -- lamp_SECTION_4 - [368] = "%.1f", -- lamp_RIO_heating_ok - [377] = "%.1f", -- lamp_LEFT_ENG_FIRE - [378] = "%.1f", -- lamp_RIGHT_ENG_FIRE - [379] = "%.1f", -- lamp_KO50_FIRE - [380] = "%.1f", -- lamp_REDUC_AI9_FIRE - [381] = "%.1f", -- lamp_FIRE_LENG_1_QUEUE - [382] = "%.1f", -- lamp_FIRE_RENG_1_QUEUE - [383] = "%.1f", -- lamp_FIRE_KO50_1_QUEUE - [384] = "%.1f", -- lamp_FIRE_REDUCT_1_QUEUE - [385] = "%.1f", -- lamp_FIRE_LENG_2_QUEUE - [386] = "%.1f", -- lamp_FIRE_RENG_2_QUEUE - [387] = "%.1f", -- lamp_FIRE_KO50_2_QUEUE - [388] = "%.1f", -- lamp_FIRE_REDUCT_2_QUEUE - [398] = "%.1f", -- lamp_CHECK_SENSORS - [407] = "%.1f", -- lamp_HYDRO_main_on - [408] = "%.1f", -- lamp_HYDRO_aux_on - [414] = "%.1f", -- lamp_APD9_on - [416] = "%.1f", -- lamp_APD9_oil_pressure - [417] = "%.1f", -- lamp_APD9_rpm - [418] = "%.1f", -- lamp_APD9_rpm_high - [420] = "%.1f", -- lamp_APD_on - [424] = "%.1f", -- lamp_APD_starter_on - [434] = "%.1f", -- lamp_FUEL_left_closed - [435] = "%.1f", -- lamp_FUEL_right_closed - [436] = "%.1f", -- lamp_FUEL_ring_closed - [441] = "%.1f", -- lamp_FUEL_center_on - [442] = "%.1f", -- lamp_FUEL_left_on - [443] = "%.1f", -- lamp_FUEL_right_on - [461] = "%.1f", -- lamp_HEATER - [462] = "%.1f", -- lamp_IGNITION - [463] = "%.1f", -- lamp_KO50_ON - [341] = "%.1f", -- lamp_LEFT_PITOT_HEATER_OK - [490] = "%.1f", -- lamp_RIGHT_PITOT_HEATER_OK - [509] = "%.1f", -- lamp_LEFT_PZU_ON - [510] = "%.1f", -- lamp_RIGHT_PZU_ON - [504] = "%.1f", -- lamp_ELEC_turn_VU1 - [505] = "%.1f", -- lamp_ELEC_turn_VU2 - [506] = "%.1f", -- lamp_ELEC_turn_VU3 - [507] = "%.1f", -- lamp_ELEC_DC_ground - [508] = "%.1f", -- lamp_ELEC_test_equipment - [543] = "%.1f", -- lamp_ELEC_gen1_fail - [544] = "%.1f", -- lamp_ELEC_gen2_fail - [545] = "%.1f", -- lamp_ELEC_AC_ground - [546] = "%.1f", -- lamp_ELEC_PO_500 - [86] = "%.1f", -- lamp_CIRCUIT_FROM_BATTERY - [68] = "%.1f", -- lamp_CLOG_TF_LEFT - [69] = "%.1f", -- lamp_CLOG_TF_RIGHT - [70] = "%.1f", -- lamp_CHIP_LEFT_ENG - [71] = "%.1f", -- lamp_CHIP_RIGHT_ENG - [72] = "%.1f", -- lamp_VIBRATION_LEFT_HIGH - [73] = "%.1f", -- lamp_VIBRATION_RIGHT_HIGH - [74] = "%.1f", -- lamp_FIRE - [76] = "%.1f", -- lamp_LEFT_ENG_TURN_OFF - [77] = "%.1f", -- lamp_RIGHT_ENG_TURN_OFF - [78] = "%.1f", -- lamp_FT_LEFT_HIGH - [79] = "%.1f", -- lamp_FT_RIGHT_HIGH - [80] = "%.1f", -- lamp_OIL_PRESSURE_LEFT - [81] = "%.1f", -- lamp_OIL_PRESSURE_RIGHT - [82] = "%.1f", -- lamp_ER_LEFT - [83] = "%.1f", -- lamp_ER_RIGHT - [84] = "%.1f", -- lamp_EEC_LEFT_OFF - [85] = "%.1f", -- lamp_EEC_RIGHT_OFF - [873] = "%.1f", -- lamp_CHIP_MAIN_REDUCTOR - [874] = "%.1f", -- lamp_CHIP_INTER_REDUCTOR - [875] = "%.1f", -- lamp_CHIP_TAIL_REDUCTOR - [64] = "%.1f", -- lamp_300_Left - [65] = "%.1f", -- lamp_DISS_OFF - [555] = "%.1f", -- lamp_BD1 - [556] = "%.1f", -- lamp_BD2 - [557] = "%.1f", -- lamp_BD3 - [558] = "%.1f", -- lamp_BD4 - [559] = "%.1f", -- lamp_BD5 - [560] = "%.1f", -- lamp_BD6 - [711] = "%.1f", -- lamp_BD1Bomb - [712] = "%.1f", -- lamp_BD2Bomb - [713] = "%.1f", -- lamp_BD3Bomb - [714] = "%.1f", -- lamp_BD4Bomb - [715] = "%.1f", -- lamp_BD5Bomb - [716] = "%.1f", -- lamp_BD6Bomb - [562] = "%.1f", -- lamp_PUS1 - [563] = "%.1f", -- lamp_PUS3 - [564] = "%.1f", -- lamp_PUS4 - [565] = "%.1f", -- lamp_PUS6 - [561] = "%.1f", -- lamp_EmergExplode - [705] = "%.1f", -- lamp_EmergExplodeSec - [710] = "%.1f", -- lamp_BV_Net_On - [566] = "%.1f", -- lamp_RS_Net_On - [567] = "%.1f", -- lamp_GUV_Net_On - --[] = "%.1f", -- lamp_MV_Net_On - [568] = "%.1f", -- lamp_FKP_On - [778] = "%.1f", -- lamp_Caution_Weap - --[] = "%.1f", -- lamp_LeftSignal - --[] = "%.1f", -- lamp_RightSignal - [586] = "%.1f", -- lamp_Caution_Weap1 - [587] = "%.1f", -- lamp_Caution_Weap2 - [588] = "%.1f", -- lamp_Caution_Weap3 - [306] = "%.1f", -- lamp_Record_P503B - [302] = "%.1f", -- lamp_IFF_KD - [303] = "%.1f", -- lamp_IFF_KP - [912] = "%.1f", -- lamp_IFF_TurnOnReserve - [87] = "%.1f", -- lamp_IFF_Failure - -- Lights system - --------------------------------------------------------------- - [880] = "%.1f", -- RedLightLhGr1 {1.0, 0.0} - [896] = "%.1f", -- RedLightLhGr2 {1.0, 0.0} - [897] = "%.1f", -- RedLightRhGr1 {1.0, 0.0} - [898] = "%.1f", -- RedLightRhGr2 {1.0, 0.0} - [899] = "%.1f", -- RedLightChGr1 {1.0, 0.0} - [901] = "%.1f", -- RedLightChGr2 {1.0, 0.0} - [922] = "%.1f", -- RedLightChGr12 {1.0, 0.0} - [902] = "%.1f", -- RedLight5V5 {1.0, 0.0} - [900] = "%.1f", -- PlafondBrightness {1.0, 0.0} - [547] = "%.1f", -- LeftPlafond {1.0, 0.0} - [665] = "%.1f", -- RightPlafond {1.0, 0.0} - [920] = "%.1f" -- RecorderP503B_PanelLightness {1.0, 0.0} -} -gES_GlassCockpitConfigArguments = -{ - --[[ - arguments for export in low tick interval - based on "clickabledata.lua" - ]] - -- ELEC_INTERFACE - --[536] = "%.1f", -- PTR-EEP-LVR-ADJV1 (AC Voltage 1 set rotary) {-1, 1} - --[537] = "%.1f", -- PTR-EEP-LVR-ADJV2 (AC Voltage 2 set rotary) {-1, 1} - [538] = "%1d", --PTR-EEP-TMB-GEN1 (Generator 1) - [539] = "%1d", --PTR-EEP-TMB-GEN2 (Generator 2) - [540] = "%1d", --PTR-EEP-TMB-AER (AC ground power) - [541] = "%1d", --PTR-EEP-TMB-PO (115V Inverter) - [542] = "%1d", --PTR-EEP-TMB-PT (36V Inverter) - [535] = "%.1f", --PTR-EEP-LVR-MODE (AC Mode), 11 degrees - [494] = "%.1f", --PTR-RSPE-LVR-FEEDMODE (DC Bus Selector), 8 degrees - - [495] = "%1d", --PTR-RSPE-TMB-AKK1 (Battery 1) - [496] = "%1d", --PTR-RSPE-TMB-AKK2 (Battery 2) - [497] = "%1d", --PTR-RSPE-TMB-RESGEN (Standby Generator) - --[498] = "%.1f", -- PTR-RSPE-LVR-V (DC Voltage set rotary) {-1, 1} - [499] = "%1d", --PTR-RSPE-TMB-RECT1 (Rectifier 1) - [500] = "%1d", --PTR-RSPE-TMB-RECT2 (Rectifier 2) - [501] = "%1d", --PTR-RSPE-TMB-RECT3 (Rectifier 3) - [502] = "%1d", --PTR-RSPE-TMB-AERF (DC ground power) - [503] = "%1d", --PTR-RSPE-TMB-TESTEQU (Equipment Test) - - [147] = "%1d", --PTR-APP-CVR-CIRC (Standby Rectifier Cover) - [148] = "%1d", --PTR-APP-TMB-CIRC (Standby Rectifier) - [149] = "%1d", --PTR-APP-TMB-TRNS (36V Transformer) - - [498] = "%.4f", --PTR-RSPE-LVR-V (Standby Generator Voltage Adjustment Rheostat) - [536] = "%.4f", --PTR-EEP-LVR-ADJV1 (Generator 1 Voltage Adjustment Rheostat) - [537] = "%.4f", --PTR-EEP-LVR-ADJV2 (Generator 2 Voltage Adjustment Rheostat) - [522] = "%.4f", --PTR-RSPE-TMB-WRMAKK (Battery Heating Switch, ON/OFF) - - [590] = "%1d", --PTR-LAZS-TMB-BV-ZSBR (BW ESBR) - [591] = "%1d", --PTR-LAZS-TMB-BV-EXP (Explode) - [592] = "%1d", --PTR-LAZS-TMB-BV-DIR (Control) - [593] = "%1d", --PTR-LAZS-TMB-BV-EQU (Equipment) - [594] = "%1d", --PTR-LAZS-TMB-RSGUV-FIRE (RS/GUV Fire) - [595] = "%1d", --PTR-LAZS-TMB-RSGUV-SIGN (RS/GUV Warning) - [596] = "%1d", --PTR-LAZS-TMB-RSGUV-WARM (ESBR Heating) - - [597] = "%1d", --PTR-LAZS-TMB-311 (GUV Out 800 Left) - [598] = "%1d", --PTR-LAZS-TMB-GUOUT-800L (GUV Out 800 Left) - [599] = "%1d", --PTR-LAZS-TMB-GUOUT-800R (GUV Out 800 Right) - [600] = "%1d", --PTR-LAZS-TMB-GUOUTL-622L (GUV In Left 622 Left) - [601] = "%1d", --PTR-LAZS-TMB-GUOUTL-622R (GUV In Left 622 Right) - [602] = "%1d", --PTR-LAZS-TMB-GUOUTR-622L (GUV In Right 622 Left) - [603] = "%1d", --PTR-LAZS-TMB-GUOUTR-622R (GUV In Rignt 622 Right) - - [604] = "%1d", --PTR-LAZS-TMB-ES-800L (Electric Launch 800 Left) - [605] = "%1d", --PTR-LAZS-TMB-ES-622R (Electric Launch 800 Right) - [606] = "%1d", --PTR-LAZS-TMB-PKT (PKT) - [607] = "%1d", --PTR-LAZS-TMB-JETBOMB (Emergency Jettison) - [608] = "%1d", --PTR-LAZS-TMB-JETPWR (Power Jettison) - [609] = "%1d", --PTR-LAZS-TMB-JETEXPL (Emergency Jettison) - [610] = "%1d", --PTR-LAZS-TMB-JETRCKT (Alarm rockets) - - [611] = "%1d", --PTR-RAZS-TMB-START-TRBON (CB APU start) - [612] = "%1d", --PTR-RAZS-TMB-START-TRBIGN (CB APU ignition) - [613] = "%1d", --PTR-RAZS-TMB-START-ENGON (CB Engine start) - [614] = "%1d", --PTR-RAZS-TMB-START-ENGIGN (CB Engine ignition) - [615] = "%1d", --PTR-RAZS-TMB-RPM (CB RPM CONTROL) - [616] = "%1d", --PTR-NONAME (CB NONAME) - [617] = "%1d", --PTR-SW-LOCKER-BASE (CB Lock Opening Control Main) - [618] = "%1d", --PTR-SW-LOCKER-RES (CB Lock Opening Control Reserve) - [619] = "%1d", --PTR-RAZS-TMB-TURN (CB TURN INDICATOR) - - [629] = "%1d", --PTR-RAZS-TMB-TSCOCK-ON (CB Bypass) - [630] = "%1d", --PTR-RAZS-TMB-TSCOCK-L (CB Left valve) - [631] = "%1d", --PTR-RAZS-TMB-TSCOCK-R (CB Right valve) - [632] = "%1d", --PTR-RAZS-TMB-TSCOUNT (CB Fuelmeter) - [633] = "%1d", --PTR-RAZS-TMB-TSPMP-C (CB Center tank) - [634] = "%1d", --PTR-RAZS-TMB-TSPMP-L (CB Left pump) - [635] = "%1d", --PTR-RAZS-TMB-TSPMP-R (CB Right pump) - [636] = "%1d", --PTR-RAZS-TMB-T819 (CB T-819) - [637] = "%1d", --PTR-RAZS-TMB-SPPU52 (CB SPUU-52) - - [647] = "%1d", --PTR-RAZS-TMB-HLGT-DIR-L (SPOT CONTROL LEFT) - [648] = "%1d", --PTR-RAZS-TMB-HLGT-ON-L (SPOT ON LEFT) - [649] = "%1d", --PTR-RAZS-TMB-HLGT-DIR-R (SPOT CONTROL RIGHT) - [650] = "%1d", --PTR-RAZS-TMB-HLGT-ON-R (SPOT ON RIGHT) - [651] = "%1d", --PTR-RAZS-TMB-ANO (ANO) - [652] = "%1d", --PTR-RAZS-TMB-WNGLGT (WING LIGHTS) - [653] = "%1d", --PTR-RAZS-TMB-LAMPTEST (CHECK LAMPS/FLASHER) - --[654] = "%1d", -- PTR-RAZS-TMB-DIRMAIN (LOCK MAIN) - --[655] = "%1d", -- PTR-RAZS-TMB-DIRDUB (LOCK SPARE) - [918] = "%1d", --PTR-SW-LIGHT-PRF4-LEFT (CB PRF-4 Light Left) - [919] = "%1d", --PTR-SW-LIGHT-PRF4-RIGHT (CB PRF-4 Light Right) - - [620] = "%1d", --PTR-RAZS-TMB-APMAIN (CB Autopilot MAIN) - [621] = "%1d", --PTR-RAZS-TMB-APFRICT (CB Autopilot Frict) - [622] = "%1d", --PTR-RAZS-TMB-APELCT (CB Autopilot Clutch) - [623] = "%1d", --PTR-RAZS-TMB-GSMAIN (CB Hydro Main) - [624] = "%1d", --PTR-RAZS-TMB-GSDBL (CB Hydro Aux) - [625] = "%1d", --PTR-RAZS-TMB-RADSPU (CB SPU (Intercom)) - [626] = "%1d", --PTR-RAZS-TMB-RADALT (CB Radio Altimeter) - [627] = "%1d", --PTR-RAZS-TMB-RADCOMM (CB Command Radio Station (R-863)) - [628] = "%1d", --PTR-RAZS-TMB-RADRS (CB 6201) - - [638] = "%1d", --PTR-RAZS-TMB-PPSSIGN (CB Signalization) - [639] = "%1d", --PTR-RAZS-TMB-PPSQUE1-L (CB 1 Queue Left) - [640] = "%1d", --PTR-RAZS-TMB-PPSQUE1-R (CB 1 Queue Right) - [641] = "%1d", --PTR-RAZS-TMB-PPSQUE2-L (CB 2 Queue Left) - [642] = "%1d", --PTR-RAZS-TMB-PPSQUE2-R (CB 2 Queue Right) - [643] = "%1d", --PTR-RAZS-TMB-RADCMP-SV (CB Radio Compass MW(ARC-9)) - [644] = "%1d", --PTR-RAZS-TMB-RADCMP-UKV (CB Radio Compass VHF(ARC-UD)) - [645] = "%1d", --PTR-RAZS-TMB-RADDISS (CB Doppler Navigator) - [646] = "%1d", --PTR-RAZS-TMB-RADRNTG (CB Radio Meter) - - [656] = "%1d", --PTR-RAZS-TMB-POSDIR (CONTROL) - [657] = "%1d", --PTR-RAZS-TMB-POSPZUENG-L (LEFT ENGINE) - [658] = "%1d", --PTR-RAZS-TMB-POSPZUENG-R (RIGHT ENGINE) - [659] = "%1d", --PTR-RAZS-TMB-POSRIO3 (RIO-3) - [660] = "%1d", --PTR-RAZS-TMB-POSGLS (WINDOW) - [661] = "%1d", --PTR-RAZS-TMB-WIPER-L (LEFT ENGINE) - [662] = "%1d", --PTR-RAZS-TMB-WIPER-R (RIGHT ENGINE) - [663] = "%1d", --PTR-RAZS-TMB-L1800 (RIO-3) - [664] = "%1d", --PTR-RAZS-TMB-KO50 (WINDOW) - - [882] = "%1d", --PTR-GRAZS-1 (CB Group 1) - [883] = "%1d", --PTR-GRAZS-2 (CB Group 4) - [884] = "%1d", --PTR-GRAZS-3 (CB Group 7) - [885] = "%1d", --PTR-GRAZS-4 (CB Group 2) - [886] = "%1d", --PTR-GRAZS-5 (CB Group 5) - [887] = "%1d", --PTR-GRAZS-6 (CB Group 8) - [888] = "%1d", --PTR-GRAZS-7 (CB Group 3) - [889] = "%1d", --PTR-GRAZS-8 (CB Group 6) - [890] = "%1d", --PTR-GRAZS-9 (CB Group 9) - ------------------------------------------------------------- - -- FUELSYS INTERFACE - [438] = "%1d", --PTR-CPE-TMB-PUMP-RATE (Service tank pump) - [439] = "%1d", --PTR-CPE-TMB-PUMPTNK-L (Left fuel tank pump) - [440] = "%1d", --PTR-CPE-TMB-PUMPTNK-R (Right fuel tank pump) - [427] = "%1d", --PTR-CPE-TMB-PUMP-L (Left Engine Shutoff Valve) - [429] = "%1d", --PTR-CPE-TMB-PUMP-R (Right Engine Shutoff Valve) - [426] = "%1d", --PTR-CPE-CVR-PUMP-L (Left Engine Shutoff Valve Cover) - [428] = "%1d", --PTR-CPE-CVR-PUMP-R (Right Engine Shutoff Valve Cover) - [431] = "%1d", --PTR-CPE-TMB-PUMP-RING (Crossfeed) - [430] = "%1d", --PTR-CPE-CVR-PUMP-RING (Crossfeed Cover) - - [433] = "%1d", --PTR-CPE-TMB-PUMP-PASS (Bypass) - [432] = "%1d", --PTR-CPE-CVR-PUMP-PASS (Bypass Cover) - [437] = "%.1f", --PTR-CPE-TMB-PUMP-CONTR (Refueling Control Switch) - ------------------------------------------------------------- - -- ENGINE INTERFACE - [412] = "%1d", --PTR-CPE-TMB-TURBOSTART-ST (APU start mode) - [413] = "%1d", --PTR-CPE-BTN-TURBOSTART-ON (APU start) - [415] = "%1d", --PTR-CPE-BTN-TURBOSTART-OFF (APU stop) - - [419] = "%1d", --PTR-CPE-BTN-ENGSTART-ON (Engine start ON) - [421] = "%1d", --PTR-CPE-BTN-ENGSTART-OFF (Engine start OFF) - [422] = "%1d", --PTR-CPE-TMB-ENGSTART-LFTRGT (Select engine) - [423] = "%1d", --PTR-CPE-TMB-ENGSTART-ROLL (Engine start mode) - [425] = "%1d", -- PTR-CPE-BTN-ENGSTART-TEST (Engine ignition check) - - [204] = "%1d", --PTR-ENGSTOP-ARM-L (Left engine stop) - [206] = "%1d", --PTR-ENGSTOP-ARM-R (Right engine stop) - [208] = "%1d", --PTR-VINTBRAKE-ARM (Rotor brake) - - [310] = "%1d", --PTR-LSPE-BTN-CONTR-IV500 (Vibration Sensor Test) - [311] = "%1d", --PTR-LSPE-BTN-CONTR-GRND (Temperature Sensor Test Cold) - [312] = "%1d", --PTR-LSPE-BTN-CONTR-AIR (Temperature Sensor Test Hot) - [313] = "%1d", --PTR-LSPE-BTN-CONTR-RTL (Temperature Regulator Test Left) - [314] = "%1d", --PTR-LSPE-BTN-CONTR-RTR (Temperature Regulator Test Right) - - [202] = "%1d", --PTR-STKSGR-TMB-RPM-LEFT - [867] = "%1d", --PTR-STKSGR-TMB-RPM-RIGHT - --[0] = "%.4f", --PTR-STKSEC-ARM-L (Left Engine Throttle) - --[0] = "%.4f", --PTR-STKSEC-ARM-R (Right Engine Throttle) - --[0] = "%.4f", --PKT-TROTTLE_L (Left Collective / Throttle) - --[0] = "%.4f", --PKT-TROTTLE_R (Right Collective / Throttle) - - [167] = "%1d", --PTR-APP-TMB-ERD-L (EEC Left) - [173] = "%1d", --PTR-APP-TMB-ERD-R (EEC Right) - [168] = "%1d", --PTR-APP-TMB-CHR-L (ER Left) - [172] = "%1d", --PTR-APP-TMB-CHR-R (ER Right) - [169] = "%1d", --PTR-APP-TMB-ST-L (FT Check Left) - [171] = "%1d", --PTR-APP-TMB-ST-R (FT Check Right) - [170] = "%1d", --PTR-APP-TMB-TKLR (CT check) - ------------------------------------------------------------- - -- HYDRO SYS INTERFACE - [406] = "%1d", --PTR-CPE-TMB-HYDRO-MAIN (Main Hydro) - [410] = "%1d", --PTR-CPE-TMB-HYDRO-DBL (Aux Hydro) - [409] = "%1d", --PTR-CPE-CVR-HYDRO-DBL (Aux Hydro Cover) - [411] = "%1d", --PTR-CPE-BTN-DBLOFF (Aux Hydro Off) - ------------------------------------------------------------- - -- AUTOPILOT - [134] = "%1d", --PTR-APP-BTN-DIRON (Autopilot Heading ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button - [868] = "%.4f", --PTR-APP-BTN-DIRON (Autopilot Heading ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis - [135] = "%1d", --PTR-APP-BTN-DIROFF (Autopilot Heading OFF/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button - [869] = "%.4f", --PTR-APP-BTN-DIROFF (Autopilot Heading OFF/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis - - [138] = "%1d", --PTR-APP-BTN-KTON (Autopilot Pitch/Roll ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button - [870] = "%.4f", --PTR-APP-BTN-KTON (Autopilot Pitch/Roll ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis - [144] = "%1d", --PTR-APP-BTN-ALTON (Autopilot Altitude ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button - [871] = "%.4f", --PTR-APP-BTN-ALTON (Autopilot Altitude ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis - [145] = "%1d", --PTR-APP-BTN-ALTOFF (Autopilot Altitude OFF/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button - [872] = "%.4f", --PTR-APP-BTN-ALTOFF (Autopilot Altitude OFF/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis - - [146] = "%1d", --PTR-APP-BTN-CONTR (Autopilot Altitude Channel Control) - - [136] = "%.4f", --PTR-APP-LVR-DIR (Autopilot Heading Adjustment) - [140] = "%.4f", --PTR-APP-LVR-K (Autopilot Roll Adjustment) - [142] = "%.4f", --PTR-APP-LVR-T (Autopilot Pitch Adjustment) - - [183] = "%1d", --PTR-AUTOPILOT-OFF-L (Autopilot Off Left Button) - [226] = "%1d", --PTR-AUTOPILOT-OFF-R (Autopilot Off Right Button) - ------------------------------------------------------------- - -- RADAR ALTIMETER - [32] = "%1d", --PTR-ALTR-LVR-TEST (Radio altimeter test) - [29] = "%.4f", --PTR-ALTR-LVR-SET (Dangerous RALT set rotary) {0, 1} - [35] = "%1d", --PTR-ALTR-TMB-ONOFF (Radar Altimeter Power) - ------------------------------------------------------------- - -- BAR ALTIMETER - [18] = "%.4f", --PTR-ALTB-LVR-SET (Baro pressure QFE knob) - [97] = "%.4f", --PTR-ALTB-LVR-SET-R (Baro pressure QFE knob) - ------------------------------------------------------------- - -- VARIOMETER - [17] = "%.4f", --PTR-VARIO-LVR-SET-L (Variometer adjustment knob) - [96] = "%.4f", --PTR-VARIO-LVR-SET-R (Variometer adjustment knob) - ------------------------------------------------------------- - --HSI - [26] = "%.4f", --PTR-PNP-LVR-SET (HSI Course set knob) - [858] = "%1d", --PTR-ARKSV-ARKUKV (HSI ARC-9/ARC-UD Select) - - [102] = "%.4f", --PTR-PNP-LVR-SET-R (HSI Course set knob) - ------------------------------------------------------------- - -- FUELSYS INTERFACE - [61] = "%.1f", --PTR-FUEL-LVR-MODE (Fuel meter switch) - ------------------------------------------------------------- - -- WEAPON SYS - [921] = "%1d", --PTR-SAFE-WEAPON (Weapon Safe-Armed) - [707] = "%1d", --PTR-ADDPBV-TMB-EMRGEXP (Emergency Explode) - [706] = "%1d", --PTR-ADDPBV-CVR-EMRGEXP (Emergency Explode Cover) - - [709] = "%1d", --PTR-ADDPBV-TMB-EMRGJET (Emergency Release) - [708] = "%1d", --PTR-ADDPBV-CVR-EMRGJET (Emergency Release Cover) - - [717] = "%1d", --PTR-ADDPBV-TMB-MAINOFF (Main Bombs) - [718] = "%1d", --PTR-ADDPBV-BTN-LAMPTEST (Lamps Check) - - [719] = "%.1f", --PTR-ADDPBV-LVR-MODE (Pod Variants) - [720] = "%1d", --PTR-ADDPBV-TMB-WARM (ESBR Heat) - - [730] = "%.4f", --PTR-ADDESBR-LVR-MODE (ESBR Position) - [731] = "%1d", --PTR-ADDESBR-LVR-ONOFF (ESBR On/Off) - - [570] = "%1d", --PTR-LAZS-TMB-EMRGEXP (Emergency Explode) - [572] = "%1d", --PTR-LAZS-TMB-EMRGJET (Emergency Release) - [569] = "%1d", --PTR-LAZS-CVR-EMRGEXP (Emergency Explode Cover) - [571] = "%1d", --PTR-LAZS-CVR-EMRGJET (Emergency Release Cover) - - --[573] = "%1d", -- PTR-LAZS-TMB-MAINOFF (Main On/Off) - [575] = "%1d", --PTR-LAZS-TMB-RSGUV (RS/GUV Selector) - [576] = "%1d", --PTR-LAZS-BTN-LAMPTEST (Lamps Check) - [574] = "%1d", --PTR-LAZS-BTN-ENTER (PUS Arming) - - [342] = "%1d", --PTR-LPE-TMB-SHOOT1 (8/16/4) - [343] = "%1d", --PTR-LPE-TMB-SHOOT2 (1256/AUTO/34) - [344] = "%1d", --PTR-LPE-TMB-RS (UPK/PKT/RS) - [345] = "%1d", --PTR-LPE-TMB-GUV (CUTOFF) - [349] = "%1d", --PTR-LAZS-TMB-MAINOFF05 (800_or_624_622_800) - [348] = "%1d", --PTR-LAZS-CVR-EMRGEXP01 (800 or 624_622_800 Cover) - - [347] = "%.4f", --PTR-LPE-TMB-VAR (In800Out/800inOr624/622) - - [346] = "%.4f", --PTR-LPE-LVR-SHELL (Burst length) - - [350] = "%.4f", --PTR-LPE-TMB-PYRO-L (PYROCARTRIDGE Left) - [351] = "%.4f", --PTR-LPE-TMB-PYRO-R (PYROCARTRIDGE Right) - - [573] = "%1d", --PTR-LAZS-TMB-MAINOFF (Mine Arms Main Switch) - [905] = "%1d", --PTR-RSPE-TMB-PKT (PKT Selector Switch) - ------------------------------------------------------------- - -- SYS CONTROLLER - [523] = "%1d", --PTR-RSPE-TMB-WINK (FLASHER) - [525] = "%1d", --PTR-RSPE-TMB-TAB (Transparent Day/Night) - [150] = "%1d", --PTR-APP-TMB-TEST (CHECK LAMPS/FLASHER) - ------------------------------------------------------------- - -- SPUU-52 - [332] = "%1d", --PTR-LES-TMB-SPPU52 (SPUU-52 Power) - [127] = "%1d", --PTR-APP-BTN-OFF (SPUU-52 Control Engage) - [129] = "%1d", --PTR-APP-TMB-RT (SPUU-52 Control (Left button - P. Right button - t)) - [128] = "%.4f", --PTR-APP-LVR-ADJ (SPUU 52 Control Adjustment) - ------------------------------------------------------------- - -- FIRE EXTING INTERFACE - [389] = "%1d", --PTR-CPE-BTN-QUE1-1 (Main Discharge L ENG) - [390] = "%1d", --PTR-CPE-BTN-QUE1-2 (Main Discharge R ENG) - [391] = "%1d", --PTR-CPE-BTN-QUE1-3 (Main Discharge KO-50) - [392] = "%1d", --PTR-CPE-BTN-QUE1-4 (Main Discharge APU GEAR) - [393] = "%1d", --PTR-CPE-BTN-QUE2-1 (Alternate Discharge L ENG) - [394] = "%1d", --PTR-CPE-BTN-QUE2-2 (Alternate Discharge R ENG) - [395] = "%1d", --PTR-CPE-BTN-QUE2-3 (Alternate Discharge KO-50) - [396] = "%1d", --PTR-CPE-BTN-QUE2-4 (Alternate Discharge APU GEAR) - [397] = "%1d", --PTR-CPE-BTN-FIRE-OFF (Turn Off Fire Signal) - - [399] = "%1d", --PTR-CPE-TMB-CONTR-FIRE (Fire Detector Test) - [400] = "%1d", --PTR-CPE-TMB-CONTR-PYRO (Squib Test) - [401] = "%.1f", --PTR-CPE-LVR-CONTR-MODE (Check Fire circuits) - ------------------------------------------------------------- - -- ENGINE INTERFACE - [353] = "%1d", --PTR-LPE-TMB-MANAUT (AUTO-MANUAL) - [354] = "%1d", --PTR-LPE-BTN-OVR (GENERAL OFF) - [355] = "%1d", --PTR-LPE-TMB-PZU-L (LEFT ENGINE) - [356] = "%1d", --PTR-LPE-TMB-PZU-R (RIGHT ENGINE) - [357] = "%1d", --PTR-LPE-TMB-GLASS (WINDOW) - [358] = "%1d", --PTR-LPE-TMB-RIO (Ice Detector Heater) - [359] = "%1d", --PTR-LPE-BTN-RIOCONTR (Ice Detector Heater Test) - [372] = "%.1f", --PTR-LPE-LVR-FEEDMODE (Anti Ice Sections Current) - - [519] = "%1d", --PTR-RSPE-TMB-WRMPVD-L (Left Pitot Heater) - [520] = "%1d", --PTR-RSPE-TMB-WRMPVD-R (Right Pitot Heater) - [339] = "%1d", --PTR-LES-BTN-CONTRPVD (Left Pitot Heater Control) - [482] = "%1d", --PTR-LES-BTN-CONTRPVD01 (Right Pitot Heater Control) - ------------------------------------------------------------- - -- DISS 15 - [483] = "%1d", --PTR-RES-TMB-DISS (Doppler Navigator, Power) - [818] = "%1d", --PTR-DISS-BTN-OFF (Turn Off Coordinates Calculator) - [819] = "%1d", --PTR-DISS-BTN-ON (Turn On Coordinates Calculator) - [815] = "%1d", --PTR-DISS-BTN-MINUS (Decrease Map Angle) - [816] = "%1d", --PTR-DISS-BTN-PLUS (Increase Map Angle) - [809] = "%1d", --PTR-DISS-BTN-N (Decrease Path KM) - [810] = "%1d", --PTR-DISS-BTN-V (Increase Path KM) - [803] = "%1d", --PTR-DISS-BTN-TOLE (Decrease Deviation KM) - [804] = "%1d", --PTR-DISS-BTN-TORI (Increase Deviation KM) - [826] = "%.1f", --PTR-IND-DISS-SELECTOR (Mode Switch) - [797] = "%1d", --PTR-DISS-SELECTOR-KR (Test/Work) - [798] = "%1d", --PTR-DISS-SELECTOR-SM (Land/Sea) - ------------------------------------------------------------- - -- ADI - [487] = "%1d", --PTR-RES-TMB-AG (Right Attitude Indicator Power) - [335] = "%1d", --PTR-LES-TMB-AG (Left Attitude Indicator Power) - [11] = "%1d", --PTR-AGB-LVR-KNOB (Left Attitude Indicator Cage) - [10] = "%.4f", --PTR-AGB-LVR-SET (Left Attitude Indicator Zero pitch trim) - [90] = "%1d", --PTR-AGB-LVR-KNOB-R (Right Attitude Indicator Cage) - [89] = "%.4f", --PTR-AGB-LVR-SET-R (Right Attitude Indicator Zero pitch trim) - ------------------------------------------------------------- - -- - [336] = "%1d", --PTR-LES-TMB-VK53 (VK-53, Power) - ------------------------------------------------------------- - -- GMK1A - [485] = "%1d", --PTR-RES-TMB-GMK (GMC Power) - [470] = "%1d", --PTR-RPE-LVR-CRDNS (GMC Hemisphere Selection) - [472] = "%1d", --PTR-RPE-LVR-CRDMK (GMC Mode (MC, DG, AC(N/F))) - [476] = "%.1f", --PTR-RPE-LVR-CRDCONTR (GMC Control (Left - 0, Right - 300)) {-1.0,0.0,1.0} - [477] = "%.1f", --PTR-RPE-LVR-CRDZK (GMC Course Setting (Left - CCW, Right - CW)) {-1.0,0.0,1.0} - [474] = "%.4f", --PTR-RPE-LVR-CRDLAT (GMC Latitude Selection) - ------------------------------------------------------------- - -- ENGINE INTERFACE - [517] = "%1d", --PTR-RSPE-TMB-PZUENG-L (Dust Protection Left) - [518] = "%1d", --PTR-RSPE-TMB-PZUENG-R (Dust Protection Right) - ------------------------------------------------------------- - -- Nav Lights System - [513] = "%1d", --PTR-RSPE-TMB-ANO (ANO) - [514] = "%1d", --PTR-RSPE-TMB-LGTWING (Formation Lights) - [515] = "%1d", --PTR-RSPE-TMB-LGTCONT (Tip Lights) - [516] = "%1d", --PTR-RSPE-TMB-BEAC (Strobe Light) - [322] = "%1d", --PTR-LSPE-TMB-AIR-CODE (ANO code) - [836] = "%1d", --PTR-LEFT-TAXI-L-SW (Taxi Light) - [837] = "%1d", --PTR-LEFT-TAXI-L-POS-SW (Left Landing Light) - [838] = "%1d", --PTR-LEFT-TAXI-R-POS-SW (Right Landing Light) - ------------------------------------------------------------- - -- Lights System - [333] = "%1d", --PTR-LES-TMB-PLF (Left Ceiling Light) - [489] = "%1d", --PTR-RES-TMB-PLF (Right Ceiling Light) - [479] = "%1d", --PTR-RES-TMB-LGT (5.5V Lights) - [280] = "%.4f", --PTR-LSPE-LVR-REDGRP1 (Lh RedLights Brightness Rst gr.1) {0.0, 1.0} - [281] = "%.4f", --PTR-LSPE-LVR-REDGRP2 (Lh RedLights Brightness Rst gr.2) {0.0, 1.0} - [491] = "%.4f", --PTR-RSPE-LVR-REDGRP1 (Rh RedLights Brightness Rst gr.1) {0.0, 1.0} - [492] = "%.4f", --PTR-RSPE-LVR-REDGRP2 (Rh RedLights Brightness Rst gr.2) {0.0, 1.0} - [894] = "%.4f", --PTR-RSPE-LVR-REDGRP003 (Central RedLights Brightness Rst gr.1) {0.0, 1.0} - [895] = "%.4f", --PTR-RSPE-LVR-REDGRP004 (Central RedLights Brightness Rst gr.2) {0.0, 1.0} - [914] = "%.4f", --PTR-RSPE-LVR-REDGRP005 (5.5V Lights Brightness Rheostat) - [511] = "%1d", --PTR-RSPE-TMB-DUTY (Cargo Cabin Duty Lights Switc) - [512] = "%1d", --PTR-RSPE-TMB-ALL (Cargo Cabin Common Lights Switch) - ------------------------------------------------- - -- RADIO EQUIPMENT - -- SPU-7 - -- Left - [549] = "%.4f", --PTR-LAZS-LVR-ALL (Common Volume) - [548] = "%.4f", --PTR-LAZS-LVR-AUDIT (Listening Volume) - [553] = "%1d", --PTR-LAZS-TMB-RADSPU (Radio/ICS) - [551] = "%1d", --PTR-LAZS-TMB-CIRC (Network 1/2 (N/F)) - [552] = "%1d", --PTR-LAZS-BTN-CB (Circular Call (N/F)) - [550] = "%.1f", --PTR-LAZS-LVR-MODES (Radio Source (R-863/JADRO-1A/R-828/NF/ARC-9/ARC-UD)) - -- Right - [841] = "%.4f", --PTR-RAZS-LVR-ALL002 (Common Volume) - [840] = "%.4f", --PTR-RAZS-LVR-AUDIT002 (Listening Volume) - [845] = "%1d", --PTR-RAZS-TMB-RADSPU002 (Radio/ICS) - [843] = "%1d", --PTR-RAZS-TMB-CIRC002 (Network 1/2 (N/F)) - [846] = "%1d", --PTR-RAZS-BTN-CB002 (Circular Call (N/F)) - [842] = "%.1f", --PTR-RAZS-LVR-MODES002 (Radio Source (R-863/JADRO-1A/R-828/NF/ARC-9/ARC-UD)) - - --[194] = "%.4f", -- RADIO/ICS-1-PTR (Radio/ICS) - [480] = "%1d", --PTR-RES-TMB-LARING (Laryngophone) - ------------------------------------------------------------- - -- R-863 - [369] = "%1d", --PTR-LPE-TMB-COMAND (R-863, Select FM/AM) - [132] = "%1d", --PTR-APP-TMB-NU (R-863, Dial/Memory Unit) - [370] = "%1d", --PTR-LPE-LVR-CHANNEL (R-863, Radio channel selector) - - [155] = "%1d", --PTR-APP-TMB-PS (R-863, Squelch) - [156] = "%.4f", --PTR-APP-LVR-LEVEL (R-863, Volume) - - [163] = "%.4f", --PTR-APP-LVR-SEL1 (R-863, 10MHz rotary) {-0.1, 0.1} - [164] = "%.4f", --PTR-APP-LVR-SEL2 (R-863, 1MHz rotary) {-0.1, 0.1} - [165] = "%.4f", --PTR-APP-LVR-SEL3 (R-863, 100kHz rotary) {-0.1, 0.1} - [166] = "%.4f", --PTR-APP-LVR-SEL4 (R-863, 1kHz rotary) {-0.1, 0.1} - - [153] = "%1d", --PTR-APP-TMB-AP (R-863, Emergency Receiver On/Off (N/F)) - [154] = "%1d", --PTR-APP-TMB-RK (R-863, ARC (N/F)) - ------------------------------------------------------------- - -- R-828 - [735] = "%1d", --PTR-ADDSECPLT-LVR-CHNL (R-828 Radio channel selector) - - [737] = "%.4f", --PTR-ADDSECPLT-LVR-VOL (R-828 Radio volume) - [738] = "%1d", --PTR-ADDSECPLT-BTN-ASU (R-828 Radio Tuner button) - [739] = "%1d", --PTR-ADDSECPLT-TMB-PSH (R-828 Radio Squelch) - [756] = "%1d", --PTR-ADDSECPLT-TMB-P828 (R-828 Radio, Power) - [757] = "%1d", --PTR-ADDSECPLT-TMB-MODSEL (R-828 Radio, COMM/NAV) - ------------------------------------------------------------- - -- Jadro-1A - [484] = "%1d", --PTR-RES-TMB-RS (Jadro 1A, Power) - [745] = "%.4f", --PTR-ADDSECPLT-LVR-DIG12 (Jadro 1A, Frequency Selector, 1MHz) {-0.1, 0.1} - [746] = "%.4f", --PTR-ADDSECPLT-LVR-DIG3 (Jadro 1A, Frequency Selector, 100kHz) {-0.1, 0.1} - [747] = "%.4f", --PTR-ADDSECPLT-LVR-DIG4 (Jadro 1A, Frequency Selector, 10kHz) {-0.1, 0.1} - - [748] = "%.4f", --PTR-ADDSECPLT-LVR-DIG6 (Jadro 1A, Frequency Selector, Left mouse - 1kHz/ Right mouse - 100Hz) - [749] = "%.4f", --PTR-ADDSECPLT-LVR-DIG6 (Jadro 1A, Frequency Selector, Left mouse - 1kHz/ Right mouse - 100Hz) - - [744] = "%.1f", --PTR-ADDSECPLT-LVR-ONOFF (Jadro 1A, Mode OFF/OM/AM) - - [743] = "%.4f", --PTR-ADDSECPLT-LVR-VOLUM (Jadro 1A, Volume) - [741] = "%.4f", --PTR-ADDSECPLT-LVR-PSH (Jadro 1A, Squelch) - [742] = "%1d", --PTR-ADDSECPLT-TMB-CONTR (Jadro 1A, Control) - ------------------------------------------------------------- - -- RI-65 - [338] = "%1d", --PTR-LES-TMB-RK85 (RI-65) - [292] = "%1d", --PTR-LSPE-BTN-RI65-OFF (RI-65 OFF) - [293] = "%1d", --PTR-LSPE-BTN-RI65-RETRY (RI-65 Repeat) - [294] = "%1d", --PTR-LSPE-BTN-RI65-TEST (RI-65 Check) - [295] = "%1d", --PTR-LSPE-TMB-RI65-AMP (RI-65 Amplifier) - ------------------------------------------------------------- - -- ARC-UD - [456] = "%.1f", --PTR-RPE-LVR-ARKMODE (ARC-UD, Mode OFF/NARROW/WIDE/PULSE/RC) - [457] = "%.1f", --PTR-RPE-LVR-ARKMODE2 (ARC-UD, Channel) - - [453] = "%1d", --PTR-RPE-TMB-ARKSENS (ARC-UD, Sensitivity) - [454] = "%1d", --PTR-RPE-TMB-ARKUKV (ARC-UD, MW/DW) - - [672] = "%1d", --PTR-RPE-BTN-CONTR (ARC-UD, Control) - [673] = "%1d", --PTR-RPE-BTN-ANTL (ARC-UD, Ant. Left) - [674] = "%1d", --PTR-RPE-BTN-ANTR (ARC-UD, Ant. Right) - - [455] = "%.4f", --PTR-RPE-LVR-ARKVOL (ARC-UD, Volume) - [481] = "%1d", --PTR-RES-TMB-BLOCK (ARC-UD, Lock Switch) - ------------------------------------------------------------- - -- PKV Sight - [589] = "%.4f", --PTR-LAZS-LVR-AIMLGT (Sight Brightness) - - [855] = "%.4f", --PTR-PKV-ROTARY (Sight Limb) - - [856] = "%.4f", --PTR-PKV-DOUBLE (Sight Double) {1.0,-1.0} - - [903] = "%.1f", --PTR-PKV-GLASS-FILTER (PKV Filter) - -------------------------------------------------------------------------------- - -- CLOCK - [57] = "%1d", --PTR-WATCH-LVR-L (Mech clock left lever) - [58] = "%1d", --PTR-WATCH-LVR-L (Mech clock left lever) - - [59] = "%1d", --PTR-WATCH-LVR-R (Mech clock right lever) - [60] = "%1d", --PTR-WATCH-LVR-R (Mech clock right lever) - - [521] = "%1d", --PTR-RSPE-TMB-WRMWTCH (Clock Heating Switch) - -------------------------------------------------------------------------------- - [839] = "%.1f", --PTR-STAT-PRESS (Static Pressure System Mode (LEFT/COMMON/RIGHT)) - -------------------------------------------------------------------------------- - -- UV-26 CMD Control Panel - [910] = "%1d", --PTR-UV26-ONOFF (CMD Power) - [859] = "%1d", --PTR-UV26-BOARD (CMD Select Left/Both/Right board flares dispensers) - [913] = "%1d", --PTR-UV26-PROG (CMD Amount flares counter/Programming) - [914] = "%1d", --PTR-L45-BTN (CMD Num of sequences) - [862] = "%1d", --PTR-L68-BTN (CMD Dispense interval) - [863] = "%1d", --PTR-L8-BTN (CMD Num in sequence) - [866] = "%1d", --PTR-START-BTN (CMD Start dispense) - [911] = "%1d", --PTR-LSPE-BTN-UV26-START (Start/Stop dispense) - [864] = "%1d", --PTR-RESET-PROG-BTN (CMD Reset to default program) - [865] = "%1d", --PTR-STOP-BTN (CMD Stop dispense) - ------------------------------------------------ - -- CPTMECH - [215] = "%1d", --PTR-BLISTER-LOCK-L (Left blister open/close) - [216] = "%1d", --PTR-BLISTER-LOCK-R (Right blister open/close) - - [881] = "%1d", --PTR-WHEELBRK-ARM (Wheel Brakes) - - [910] = "%1d", --PTR-RSPE-TMB-WINK002 (Acceleration Reset) - - [334] = "%1d", --PTR-LES-TMB-VENT (Left Fan Switch) - [488] = "%1d", --PTR-RES-TMB-VENT (Right Fan Switch) - ------------------------------------------------ - -- ARC-9 - [469] = "%1d", --PTR-RPE-TMB-NEARFAR (ARC-9, Main/Backup Dialer) - [448] = "%.4f", --PTR-RPE-LVR-FRQVOLUME (ARC-9, Volume) - [444] = "%1d", --PTR-RPE-TMB-FRQTLG (ARC-9, TLF/TLG) - [446] = "%.1f", --PTR-RPE-LVR-FRQMODE (ARC-9, Mode OFF/COMP/ANT/LOOP) - [447] = "$.1f", --PTR-RPE-TMB-FRQFRAME (ARC-9, Loop Left/Right) - - [449] = "%.4f", --PTR-RPE-LVR-FRQADJRES (ARC-9, Backup Frequency Tune) - [675] = "%.2f", --PTR-RPE-LVR-FRQRES-SEC (ARC-9, Backup 100kHz rotary) - [450] = "%.2f", --PTR-RPE-LVR-FRQRES (ARC-9, Backup 10kHz rotary) - [451] = "%.4f", --PTR-RPE-LVR-FRQADJMAIN (ARC-9, Main Frequency Tune) - [678] = "%.2f", --PTR-RPE-LVR-FRQMAIN-SEC (ARC-9, Main 100kHz rotary) - [452] = "%.2f", --PTR-RPE-LVR-FRQMAIN (ARC-9, Main 10kHz rotary) - ------------------------------------------------ - -- External Cargo Equipment - [199] = "%1d", --PTR-STKSG-CVR-TACTJET (Tactical Cargo Release Button Cover) - [200] = "%1d", --PTR-STKSG-BTN-TACTJET (Tactical Cargo Release Button - Push to release) - [197] = "%1d", --PTR-STKSG-CVR-EMRGJET (Emergency Cargo Release Button Cover) - [198] = "%1d", --PTR-STKSG-BTN-EMRGJET (Emergency Cargo Release Button - Push to release) - [324] = "%1d", --PTR-LSPE-TMB-BRK-OUT (External Cargo Automatic Dropping) - ------------------------------------------------ - -- Signal Flares - [282] = "%1d", --PTR-LSPE-TMB-ALRMRKT1 (Signal Flares Cassette 1 Power Switch) - [283] = "%1d", --PTR-LSPE-TMB-ALRMRKT2 (Signal Flares Cassette 2 Power Switch) - [284] = "%1d", --PTR-LSPE-BTN-RCKT11 (Signal Flares Cassette 1 Launch Red Button) - [285] = "%1d", --PTR-LSPE-BTN-RCKT12 (Signal Flares Cassette 1 Launch Green Button) - [286] = "%1d", --PTR-LSPE-BTN-RCKT13 (Signal Flares Cassette 1 Launch Yellow Button) - [287] = "%1d", --PTR-LSPE-BTN-RCKT14 (Signal Flares Cassette 1 Launch White Button) - [288] = "%1d", --PTR-LSPE-BTN-RCKT21 (Signal Flares Cassette 2 Launch Red Button) - [289] = "%1d", --PTR-LSPE-BTN-RCKT22 (Signal Flares Cassette 2 Launch Green Button) - [290] = "%1d", --PTR-LSPE-BTN-RCKT23 (Signal Flares Cassette 2 Launch Yellow Button) - [291] = "%1d", --PTR-LSPE-BTN-RCKT24 (Signal Flares Cassette 2 Launch White Button) - ------------------------------------------------ - -- SARPP - [315] = "%1d", --PTR-LSPE-TMB-CONTR-AUTMAN (SARPP-12 Mode Switch,) - ------------------------------------------------ - -- Recorder P-503B - [305] = "%1d", --PTR-LSPE-TMB-REC (Recorder P-503B Power Switch) - [308] = "%.4f", --PTR-LSPE-LVR-LGTSEL (Recorder P-503B Backlight Brightness Knob) - ------------------------------------------------ - -- IFF - [304] = "%1d", --"PTR-LSPE-LVR-MODE (IFF Transponder Mode Selector Switch) - [301] = "%1d", --PTR-LSPE-TMB-RADIO-WRK (IFF Transponder Device Selector Switch) - [300] = "%1d", --PTR-LSPE-TMB-RADIO-MODE12 (IFF Transponder Device Mode Switch) - [296] = "%1d", --PTR-LSPE-CVR-EMRG-ERASE (IFF Transponder Erase Button Cover) - [297] = "%1d", --PTR-LSPE-BTN-EMRG-ERASE (IFF Transponder Erase Button) - [298] = "%1d", --PTR-LSPE-CVR-EMRG-MAYDAY (IFF Transponder Disaster Switch Cover) - [299] = "%1d", --PTR-LSPE-TMB-EMRG-MAYDAY (IFF Transponder Disaster Switch) - ------------------------------------------------ - -- jump descent siren - [323] = "%1d", --PTR-LSPE-TMB-AIR-SIREN (Alarm Bell Button) -} - ------------------------------ --- HIGH IMPORTANCE EXPORTS -- --- done every export event -- ------------------------------ - -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - --[[ - every frame export to GlassCockpit - Example from A-10C - Get Radio Frequencies - get data from device - local lUHFRadio = GetDevice(54) - SendData("ExportID", "Format") - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data - ]] - -- Altimeter - -- VD_10K_L_100_Ind; VD_10K_L_10_Ind; VD_10K_L_PRESS - SendData(2000, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(98), - mainPanelDevice:get_argument_value(99), - mainPanelDevice:get_argument_value(21))) - -- Altimeter Radar - -- A_036_RALT;A_036_DangerRALT_index;A_036_DangerRALT_lamp;A_036_warning_flag - SendData(2001, string.format("%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(34), - mainPanelDevice:get_argument_value(31), - mainPanelDevice:get_argument_value(30), - mainPanelDevice:get_argument_value(33))) - -- AGB_3K - -- AGB_3K_Left_roll, AGB_3K_Left_pitch, steering_warning_flag, SlipBallPosition - SendData(2002, string.format("%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(13), - mainPanelDevice:get_argument_value(12), - mainPanelDevice:get_argument_value(14), - mainPanelDevice:get_argument_value(15))) - - -- Clock - -- currtimeHours; currtimeMinutes; currtimeSeconds; flightTimeMeterStatus; - -- flightHours;flightMinutes; secondsMeterTimeMinutes; secondsMeterTimeSeconds; - SendData(2003, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(49), - mainPanelDevice:get_argument_value(50), - mainPanelDevice:get_argument_value(51), - mainPanelDevice:get_argument_value(56), - mainPanelDevice:get_argument_value(52), - mainPanelDevice:get_argument_value(53), - mainPanelDevice:get_argument_value(54), - mainPanelDevice:get_argument_value(55))) - -- DirectionalGyro - -- UGR_4K_heading_L;UGR_4K_commanded_course_L;UGR_4K_bearing_needle_L - SendData(2004, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(25), - mainPanelDevice:get_argument_value(27), - mainPanelDevice:get_argument_value(28))) - -- DriftIndicator - -- diss15_drift_angle;diss15_W_shutter;diss15_W_memory_lamp;diss15_W_hundreds; diss15_W_tens;diss15_W_ones - SendData(2005, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(791), - mainPanelDevice:get_argument_value(795), - mainPanelDevice:get_argument_value(796), - mainPanelDevice:get_argument_value(792), - mainPanelDevice:get_argument_value(793), - mainPanelDevice:get_argument_value(794))) - -- EGT - -- LeftEngineTemperatureHund; LeftEngineTemperatureTenth; RightEngineTemperatureHund;RightEngineTemperatureTenth - SendData(2006, string.format("%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(43), - mainPanelDevice:get_argument_value(44), - mainPanelDevice:get_argument_value(45), - mainPanelDevice:get_argument_value(46))) - -- Engine Power - -- EnginesMode;LeftEngineMode;RightEngineMode ???? - SendData(2007, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(39), - mainPanelDevice:get_argument_value(37), - mainPanelDevice:get_argument_value(38))) - -- Hover - -- diss15_hover_x; diss15_hover_y;diss15_hover_z;diss15_hover_lamp_off; - SendData(2008, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(830), - mainPanelDevice:get_argument_value(828), - mainPanelDevice:get_argument_value(829), - mainPanelDevice:get_argument_value(831), - mainPanelDevice:get_argument_value(16))) - -- Oil Engine Left - -- oils_p_left_engine;oils_t_left_engine - SendData(2009, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(115), - mainPanelDevice:get_argument_value(116))) - -- Oil Engine Right - -- oils_p_right_engine;oils_t_right_engine - SendData(2010, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(117), - mainPanelDevice:get_argument_value(118))) - -- Oil Transition - -- oils_p_main_reductor;oils_t_main_reductor;oils_temp_tail_reductor; - SendData(2011, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(111), - mainPanelDevice:get_argument_value(114), - mainPanelDevice:get_argument_value(113))) - -- RPM - -- LeftEngineRPM;RightEngineRPM - SendData(2012, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(40), - mainPanelDevice:get_argument_value(41))) - -- Turn Indicator - -- EUP_speed;EUP_sideslip - SendData(2013, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(22), - mainPanelDevice:get_argument_value(23))) - - end -end - -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) - --[[ - every frame export to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config - ]] - - -- Radar altimeter A-036 - --------------------------------------------------------------- - SendDataHW("30", mainPanelDevice:get_argument_value(30) > 0.3 and 1 or 0) -- A_036_DangerRALT_lamp {0.0, 1.0} - -- DISS15 - --------------------------------------------------------------- - SendDataHW("822", mainPanelDevice:get_argument_value(822) > 0.3 and 1 or 0) -- diss15_check_control_lamp {0.0, 0.9} - SendDataHW("823", mainPanelDevice:get_argument_value(823) > 0.3 and 1 or 0) -- diss15_check_work_lamp {0.0, 0.9} - SendDataHW("824", mainPanelDevice:get_argument_value(824) > 0.3 and 1 or 0) -- diss15_check_failM_lamp {0.0, 0.9} - SendDataHW("825", mainPanelDevice:get_argument_value(825) > 0.3 and 1 or 0) -- diss15_check_failC_lamp {0.0, 0.9} - -- SPUU-52 - --------------------------------------------------------------- - SendDataHW("786", mainPanelDevice:get_argument_value(786) > 0.3 and 1 or 0) -- SPUU52_lamp {0.0, 1.0} - -- PU-26 LAMP - --------------------------------------------------------------- - SendDataHW("827", mainPanelDevice:get_argument_value(827) > 0.3 and 1 or 0) -- PU_26_GA_Lamp {0.0, 0.5} - -- ARC-UD - --------------------------------------------------------------- - SendDataHW("458", mainPanelDevice:get_argument_value(458) > 0.3 and 1 or 0) -- ARC_UD_Narrow_Lamp {0.0, 0.9} - SendDataHW("459", mainPanelDevice:get_argument_value(459) > 0.3 and 1 or 0) -- ARC_UD_Wide_Lamp {0.0, 0.9} - SendDataHW("460", mainPanelDevice:get_argument_value(460) > 0.3 and 1 or 0) -- ARC_UD_Pulse_Lamp {0.0, 0.9} - -- Jadro 1A - --------------------------------------------------------------- - SendDataHW("849", mainPanelDevice:get_argument_value(849) > 0.3 and 1 or 0) -- Jadro_ASU_Lamp {0.0, 1.0} - SendDataHW("848", mainPanelDevice:get_argument_value(848) > 0.3 and 1 or 0) -- Jadro_Ctl_Lamp {0.0, 1.0} - SendDataHW("850", mainPanelDevice:get_argument_value(450) > 0.3 and 1 or 0) -- Jadro_Breakdown_Lamp {0.0, 1.0} - -- Autopilot LAMPS - --------------------------------------------------------------- - SendDataHW("781", mainPanelDevice:get_argument_value(781) > 0.3 and 1 or 0) -- lamp_AP_heading_on - SendDataHW("782", mainPanelDevice:get_argument_value(782) > 0.3 and 1 or 0) -- lamp_AP_heading_off - SendDataHW("783", mainPanelDevice:get_argument_value(783) > 0.3 and 1 or 0) -- lamp_AP_pitch_roll_on - SendDataHW("784", mainPanelDevice:get_argument_value(784) > 0.3 and 1 or 0) -- lamp_AP_height_on - SendDataHW("785", mainPanelDevice:get_argument_value(785) > 0.3 and 1 or 0) -- lamp_AP_height_off - -- LAMPS - --------------------------------------------------------------- - SendDataHW("316", mainPanelDevice:get_argument_value(316) > 0.3 and 1 or 0) -- lamp_ENGINE_RT_LEFT_ON - SendDataHW("317", mainPanelDevice:get_argument_value(317) > 0.3 and 1 or 0) -- lamp_ENGINE_RT_RIGHT_ON - SendDataHW("318", mainPanelDevice:get_argument_value(318) > 0.3 and 1 or 0) -- lamp_SARPP_ON - SendDataHW("326", mainPanelDevice:get_argument_value(326) > 0.3 and 1 or 0) -- lamp_LOCK_OPEN - SendDataHW("327", mainPanelDevice:get_argument_value(327) > 0.3 and 1 or 0) -- lamp_DOORS_OPEN - SendDataHW("340", mainPanelDevice:get_argument_value(340) > 0.3 and 1 or 0) -- lamp_TURN_ON_RI_65 - SendDataHW("360", mainPanelDevice:get_argument_value(360) > 0.3 and 1 or 0) -- lamp_FROST - SendDataHW("362", mainPanelDevice:get_argument_value(362) > 0.3 and 1 or 0) -- lamp_LEFT_ENG_HEATING - SendDataHW("363", mainPanelDevice:get_argument_value(363) > 0.3 and 1 or 0) -- lamp_RIGHT_ENG_HEATING - SendDataHW("361", mainPanelDevice:get_argument_value(361) > 0.3 and 1 or 0) -- lamp_ANTI_ICE_ON - SendDataHW("364", mainPanelDevice:get_argument_value(364) > 0.3 and 1 or 0) -- lamp_LEFT_PZU_FRONT - SendDataHW("365", mainPanelDevice:get_argument_value(365) > 0.3 and 1 or 0) -- lamp_RIGHT_PZU_FRONT - SendDataHW("366", mainPanelDevice:get_argument_value(366) > 0.3 and 1 or 0) -- lamp_LEFT_PZU_BACK - SendDataHW("367", mainPanelDevice:get_argument_value(367) > 0.3 and 1 or 0) -- lamp_RIGHT_PZU_BACK - SendDataHW("373", mainPanelDevice:get_argument_value(373) > 0.3 and 1 or 0) -- lamp_SECTION_1 - SendDataHW("375", mainPanelDevice:get_argument_value(375) > 0.3 and 1 or 0) -- lamp_SECTION_2 - SendDataHW("374", mainPanelDevice:get_argument_value(374) > 0.3 and 1 or 0) -- lamp_SECTION_3 - SendDataHW("376", mainPanelDevice:get_argument_value(376) > 0.3 and 1 or 0) -- lamp_SECTION_4 - SendDataHW("368", mainPanelDevice:get_argument_value(368) > 0.3 and 1 or 0) -- lamp_RIO_heating_ok - SendDataHW("377", mainPanelDevice:get_argument_value(377) > 0.3 and 1 or 0) -- lamp_LEFT_ENG_FIRE - SendDataHW("378", mainPanelDevice:get_argument_value(378) > 0.3 and 1 or 0) -- lamp_RIGHT_ENG_FIRE - SendDataHW("379", mainPanelDevice:get_argument_value(379) > 0.3 and 1 or 0) -- lamp_KO50_FIRE - SendDataHW("380", mainPanelDevice:get_argument_value(380) > 0.3 and 1 or 0) -- lamp_REDUC_AI9_FIRE - SendDataHW("381", mainPanelDevice:get_argument_value(381) > 0.3 and 1 or 0) -- lamp_FIRE_LENG_1_QUEUE - SendDataHW("382", mainPanelDevice:get_argument_value(382) > 0.3 and 1 or 0) -- lamp_FIRE_RENG_1_QUEUE - SendDataHW("383", mainPanelDevice:get_argument_value(383) > 0.3 and 1 or 0) -- lamp_FIRE_KO50_1_QUEUE - SendDataHW("384", mainPanelDevice:get_argument_value(384) > 0.3 and 1 or 0) -- lamp_FIRE_REDUCT_1_QUEUE - SendDataHW("385", mainPanelDevice:get_argument_value(385) > 0.3 and 1 or 0) -- lamp_FIRE_LENG_2_QUEUE - SendDataHW("386", mainPanelDevice:get_argument_value(386) > 0.3 and 1 or 0) -- lamp_FIRE_RENG_2_QUEUE - SendDataHW("387", mainPanelDevice:get_argument_value(387) > 0.3 and 1 or 0) -- lamp_FIRE_KO50_2_QUEUE - SendDataHW("388", mainPanelDevice:get_argument_value(388) > 0.3 and 1 or 0) -- lamp_FIRE_REDUCT_2_QUEUE - SendDataHW("398", mainPanelDevice:get_argument_value(398) > 0.3 and 1 or 0) -- lamp_CHECK_SENSORS - SendDataHW("407", mainPanelDevice:get_argument_value(407) > 0.3 and 1 or 0) -- lamp_HYDRO_main_on - SendDataHW("408", mainPanelDevice:get_argument_value(408) > 0.3 and 1 or 0) -- lamp_HYDRO_aux_on - SendDataHW("414", mainPanelDevice:get_argument_value(414) > 0.3 and 1 or 0) -- lamp_APD9_on - SendDataHW("416", mainPanelDevice:get_argument_value(416) > 0.3 and 1 or 0) -- lamp_APD9_oil_pressure - SendDataHW("417", mainPanelDevice:get_argument_value(417) > 0.3 and 1 or 0) -- lamp_APD9_rpm - SendDataHW("418", mainPanelDevice:get_argument_value(418) > 0.3 and 1 or 0) -- lamp_APD9_rpm_high - SendDataHW("420", mainPanelDevice:get_argument_value(420) > 0.3 and 1 or 0) -- lamp_APD_on - SendDataHW("424", mainPanelDevice:get_argument_value(424) > 0.3 and 1 or 0) -- lamp_APD_starter_on - SendDataHW("434", mainPanelDevice:get_argument_value(434) > 0.3 and 1 or 0) -- lamp_FUEL_left_closed - SendDataHW("435", mainPanelDevice:get_argument_value(435) > 0.3 and 1 or 0) -- lamp_FUEL_right_closed - SendDataHW("436", mainPanelDevice:get_argument_value(436) > 0.3 and 1 or 0) -- lamp_FUEL_ring_closed - SendDataHW("441", mainPanelDevice:get_argument_value(441) > 0.3 and 1 or 0) -- lamp_FUEL_center_on - SendDataHW("442", mainPanelDevice:get_argument_value(442) > 0.3 and 1 or 0) -- lamp_FUEL_left_on - SendDataHW("443", mainPanelDevice:get_argument_value(443) > 0.3 and 1 or 0) -- lamp_FUEL_right_on - SendDataHW("461", mainPanelDevice:get_argument_value(461) > 0.3 and 1 or 0) -- lamp_HEATER - SendDataHW("462", mainPanelDevice:get_argument_value(462) > 0.3 and 1 or 0) -- lamp_IGNITION - SendDataHW("463", mainPanelDevice:get_argument_value(463) > 0.3 and 1 or 0) -- lamp_KO50_ON - SendDataHW("341", mainPanelDevice:get_argument_value(341) > 0.3 and 1 or 0) -- lamp_LEFT_PITOT_HEATER_OK - SendDataHW("490", mainPanelDevice:get_argument_value(490) > 0.3 and 1 or 0) -- lamp_RIGHT_PITOT_HEATER_OK - SendDataHW("509", mainPanelDevice:get_argument_value(509) > 0.3 and 1 or 0) -- lamp_LEFT_PZU_ON - SendDataHW("510", mainPanelDevice:get_argument_value(510) > 0.3 and 1 or 0) -- lamp_RIGHT_PZU_ON - SendDataHW("504", mainPanelDevice:get_argument_value(504) > 0.3 and 1 or 0) -- lamp_ELEC_turn_VU1 - SendDataHW("505", mainPanelDevice:get_argument_value(505) > 0.3 and 1 or 0) -- lamp_ELEC_turn_VU2 - SendDataHW("506", mainPanelDevice:get_argument_value(506) > 0.3 and 1 or 0) -- lamp_ELEC_turn_VU3 - SendDataHW("507", mainPanelDevice:get_argument_value(507) > 0.3 and 1 or 0) -- lamp_ELEC_DC_ground - SendDataHW("508", mainPanelDevice:get_argument_value(508) > 0.3 and 1 or 0) -- lamp_ELEC_test_equipment - SendDataHW("543", mainPanelDevice:get_argument_value(543) > 0.3 and 1 or 0) -- lamp_ELEC_gen1_fail - SendDataHW("544", mainPanelDevice:get_argument_value(544) > 0.3 and 1 or 0) -- lamp_ELEC_gen2_fail - SendDataHW("545", mainPanelDevice:get_argument_value(545) > 0.3 and 1 or 0) -- lamp_ELEC_AC_ground - SendDataHW("546", mainPanelDevice:get_argument_value(546) > 0.3 and 1 or 0) -- lamp_ELEC_PO_500 - SendDataHW("86", mainPanelDevice:get_argument_value(86) > 0.3 and 1 or 0) -- lamp_CIRCUIT_FROM_BATTERY - SendDataHW("68", mainPanelDevice:get_argument_value(68) > 0.3 and 1 or 0) -- lamp_CLOG_TF_LEFT - SendDataHW("69", mainPanelDevice:get_argument_value(69) > 0.3 and 1 or 0) -- lamp_CLOG_TF_RIGHT - SendDataHW("70", mainPanelDevice:get_argument_value(70) > 0.3 and 1 or 0) -- lamp_CHIP_LEFT_ENG - SendDataHW("71", mainPanelDevice:get_argument_value(71) > 0.3 and 1 or 0) -- lamp_CHIP_RIGHT_ENG - SendDataHW("72", mainPanelDevice:get_argument_value(72) > 0.3 and 1 or 0) -- lamp_VIBRATION_LEFT_HIGH - SendDataHW("73", mainPanelDevice:get_argument_value(73) > 0.3 and 1 or 0) -- lamp_VIBRATION_RIGHT_HIGH - SendDataHW("74", mainPanelDevice:get_argument_value(74) > 0.3 and 1 or 0) -- lamp_FIRE - SendDataHW("76", mainPanelDevice:get_argument_value(76) > 0.3 and 1 or 0) -- lamp_LEFT_ENG_TURN_OFF - SendDataHW("77", mainPanelDevice:get_argument_value(77) > 0.3 and 1 or 0) -- lamp_RIGHT_ENG_TURN_OFF - SendDataHW("78", mainPanelDevice:get_argument_value(78) > 0.3 and 1 or 0) -- lamp_FT_LEFT_HIGH - SendDataHW("79", mainPanelDevice:get_argument_value(79) > 0.3 and 1 or 0) -- lamp_FT_RIGHT_HIGH - SendDataHW("80", mainPanelDevice:get_argument_value(80) > 0.3 and 1 or 0) -- lamp_OIL_PRESSURE_LEFT - SendDataHW("81", mainPanelDevice:get_argument_value(81) > 0.3 and 1 or 0) -- lamp_OIL_PRESSURE_RIGHT - SendDataHW("82", mainPanelDevice:get_argument_value(82) > 0.3 and 1 or 0) -- lamp_ER_LEFT - SendDataHW("83", mainPanelDevice:get_argument_value(83) > 0.3 and 1 or 0) -- lamp_ER_RIGHT - SendDataHW("84", mainPanelDevice:get_argument_value(84) > 0.3 and 1 or 0) -- lamp_EEC_LEFT_OFF - SendDataHW("85", mainPanelDevice:get_argument_value(85) > 0.3 and 1 or 0) -- lamp_EEC_RIGHT_OFF - SendDataHW("873", mainPanelDevice:get_argument_value(873) > 0.3 and 1 or 0) -- lamp_CHIP_MAIN_REDUCTOR - SendDataHW("874", mainPanelDevice:get_argument_value(874) > 0.3 and 1 or 0) -- lamp_CHIP_INTER_REDUCTOR - SendDataHW("875", mainPanelDevice:get_argument_value(875) > 0.3 and 1 or 0) -- lamp_CHIP_TAIL_REDUCTOR - SendDataHW("64", mainPanelDevice:get_argument_value(64) > 0.3 and 1 or 0) -- lamp_300_Left - SendDataHW("65", mainPanelDevice:get_argument_value(65) > 0.3 and 1 or 0) -- lamp_DISS_OFF - SendDataHW("555", mainPanelDevice:get_argument_value(555) > 0.3 and 1 or 0) -- lamp_BD1 - SendDataHW("556", mainPanelDevice:get_argument_value(556) > 0.3 and 1 or 0) -- lamp_BD2 - SendDataHW("557", mainPanelDevice:get_argument_value(557) > 0.3 and 1 or 0) -- lamp_BD3 - SendDataHW("558", mainPanelDevice:get_argument_value(558) > 0.3 and 1 or 0) -- lamp_BD4 - SendDataHW("559", mainPanelDevice:get_argument_value(559) > 0.3 and 1 or 0) -- lamp_BD5 - SendDataHW("560", mainPanelDevice:get_argument_value(560) > 0.3 and 1 or 0) -- lamp_BD6 - SendDataHW("711", mainPanelDevice:get_argument_value(711) > 0.3 and 1 or 0) -- lamp_BD1Bomb - SendDataHW("712", mainPanelDevice:get_argument_value(712) > 0.3 and 1 or 0) -- lamp_BD2Bomb - SendDataHW("713", mainPanelDevice:get_argument_value(713) > 0.3 and 1 or 0) -- lamp_BD3Bomb - SendDataHW("714", mainPanelDevice:get_argument_value(714) > 0.3 and 1 or 0) -- lamp_BD4Bomb - SendDataHW("715", mainPanelDevice:get_argument_value(715) > 0.3 and 1 or 0) -- lamp_BD5Bomb - SendDataHW("716", mainPanelDevice:get_argument_value(716) > 0.3 and 1 or 0) -- lamp_BD6Bomb - SendDataHW("562", mainPanelDevice:get_argument_value(562) > 0.3 and 1 or 0) -- lamp_PUS1 - SendDataHW("563", mainPanelDevice:get_argument_value(563) > 0.3 and 1 or 0) -- lamp_PUS3 - SendDataHW("564", mainPanelDevice:get_argument_value(564) > 0.3 and 1 or 0) -- lamp_PUS4 - SendDataHW("565", mainPanelDevice:get_argument_value(565) > 0.3 and 1 or 0) -- lamp_PUS6 - SendDataHW("561", mainPanelDevice:get_argument_value(561) > 0.3 and 1 or 0) -- lamp_EmergExplode - SendDataHW("705", mainPanelDevice:get_argument_value(705) > 0.3 and 1 or 0) -- lamp_EmergExplodeSec - SendDataHW("710", mainPanelDevice:get_argument_value(710) > 0.3 and 1 or 0) -- lamp_BV_Net_On - SendDataHW("566", mainPanelDevice:get_argument_value(566) > 0.3 and 1 or 0) -- lamp_RS_Net_On - SendDataHW("567", mainPanelDevice:get_argument_value(567) > 0.3 and 1 or 0) -- lamp_GUV_Net_On - --SendDataHW("", mainPanelDevice:get_argument_value() > 0.3 and 1 or 0) -- lamp_MV_Net_On - SendDataHW("568", mainPanelDevice:get_argument_value(568) > 0.3 and 1 or 0) -- lamp_FKP_On - SendDataHW("778", mainPanelDevice:get_argument_value(778) > 0.3 and 1 or 0) -- lamp_Caution_Weap - -end - ------------------------------------------------------ --- LOW IMPORTANCE EXPORTS -- --- done every gExportLowTickInterval export events -- ------------------------------------------------------ - -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - --[[ - export in low tick interval to GlassCockpit - Example from A-10C - Get Radio Frequencies - get data from device - local lUHFRadio = GetDevice(54) - SendData("ExportID", "Format") - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data - ]] - --[[ - -- AGB_3K_LEFT - local lAGB_3K_LEFT = GetDevice(6) - WriteToLog('lAGB_3K_LEFT:get_sideslip '..dump(lAGB_3K_LEFT:get_sideslip())) - WriteToLog('lAGB_3K_LEFT:get_bank '..dump(lAGB_3K_LEFT:get_bank())) - WriteToLog('lAGB_3K_LEFT:get_pitch '..dump(lAGB_3K_LEFT:get_pitch())) - - -- AGB_3K_RIGHT - local lAGB_3K_RIGHT = GetDevice(7) - WriteToLog('lAGB_3K_RIGHT:get_sideslip '..dump(lAGB_3K_RIGHT:get_sideslip())) - WriteToLog('lAGB_3K_RIGHT:get_bank '..dump(lAGB_3K_RIGHT:get_bank())) - WriteToLog('lAGB_3K_RIGHT:get_pitch '..dump(lAGB_3K_RIGHT:get_pitch())) - - -- DISS_15 - local lDISS_15 = GetDevice(15) - WriteToLog('lDISS_15:get_w_vector '..dump(lDISS_15:get_w_vector())) - WriteToLog('lDISS_15:get_drift_angle '..dump(lDISS_15:get_drift_angle())) - - -- RADAR_ALTIMETER - local lRADAR_ALTIMETER = GetDevice(18) - WriteToLog('lRADAR_ALTIMETER:get_altitude '..dump(lRADAR_ALTIMETER:get_altitude())) - WriteToLog('lRADAR_ALTIMETER:get_dangerous_height_flag '..dump(lRADAR_ALTIMETER:get_dangerous_height_flag())) - WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..dump(lRADAR_ALTIMETER:get_distance_limit())) - WriteToLog('lRADAR_ALTIMETER:get_dangerous_height '..dump(lRADAR_ALTIMETER:get_dangerous_height())) - WriteToLog('lRADAR_ALTIMETER:get_warning_flag '..dump(lRADAR_ALTIMETER:get_warning_flag())) - WriteToLog('lRADAR_ALTIMETER:get_mode '..dump(lRADAR_ALTIMETER:get_mode())) - WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..dump(lRADAR_ALTIMETER:get_aperture_size())) - WriteToLog('lRADAR_ALTIMETER:get_needle_value '..dump(lRADAR_ALTIMETER:get_needle_value())) - - -- MISC_SYSTEMS_INTERFACE - local lMISC_SYSTEMS_INTERFACE = GetDevice(20) - WriteToLog('lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch '..dump(lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch())) - WriteToLog('lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm '..dump(lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm())) - - -- SPU_7 (Intercom) - local lSPU_7 = GetDevice(36) - WriteToLog('lSPU_7:is_communicator_available '..dump(lSPU_7:is_communicator_available())) - WriteToLog('lSPU_7:get_noise_level '..dump(lSPU_7:get_noise_level())) - WriteToLog('lSPU_7:get_signal_level '..dump(lSPU_7:get_signal_level())) - --WriteToLog('lSPU_7:set_communicator '..dump(lSPU_7:set_communicator())) -- test parameters - --WriteToLog('lSPU_7:set_voip_mode '..dump(lSPU_7:set_voip_mode())) -- test parameters - - -- JADRO_1A - local lJADRO_1A = GetDevice(37) - WriteToLog('lJADRO_1A:is_on '..dump(lJADRO_1A:is_on())) - WriteToLog('lJADRO_1A:get_frequency '..dump(lJADRO_1A:get_frequency())) - --WriteToLog('lJADRO_1A:set_frequency '..dump(lJADRO_1A:set_frequency())) -- test parameters - --WriteToLog('lJADRO_1A:set_modulation '..dump(lJADRO_1A:set_modulation())) -- test parameters - --WriteToLog('lJADRO_1A:set_channel '..dump(lJADRO_1A:set_channel())) -- test parameters - - -- R_863 - local lR_863 = GetDevice(38) - WriteToLog('lR_863:is_on '..dump(lR_863:is_on())) - WriteToLog('lR_863:get_frequency '..dump(lR_863:get_frequency())) - --WriteToLog('lR_863:set_frequency '..dump(lR_863:set_frequency())) -- test parameters - --WriteToLog('lR_863:set_modulation '..dump(lR_863:set_modulation())) -- test parameters - --WriteToLog('lR_863:set_channel '..dump(lR_863:set_channel())) -- test parameters - - -- R_828 - local lR_828 = GetDevice(39) - WriteToLog('lR_828:is_on '..dump(lR_828:is_on())) - WriteToLog('lR_828:get_frequency '..dump(lR_828:get_frequency())) - --WriteToLog('lR_828:set_frequency '..dump(lR_828:set_frequency())) -- test parameters - --WriteToLog('lR_828:set_modulation '..dump(lR_828:set_modulation())) -- test parameters - --WriteToLog('lR_828:set_channel '..dump(lR_828:set_channel())) -- test parameters - ]] -end - -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) ---[[ - export in low tick interval to hardware - Example from A-10C - Landing Gear - mainPanelDevice, basis panel - SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE - SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE - SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE - - Device test, Device 2 to 32 - is value "userdata", is only DLL intern functions - - local ltmp1 = 0 - for ltmp2 = 1, 50, 1 do - ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] - - -- Radio comunication - -- JADRO 1A - local lJADRO_1A = GetDevice(37) - if lJADRO_1A:is_on() then - SendDataHW("2000", string.format("%7.4f", lJADRO_1A:get_frequency()/1000000)) - else - SendDataHW("2000", "-") - end - - -- R_863 (center) - local lR_863_c = GetDevice(38) - SendDataHW("2001", string.format("%7.3f", lR_863_c:get_frequency()/1000000)) - - -- R_863 (left) Channel - local lR_863_l = {[0.0]="1",[0.05]="2",[0.10]="3",[0.15]="4",[0.20]="5",[0.25]="6",[0.30]="7",[0.35]="8",[0.40]="9",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"} - SendDataHW("2002", lR_863_l[math.round(mainPanelDevice:get_argument_value(370), 2)]) - - -- R_863 (left) Frequency - -- is the same frequency as R_863 (center), but not the frequency from R_863 (left) - local lR_863_F = GetDevice(38) - SendDataHW("2003", string.format("%7.3f", lR_863_F:get_frequency()/1000000)) - - -- R_828 Channel - local lR_828 = {[0.0]="1",[0.101]="2",[0.199]="3",[0.302]="4",[0.400]="5",[0.502]="6",[0.601]="7",[0.697]="8",[0.801]="9",[0.898]="10"} - SendDataHW("2004", lR_828[math.round(mainPanelDevice:get_argument_value(736), 3)]) - - -- R_828 Frequency - local lR_828_F = GetDevice(39) - if lR_828_F:is_on() then - SendDataHW("2005", string.format("%7.3f", lR_828_F:get_frequency()/1000000)) - else - SendDataHW("2005", "-") - end - - -- UV-26 - local lUV26 = list_indication(5) - lUV26 = lUV26:gsub("-----------------------------------------", "") - lUV26 = lUV26:gsub("txt_digits", "") - lUV26 = lUV26:gsub("%c", "") - - SendDataHW("2006", string.format("%s", lUV26)) - - - --============================================================================================ - --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - - local ltmp1 = 0 - for ltmp2 = 1, 10, 1 do - ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] -end +-- Mi-8MTV2 Export +-- Version 1.0.0 BETA + +ExportScript.FoundDCSModule = true + +ExportScript.ConfigEveryFrameArguments = +{ + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] + + -- CONTROLLERS + --------------------------------------------------------------- + ----[209] = "%.4f", -- rudder { -1, 1} + --[266] = "%.4f", -- rudder_add { 1, -1} + --[181] = "%.4f", -- stick_roll {1, -1} + --[180] = "%.4f", -- stick_pitch {1, -1} + --[191] = "%.4f", -- collective_position {0, 1} + --[192] = "%1d", -- correction_position {1, 0} + --[230] = "%1d", -- collective_position_operator {0, 1} + --[231] = "%1d", -- correction_position_operator {1, 0} + --[560] = "%1d", -- coll_ROUTE_DESCENT_sw {0, 1} + --[558] = "%1d", -- coll_ReadjustFreeTurbRPM_sw {0, 1} + ----[208] = "%1d", -- collective_stopper {0, 1} + --[187] = "%.4f", -- left_engine_throttle {0.0, 1.0} + --[189] = "%.4f", -- right_engine_throttle {0.0, 1.0} + --[881] = "%.4f", -- wheelBrakes {0.0, 1.0} + ----[579] = "", -- throttle_cover {0.0, 1.0} + ----[208] = "", -- rotor_brake_handle {0.0, 1.0} + -- Left main panel + --------------------------------------------------------------- + [16] = "%.2f", -- Variometer_L {-30, -20, -10, -5, -2, -1, 0, 1, 2, 5, 10, 20, 30} {-1.0, -0.71, -0.43, -0.23, -0.09, -0.05, 0, 0.05, 0.09, 0.23, 0.43, 0.71, 1.0} + [95] = "%.2f", -- Variometer_R {-30, -20, -10, -5, -2, -1, 0, 1, 2, 5, 10, 20, 30} {-1.0, -0.71, -0.43, -0.23, -0.09, -0.05, 0, 0.05, 0.09, 0.23, 0.43, 0.71, 1.0} + [24] = "%.3f", -- IAS_L {-10.0, 0.0, 13.889, 27.78, 41.67, 55.56, 69.44, 83.33, 111.1, 125.0, 129.2} {0.0, 0.001, 0.028, 0.165, 0.277, 0.393, 1.0} + [790] = "%.3f", -- IAS_R {-10.0, 0.0, 13.889, 27.78, 41.67, 55.56, 69.44, 83.33, 111.1, 125.0, 129.2} {0.0, 0.001, 0.028, 0.165, 0.277, 0.393, 1.0} + -- AGB-3k + --------------------------------------------------------------- + [13] = "%.4f", -- AGB_3K_Left_roll {-1.0, 1.0} + [12] = "%.4f", -- AGB_3K_Left_pitch {1.0, -1.0} + [14] = "%.4f", -- AGB_3K_Left_failure_flag {0.0, 1.0} + [15] = "%.4f", -- AGB_3K_Left_sideslip {1.0, -1.0} + [820] = "%.4f", -- AGB_3K_Left_index {0.5, -0.5} + ------ + [92] = "%.4f", -- AGB_3K_Right_roll {-1.0, 1.0} + [91] = "%.4f", -- AGB_3K_Right_pitch {1.0, -1.0} + [93] = "%.4f", -- AGB_3K_Right_failure_flag {0.0, 1.0} + [94] = "%.4f", -- AGB_3K_Right_sideslip {1.0, -1.0} + [821] = "%.4f", -- AGB_3K_Right_index {0.5, -0.5} + -- EUP-53 + --------------------------------------------------------------- + [22] = "%.4f", -- EUP_speed {-1.0, 1.0} + [23] = "%.4f", -- EUP_sideslip {-1.0, 1.0} + -- UGR-4K + --------------------------------------------------------------- + [25] = "%.4f", -- UGR_4K_heading_L {0.0, 1.0} + [27] = "%.4f", -- UGR_4K_commanded_course_L {0.0, 1.0} + [28] = "%.4f", -- UGR_4K_bearing_needle_L {0.0, 1.0} + ---- + [101] = "%.4f", -- UGR_4K_heading_R {0.0, 1.0} + [103] = "%.4f", -- UGR_4K_commanded_course_R {0.0, 1.0} + [104] = "%.4f", -- UGR_4K_bearing_needle_R {0.0, 1.0} + -- Barometric altimeter VD-10K + --------------------------------------------------------------- + [19] = "%.4f", -- VD_10K_L_100 {0.0, 1.0} + [20] = "%.4f", -- VD_10K_L_10 {0.0, 1.0} + [833] = "%.4f", -- VD_10K_L_100_Ind {0.0, 1.0} + [832] = "%.4f", -- VD_10K_L_10_Ind {0.0, 1.0} + [916] = "%.4f", -- VD_10K_L_Shutter {0.822, 0.75} + [21] = "%.4f", -- VD_10K_L_PRESS {0.0, 1.0} + ----- + [98] = "%.4f", -- VD_10K_R_100 {0.0, 1.0} + [99] = "%.4f", -- VD_10K_R_10 {0.0, 1.0} + [835] = "%.4f", -- VD_10K_R_100_Ind {0.0, 1.0} + [917] = "%.4f", -- VD_10K_R_Shutter {0.822, 0.75} + [834] = "%.4f", -- VD_10K_R_10_Ind {0.0, 1.0} + [100] = "%.4f", -- VD_10K_R_PRESS {0.0, 1.0} + -- Rotor RPM + --------------------------------------------------------------- + [42] = "%.4f", -- RotorRPM {0.0, 1.0} + [787] = "%.4f", -- RotorRPM_Oper {0.0, 1.0} + -- Rotor Pitch + --------------------------------------------------------------- + [36] = "%.2f", -- RotorPitch {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0} {0.0, 0.07, 0.14, 0.21, 0.29, 0.35, 0.43, 0.5, 0.57, 0.64, 0.71, 0.79, 0.86, 0.93, 1.0} + -- Radar altimeter A-036 + --------------------------------------------------------------- + [34] = "%.3f", -- A_036_RALT {0, 100, 300, 800} {0.0, 0.475, 0.625, 1.0} + [31] = "%.3f", -- A_036_DangerRALT_index {0, 100, 300, 800} {0.0, 0.475, 0.625, 1.0} + [30] = "%.f", -- A_036_DangerRALT_lamp {0.0, 1.0} + [33] = "%.1f", -- A_036_warning_flag {0.0, 1.0} + -- Engines RPM + --------------------------------------------------------------- + [40] = "%.4f", -- LeftEngineRPM {0.0, 110.0} {0.0, 1.0} + [41] = "%.4f", -- RightEngineRPM {0.0, 110.0} {0.0, 1.0} + [788] = "%.4f", -- LeftEngineRPM_Oper {0.0, 110.0} {0.0, 1.0} + [789] = "%.4f", -- RightEngineRPM_Oper {0.0, 110.0} {0.0, 1.0} + -- Engines temperature + --------------------------------------------------------------- + [43] = "%.4f", -- LeftEngineTemperatureHund {0.0, 1200.0} {0.0, 1.0} + [44] = "%.4f", -- LeftEngineTemperatureTenth {0.0, 100.0} {0.0, 1.0} + [45] = "%.4f", -- RightEngineTemperatureHund {0.0, 1200.0} {0.0, 1.0} + [46] = "%.4f", -- RightEngineTemperatureTenth {0.0, 100.0} {0.0, 1.0} + -- Engines mode indicator + --------------------------------------------------------------- + [39] = "%.4f", -- EnginesMode {0.0, 1.0} + [37] = "%.4f", -- LeftEngineMode {0.0, 1.0} + [38] = "%.4f", -- RightEngineMode {0.0, 1.0} + -- Engines brakes + --------------------------------------------------------------- + [204] = "%.1f", -- left_engine_brake_handle {0.0, 1.0} + [206] = "%.1f", -- right_engine_brake_handle {0.0, 1.0} + [203] = "%.1f", -- left_engine_brake_handle_holder {0.0, 1.0} + [205] = "%.1f", -- right_engine_brake_handle_holder {0.0, 1.0} + -- DISS 15 + --------------------------------------------------------------- + [830] = "%.4f", -- diss15_hover_x {-1.0, 0, 1.0} + [828] = "%.4f", -- diss15_hover_y {-1.0, 1.0} + [829] = "%.4f", -- diss15_hover_z {-1.0, 1.0} + [831] = "%.4f", -- diss15_hover_lamp_off {0.0, 0.9} + ---- + [791] = "%.4f", -- diss15_drift_angle {-1.0, 1.0} + ---- + [795] = "%.4f", -- diss15_W_shutter {0.0, 1.0} + [796] = "%.1f", -- diss15_W_memory_lamp {1.0, 0.0} + [792] = "%.4f", -- diss15_W_hundreds {0.0, 1.0} + [793] = "%.4f", -- diss15_W_tens {0.0, 1.0} + [794] = "%.4f", -- diss15_W_ones {0.0, 1.0} + ---- + [817] = "%.4f", -- diss15_coord_on_lamp {1.0, 0.0} + [805] = "%.4f", -- diss15_coord_forward {1.0, 0.0} + [806] = "%.4f", -- diss15_coord_X_hundreds {0.0, 1.0} + [807] = "%.4f", -- diss15_coord_X_tens {0.0, 1.0} + [808] = "%.4f", -- diss15_coord_X_ones {0.0, 1.0} + [802] = "%.4f", -- diss15_coord_right {0.0, 1.0} + [799] = "%.4f", -- diss15_coord_Z_hundreds {0.0, 1.0} + [800] = "%.4f", -- diss15_coord_Z_tens {0.0, 1.0} + [801] = "%.4f", -- diss15_coord_Z_ones {0.0, 1.0} + [811] = "%.4f", -- diss15_coord_angle_hundreds {0.0, 1.0} + [812] = "%.4f", -- diss15_coord_angle_tens {0.0, 1.0} + [813] = "%.4f", -- diss15_coord_angle_ones {0.0, 1.0} + [814] = "%.4f", -- diss15_coord_angle_minutes {0.0, 1.0} + ---- + [822] = "%.f", -- diss15_check_control_lamp {0.0, 0.9} + [823] = "%.f", -- diss15_check_work_lamp {0.0, 0.9} + [824] = "%.f", -- diss15_check_failM_lamp {0.0, 0.9} + [825] = "%.f", -- diss15_check_failC_lamp {0.0, 0.9} + -- Oil + --------------------------------------------------------------- + [111] = "%.4f", -- oils_p_main_reductor {0.0, 1.0} + [114] = "%.2f", -- oils_t_main_reductor {0.0, 1.0} {-0.25, 0.75} + [113] = "%.2f", -- oils_temp_tail_reductor {0.0, 1.0} {-0.25, 0.75} + [112] = "%.2f", -- oils_temp_intermediate_reductor {0.0, 1.0} {-0.25, 0.75} + [115] = "%.4f", -- oils_p_left_engine {0.0, 1.0} + [116] = "%.2f", -- oils_t_left_engine {-0.25, 0.75} + [117] = "%.4f", -- oils_p_right_engine {0.0, 1.0} + [118] = "%.2f", -- oils_t_right_engine {-0.25, 0.75} + -- Autopilot + --------------------------------------------------------------- + [122] = "%.4f", -- autopilot_yaw_indicator {-1.0, 1.0} + [124] = "%.4f", -- autopilot_pitch_indicator {-1.0, 1.0} + [123] = "%.2f", -- autopilot_roll_indicator {-0.33, 0.33} + [125] = "%.4f", -- autopilot_altitude_indicator {-1.0, 1.0} + [119] = "%.4f", -- autopilot_yaw_scale {0.0, 1.0} + [120] = "%.4f", -- autopilot_roll_scale {0.0, 1.0} + [121] = "%.4f", -- autopilot_pitch_scale {0.0, 1.0} + -- Center upper panel + --------------------------------------------------------------- + [404] = "%.2f", -- hydro_pressure_main {0.05, 0.33, 0.52, 0.69, 1.0} + [405] = "%.2f", -- hydro_pressure_aux {0.05, 0.33, 0.52, 0.69, 1.0} + [402] = "%.2f", -- APU_temperature {0.0, 0.2, 0.42, 0.69, 0.94, 1.0} + [403] = "%.2f", -- APU_pressure {0.04, 0.95} + -- Mechanic clock + --------------------------------------------------------------- + [49] = "%.4f", -- CLOCK_currtime_hours {0.0, 1.0} + [50] = "%.4f", -- CLOCK_currtime_minutes {0.0, 1.0} + [51] = "%.4f", -- CLOCK_currtime_seconds {0.0, 1.0} + [56] = "%.4f", -- CLOCK_flight_time_meter_status {0.0, 1.0} + [52] = "%.4f", -- CLOCK_flight_hours {0.0, 1.0} + [53] = "%.4f", -- CLOCK_flight_minutes {0.0, 1.0} + [54] = "%.4f", -- CLOCK_seconds_meter_time_minutes {0.0, 1.0} + [55] = "%.4f", -- CLOCK_seconds_meter_time_seconds {0.0, 1.0} + -- Fuel tanks + --------------------------------------------------------------- + [62] = "%.3f", -- FuelScaleUpper {0.0, 200.0, 400.0, 800.0, 1600.0, 2000.0, 2400.0, 2800.0} {0.0, 0.131, 0.244, 0.414, 0.647, 0.705, 0.9, 1.0} + [62] = "%.3f", -- FuelScaleLower {0.0, 200.0, 300.0, 400.0, 600.0, 1200.0, 2240.0} {0.0, 0.165, 0.283, 0.393, 0.618, 1.0} + -- Air system gauges + --------------------------------------------------------------- + [320] = "%.2f", -- air_system_pressure {0.0, 25.0, 50.0, 100.0} {0.0, 0.23, 0.48, 1.0} + [321] = "%.4f", -- air_system_brake_pressure {0.0, 1.0} + -- SPUU-52 + --------------------------------------------------------------- + [126] = "%.4f", -- SPUU_pointer {-1.0, 1.0} + [786] = "%.f", -- SPUU52_lamp {0.0, 1.0} + -- PU-26 LAMP + --------------------------------------------------------------- + [827] = "%.f", -- PU_26_GA_Lamp {0.0, 1.0} {0.0, 0.5} + -- ARC-UD + --------------------------------------------------------------- + [458] = "%.f", -- ARC_UD_Narrow_Lamp {0.0, 0.9} + [459] = "%.f", -- ARC_UD_Wide_Lamp {0.0, 0.9} + [460] = "%.f", -- ARC_UD_Pulse_Lamp {0.0, 0.9} + -- ARC-9 + --------------------------------------------------------------- + [681] = "%.4f", -- ARC_9_Signal {0.0, 1.0} + ---- + [857] = "%.4f", -- PKV_Reflector {0.0, 1.0} + ---- + [778] = "%.4f", -- SAFE_WEAP {0.0, 1.0} + ---- + [577] = "%.4f", -- AMMO_CNT1_1 {0.0, 1.0} + [578] = "%.4f", -- AMMO_CNT1_2 {0.0, 1.0} + [580] = "%.4f", -- AMMO_CNT2_1 {0.0, 1.0} + [581] = "%.4f", -- AMMO_CNT2_2 {0.0, 1.0} + [583] = "%.4f", -- AMMO_CNT3_1 {0.0, 1.0} + [584] = "%.4f", -- AMMO_CNT3_2 {0.0, 1.0} + -- Radio R-828 + --------------------------------------------------------------- + [740] = "%.2f", -- R828_ASU {0.0, 1.0} {0.0, 0.95} + [736] = "%.3f", -- R828_channel {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} {0.0, 0.101, 0.199, 0.302, 0.400, 0.502, 0.601, 0.697, 0.801, 0.898} + -- Damage + --------------------------------------------------------------- + --[215] = "%0.1f", -- Blister_LEFT {0.0, 1.0} {0.0, 0.8} + --[216] = "%0.1f", -- Blister_RIGHT {0.0, 1.0} {0.0, 0.8} + ---- + --[878] = "%.1f", -- WindShiels_Up {0.0, 1.0} + --[879] = "%.1f", -- WindShiels_Down {0.0, 1.0} + -- UV-26 + --------------------------------------------------------------- + --[892] = "%.1f", -- UV26_Left {0.0, 1.0} + --[891] = "%.1f", -- UV26_Right {0.0, 1.0} + -- Pilots + --------------------------------------------------------------- + --[245] = "%.1f", -- Pilot_Body {0.0, 1.0} + --[242] = "%.1f", -- Operator_Body {0.0, 1.0} + --[262] = "%.1f", -- Crew_Body {0.0, 1.0} + -- Damage + --------------------------------------------------------------- + --[876] = "%.1f", -- Upper_Windshield {0.0, 1.0} + --[877] = "%.1f", -- Down_Windshield {0.0, 1.0} + --[879] = "%.1f", -- Left_Windshield {0.0, 1.0} + --[878] = "%.1f", -- Right_Windshield {0.0, 1.0} + -- Jadro 1A + --------------------------------------------------------------- + [849] = "%.f", -- Jadro_ASU_Lamp {0.0, 1.0} + [848] = "%.f", -- Jadro_Ctl_Lamp {0.0, 1.0} + [850] = "%.f", -- Jadro_Breakdown_Lamp {0.0, 1.0} + ---- + [904] = "%.4f", -- RAM_Temp {-50.0, 0.0, 70.0} {-1.0, 0.0, 1.0} + ---- + [907] = "%.4f", -- G_Meter {-1.0, 1.0, 3.0} {-1.0, 0.343, 1.0} + [908] = "%.4f", -- G_Meter_Max {1.0, 3.0} {0.343, 1.0} + [909] = "%.4f", -- G_Meter_Min {-1.0, 1.0} {-1.0, 0.343} + ---- + [903] = "%1d", -- filter_handle {0,1} + ---- + [63] = "%.4f", -- SalonTemperature {-70.0, -60.0, -30.0, -20.0, -10.0, 0.0, 10.0, 20.0, 30.0, 60.0, 70.0} {-0.7, -0.593, -0.296, -0.227, -0.125, 0.003, 0.132, 0.233, 0.302, 0.603, 0.693} + -- electric system gauges + --------------------------------------------------------------- + [526] = "%.4f", -- DC_voltage {0.0, 30.0} {0.0, 1.0} + [532] = "%.2f", -- AC_voltage {0.0, 100.0, 150.0, 200.0, 250.0} {0.0, 0.14, 0.31, 0.56, 1.0} + [493] = "%.4f", -- DC_APU_current {0.0, 400.0} {0.0, 1.0} + [527] = "%.4f", -- DC_battery_I_current {0.0, 400.0} {0.0, 1.0} + [528] = "%.4f", -- DC_battery_II_current {0.0, 400.0} {0.0, 1.0} + [529] = "%.4f", -- DC_VU_I_current {0.0, 400.0} {0.0, 1.0} + [530] = "%.4f", -- DC_VU_II_current {0.0, 400.0} {0.0, 1.0} + [531] = "%.4f", -- DC_VU_III_current {0.0, 400.0} {0.0, 1.0} + [533] = "%.2f", -- AC_generator_I_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} + [534] = "%.2f", -- AC_generator_II_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} + [371] = "%.2f", -- AntiIce_ampermeter {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} + -- LAMPS + --------------------------------------------------------------- + [781] = "%.f", -- lamp_AP_heading_on + [782] = "%.f", -- lamp_AP_heading_off + [783] = "%.f", -- lamp_AP_pitch_roll_on + [784] = "%.f", -- lamp_AP_height_on + [785] = "%.f", -- lamp_AP_height_off + [316] = "%.f", -- lamp_ENGINE_RT_LEFT_ON + [317] = "%.f", -- lamp_ENGINE_RT_RIGHT_ON + [318] = "%.f", -- lamp_SARPP_ON + [325] = "%.f", -- lamp_Descent_Siren + [326] = "%.f", -- lamp_LOCK_OPEN + [327] = "%.f", -- lamp_DOORS_OPEN + [340] = "%.f", -- lamp_TURN_ON_RI_65 + [360] = "%.f", -- lamp_FROST + [362] = "%.f", -- lamp_LEFT_ENG_HEATING + [363] = "%.f", -- lamp_RIGHT_ENG_HEATING + [361] = "%.f", -- lamp_ANTI_ICE_ON + [364] = "%.f", -- lamp_LEFT_PZU_FRONT + [365] = "%.f", -- lamp_RIGHT_PZU_FRONT + [366] = "%.f", -- lamp_LEFT_PZU_BACK + [367] = "%.f", -- lamp_RIGHT_PZU_BACK + [373] = "%.f", -- lamp_SECTION_1 + [375] = "%.f", -- lamp_SECTION_2 + [374] = "%.f", -- lamp_SECTION_3 + [376] = "%.f", -- lamp_SECTION_4 + [368] = "%.f", -- lamp_RIO_heating_ok + [377] = "%.f", -- lamp_LEFT_ENG_FIRE + [378] = "%.f", -- lamp_RIGHT_ENG_FIRE + [379] = "%.f", -- lamp_KO50_FIRE + [380] = "%.f", -- lamp_REDUC_AI9_FIRE + [381] = "%.f", -- lamp_FIRE_LENG_1_QUEUE + [382] = "%.f", -- lamp_FIRE_RENG_1_QUEUE + [383] = "%.f", -- lamp_FIRE_KO50_1_QUEUE + [384] = "%.f", -- lamp_FIRE_REDUCT_1_QUEUE + [385] = "%.f", -- lamp_FIRE_LENG_2_QUEUE + [386] = "%.f", -- lamp_FIRE_RENG_2_QUEUE + [387] = "%.f", -- lamp_FIRE_KO50_2_QUEUE + [388] = "%.f", -- lamp_FIRE_REDUCT_2_QUEUE + [398] = "%.f", -- lamp_CHECK_SENSORS + [407] = "%.f", -- lamp_HYDRO_main_on + [408] = "%.f", -- lamp_HYDRO_aux_on + [414] = "%.f", -- lamp_APD9_on + [416] = "%.f", -- lamp_APD9_oil_pressure + [417] = "%.f", -- lamp_APD9_rpm + [418] = "%.f", -- lamp_APD9_rpm_high + [420] = "%.f", -- lamp_APD_on + [424] = "%.f", -- lamp_APD_starter_on + [434] = "%.f", -- lamp_FUEL_left_closed + [435] = "%.f", -- lamp_FUEL_right_closed + [436] = "%.f", -- lamp_FUEL_ring_closed + [441] = "%.f", -- lamp_FUEL_center_on + [442] = "%.f", -- lamp_FUEL_left_on + [443] = "%.f", -- lamp_FUEL_right_on + [461] = "%.f", -- lamp_HEATER + [462] = "%.f", -- lamp_IGNITION + [463] = "%.f", -- lamp_KO50_ON + [341] = "%.f", -- lamp_LEFT_PITOT_HEATER_OK + [490] = "%.f", -- lamp_RIGHT_PITOT_HEATER_OK + [509] = "%.f", -- lamp_LEFT_PZU_ON + [510] = "%.f", -- lamp_RIGHT_PZU_ON + [504] = "%.f", -- lamp_ELEC_turn_VU1 + [505] = "%.f", -- lamp_ELEC_turn_VU2 + [506] = "%.f", -- lamp_ELEC_turn_VU3 + [507] = "%.f", -- lamp_ELEC_DC_ground + [508] = "%.f", -- lamp_ELEC_test_equipment + [543] = "%.f", -- lamp_ELEC_gen1_fail + [544] = "%.f", -- lamp_ELEC_gen2_fail + [545] = "%.f", -- lamp_ELEC_AC_ground + [546] = "%.f", -- lamp_ELEC_PO_500 + [86] = "%.f", -- lamp_CIRCUIT_FROM_BATTERY + [68] = "%.f", -- lamp_CLOG_TF_LEFT + [69] = "%.f", -- lamp_CLOG_TF_RIGHT + [70] = "%.f", -- lamp_CHIP_LEFT_ENG + [71] = "%.f", -- lamp_CHIP_RIGHT_ENG + [72] = "%.f", -- lamp_VIBRATION_LEFT_HIGH + [73] = "%.f", -- lamp_VIBRATION_RIGHT_HIGH + [74] = "%.f", -- lamp_FIRE + [76] = "%.f", -- lamp_LEFT_ENG_TURN_OFF + [77] = "%.f", -- lamp_RIGHT_ENG_TURN_OFF + [78] = "%.f", -- lamp_FT_LEFT_HIGH + [79] = "%.f", -- lamp_FT_RIGHT_HIGH + [80] = "%.f", -- lamp_OIL_PRESSURE_LEFT + [81] = "%.f", -- lamp_OIL_PRESSURE_RIGHT + [82] = "%.f", -- lamp_ER_LEFT + [83] = "%.f", -- lamp_ER_RIGHT + [84] = "%.f", -- lamp_EEC_LEFT_OFF + [85] = "%.f", -- lamp_EEC_RIGHT_OFF + [873] = "%.f", -- lamp_CHIP_MAIN_REDUCTOR + [874] = "%.f", -- lamp_CHIP_INTER_REDUCTOR + [875] = "%.f", -- lamp_CHIP_TAIL_REDUCTOR + [64] = "%.f", -- lamp_300_Left + [65] = "%.f", -- lamp_DISS_OFF + [555] = "%.f", -- lamp_BD1 + [556] = "%.f", -- lamp_BD2 + [557] = "%.f", -- lamp_BD3 + [558] = "%.f", -- lamp_BD4 + [559] = "%.f", -- lamp_BD5 + [560] = "%.f", -- lamp_BD6 + [711] = "%.f", -- lamp_BD1Bomb + [712] = "%.f", -- lamp_BD2Bomb + [713] = "%.f", -- lamp_BD3Bomb + [714] = "%.f", -- lamp_BD4Bomb + [715] = "%.f", -- lamp_BD5Bomb + [716] = "%.f", -- lamp_BD6Bomb + [562] = "%.f", -- lamp_PUS1 + [563] = "%.f", -- lamp_PUS3 + [564] = "%.f", -- lamp_PUS4 + [565] = "%.f", -- lamp_PUS6 + [561] = "%.f", -- lamp_EmergExplode + [705] = "%.f", -- lamp_EmergExplodeSec + [710] = "%.f", -- lamp_BV_Net_On + [566] = "%.f", -- lamp_RS_Net_On + [567] = "%.f", -- lamp_GUV_Net_On + --[] = "%.f", -- lamp_MV_Net_On + [568] = "%.f", -- lamp_FKP_On + [778] = "%.f", -- lamp_Caution_Weap + --[] = "%.f", -- lamp_LeftSignal + --[] = "%.f", -- lamp_RightSignal + [586] = "%.f", -- lamp_Caution_Weap1 + [587] = "%.f", -- lamp_Caution_Weap2 + [588] = "%.f", -- lamp_Caution_Weap3 + [306] = "%.f", -- lamp_Record_P503B + [302] = "%.f", -- lamp_IFF_KD + [303] = "%.f", -- lamp_IFF_KP + [912] = "%.f", -- lamp_IFF_TurnOnReserve + [87] = "%.f", -- lamp_IFF_Failure + -- Lights system + --------------------------------------------------------------- + [880] = "%.f", -- RedLightLhGr1 {1.0, 0.0} + [896] = "%.f", -- RedLightLhGr2 {1.0, 0.0} + [897] = "%.f", -- RedLightRhGr1 {1.0, 0.0} + [898] = "%.f", -- RedLightRhGr2 {1.0, 0.0} + [899] = "%.f", -- RedLightChGr1 {1.0, 0.0} + [901] = "%.f", -- RedLightChGr2 {1.0, 0.0} + [922] = "%.f", -- RedLightChGr12 {1.0, 0.0} + [902] = "%.f", -- RedLight5V5 {1.0, 0.0} + [900] = "%.f", -- PlafondBrightness {1.0, 0.0} + [547] = "%.f", -- LeftPlafond {1.0, 0.0} + [665] = "%.f", -- RightPlafond {1.0, 0.0} + [920] = "%.f" -- RecorderP503B_PanelLightness {1.0, 0.0} +} +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + -- ELEC_INTERFACE + --[536] = "%.1f", -- PTR-EEP-LVR-ADJV1 (AC Voltage 1 set rotary) {-1, 1} + --[537] = "%.1f", -- PTR-EEP-LVR-ADJV2 (AC Voltage 2 set rotary) {-1, 1} + [538] = "%1d", --PTR-EEP-TMB-GEN1 (Generator 1) + [539] = "%1d", --PTR-EEP-TMB-GEN2 (Generator 2) + [540] = "%1d", --PTR-EEP-TMB-AER (AC ground power) + [541] = "%1d", --PTR-EEP-TMB-PO (115V Inverter) + [542] = "%1d", --PTR-EEP-TMB-PT (36V Inverter) + [535] = "%.1f", --PTR-EEP-LVR-MODE (AC Mode), 11 degrees + [494] = "%.1f", --PTR-RSPE-LVR-FEEDMODE (DC Bus Selector), 8 degrees + + [495] = "%1d", --PTR-RSPE-TMB-AKK1 (Battery 1) + [496] = "%1d", --PTR-RSPE-TMB-AKK2 (Battery 2) + [497] = "%1d", --PTR-RSPE-TMB-RESGEN (Standby Generator) + --[498] = "%.1f", -- PTR-RSPE-LVR-V (DC Voltage set rotary) {-1, 1} + [499] = "%1d", --PTR-RSPE-TMB-RECT1 (Rectifier 1) + [500] = "%1d", --PTR-RSPE-TMB-RECT2 (Rectifier 2) + [501] = "%1d", --PTR-RSPE-TMB-RECT3 (Rectifier 3) + [502] = "%1d", --PTR-RSPE-TMB-AERF (DC ground power) + [503] = "%1d", --PTR-RSPE-TMB-TESTEQU (Equipment Test) + + [147] = "%1d", --PTR-APP-CVR-CIRC (Standby Rectifier Cover) + [148] = "%1d", --PTR-APP-TMB-CIRC (Standby Rectifier) + [149] = "%1d", --PTR-APP-TMB-TRNS (36V Transformer) + + [498] = "%.4f", --PTR-RSPE-LVR-V (Standby Generator Voltage Adjustment Rheostat) + [536] = "%.4f", --PTR-EEP-LVR-ADJV1 (Generator 1 Voltage Adjustment Rheostat) + [537] = "%.4f", --PTR-EEP-LVR-ADJV2 (Generator 2 Voltage Adjustment Rheostat) + [522] = "%.4f", --PTR-RSPE-TMB-WRMAKK (Battery Heating Switch, ON/OFF) + + [590] = "%1d", --PTR-LAZS-TMB-BV-ZSBR (BW ESBR) + [591] = "%1d", --PTR-LAZS-TMB-BV-EXP (Explode) + [592] = "%1d", --PTR-LAZS-TMB-BV-DIR (Control) + [593] = "%1d", --PTR-LAZS-TMB-BV-EQU (Equipment) + [594] = "%1d", --PTR-LAZS-TMB-RSGUV-FIRE (RS/GUV Fire) + [595] = "%1d", --PTR-LAZS-TMB-RSGUV-SIGN (RS/GUV Warning) + [596] = "%1d", --PTR-LAZS-TMB-RSGUV-WARM (ESBR Heating) + + [597] = "%1d", --PTR-LAZS-TMB-311 (GUV Out 800 Left) + [598] = "%1d", --PTR-LAZS-TMB-GUOUT-800L (GUV Out 800 Left) + [599] = "%1d", --PTR-LAZS-TMB-GUOUT-800R (GUV Out 800 Right) + [600] = "%1d", --PTR-LAZS-TMB-GUOUTL-622L (GUV In Left 622 Left) + [601] = "%1d", --PTR-LAZS-TMB-GUOUTL-622R (GUV In Left 622 Right) + [602] = "%1d", --PTR-LAZS-TMB-GUOUTR-622L (GUV In Right 622 Left) + [603] = "%1d", --PTR-LAZS-TMB-GUOUTR-622R (GUV In Rignt 622 Right) + + [604] = "%1d", --PTR-LAZS-TMB-ES-800L (Electric Launch 800 Left) + [605] = "%1d", --PTR-LAZS-TMB-ES-622R (Electric Launch 800 Right) + [606] = "%1d", --PTR-LAZS-TMB-PKT (PKT) + [607] = "%1d", --PTR-LAZS-TMB-JETBOMB (Emergency Jettison) + [608] = "%1d", --PTR-LAZS-TMB-JETPWR (Power Jettison) + [609] = "%1d", --PTR-LAZS-TMB-JETEXPL (Emergency Jettison) + [610] = "%1d", --PTR-LAZS-TMB-JETRCKT (Alarm rockets) + + [611] = "%1d", --PTR-RAZS-TMB-START-TRBON (CB APU start) + [612] = "%1d", --PTR-RAZS-TMB-START-TRBIGN (CB APU ignition) + [613] = "%1d", --PTR-RAZS-TMB-START-ENGON (CB Engine start) + [614] = "%1d", --PTR-RAZS-TMB-START-ENGIGN (CB Engine ignition) + [615] = "%1d", --PTR-RAZS-TMB-RPM (CB RPM CONTROL) + [616] = "%1d", --PTR-NONAME (CB NONAME) + [617] = "%1d", --PTR-SW-LOCKER-BASE (CB Lock Opening Control Main) + [618] = "%1d", --PTR-SW-LOCKER-RES (CB Lock Opening Control Reserve) + [619] = "%1d", --PTR-RAZS-TMB-TURN (CB TURN INDICATOR) + + [629] = "%1d", --PTR-RAZS-TMB-TSCOCK-ON (CB Bypass) + [630] = "%1d", --PTR-RAZS-TMB-TSCOCK-L (CB Left valve) + [631] = "%1d", --PTR-RAZS-TMB-TSCOCK-R (CB Right valve) + [632] = "%1d", --PTR-RAZS-TMB-TSCOUNT (CB Fuelmeter) + [633] = "%1d", --PTR-RAZS-TMB-TSPMP-C (CB Center tank) + [634] = "%1d", --PTR-RAZS-TMB-TSPMP-L (CB Left pump) + [635] = "%1d", --PTR-RAZS-TMB-TSPMP-R (CB Right pump) + [636] = "%1d", --PTR-RAZS-TMB-T819 (CB T-819) + [637] = "%1d", --PTR-RAZS-TMB-SPPU52 (CB SPUU-52) + + [647] = "%1d", --PTR-RAZS-TMB-HLGT-DIR-L (SPOT CONTROL LEFT) + [648] = "%1d", --PTR-RAZS-TMB-HLGT-ON-L (SPOT ON LEFT) + [649] = "%1d", --PTR-RAZS-TMB-HLGT-DIR-R (SPOT CONTROL RIGHT) + [650] = "%1d", --PTR-RAZS-TMB-HLGT-ON-R (SPOT ON RIGHT) + [651] = "%1d", --PTR-RAZS-TMB-ANO (ANO) + [652] = "%1d", --PTR-RAZS-TMB-WNGLGT (WING LIGHTS) + [653] = "%1d", --PTR-RAZS-TMB-LAMPTEST (CHECK LAMPS/FLASHER) + --[654] = "%1d", -- PTR-RAZS-TMB-DIRMAIN (LOCK MAIN) + --[655] = "%1d", -- PTR-RAZS-TMB-DIRDUB (LOCK SPARE) + [918] = "%1d", --PTR-SW-LIGHT-PRF4-LEFT (CB PRF-4 Light Left) + [919] = "%1d", --PTR-SW-LIGHT-PRF4-RIGHT (CB PRF-4 Light Right) + + [620] = "%1d", --PTR-RAZS-TMB-APMAIN (CB Autopilot MAIN) + [621] = "%1d", --PTR-RAZS-TMB-APFRICT (CB Autopilot Frict) + [622] = "%1d", --PTR-RAZS-TMB-APELCT (CB Autopilot Clutch) + [623] = "%1d", --PTR-RAZS-TMB-GSMAIN (CB Hydro Main) + [624] = "%1d", --PTR-RAZS-TMB-GSDBL (CB Hydro Aux) + [625] = "%1d", --PTR-RAZS-TMB-RADSPU (CB SPU (Intercom)) + [626] = "%1d", --PTR-RAZS-TMB-RADALT (CB Radio Altimeter) + [627] = "%1d", --PTR-RAZS-TMB-RADCOMM (CB Command Radio Station (R-863)) + [628] = "%1d", --PTR-RAZS-TMB-RADRS (CB 6201) + + [638] = "%1d", --PTR-RAZS-TMB-PPSSIGN (CB Signalization) + [639] = "%1d", --PTR-RAZS-TMB-PPSQUE1-L (CB 1 Queue Left) + [640] = "%1d", --PTR-RAZS-TMB-PPSQUE1-R (CB 1 Queue Right) + [641] = "%1d", --PTR-RAZS-TMB-PPSQUE2-L (CB 2 Queue Left) + [642] = "%1d", --PTR-RAZS-TMB-PPSQUE2-R (CB 2 Queue Right) + [643] = "%1d", --PTR-RAZS-TMB-RADCMP-SV (CB Radio Compass MW(ARC-9)) + [644] = "%1d", --PTR-RAZS-TMB-RADCMP-UKV (CB Radio Compass VHF(ARC-UD)) + [645] = "%1d", --PTR-RAZS-TMB-RADDISS (CB Doppler Navigator) + [646] = "%1d", --PTR-RAZS-TMB-RADRNTG (CB Radio Meter) + + [656] = "%1d", --PTR-RAZS-TMB-POSDIR (CONTROL) + [657] = "%1d", --PTR-RAZS-TMB-POSPZUENG-L (LEFT ENGINE) + [658] = "%1d", --PTR-RAZS-TMB-POSPZUENG-R (RIGHT ENGINE) + [659] = "%1d", --PTR-RAZS-TMB-POSRIO3 (RIO-3) + [660] = "%1d", --PTR-RAZS-TMB-POSGLS (WINDOW) + [661] = "%1d", --PTR-RAZS-TMB-WIPER-L (LEFT ENGINE) + [662] = "%1d", --PTR-RAZS-TMB-WIPER-R (RIGHT ENGINE) + [663] = "%1d", --PTR-RAZS-TMB-L1800 (RIO-3) + [664] = "%1d", --PTR-RAZS-TMB-KO50 (WINDOW) + + [882] = "%1d", --PTR-GRAZS-1 (CB Group 1) + [883] = "%1d", --PTR-GRAZS-2 (CB Group 4) + [884] = "%1d", --PTR-GRAZS-3 (CB Group 7) + [885] = "%1d", --PTR-GRAZS-4 (CB Group 2) + [886] = "%1d", --PTR-GRAZS-5 (CB Group 5) + [887] = "%1d", --PTR-GRAZS-6 (CB Group 8) + [888] = "%1d", --PTR-GRAZS-7 (CB Group 3) + [889] = "%1d", --PTR-GRAZS-8 (CB Group 6) + [890] = "%1d", --PTR-GRAZS-9 (CB Group 9) + ------------------------------------------------------------- + -- FUELSYS INTERFACE + [438] = "%1d", --PTR-CPE-TMB-PUMP-RATE (Service tank pump) + [439] = "%1d", --PTR-CPE-TMB-PUMPTNK-L (Left fuel tank pump) + [440] = "%1d", --PTR-CPE-TMB-PUMPTNK-R (Right fuel tank pump) + [427] = "%1d", --PTR-CPE-TMB-PUMP-L (Left Engine Shutoff Valve) + [429] = "%1d", --PTR-CPE-TMB-PUMP-R (Right Engine Shutoff Valve) + [426] = "%1d", --PTR-CPE-CVR-PUMP-L (Left Engine Shutoff Valve Cover) + [428] = "%1d", --PTR-CPE-CVR-PUMP-R (Right Engine Shutoff Valve Cover) + [431] = "%1d", --PTR-CPE-TMB-PUMP-RING (Crossfeed) + [430] = "%1d", --PTR-CPE-CVR-PUMP-RING (Crossfeed Cover) + + [433] = "%1d", --PTR-CPE-TMB-PUMP-PASS (Bypass) + [432] = "%1d", --PTR-CPE-CVR-PUMP-PASS (Bypass Cover) + [437] = "%.1f", --PTR-CPE-TMB-PUMP-CONTR (Refueling Control Switch) + ------------------------------------------------------------- + -- ENGINE INTERFACE + [412] = "%1d", --PTR-CPE-TMB-TURBOSTART-ST (APU start mode) + [413] = "%1d", --PTR-CPE-BTN-TURBOSTART-ON (APU start) + [415] = "%1d", --PTR-CPE-BTN-TURBOSTART-OFF (APU stop) + + [419] = "%1d", --PTR-CPE-BTN-ENGSTART-ON (Engine start ON) + [421] = "%1d", --PTR-CPE-BTN-ENGSTART-OFF (Engine start OFF) + [422] = "%1d", --PTR-CPE-TMB-ENGSTART-LFTRGT (Select engine) + [423] = "%1d", --PTR-CPE-TMB-ENGSTART-ROLL (Engine start mode) + [425] = "%1d", -- PTR-CPE-BTN-ENGSTART-TEST (Engine ignition check) + + [204] = "%1d", --PTR-ENGSTOP-ARM-L (Left engine stop) + [206] = "%1d", --PTR-ENGSTOP-ARM-R (Right engine stop) + [208] = "%1d", --PTR-VINTBRAKE-ARM (Rotor brake) + + [310] = "%1d", --PTR-LSPE-BTN-CONTR-IV500 (Vibration Sensor Test) + [311] = "%1d", --PTR-LSPE-BTN-CONTR-GRND (Temperature Sensor Test Cold) + [312] = "%1d", --PTR-LSPE-BTN-CONTR-AIR (Temperature Sensor Test Hot) + [313] = "%1d", --PTR-LSPE-BTN-CONTR-RTL (Temperature Regulator Test Left) + [314] = "%1d", --PTR-LSPE-BTN-CONTR-RTR (Temperature Regulator Test Right) + + [202] = "%1d", --PTR-STKSGR-TMB-RPM-LEFT + [867] = "%1d", --PTR-STKSGR-TMB-RPM-RIGHT + --[0] = "%.4f", --PTR-STKSEC-ARM-L (Left Engine Throttle) + --[0] = "%.4f", --PTR-STKSEC-ARM-R (Right Engine Throttle) + --[0] = "%.4f", --PKT-TROTTLE_L (Left Collective / Throttle) + --[0] = "%.4f", --PKT-TROTTLE_R (Right Collective / Throttle) + + [167] = "%1d", --PTR-APP-TMB-ERD-L (EEC Left) + [173] = "%1d", --PTR-APP-TMB-ERD-R (EEC Right) + [168] = "%1d", --PTR-APP-TMB-CHR-L (ER Left) + [172] = "%1d", --PTR-APP-TMB-CHR-R (ER Right) + [169] = "%1d", --PTR-APP-TMB-ST-L (FT Check Left) + [171] = "%1d", --PTR-APP-TMB-ST-R (FT Check Right) + [170] = "%1d", --PTR-APP-TMB-TKLR (CT check) + ------------------------------------------------------------- + -- HYDRO SYS INTERFACE + [406] = "%1d", --PTR-CPE-TMB-HYDRO-MAIN (Main Hydro) + [410] = "%1d", --PTR-CPE-TMB-HYDRO-DBL (Aux Hydro) + [409] = "%1d", --PTR-CPE-CVR-HYDRO-DBL (Aux Hydro Cover) + [411] = "%1d", --PTR-CPE-BTN-DBLOFF (Aux Hydro Off) + ------------------------------------------------------------- + -- AUTOPILOT + [134] = "%1d", --PTR-APP-BTN-DIRON (Autopilot Heading ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button + [868] = "%.4f", --PTR-APP-BTN-DIRON (Autopilot Heading ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis + [135] = "%1d", --PTR-APP-BTN-DIROFF (Autopilot Heading OFF/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button + [869] = "%.4f", --PTR-APP-BTN-DIROFF (Autopilot Heading OFF/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis + + [138] = "%1d", --PTR-APP-BTN-KTON (Autopilot Pitch/Roll ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button + [870] = "%.4f", --PTR-APP-BTN-KTON (Autopilot Pitch/Roll ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis + [144] = "%1d", --PTR-APP-BTN-ALTON (Autopilot Altitude ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button + [871] = "%.4f", --PTR-APP-BTN-ALTON (Autopilot Altitude ON/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis + [145] = "%1d", --PTR-APP-BTN-ALTOFF (Autopilot Altitude OFF/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Button + [872] = "%.4f", --PTR-APP-BTN-ALTOFF (Autopilot Altitude OFF/Lamp Intensity. Rotate mouse wheel to set lamp intensity), Axis + + [146] = "%1d", --PTR-APP-BTN-CONTR (Autopilot Altitude Channel Control) + + [136] = "%.4f", --PTR-APP-LVR-DIR (Autopilot Heading Adjustment) + [140] = "%.4f", --PTR-APP-LVR-K (Autopilot Roll Adjustment) + [142] = "%.4f", --PTR-APP-LVR-T (Autopilot Pitch Adjustment) + + [183] = "%1d", --PTR-AUTOPILOT-OFF-L (Autopilot Off Left Button) + [226] = "%1d", --PTR-AUTOPILOT-OFF-R (Autopilot Off Right Button) + ------------------------------------------------------------- + -- RADAR ALTIMETER + [32] = "%1d", --PTR-ALTR-LVR-TEST (Radio altimeter test) + [29] = "%.4f", --PTR-ALTR-LVR-SET (Dangerous RALT set rotary) {0, 1} + [35] = "%1d", --PTR-ALTR-TMB-ONOFF (Radar Altimeter Power) + ------------------------------------------------------------- + -- BAR ALTIMETER + [18] = "%.4f", --PTR-ALTB-LVR-SET (Baro pressure QFE knob) + [97] = "%.4f", --PTR-ALTB-LVR-SET-R (Baro pressure QFE knob) + ------------------------------------------------------------- + -- VARIOMETER + [17] = "%.4f", --PTR-VARIO-LVR-SET-L (Variometer adjustment knob) + [96] = "%.4f", --PTR-VARIO-LVR-SET-R (Variometer adjustment knob) + ------------------------------------------------------------- + --HSI + [26] = "%.4f", --PTR-PNP-LVR-SET (HSI Course set knob) + [858] = "%1d", --PTR-ARKSV-ARKUKV (HSI ARC-9/ARC-UD Select) + + [102] = "%.4f", --PTR-PNP-LVR-SET-R (HSI Course set knob) + ------------------------------------------------------------- + -- FUELSYS INTERFACE + [61] = "%.1f", --PTR-FUEL-LVR-MODE (Fuel meter switch) + ------------------------------------------------------------- + -- WEAPON SYS + [921] = "%1d", --PTR-SAFE-WEAPON (Weapon Safe-Armed) + [707] = "%1d", --PTR-ADDPBV-TMB-EMRGEXP (Emergency Explode) + [706] = "%1d", --PTR-ADDPBV-CVR-EMRGEXP (Emergency Explode Cover) + + [709] = "%1d", --PTR-ADDPBV-TMB-EMRGJET (Emergency Release) + [708] = "%1d", --PTR-ADDPBV-CVR-EMRGJET (Emergency Release Cover) + + [717] = "%1d", --PTR-ADDPBV-TMB-MAINOFF (Main Bombs) + [718] = "%1d", --PTR-ADDPBV-BTN-LAMPTEST (Lamps Check) + + [719] = "%.1f", --PTR-ADDPBV-LVR-MODE (Pod Variants) + [720] = "%1d", --PTR-ADDPBV-TMB-WARM (ESBR Heat) + + [730] = "%.4f", --PTR-ADDESBR-LVR-MODE (ESBR Position) + [731] = "%1d", --PTR-ADDESBR-LVR-ONOFF (ESBR On/Off) + + [570] = "%1d", --PTR-LAZS-TMB-EMRGEXP (Emergency Explode) + [572] = "%1d", --PTR-LAZS-TMB-EMRGJET (Emergency Release) + [569] = "%1d", --PTR-LAZS-CVR-EMRGEXP (Emergency Explode Cover) + [571] = "%1d", --PTR-LAZS-CVR-EMRGJET (Emergency Release Cover) + + --[573] = "%1d", -- PTR-LAZS-TMB-MAINOFF (Main On/Off) + [575] = "%1d", --PTR-LAZS-TMB-RSGUV (RS/GUV Selector) + [576] = "%1d", --PTR-LAZS-BTN-LAMPTEST (Lamps Check) + [574] = "%1d", --PTR-LAZS-BTN-ENTER (PUS Arming) + + [342] = "%1d", --PTR-LPE-TMB-SHOOT1 (8/16/4) + [343] = "%1d", --PTR-LPE-TMB-SHOOT2 (1256/AUTO/34) + [344] = "%1d", --PTR-LPE-TMB-RS (UPK/PKT/RS) + [345] = "%1d", --PTR-LPE-TMB-GUV (CUTOFF) + [349] = "%1d", --PTR-LAZS-TMB-MAINOFF05 (800_or_624_622_800) + [348] = "%1d", --PTR-LAZS-CVR-EMRGEXP01 (800 or 624_622_800 Cover) + + [347] = "%.4f", --PTR-LPE-TMB-VAR (In800Out/800inOr624/622) + + [346] = "%.4f", --PTR-LPE-LVR-SHELL (Burst length) + + [350] = "%.4f", --PTR-LPE-TMB-PYRO-L (PYROCARTRIDGE Left) + [351] = "%.4f", --PTR-LPE-TMB-PYRO-R (PYROCARTRIDGE Right) + + [573] = "%1d", --PTR-LAZS-TMB-MAINOFF (Mine Arms Main Switch) + [905] = "%1d", --PTR-RSPE-TMB-PKT (PKT Selector Switch) + ------------------------------------------------------------- + -- SYS CONTROLLER + [523] = "%1d", --PTR-RSPE-TMB-WINK (FLASHER) + [525] = "%1d", --PTR-RSPE-TMB-TAB (Transparent Day/Night) + [150] = "%1d", --PTR-APP-TMB-TEST (CHECK LAMPS/FLASHER) + ------------------------------------------------------------- + -- SPUU-52 + [332] = "%1d", --PTR-LES-TMB-SPPU52 (SPUU-52 Power) + [127] = "%1d", --PTR-APP-BTN-OFF (SPUU-52 Control Engage) + [129] = "%1d", --PTR-APP-TMB-RT (SPUU-52 Control (Left button - P. Right button - t)) + [128] = "%.4f", --PTR-APP-LVR-ADJ (SPUU 52 Control Adjustment) + ------------------------------------------------------------- + -- FIRE EXTING INTERFACE + [389] = "%1d", --PTR-CPE-BTN-QUE1-1 (Main Discharge L ENG) + [390] = "%1d", --PTR-CPE-BTN-QUE1-2 (Main Discharge R ENG) + [391] = "%1d", --PTR-CPE-BTN-QUE1-3 (Main Discharge KO-50) + [392] = "%1d", --PTR-CPE-BTN-QUE1-4 (Main Discharge APU GEAR) + [393] = "%1d", --PTR-CPE-BTN-QUE2-1 (Alternate Discharge L ENG) + [394] = "%1d", --PTR-CPE-BTN-QUE2-2 (Alternate Discharge R ENG) + [395] = "%1d", --PTR-CPE-BTN-QUE2-3 (Alternate Discharge KO-50) + [396] = "%1d", --PTR-CPE-BTN-QUE2-4 (Alternate Discharge APU GEAR) + [397] = "%1d", --PTR-CPE-BTN-FIRE-OFF (Turn Off Fire Signal) + + [399] = "%1d", --PTR-CPE-TMB-CONTR-FIRE (Fire Detector Test) + [400] = "%1d", --PTR-CPE-TMB-CONTR-PYRO (Squib Test) + [401] = "%.1f", --PTR-CPE-LVR-CONTR-MODE (Check Fire circuits) + ------------------------------------------------------------- + -- ENGINE INTERFACE + [353] = "%1d", --PTR-LPE-TMB-MANAUT (AUTO-MANUAL) + [354] = "%1d", --PTR-LPE-BTN-OVR (GENERAL OFF) + [355] = "%1d", --PTR-LPE-TMB-PZU-L (LEFT ENGINE) + [356] = "%1d", --PTR-LPE-TMB-PZU-R (RIGHT ENGINE) + [357] = "%1d", --PTR-LPE-TMB-GLASS (WINDOW) + [358] = "%1d", --PTR-LPE-TMB-RIO (Ice Detector Heater) + [359] = "%1d", --PTR-LPE-BTN-RIOCONTR (Ice Detector Heater Test) + [372] = "%.1f", --PTR-LPE-LVR-FEEDMODE (Anti Ice Sections Current) + + [519] = "%1d", --PTR-RSPE-TMB-WRMPVD-L (Left Pitot Heater) + [520] = "%1d", --PTR-RSPE-TMB-WRMPVD-R (Right Pitot Heater) + [339] = "%1d", --PTR-LES-BTN-CONTRPVD (Left Pitot Heater Control) + [482] = "%1d", --PTR-LES-BTN-CONTRPVD01 (Right Pitot Heater Control) + ------------------------------------------------------------- + -- DISS 15 + [483] = "%1d", --PTR-RES-TMB-DISS (Doppler Navigator, Power) + [818] = "%1d", --PTR-DISS-BTN-OFF (Turn Off Coordinates Calculator) + [819] = "%1d", --PTR-DISS-BTN-ON (Turn On Coordinates Calculator) + [815] = "%1d", --PTR-DISS-BTN-MINUS (Decrease Map Angle) + [816] = "%1d", --PTR-DISS-BTN-PLUS (Increase Map Angle) + [809] = "%1d", --PTR-DISS-BTN-N (Decrease Path KM) + [810] = "%1d", --PTR-DISS-BTN-V (Increase Path KM) + [803] = "%1d", --PTR-DISS-BTN-TOLE (Decrease Deviation KM) + [804] = "%1d", --PTR-DISS-BTN-TORI (Increase Deviation KM) + [826] = "%.1f", --PTR-IND-DISS-SELECTOR (Mode Switch) + [797] = "%1d", --PTR-DISS-SELECTOR-KR (Test/Work) + [798] = "%1d", --PTR-DISS-SELECTOR-SM (Land/Sea) + ------------------------------------------------------------- + -- ADI + [487] = "%1d", --PTR-RES-TMB-AG (Right Attitude Indicator Power) + [335] = "%1d", --PTR-LES-TMB-AG (Left Attitude Indicator Power) + [11] = "%1d", --PTR-AGB-LVR-KNOB (Left Attitude Indicator Cage) + [10] = "%.4f", --PTR-AGB-LVR-SET (Left Attitude Indicator Zero pitch trim) + [90] = "%1d", --PTR-AGB-LVR-KNOB-R (Right Attitude Indicator Cage) + [89] = "%.4f", --PTR-AGB-LVR-SET-R (Right Attitude Indicator Zero pitch trim) + ------------------------------------------------------------- + -- + [336] = "%1d", --PTR-LES-TMB-VK53 (VK-53, Power) + ------------------------------------------------------------- + -- GMK1A + [485] = "%1d", --PTR-RES-TMB-GMK (GMC Power) + [470] = "%1d", --PTR-RPE-LVR-CRDNS (GMC Hemisphere Selection) + [472] = "%1d", --PTR-RPE-LVR-CRDMK (GMC Mode (MC, DG, AC(N/F))) + [476] = "%.1f", --PTR-RPE-LVR-CRDCONTR (GMC Control (Left - 0, Right - 300)) {-1.0,0.0,1.0} + [477] = "%.1f", --PTR-RPE-LVR-CRDZK (GMC Course Setting (Left - CCW, Right - CW)) {-1.0,0.0,1.0} + [474] = "%.4f", --PTR-RPE-LVR-CRDLAT (GMC Latitude Selection) + ------------------------------------------------------------- + -- ENGINE INTERFACE + [517] = "%1d", --PTR-RSPE-TMB-PZUENG-L (Dust Protection Left) + [518] = "%1d", --PTR-RSPE-TMB-PZUENG-R (Dust Protection Right) + ------------------------------------------------------------- + -- Nav Lights System + [513] = "%1d", --PTR-RSPE-TMB-ANO (ANO) + [514] = "%1d", --PTR-RSPE-TMB-LGTWING (Formation Lights) + [515] = "%1d", --PTR-RSPE-TMB-LGTCONT (Tip Lights) + [516] = "%1d", --PTR-RSPE-TMB-BEAC (Strobe Light) + [322] = "%1d", --PTR-LSPE-TMB-AIR-CODE (ANO code) + [836] = "%1d", --PTR-LEFT-TAXI-L-SW (Taxi Light) + [837] = "%1d", --PTR-LEFT-TAXI-L-POS-SW (Left Landing Light) + [838] = "%1d", --PTR-LEFT-TAXI-R-POS-SW (Right Landing Light) + ------------------------------------------------------------- + -- Lights System + [333] = "%1d", --PTR-LES-TMB-PLF (Left Ceiling Light) + [489] = "%1d", --PTR-RES-TMB-PLF (Right Ceiling Light) + [479] = "%1d", --PTR-RES-TMB-LGT (5.5V Lights) + [280] = "%.4f", --PTR-LSPE-LVR-REDGRP1 (Lh RedLights Brightness Rst gr.1) {0.0, 1.0} + [281] = "%.4f", --PTR-LSPE-LVR-REDGRP2 (Lh RedLights Brightness Rst gr.2) {0.0, 1.0} + [491] = "%.4f", --PTR-RSPE-LVR-REDGRP1 (Rh RedLights Brightness Rst gr.1) {0.0, 1.0} + [492] = "%.4f", --PTR-RSPE-LVR-REDGRP2 (Rh RedLights Brightness Rst gr.2) {0.0, 1.0} + [894] = "%.4f", --PTR-RSPE-LVR-REDGRP003 (Central RedLights Brightness Rst gr.1) {0.0, 1.0} + [895] = "%.4f", --PTR-RSPE-LVR-REDGRP004 (Central RedLights Brightness Rst gr.2) {0.0, 1.0} + [914] = "%.4f", --PTR-RSPE-LVR-REDGRP005 (5.5V Lights Brightness Rheostat) + [511] = "%1d", --PTR-RSPE-TMB-DUTY (Cargo Cabin Duty Lights Switc) + [512] = "%1d", --PTR-RSPE-TMB-ALL (Cargo Cabin Common Lights Switch) + ------------------------------------------------- + -- RADIO EQUIPMENT + -- SPU-7 + -- Left + [549] = "%.4f", --PTR-LAZS-LVR-ALL (Common Volume) + [548] = "%.4f", --PTR-LAZS-LVR-AUDIT (Listening Volume) + [553] = "%1d", --PTR-LAZS-TMB-RADSPU (Radio/ICS) + [551] = "%1d", --PTR-LAZS-TMB-CIRC (Network 1/2 (N/F)) + [552] = "%1d", --PTR-LAZS-BTN-CB (Circular Call (N/F)) + [550] = "%.1f", --PTR-LAZS-LVR-MODES (Radio Source (R-863/JADRO-1A/R-828/NF/ARC-9/ARC-UD)) + -- Right + [841] = "%.4f", --PTR-RAZS-LVR-ALL002 (Common Volume) + [840] = "%.4f", --PTR-RAZS-LVR-AUDIT002 (Listening Volume) + [845] = "%1d", --PTR-RAZS-TMB-RADSPU002 (Radio/ICS) + [843] = "%1d", --PTR-RAZS-TMB-CIRC002 (Network 1/2 (N/F)) + [846] = "%1d", --PTR-RAZS-BTN-CB002 (Circular Call (N/F)) + [842] = "%.1f", --PTR-RAZS-LVR-MODES002 (Radio Source (R-863/JADRO-1A/R-828/NF/ARC-9/ARC-UD)) + + --[194] = "%.4f", -- RADIO/ICS-1-PTR (Radio/ICS) + [480] = "%1d", --PTR-RES-TMB-LARING (Laryngophone) + ------------------------------------------------------------- + -- R-863 + [369] = "%1d", --PTR-LPE-TMB-COMAND (R-863, Select FM/AM) + [132] = "%1d", --PTR-APP-TMB-NU (R-863, Dial/Memory Unit) + [370] = "%1d", --PTR-LPE-LVR-CHANNEL (R-863, Radio channel selector) + + [155] = "%1d", --PTR-APP-TMB-PS (R-863, Squelch) + [156] = "%.4f", --PTR-APP-LVR-LEVEL (R-863, Volume) + + [163] = "%.4f", --PTR-APP-LVR-SEL1 (R-863, 10MHz rotary) {-0.1, 0.1} + [164] = "%.4f", --PTR-APP-LVR-SEL2 (R-863, 1MHz rotary) {-0.1, 0.1} + [165] = "%.4f", --PTR-APP-LVR-SEL3 (R-863, 100kHz rotary) {-0.1, 0.1} + [166] = "%.4f", --PTR-APP-LVR-SEL4 (R-863, 1kHz rotary) {-0.1, 0.1} + + [153] = "%1d", --PTR-APP-TMB-AP (R-863, Emergency Receiver On/Off (N/F)) + [154] = "%1d", --PTR-APP-TMB-RK (R-863, ARC (N/F)) + ------------------------------------------------------------- + -- R-828 + [735] = "%1d", --PTR-ADDSECPLT-LVR-CHNL (R-828 Radio channel selector) + + [737] = "%.4f", --PTR-ADDSECPLT-LVR-VOL (R-828 Radio volume) + [738] = "%1d", --PTR-ADDSECPLT-BTN-ASU (R-828 Radio Tuner button) + [739] = "%1d", --PTR-ADDSECPLT-TMB-PSH (R-828 Radio Squelch) + [756] = "%1d", --PTR-ADDSECPLT-TMB-P828 (R-828 Radio, Power) + [757] = "%1d", --PTR-ADDSECPLT-TMB-MODSEL (R-828 Radio, COMM/NAV) + ------------------------------------------------------------- + -- Jadro-1A + [484] = "%1d", --PTR-RES-TMB-RS (Jadro 1A, Power) + [745] = "%.4f", --PTR-ADDSECPLT-LVR-DIG12 (Jadro 1A, Frequency Selector, 1MHz) {-0.1, 0.1} + [746] = "%.4f", --PTR-ADDSECPLT-LVR-DIG3 (Jadro 1A, Frequency Selector, 100kHz) {-0.1, 0.1} + [747] = "%.4f", --PTR-ADDSECPLT-LVR-DIG4 (Jadro 1A, Frequency Selector, 10kHz) {-0.1, 0.1} + + [748] = "%.4f", --PTR-ADDSECPLT-LVR-DIG6 (Jadro 1A, Frequency Selector, Left mouse - 1kHz/ Right mouse - 100Hz) + [749] = "%.4f", --PTR-ADDSECPLT-LVR-DIG6 (Jadro 1A, Frequency Selector, Left mouse - 1kHz/ Right mouse - 100Hz) + + [744] = "%.1f", --PTR-ADDSECPLT-LVR-ONOFF (Jadro 1A, Mode OFF/OM/AM) + + [743] = "%.4f", --PTR-ADDSECPLT-LVR-VOLUM (Jadro 1A, Volume) + [741] = "%.4f", --PTR-ADDSECPLT-LVR-PSH (Jadro 1A, Squelch) + [742] = "%1d", --PTR-ADDSECPLT-TMB-CONTR (Jadro 1A, Control) + ------------------------------------------------------------- + -- RI-65 + [338] = "%1d", --PTR-LES-TMB-RK85 (RI-65) + [292] = "%1d", --PTR-LSPE-BTN-RI65-OFF (RI-65 OFF) + [293] = "%1d", --PTR-LSPE-BTN-RI65-RETRY (RI-65 Repeat) + [294] = "%1d", --PTR-LSPE-BTN-RI65-TEST (RI-65 Check) + [295] = "%1d", --PTR-LSPE-TMB-RI65-AMP (RI-65 Amplifier) + ------------------------------------------------------------- + -- ARC-UD + [456] = "%.1f", --PTR-RPE-LVR-ARKMODE (ARC-UD, Mode OFF/NARROW/WIDE/PULSE/RC) + [457] = "%.1f", --PTR-RPE-LVR-ARKMODE2 (ARC-UD, Channel) + + [453] = "%1d", --PTR-RPE-TMB-ARKSENS (ARC-UD, Sensitivity) + [454] = "%1d", --PTR-RPE-TMB-ARKUKV (ARC-UD, MW/DW) + + [672] = "%1d", --PTR-RPE-BTN-CONTR (ARC-UD, Control) + [673] = "%1d", --PTR-RPE-BTN-ANTL (ARC-UD, Ant. Left) + [674] = "%1d", --PTR-RPE-BTN-ANTR (ARC-UD, Ant. Right) + + [455] = "%.4f", --PTR-RPE-LVR-ARKVOL (ARC-UD, Volume) + [481] = "%1d", --PTR-RES-TMB-BLOCK (ARC-UD, Lock Switch) + ------------------------------------------------------------- + -- PKV Sight + [589] = "%.4f", --PTR-LAZS-LVR-AIMLGT (Sight Brightness) + + [855] = "%.4f", --PTR-PKV-ROTARY (Sight Limb) + + [856] = "%.4f", --PTR-PKV-DOUBLE (Sight Double) {1.0,-1.0} + + [903] = "%.1f", --PTR-PKV-GLASS-FILTER (PKV Filter) + -------------------------------------------------------------------------------- + -- CLOCK + [57] = "%1d", --PTR-WATCH-LVR-L (Mech clock left lever) + [58] = "%1d", --PTR-WATCH-LVR-L (Mech clock left lever) + + [59] = "%1d", --PTR-WATCH-LVR-R (Mech clock right lever) + [60] = "%1d", --PTR-WATCH-LVR-R (Mech clock right lever) + + [521] = "%1d", --PTR-RSPE-TMB-WRMWTCH (Clock Heating Switch) + -------------------------------------------------------------------------------- + [839] = "%.1f", --PTR-STAT-PRESS (Static Pressure System Mode (LEFT/COMMON/RIGHT)) + -------------------------------------------------------------------------------- + -- UV-26 CMD Control Panel + [910] = "%1d", --PTR-UV26-ONOFF (CMD Power) + [859] = "%1d", --PTR-UV26-BOARD (CMD Select Left/Both/Right board flares dispensers) + [913] = "%1d", --PTR-UV26-PROG (CMD Amount flares counter/Programming) + [914] = "%1d", --PTR-L45-BTN (CMD Num of sequences) + [862] = "%1d", --PTR-L68-BTN (CMD Dispense interval) + [863] = "%1d", --PTR-L8-BTN (CMD Num in sequence) + [866] = "%1d", --PTR-START-BTN (CMD Start dispense) + [911] = "%1d", --PTR-LSPE-BTN-UV26-START (Start/Stop dispense) + [864] = "%1d", --PTR-RESET-PROG-BTN (CMD Reset to default program) + [865] = "%1d", --PTR-STOP-BTN (CMD Stop dispense) + ------------------------------------------------ + -- CPTMECH + [215] = "%1d", --PTR-BLISTER-LOCK-L (Left blister open/close) + [216] = "%1d", --PTR-BLISTER-LOCK-R (Right blister open/close) + + [881] = "%1d", --PTR-WHEELBRK-ARM (Wheel Brakes) + + [910] = "%1d", --PTR-RSPE-TMB-WINK002 (Acceleration Reset) + + [334] = "%1d", --PTR-LES-TMB-VENT (Left Fan Switch) + [488] = "%1d", --PTR-RES-TMB-VENT (Right Fan Switch) + ------------------------------------------------ + -- ARC-9 + [469] = "%1d", --PTR-RPE-TMB-NEARFAR (ARC-9, Main/Backup Dialer) + [448] = "%.4f", --PTR-RPE-LVR-FRQVOLUME (ARC-9, Volume) + [444] = "%1d", --PTR-RPE-TMB-FRQTLG (ARC-9, TLF/TLG) + [446] = "%.1f", --PTR-RPE-LVR-FRQMODE (ARC-9, Mode OFF/COMP/ANT/LOOP) + [447] = "$.1f", --PTR-RPE-TMB-FRQFRAME (ARC-9, Loop Left/Right) + + [449] = "%.4f", --PTR-RPE-LVR-FRQADJRES (ARC-9, Backup Frequency Tune) + [675] = "%.2f", --PTR-RPE-LVR-FRQRES-SEC (ARC-9, Backup 100kHz rotary) + [450] = "%.2f", --PTR-RPE-LVR-FRQRES (ARC-9, Backup 10kHz rotary) + [451] = "%.4f", --PTR-RPE-LVR-FRQADJMAIN (ARC-9, Main Frequency Tune) + [678] = "%.2f", --PTR-RPE-LVR-FRQMAIN-SEC (ARC-9, Main 100kHz rotary) + [452] = "%.2f", --PTR-RPE-LVR-FRQMAIN (ARC-9, Main 10kHz rotary) + ------------------------------------------------ + -- External Cargo Equipment + [199] = "%1d", --PTR-STKSG-CVR-TACTJET (Tactical Cargo Release Button Cover) + [200] = "%1d", --PTR-STKSG-BTN-TACTJET (Tactical Cargo Release Button - Push to release) + [197] = "%1d", --PTR-STKSG-CVR-EMRGJET (Emergency Cargo Release Button Cover) + [198] = "%1d", --PTR-STKSG-BTN-EMRGJET (Emergency Cargo Release Button - Push to release) + [324] = "%1d", --PTR-LSPE-TMB-BRK-OUT (External Cargo Automatic Dropping) + ------------------------------------------------ + -- Signal Flares + [282] = "%1d", --PTR-LSPE-TMB-ALRMRKT1 (Signal Flares Cassette 1 Power Switch) + [283] = "%1d", --PTR-LSPE-TMB-ALRMRKT2 (Signal Flares Cassette 2 Power Switch) + [284] = "%1d", --PTR-LSPE-BTN-RCKT11 (Signal Flares Cassette 1 Launch Red Button) + [285] = "%1d", --PTR-LSPE-BTN-RCKT12 (Signal Flares Cassette 1 Launch Green Button) + [286] = "%1d", --PTR-LSPE-BTN-RCKT13 (Signal Flares Cassette 1 Launch Yellow Button) + [287] = "%1d", --PTR-LSPE-BTN-RCKT14 (Signal Flares Cassette 1 Launch White Button) + [288] = "%1d", --PTR-LSPE-BTN-RCKT21 (Signal Flares Cassette 2 Launch Red Button) + [289] = "%1d", --PTR-LSPE-BTN-RCKT22 (Signal Flares Cassette 2 Launch Green Button) + [290] = "%1d", --PTR-LSPE-BTN-RCKT23 (Signal Flares Cassette 2 Launch Yellow Button) + [291] = "%1d", --PTR-LSPE-BTN-RCKT24 (Signal Flares Cassette 2 Launch White Button) + ------------------------------------------------ + -- SARPP + [315] = "%1d", --PTR-LSPE-TMB-CONTR-AUTMAN (SARPP-12 Mode Switch,) + ------------------------------------------------ + -- Recorder P-503B + [305] = "%1d", --PTR-LSPE-TMB-REC (Recorder P-503B Power Switch) + [308] = "%.4f", --PTR-LSPE-LVR-LGTSEL (Recorder P-503B Backlight Brightness Knob) + ------------------------------------------------ + -- IFF + [304] = "%1d", --"PTR-LSPE-LVR-MODE (IFF Transponder Mode Selector Switch) + [301] = "%1d", --PTR-LSPE-TMB-RADIO-WRK (IFF Transponder Device Selector Switch) + [300] = "%1d", --PTR-LSPE-TMB-RADIO-MODE12 (IFF Transponder Device Mode Switch) + [296] = "%1d", --PTR-LSPE-CVR-EMRG-ERASE (IFF Transponder Erase Button Cover) + [297] = "%1d", --PTR-LSPE-BTN-EMRG-ERASE (IFF Transponder Erase Button) + [298] = "%1d", --PTR-LSPE-CVR-EMRG-MAYDAY (IFF Transponder Disaster Switch Cover) + [299] = "%1d", --PTR-LSPE-TMB-EMRG-MAYDAY (IFF Transponder Disaster Switch) + ------------------------------------------------ + -- jump descent siren + [323] = "%1d", --PTR-LSPE-TMB-AIR-SIREN (Alarm Bell Button) +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] +end + +----------------------------------------------------- +-- LOW IMPORTANCE EXPORTS -- +-- done every gExportLowTickInterval export events -- +----------------------------------------------------- + +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] + --[[ + -- AGB_3K_LEFT + local lAGB_3K_LEFT = GetDevice(6) + ExportScript.Tools.WriteToLog('lAGB_3K_LEFT:get_sideslip '..ExportScript.Tools.dump(lAGB_3K_LEFT:get_sideslip())) + ExportScript.Tools.WriteToLog('lAGB_3K_LEFT:get_bank '..ExportScript.Tools.dump(lAGB_3K_LEFT:get_bank())) + ExportScript.Tools.WriteToLog('lAGB_3K_LEFT:get_pitch '..ExportScript.Tools.dump(lAGB_3K_LEFT:get_pitch())) + + -- AGB_3K_RIGHT + local lAGB_3K_RIGHT = GetDevice(7) + ExportScript.Tools.WriteToLog('lAGB_3K_RIGHT:get_sideslip '..ExportScript.Tools.dump(lAGB_3K_RIGHT:get_sideslip())) + ExportScript.Tools.WriteToLog('lAGB_3K_RIGHT:get_bank '..ExportScript.Tools.dump(lAGB_3K_RIGHT:get_bank())) + ExportScript.Tools.WriteToLog('lAGB_3K_RIGHT:get_pitch '..ExportScript.Tools.dump(lAGB_3K_RIGHT:get_pitch())) + + -- DISS_15 + local lDISS_15 = GetDevice(15) + ExportScript.Tools.WriteToLog('lDISS_15:get_w_vector '..ExportScript.Tools.dump(lDISS_15:get_w_vector())) + ExportScript.Tools.WriteToLog('lDISS_15:get_drift_angle '..ExportScript.Tools.dump(lDISS_15:get_drift_angle())) + + -- RADAR_ALTIMETER + local lRADAR_ALTIMETER = GetDevice(18) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_altitude '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_altitude())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_dangerous_height_flag '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_dangerous_height_flag())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_distance_limit())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_dangerous_height '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_dangerous_height())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_warning_flag '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_warning_flag())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_mode '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_mode())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_aperture_size())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_needle_value '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_needle_value())) + + -- MISC_SYSTEMS_INTERFACE + local lMISC_SYSTEMS_INTERFACE = GetDevice(20) + ExportScript.Tools.WriteToLog('lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch '..ExportScript.Tools.dump(lMISC_SYSTEMS_INTERFACE:get_rotor_blades_pitch())) + ExportScript.Tools.WriteToLog('lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm '..ExportScript.Tools.dump(lMISC_SYSTEMS_INTERFACE:get_main_rotor_rpm())) + + -- SPU_7 (Intercom) + local lSPU_7 = GetDevice(36) + ExportScript.Tools.WriteToLog('lSPU_7:is_communicator_available '..ExportScript.Tools.dump(lSPU_7:is_communicator_available())) + ExportScript.Tools.WriteToLog('lSPU_7:get_noise_level '..ExportScript.Tools.dump(lSPU_7:get_noise_level())) + ExportScript.Tools.WriteToLog('lSPU_7:get_signal_level '..ExportScript.Tools.dump(lSPU_7:get_signal_level())) + --ExportScript.Tools.WriteToLog('lSPU_7:set_communicator '..ExportScript.Tools.dump(lSPU_7:set_communicator())) -- test parameters + --ExportScript.Tools.WriteToLog('lSPU_7:set_voip_mode '..ExportScript.Tools.dump(lSPU_7:set_voip_mode())) -- test parameters + + -- JADRO_1A + local lJADRO_1A = GetDevice(37) + ExportScript.Tools.WriteToLog('lJADRO_1A:is_on '..ExportScript.Tools.dump(lJADRO_1A:is_on())) + ExportScript.Tools.WriteToLog('lJADRO_1A:get_frequency '..ExportScript.Tools.dump(lJADRO_1A:get_frequency())) + --ExportScript.Tools.WriteToLog('lJADRO_1A:set_frequency '..ExportScript.Tools.dump(lJADRO_1A:set_frequency())) -- test parameters + --ExportScript.Tools.WriteToLog('lJADRO_1A:set_modulation '..ExportScript.Tools.dump(lJADRO_1A:set_modulation())) -- test parameters + --ExportScript.Tools.WriteToLog('lJADRO_1A:set_channel '..ExportScript.Tools.dump(lJADRO_1A:set_channel())) -- test parameters + + -- R_863 + local lR_863 = GetDevice(38) + ExportScript.Tools.WriteToLog('lR_863:is_on '..ExportScript.Tools.dump(lR_863:is_on())) + ExportScript.Tools.WriteToLog('lR_863:get_frequency '..ExportScript.Tools.dump(lR_863:get_frequency())) + --ExportScript.Tools.WriteToLog('lR_863:set_frequency '..ExportScript.Tools.dump(lR_863:set_frequency())) -- test parameters + --ExportScript.Tools.WriteToLog('lR_863:set_modulation '..ExportScript.Tools.dump(lR_863:set_modulation())) -- test parameters + --ExportScript.Tools.WriteToLog('lR_863:set_channel '..ExportScript.Tools.dump(lR_863:set_channel())) -- test parameters + + -- R_828 + local lR_828 = GetDevice(39) + ExportScript.Tools.WriteToLog('lR_828:is_on '..ExportScript.Tools.dump(lR_828:is_on())) + ExportScript.Tools.WriteToLog('lR_828:get_frequency '..ExportScript.Tools.dump(lR_828:get_frequency())) + --ExportScript.Tools.WriteToLog('lR_828:set_frequency '..ExportScript.Tools.dump(lR_828:set_frequency())) -- test parameters + --ExportScript.Tools.WriteToLog('lR_828:set_modulation '..ExportScript.Tools.dump(lR_828:set_modulation())) -- test parameters + --ExportScript.Tools.WriteToLog('lR_828:set_channel '..ExportScript.Tools.dump(lR_828:set_channel())) -- test parameters + ]] +end + +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) +--[[ + export in low tick interval to hardware + Example from A-10C + Landing Gear + mainPanelDevice, basis panel + ExportScript.Tools.SendDataDAC("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE + ExportScript.Tools.SendDataDAC("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE + ExportScript.Tools.SendDataDAC("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE + + Device test, Device 2 to 32 + is value "userdata", is only DLL intern functions + + local ltmp1 = 0 + for ltmp2 = 1, 50, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] + + -- Radio comunication + -- JADRO 1A + local lJADRO_1A = GetDevice(37) + if lJADRO_1A:is_on() then + ExportScript.Tools.SendDataDAC("2000", string.format("%7.4f", lJADRO_1A:get_frequency()/1000000)) + else + ExportScript.Tools.SendDataDAC("2000", "-") + end + + -- R_863 (center) + local lR_863_c = GetDevice(38) + ExportScript.Tools.SendDataDAC("2001", string.format("%7.3f", lR_863_c:get_frequency()/1000000)) + + -- R_863 (left) Channel + local lR_863_l = {[0.0]="1",[0.05]="2",[0.10]="3",[0.15]="4",[0.20]="5",[0.25]="6",[0.30]="7",[0.35]="8",[0.40]="9",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"} + ExportScript.Tools.SendDataDAC("2002", lR_863_l[ExportScript.Tools.round(mainPanelDevice:get_argument_value(370), 2)]) + + -- R_863 (left) Frequency + -- is the same frequency as R_863 (center), but not the frequency from R_863 (left) + local lR_863_F = GetDevice(38) + ExportScript.Tools.SendDataDAC("2003", string.format("%7.3f", lR_863_F:get_frequency()/1000000)) + + -- R_828 Channel + local lR_828 = {[0.0]="1",[0.101]="2",[0.199]="3",[0.302]="4",[0.400]="5",[0.502]="6",[0.601]="7",[0.697]="8",[0.801]="9",[0.898]="10"} + ExportScript.Tools.SendDataDAC("2004", lR_828[ExportScript.Tools.round(mainPanelDevice:get_argument_value(736), 3)]) + + -- R_828 Frequency + local lR_828_F = GetDevice(39) + if lR_828_F:is_on() then + ExportScript.Tools.SendDataDAC("2005", string.format("%7.3f", lR_828_F:get_frequency()/1000000)) + else + ExportScript.Tools.SendDataDAC("2005", "-") + end + + -- UV-26 + local lUV26 = list_indication(5) + lUV26 = lUV26:gsub("-----------------------------------------", "") + lUV26 = lUV26:gsub("txt_digits", "") + lUV26 = lUV26:gsub("%c", "") + + ExportScript.Tools.SendDataDAC("2006", string.format("%s", lUV26)) + + + --============================================================================================ + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + + local ltmp1 = 0 + for ltmp2 = 1, 10, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] +end + +----------------------------- +-- Custom functions -- +----------------------------- + +function ExportScript.genericRadio(key, value, hardware) +end diff --git a/ExportsModules/MiG-15bis.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua similarity index 57% rename from ExportsModules/MiG-15bis.lua rename to Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua index 741e345..13c5136 100644 --- a/ExportsModules/MiG-15bis.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/MiG-15bis.lua @@ -1,12 +1,20 @@ -- MiG-15Bis --- Version 0.9.9 BETA +-- Version 1.0.0 BETA -gES_FoundDCSModule = true +ExportScript.FoundDCSModule = true -gES_GlassCockpitConfigEveryFrameArguments = +ExportScript.ConfigEveryFrameArguments = { --- arguments for export every frame --- based of "mainpanel_init.lua" + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] [225] = "%.4f", -- Canopy [223] = "%.4f", -- LeftCanopyLever [222] = "%.4f", -- RightCanopyLever @@ -84,34 +92,34 @@ gES_GlassCockpitConfigEveryFrameArguments = [245] = "%.4f", -- ASP_3N_Range -- Lamps -- electric system - [57] = "%.4f", -- lamp_GeneratorOff {-1.0, 1.0}{-1.0, 1.0} - [58] = "%.4f", -- lamp_Ignition {-1.0, 1.0}{-1.0, 1.0} + [57] = "%.f", -- lamp_GeneratorOff {-1.0, 1.0}{-1.0, 1.0} + [58] = "%.f", -- lamp_Ignition {-1.0, 1.0}{-1.0, 1.0} -- power plant - [119] = "%.4f", -- lamp_IsolatingValve {-1.0, 1.0}{-1.0, 1.0} + [119] = "%.f", -- lamp_IsolatingValve {-1.0, 1.0}{-1.0, 1.0} -- gear system - [75] = "%.4f", -- lamp_LeftGearExt {-1.0, 1.0}{-1.0, 1.0} - [74] = "%.4f", -- lamp_LeftGearRet {-1.0, 1.0}{-1.0, 1.0} - [79] = "%.4f", -- lamp_RightGearExt {-1.0, 1.0}{-1.0, 1.0} - [78] = "%.4f", -- lamp_RightGearRet {-1.0, 1.0}{-1.0, 1.0} - [77] = "%.4f", -- lamp_NoseGearExt {-1.0, 1.0}{-1.0, 1.0} - [76] = "%.4f", -- lamp_NoseGearRet {-1.0, 1.0}{-1.0, 1.0} - [53] = "%.4f", -- lamp_ExtendGears {-1.0, 1.0}{-1.0, 1.0} + [75] = "%.f", -- lamp_LeftGearExt {-1.0, 1.0}{-1.0, 1.0} + [74] = "%.f", -- lamp_LeftGearRet {-1.0, 1.0}{-1.0, 1.0} + [79] = "%.f", -- lamp_RightGearExt {-1.0, 1.0}{-1.0, 1.0} + [78] = "%.f", -- lamp_RightGearRet {-1.0, 1.0}{-1.0, 1.0} + [77] = "%.f", -- lamp_NoseGearExt {-1.0, 1.0}{-1.0, 1.0} + [76] = "%.f", -- lamp_NoseGearRet {-1.0, 1.0}{-1.0, 1.0} + [53] = "%.f", -- lamp_ExtendGears {-1.0, 1.0}{-1.0, 1.0} -- fuel system - [56] = "%.4f", -- lamp_Remain300 {-1.0, 1.0}{-1.0, 1.0} - [50] = "%.4f", -- lamp_AftEmpty {-1.0, 1.0}{-1.0, 1.0} - [52] = "%.4f", -- lamp_DropTanks {-1.0, 1.0}{-1.0, 1.0} - [51] = "%.4f", -- lamp_BoostPressure {-1.0, 1.0}{-1.0, 1.0} + [56] = "%.f", -- lamp_Remain300 {-1.0, 1.0}{-1.0, 1.0} + [50] = "%.f", -- lamp_AftEmpty {-1.0, 1.0}{-1.0, 1.0} + [52] = "%.f", -- lamp_DropTanks {-1.0, 1.0}{-1.0, 1.0} + [51] = "%.f", -- lamp_BoostPressure {-1.0, 1.0}{-1.0, 1.0} -- control system - [113] = "%.4f", -- lamp_TrimmerNeutral {-1.0, 1.0}{-1.0, 1.0} - [59] = "%.4f", -- lamp_FlapsExt {-1.0, 1.0}{-1.0, 1.0} - [124] = "%.4f", -- lamp_AirBrakeExt {-1.0, 1.0}{-1.0, 1.0} + [113] = "%.f", -- lamp_TrimmerNeutral {-1.0, 1.0}{-1.0, 1.0} + [59] = "%.f", -- lamp_FlapsExt {-1.0, 1.0}{-1.0, 1.0} + [124] = "%.f", -- lamp_AirBrakeExt {-1.0, 1.0}{-1.0, 1.0} -- fire extinguisher system - [135] = "%.4f", -- lamp_FireDetected {-1.0, 1.0}{-1.0, 1.0} + [135] = "%.f", -- lamp_FireDetected {-1.0, 1.0}{-1.0, 1.0} -- ARC-5 - [183] = "%.4f", -- lamp_ARC_5 {-1.0, 1.0}{-1.0, 1.0} - [218] = "%.4f", -- light_ARC_5_scale {-1.0, 1.0}{-1.0, 1.0} + [183] = "%.f", -- lamp_ARC_5 {-1.0, 1.0}{-1.0, 1.0} + [218] = "%.f", -- light_ARC_5_scale {-1.0, 1.0}{-1.0, 1.0} -- MRP-48P - [54] = "%.4f", -- lamp_Marker {-1.0, 1.0}{-1.0, 1.0} + [54] = "%.f", -- lamp_Marker {-1.0, 1.0}{-1.0, 1.0} -- Light System [226] = "%.4f", -- light_LeftUV {-1.0, 1.0}{-1.0, 1.0} [215] = "%.4f", -- light_CenterUV {-1.0, 1.0}{-1.0, 1.0} @@ -119,9 +127,9 @@ gES_GlassCockpitConfigEveryFrameArguments = [217] = "%.4f", -- light_Panels {-1.0, 1.0}{-1.0, 1.0} [216] = "%.4f", -- light_AuxLeftPanel {-1.0, 1.0}{-1.0, 1.0} -- Gun Camera - [55] = "%.4f" -- lamp_GunCamera {-1.0, 1.0}{-1.0, 1.0} + [55] = "%.f" -- lamp_GunCamera {-1.0, 1.0}{-1.0, 1.0} } -gES_GlassCockpitConfigArguments = +ExportScript.ConfigArguments = { --[[ arguments for export in low tick interval @@ -271,132 +279,31 @@ gES_GlassCockpitConfigArguments = -- done every export event -- ----------------------------- --- Pointed to by ProcessGlassCockpitDCSHighImportance -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - - -- ADI - -- AGK_47B_roll;AGK_47B_pitch;AGK_47B_failure_flag;AGK_47B_sideslip; - -- AGK_47B_turn;AGK_47B_horizon - SendData(2001, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.1f", - mainPanelDevice:get_argument_value(6), - mainPanelDevice:get_argument_value(7), - mainPanelDevice:get_argument_value(11), - mainPanelDevice:get_argument_value(8), - mainPanelDevice:get_argument_value(9), - mainPanelDevice:get_argument_value(10))) - -- Altimeter - -- Altimeter_km;Altimeter_m;Altimeter_Pressure - SendData(2002, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(28), - mainPanelDevice:get_argument_value(29), - mainPanelDevice:get_argument_value(31))) - -- Airspeed - -- IAS;TAS - SendData(2003, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(4), - mainPanelDevice:get_argument_value(5))) - -- Brake - -- LeftBrakePressure;RightBrakePressure - SendData(2004, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(121), - mainPanelDevice:get_argument_value(122))) - -- Cockpit - -- CockpitAltitude;PressureDifference; - SendData(2005, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(39), - mainPanelDevice:get_argument_value(40))) - -- FuelFlow - -- OilTemperature;OilPressure;EngineFuelPressure; - SendData(2006, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(45), - mainPanelDevice:get_argument_value(44), - mainPanelDevice:get_argument_value(43))) - -- Gear - -- lamp_LeftGearExt;lamp_LeftGearRet;lamp_RightGearExt;lamp_RightGearRet;lamp_NoseGearExt; - -- lamp_NoseGearRet;lamp_ExtendGears - SendData(2007, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.4f;%.3f", - mainPanelDevice:get_argument_value(75), - mainPanelDevice:get_argument_value(74), - mainPanelDevice:get_argument_value(79), - mainPanelDevice:get_argument_value(78), - mainPanelDevice:get_argument_value(77), - mainPanelDevice:get_argument_value(76), - mainPanelDevice:get_argument_value(53))) - -- GyroCompass - -- HeadingScale;Heading - SendData(2008, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(32), - mainPanelDevice:get_argument_value(33))) - -- VoltAmpMeter - -- VoltAmperMeter; lamps_lightness; - SendData(2009, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(83), - mainPanelDevice:get_argument_value(244))) - -- Clock - -- CLOCK_currtime_hours;CLOCK_currtime_minutes;CLOCK_flight_time_meter_status; - -- CLOCK_flight_hours; CLOCK_flight_minutes;CLOCK_seconds_meter_time_minutes; - -- CLOCK_seconds_meter_time_seconds - SendData(2010, string.format("%.4f;%.4f;%.4f;%.4f;%.4f;%.4f;%.3f", - mainPanelDevice:get_argument_value(15), - mainPanelDevice:get_argument_value(16), - mainPanelDevice:get_argument_value(22), - mainPanelDevice:get_argument_value(18), - mainPanelDevice:get_argument_value(19), - mainPanelDevice:get_argument_value(20), - mainPanelDevice:get_argument_value(17))) - -- Compass - -- heading, pitch, bank - SendData(2011, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(33), - mainPanelDevice:get_argument_value(7), - mainPanelDevice:get_argument_value(6))) - end +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] end -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) --- SendDataHW("", mainPanelDevice:get_argument_value()) -- - -- Lamps - -- electric system - SendDataHW("57", mainPanelDevice:get_argument_value(57)) -- lamp_GeneratorOff - SendDataHW("58", mainPanelDevice:get_argument_value(58)) -- lamp_Ignition - -- power plant - SendDataHW("119", mainPanelDevice:get_argument_value(119)) -- lamp_IsolatingValve - -- gear system - SendDataHW("75", mainPanelDevice:get_argument_value(75)) -- lamp_LeftGearExt - SendDataHW("74", mainPanelDevice:get_argument_value(74)) -- lamp_LeftGearRet - SendDataHW("79", mainPanelDevice:get_argument_value(79)) -- lamp_RightGearExt - SendDataHW("78", mainPanelDevice:get_argument_value(78)) -- lamp_RightGearRet - SendDataHW("77", mainPanelDevice:get_argument_value(77)) -- lamp_NoseGearExt - SendDataHW("76", mainPanelDevice:get_argument_value(76)) -- lamp_NoseGearRet - SendDataHW("53", mainPanelDevice:get_argument_value(53)) -- lamp_ExtendGears - -- fuel system - SendDataHW("56", mainPanelDevice:get_argument_value(56)) -- lamp_Remain300 - SendDataHW("50", mainPanelDevice:get_argument_value(50)) -- lamp_AftEmpty - SendDataHW("52", mainPanelDevice:get_argument_value(52)) -- lamp_DropTanks - SendDataHW("51", mainPanelDevice:get_argument_value(51)) -- lamp_BoostPressure - -- control system - SendDataHW("113", mainPanelDevice:get_argument_value(113)) -- lamp_TrimmerNeutral - SendDataHW("59", mainPanelDevice:get_argument_value(59)) -- lamp_FlapsExt - SendDataHW("124", mainPanelDevice:get_argument_value(124)) -- lamp_AirBrakeExt - -- fire extinguisher system - SendDataHW("135", mainPanelDevice:get_argument_value(135)) -- lamp_FireDetected - -- ARC-5 - SendDataHW("183", mainPanelDevice:get_argument_value(183)) -- lamp_ARC_5 - SendDataHW("218", mainPanelDevice:get_argument_value(218)) -- light_ARC_5_scale - -- MRP-48P - SendDataHW("54", mainPanelDevice:get_argument_value(54)) -- lamp_Marker - -- Light System - SendDataHW("226", mainPanelDevice:get_argument_value(226)) -- light_LeftUV - SendDataHW("215", mainPanelDevice:get_argument_value(215)) -- light_CenterUV - SendDataHW("227", mainPanelDevice:get_argument_value(227)) -- light_RightUV - SendDataHW("217", mainPanelDevice:get_argument_value(217)) -- light_Panels - SendDataHW("216", mainPanelDevice:get_argument_value(216)) -- light_AuxLeftPanel - -- Gun Camera - SendDataHW("55", mainPanelDevice:get_argument_value(55)) -- lamp_GunCamera +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] end ----------------------------------------------------- @@ -404,46 +311,51 @@ end -- done every gExportLowTickInterval export events -- ----------------------------------------------------- --- Pointed to by ProcessGlassCockpitDCSConfigLowImportance -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - end +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] end -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) + +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) --[[ every frame export to hardware Example from A-10C Get Radio Frequencies get data from device local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config ]] --===================================================================================== --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - WriteToLog('CMSP: '..dump(list_indication(7))) + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) local ltmp1 = 0 for ltmp2 = 0, 13, 1 do ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) end ]] --[[ local ltmp1 = 0 for ltmp2 = 1, 73, 1 do ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) end ]] end @@ -452,5 +364,5 @@ end -- Custom functions -- ----------------------------- -function genericRadio(key, value, hardware) +function ExportScript.genericRadio(key, value, hardware) end diff --git a/ExportsModules/MiG-21Bis.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-21Bis.lua similarity index 57% rename from ExportsModules/MiG-21Bis.lua rename to Scripts/DCS-ExportScript/ExportsModules/MiG-21Bis.lua index 701f630..b0e7d04 100644 --- a/ExportsModules/MiG-21Bis.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/MiG-21Bis.lua @@ -1,839 +1,675 @@ --- MiG-21Bis Export --- Version 0.9.9 BETA - -gES_FoundDCSModule = true - -gES_GlassCockpitConfigEveryFrameArguments = -{ - --[[ - every frames arguments - based of "mainpanel_init.lua" - Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) - [DeviceID] = "Format" - [4] = "%.4f", <- floating-point number with 4 digits after point - [19] = "%0.1f", <- floating-point number with 1 digit after point - [129] = "%1d", <- decimal number - ]] - [239] = "%.1f", -- CANOPY_anti_ice ---ALCOHOL, COMPRESSED_AIR other similar stuff == == == == == == == == == == == == == == == == == == == == == == = - [411] = "%.1f", -- ALCOHOL - [413] = "%.1f", -- COMPRESSED_AIR_main - [414] = "%.1f", -- COMPRESSED_AIR_aux --- OXYGENE SYSTEM (pilot only, engine O2 separated) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [59] = "%.1f", -- OXYGENE_instrument_IK52 - [60] = "%.1f", -- OXYGENE_instrument_IK52_blinking_lungs - [58] = "%.1f", -- OXYGENE_instrument_M2000 ---GEAR LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [9] = "%.1f", -- GEAR_NOSE_UP_LIGHT - [12] = "%.1f", -- GEAR_NOSE_DOWN_LIGHT - [10] = "%.1f", -- GEAR_LEFT_UP_LIGHT - [13] = "%.1f", -- GEAR_LEFT_DOWN_LIGHT - [11] = "%.1f", -- GEAR_RIGHT_UP_LIGHT - [14] = "%.1f", -- GEAR_RIGHT_DOWN_LIGHT --- AIRBRAKES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [316] = "%.1f", -- AIRBRAKES_button - [7] = "%.1f", -- AIRBRAKES_3D --- INSTRUMENTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [100] = "%.4f", -- IAS_indicator - [101] = "%.4f", -- TAS_indicator - [102] = "%.4f", -- M_indicator --- Baro altimeter subgroup -------------------------------------------------------------------------------------------------------------------------- - [104] = "%.4f", -- H_indicator_needle_m - [112] = "%.4f", -- H_indicator_needle_km ---/N/ KSI subgroup (NPP) -------------------------------------------------------------------------------------------------------------------------- - [178] = "%.1f", -- KSI_switch - [258] = "%.1f", -- KSI_adjust_button - [111] = "%.1f", -- KSI_course_indicator - [68] = "%.1f", -- KSI_course_set_needle --- RSBN subgroup ------------------------------------------------------------------------------------------------------------------------------------------------ - [176] = "%.1f", -- RSBN_switch - [548] = "%.1f", -- RSBN_azimut_korekcija_LIGHT - [549] = "%.1f", -- RSBN_dalnost_korekcija_LIGHT - [417] = "%.1f", -- RSBN_distance_meter - [355] = "%.1f", -- RSBN_distance_meter_Hundreds - [356] = "%.1f", -- RSBN_distance_meter_Tens - [357] = "%.1f", -- RSBN_distance_meter_Singles - [587] = "%.1f", -- RSBN_NPP_kurs_blinker - [588] = "%.1f", -- RSBN_NPP_glisada_blinker - [590] = "%.4f", -- RSBN_NPP_kurs_needle - [589] = "%.4f", -- RSBN_NPP_glisada_needle - [567] = "%.1f", -- RSBN_KPP_kren_blinker - [568] = "%.1f", -- RSBN_KPP_tangaz_blinker - [565] = "%.4f", -- RSBN_KPP_kurs_director - [566] = "%.4f", -- RSBN_KPP_glisada_director ---/N/ ARK subgroup --------------------------------------------------------------------------------------------------------------------------------- - [174] = "%.1f", -- ARK_switch - [254] = "%.1f", -- ARK_dal_bliz_selector - [36] = "%.4f", -- ARK_RSBN_needle --- Radio-altimeter subgroup ------------------------------------------------------------------------------------------------------------------------------------------------------ - [175] = "%.1f", -- RADIO_ALTIMETER_MARKER_switch - [103] = "%.4f", -- RADIO_ALTIMETER_indicator - [500] = "%.1f", -- LOW_ALT_LIGHT --- UUA and SUA subgroup ----------------------------------------------------------------------------------------------------------------------------------------------------------- - [105] = "%.4f", -- UUA_indicator - [537] = "%.1f", -- AOA_WARNING_LIGHT --- DA-200 subgroup --------------------------------------------------------------------------------------------------------------------------------------------------------- - [107] = "%.6f", -- DA200_TurnNeedle - [106] = "%.4f", -- DA200_VerticalVelocity - [31] = "%.1f", -- DA200_Slipball - [177] = "%.1f", -- KPP_switch - [259] = "%.1f", -- KPP_ARRETIR - [535] = "%.1f", -- KPP_ARRETIR_light - [108] = "%.4f", -- KPP_Bank - [109] = "%.4f", -- KPP_Pitch --- ACCELEROMETER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [110] = "%.4f", -- ACCELEROMETER - [228] = "%.4f", -- RESET_G_needle - [113] = "%.4f", -- MAX_G_needle - [114] = "%.4f", -- MIN_G_needle ---TRIMMER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [172] = "%.1f", -- TRIMMER_switch - [519] = "%.1f", -- TRIMMER_light ---PITOT TUBES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [229] = "%.1f", -- PITOT_TUBES_SELECTOR - [279] = "%.1f", -- PITOT_TUBES_HEATING_main - [280] = "%.1f", -- PITOT_TUBES_HEATING_aux - [406] = "%.1f", -- PITOT_TUBES_STATUS --- FREEZING EFFECTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [410] = "%.1f", -- FREEZING_level_absolute - [543] = "%.1f", -- FREEZING_EFFECTS_canopy ---/N/ DC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [124] = "%.4f", -- DC_BUS_V_needle - [165] = "%.1f", -- DC_BUS_battery - [155] = "%.1f", -- DC_BUS_battery_heat - [510] = "%.1f", -- DC_GENERATOR_LIGHT - [16666] = "%.1f", -- DC_GENERATOR - [563] = "%.1f", -- DC_BUS - [55] = "%.1f", -- DC_BUS_ISA_K ---/N/ AC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [564] = "%.1f", -- AC_BUS - [15366] = "%.1f", -- AC_BUS_PO7501 - [15466] = "%.1f", -- AC_BUS_PO7502 - [16466] = "%.1f", -- AC_BUS_Emerg_Inverter - [16966] = "%.1f", -- AC_GENERATOR - [511] = "%.1f", -- AC_GENERATOR_LIGHT ---/N/ FUEL PUMPS & FUEL SYSTEM == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [159] = "%.1f", -- FUEL_PUMP_3 - [160] = "%.1f", -- FUEL_PUMP_1 - [161] = "%.1f", -- FUEL_PUMP_RASHOD - [402] = "%.4f", -- FUEL_PRESSURE { 0, 45 } ???? - [52] = "%.1f", -- FUEL_METER ---FUEL LIGHTS (in connection with previous) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [501] = "%.1f", -- FUEL_LIGHT_FUELPODC - [502] = "%.1f", -- FUEL_LIGHT_1GR - [503] = "%.1f", -- FUEL_LIGHT_450 - [504] = "%.1f", -- FUEL_LIGHT_3GR - [505] = "%.1f", -- FUEL_LIGHT_FUELPODW - [506] = "%.1f", -- FUEL_LIGHT_RASHOD ---ENGINE START DEVICE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [403] = "%.1f", -- ENGINE_START_DEVICE_STATUS { -1, 0, 1, 2 } - [509] = "%.1f", -- START_DEVICE_ZAZIG_LIGHT - [415] = "%.1f", -- ENGINE_OXYGENE_STATUS - [61] = "%.4f", -- ENGINE_OXYGENE_manometer --- ENGINE and THROTTLE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [624] = "%.1f", -- SPS_state - [625] = "%.4f", -- KONUS_efficiency - [626] = "%.4f", -- SOPLO_efficiency - [50] = "%.4f", -- ENGINE_RPM - [670] = "%.4f", -- ENGINE_RPM2 - [51] = "%.4f", -- ENGINE_TEMP - [404] = "%.4f", -- ENGINE_STRESS - [507] = "%.1f", -- FORSAZ_1_LIGHT - [508] = "%.1f", -- FORSAZ_2_LIGHT - [512] = "%.1f", -- NOZZLE_LIGHT - [517] = "%.1f", -- KONUS_LIGHT - [513] = "%.1f", -- OIL_LIGHT - [627] = "%.4f", -- OIL_PRESSURE - [534] = "%.1f", -- FIRE_LIGHT - [405] = "%.1f", -- ENGINE_SURGE_DOORS_POZITION { -1, 0, 1 } --- GIDRO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [418] = "%.4f", -- PRIMARY_GIDRO_Pressure - [419] = "%.4f", -- SECONDARY_GIDRO_Pressure - [126] = "%.4f", -- PRIMARY_GIDRO_Pressure_needle - [125] = "%.4f", -- SECONDARY_GIDRO_Pressure_needle - [171] = "%.1f", -- GIDRO_NR27_switch - [319] = "%.1f", -- GIDRO_ailerones_busters_switch - [515] = "%.1f", -- HYDRAULIC_LIGHT - [514] = "%.1f", -- BUSTER_LIGHT ---HELMET == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [306] = "%.1f", -- HELMET_heat_man_auto_switch - [310] = "%.1f", -- HELMET_quick_heat_button - [595] = "%.1f", -- HELMET_visor_switch ---AIR CONDITIONING == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [412] = "%.4f", -- AIR_CONDITION_cockpit_temperature --- WARNING LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [541] = "%.1f", -- CANOPY_WARNING_LIGHT - [542] = "%.1f", -- SORC_LIGHT - [407] = "%.1f", -- WARNING_LIGHTS_CHECK_STATE - [516] = "%.1f", -- MARKER_LIGHT - [518] = "%.1f", -- STABILISATOR_LIGHT - [520] = "%.1f", -- CHECK_GEAR_LIGHT - [521] = "%.1f", -- FLAPS_LIGHT - [522] = "%.1f", -- AIRBRAKE_LIGHT - [523] = "%.1f", -- CENTRAL_PYLON_LIGHT - [524] = "%.1f", -- RATO_L_LIGHT - [525] = "%.1f", -- RATO_R_LIGHT - [526] = "%.1f", -- PYLON_1_ON_LIGHT - [527] = "%.1f", -- PYLON_2_ON_LIGHT - [528] = "%.1f", -- PYLON_3_ON_LIGHT - [529] = "%.1f", -- PYLON_4_ON_LIGHT - [530] = "%.1f", -- PYLON_1_OFF_LIGHT - [531] = "%.1f", -- PYLON_2_OFF_LIGHT - [532] = "%.1f", -- PYLON_3_OFF_LIGHT - [533] = "%.1f", -- PYLON_4_OFF_LIGHT --- GIRO DEVICES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [536] = "%.1f", -- GIRO_ARRETIR - [408] = "%.1f", -- GIRO_AGD_KSI_SAU_RLS_STATE - [409] = "%.1f", -- GIRO_DA200_KSI_SAU_RLS_STATE - [162] = "%.1f", -- GIRO_AGD_KSI_SAU_RLS_switch - [163] = "%.1f", -- GIRO_DA200_KSI_SAU_RLS_switch --- ASP == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [539] = "%.1f", -- ASP_TGT_ACQUIRED_LIGHT - [538] = "%.1f", -- ASP_LAUNCH - [540] = "%.1f", -- ASP_DISENGAGE - [67] = "%.1f", -- GUN_camera_3D - [551] = "%.1f", -- ASP_DISTANCE - [552] = "%.4f", -- ASP_DISTANCE_MISSILE - [553] = "%.1f", -- RADAR_ERROR - [554] = "%.1f", -- RADAR_LOW_ALT - [555] = "%.1f", -- RADAR_FIX_BEAM - [556] = "%.1f", -- ASP_SCALE_BASE - [557] = "%.1f", -- ASP_SCALE_ANGLE - [558] = "%.1f", -- RADAR_LAUNCH - [559] = "%.1f", -- RADAR_MISSILE_HEAD_RDY - [560] = "%.1f", -- RADAR_JAMMED - [561] = "%.1f", -- RADAR_BROKEN - [562] = "%.1f", -- RADAR_DISENGAGE - [571] = "%.1f", -- RADAR_19A_1 - [572] = "%.1f", -- RADAR_19A_2 - [573] = "%.1f", -- RADAR_19A_3 - [574] = "%.1f", -- RADAR_19A_4 - [575] = "%.1f", -- RADAR_19A_5 - [576] = "%.1f", -- RADAR_19A_6 - [577] = "%.1f", -- RADAR_19A_7 - [578] = "%.1f", -- RADAR_19A_8 - [579] = "%.1f", -- SEAT_HEIGHT - [580] = "%.1f", -- IAB_BOX - [581] = "%.1f", -- IAB_LIGHT_1 - [582] = "%.1f", -- IAB_LIGHT_2 - [583] = "%.1f", -- IAB_LIGHT_3 - [584] = "%.1f", -- MISSILE_55_1 - [585] = "%.1f", -- MISSILE_55_2 - [586] = "%.1f", -- MISSILE_62 - [63] = "%.1f", -- TACTICAL_DROP_ARMED - [591] = "%.1f", -- SPS_BOX - [592] = "%.1f", -- SPS_HIGH - [593] = "%.1f", -- SPS_ILLUMINATION - [594] = "%.1f", -- SPS_LAUNCH - [598] = "%.1f", -- GUV_BOX - [701] = "%.1f", -- GUV_LAUNCH --- SARPP == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [193] = "%.1f", -- SARPP_switch --- SAU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [546] = "%.1f", -- SAU_stabilization_LIGHT - [547] = "%.1f", -- SAU_privedenie_LIGHT - [544] = "%.1f", -- SAU_landing_COMMAND_LIGHT - [545] = "%.1f", -- SAU_landing_AUTO_LIGHT --- ARU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [64] = "%.1f", -- ARU_3G_instrument --- KONUS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [66] = "%.1f", -- KONUS_UPES_3_instrument --- DRAG CHUTE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [550] = "%.1f", -- GUN_GOTOVN_LIGHT --- SPO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - [601] = "%.1f", -- SPO_L_F - [602] = "%.1f", -- SPO_R_F - [603] = "%.1f", -- SPO_R_B - [604] = "%.1f", -- SPO_L_B - [605] = "%.1f", -- SPO_MUTED --- SOD == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - [606] = "%.1f", -- SOD_ANSWER - [607] = "%.1f", -- SRZO_ON - [608] = "%.1f", -- SRZO_CODE - [609] = "%.1f", -- SRZO_CIPH - [611] = "%.1f", -- SRZO_ERROR - [613] = "%.1f", -- ASP_BACKLIGHT_ON - [614] = "%.1f", -- ASP_BACKLIGHT_INTENSITY - [618] = "%.1f", -- NEEDLES_PHOSPHOR_LIGHT - [152] = "%.1f", -- RED_PANELLIGHT - [619] = "%.1f", -- RED_FLOODLIGHT - [620] = "%.1f", -- WHITE_PANELLIGHT - [621] = "%.1f", -- RED_INSTRUMENT - [622] = "%.1f", -- ASP_GLASS_LIGHT_INTENSITY - [652] = "%.4f", -- H_indicator_needle_max - [655] = "%.4f", -- COCKPIT_PRESSURE_ALTIMETER - [656] = "%.4f", -- COCKPIT_PRESSURE -} -gES_GlassCockpitConfigArguments = -{ - --[[ - arguments for export in low tick interval - based on "clickabledata.lua" - ]] - -- cockpit mechanics - --[718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 1.0} - --[818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0} - --- DC & AC buses & giro devices - [165] = "%.1f", -- Battery On/Off - [155] = "%.1f", -- Battery Heat On/Off - [166] = "%.1f", -- DC Generator On/Off - [169] = "%.1f", -- AC Generator On/Off - [153] = "%.1f", -- PO-750 Inverter #1 On/Off - [154] = "%.1f", -- PO-750 Inverter #2 On/Off - [164] = "%.1f", -- Emergency Inverter --- GIRO - [162] = "%.1f", -- Giro, NPP, SAU, RLS Signal, KPP Power On/Off - [163] = "%.1f", -- DA-200 Signal, Giro, NPP, RLS, SAU Power On/Off --- FUEL_PUMPS & FUEL_SYSTEM (merged) - [159] = "%.1f", -- Fuel Tanks 3rd Group, Fuel Pump - [160] = "%.1f", -- Fuel Tanks 1st Group, Fuel Pump - [161] = "%.1f", -- Drain Fuel Tank, Fuel Pump - [274] = "%.1f", -- Fuel Quantity Set --- ENGINE START DEVICE - [302] = "%.1f", -- APU On/Off - [288] = "%.1f", -- Engine Cold / Normal Start - [289] = "%.1f", -- Start Engine - [301] = "%.1f", -- Engine Emergency Air Start - [616] = "%.1f", -- Engine Stop/Lock --- ACCELEROMETER - [228] = "%.1f", -- Accelerometer Reset --- PITOT TUBES and related things that use dc bus for heating - [229] = "%.1f", -- Pitot tube Selector Main/Emergency - [279] = "%.1f", -- Pitot tube/Periscope/Clock Heat - [280] = "%.1f", -- Secondary Pitot Tube Heat --- DA-200 - [261] = "%.1f", -- Variometer Set --- ENGINE - [308] = "%.1f", -- Anti surge doors - Auto/Manual - [300] = "%.1f", -- Afterburner/Maximum Off/On - [320] = "%.1f", -- Emergency Afterburner Off/On --- FIRE EXTINGUISHER - [303] = "%.1f", -- Fire Extinguisher Off/On - [324] = "%.1f", -- Fire Extinguisher Cover - [325] = "%.1f", -- Fire Extinguisher --- LIGHTS - [612] = "%.1f", -- Cockpit Texts Back-light default_axis - [156] = "%.1f", -- Instruments Back-light default_axis - [157] = "%.1f", -- Main Red Lights default_axis - [222] = "%.1f", -- Main White Lights default_axis - [194] = "%.1f", -- Navigation Lights Off/Min/Med/Max - [323] = "%.1f", -- Landing Lights Off/Taxi/Land --- LIGHTS WARNING - [195] = "%.1f", -- CheckWarningLights11 - [196] = "%.1f", -- CheckWarningLights21 - [273] = "%.1f", -- CheckWarningLights31 - [282] = "%.1f", -- CheckWarningLights41 - [283] = "%.1f", -- CheckWarningLights51 - [322] = "%.1f", -- CheckWarningLights61 - [657] = "%.1f", -- SORC --- Radio - [173] = "%.1f", -- Radio System On/Off - [208] = "%.1f", -- Radio / Compass - [209] = "%.1f", -- Squelch On/Off - [210] = "%.1f", -- Radio Volume - [211] = "%.1f", -- Radio Channel - [315] = "%.1f", -- Radio PTT --- ARK - [174] = "%.1f", -- ARK On/Off - [198] = "%.1f", -- ARK Sound - [212] = "%.1f", -- ARK Change - [189] = "%.1f", -- ARK Zone - [197] = "%.1f", -- ARK Mode - Antenna / Compass - [254] = "%.1f", -- Marker Far/Near --- RSBN - [176] = "%.1f", -- RSBN On/Off - [240] = "%.1f", -- RSBN Mode Land/Navigation/Descend - [340] = "%.1f", -- RSBN / ARK - [294] = "%.1f", -- RSBN Identify - [347] = "%.1f", -- RSBN self-test ---RSBN Panel - [345] = "%.1f", -- RSBN Sound - [351] = "%.1f", -- RSBN Navigation - [352] = "%.1f", -- PRMG Landing - [366] = "%.1f", -- RSBN Reset - [367] = "%.1f", -- RSBN Bearing - [368] = "%.1f", -- RSBN Distance --- SAU - [179] = "%.1f", -- SAU On/Off - [180] = "%.1f", -- SAU Pitch On/Off - [343] = "%.1f", -- SAU - Stabilize - [376] = "%.1f", -- SAU cancel current mode - [377] = "%.1f", -- SAU - Recovery - [344] = "%.1f", -- SAU Preset - Limit Altitude - [341] = "%.1f", -- SAU - Landing - Command - [342] = "%.1f", -- SAU - Landing - Auto - [348] = "%.1f", -- SAU Reset/Off --- SPO - [202] = "%.1f", -- SPO-10 RWR On/Off - [226] = "%.1f", -- SPO-10 Test - [227] = "%.1f", -- SPO-10 Night / Day - [225] = "%.1f", -- SPO-10 Volume --- SRZO IFF - [188] = "%.1f", -- SRZO IFF Coder/Decoder On/Off - [192] = "%.1f", -- SRZO Codes - [346] = "%.1f", -- IFF System 'Type 81' On/Off - [190] = "%.1f", -- Emergency Transmitter Cover - [191] = "%.1f", -- Emergency Transmitter On/Off - [427] = "%.1f", -- SRZO Self Destruct Cover - [428] = "%.1f", -- SRZO Self Destruct --- SOD - [200] = "%.1f", -- SOD IFF On/Off - [199] = "%.1f", -- SOD Identify - [201] = "%.1f", -- SOD Wave Selector 3/1/2 - [204] = "%.1f", -- SOD Modes --- RADAR - [205] = "%.1f", -- Radar Off/Prep/On - [206] = "%.1f", -- Low Altitude Off/Comp/On - [207] = "%.1f", -- Locked Beam On/Off - [266] = "%.1f", -- Radar Screen Magnetic Reset - [330] = "%.1f", -- Radar Interferes - Continues - [331] = "%.1f", -- Radar Interferes - Temporary - [332] = "%.1f", -- Radar Interferes - Passive - [333] = "%.1f", -- Radar Interferes - Weather - [334] = "%.1f", -- Radar Interferes - IFF - [335] = "%.1f", -- Radar Interferes - Low Speed - [336] = "%.1f", -- Radar Interferes - Self-test - [337] = "%.1f", -- Radar Interferes - Reset - [378] = "%.1f", -- Lock Target - [623] = "%.1f", -- Radar Polar Filter --- SPRD - [167] = "%.1f", -- SPRD (RATO) System On/Off - [168] = "%.1f", -- SPRD (RATO) Drop System On/Off - [252] = "%.1f", -- SPRD (RATO) Start Cover - [253] = "%.1f", -- SPRD (RATO) Start - [317] = "%.1f", -- SPRD (RATO)t Drop Cover - [318] = "%.1f", -- SPRD (RATO) Drop --- CONTROL SYSTEM ------------- subsystems -------------------------------------------- --- SPS - [293] = "%.1f", -- SPS System Off/On --- ARU - [295] = "%.1f", -- ARU System - Manual/Auto - [296] = "%.1f", -- ARU System - Low Speed/Neutral/High Speed --- Airbrake - [316] = "%.1f", -- Airbrake - Out/In --- Gear brakes - [299] = "%.1f", -- ABS Off/On - [238] = "%.1f", -- Nosegear Brake Off/On - [237] = "%.1f", -- Emergency Brake --- Gears - [326] = "%.1f", -- Gear Handle Fixator - [327] = "%.1f", -- Gear Up/Neutral/Down - [223] = "%.1f", -- Main Gears Emergency Release Handle - [281] = "%.1f", -- Nose Gear Emergency Release Handle --- Flaps - [311] = "%.1f", -- Flaps Neutral - [312] = "%.1f", -- Flaps Take-Off - [313] = "%.1f", -- Flaps Landing - [314] = "%.1f", -- Flaps Reset buttons --- Drag chute - [298] = "%.1f", -- Release Drag Chute - [304] = "%.1f", -- Drop Drag Chute Cover - [305] = "%.1f", -- Drop Drag Chute ---TRIMMER - [172] = "%.1f", -- Trimmer On/Off - [379] = "%.1f", -- Trimmer Pitch Up/Down --- KONUS - [170] = "%.1f", -- Nosecone On/Off - [309] = "%.1f", -- Nosecone Control - Manual/Auto - [236] = "%.1f", -- Nosecone manual position controller --- SOPLO - [291] = "%.1f", -- Engine Nozzle 2 Position Emergency Control ---MAIN_HYDRO and BUSTER_HYDRO == == == == == == == == == == == == == == == == == == == TEMPORARY MERGED == == == == == == == == == == == == == == == == == == == == == == - [171] = "%.1f", -- Emergency Hydraulic Pump On/Off - [319] = "%.1f", -- Aileron Booster - Off/On ---KPP - [177] = "%.1f", -- KPP Main/Emergency - [259] = "%.1f", -- KPP Cage - [260] = "%.1f", -- KPP Set ---IAS / TAS / KSI (NPP) - [178] = "%.1f", -- NPP On/Off - [258] = "%.1f", -- NPP Adjust - [263] = "%.1f", -- NPP Course set --- ALTIMETER and radioALTIMETER - [175] = "%.1f", -- Radio Altimeter/Marker On/Off - [284] = "%.1f", -- Dangerous Altitude Warning Set - [262] = "%.1f", -- Altimeter pressure knob --- OXYGENE_SYSTEM - [285] = "%.1f", -- Helmet Air Condition Off/On - [286] = "%.1f", -- Emergency Oxygen Off/On - [287] = "%.1f", -- Mixture/Oxygen --- CANOPY - [328] = "%.1f", -- Hermetize Canopy - [329] = "%.1f", -- Secure Canopy - [375] = "%.1f", -- Canopy Open - [385] = "%.1f", -- Canopy Close - [239] = "%.1f", -- Canopy Anti Ice - [224] = "%.1f", -- Canopy Emergency Release Handle - [649] = "%.1f", -- Canopy Ventilation System --- ASP Gunsight - [186] = "%.1f", -- ASP Optical sight On/Off - [241] = "%.1f", -- ASP Main Mode - Manual/Auto - [242] = "%.1f", -- ASP Mode - Bombardment/Shooting - [243] = "%.1f", -- ASP Mode - Missiles-Rockets/Gun - [244] = "%.1f", -- ASP Mode - Giro/Missile - [249] = "%.1f", -- Pipper On/Off - [250] = "%.1f", -- Fix net On/Off - [245] = "%.1f", -- Target Size - [246] = "%.1f", -- Intercept Angle - [247] = "%.1f", -- Scale Backlights control - [248] = "%.1f", -- Pipper light control - [251] = "%.1f", -- Fix Net light control - [384] = "%.1f", -- TDC Range / Pipper Span control --- WEAPON_CONTROL - [181] = "%.1f", -- Missiles - Rockets Heat On/Off - [182] = "%.1f", -- Missiles - Rockets Launch On/Off - [183] = "%.1f", -- Pylon 1-2 Power On/Off - [184] = "%.1f", -- Pylon 3-4 Power On/Off - [185] = "%.1f", -- GS-23 Gun On/Off - [187] = "%.1f", -- Guncam On/Off - [277] = "%.1f", -- Tactical Drop Cover - [278] = "%.1f", -- Tactical Drop - [275] = "%.1f", -- Emergency Missile/Rocket Launcher Cover - [276] = "%.1f", -- Emergency Missile/Rocket Launcher - [256] = "%.1f", -- Drop Wing Fuel Tanks Cover - [257] = "%.1f", -- Drop Wing Fuel Tanks - [386] = "%.1f", -- Drop Center Fuel Tank - [269] = "%.1f", -- Drop Payload - Outer Pylons Cover - [270] = "%.1f", -- Drop Payload - Outer Pylons - [271] = "%.1f", -- Drop Payload - Inner Pylons Cover - [272] = "%.1f", -- Drop Payload - Inner Pylons - [230] = "%.1f", -- Weapon Mode - Air/Ground - [231] = "%.1f", -- Weapon Mode - IR Missile/Neutral/SAR Missile - [232] = "%.1f", -- Activate Gun Loading Pyro - 1 - [233] = "%.1f", -- Activate Gun Loading Pyro - 2 - [234] = "%.1f", -- Activate Gun Loading Pyro - 3 - [235] = "%.1f", -- Weapon Selector - [297] = "%.1f", -- Missile Seeker Sound - [381] = "%.1f", -- Fire Gun - [382] = "%.1f", -- Release Weapon - [383] = "%.1f", -- Release Weapon Cover --- HELMET_VISOR - [306] = "%.1f", -- Helmet Heat - Manual/Auto - [310] = "%.1f", -- Helmet Quick Heat - [369] = "%.1f", -- Helmet visor - off/on --- AIR CONDITIONING - [292] = "%.1f", -- Cockpit Air Condition Off/Cold/Auto/Warm --- SARPP - [193] = "%.1f", -- SARPP-12 Flight Data Recorder On/Off --- Flight Control - --- Dummy buttons/switches - [632] = "%.1f", -- Radar emission - Cover - [633] = "%.1f", -- Radar emission - Combat/Training - [634] = "%.1f", -- G-Suit Max/Min valve - [635] = "%.1f", -- Electric Bus Nr.1 - Cover - [636] = "%.1f", -- Electric Bus Nr.1 - [637] = "%.1f", -- Electric Bus Nr.2 - [638] = "%.1f", -- 1.7 Mach Test Button - Cover - [639] = "%.1f", -- 1.7 Mach Test Button - [640] = "%.1f", -- BU-45 Buster System Separation - [642] = "%.1f", -- SOD Control PBU-1 - [641] = "%.1f", -- SOD Control PBU-2 - [643] = "%.1f", -- Eject - [644] = "%.1f", -- Ejection Seat Emergency Oxygen - [645] = "%.1f", -- UK-2M Mic Amplifier M/L - [646] = "%.1f", -- UK-2M Mic Amplifier GS/KM - [647] = "%.1f", -- Suit Ventilation - [648] = "%.1f", -- Harness Separation - [650] = "%.1f", -- Harness Loose/Tight - [651] = "%.1f", -- Throttle Fixation --- IAB PBK-3 - [387] = "%.1f", -- Emergency Jettison - [388] = "%.1f", -- Emergency Jettison Armed / Not Armed - [389] = "%.1f", -- Tactical Jettison - [390] = "%.1f", -- Special AB / Missile-Rocket-Bombs-Cannon - [391] = "%.1f", -- Brake Chute - [392] = "%.1f", -- Detonation Air / Ground --- SPS 141-100 - [393] = "%.1f", -- "On / Off" - [394] = "%.1f", -- Transmit / Receive - [395] = "%.1f", -- Program I / II - [396] = "%.1f", -- Continuous / Impuls - [397] = "%.1f", -- Test - [398] = "%.1f", -- Dispenser Auto / Manual - [399] = "%.1f", -- Off / Parallel / Full - [400] = "%.1f", -- Manual Activation button - Cover - [401] = "%.1f", -- Manual Activation button --- GUV Control Box -/N/ GUV is useless, it's mostly anti-infantry weapon - [420] = "%.1f", -- On / Off - [421] = "%.1f", -- MAIN GUN / UPK Guns - [422] = "%.1f", -- LOAD 1 - [425] = "%.1f", -- LOAD 2 - [424] = "%.1f", -- LOAD 3 -} - ------------------------------ --- HIGH IMPORTANCE EXPORTS -- --- done every export event -- ------------------------------ - -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - --[[ - every frame export - Example from A-10C - Landing Gear - mainPanelDevice, basis panel - SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE - SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE - SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE - ]] - - - -- Distance - -- distance_meter_Hundreds;distance_meter_Tens;distance_meter_Singles - -- 355; 356; 357; - SendData(2000, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(355), - mainPanelDevice:get_argument_value(356), - mainPanelDevice:get_argument_value(357))) - -- HSI - -- heading; requiredHeading; bearingNeedle; warningFlagG; warningFlagK; glide; side; - -- 111; 68; 590; 588; 587; glide; side; - SendData(2001, string.format("%0.4f;%0.4f;%0.4f;%0.1f;%0.1f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(111), - mainPanelDevice:get_argument_value(68), - ((mainPanelDevice:get_argument_value(36) + 0.25) - mainPanelDevice:get_argument_value(111)), --Needle is wrong - mainPanelDevice:get_argument_value(588), -- RSBN_NPP_glisada_blinker - mainPanelDevice:get_argument_value(587), -- RSBN_NPP_kurs_blinker - mainPanelDevice:get_argument_value(589), -- RSBN_NPP_glisada_needle - mainPanelDevice:get_argument_value(590))) -- RSBN_NPP_kurs_needle - -- Altimeter - -- altituteMeter; altituteKM; baroPressure - -- 104; 112; 655; - SendData(2002, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(104), - mainPanelDevice:get_argument_value(112), - mainPanelDevice:get_argument_value(655))) - -- ADI - -- bank;pitch;sideslip;RSBN_KPP_tangaz_blinker(Flag_L);RSBN_KPP_kren_blinker(Flag_R); - -- desiredBank;desirePitch;airSpeedDeviation;trackDeviation;heightDeviation; - SendData(2003, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(108), -- bank - mainPanelDevice:get_argument_value(109), -- pitch - mainPanelDevice:get_argument_value(31), -- sideslip - mainPanelDevice:get_argument_value(568), -- RSBN_KPP_tangaz_blinker(Flag_L) - mainPanelDevice:get_argument_value(567), -- RSBN_KPP_kren_blinker(Flag_R) - (mainPanelDevice:get_argument_value(565) * 3), -- RSBN_KPP_kurs_director - (mainPanelDevice:get_argument_value(566) * 3), -- RSBN_KPP_glisada_director (maybe multiply by 3) - 0, -- ? - mainPanelDevice:get_argument_value(590), -- RSBN_NPP_kurs_needle - mainPanelDevice:get_argument_value(589))) -- RSBN_NPP_glisada_needle - -- HydraulicPressure - -- PRIMARY_GIDRO_Pressure_needle, SECONDARY_GIDRO_Pressure_needle - -- 126; 125; - SendData(2004, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(126), - mainPanelDevice:get_argument_value(125))) - -- Mach - -- 101; 102; - SendData(2005, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(101), - mainPanelDevice:get_argument_value(102))) - -- Nosecone - -- KONUS_efficiency, KONUS_UPES_3_instrument - -- 625; 66; - SendData(2006, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(625), - mainPanelDevice:get_argument_value(66))) - -- RPM - -- ENGINE_RPM; ENGINE_RPM2 - -- 50; 670; - SendData(2007, string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(50), - mainPanelDevice:get_argument_value(670))) - - -- VVI - -- DA200_VerticalVelocity; DA200_TurnNeedle; DA200_Slipball - -- 106; 107; 31; - SendData(2008, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(106), - mainPanelDevice:get_argument_value(107), - mainPanelDevice:get_argument_value(31))) - -- Wheelbrakes - -- LEFT_Wheelbrake;RIGHT_Wheelbrake; - -- ???; ??? - -- SendData(2009, string.format("%0.4f;%0.4f", - -- mainPanelDevice:get_argument_value(???), - -- mainPanelDevice:get_argument_value(???))) - - -- Gear - -- GEAR_NOSE_UP_LIGHT; GEAR_NOSE_DOWN_LIGHT; GEAR_LEFT_UP_LIGHT; GEAR_LEFT_DOWN_LIGHT; - -- GEAR_RIGHT_UP_LIGHT; GEAR_RIGHT_DOWN_LIGHT; AIRBRAKE_LIGHT; FLAPS_LIGHT; CHECK_GEAR_LIGHT; - -- 9; 12; 10; 13; 11; 14; 522; 521; 520; - - SendData(2010, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(9), - mainPanelDevice:get_argument_value(12), - mainPanelDevice:get_argument_value(10), - mainPanelDevice:get_argument_value(13), - mainPanelDevice:get_argument_value(11), - mainPanelDevice:get_argument_value(14), - mainPanelDevice:get_argument_value(522), - mainPanelDevice:get_argument_value(521), - mainPanelDevice:get_argument_value(520))) - -- ACC - -- ACCELEROMETER; MAX_G_needle; MIN_G_needle - -- 110; 113; 114; - SendData(2012, string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(110), - mainPanelDevice:get_argument_value(113), - mainPanelDevice:get_argument_value(114))) - -- SPO - -- SPO_L_F; SPO_R_F; SPO_R_B; SPO_L_B; SPO_MUTED - -- 601; 602; 603; 604; 605; - SendData(2013, string.format("%0.4f;%0.4f;%0.4f;%0.1f;%0.1f", - mainPanelDevice:get_argument_value(601), - mainPanelDevice:get_argument_value(602), - mainPanelDevice:get_argument_value(603), - mainPanelDevice:get_argument_value(604), - mainPanelDevice:get_argument_value(605))) - -- Clock - -- currtimeHours; currtimeMinutes; currtimeSeconds; flightTimeMeterStatus; - -- flightHours;flightMinutes; secondsMeterTimeMinutes; secondsMeterTimeSeconds; - -- 115; 116; 117; 118; 119; 120; 121; 122; - SendData(2014, string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(115), - mainPanelDevice:get_argument_value(116), - mainPanelDevice:get_argument_value(117), - mainPanelDevice:get_argument_value(118), - mainPanelDevice:get_argument_value(119), - mainPanelDevice:get_argument_value(120), - mainPanelDevice:get_argument_value(121), - mainPanelDevice:get_argument_value(122))) - end -end - -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) - --[[ - every frame export to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config - ]] ---GEAR LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - SendDataHW("9", mainPanelDevice:get_argument_value(9)) -- GEAR_NOSE_UP_LIGHT - SendDataHW("12", mainPanelDevice:get_argument_value(12)) -- GEAR_NOSE_DOWN_LIGHT - SendDataHW("10", mainPanelDevice:get_argument_value(10)) -- GEAR_LEFT_UP_LIGHT - SendDataHW("13", mainPanelDevice:get_argument_value(13)) -- GEAR_LEFT_DOWN_LIGHT - SendDataHW("11", mainPanelDevice:get_argument_value(11)) -- GEAR_RIGHT_UP_LIGHT - SendDataHW("14", mainPanelDevice:get_argument_value(14)) -- GEAR_RIGHT_DOWN_LIGHT - SendDataHW("522", mainPanelDevice:get_argument_value(522)) -- AIRBRAKE_LIGHT - SendDataHW("521", mainPanelDevice:get_argument_value(521)) -- FLAPS_LIGHT - SendDataHW("520", mainPanelDevice:get_argument_value(520)) -- CHECK_GEAR_LIGHT --- Radio-altimeter subgroup ------------------------------------------------------------------------------------------------------------------------------------------------------ - SendDataHW("500", mainPanelDevice:get_argument_value(500)) -- LOW_ALT_LIGHT --- UUA and SUA subgroup ----------------------------------------------------------------------------------------------------------------------------------------------------------- - SendDataHW("537", mainPanelDevice:get_argument_value(537)) -- AOA_WARNING_LIGHT ---/N/ DC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - SendDataHW("510", mainPanelDevice:get_argument_value(510)) -- DC_GENERATOR_LIGHT ---TRIMER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - SendDataHW("519", mainPanelDevice:get_argument_value(519)) -- TRIMMER_light ---/N/ AC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - SendDataHW("511", mainPanelDevice:get_argument_value(511)) -- AC_GENERATOR_LIGHT ---FUEL LIGHTS (in connection with previous) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - SendDataHW("501", mainPanelDevice:get_argument_value(501)) -- FUEL_LIGHT_FUELPODC - SendDataHW("502", mainPanelDevice:get_argument_value(502)) -- FUEL_LIGHT_1GR - SendDataHW("503", mainPanelDevice:get_argument_value(503)) -- FUEL_LIGHT_450 - SendDataHW("504", mainPanelDevice:get_argument_value(504)) -- FUEL_LIGHT_3GR - SendDataHW("505", mainPanelDevice:get_argument_value(505)) -- FUEL_LIGHT_FUELPODW - SendDataHW("506", mainPanelDevice:get_argument_value(506)) -- FUEL_LIGHT_RASHOD --- GIDRO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - SendDataHW("515", mainPanelDevice:get_argument_value(515)) -- HYDRAULIC_LIGHT - SendDataHW("514", mainPanelDevice:get_argument_value(514)) -- BUSTER_LIGHT --- DRAG CHUTE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - SendDataHW("550", mainPanelDevice:get_argument_value(550)) -- GUN_GOTOVN_LIGHT --- SPO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - SendDataHW("601", mainPanelDevice:get_argument_value(601)) -- SPO_L_F - SendDataHW("602", mainPanelDevice:get_argument_value(602)) -- SPO_R_F - SendDataHW("603", mainPanelDevice:get_argument_value(603)) -- SPO_R_B - SendDataHW("604", mainPanelDevice:get_argument_value(604)) -- SPO_L_B - SendDataHW("605", mainPanelDevice:get_argument_value(605)) -- SPO_MUTED --- SAU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - SendDataHW("546", mainPanelDevice:get_argument_value(546)) -- SAU_stabilization_LIGHT - SendDataHW("547", mainPanelDevice:get_argument_value(547)) -- SAU_privedenie_LIGHT - SendDataHW("544", mainPanelDevice:get_argument_value(544)) -- SAU_landing_COMMAND_LIGHT - SendDataHW("545", mainPanelDevice:get_argument_value(545)) -- SAU_landing_AUTO_LIGHT --- WARNING LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - SendDataHW("541", mainPanelDevice:get_argument_value(541)) -- CANOPY_WARNING_LIGHT - SendDataHW("542", mainPanelDevice:get_argument_value(542)) -- SORC_LIGHT - SendDataHW("407", mainPanelDevice:get_argument_value(407)) -- WARNING_LIGHTS_CHECK_STATE - SendDataHW("516", mainPanelDevice:get_argument_value(516)) -- MARKER_LIGHT - SendDataHW("518", mainPanelDevice:get_argument_value(518)) -- STABILISATOR_LIGHT - SendDataHW("520", mainPanelDevice:get_argument_value(520)) -- CHECK_GEAR_LIGHT - SendDataHW("521", mainPanelDevice:get_argument_value(521)) -- FLAPS_LIGHT - SendDataHW("522", mainPanelDevice:get_argument_value(522)) -- AIRBRAKE_LIGHT - SendDataHW("523", mainPanelDevice:get_argument_value(523)) -- CENTRAL_PYLON_LIGHT - SendDataHW("524", mainPanelDevice:get_argument_value(524)) -- RATO_L_LIGHT - SendDataHW("525", mainPanelDevice:get_argument_value(525)) -- RATO_R_LIGHT - SendDataHW("526", mainPanelDevice:get_argument_value(526)) -- PYLON_1_ON_LIGHT - SendDataHW("527", mainPanelDevice:get_argument_value(527)) -- PYLON_2_ON_LIGHT - SendDataHW("528", mainPanelDevice:get_argument_value(528)) -- PYLON_3_ON_LIGHT - SendDataHW("529", mainPanelDevice:get_argument_value(529)) -- PYLON_4_ON_LIGHT - SendDataHW("530", mainPanelDevice:get_argument_value(530)) -- PYLON_1_OFF_LIGHT - SendDataHW("531", mainPanelDevice:get_argument_value(531)) -- PYLON_2_OFF_LIGHT - SendDataHW("532", mainPanelDevice:get_argument_value(532)) -- PYLON_3_OFF_LIGHT - SendDataHW("533", mainPanelDevice:get_argument_value(533)) -- PYLON_4_OFF_LIGHT --- ENGINE and THROTTLE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == - SendDataHW("507", mainPanelDevice:get_argument_value(507)) -- FORSAZ_1_LIGHT - SendDataHW("508", mainPanelDevice:get_argument_value(508)) -- FORSAZ_2_LIGHT - SendDataHW("512", mainPanelDevice:get_argument_value(512)) -- NOZZLE_LIGHT - SendDataHW("517", mainPanelDevice:get_argument_value(517)) -- KONUS_LIGHT - SendDataHW("513", mainPanelDevice:get_argument_value(513)) -- OIL_LIGHT - SendDataHW("534", mainPanelDevice:get_argument_value(534)) -- FIRE_LIGHT ---ENGINE START DEVICE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = - SendDataHW("509", mainPanelDevice:get_argument_value(509)) -- START_DEVICE_ZAZIG_LIGHT - -end - ------------------------------------------------------ --- LOW IMPORTANCE EXPORTS -- --- done every gExportLowTickInterval export events -- ------------------------------------------------------ - -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - --[[ - export in low tick interval to HELIOS - Example from A-10C - Landing Gear - mainPanelDevice, basis panel - SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE - SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE - SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE - ]] - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch version 1.6 - end -end - -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) ---[[ - export in low tick interval to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local lUHFRadio = GetDevice(54) - SendData("ExportID", "Format") - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data - - Device test, Device 2 to 32 - is value "userdata", is only DLL intern functions - local ltmp1 = 0 - for ltmp2 = 1, 32, 1 do - ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] -end \ No newline at end of file +-- MiG-21Bis Export +-- Version 1.0.0 BETA + +ExportScript.FoundDCSModule = true + +ExportScript.ConfigEveryFrameArguments = +{ + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with + [5] = "%.f", <- floating point number rounded to a decimal number + ]] + [239] = "%.1f", -- CANOPY_anti_ice +--ALCOHOL, COMPRESSED_AIR other similar stuff == == == == == == == == == == == == == == == == == == == == == == = + [411] = "%.1f", -- ALCOHOL + [413] = "%.1f", -- COMPRESSED_AIR_main + [414] = "%.1f", -- COMPRESSED_AIR_aux +-- OXYGENE SYSTEM (pilot only, engine O2 separated) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [59] = "%.1f", -- OXYGENE_instrument_IK52 + [60] = "%.1f", -- OXYGENE_instrument_IK52_blinking_lungs + [58] = "%.1f", -- OXYGENE_instrument_M2000 +--GEAR LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [9] = "%.f", -- GEAR_NOSE_UP_LIGHT + [12] = "%.f", -- GEAR_NOSE_DOWN_LIGHT + [10] = "%.f", -- GEAR_LEFT_UP_LIGHT + [13] = "%.f", -- GEAR_LEFT_DOWN_LIGHT + [11] = "%.f", -- GEAR_RIGHT_UP_LIGHT + [14] = "%.f", -- GEAR_RIGHT_DOWN_LIGHT +-- AIRBRAKES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [316] = "%.1f", -- AIRBRAKES_button + [7] = "%.1f", -- AIRBRAKES_3D +-- INSTRUMENTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [100] = "%.4f", -- IAS_indicator + [101] = "%.4f", -- TAS_indicator + [102] = "%.4f", -- M_indicator +-- Baro altimeter subgroup -------------------------------------------------------------------------------------------------------------------------- + [104] = "%.4f", -- H_indicator_needle_m + [112] = "%.4f", -- H_indicator_needle_km +--/N/ KSI subgroup (NPP) -------------------------------------------------------------------------------------------------------------------------- + [178] = "%.1f", -- KSI_switch + [258] = "%.1f", -- KSI_adjust_button + [111] = "%.4f", -- KSI_course_indicator + [68] = "%.4f", -- KSI_course_set_needle +-- RSBN subgroup ------------------------------------------------------------------------------------------------------------------------------------------------ + [176] = "%.1f", -- RSBN_switch + [548] = "%.1f", -- RSBN_azimut_korekcija_LIGHT + [549] = "%.1f", -- RSBN_dalnost_korekcija_LIGHT + [417] = "%.1f", -- RSBN_distance_meter + [355] = "%.1f", -- RSBN_distance_meter_Hundreds + [356] = "%.1f", -- RSBN_distance_meter_Tens + [357] = "%.1f", -- RSBN_distance_meter_Singles + [587] = "%.1f", -- RSBN_NPP_kurs_blinker + [588] = "%.1f", -- RSBN_NPP_glisada_blinker + [590] = "%.4f", -- RSBN_NPP_kurs_needle + [589] = "%.4f", -- RSBN_NPP_glisada_needle + [567] = "%.1f", -- RSBN_KPP_kren_blinker + [568] = "%.1f", -- RSBN_KPP_tangaz_blinker + --[565] = "%.4f", -- RSBN_KPP_kurs_director + --[566] = "%.4f", -- RSBN_KPP_glisada_director +--/N/ ARK subgroup --------------------------------------------------------------------------------------------------------------------------------- + [174] = "%.1f", -- ARK_switch + [254] = "%.1f", -- ARK_dal_bliz_selector + --[36] = "%.4f", -- ARK_RSBN_needle +-- Radio-altimeter subgroup ------------------------------------------------------------------------------------------------------------------------------------------------------ + [175] = "%.1f", -- RADIO_ALTIMETER_MARKER_switch + [103] = "%.4f", -- RADIO_ALTIMETER_indicator + [500] = "%.f", -- LOW_ALT_LIGHT +-- UUA and SUA subgroup ----------------------------------------------------------------------------------------------------------------------------------------------------------- + [105] = "%.4f", -- UUA_indicator + [537] = "%.f", -- AOA_WARNING_LIGHT +-- DA-200 subgroup --------------------------------------------------------------------------------------------------------------------------------------------------------- + [107] = "%.6f", -- DA200_TurnNeedle + [106] = "%.4f", -- DA200_VerticalVelocity + [31] = "%.1f", -- DA200_Slipball + [177] = "%.1f", -- KPP_switch + [259] = "%.1f", -- KPP_ARRETIR + [535] = "%.1f", -- KPP_ARRETIR_light + [108] = "%.4f", -- KPP_Bank + [109] = "%.4f", -- KPP_Pitch +-- ACCELEROMETER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [110] = "%.4f", -- ACCELEROMETER + [228] = "%.4f", -- RESET_G_needle + [113] = "%.4f", -- MAX_G_needle + [114] = "%.4f", -- MIN_G_needle +--TRIMMER == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [172] = "%.1f", -- TRIMMER_switch + [519] = "%.f", -- TRIMMER_light +--PITOT TUBES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [229] = "%.1f", -- PITOT_TUBES_SELECTOR + [279] = "%.1f", -- PITOT_TUBES_HEATING_main + [280] = "%.1f", -- PITOT_TUBES_HEATING_aux + [406] = "%.1f", -- PITOT_TUBES_STATUS +-- FREEZING EFFECTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [410] = "%.1f", -- FREEZING_level_absolute + [543] = "%.1f", -- FREEZING_EFFECTS_canopy +--/N/ DC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [124] = "%.4f", -- DC_BUS_V_needle + [165] = "%.1f", -- DC_BUS_battery + [155] = "%.1f", -- DC_BUS_battery_heat + [510] = "%.f", -- DC_GENERATOR_LIGHT + [16666] = "%.1f", -- DC_GENERATOR + [563] = "%.1f", -- DC_BUS + [55] = "%.1f", -- DC_BUS_ISA_K +--/N/ AC bus == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [564] = "%.1f", -- AC_BUS + [15366] = "%.1f", -- AC_BUS_PO7501 + [15466] = "%.1f", -- AC_BUS_PO7502 + [16466] = "%.1f", -- AC_BUS_Emerg_Inverter + [16966] = "%.1f", -- AC_GENERATOR + [511] = "%.f", -- AC_GENERATOR_LIGHT +--/N/ FUEL PUMPS & FUEL SYSTEM == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [159] = "%.1f", -- FUEL_PUMP_3 + [160] = "%.1f", -- FUEL_PUMP_1 + [161] = "%.1f", -- FUEL_PUMP_RASHOD + [402] = "%.4f", -- FUEL_PRESSURE { 0, 45 } ???? + [52] = "%.1f", -- FUEL_METER +--FUEL LIGHTS (in connection with previous) == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [501] = "%.f", -- FUEL_LIGHT_FUELPODC + [502] = "%.f", -- FUEL_LIGHT_1GR + [503] = "%.f", -- FUEL_LIGHT_450 + [504] = "%.f", -- FUEL_LIGHT_3GR + [505] = "%.f", -- FUEL_LIGHT_FUELPODW + [506] = "%.f", -- FUEL_LIGHT_RASHOD +--ENGINE START DEVICE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [403] = "%.1f", -- ENGINE_START_DEVICE_STATUS { -1, 0, 1, 2 } + [509] = "%.f", -- START_DEVICE_ZAZIG_LIGHT + [415] = "%.1f", -- ENGINE_OXYGENE_STATUS + [61] = "%.4f", -- ENGINE_OXYGENE_manometer +-- ENGINE and THROTTLE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [624] = "%.1f", -- SPS_state + [625] = "%.4f", -- KONUS_efficiency + [626] = "%.4f", -- SOPLO_efficiency + [50] = "%.4f", -- ENGINE_RPM + [670] = "%.4f", -- ENGINE_RPM2 + [51] = "%.4f", -- ENGINE_TEMP + [404] = "%.4f", -- ENGINE_STRESS + [507] = "%.f", -- FORSAZ_1_LIGHT + [508] = "%.f", -- FORSAZ_2_LIGHT + [512] = "%.f", -- NOZZLE_LIGHT + [517] = "%.f", -- KONUS_LIGHT + [513] = "%.f", -- OIL_LIGHT + [627] = "%.4f", -- OIL_PRESSURE + [534] = "%.f", -- FIRE_LIGHT + [405] = "%.1f", -- ENGINE_SURGE_DOORS_POZITION { -1, 0, 1 } +-- GIDRO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [418] = "%.4f", -- PRIMARY_GIDRO_Pressure + [419] = "%.4f", -- SECONDARY_GIDRO_Pressure + [126] = "%.4f", -- PRIMARY_GIDRO_Pressure_needle + [125] = "%.4f", -- SECONDARY_GIDRO_Pressure_needle + [171] = "%.1f", -- GIDRO_NR27_switch + [319] = "%.1f", -- GIDRO_ailerones_busters_switch + [515] = "%.f", -- HYDRAULIC_LIGHT + [514] = "%.f", -- BUSTER_LIGHT +--HELMET == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [306] = "%.1f", -- HELMET_heat_man_auto_switch + [310] = "%.1f", -- HELMET_quick_heat_button + [595] = "%.1f", -- HELMET_visor_switch +--AIR CONDITIONING == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [412] = "%.4f", -- AIR_CONDITION_cockpit_temperature +-- WARNING LIGHTS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [541] = "%.f", -- CANOPY_WARNING_LIGHT + [542] = "%.f", -- SORC_LIGHT + [407] = "%.f", -- WARNING_LIGHTS_CHECK_STATE + [516] = "%.f", -- MARKER_LIGHT + [518] = "%.f", -- STABILISATOR_LIGHT + [520] = "%.f", -- CHECK_GEAR_LIGHT + [521] = "%.f", -- FLAPS_LIGHT + [522] = "%.f", -- AIRBRAKE_LIGHT + [523] = "%.f", -- CENTRAL_PYLON_LIGHT + [524] = "%.f", -- RATO_L_LIGHT + [525] = "%.f", -- RATO_R_LIGHT + [526] = "%.f", -- PYLON_1_ON_LIGHT + [527] = "%.f", -- PYLON_2_ON_LIGHT + [528] = "%.f", -- PYLON_3_ON_LIGHT + [529] = "%.f", -- PYLON_4_ON_LIGHT + [530] = "%.f", -- PYLON_1_OFF_LIGHT + [531] = "%.f", -- PYLON_2_OFF_LIGHT + [532] = "%.f", -- PYLON_3_OFF_LIGHT + [533] = "%.f", -- PYLON_4_OFF_LIGHT +-- GIRO DEVICES == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [536] = "%.1f", -- GIRO_ARRETIR + [408] = "%.1f", -- GIRO_AGD_KSI_SAU_RLS_STATE + [409] = "%.1f", -- GIRO_DA200_KSI_SAU_RLS_STATE + [162] = "%.1f", -- GIRO_AGD_KSI_SAU_RLS_switch + [163] = "%.1f", -- GIRO_DA200_KSI_SAU_RLS_switch +-- ASP == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [539] = "%.1f", -- ASP_TGT_ACQUIRED_LIGHT + [538] = "%.1f", -- ASP_LAUNCH + [540] = "%.1f", -- ASP_DISENGAGE + [67] = "%.1f", -- GUN_camera_3D + [551] = "%.1f", -- ASP_DISTANCE + [552] = "%.4f", -- ASP_DISTANCE_MISSILE + [553] = "%.1f", -- RADAR_ERROR + [554] = "%.1f", -- RADAR_LOW_ALT + [555] = "%.1f", -- RADAR_FIX_BEAM + [556] = "%.1f", -- ASP_SCALE_BASE + [557] = "%.1f", -- ASP_SCALE_ANGLE + [558] = "%.1f", -- RADAR_LAUNCH + [559] = "%.1f", -- RADAR_MISSILE_HEAD_RDY + [560] = "%.1f", -- RADAR_JAMMED + [561] = "%.1f", -- RADAR_BROKEN + [562] = "%.1f", -- RADAR_DISENGAGE + [571] = "%.1f", -- RADAR_19A_1 + [572] = "%.1f", -- RADAR_19A_2 + [573] = "%.1f", -- RADAR_19A_3 + [574] = "%.1f", -- RADAR_19A_4 + [575] = "%.1f", -- RADAR_19A_5 + [576] = "%.1f", -- RADAR_19A_6 + [577] = "%.1f", -- RADAR_19A_7 + [578] = "%.1f", -- RADAR_19A_8 + [579] = "%.1f", -- SEAT_HEIGHT + [580] = "%.1f", -- IAB_BOX + [581] = "%.1f", -- IAB_LIGHT_1 + [582] = "%.1f", -- IAB_LIGHT_2 + [583] = "%.1f", -- IAB_LIGHT_3 + [584] = "%.1f", -- MISSILE_55_1 + [585] = "%.1f", -- MISSILE_55_2 + [586] = "%.1f", -- MISSILE_62 + [63] = "%.1f", -- TACTICAL_DROP_ARMED + [591] = "%.1f", -- SPS_BOX + [592] = "%.1f", -- SPS_HIGH + [593] = "%.1f", -- SPS_ILLUMINATION + [594] = "%.1f", -- SPS_LAUNCH + [598] = "%.1f", -- GUV_BOX + [701] = "%.1f", -- GUV_LAUNCH +-- SARPP == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [193] = "%.1f", -- SARPP_switch +-- SAU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [546] = "%.f", -- SAU_stabilization_LIGHT + [547] = "%.f", -- SAU_privedenie_LIGHT + [544] = "%.f", -- SAU_landing_COMMAND_LIGHT + [545] = "%.f", -- SAU_landing_AUTO_LIGHT +-- ARU == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [64] = "%.1f", -- ARU_3G_instrument +-- KONUS == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [66] = "%.1f", -- KONUS_UPES_3_instrument +-- DRAG CHUTE == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [550] = "%.f", -- GUN_GOTOVN_LIGHT +-- SPO == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == = + [601] = "%.f", -- SPO_L_F + [602] = "%.f", -- SPO_R_F + [603] = "%.f", -- SPO_R_B + [604] = "%.f", -- SPO_L_B + [605] = "%.f", -- SPO_MUTED +-- SOD == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + [606] = "%.1f", -- SOD_ANSWER + [607] = "%.1f", -- SRZO_ON + [608] = "%.1f", -- SRZO_CODE + [609] = "%.1f", -- SRZO_CIPH + [611] = "%.1f", -- SRZO_ERROR + [613] = "%.1f", -- ASP_BACKLIGHT_ON + [614] = "%.1f", -- ASP_BACKLIGHT_INTENSITY + [618] = "%.1f", -- NEEDLES_PHOSPHOR_LIGHT + [152] = "%.1f", -- RED_PANELLIGHT + [619] = "%.1f", -- RED_FLOODLIGHT + [620] = "%.1f", -- WHITE_PANELLIGHT + [621] = "%.1f", -- RED_INSTRUMENT + [622] = "%.1f", -- ASP_GLASS_LIGHT_INTENSITY + [652] = "%.4f", -- H_indicator_needle_max + [655] = "%.4f", -- COCKPIT_PRESSURE_ALTIMETER + [656] = "%.4f", -- COCKPIT_PRESSURE +-- Clock == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == + -- currtimeHours; currtimeMinutes; currtimeSeconds; flightTimeMeterStatus; + -- flightHours;flightMinutes; secondsMeterTimeMinutes; secondsMeterTimeSeconds; + -- 115; 116; 117; 118; 119; 120; 121; 122; + [115] = "%.4f", -- currtimeHours + [116] = "%.4f", -- currtimeMinutes + [117] = "%.4f", -- currtimeSeconds + [118] = "%.4f", -- flightTimeMeterStatus + [119] = "%.4f", -- flightHours + [120] = "%.4f", -- flightMinutes + [121] = "%.4f", -- secondsMeterTimeMinutes + [122] = "%.4f", -- secondsMeterTimeSeconds +} +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + -- cockpit mechanics + --[718] = "%.1f", -- Canopy Switch, OPEN/OFF/CLOSE {-1.0, 1.0} + --[818] = "%.1f", -- Emergency Jettison Handle, IN/OUT {0.0, 1.0} + +-- DC & AC buses & giro devices + [165] = "%.1f", -- Battery On/Off + [155] = "%.1f", -- Battery Heat On/Off + [166] = "%.1f", -- DC Generator On/Off + [169] = "%.1f", -- AC Generator On/Off + [153] = "%.1f", -- PO-750 Inverter #1 On/Off + [154] = "%.1f", -- PO-750 Inverter #2 On/Off + [164] = "%.1f", -- Emergency Inverter +-- GIRO + [162] = "%.1f", -- Giro, NPP, SAU, RLS Signal, KPP Power On/Off + [163] = "%.1f", -- DA-200 Signal, Giro, NPP, RLS, SAU Power On/Off +-- FUEL_PUMPS & FUEL_SYSTEM (merged) + [159] = "%.1f", -- Fuel Tanks 3rd Group, Fuel Pump + [160] = "%.1f", -- Fuel Tanks 1st Group, Fuel Pump + [161] = "%.1f", -- Drain Fuel Tank, Fuel Pump + [274] = "%.1f", -- Fuel Quantity Set +-- ENGINE START DEVICE + [302] = "%.1f", -- APU On/Off + [288] = "%.1f", -- Engine Cold / Normal Start + [289] = "%.1f", -- Start Engine + [301] = "%.1f", -- Engine Emergency Air Start + [616] = "%.1f", -- Engine Stop/Lock +-- ACCELEROMETER + [228] = "%.1f", -- Accelerometer Reset +-- PITOT TUBES and related things that use dc bus for heating + [229] = "%.1f", -- Pitot tube Selector Main/Emergency + [279] = "%.1f", -- Pitot tube/Periscope/Clock Heat + [280] = "%.1f", -- Secondary Pitot Tube Heat +-- DA-200 + [261] = "%.1f", -- Variometer Set +-- ENGINE + [308] = "%.1f", -- Anti surge doors - Auto/Manual + [300] = "%.1f", -- Afterburner/Maximum Off/On + [320] = "%.1f", -- Emergency Afterburner Off/On +-- FIRE EXTINGUISHER + [303] = "%.1f", -- Fire Extinguisher Off/On + [324] = "%.1f", -- Fire Extinguisher Cover + [325] = "%.1f", -- Fire Extinguisher +-- LIGHTS + [612] = "%.1f", -- Cockpit Texts Back-light default_axis + [156] = "%.1f", -- Instruments Back-light default_axis + [157] = "%.1f", -- Main Red Lights default_axis + [222] = "%.1f", -- Main White Lights default_axis + [194] = "%.1f", -- Navigation Lights Off/Min/Med/Max + [323] = "%.1f", -- Landing Lights Off/Taxi/Land +-- LIGHTS WARNING + [195] = "%.1f", -- CheckWarningLights11 + [196] = "%.1f", -- CheckWarningLights21 + [273] = "%.1f", -- CheckWarningLights31 + [282] = "%.1f", -- CheckWarningLights41 + [283] = "%.1f", -- CheckWarningLights51 + [322] = "%.1f", -- CheckWarningLights61 + [657] = "%.1f", -- SORC +-- Radio + [173] = "%.1f", -- Radio System On/Off + [208] = "%.1f", -- Radio / Compass + [209] = "%.1f", -- Squelch On/Off + [210] = "%.1f", -- Radio Volume + [211] = "%.1f", -- Radio Channel + [315] = "%.1f", -- Radio PTT +-- ARK + [174] = "%.1f", -- ARK On/Off + [198] = "%.1f", -- ARK Sound + [212] = "%.1f", -- ARK Change + [189] = "%.1f", -- ARK Zone + [197] = "%.1f", -- ARK Mode - Antenna / Compass + [254] = "%.1f", -- Marker Far/Near +-- RSBN + [176] = "%.1f", -- RSBN On/Off + [240] = "%.1f", -- RSBN Mode Land/Navigation/Descend + [340] = "%.1f", -- RSBN / ARK + [294] = "%.1f", -- RSBN Identify + [347] = "%.1f", -- RSBN self-test +--RSBN Panel + [345] = "%.1f", -- RSBN Sound + [351] = "%.1f", -- RSBN Navigation + [352] = "%.1f", -- PRMG Landing + [366] = "%.1f", -- RSBN Reset + [367] = "%.1f", -- RSBN Bearing + [368] = "%.1f", -- RSBN Distance +-- SAU + [179] = "%.1f", -- SAU On/Off + [180] = "%.1f", -- SAU Pitch On/Off + [343] = "%.1f", -- SAU - Stabilize + [376] = "%.1f", -- SAU cancel current mode + [377] = "%.1f", -- SAU - Recovery + [344] = "%.1f", -- SAU Preset - Limit Altitude + [341] = "%.1f", -- SAU - Landing - Command + [342] = "%.1f", -- SAU - Landing - Auto + [348] = "%.1f", -- SAU Reset/Off +-- SPO + [202] = "%.1f", -- SPO-10 RWR On/Off + [226] = "%.1f", -- SPO-10 Test + [227] = "%.1f", -- SPO-10 Night / Day + [225] = "%.1f", -- SPO-10 Volume +-- SRZO IFF + [188] = "%.1f", -- SRZO IFF Coder/Decoder On/Off + [192] = "%.1f", -- SRZO Codes + [346] = "%.1f", -- IFF System 'Type 81' On/Off + [190] = "%.1f", -- Emergency Transmitter Cover + [191] = "%.1f", -- Emergency Transmitter On/Off + [427] = "%.1f", -- SRZO Self Destruct Cover + [428] = "%.1f", -- SRZO Self Destruct +-- SOD + [200] = "%.1f", -- SOD IFF On/Off + [199] = "%.1f", -- SOD Identify + [201] = "%.1f", -- SOD Wave Selector 3/1/2 + [204] = "%.1f", -- SOD Modes +-- RADAR + [205] = "%.1f", -- Radar Off/Prep/On + [206] = "%.1f", -- Low Altitude Off/Comp/On + [207] = "%.1f", -- Locked Beam On/Off + [266] = "%.1f", -- Radar Screen Magnetic Reset + [330] = "%.1f", -- Radar Interferes - Continues + [331] = "%.1f", -- Radar Interferes - Temporary + [332] = "%.1f", -- Radar Interferes - Passive + [333] = "%.1f", -- Radar Interferes - Weather + [334] = "%.1f", -- Radar Interferes - IFF + [335] = "%.1f", -- Radar Interferes - Low Speed + [336] = "%.1f", -- Radar Interferes - Self-test + [337] = "%.1f", -- Radar Interferes - Reset + [378] = "%.1f", -- Lock Target + [623] = "%.1f", -- Radar Polar Filter +-- SPRD + [167] = "%.1f", -- SPRD (RATO) System On/Off + [168] = "%.1f", -- SPRD (RATO) Drop System On/Off + [252] = "%.1f", -- SPRD (RATO) Start Cover + [253] = "%.1f", -- SPRD (RATO) Start + [317] = "%.1f", -- SPRD (RATO)t Drop Cover + [318] = "%.1f", -- SPRD (RATO) Drop +-- CONTROL SYSTEM ------------- subsystems -------------------------------------------- +-- SPS + [293] = "%.1f", -- SPS System Off/On +-- ARU + [295] = "%.1f", -- ARU System - Manual/Auto + [296] = "%.1f", -- ARU System - Low Speed/Neutral/High Speed +-- Airbrake + [316] = "%.1f", -- Airbrake - Out/In +-- Gear brakes + [299] = "%.1f", -- ABS Off/On + [238] = "%.1f", -- Nosegear Brake Off/On + [237] = "%.1f", -- Emergency Brake +-- Gears + [326] = "%.1f", -- Gear Handle Fixator + [327] = "%.1f", -- Gear Up/Neutral/Down + [223] = "%.1f", -- Main Gears Emergency Release Handle + [281] = "%.1f", -- Nose Gear Emergency Release Handle +-- Flaps + [311] = "%.1f", -- Flaps Neutral + [312] = "%.1f", -- Flaps Take-Off + [313] = "%.1f", -- Flaps Landing + [314] = "%.1f", -- Flaps Reset buttons +-- Drag chute + [298] = "%.1f", -- Release Drag Chute + [304] = "%.1f", -- Drop Drag Chute Cover + [305] = "%.1f", -- Drop Drag Chute +--TRIMMER + [172] = "%.1f", -- Trimmer On/Off + [379] = "%.1f", -- Trimmer Pitch Up/Down +-- KONUS + [170] = "%.1f", -- Nosecone On/Off + [309] = "%.1f", -- Nosecone Control - Manual/Auto + [236] = "%.1f", -- Nosecone manual position controller +-- SOPLO + [291] = "%.1f", -- Engine Nozzle 2 Position Emergency Control +--MAIN_HYDRO and BUSTER_HYDRO == == == == == == == == == == == == == == == == == == == TEMPORARY MERGED == == == == == == == == == == == == == == == == == == == == == == + [171] = "%.1f", -- Emergency Hydraulic Pump On/Off + [319] = "%.1f", -- Aileron Booster - Off/On +--KPP + [177] = "%.1f", -- KPP Main/Emergency + [259] = "%.1f", -- KPP Cage + [260] = "%.1f", -- KPP Set +--IAS / TAS / KSI (NPP) + [178] = "%.1f", -- NPP On/Off + [258] = "%.1f", -- NPP Adjust + [263] = "%.1f", -- NPP Course set +-- ALTIMETER and radioALTIMETER + [175] = "%.1f", -- Radio Altimeter/Marker On/Off + [284] = "%.1f", -- Dangerous Altitude Warning Set + [262] = "%.1f", -- Altimeter pressure knob +-- OXYGENE_SYSTEM + [285] = "%.1f", -- Helmet Air Condition Off/On + [286] = "%.1f", -- Emergency Oxygen Off/On + [287] = "%.1f", -- Mixture/Oxygen +-- CANOPY + [328] = "%.1f", -- Hermetize Canopy + [329] = "%.1f", -- Secure Canopy + [375] = "%.1f", -- Canopy Open + [385] = "%.1f", -- Canopy Close + [239] = "%.1f", -- Canopy Anti Ice + [224] = "%.1f", -- Canopy Emergency Release Handle + [649] = "%.1f", -- Canopy Ventilation System +-- ASP Gunsight + [186] = "%.1f", -- ASP Optical sight On/Off + [241] = "%.1f", -- ASP Main Mode - Manual/Auto + [242] = "%.1f", -- ASP Mode - Bombardment/Shooting + [243] = "%.1f", -- ASP Mode - Missiles-Rockets/Gun + [244] = "%.1f", -- ASP Mode - Giro/Missile + [249] = "%.1f", -- Pipper On/Off + [250] = "%.1f", -- Fix net On/Off + [245] = "%.1f", -- Target Size + [246] = "%.1f", -- Intercept Angle + [247] = "%.1f", -- Scale Backlights control + [248] = "%.1f", -- Pipper light control + [251] = "%.1f", -- Fix Net light control + [384] = "%.1f", -- TDC Range / Pipper Span control +-- WEAPON_CONTROL + [181] = "%.1f", -- Missiles - Rockets Heat On/Off + [182] = "%.1f", -- Missiles - Rockets Launch On/Off + [183] = "%.1f", -- Pylon 1-2 Power On/Off + [184] = "%.1f", -- Pylon 3-4 Power On/Off + [185] = "%.1f", -- GS-23 Gun On/Off + [187] = "%.1f", -- Guncam On/Off + [277] = "%.1f", -- Tactical Drop Cover + [278] = "%.1f", -- Tactical Drop + [275] = "%.1f", -- Emergency Missile/Rocket Launcher Cover + [276] = "%.1f", -- Emergency Missile/Rocket Launcher + [256] = "%.1f", -- Drop Wing Fuel Tanks Cover + [257] = "%.1f", -- Drop Wing Fuel Tanks + [386] = "%.1f", -- Drop Center Fuel Tank + [269] = "%.1f", -- Drop Payload - Outer Pylons Cover + [270] = "%.1f", -- Drop Payload - Outer Pylons + [271] = "%.1f", -- Drop Payload - Inner Pylons Cover + [272] = "%.1f", -- Drop Payload - Inner Pylons + [230] = "%.1f", -- Weapon Mode - Air/Ground + [231] = "%.1f", -- Weapon Mode - IR Missile/Neutral/SAR Missile + [232] = "%.1f", -- Activate Gun Loading Pyro - 1 + [233] = "%.1f", -- Activate Gun Loading Pyro - 2 + [234] = "%.1f", -- Activate Gun Loading Pyro - 3 + [235] = "%.1f", -- Weapon Selector + [297] = "%.1f", -- Missile Seeker Sound + [381] = "%.1f", -- Fire Gun + [382] = "%.1f", -- Release Weapon + [383] = "%.1f", -- Release Weapon Cover +-- HELMET_VISOR + [306] = "%.1f", -- Helmet Heat - Manual/Auto + [310] = "%.1f", -- Helmet Quick Heat + [369] = "%.1f", -- Helmet visor - off/on +-- AIR CONDITIONING + [292] = "%.1f", -- Cockpit Air Condition Off/Cold/Auto/Warm +-- SARPP + [193] = "%.1f", -- SARPP-12 Flight Data Recorder On/Off +-- Flight Control + +-- Dummy buttons/switches + [632] = "%.1f", -- Radar emission - Cover + [633] = "%.1f", -- Radar emission - Combat/Training + [634] = "%.1f", -- G-Suit Max/Min valve + [635] = "%.1f", -- Electric Bus Nr.1 - Cover + [636] = "%.1f", -- Electric Bus Nr.1 + [637] = "%.1f", -- Electric Bus Nr.2 + [638] = "%.1f", -- 1.7 Mach Test Button - Cover + [639] = "%.1f", -- 1.7 Mach Test Button + [640] = "%.1f", -- BU-45 Buster System Separation + [642] = "%.1f", -- SOD Control PBU-1 + [641] = "%.1f", -- SOD Control PBU-2 + [643] = "%.1f", -- Eject + [644] = "%.1f", -- Ejection Seat Emergency Oxygen + [645] = "%.1f", -- UK-2M Mic Amplifier M/L + [646] = "%.1f", -- UK-2M Mic Amplifier GS/KM + [647] = "%.1f", -- Suit Ventilation + [648] = "%.1f", -- Harness Separation + [650] = "%.1f", -- Harness Loose/Tight + [651] = "%.1f", -- Throttle Fixation +-- IAB PBK-3 + [387] = "%.1f", -- Emergency Jettison + [388] = "%.1f", -- Emergency Jettison Armed / Not Armed + [389] = "%.1f", -- Tactical Jettison + [390] = "%.1f", -- Special AB / Missile-Rocket-Bombs-Cannon + [391] = "%.1f", -- Brake Chute + [392] = "%.1f", -- Detonation Air / Ground +-- SPS 141-100 + [393] = "%.1f", -- "On / Off" + [394] = "%.1f", -- Transmit / Receive + [395] = "%.1f", -- Program I / II + [396] = "%.1f", -- Continuous / Impuls + [397] = "%.1f", -- Test + [398] = "%.1f", -- Dispenser Auto / Manual + [399] = "%.1f", -- Off / Parallel / Full + [400] = "%.1f", -- Manual Activation button - Cover + [401] = "%.1f", -- Manual Activation button +-- GUV Control Box -/N/ GUV is useless, it's mostly anti-infantry weapon + [420] = "%.1f", -- On / Off + [421] = "%.1f", -- MAIN GUN / UPK Guns + [422] = "%.1f", -- LOAD 1 + [425] = "%.1f", -- LOAD 2 + [424] = "%.1f", -- LOAD 3 +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] + + -- ADI/KPP correction + ExportScript.Tools.SendData(565, string.format("%.4f", (mainPanelDevice:get_argument_value(565) * 3))) -- RSBN_KPP_kurs_director + ExportScript.Tools.SendData(566, string.format("%.4f", (mainPanelDevice:get_argument_value(566) * 3))) -- RSBN_KPP_glisada_director + + -- HSI/NPP correction + ExportScript.Tools.SendData(36, string.format("%.4f", (mainPanelDevice:get_argument_value(36) - 0.5))) +end + +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] +end + +----------------------------------------------------- +-- LOW IMPORTANCE EXPORTS -- +-- done every gExportLowTickInterval export events -- +----------------------------------------------------- + +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) + --[[ + every frame export to hardware + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + + --===================================================================================== + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) + + local ltmp1 = 0 + for ltmp2 = 0, 13, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] +--[[ + local ltmp1 = 0 + for ltmp2 = 1, 73, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end +]] +end + +----------------------------- +-- Custom functions -- +----------------------------- + +function ExportScript.genericRadio(key, value, hardware) +end diff --git a/ExportsModules/MiG-29A.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-29A.lua similarity index 100% rename from ExportsModules/MiG-29A.lua rename to Scripts/DCS-ExportScript/ExportsModules/MiG-29A.lua diff --git a/ExportsModules/MiG-29S.lua b/Scripts/DCS-ExportScript/ExportsModules/MiG-29S.lua similarity index 100% rename from ExportsModules/MiG-29S.lua rename to Scripts/DCS-ExportScript/ExportsModules/MiG-29S.lua diff --git a/Scripts/DCS-ExportScript/ExportsModules/P-51D.lua b/Scripts/DCS-ExportScript/ExportsModules/P-51D.lua new file mode 100644 index 0000000..3276211 --- /dev/null +++ b/Scripts/DCS-ExportScript/ExportsModules/P-51D.lua @@ -0,0 +1,331 @@ +-- P-51D Export +-- Version 1.0.0 BETA + +ExportScript.FoundDCSModule = true + +ExportScript.ConfigEveryFrameArguments = +{ + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] + -- Flight Instruments + [11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7} + [29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6} + -- Altimeter + [97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0} + [96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0} + [24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0} + [25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0} + -- Artificial horizon + [15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} + [14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} + [16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0} + [20] = "%.1f", -- AHorizon_Caged {0.0, 1.0} + -- directional gyro + [12] = "%.4f", -- GyroHeading + -- turn indicator + [27] = "%.4f", -- TurnNeedle {-1.0, 1.0} + [28] = "%.4f", -- Slipball {-1.0, 1.0} + -- oxygen pressure indicator + [34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} + [33] = "%.4f", -- Oxygen_Flow_Blinker + -- fuel system + [155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} + [156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} + [160] = "%.4f", -- Fuel_Tank_Fuselage {0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,85.0} {0.0,0.12,0.28,0.40,0.51,0.62,0.72,0.83,0.96,1.0} + [32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0} + -- A-11 clock + [4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0} + [5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0} + [6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0} + -- AN5730 remote compass + [1] = "%.4f", -- CompassHeading + [2] = "%.4f", -- CommandedCourse + [3] = "%.4f", -- CommandedCourseKnob + -- TailRadarWarning + [161] = "%.f", -- Lamp TailRadarWarning + -- SCR-522A Control panel + [122] = "%.f", -- A_channel_light + [123] = "%.f", -- B_channel_light + [124] = "%.f", -- C_channel_light + [125] = "%.f", -- D_channel_light + [126] = "%.f", -- Transmit_light + -- hydraulic pressure + [78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0} + -- Landing gears handle + [150] = "%.4f", -- Landing_Gear_Handle + [151] = "%.4f", -- Landing_Gear_Handle_Indoor + [80] = "%.f", -- LandingGearGreenLight + [82] = "%.f", -- LandingGearRedLight + -- gauges + [10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} + [23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} + [9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0} + [21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} + [22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1} + [30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0} + [31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0} + [164] = "%.1f", -- Left_Fluor_Light + [165] = "%.1f", -- Right_Fluor_Light + [59] = "%.f", -- Hight_Blower_Lamp + -- Trimmer + [170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0} + [172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0} + [171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0} + [174] = "%.4f", -- Control_Lock_Bracket + [175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} + [177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} + [178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} + [101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} + -- light + [185] = "%.1f", -- Left_cockpit_light + [186] = "%.1f", -- Right_cockpit_light + [190] = "%.4f", -- warEmergencyPowerLimWire + ------------- + --[181] = "%.4f", -- Panel_Shake_Z + --[180] = "%.4f", -- Panel_Shake_Y + --[189] = "%.4f", -- Panel_Rot_X + --[162] = "%.1f", -- Canopy_Trucks + --[163] = "%.1f", -- Canopy_Visibility + -- Stick + --[50] = "%.4f", -- StickPitch + --[51] = "%.4f", -- StickBank + -- RudderPedals + --[54] = "%.4f", -- RudderPedals + --[55] = "%.4f", -- Left_Wheel_Brake + --[56] = "%.4f", -- Right_Wheel_Brake + -- K-14 gunsight + [36] = "%.4f", -- sightRange + --[188] = "%.4f", -- K_14_Shake_Z + --[187] = "%.4f", -- K_14_Shake_Y + ------------- + --[45] = "%.4f", -- ThrottleTwistGrip + ------------- + [77] = "%.4f", -- Rocket_Counter + ------------- + --[413] = "%.1f", -- WindShieldDamages + --[412] = "%.1f", -- WindShieldOil +} + +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + -- Right Swich Panel + [102] = "%d", -- Generator Connect/Disconnect + [103] = "%d", -- Battery Connect/Disconnect + [104] = "%d", -- Gun Heating ON/OFF + [105] = "%d", -- Pitot Heating ON/OFF + [106] = "%d", -- Wing Position Lights Bright/Off/Dim + [107] = "%d", -- Tail Position Lights Bright/Off/Dim + [108] = "%d", -- Red Recognition Light Key/Off/Steady + [109] = "%d", -- Green Recognition Light Key/Off/Steady + [110] = "%d", -- Amber Recognition Light Key/Off/Steady + [111] = "%d", -- Recognition Lights Key + [112] = "%d", -- Circuit Protectors Reset + [100] = "%.4f", -- Right Fluorescent Light (rotary) + [90] = "%.4f", -- Left Fluorescent Light (rotary) + -- Flight Instrument panel + [3] = "%.4f", -- Course Set (rotary) + [13] = "%.4f", -- Heading Set/Cage (rotary) + [179] = "%d", -- Heading Set/Cage Button + [17] = "%.4f", -- Pitch Adjustment (rotary) + [18] = "%.4f", -- Cage (rotary) + [19] = "%d", -- Cage Button + [8] = "%d", -- Winding/Adjustment Clock Button + [7] = "%.4f", -- Winding/Adjustment Clock (rotary) + [26] = "%.4f", -- Set Pressure (rotary) + -- SCR-522A Control panel + [117] = "%d", -- Radio ON/OFF + [118] = "%d", -- A Channel Activate + [119] = "%d", -- B Channel Activate + [120] = "%d", -- C Channel Activate + [121] = "%d", -- D Channel Activate + [127] = "%.4f", -- Radio Lights Dimmer (rotary) + [116] = "%.4f", -- Radio Audio Volume (rotary) + [44] = "%d", -- Microphone On + [200] = "%d", -- Arm rest + [129] = "%d", -- Switch Locking Lever + [128] = "%d", -- Radio Mode Transmit/Receive/Remote + ------------- + [71] = "%.4f", -- Cockpit Lights (rotary) + [66] = "%0.1f", -- Ignition Off/Right/Left/Both + [67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On + [72] = "%d", -- Silence Landing Gear Warning Horn Cut Off + -- Bomb Arm/Chemical + [69] = "%d", -- Left Bomb Arm/Chemical + [70] = "%d", -- Right Bomb Arm/Chemical + -- Release Mode + [68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm + [73] = "%0.1f", -- Rockets Release Mode Off/Single/Auto + [74] = "%d", -- Rockets Delay Switch Delay/Int + [75] = "%0.4f", -- Rockets Counter Control + -- Engine Control Panel + [58] = "%d", -- Supercharger Switch Cover + [57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH + [60] = "%d", -- High Blower Lamp Test + [61] = "%d", -- Fuel Booster On/Off + [62] = "%d", -- Oil Dilute Activate + [63] = "%d", -- Starter Activate + [64] = "%d", -- Starter Switch Cover + [65] = "%d", -- Primer Activate + -- Oxygen Regulator + [131] = "%d", -- Auto-Mix On-Off + [130] = "%0.4f", -- Oxygen Emergency By-pass + -- Fuel system + [85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank + [86] = "%d", -- Fuel Shut-Off Valve ON/OFF + -- AN/APS-13 + [114] = "%d", -- ail Warning Radar Power ON/OFF + [115] = "%d", -- Tail Warning Radar Test + [113] = "%.4f", -- Tail Warning Radar Light Control (rotary) + ------------- + [79] = "%d", -- Hydraulic Release Knob + [94] = "%.4f", -- Flaps Control Handle (rotary) + [84] = "%d", -- Parking Brake Handle + [81] = "%d", -- Safe Landing Gear Light Test + [83] = "%d", -- Unsafe Landing Gear Light Test + -- Detrola receiver + [137] = "%.4f", -- Detrola Frequency Selector (rotary) + [138] = "%.4f", -- Detrola Volume (rotary) + -- canopy + [147] = "%.4f", -- Canopy Hand Crank (rotary) + [149] = "%d", -- Canopy Emergency Release Handle + -- AN/ARA-8 + [152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING + [153] = "%d", -- Homing Adapter Power On/Off + [154] = "%d", -- Homing Adapter's Circuit Breaker + -- SCR-695 + [139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6 + [140] = "%d", -- IFF Power On/Off + [141] = "%d", -- IFF TIME/OFF/ON + [142] = "%d", -- IFF Detonator Circuit On/Off + [143] = "%d", -- IFF Distress Signal On/Off + [145] = "%d", -- IFF Detonator Left + [146] = "%d", -- IFF Detonator Right + -- Trimmers + [91] = "%.4f", -- Aileron Trim (rotary) + [92] = "%.4f", -- Elevator Trim (rotary) + [93] = "%.4f", -- Rudder Trim (rotary) + ------------- + [157] = "%.4f", -- Defroster (rotary) + [158] = "%.4f", -- Cold Air (rotary) + [159] = "%.4f", -- Hot Air (rotary) + ------------- + [89] = "%d", -- Landing Light On/Off + [168] = "%d", -- Coolant Control Cover + [87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control + [169] = "%d", -- Oil Control Cover + [88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control + [134] = "%0.1f", -- Carburetor Cold Air Control (rotary) + [135] = "%0.1f", -- Carburetor Warm Air Control (rotary) + [47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH + [43] = "%.4f", -- Throttle (rotary) + [46] = "%.4f", -- Propeller RPM (rotary) + [173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position + [48] = "%.4f", -- Lock Throttle (rotary) + [49] = "%.4f", -- Lock Propeller & Mixture (rotary) + [176] = "%d", -- G-meter reset + [183] = "%d", -- Mirror +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] +end + +----------------------------------------------------- +-- LOW IMPORTANCE EXPORTS -- +-- done every gExportLowTickInterval export events -- +----------------------------------------------------- + +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) + --[[ + every frame export to hardware + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + + --===================================================================================== + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) + + local ltmp1 = 0 + for ltmp2 = 0, 13, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] +--[[ + local ltmp1 = 0 + for ltmp2 = 1, 73, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end +]] +end + +----------------------------- +-- Custom functions -- +----------------------------- + +function ExportScript.genericRadio(key, value, hardware) +end diff --git a/ExportsModules/Su-25.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-25.lua similarity index 100% rename from ExportsModules/Su-25.lua rename to Scripts/DCS-ExportScript/ExportsModules/Su-25.lua diff --git a/ExportsModules/Su-25T.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua similarity index 95% rename from ExportsModules/Su-25T.lua rename to Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua index 796a684..ded58d3 100644 --- a/ExportsModules/Su-25T.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/Su-25T.lua @@ -1,19 +1,19 @@ -- Su-25T Export --- Version 0.9.9 BETA +-- Version 1.0.0 BETA -gES_FoundFCModule = true +ExportScript.FoundFCModule = true -- auxiliary function -dofile(gES_ExportModulePath.."FC_AuxiliaryFuntions.lua") +dofile(ExportScript.Config.ExportModulePath.."FC_AuxiliaryFuntions.lua") ----------------------------------------- -- FLAMING CLIFFS AIRCRAFT / Su-25T -- -- FC aircraft don't support GetDevice -- ----------------------------------------- -function ProcessGlassCockpitFCHighImportanceConfig() - - local myData = LoGetSelfData() +function ExportScript.ProcessIkarusFCHighImportanceConfig() + local lFunctionTyp = "Ikarus" -- function type for shared function + local myData = nil -- = LoGetSelfData() if (myData) then local lLatitude = myData.LatLongAlt.Lat -- LATITUDE @@ -140,15 +140,20 @@ function ProcessGlassCockpitFCHighImportanceConfig() FC_Russian_Clock_late(12) end else - WriteToLog("Unknown FC Error, no LoGetSelfData.") + --WriteToLog("Unknown FC Error, no LoGetSelfData.") end end -function ProcessHARDWAREConfigHighImportance() +function ExportScript.ProcessDACConfigHighImportance() + local lFunctionTyp = "DAC" -- function type for shared function end -function ProcessGlassCockpitFCLowImportanceConfig() +function ExportScript.ProcessIkarusFCLowImportanceConfig() + local lFunctionTyp = "Ikarus" -- function type for shared function + + ExportScript.AF.SPO15RWR(lFunctionTyp) + ExportScript.AF.WeaponPanel_SU25(lFunctionTyp) if gES_GlassCockpitType == 1 then -- HELIOS Version 1.3 @@ -299,14 +304,14 @@ function ProcessGlassCockpitFCLowImportanceConfig() --WriteToLog('lNameByType: '..dump(lNameByType)) end -function ProcessHARDWAREConfigLowImportance() --- where necessary, specify HardwareID, example WeaponStatusPanel(2) - WeaponStatusPanel() - MechanicalDevicesIndicator() - StatusLamp() - FuelQuantityIndicator() - SightingSystem() - SPO15RWR() +function ExportScript.ProcessDACConfigLowImportance() + local lFunctionTyp = "DAC" -- function type for shared function +-- WeaponStatusPanel() +-- MechanicalDevicesIndicator() +-- StatusLamp() +-- FuelQuantityIndicator() +-- SightingSystem() +-- SPO15RWR() end ----------------------------- diff --git a/ExportsModules/Su-27.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-27.lua similarity index 100% rename from ExportsModules/Su-27.lua rename to Scripts/DCS-ExportScript/ExportsModules/Su-27.lua diff --git a/ExportsModules/Su-33.lua b/Scripts/DCS-ExportScript/ExportsModules/Su-33.lua similarity index 100% rename from ExportsModules/Su-33.lua rename to Scripts/DCS-ExportScript/ExportsModules/Su-33.lua diff --git a/Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua b/Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua new file mode 100644 index 0000000..58e0b20 --- /dev/null +++ b/Scripts/DCS-ExportScript/ExportsModules/TF-51D.lua @@ -0,0 +1,310 @@ +-- TF-51D Export +-- Version 1.0.0 BETA + +ExportScript.FoundDCSModule = true + +ExportScript.ConfigEveryFrameArguments = +{ + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] + -- Flight Instruments + [11] = "%.4f", -- AirspeedNeedle {0,50,100,150,200,250,300,350,400,450,500,550,600,650,700} {0.0,0.05,0.10,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7} + [29] = "%.4f", -- Variometer {-6000,-4000,-2000,2000,4000,6000} {-0.6,-0.4,-0.2,0.2,0.4,0.6} + -- Altimeter + [97] = "%.4f", -- Altimeter_Pressure {28.1, 31.0}{0.0, 1.0} + [96] = "%.41f", -- Altimeter_10000_footPtr {0.0, 100000.0}{0.0, 1.0} + [24] = "%.4f", -- Altimeter_1000_footPtr {0.0, 10000.0}{0.0, 1.0} + [25] = "%.4f", -- Altimeter_100_footPtr{0.0, 1000.0}{0.0, 1.0} + -- Artificial horizon + [15] = "%.4f", -- AHorizon_Pitch {1.0, -1.0} + [14] = "%.4f", -- AHorizon_Bank {1.0, -1.0} + [16] = "%.1f", -- AHorizon_PitchShift {-1.0, 1.0} + [20] = "%.1f", -- AHorizon_Caged {0.0, 1.0} + -- directional gyro + [12] = "%.4f", -- GyroHeading + -- turn indicator + [27] = "%.4f", -- TurnNeedle {-1.0, 1.0} + [28] = "%.4f", -- Slipball {-1.0, 1.0} + -- oxygen pressure indicator + [34] = "%.4f", -- Oxygen_Pressure {0.0, 500.0} {0.0, 1.0} + [33] = "%.4f", -- Oxygen_Flow_Blinker + -- fuel system + [155] = "%.4f", -- Fuel_Tank_Left {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} + [156] = "%.4f", -- Fuel_Tank_Right {0.0,5.0,15.0,30.0,45.0,60.0,75.0,92.0} {0.0,0.2,0.36,0.52,0.65,0.77,0.92,1.0} + [32] = "%.4f", -- Fuel_Pressure {0.0, 25.0} {0.0, 1.0} + -- A-11 clock + [4] = "%.4f", -- CLOCK_currtime_hours {0.0, 12.0}{0.0, 1.0} + [5] = "%.4f", -- CLOCK_currtime_minutes {0.0, 60.0}{0.0, 1.0} + [6] = "%.4f", -- CLOCK_currtime_seconds {0.0, 60.0}{0.0, 1.0} + -- AN5730 remote compass + [1] = "%.4f", -- CompassHeading + [2] = "%.4f", -- CommandedCourse + [3] = "%.4f", -- CommandedCourseKnob + -- TailRadarWarning + [161] = "%.f", -- Lamp TailRadarWarning + -- SCR-522A Control panel + [122] = "%.f", -- A_channel_light + [123] = "%.f", -- B_channel_light + [124] = "%.f", -- C_channel_light + [125] = "%.f", -- D_channel_light + [126] = "%.f", -- Transmit_light + -- hydraulic pressure + [78] = "%.4f", -- Hydraulic_Pressure {0.0, 2000.0} {0.0, 1.0} + -- Landing gears handle + [150] = "%.4f", -- Landing_Gear_Handle + [151] = "%.4f", -- Landing_Gear_Handle_Indoor + [80] = "%.f", -- LandingGearGreenLight + [82] = "%.f", -- LandingGearRedLight + -- gauges + [10] = "%.4f", -- Manifold_Pressure {10.0, 75.0} {0.0, 1.0} + [23] = "%.4f", -- Engine_RPM {0.0, 4500.0} {0.0, 1.0} + [9] = "%.4f", -- Vacuum_Suction {0.0, 10.0} {0.0, 1.0} + [21] = "%.4f", -- Carb_Temperature {-80, 150} {-0, 1} + [22] = "%.4f", -- Coolant_Temperature {-80, 150} {-0, 1} + [30] = "%.4f", -- Oil_Temperature {0.0, 100.0} {0, 1.0} + [31] = "%.4f", -- Oil_Pressure {0.0, 200.0} {0, 1.0} + [164] = "%.1f", -- Left_Fluor_Light + [165] = "%.1f", -- Right_Fluor_Light + [59] = "%.f", -- Hight_Blower_Lamp + -- Trimmer + [170] = "%.4f", -- Aileron_Trimmer {-1.0, 1.0} + [172] = "%.4f", -- Rudder_Trimmer {-1.0, 1.0} + [171] = "%.4f", -- Elevator_Trimmer {-1.0, 1.0} + [174] = "%.4f", -- Control_Lock_Bracket + [175] = "%.4f", -- Accelerometer_main {-5.0, 12.0} {0.0, 1.0} + [177] = "%.4f", -- Accelerometer_min {-5.0, 12.0} {0.0, 1.0} + [178] = "%.4f", -- Accelerometer_max {-5.0, 12.0} {0.0, 1.0} + [101] = "%.4f", -- Ammeter {0.0, 150.0} {0.0, 1.0} + -- light + [185] = "%.1f", -- Left_cockpit_light + [186] = "%.1f", -- Right_cockpit_light + [190] = "%.4f", -- warEmergencyPowerLimWire +} + +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + -- Right Swich Panel + [102] = "%d", -- Generator Connect/Disconnect + [103] = "%d", -- Battery Connect/Disconnect + [104] = "%d", -- Gun Heating ON/OFF + [105] = "%d", -- Pitot Heating ON/OFF + [106] = "%d", -- Wing Position Lights Bright/Off/Dim + [107] = "%d", -- Tail Position Lights Bright/Off/Dim + [108] = "%d", -- Red Recognition Light Key/Off/Steady + [109] = "%d", -- Green Recognition Light Key/Off/Steady + [110] = "%d", -- Amber Recognition Light Key/Off/Steady + [111] = "%d", -- Recognition Lights Key + [112] = "%d", -- Circuit Protectors Reset + [100] = "%.4f", -- Right Fluorescent Light (rotary) + [90] = "%.4f", -- Left Fluorescent Light (rotary) + -- Flight Instrument panel + [3] = "%.4f", -- Course Set (rotary) + [13] = "%.4f", -- Heading Set/Cage (rotary) + [179] = "%d", -- Heading Set/Cage Button + [17] = "%.4f", -- Pitch Adjustment (rotary) + [18] = "%.4f", -- Cage (rotary) + [19] = "%d", -- Cage Button + [8] = "%d", -- Winding/Adjustment Clock Button + [7] = "%.4f", -- Winding/Adjustment Clock (rotary) + [26] = "%.4f", -- Set Pressure (rotary) + -- SCR-522A Control panel + [117] = "%d", -- Radio ON/OFF + [118] = "%d", -- A Channel Activate + [119] = "%d", -- B Channel Activate + [120] = "%d", -- C Channel Activate + [121] = "%d", -- D Channel Activate + [127] = "%.4f", -- Radio Lights Dimmer (rotary) + [116] = "%.4f", -- Radio Audio Volume (rotary) + [44] = "%d", -- Microphone On + [129] = "%d", -- Switch Locking Lever + [128] = "%d", -- Radio Mode Transmit/Receive/Remote + ------------- + [71] = "%.4f", -- Cockpit Lights (rotary) + [66] = "%0.1f", -- Ignition Off/Right/Left/Both + [67] = "%d", -- Gun control Gun And Camera On/Gun And Camera OFF/Camera On + [72] = "%d", -- Silence Landing Gear Warning Horn Cut Off + -- Bomb Arm/Chemical + [69] = "%d", -- Left Bomb Arm/Chemical + [70] = "%d", -- Right Bomb Arm/Chemical + -- Release Mode + [68] = "%0.1f", -- Release Mode, Bombs and Rockets Safe/Bombs Train Release/Bombs Both Release/Rockets Arm + -- Engine Control Panel + [58] = "%d", -- Supercharger Switch Cover + [57] = "%0.1f", -- Supercharger AUTO/LOW/HIGH + [60] = "%d", -- High Blower Lamp Test + [61] = "%d", -- Fuel Booster On/Off + [62] = "%d", -- Oil Dilute Activate + [63] = "%d", -- Starter Activate + [64] = "%d", -- Starter Switch Cover + [65] = "%d", -- Primer Activate + -- Oxygen Regulator + [131] = "%d", -- Auto-Mix On-Off + [130] = "%0.4f", -- Oxygen Emergency By-pass + -- Fuel system + [85] = "%0.1f", -- Fuel Selector Valve, Select Right Combat Tank/Select Left Main Tank/Select Fuselage Tank/Select Right Main Tank/Select Left Combat Tank + [86] = "%d", -- Fuel Shut-Off Valve ON/OFF + -- AN/APS-13 + [114] = "%d", -- ail Warning Radar Power ON/OFF + [115] = "%d", -- Tail Warning Radar Test + [113] = "%.4f", -- Tail Warning Radar Light Control (rotary) + ------------- + [79] = "%d", -- Hydraulic Release Knob + [94] = "%.4f", -- Flaps Control Handle (rotary) + [84] = "%d", -- Parking Brake Handle + [81] = "%d", -- Safe Landing Gear Light Test + [83] = "%d", -- Unsafe Landing Gear Light Test + -- Detrola receiver + [137] = "%.4f", -- Detrola Frequency Selector (rotary) + [138] = "%.4f", -- Detrola Volume (rotary) + -- canopy + [147] = "%.4f", -- Canopy Hand Crank (rotary) + [149] = "%d", -- Canopy Emergency Release Handle + -- AN/ARA-8 + [152] = "%0.1f", -- Homing Adapter Mode TRANSMIT/COMM./HOMING + [153] = "%d", -- Homing Adapter Power On/Off + [154] = "%d", -- Homing Adapter's Circuit Breaker + -- SCR-695 + [139] = "%0.1f", -- IFF Code Selector Code 1/2/3/4/5/6 + [140] = "%d", -- IFF Power On/Off + [141] = "%d", -- IFF TIME/OFF/ON + [142] = "%d", -- IFF Detonator Circuit On/Off + [143] = "%d", -- IFF Distress Signal On/Off + [145] = "%d", -- IFF Detonator Left + [146] = "%d", -- IFF Detonator Right + -- Trimmers + [91] = "%.4f", -- Aileron Trim (rotary) + [92] = "%.4f", -- Elevator Trim (rotary) + [93] = "%.4f", -- Rudder Trim (rotary) + ------------- + [157] = "%.4f", -- Defroster (rotary) + [158] = "%.4f", -- Cold Air (rotary) + [159] = "%.4f", -- Hot Air (rotary) + ------------- + [89] = "%d", -- Landing Light On/Off + [168] = "%d", -- Coolant Control Cover + [87] = "%0.1f", -- Close Coolant Control/Automatic Coolant Control/Open Coolant Control + [169] = "%d", -- Oil Control Cover + [88] = "%0.1f", -- Close Oil Control/Automatic Oil Control/Open Oil Control + [134] = "%0.1f", -- Carburetor Cold Air Control (rotary) + [135] = "%0.1f", -- Carburetor Warm Air Control (rotary) + [47] = "%0.1f", -- Mixture Control Select IDLE CUT OFF/RUN/EMERGENCY FULL RICH + [43] = "%.4f", -- Throttle (rotary) + [46] = "%.4f", -- Propeller RPM (rotary) + [173] = "%d", -- Surface Control Lock Plunger. Left Button - Lock Stick in the Forward Position', Right Button - Lock Stick in the Neutral Position + [48] = "%.4f", -- Lock Throttle (rotary) + [49] = "%.4f", -- Lock Propeller & Mixture (rotary) + [176] = "%d", -- G-meter reset + [183] = "%d", -- Mirror + --Gunsight Selector + [41] = "%d", -- Sight On/Off + [39] = "%d", -- Fixed Reticle Mask Lever + [40] = "%0.1f", -- Sight Mode, Fixed Sight/Fixed-Gyro Sight/Gyro Sight + [42] = "%.1f", -- Gun Sight Brightness + [35] = "%.1f", -- Wing Span Selector + ------------- + [132] = "%.4f", -- Left Payload Salvo + [133] = "%.4f" -- Right Payload Salvo +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + every frame export to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] +end +----------------------------------------------------- +-- LOW IMPORTANCE EXPORTS -- +-- done every gExportLowTickInterval export events -- +----------------------------------------------------- + +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) + --[[ + every frame export to hardware + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] + + --===================================================================================== + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7))) + + local ltmp1 = 0 + for ltmp2 = 0, 13, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] +--[[ + local ltmp1 = 0 + for ltmp2 = 1, 73, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end +]] +end + +----------------------------- +-- Custom functions -- +----------------------------- + +function ExportScript.genericRadio(key, value, hardware) +end diff --git a/ExportsModules/UH-1H.lua b/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua similarity index 58% rename from ExportsModules/UH-1H.lua rename to Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua index 515bd48..6fbaf9a 100644 --- a/ExportsModules/UH-1H.lua +++ b/Scripts/DCS-ExportScript/ExportsModules/UH-1H.lua @@ -1,1667 +1,1336 @@ --- Uh-1H Export --- Version 0.9.9 BETA - -gES_FoundDCSModule = true - -gES_GlassCockpitConfigEveryFrameArguments = -{ - --[[ - every frames arguments - based of "mainpanel_init.lua" - Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) - [DeviceID] = "Format" - [4] = "%.4f", <- floating-point number with 4 digits after point - [19] = "%0.1f", <- floating-point number with 1 digit after point - [129] = "%1d", <- decimal number - ]] - -- Controlls Pilot - --[184] = "%.4f", -- rudder - --[187] = "%.4f", -- stick_roll - --[186] = "%.4f", -- stick_pitch - --[200] = "%.4f", -- collective_position - -- Controlls CoPilot - --[185] = "%.4f", -- rudder_add - --[191] = "%.4f", -- stick_roll_sec - --[190] = "%.4f", -- stick_pitch_sec - --[207] = "%.4f", -- collective_position_operator - -- Gauges Pilot - [117] = "%0.4f", -- AIRSPEED_Nose {0.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 120.0, 150.0} {0.0, 0.075, 0.19, 0.32, 0.395, 0.44, 0.55, 0.825, 1.0} - [118] = "%0.4f", -- AIRSPEED_Roof {0.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 120.0, 150.0} {0.0, 0.075, 0.19, 0.32, 0.395, 0.44, 0.55, 0.825, 1.0} - -- Course Indicator ID-1347 - [151] = "%.4f", -- VerticalBar {-1.0, 1.0} {-0.7, 0.7} - [152] = "%.4f", -- HorisontalBar {-1.0, 1.0} {-0.7, 0.7} - [153] = "%.4f", -- ToMarker - [154] = "%.4f", -- FromMarker - [156] = "%.4f", -- RotCourseCard - [157] = "%.1f", -- VerticalOFF - [158] = "%.1f", -- HorisontalOFF - -- ADF_ARN83 - [45] = "%0.2f", -- ADF_ARN83_Frequency {0.0, 1.0} {0.0, 0.55} - [40] = "%.4f", -- ARN83_SignalLevel - -- GMC - [159] = "%.4f", -- GMC_CoursePointer1 - [160] = "%.4f", -- GMC_CoursePointer2 - [162] = "%.4f", -- GMC_HeadingMarker - [165] = "%.4f", -- GMC_Heading - [166] = "%.4f", -- GMC_Annunciator {-1.0, 1.0} {0.0, 1.0} - [167] = "%.2f", -- GMC_PowerFail - -- Copilot RMI - [266] = "%.4f", -- RMI_CoursePointer1 - [267] = "%.4f", -- RMI_CoursePointer2 - [269] = "%.4f", -- RMI_Heading - -- Altimeter Indicator AAU-32/A (operator) - [168] = "%.4f", -- Pointer {0.0, 1000.0} {0.0, 1.0} - [169] = "%.4f", -- Alt1AAU_10000_footCount {0.0, 10.0} {0.0, 1.0} - [170] = "%.4f", -- Alt1AAU_1000_footCount {0.0, 10.0} {0.0, 1.0} - [171] = "%.4f", -- Alt1AAU_100_footCount {0.0, 10.0} {0.0, 1.0} - [174] = "%.2f", -- AAU_32_Drum_Counter {-2.0, 1.0} {0.0, 0.3} - [175] = "%.2f", -- AAU_32_Drum_Counter {0.0, 10.0} {0.0, 1.0} - [176] = "%.2f", -- AAU_32_Drum_Counter {0.0, 10.0} {0.0, 1.0} - [177] = "%.1f", -- CodeOff_flag - -- Altimeter Indicator AAU-7/A (pilot) (AAU-31/A) - [178] = "%.4f", -- Alt_10000_AAU_7A {0.0, 100000.0} {0.0, 1.0} - [179] = "%.4f", -- Alt_1000_AAU_7A {0.0, 10000.0} {0.0, 1.0} - [180] = "%.4f", -- Alt_100_AAU_7A {0.0, 1000.0} {0.0, 1.0} - [182] = "%.4f", -- Press_AAU_7A {28.1, 31.0} {0.0, 1.0} - -- Gauges - [113] = "%.4f", -- EngOilPress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0} - [114] = "%.4f", -- EngOilTemp {-70.0, -50.0, 0.0, 100.0, 150.0} {0.0, 0.13, 0.38, 0.71, 1.0} - [115] = "%.4f", -- TransmOilPress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0} - [116] = "%.4f", -- TransmOilTemp {-70.0, -50.0, 0.0, 100.0, 150.0} {0.0, 0.13, 0.38, 0.71, 1.0} - --[117] = "%.4f", -- AIRSPEED_Nose - --[118] = "%.4f", -- AIRSPEED_Roof - [121] = "%.4f", -- ExhaustTemp {0.0, 1000.0} {0.0, 1.0} - [122] = "%.4f", -- EngineTach {0.0, 7200.0} {0.0, 1.0} - [123] = "%.4f", -- RotorTach {0.0, 360.0} {0.0, 1.0} - [119] = "%.4f", -- GasProducerTach {0.0, 101.5} {0.0, 1.0} - [120] = "%.4f", -- GasProducerTach_U {0.0, 10.0} {0.0, 1.0} - [124] = "%.4f", -- TorquePress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0} - [149] = "%.4f", -- VoltageDC {0.0, 30.0} {0.0, 1.0} - [150] = "%.4f", -- VoltageAC {0.0, 150.0} {0.0, 1.0} - [436] = "%.4f", -- LoadmeterMainGen {-1.5, 0.0, 12.5} {0.0, 0.156, 1.0} - [125] = "%.4f", -- LoadmeterSTBYGen {-1.5, 0.0, 12.5} {0.0, 0.09, 1.0} - [126] = "%.4f", -- FuelPress {-2.0, 0.0, 50.0} {0.0, 0.015, 1.0} - [239] = "%.4f", -- FuelQuantity {0.0, 1580.0} {0.0, 1.0} - -- Mechanic clock - [127] = "%.4f", -- CLOCK_hours {0.0, 12.0} {0.0, 1.0} - [128] = "%.4f", -- CLOCK_minutes {0.0, 60.0} {0.0, 1.0} - [129] = "%.4f", -- CLOCK_seconds {0.0, 60.0} {0.0, 1.0} - -- - [132] = "%.4f", -- TurnPtr {-1.0, 1.0} - [133] = "%.4f", -- SideSlip {-1.0, 1.0} - [134] = "%.2f", -- VertVelocPilot {-4000.0, -3000.0, -1500.0, -1000.0, 1000.0, 1500.0, 3000.0, 4000.0} {-1.0, -0.81, -0.54, -0.36, 0.36, 0.54, 0.81, 1.0} - [251] = "%.2f", -- VertVelocCopilot {-4000.0, -3000.0, -1500.0, -1000.0, 1000.0, 1500.0, 3000.0, 4000.0} {-1.0, -0.81, -0.54, -0.36, 0.36, 0.54, 0.81, 1.0} - -- ADI - pilot - [142] = "%.4f", -- Attitude_Roll {1.0, -1.0} - [143] = "%.4f", -- Attitude_Pitch {1.0, -1.0} - [148] = "%.1f", -- Attitude_Off_flag - -- ADI - operator - [135] = "%.4f", -- Attitude_Roll_left {1.0, -1.0} - [136] = "%.4f", -- Attitude_Pitch_left {1.0, -1.0} - [141] = "%.1f", -- Attitude_Off_flag_left {0.0, 1.0} {1.0, 0.0} - [138] = "%.4f", -- Attitude_PitchShift {0.0, 1.0} {-1.0, 1.0} - -- operator - --[149] = "%.4f", -- DCVoltmeter - --[150] = "%.4f", -- ACVoltmeter - -- UHF_ARC51 - [10] = "%.4f", -- UHF_ARC51_Freq1 {2.0, 3.0} {0.0, 1.0} - [11] = "%.4f", -- UHF_ARC51_Freq2 {0.0, 10.0} {0.0, 1.0} - [12] = "%.4f", -- UHF_ARC51_Freq3 {0.0, 10.0} {0.0, 1.0} - [13] = "%.4f", -- UHF_ARC51_Freq4 {0.0, 10.0} {0.0, 1.0} - [14] = "%.4f", -- UHF_ARC51_Freq5 {0.0, 10.0} {0.0, 1.0} - -- NAV_ARN82 - [46] = "%.4f", -- NAV_ARN82_Freq1 {0.0, 10.0} {0.0, 1.0} - [47] = "%.4f", -- NAV_ARN82_Freq2 {0.0, 10.0} {0.0, 1.0} - [48] = "%.4f", -- NAV_ARN82_Freq3 {0.0, 10.0} {0.0, 1.0} - [49] = "%.4f", -- NAV_ARN82_Freq4 {0.0, 10.0} {0.0, 1.0} - [50] = "%.4f", -- NAV_ARN82_Freq5 {0.0, 10.0} {0.0, 1.0} - -- VHF_ARC134 - [1] = "%.4f", -- VHF_ARC134_Freq1 {0.0, 10.0} {0.0, 1.0} - [2] = "%.4f", -- VHF_ARC134_Freq2 {0.0, 10.0} {0.0, 1.0} - [3] = "%.4f", -- VHF_ARC134_Freq3 {0.0, 10.0} {0.0, 1.0} - [4] = "%.4f", -- VHF_ARC134_Freq4 {0.0, 10.0} {0.0, 1.0} - -- - [56] = "%.1f", -- Marker_Beacon_Lamp {0.0, 1.0} {0.0, 0.9} - -- Panel_Shake - --[264] = "%.1f", -- Panel_Shake_Z - --[265] = "%.1f", -- Panel_Shake_Y - --[282] = "%.1f", -- Panel_Rot_X - -- Wiper - --[284] = "%.4f", -- Wiper_Pilot - --[283] = "%.4f", -- Wiper_Operator - -- Pilot Model - --[242] = "%.1f", -- Pilot_Model - --[245] = "%.1f", -- Operator_Model - -- Flexible sight station - --[263] = "%.2f", -- FlexSightHeight - --[261] = "%.4f", -- FlexSightAzimuth - --[262] = "%.4f", -- FlexSightElevation - -- Pilot sight station - --[438] = "%.4f", -- PilotSightHeight - --[442] = "%.2f", -- PilotSightGlass - -- Light - --[279] = "%.4f", -- light_ConsoleLight - --[410] = "%.4f", -- light_DomeLight - --[411] = "%.4f", -- light_DomeLightGreen - -- Damage - --[248] = "%.1f", -- DeadPilot - --[249] = "%.1f", -- DeadCoPilot - --[414] = "%.4f", -- LeftWindShield - --[413] = "%.4f", -- RightWindShield - --[412] = "%.4f", -- DownBlisters - --[417] = "%.4f", -- UpRightBlister - --[418] = "%.4f", -- UpLeftBlister - --[415] = "%.4f", -- RightWindow - --[416] = "%.4f", -- LeftWindow - --[422] = "%.4f", -- RightDoor - --[420] = "%.4f", -- LeftDoor - -- - [437] = "%.3f", -- RamTemp - -- Radar Altimeter - [443] = "%.4f", -- RALT_Needle {0.0, 0.98} {0.0, 0.98} - [467] = "%.1f", -- RALT_Off_Flag - [447] = "%.1f", -- RALT_LO_Lamp - [465] = "%.1f", -- RALT_HI_Lamp - [444] = "%.4f", -- RALT_LO_Index {-0.02, -0.01, -0.0001,0.0, 0.744} {0.97, 0.99, 1.0, 0.0, 0.744} - [466] = "%.4f", -- RALT_HI_Index {0.0, 0.744} {0.0, 0.744} - [468] = "%0.1f", -- RALT_Digit_1 {0.0, 10.0} {0.0, 1.0} - [469] = "%0.1f", -- RALT_Digit_2 {0.0, 10.0} {0.0, 1.0} - [470] = "%0.1f", -- RALT_Digit_3 {0.0, 10.0} {0.0, 1.0} - [471] = "%0.1f", -- RALT_Digit_4 {0.0, 10.0} {0.0, 1.0} - -- FLARE CHAFF - [460] = "%1d", -- FLARE_Digit_1 {0.0, 10.0} {0.0, 1.0} - [461] = "%1d", -- FLARE_Digit_2 {0.0, 10.0} {0.0, 1.0} - [462] = "%1d", -- CHAFF_Digit_1 {0.0, 10.0} {0.0, 1.0} - [463] = "%1d", -- CHAFF_Digit_2 {0.0, 10.0} {0.0, 1.0} - -- XM130 Chaff Flare - [458] = "%.1f", -- lamp_XM130_ARMED - -- SIGHTS_FOR_CIVIL - [473] = "$.1f", -- SIGHTS_FOR_CIVIL - -- Main Panel Lights - [277] = "%.1f", -- lamp_MASTER - [276] = "%.1f", -- lamp_LOW_RPM - [275] = "%.1f", -- lamp_FIRE - -- Caution Panel Lights - [91] = "%.1f", -- lamp_ENGINE_OIL_PRESS - [92] = "%.1f", -- lamp_ENGINE_ICING - [93] = "%.1f", -- lamp_ENGINE_ICE_JET - [94] = "%.1f", -- lamp_ENGINE_CHIP_DET - [95] = "%.1f", -- lamp_LEFT_FUEL_BOOST - [96] = "%.1f", -- lamp_RIGHT_FUEL_BOOST - [97] = "%.1f", -- lamp_ENG_FUEL_PUMP - [98] = "%.1f", -- lamp_20_MINUTE - [99] = "%.1f", -- lamp_FUEL_FILTER - [100] = "%.1f", -- lamp_GOV_EMERG - [101] = "%.1f", -- lamp_AUX_FUEL_LOW - [102] = "%.1f", -- lamp_XMSN_OIL_PRESS - [103] = "%.1f", -- lamp_XMSN_OIL_HOT - [104] = "%.1f", -- lamp_HYD_PRESSURE - [105] = "%.1f", -- lamp_ENGINE_INLET_AIR - [106] = "%.1f", -- lamp_INST_INVERTER - [107] = "%.1f", -- lamp_DC_GENERATOR - [108] = "%.1f", -- lamp_EXTERNAL_POWER - [109] = "%.1f", -- lamp_CHIP_DETECTOR - [110] = "%.1f", -- lamp_IFF - -- M21 - [254] = "%.1f", -- lamp_M21_ARMED - [255] = "%.1f", -- lamp_M21_SAFE - -- - [76] = "%.1f", -- lamp_IFF_REPLY - [77] = "%.1f", -- lamp_IFF_TEST - -- Electic Gauges - [526] = "%.4f", -- DC_voltage {0.0, 30.0} {0.0, 1.0} - [532] = "%.2f", -- AC_voltage {0.0, 100.0, 150.0, 200.0, 250.0} {0.0, 0.14, 0.31, 0.56, 1.0} - [527] = "%.4f", -- DC_battery_I_current {0.0, 400.0} {0.0, 1.0} - [528] = "%.4f", -- DC_battery_II_current {0.0, 400.0} {0.0, 1.0} - [529] = "%.4f", -- DC_VU_I_current {0.0, 400.0} {0.0, 1.0} - [530] = "%.4f", -- DC_VU_II_current {0.0, 400.0} {0.0, 1.0} - [531] = "%.4f", -- DC_VU_III_current {0.0, 400.0} {0.0, 1.0} - [533] = "%.2f", -- AC_generator_I_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} - [534] = "%.2f", -- AC_generator_II_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} - [371] = "%.2f" -- AntiIce_ampermeter {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} -} -gES_GlassCockpitConfigArguments = -{ - --[[ - arguments for export in low tick interval - based on "clickabledata.lua" - ]] - -- Electrosystem - [219] = "%1d", -- Battery - [220] = "%1d", -- Starter/Stdby GEN - [218] = "%.1f", -- DC Voltmeter Selector - [221] = "%1d", -- Non Essential bus - [214] = "%.1f", -- AC Voltmeter Selector - [215] = "%1d", -- Inverter - -- Electrosystem circuit breakers - -- Essential BUS. line 1 - [285] = "%1d", -- CB IFF APX 1 (N/F) - [287] = "%1d", -- CB IFF APX 2 (N/F) - [289] = "%1d", -- CB Prox. warn.(N/F) - [291] = "%1d", -- CB Marker beacon - [293] = "%1d", -- CB VHF Nav. (ARN-82) - [295] = "%1d", -- CB LF Nav. (ARN-83) - [297] = "%1d", -- CB Intercom CPLT(N/F) - [299] = "%1d", -- CB Intercom PLT - [349] = "%1d", -- CB ARC-102 HF Static INVTR(N/F) - [351] = "%1d", -- CB HF ANT COUPLR(N/F) - [353] = "%1d", -- CB HF ARC-102(N/F) - [355] = "%1d", -- CB FM Radio - [357] = "%1d", -- CB UHF Radio - [359] = "%1d", -- CB FM 2 Radio(N/F) - [361] = "%1d", -- CB VHF AM Radio - [321] = "%1d", -- CB Pitot tube(N/F) - [345] = "%1d", -- CB Rescue hoist CTL(N/F) - [347] = "%1d", -- CB Rescue hoist cable cutter (N/F) - -- Essential BUS. line 2 - [303] = "%1d", -- CB Wind wiper PLT - [301] = "%1d", -- CB Wind wiper CPLT - [305] = "%1d", -- CB KY-28 voice security(N/F) - [403] = "%1d", -- CB Starter Relay(N/F) - [307] = "%1d", -- CB Search light power(N/F) - [309] = "%1d", -- CB Landing light power(N/F) - [311] = "%1d", -- CB Landing & Search light control(N/F) - [313] = "%1d", -- CB Anticollision light(N/F) - [363] = "%1d", -- CB Fuselage lights(N/F) - [365] = "%1d", -- CB Navigation lights(N/F) - [367] = "%1d", -- CB Dome lights(N/F) - [369] = "%1d", -- CB Cockpit lights(N/F) - [371] = "%1d", -- CB Caution lights(N/F) - [373] = "%1d", -- CB Console lights(N/F) - [375] = "%1d", -- CB INST Panel lights(N/F) - [377] = "%1d", -- CB INST SEC lights(N/F) - [323] = "%1d", -- CB Cabin heater (Outlet valve)(N/F) - [325] = "%1d", -- CB Cabin heater (Air valve)(N/F) - [343] = "%1d", -- CB Rescue hoist PWR(N/F) - -- Essential BUS. line 3 - [327] = "%1d", -- CB RPM Warning system(N/F) - [329] = "%1d", -- CB Engine anti-ice(N/F) - [331] = "%1d", -- CB Fire detector(N/F) - [333] = "%1d", -- CB LH fuel boost pump(N/F) - [335] = "%1d", -- CB Turn & Slip indicator - [337] = "%1d", -- CB TEMP indicator(N/F) - [339] = "%1d", -- CB HYD Control(N/F) - [341] = "%1d", -- CB FORCE Trim(N/F) - [379] = "%1d", -- CB Cargo hook release(N/F) - [381] = "%1d", -- CB EXT Stores jettison(N/F) - [383] = "%1d", -- CB Spare inverter PWR(N/F) - [385] = "%1d", -- CB Inverter CTRL (N/F) - [387] = "%1d", -- CB Main inverter PWR(N/F) - [389] = "%1d", -- CB Generator & Bus Reset(N/F) - [391] = "%1d", -- CB STBY Generator Field(N/F) - [393] = "%1d", -- CB Governor Control(N/F) - [395] = "%1d", -- CB IDLE Stop release(N/F) - [397] = "%1d", -- CB RH fuel boost pump(N/F) - [399] = "%1d", -- CB Fuel TRANS(N/F) - [401] = "%1d", -- CB Fuel valves(N/F) - -- Non Essential BUS - [315] = "%1d", -- CB Heated blanket 1(N/F) - [317] = "%1d", -- CB Heated blanket 2(N/F) - [319] = "%1d", -- CB Voltmeter Non Ess Bus(N/F) - -- other circuit breakers - [405] = "%1d", -- CB Ignition system(N/F) - -- AC BUS circuit breakers - [423] = "%1d", -- CB Pilot ATTD1(N/F) - [424] = "%1d", -- CB Pilot ATTD2(N/F) - [425] = "%1d", -- CB Copilot ATTD1(N/F) - [426] = "%1d", -- CB Copilot ATTD2(N/F) - [427] = "%1d", -- CB Gyro Cmps(N/F) - [428] = "%1d", -- CB Fuel Quantity(N/F) - [429] = "%1d", -- CB 28V Trans(N/F) - [430] = "%1d", -- CB Fail Relay(N/F) - [431] = "%1d", -- CB Pressure Fuel(N/F) - [432] = "%1d", -- CB Pressure Torque(N/F) - [433] = "%1d", -- CB Pressure XMSN(N/F) - [434] = "%1d", -- CB Pressure Eng(N/F) - [435] = "%1d", -- CB Course Ind(N/F) - -- - [238] = "%1d", -- Pitot Heater - [216] = "%1d", -- Main generator (Left button - ON/OFF. Right button RESET) {-1, 0, 1} - [217] = "%1d", -- Main generator switch cover - -- - [111] = "%1d", -- Reset/Test switch {-1, 0, 1} - [112] = "%1d", -- Bright/Dim switch {-1, 0, 1} - -- Fuel system - [81] = "%1d", -- Main Fuel - [240] = "%1d", -- Test Fuel Gauge - --Transponder APX-72 - [58] = "%.1f", -- Code - [59] = "%.1f", -- Master - [60] = "%1d", -- Audio/light - - [61] = "%1d", -- Test M-1 {-1, 0, 1} - [62] = "%1d", -- Test M-2 {-1, 0, 1} - [63] = "%1d", -- Test M-3A {-1, 0, 1} - [64] = "%1d", -- Test M-C {-1, 0, 1} - -- - [65] = "%1d", -- RAD Test/Mon {-1, 0, 1} - [66] = "%1d", -- Ident/Mic {-1, 0, 1} - -- IFF - [67] = "%1d", -- IFF On/Out - - [68] = "%1d", -- MODE1-WHEEL1 - [69] = "%1d", -- MODE1-WHEEL2 - - [70] = "%1d", -- "MODE3A-WHEEL1 - [71] = "%1d", -- "MODE3A-WHEEL2 - [72] = "%1d", -- "MODE3A-WHEEL3 - [73] = "%1d", -- "MODE3A-WHEEL4 - - [74] = "%.4f", -- Reply test, Axis - [78] = "%1d", -- Reply test, Button - - [75] = "%.4f", -- Test test, Axis - [79] = "%1d", -- Test test, Button - - [130] = "%1d", -- Winding/Adjustment Clock, Axis ?? - [131] = "%1d", -- Winding/Adjustment Clock, Button ?? - -- ENGINE INTERFACE - [250] = "%.4f", -- Throttle {-1.0, 0.4} - [206] = "%1d", -- Throttle Stop - - [84] = "%1d", -- De-Ice On/Off - [80] = "%1d", -- Low RPM Warning - [86] = "%1d", -- Chip Detector {-1, 0, 1} - [85] = "%1d", -- Governor Emer/Auto - [90] = "%1d", -- Hydraulic Control - [89] = "%1d", -- Force Trim - [203] = "%1d", -- Governor {-1, 0, 1} - [278] = "%1d", -- Fire Test - -- ADI OPERATOR - -- Copilot's attutude indicator - [140] = "%1d", -- Cage Copilot's Attitude Indicator, Button - [146] = "%.4f", -- Attitude Indicator Pitch Trim Knob, Axis - -- ADI PILOT - [145] = "%.4f", -- Attitude Indicator Pitch Trim Knob, Axis - [144] = "%.4f", -- Attitude Indicator Roll Trim Knob, Axis - -- AAU32 - -- Copilot's altimeter - [172] = "%.4f", -- Pressure Adjustment, Axis - -- AAU7 - -- Pilot's altimeter - [181] = "%.4f", -- Pressure Adjustment, Axis - -- VHF ARC-134 - [6] = "%1d", -- Comm Test Button - [7] = "%1d", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Button - [5] = "%.4f", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Axis - [8] = "%1d", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume, Button - [9] = "%.4f", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume, Axis - -- Intercom Control Panel - [29] = "%.4f", -- Intercom volume {0.3,1.0} - [23] = "%1d", -- VHF AM Radio Receiver - [24] = "%1d", -- UHF Radio Receiver - [25] = "%1d", -- VHF FM Radio Receiver - [26] = "%1d", -- Receiver 4 N/F - [27] = "%1d", -- INT Receiver - [28] = "%1d", -- Receiver NAV - [30] = "%.1f", -- Intercom Mode (PVT - hot line; INT - interphone; 1 - VHF FM transmitter; 2 - UHF transmitter; 3 - VHF AM transmitter; 4 - Not used) - [194] = "%.1f", -- Radio/ICS - -- ARC 51BX UHF Raido - [16] = "%.1f", -- Preset Channel Selector - [18] = "%.4f", -- 10 MHz Selector, Axis - [19] = "%.4f", -- 1 MHz Selector, Axis - [20] = "%.4f", -- 50 kHz Selector, Axis - - [15] = "%.1f", -- Frequency Mode Dial - [17] = "%.1f", -- Function Dial - [22] = "%1d", -- Squelch - [21] = "%.4f", -- Volume, Axis - -- VHF ARC 131 - [31] = "%.1f", -- Frequency Tens MHz - [32] = "%.1f", -- Frequency Ones MHz - [33] = "%.1f", -- Frequency Decimals MHz - [34] = "%.1f", -- Frequency Hundredths MHz - [35] = "%.1f", -- Mode OFF/TR/RETRAN(N/F)/HOME(N/F) - [36] = "%.1f", -- quelch Mode - [37] = "%.4f", -- Volume, Axis - -- ARN-82 - [52] = "%1d", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Button - [51] = "%.4f", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Axis - [53] = "%1d", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume, Button - [54] = "%.4f", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume, Axis - -- Marker beakon - [57] = "%.4f", -- Marker beacon On/Off/Volume - [55] = "%1d", -- Marker beacon sensing - -- AN/ARN-83 - [42] = "%.1f", -- ADF Loop Antenna speed {0.1,0.3} - [41] = "%1d", -- BFO (N/F) - [43] = "%1d", -- Gain control / Mode. Right mouse click to cycle mode. Rotate mouse wheel to adjust gain, Button - [44] = "%.4f", -- Gain control / Mode. Right mouse click to cycle mode. Rotate mouse wheel to adjust gain, Axis - [38] = "%1d", -- Tune control / Band selection. Right mouse click to select a band. Rotate mouse wheel to adjust tune, Button - [39] = "%.4f", -- Tune control / Band selection. Right mouse click to select a band. Rotate mouse wheel to adjust tune, Axis - -- Nav lights - [222] = "%.1f", -- Navigation lights - [223] = "%1d", -- Position Lights, STEADY/OFF/FLASH - [224] = "%1d", -- Position Lights, DIM/BRIGHT - [225] = "%1d", -- Anti-Collision Lights, ON/OFF - [202] = "%1d", -- Landing Light - [201] = "%1d", -- Search Light - [205] = "%1d", -- Landing Light Ctrl - -- Light System - [230] = "%.4f", -- "Overhead Console Panel Lights Brightness Rheostat, Axis - [231] = "%.4f", -- Pedestal Lights Brightness Rheostat, Axis - [232] = "%.4f", -- Secondary Instrument Lights Brightness Rheostat, Axis - [233] = "%.4f", -- Engine Instrument Lights Brightness Rheostat, Axis - [234] = "%.4f", -- Copilot Instrument Lights Brightness Rheostat, Axis - [235] = "%.4f", -- Pilot Instrument Lights Brightness Rheostat, Axis - [226] = "%1d", -- Dome Light Ctrl - -- HEATING SYSTEM - [236] = "%.1f", -- Bleed Air - -- GCI(ID-998/ASN) - [163] = "%.4f", -- Heading Set Knob, Axis - [161] = "%.4f", -- Compass Synchronizing, Axis - [164] = "%1d", -- ADF/VOR control - [241] = "%1d", -- DG/Slave gyro mode - -- COURSE IND - [155] = "%.4f", -- Course select knob, Axis - -- weapon system - [252] = "%1d", -- Armed/Safe/Off - [253] = "%1d", -- Left/Right/All - [256] = "%1d", -- 7.62/2.75/40 - [257] = "%.1f", -- Rocket Pair - [258] = "%1d", -- Rocket Reset - [259] = "%1d", -- Jettison Cover - [260] = "%1d", -- Jettison - -- sighting station - [281] = "%.4f", -- Sighting Station Intensity - [408] = "%1d", -- Sighting Station Lamp Switch BACKUP/OFF/MAIN - - [0] = "%1d", -- Pilot Sight Armed/Safe ?? - [439] = "%1d", -- Pilot Sight On/Off - [440] = "%.4f", -- Pilot Sighting Station Intensity, Axis - [441] = "%.4f", -- Sight Elevation, Axis - -- Windshield Wipers - [227] = "%1d", -- Pilot/Both/Operator - [229] = "%.1f", -- Wipers Speed - -- Stick - [189] = "%1d", -- Force Trim ON/OFF (Pilot) - [193] = "%1d", -- Force Trim ON/OFF (CoPilot) - -- XM 130 Chaff Flare - [450] = "%1d", -- Ripple Fire Cover - [451] = "%1d", -- Ripple Fire - [456] = "%1d", -- SAFE/ARMED Switcher - [459] = "%1d", -- MAN/PGRM Mode - [464] = "%1d", -- Flare Dispense - [457] = "%1d", -- Armed lamp Test - [453] = "%1d", -- Flare counter Reset. Rotate mouse wheel to set Number, Button - [452] = "%.4f", -- Flare counter Reset. Rotate mouse wheel to set Number, Axis - [455] = "%1d", -- Chaff counter Reset. Rotate mouse wheel to set Number, Button - [454] = "%.4f", -- Chaff counter Reset. Rotate mouse wheel to set Number, Axis - -- Radar Altimeter - [449] = "%1d", -- Radar Altimeter Power - [445] = "%.4f", -- Turn On. Low Set. - [446] = "%1d", -- Test / Hight Set. Left mouse click to Test. Rotate mouse wheel to set Hight, Button - [464] = "%1d", -- Test / Hight Set. Left mouse click to Test. Rotate mouse wheel to set Hight, Axis - -- Doors - [419] = "%1d", -- Open Left Doors - [421] = "%1d" -- Open Right Doors -} - ------------------------------ --- HIGH IMPORTANCE EXPORTS -- --- done every export event -- ------------------------------ - -function ProcessGlassCockpitDCSConfigHighImportance(mainPanelDevice) - if gES_GlassCockpitType == 1 then - -- HELIOS Version 1.3 - elseif gES_GlassCockpitType == 2 then - -- HawgTouch Version 1.6 - - -- Pilot Gauges - - -- Airspeed indicator - -- [117] = "%0.4f", -- AIRSPEED_Nose - -- {0.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 120.0, 150.0} - -- {0.0, 0.075, 0.19, 0.32, 0.395, 0.44, 0.55, 0.825, 1.0} - - -- Attitude Indicators - -- ADI - pilot - -- [142] = "%.4f", -- Attitude_Roll - -- [143] = "%.4f", -- Attitude_Pitch - -- [148] = "%.1f", -- Attitude_Off_flag - SendData("2000", string.format("%0.4f;%0.4f;%0.1f", - mainPanelDevice:get_argument_value(142), - mainPanelDevice:get_argument_value(143), - mainPanelDevice:get_argument_value(148))) - - -- Dual tachometer - -- [122] = "%.4f", -- EngineTach - -- [123] = "%.4f", -- RotorTach - SendData("2001", string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(122), - mainPanelDevice:get_argument_value(123))) - - -- Altimeter Indicator (AAU-31/A) - -- Altimeter Indicator AAU-7/A (pilot) - -- [182] = "%.4f", -- Press_AAU_7A - -- [178] = "%.4f", -- Alt_10000_AAU_7A - -- [179] = "%.4f", -- Alt_1000_AAU_7A - -- [180] = "%.4f", -- Alt_100_AAU_7A - SendData("2002", string.format("%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(182), - mainPanelDevice:get_argument_value(178), - mainPanelDevice:get_argument_value(179), - mainPanelDevice:get_argument_value(180))) - - -- Radio Compass Indicator - -- GMC - -- [159] = "%.4f", -- GMC_CoursePointer1 - -- [160] = "%.4f", -- GMC_CoursePointer2 - -- [165] = "%.4f", -- GMC_Heading - -- [162] = "%.4f", -- GMC_HeadingMarker - -- [166] = "%.4f", -- GMC_Annunciator - -- [167] = "%.2f", -- GMC_PowerFail - SendData("2003", string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.2f", - mainPanelDevice:get_argument_value(159), - mainPanelDevice:get_argument_value(160), - mainPanelDevice:get_argument_value(165), - mainPanelDevice:get_argument_value(162), - mainPanelDevice:get_argument_value(166), - mainPanelDevice:get_argument_value(167))) - - -- Vertical velocity indicator - -- [134] = "%.2f", -- VertVelocPilot - -- {-4000.0, -3000.0, -1500.0, -1000.0, 1000.0, 1500.0, 3000.0, 4000.0} - -- {-1.0, -0.81, -0.54, -0.36, 0.36, 0.54, 0.81, 1.0} - - -- Exhaust gas temperature indicator - -- [121] = "%.4f", -- ExhaustTem - - -- Gas Producer Tachometer Indicator - -- [119] = "%.4f", -- GasProducerTach - -- [120] = "%.4f", -- GasProducerTach_U - SendData("2004", string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(119), - mainPanelDevice:get_argument_value(120))) - - -- Turn and slip indicator - -- [132] = "%.4f", -- TurnPtr - -- [133] = "%.4f", -- SideSlip - SendData("2005", string.format("%0.4f;%0.4f", - mainPanelDevice:get_argument_value(132), - mainPanelDevice:get_argument_value(133))) - - -- Torquemeter Indicator - -- [124] = "%.4f", -- TorquePress - -- {-3.0, 0.0, 100.0} - -- {0.0, 0.029, 1.0} - - -- Mechanic clock - -- [127] = "%.4f", -- CLOCK_hours - -- [128] = "%.4f", -- CLOCK_minutes - -- [129] = "%.4f", -- CLOCK_seconds - SendData("2006", string.format("%0.4f;%0.4f;%0.1f", - mainPanelDevice:get_argument_value(127), - mainPanelDevice:get_argument_value(128), - mainPanelDevice:get_argument_value(129))) - - -- Course deviation indicator - -- Course Indicator ID-1347 - -- [151] = "%.4f", -- VerticalBar - -- {-1.0, 1.0} - -- {-0.7, 0.7} - -- [152] = "%.4f", -- HorisontalBar - -- {-1.0, 1.0} - -- {-0.7, 0.7} - -- [153] = "%.4f", -- ToMarker - -- [154] = "%.4f", -- FromMarker - -- [156] = "%.4f", -- RotCourseCard - -- [157] = "%.1f", -- VerticalOFF - -- [158] = "%.1f", -- HorisontalOFF - SendData("2007", string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(151), - mainPanelDevice:get_argument_value(152), - mainPanelDevice:get_argument_value(153), - mainPanelDevice:get_argument_value(154), - mainPanelDevice:get_argument_value(156), - mainPanelDevice:get_argument_value(157), - mainPanelDevice:get_argument_value(158))) - - -- Standby magnetic compass - -- no ID - -- SendData("2008", string.format("%0.4f;%0.4f;%0.1f", - -- mainPanelDevice:get_argument_value(), - -- mainPanelDevice:get_argument_value(), - -- mainPanelDevice:get_argument_value())) - - -- Radar Altimeter - AN/APN-209 - -- [443] = "%.4f", -- RALT_Needle - -- [467] = "%.2f", -- RALT_Off_Flag - -- [447] = "%.1f", -- RALT_LO_Lamp - -- [465] = "%.1f", -- RALT_HI_Lamp - -- [444] = "%.4f", -- RALT_LO_Index - -- {-0.02, -0.01, -0.0001,0.0, 0.744} - -- {0.97, 0.99, 1.0, 0.0, 0.744} - -- [466] = "%.4f", -- RALT_HI_Index - -- {0.0, 0.744} - -- {0.0, 0.744} - -- [468] = "%0.1f", -- RALT_Digit_1 - -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' - -- [469] = "%0.1f", -- RALT_Digit_2 - -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' - -- [470] = "%0.1f", -- RALT_Digit_3 - -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' - -- [471] = "%0.1f", -- RALT_Digit_4 - -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' - SendData("2009", string.format("%0.4f;%0.2f;%0.1f;%0.1f;%.4f;%.4f;%0.1f;%0.1f;%0.1f;%0.1f", - mainPanelDevice:get_argument_value(443), - mainPanelDevice:get_argument_value(467), - mainPanelDevice:get_argument_value(447), - mainPanelDevice:get_argument_value(465), - mainPanelDevice:get_argument_value(444), - mainPanelDevice:get_argument_value(466), - mainPanelDevice:get_argument_value(468), - mainPanelDevice:get_argument_value(469), - mainPanelDevice:get_argument_value(470), - mainPanelDevice:get_argument_value(471))) - - -- CoPilot Gauges - - -- Airspeed indicator - -- [117] = "%0.4f", -- AIRSPEED_Nose - -- {0.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 120.0, 150.0} - -- {0.0, 0.075, 0.19, 0.32, 0.395, 0.44, 0.55, 0.825, 1.0} - - -- Attitude Indicators - -- ADI - operator - -- [135] = "%.4f", -- Attitude_Roll_left - -- [136] = "%.4f", -- Attitude_Pitch_left - -- [141] = "%.1f", -- Attitude_Off_flag_left - -- [138] = "%.4f", -- Attitude_PitchShift - SendData("2010", string.format("%0.4f;%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(135), - mainPanelDevice:get_argument_value(136), - mainPanelDevice:get_argument_value(141), - mainPanelDevice:get_argument_value(138))) - - -- Radio compass indicator - -- GMC - -- [266] = "%.4f", -- GMC_CoursePointer1 - -- [267] = "%.4f", -- GMC_CoursePointer2 - -- [269] = "%.4f", -- GMC_Heading - SendData("2011", string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(266), - mainPanelDevice:get_argument_value(267), - mainPanelDevice:get_argument_value(269))) - - -- Altimeter indicator (AAU-32/A) - -- [168] = "%.4f", -- Pointer - -- [169] = "%.4f", -- Alt1AAU_10000_footCount - -- [170] = "%.4f", -- Alt1AAU_1000_footCount - -- [171] = "%.4f", -- Alt1AAU_100_footCount - -- [174] = "%.2f", -- AAU_32_Drum_Counter - -- [175] = "%.2f", -- AAU_32_Drum_Counter - -- [176] = "%.2f", -- AAU_32_Drum_Counter - -- [177] = "%.1f", -- CodeOff_flag - SendData("2012", string.format("%0.4f;%0.4f;%0.4f;%0.4f;%0.2f;%0.2f;%0.2f;%0.1f", - mainPanelDevice:get_argument_value(168), - mainPanelDevice:get_argument_value(169), - mainPanelDevice:get_argument_value(170), - mainPanelDevice:get_argument_value(171), - mainPanelDevice:get_argument_value(174), - mainPanelDevice:get_argument_value(175), - mainPanelDevice:get_argument_value(176), - mainPanelDevice:get_argument_value(177))) - - -- Whisky Compass - -- [269] = "%.4f", -- RMI_Heading - -- [142] = "%.4f", -- Attitude_Roll - -- [143] = "%.4f", -- Attitude_Pitch - SendData("2013", string.format("%0.4f;%0.4f;%0.4f", - mainPanelDevice:get_argument_value(269), - mainPanelDevice:get_argument_value(142), - mainPanelDevice:get_argument_value(143))) - - -- Vertical velocity indicator - -- [251] = "%.2f", -- VertVelocCopilot - -- {-4000.0, -3000.0, -1500.0, -1000.0, 1000.0, 1500.0, 3000.0, 4000.0} - -- {-1.0, -0.81, -0.54, -0.36, 0.36, 0.54, 0.81, 1.0} - - -- Fuel Pressure Indicator - -- [126] = "%.4f", -- FuelPress - -- {-2.0, 0.0, 50.0} - -- {0.0, 0.015, 1.0} - - -- Transmission oil pressure - -- [115] = "%.4f", -- TransmOilPress - -- {-3.0, 0.0, 100.0} - -- {0.0, 0.029, 1.0} - - -- DC Loadmeters (Main) - -- [436] = "%.4f", -- LoadmeterMainGen - -- {-1.5, 0.0, 12.5} - -- {0.0, 0.156, 1.0} - - -- DC Loadmeters (Standby) - -- [125] = "%.4f", -- LoadmeterSTBYGen - -- {-1.5, 0.0, 12.5} - -- {0.0, 0.09, 1.0} - - -- Engine oil pressure indicator - -- [113] = "%.4f", -- EngOilPress - -- {-3.0, 0.0, 100.0} - -- {0.0, 0.029, 1.0} - - -- AC voltmeter - -- [150] = "%.4f", -- VoltageAC - - -- DC voltmeter - -- [149] = "%.4f", -- VoltageDC - - -- Transmission oil temperature indicator - -- [116] = "%.4f", -- TransmOilTemp - -- {-70.0, -50.0, 0.0, 100.0, 150.0} - -- {0.0, 0.13, 0.38, 0.71, 1.0} - - -- Engine oil temperature - -- [114] = "%.4f", -- EngOilTemp - -- {-70.0, -50.0, 0.0, 100.0, 150.0} - -- {0.0, 0.13, 0.38, 0.71, 1.0} - - -- Fuel Quantity Indicator - -- [239] = "%.4f", -- FuelQuantity - - end -end - -function ProcessHARDWAREConfigHighImportance(mainPanelDevice) - --[[ - every frame export to hardware - Example from A-10C - Get Radio Frequencies - get data from device - local UHF_RADIO = GetDevice(54) - SendDataHW("ExportID", "Format") - SendDataHW("ExportID", "Format", HardwareConfigID) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) - SendDataHW("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config - ]] - - -- no dimming lights - -- Light - SendDataHW("279", mainPanelDevice:get_argument_value(279) > 0.3 and 1 or 0) -- light_ConsoleLight - SendDataHW("410", mainPanelDevice:get_argument_value(410) > 0.3 and 1 or 0) -- light_DomeLight - SendDataHW("411", mainPanelDevice:get_argument_value(411) > 0.3 and 1 or 0) -- light_DomeLightGreen - -- Radar Altimeter - SendDataHW("447", mainPanelDevice:get_argument_value(447) > 0.3 and 1 or 0) -- RALT_LO_Lamp - SendDataHW("465", mainPanelDevice:get_argument_value(465) > 0.3 and 1 or 0) -- RALT_HI_Lamp - -- Main Panel Lights - SendDataHW("277", mainPanelDevice:get_argument_value(277) > 0.3 and 1 or 0) -- lamp_MASTER - SendDataHW("276", mainPanelDevice:get_argument_value(276) > 0.3 and 1 or 0) -- lamp_LOW_RPM - SendDataHW("275", mainPanelDevice:get_argument_value(275) > 0.3 and 1 or 0) -- lamp_FIRE - -- Caution Panel Lights - SendDataHW("91", mainPanelDevice:get_argument_value(91) > 0.3 and 1 or 0) -- lamp_ENGINE_OIL_PRESS - SendDataHW("92", mainPanelDevice:get_argument_value(92) > 0.3 and 1 or 0) -- lamp_ENGINE_ICING - SendDataHW("93", mainPanelDevice:get_argument_value(93) > 0.3 and 1 or 0) -- lamp_ENGINE_ICE_JET - SendDataHW("94", mainPanelDevice:get_argument_value(94) > 0.3 and 1 or 0) -- lamp_ENGINE_CHIP_DET - SendDataHW("95", mainPanelDevice:get_argument_value(95) > 0.3 and 1 or 0) -- lamp_LEFT_FUEL_BOOST - SendDataHW("96", mainPanelDevice:get_argument_value(96) > 0.3 and 1 or 0) -- lamp_RIGHT_FUEL_BOOST - SendDataHW("97", mainPanelDevice:get_argument_value(97) > 0.3 and 1 or 0) -- lamp_ENG_FUEL_PUMP - SendDataHW("98", mainPanelDevice:get_argument_value(98) > 0.3 and 1 or 0) -- lamp_20_MINUTE - SendDataHW("99", mainPanelDevice:get_argument_value(99) > 0.3 and 1 or 0) -- lamp_FUEL_FILTER - SendDataHW("100", mainPanelDevice:get_argument_value(100) > 0.3 and 1 or 0) -- lamp_GOV_EMERG - SendDataHW("101", mainPanelDevice:get_argument_value(101) > 0.3 and 1 or 0) -- lamp_AUX_FUEL_LOW - SendDataHW("102", mainPanelDevice:get_argument_value(102) > 0.3 and 1 or 0) -- lamp_XMSN_OIL_PRESS - SendDataHW("103", mainPanelDevice:get_argument_value(103) > 0.3 and 1 or 0) -- lamp_XMSN_OIL_HOT - SendDataHW("104", mainPanelDevice:get_argument_value(104) > 0.3 and 1 or 0) -- lamp_HYD_PRESSURE - SendDataHW("105", mainPanelDevice:get_argument_value(105) > 0.3 and 1 or 0) -- lamp_ENGINE_INLET_AIR - SendDataHW("106", mainPanelDevice:get_argument_value(106) > 0.3 and 1 or 0) -- lamp_INST_INVERTER - SendDataHW("107", mainPanelDevice:get_argument_value(107) > 0.3 and 1 or 0) -- lamp_DC_GENERATOR - SendDataHW("108", mainPanelDevice:get_argument_value(108) > 0.3 and 1 or 0) -- lamp_EXTERNAL_POWER - SendDataHW("109", mainPanelDevice:get_argument_value(109) > 0.3 and 1 or 0) -- lamp_CHIP_DETECTOR - SendDataHW("110", mainPanelDevice:get_argument_value(110) > 0.3 and 1 or 0) -- lamp_IFF - -- M21 - SendDataHW("254", mainPanelDevice:get_argument_value(254) > 0.3 and 1 or 0) -- lamp_M21_ARMED - SendDataHW("255", mainPanelDevice:get_argument_value(255) > 0.3 and 1 or 0) -- lamp_M21_SAFE - -- IFF - SendDataHW("76", mainPanelDevice:get_argument_value(76) > 0.3 and 1 or 0) -- lamp_IFF_REPLY - SendDataHW("77", mainPanelDevice:get_argument_value(77) > 0.3 and 1 or 0) -- lamp_IFF_TEST - -- Beacon - SendDataHW("56", mainPanelDevice:get_argument_value(56) > 0.3 and 1 or 0) -- lamp_Marker_Beacon - -- XM130 Chaff Flare - SendDataHW("458", mainPanelDevice:get_argument_value(458) > 0.3 and 1 or 0) -- lamp_XM130_ARMED - - --[[ - -- dimming lights - -- Light - SendDataHW("279", string.format("%.1f", mainPanelDevice:get_argument_value(279))) -- light_ConsoleLight - SendDataHW("410", string.format("%.1f", mainPanelDevice:get_argument_value(410))) -- light_DomeLight - SendDataHW("411", string.format("%.1f", mainPanelDevice:get_argument_value(411))) -- light_DomeLightGreen - -- Radar Altimeter - SendDataHW("447", string.format("%.1f", mainPanelDevice:get_argument_value(447))) -- RALT_LO_Lamp - SendDataHW("465", string.format("%.1f", mainPanelDevice:get_argument_value(465))) -- RALT_HI_Lamp - -- Main Panel Lights - SendDataHW("277", string.format("%.1f", mainPanelDevice:get_argument_value(277))) -- lamp_MASTER - SendDataHW("276", string.format("%.1f", mainPanelDevice:get_argument_value(276))) -- lamp_LOW_RPM - SendDataHW("275", string.format("%.1f", mainPanelDevice:get_argument_value(275))) -- lamp_FIRE - -- Caution Panel Lights - SendDataHW("91", string.format("%.1f", mainPanelDevice:get_argument_value(91))) -- lamp_ENGINE_OIL_PRESS - SendDataHW("92", string.format("%.1f", mainPanelDevice:get_argument_value(92))) -- lamp_ENGINE_ICING - SendDataHW("93", string.format("%.1f", mainPanelDevice:get_argument_value(93))) -- lamp_ENGINE_ICE_JET - SendDataHW("94", string.format("%.1f", mainPanelDevice:get_argument_value(94))) -- lamp_ENGINE_CHIP_DET - SendDataHW("95", string.format("%.1f", mainPanelDevice:get_argument_value(95))) -- lamp_LEFT_FUEL_BOOST - SendDataHW("96", string.format("%.1f", mainPanelDevice:get_argument_value(96))) -- lamp_RIGHT_FUEL_BOOST - SendDataHW("97", string.format("%.1f", mainPanelDevice:get_argument_value(97))) -- lamp_ENG_FUEL_PUMP - SendDataHW("98", string.format("%.1f", mainPanelDevice:get_argument_value(98))) -- lamp_20_MINUTE - SendDataHW("99", string.format("%.1f", mainPanelDevice:get_argument_value(99))) -- lamp_FUEL_FILTER - SendDataHW("100", string.format("%.1f", mainPanelDevice:get_argument_value(100))) -- lamp_GOV_EMERG - SendDataHW("101", string.format("%.1f", mainPanelDevice:get_argument_value(101))) -- lamp_AUX_FUEL_LOW - SendDataHW("102", string.format("%.1f", mainPanelDevice:get_argument_value(102))) -- lamp_XMSN_OIL_PRESS - SendDataHW("103", string.format("%.1f", mainPanelDevice:get_argument_value(103))) -- lamp_XMSN_OIL_HOT - SendDataHW("104", string.format("%.1f", mainPanelDevice:get_argument_value(104))) -- lamp_HYD_PRESSURE - SendDataHW("105", string.format("%.1f", mainPanelDevice:get_argument_value(105))) -- lamp_ENGINE_INLET_AIR - SendDataHW("106", string.format("%.1f", mainPanelDevice:get_argument_value(106))) -- lamp_INST_INVERTER - SendDataHW("107", string.format("%.1f", mainPanelDevice:get_argument_value(107))) -- lamp_DC_GENERATOR - SendDataHW("108", string.format("%.1f", mainPanelDevice:get_argument_value(108))) -- lamp_EXTERNAL_POWER - SendDataHW("109", string.format("%.1f", mainPanelDevice:get_argument_value(109))) -- lamp_CHIP_DETECTOR - SendDataHW("110", string.format("%.1f", mainPanelDevice:get_argument_value(110))) -- lamp_IFF - -- M21 - SendDataHW("254", string.format("%.1f", mainPanelDevice:get_argument_value(254))) -- lamp_M21_ARMED - SendDataHW("255", string.format("%.1f", mainPanelDevice:get_argument_value(255))) -- lamp_M21_SAFE - -- - SendDataHW("76", string.format("%.1f", mainPanelDevice:get_argument_value(76))) -- lamp_IFF_REPLY - SendDataHW("77", string.format("%.1f", mainPanelDevice:get_argument_value(77))) -- lamp_IFF_TEST - -- - SendDataHW("56", string.format("%.1f", mainPanelDevice:get_argument_value(56))) -- Marker_Beacon_Lamp - -- XM130 Chaff Flare - SendDataHW("458", string.format("%.1f", mainPanelDevice:get_argument_value(458))) -- XM130_ARMED_LAMP - ]] -end - ------------------------------------------------------ --- LOW IMPORTANCE EXPORTS -- --- done every gExportLowTickInterval export events -- ------------------------------------------------------ - -function ProcessGlassCockpitDCSConfigLowImportance(mainPanelDevice) - --[[ - export in low tick interval to GlassCockpit - Example from A-10C - Get Radio Frequencies - get data from device - local lUHFRadio = GetDevice(54) - SendData("ExportID", "Format") - SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data - ]] -end - -function ProcessHARDWAREConfigLowImportance(mainPanelDevice) ---[[ - export in low tick interval to hardware - Example from A-10C - Landing Gear - mainPanelDevice, basis panel - SendDataHW("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE - SendDataHW("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE - SendDataHW("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE - ]] - - -- Radio comunication - -- UHF_ARC_51 - local lUHF_ARC_51 = GetDevice(22) - SendDataHW("2000", string.format("%7.3f", lUHF_ARC_51:get_frequency()/1000000)) - - local lUHF_ARC_51_PRESET = {[0.00]="1",[0.05]="2",[0.10]="3",[0.15]="4",[0.20]="5",[0.25]="6",[0.30]="7",[0.35]="8",[0.40]="9",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"} - SendDataHW("2001", lUHF_ARC_51_PRESET[math.round(mainPanelDevice:get_argument_value(16), 2)]) - - -- VHF_ARC_131 - local lVHF_ARC_131 = GetDevice(23) - SendDataHW("2002", string.format("%7.3f", lVHF_ARC_131:get_frequency()/1000000)) - - -- VHF_ARC_134 - local lVHF_ARC_134 = GetDevice(20) - SendDataHW("2003", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000)) - - -- ARN_82 VHF Navigation Set NOT FUNCTIONAL - --local lARN_82 = GetDevice(26) - --WriteToLog('lARN_82: '..dump(lARN_82)) - --WriteToLog('lARN_82 (metatable): '..dump(getmetatable(lARN_82))) - --SendDataHW("2004", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000)) - - -- XM130 FLARE CHAFF - SendDataHW("2005", string.format("%1d", math.round(mainPanelDevice:get_argument_value(460) * 10, 0)..math.round(mainPanelDevice:get_argument_value(461) * 10, 0))) -- FLARE_Digit_1 -- FLARE_Digit_2 - SendDataHW("2006", string.format("%1d", math.round(mainPanelDevice:get_argument_value(462) * 10, 0)..math.round(mainPanelDevice:get_argument_value(463) * 10, 0))) -- CHAFF_Digit_1 -- CHAFF_Digit_2 - - -- ADF_ARN83 - local lpos1, pos2, lpos3, pos4 - local lADF_ARN83 = "" - local lCockpitParams = list_cockpit_params() - if lCockpitParams ~= nil then - lpos1, pos2 = lCockpitParams:find("ADF_FREQ:", 1) - if pos2 ~= nil then - lpos3, pos4 = lCockpitParams:find("%c", pos2) - if lpos3 ~= nil then - lADF_ARN83 = lCockpitParams:sub(pos2 + 1, lpos3 - 2) - else - lADF_ARN83 = lCockpitParams:sub(pos2 + 1) - end - lADF_ARN83 = math.round(tonumber(lADF_ARN83) / 1000, 2) - end - end - - SendDataHW("2007", string.format("%s", lADF_ARN83)) - - -- Radar Altimeter - AN/APN-209 - -- [468] = "%0.1f", -- RALT_Digit_1 - -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' - -- [469] = "%0.1f", -- RALT_Digit_2 - -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' - -- [470] = "%0.1f", -- RALT_Digit_3 - -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' - -- [471] = "%0.1f", -- RALT_Digit_4 - -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' - local lAN_APN_209_PRESET = {[0.0]="0",[0.1]="1",[0.2]="2",[0.3]="3",[0.4]="4",[0.5]="5",[0.6]="6",[0.7]="7",[0.8]="8",[0.9]="9",[1.0]=" "} - local lAN_APN_209 = "" - lAN_APN_209 = lAN_APN_209_PRESET[math.round(mainPanelDevice:get_argument_value(468), 2)] - lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[math.round(mainPanelDevice:get_argument_value(469), 2)] - lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[math.round(mainPanelDevice:get_argument_value(470), 2)] - lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[math.round(mainPanelDevice:get_argument_value(471), 2)] - SendDataHW("2008", string.format("%s", lAN_APN_209)) - - -- generic Radio display and frequency rotarys - ------------------------------------------------- - genericRadio(nil, nil, gES_genericRadioHardwareID) - - --[[ - -- ENGINE_INTERFACE - local lENGINE_INTERFACE = GetDevice(3) - WriteToLog('lENGINE_INTERFACE:get_eng_rpm '..dump(lENGINE_INTERFACE:get_eng_rpm())) - WriteToLog('lENGINE_INTERFACE:get_fire_lamp '..dump(lENGINE_INTERFACE:get_fire_lamp())) - WriteToLog('lENGINE_INTERFACE:get_gas_prod_tach '..dump(lENGINE_INTERFACE:get_gas_prod_tach())) - WriteToLog('lENGINE_INTERFACE:get_fire_test_lamp '..dump(lENGINE_INTERFACE:get_fire_test_lamp())) - WriteToLog('lENGINE_INTERFACE:get_trans_oil_temp '..dump(lENGINE_INTERFACE:get_trans_oil_temp())) - WriteToLog('lENGINE_INTERFACE:get_eng_torq '..dump(lENGINE_INTERFACE:get_eng_torq())) - WriteToLog('lENGINE_INTERFACE:get_trans_oil_press '..dump(lENGINE_INTERFACE:get_trans_oil_press())) - WriteToLog('lENGINE_INTERFACE:get_exhaust_temp '..dump(lENGINE_INTERFACE:get_exhaust_temp())) - WriteToLog('lENGINE_INTERFACE:get_low_rpm_lamp '..dump(lENGINE_INTERFACE:get_low_rpm_lamp())) - WriteToLog('lENGINE_INTERFACE:get_eng_oil_temp '..dump(lENGINE_INTERFACE:get_eng_oil_temp())) - WriteToLog('lENGINE_INTERFACE:get_eng_oil_press '..dump(lENGINE_INTERFACE:get_eng_oil_press())) - - -- ADI_PILOT - local lADI_PILOT = GetDevice(6) - WriteToLog('lADI_PILOT:get_sideslip '..dump(lADI_PILOT:get_sideslip())) - WriteToLog('lADI_PILOT:get_bank '..dump(lADI_PILOT:get_bank())) - WriteToLog('lADI_PILOT:get_pitch '..dump(lADI_PILOT:get_pitch())) - - -- RADAR_ALTIMETER - local lRADAR_ALTIMETER = GetDevice(13) - WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..dump(lRADAR_ALTIMETER:get_distance_limit())) - WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..dump(lRADAR_ALTIMETER:get_aperture_size())) - WriteToLog('lRADAR_ALTIMETER:get_mode '..dump(lRADAR_ALTIMETER:get_mode())) - WriteToLog('lRADAR_ALTIMETER:get_altitude '..dump(lRADAR_ALTIMETER:get_altitude())) - ]] - --[[ - -- VHF_ARC_134 - local lVHF_ARC_134 = GetDevice(20) - WriteToLog('lVHF_ARC_134:is_on '..dump(lVHF_ARC_134:is_on())) - WriteToLog('lVHF_ARC_134:get_frequency '..dump(lVHF_ARC_134:get_frequency())) - --WriteToLog('lVHF_ARC_134:set_frequency '..dump(lVHF_ARC_134:set_frequency())) -- test parameters - --WriteToLog('lVHF_ARC_134:set_modulation '..dump(lVHF_ARC_134:set_modulation())) -- test parameters - --WriteToLog('lVHF_ARC_134:set_channel '..dump(lVHF_ARC_134:set_channel())) -- test parameters - - -- INTERCOM - local lINTERCOM = GetDevice(21) - WriteToLog('lINTERCOM:is_communicator_available '..dump(lINTERCOM:is_communicator_available())) - WriteToLog('lINTERCOM:get_noise_level '..dump(lINTERCOM:get_noise_level())) - WriteToLog('lINTERCOM:get_signal_level '..dump(lINTERCOM:get_signal_level())) - --WriteToLog('lINTERCOM:set_communicator '..dump(lINTERCOM:set_communicator())) -- test parameters - --WriteToLog('lINTERCOM:set_voip_mode '..dump(lINTERCOM:set_voip_mode())) -- test parameters - - -- UHF_ARC_51 - local lUHF_ARC_51 = GetDevice(22) - WriteToLog('lUHF_ARC_51:is_on '..dump(lUHF_ARC_51:is_on())) - WriteToLog('lUHF_ARC_51:get_frequency '..dump(lUHF_ARC_51:get_frequency())) - --WriteToLog('lUHF_ARC_51:set_frequency '..dump(lUHF_ARC_51:set_frequency())) -- test parameters - --WriteToLog('lUHF_ARC_51:set_modulation '..dump(lUHF_ARC_51:set_modulation())) -- test parameters - --WriteToLog('lUHF_ARC_51:set_channel '..dump(lUHF_ARC_51:set_channel())) -- test parameters - - -- VHF_ARC_131 - local lVHF_ARC_131 = GetDevice(23) - WriteToLog('lVHF_ARC_131:is_on '..dump(lVHF_ARC_131:is_on())) - WriteToLog('lVHF_ARC_131:get_frequency '..dump(lVHF_ARC_131:get_frequency())) - --WriteToLog('lVHF_ARC_131:set_frequency '..dump(lVHF_ARC_131:set_frequency())) -- test parameters - --WriteToLog('lVHF_ARC_131:set_modulation '..dump(lVHF_ARC_131:set_modulation())) -- test parameters - --WriteToLog('lVHF_ARC_131:set_channel '..dump(lVHF_ARC_131:set_channel())) -- test parameters - - WriteToLog('Frequency Mode Dial '..dump(mainPanelDevice:get_argument_value(15))) - WriteToLog('Function Dial '..dump(mainPanelDevice:get_argument_value(17))) - ]] - --[[ - Device test, Device 2 to 32 - is value "userdata", is only DLL intern functions - local ltmp1 = 0 - for ltmp2 = 1, 49, 1 do - ltmp1 = GetDevice(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] - --[[ - WriteToLog('list_cockpit_params(): '..dump(list_cockpit_params())) - - local ltmp1 = 0 - for ltmp2 = 1, 8, 1 do - ltmp1 = list_indication(ltmp2) - WriteToLog(ltmp2..': '..dump(ltmp1)) - --WriteToLog(ltmp2..' (metatable): '..dump(getmetatable(ltmp1))) - end - ]] -end - ------------------------------ --- Custom functions -- ------------------------------ - -function genericRadio(key, value, hardware) - local lHardware = hardware or 1 - -- Werte werden per Encoder im Bereich von 0.0 bis 2.0 in 0.1 Schritten uebergeben - -- im jeweiligen Abschnitt muessen die Eingangsdaten auf den Zulaessigen Bereich eingeschraengt werden - local lRotaryFrequency_1, lRotaryFrequency_2, lVolume, lPreset, lLoad, lSquelch, lManualPreset, lPower, lDevice, lClickAction, lSetFrequency = nil - local lMainPanelDevice = GetDevice(0) - local lMaxRadios = 3 - - if gES_genericRadio == nil then - gES_genericRadio = 0 - end - if gES_genericRadioFrequency1 == nil then - gES_genericRadioFrequency1 = 0.0 - end - if gES_genericRadioFrequency2 == nil then - gES_genericRadioFrequency2 = 0.0 - end - if gES_genericRadioPresetChannel == nil then - gES_genericRadioPresetChannel = 0.0 - end - if gES_genericRadioPower == nil then - gES_genericRadioPower = {} - end - if gES_genericRadioPresetManual == nil then - gES_genericRadioPresetManual = {} - end - if gES_genericRadioSquelch == nil then - gES_genericRadioSquelch = {} - end - - if key == "3001" then - gES_genericRadio = tonumber(value) - end - if key == "3002" then - lRotaryFrequency_1 = tonumber(value) - end - if key == "3003" then - lRotaryFrequency_2 = tonumber(value) - end - if key == "3004" then - lVolume = tonumber(value) - end - if key == "3005" then - lPreset = tonumber(value) - end - if key == "3006" then - lLoad = tonumber(value) - end - if key == "3007" then - lSquelch = tonumber(value) - end - if key == "3008" then - lManualPreset = tonumber(value) - end - if key == "3009" then - lPower = tonumber(value) - end - - if gES_genericRadio > lMaxRadios then - WriteToLog("Radio Nr. "..gES_genericRadio.." not defined.") - return - end - - if gES_genericRadio == 1 then - -- AN/ARC-131 VHF FM Radio - local lDeviceID = 23 - local lVHF_FM_RADIO = GetDevice(lDeviceID) - - -- check status of the radio - if gES_genericRadioPower[gES_genericRadio] == nil then - if lVHF_FM_RADIO:is_on() then - gES_genericRadioPower[gES_genericRadio] = 1.0 - else - gES_genericRadioPower[gES_genericRadio] = 0.0 - end - end - if gES_genericRadioPresetManual[gES_genericRadio] == nil then - gES_genericRadioPresetManual[gES_genericRadio] = 0 -- no preset channels - end - if gES_genericRadioSquelch[gES_genericRadio] == nil then - gES_genericRadioSquelch[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(36), 1) == 0.1) and 0 or 1) - end - - local lVHF_FM_RADIO_FREQUENCY = math.round(lVHF_FM_RADIO:get_frequency()/1000000 , 3, "floor") - - SendDataHW("3000", string.format("%.3f", lVHF_FM_RADIO_FREQUENCY), lHardware) - SendDataHW("3001", string.format("-"), lHardware) - SendDataHW("3002", string.format("%.3f", lVHF_FM_RADIO_FREQUENCY), lHardware) - - if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then - - local lFrequency = StrSplit(lVHF_FM_RADIO_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 25) - lFrequency[2] = ltmp * 25 - end - if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then - lFrequency[1] = lFrequency[1] - 1 - if lFrequency[1] == 99 then - lFrequency[1] = 399 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - else - lFrequency[1] = lFrequency[1] + 1 - if lFrequency[1] == 400 then - lFrequency[1] = 100 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("1. genericUH-1H AN/ARC-131 VHF FM Radio, don't split frequency: "..lFrequency) - end - end - - if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then - - local lFrequency = StrSplit(lVHF_FM_RADIO_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 25) - lFrequency[2] = ltmp * 25 - end - if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then - lFrequency[2] = lFrequency[2] - 25 - if lFrequency[2] == -25 then - lFrequency[2] = 975 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - else - lFrequency[2] = lFrequency[2] + 25 - if lFrequency[2] == 1000 then - lFrequency[2] = 0 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("2. generic UH-1H AN/ARC-131 VHF FM Radio, don't split frequency: "..lFrequency) - end - end - - if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then - lVolume = lVolume / 2 - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3006, - Value = lVolume} - end ---[[ - if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then - -- Preset 0.0 to 0.20 in 0.01 steps - if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3001, - Value = 0.01} - gES_genericRadioPresetChannel = lPreset - else - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3002, - Value = -0.01} - gES_genericRadioPresetChannel = lPreset - end - end - if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3006, - Value = lLoad} - end - if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then - if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then - -- Manual on - lManualPreset = 0.1 - gES_genericRadioPresetManual[gES_genericRadio] = 0 - elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then - -- Preset on - lManualPreset = 0.0 - gES_genericRadioPresetManual[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3005, - Value = lManualPreset} - end -]] - if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then - if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then - -- Squelch off - lSquelch = 0.0 - gES_genericRadioSquelch[gES_genericRadio] = 0 - elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then - -- Squelch on - lSquelch = 0.1 - gES_genericRadioSquelch[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3005, - Value = lSquelch} - end - if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then - if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then - -- Power off - lPower = 0.0 - gES_genericRadioPower[gES_genericRadio] = 0 - elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then - -- Power on - lPower = 0.1 - gES_genericRadioPower[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3007, - Value = lPower} - end - - elseif gES_genericRadio == 2 then - -- AN/ARC-51BX UHF AM Radio - local lDeviceID = 22 - local lUHF_AM_RADIO = GetDevice(lDeviceID) - - -- check status of the radio - if gES_genericRadioPower[gES_genericRadio] == nil then - if lUHF_AM_RADIO:is_on() then - gES_genericRadioPower[gES_genericRadio] = 1.0 - else - gES_genericRadioPower[gES_genericRadio] = 0.0 - end - end - if gES_genericRadioPresetManual[gES_genericRadio] == nil then - gES_genericRadioPresetManual[gES_genericRadio] = ((math.round(lMainPanelDevice:get_argument_value(15), 1) == 0.1) and 0 or 1) - end - if gES_genericRadioSquelch[gES_genericRadio] == nil then - gES_genericRadioSquelch[gES_genericRadio] = math.round(lMainPanelDevice:get_argument_value(22), 1) - end - - local lPresetChannel = math.round(lMainPanelDevice:get_argument_value(16), 2) - - local lUHF_AM_RADIO_PRESET = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"} - local lUHF_AM_RADIO_FREQUENCY = math.round(lUHF_AM_RADIO:get_frequency()/1000000 , 3, "floor") - - SendDataHW("3000", string.format("%s%.3f", lUHF_AM_RADIO_PRESET[lPresetChannel], lUHF_AM_RADIO_FREQUENCY), lHardware) - SendDataHW("3001", string.format("%s", lUHF_AM_RADIO_PRESET[lPresetChannel]), lHardware) - SendDataHW("3002", string.format("%.3f", lUHF_AM_RADIO_FREQUENCY), lHardware) - - if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then - - local lFrequency = StrSplit(lUHF_AM_RADIO_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 50) - lFrequency[2] = ltmp * 50 - end - if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then - lFrequency[1] = lFrequency[1] - 1 - if lFrequency[1] == 224 then - lFrequency[1] = 399 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - else - lFrequency[1] = lFrequency[1] + 1 - if lFrequency[1] == 400 then - lFrequency[1] = 225 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("1. generic UH-1H AN/ARC-51BX UHF AM Radio, don't split frequency: "..lFrequency) - end - end - - if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then - - local lFrequency = StrSplit(lUHF_AM_RADIO_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 50) - lFrequency[2] = ltmp * 50 - end - if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then - lFrequency[2] = lFrequency[2] - 50 - if lFrequency[2] == -50 then - lFrequency[2] = 950 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - else - lFrequency[2] = lFrequency[2] + 50 - if lFrequency[2] == 1000 then - lFrequency[2] = 0 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("2. generic UH-1H AN/ARC-51BX UHF AM Radio, don't split frequency: "..lFrequency) - end - end - if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then - lVolume = lVolume / 2 - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3008, - Value = lVolume} - end - if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then - -- Preset 0.0 to 0.95 in 0.05 steps - if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then - lPresetChannel = lPresetChannel + 0.05 - gES_genericRadioPresetChannel = lPreset - if lPresetChannel == 1.00 then - lPresetChannel = 0.0 - end - else - lPresetChannel = lPresetChannel - 0.05 - gES_genericRadioPresetChannel = lPreset - if lPresetChannel == -0.05 then - lPresetChannel = 0.95 - end - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3001, - Value = lPresetChannel} - end - if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then - if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then - -- Power off - lSquelch = 0.0 - gES_genericRadioSquelch[gES_genericRadio] = 0 - elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then - -- Power on - lSquelch = 1.0 - gES_genericRadioSquelch[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3007, - Value = lSquelch} - end - if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then - if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then - -- Manual on - lManualPreset = 0.1 - gES_genericRadioPresetManual[gES_genericRadio] = 0 - elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then - -- Preset on - lManualPreset = 0.0 - gES_genericRadioPresetManual[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3005, - Value = lManualPreset} - end - if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then - if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then - -- Power off - lPower = 0.0 - gES_genericRadioPower[gES_genericRadio] = 0 - elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then - -- Power on - lPower = 0.1 - gES_genericRadioPower[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3006, - Value = lPower} - end - - elseif gES_genericRadio == 3 then - -- AN/ARC-134 VHF AM Radio - local lDeviceID = 20 - local lVHF_AM_RADIO = GetDevice(lDeviceID) - - -- check status of the radio - if gES_genericRadioPower[gES_genericRadio] == nil then - if lVHF_AM_RADIO:is_on() then - gES_genericRadioPower[gES_genericRadio] = 1.0 - else - gES_genericRadioPower[gES_genericRadio] = 0.85 - end - end - if gES_genericRadioPresetManual[gES_genericRadio] == nil then - gES_genericRadioPresetManual[gES_genericRadio] = 0.0 -- no preset channels - end - if gES_genericRadioSquelch[gES_genericRadio] == nil then - gES_genericRadioSquelch[gES_genericRadio] = 0.0 -- no Squelch - end - - local lVHF_AM_RADIO_FREQUENCY = math.round(lVHF_AM_RADIO:get_frequency()/1000000 , 3, "floor") - - SendDataHW("3000", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware) - SendDataHW("3001", string.format("-"), lHardware) - SendDataHW("3002", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware) - - if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then - - local lFrequency = StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 25) - lFrequency[2] = ltmp * 25 - end - if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then - lFrequency[1] = lFrequency[1] - 1 - if lFrequency[1] == 99 then - lFrequency[1] = 399 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - else - lFrequency[1] = lFrequency[1] + 1 - if lFrequency[1] == 400 then - lFrequency[1] = 100 - end - gES_genericRadioFrequency1 = lRotaryFrequency_1 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("1. genericUH-1H AN/ARC-134 VHF AM Radio, don't split frequency: "..lFrequency) - end - end - - if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then - - local lFrequency = StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.") - - if type(lFrequency) == "table" and lFrequency[1] ~= nil then - lFrequency[1] = tonumber(lFrequency[1]) - if lFrequency[2] == nil then - lFrequency[2] = 0 - else - lFrequency[2] = tonumber(lFrequency[2]) - local ltmp = string.format("%.0f", lFrequency[2] / 25) - lFrequency[2] = ltmp * 25 - end - if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then - lFrequency[2] = lFrequency[2] - 25 - if lFrequency[2] == -25 then - lFrequency[2] = 975 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - else - lFrequency[2] = lFrequency[2] + 25 - if lFrequency[2] == 1000 then - lFrequency[2] = 0 - end - gES_genericRadioFrequency2 = lRotaryFrequency_2 - end - - lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) - local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) - ltempFrequency = tonumber(ltempFrequency) - lSetFrequency = {DeviceID = lDeviceID, - Frequency = ltempFrequency * 1000000} - - else - WriteToLog("2. generic UH-1H AN/ARC-134 VHF AM Radio, don't split frequency: "..lFrequency) - end - end - - if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then - lVolume = lVolume / 3 - if lVolume > 0.65 then - lVolume = 0.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3003, - Value = lVolume} - end ---[[ - if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then - -- Preset 0.0 to 0.20 in 0.01 steps - if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3001, - Value = 0.01} - gES_genericRadioPresetChannel = lPreset - else - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3002, - Value = -0.01} - gES_genericRadioPresetChannel = lPreset - end - end - if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3006, - Value = lLoad} - end - if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then - if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then - -- Power off - lSquelch = 0.0 - gES_genericRadioSquelch[gES_genericRadio] = 0 - elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then - -- Power on - lSquelch = 1.0 - gES_genericRadioSquelch[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3007, - Value = lSquelch} - end - if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then - if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then - -- Manual on - lManualPreset = 0.1 - gES_genericRadioPresetManual[gES_genericRadio] = 0 - elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then - -- Preset on - lManualPreset = 0.0 - gES_genericRadioPresetManual[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3005, - Value = lManualPreset} - end -]] - if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then - if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then - -- Power off - lPower = 0.85 - gES_genericRadioPower[gES_genericRadio] = 0 - elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then - -- Power on - lPower = 1.0 - gES_genericRadioPower[gES_genericRadio] = 1.0 - end - lClickAction = {DeviceID = lDeviceID, - ButtonID = 3001, - Value = lPower} - end - - else - SendDataHW("3000", "-", lHardware) - SendDataHW("3001", "-", lHardware) - SendDataHW("3002", "-", lHardware) - SendDataHW("3010", 0, lHardware) - SendDataHW("3011", 0, lHardware) - SendDataHW("3012", 0, lHardware) - return - end - - SendDataHW("3010", gES_genericRadioPower[gES_genericRadio], lHardware) - SendDataHW("3011", gES_genericRadioPresetManual[gES_genericRadio], lHardware) - SendDataHW("3012", gES_genericRadioSquelch[gES_genericRadio], lHardware) - - if lClickAction ~= nil then - lDevice = GetDevice(lClickAction.DeviceID) - if type(lDevice) == "table" then - --WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ") - lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value) - end - elseif lSetFrequency ~= nil then - lDevice = GetDevice(lSetFrequency.DeviceID) - if type(lDevice) == "table" and lDevice:is_on() then - --WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ") - lDevice:set_frequency(lSetFrequency.Frequency) - else - WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on") - end - end -end +-- Uh-1H Export +-- Version 1.0.0 BETA + +ExportScript.FoundDCSModule = true + +ExportScript.ConfigEveryFrameArguments = +{ + --[[ + every frames arguments + based of "mainpanel_init.lua" + Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format) + [DeviceID] = "Format" + [4] = "%.4f", <- floating-point number with 4 digits after point + [19] = "%0.1f", <- floating-point number with 1 digit after point + [129] = "%1d", <- decimal number + [5] = "%.f", <- floating point number rounded to a decimal number + ]] + -- Controlls Pilot + --[184] = "%.4f", -- rudder + --[187] = "%.4f", -- stick_roll + --[186] = "%.4f", -- stick_pitch + --[200] = "%.4f", -- collective_position + -- Controlls CoPilot + --[185] = "%.4f", -- rudder_add + --[191] = "%.4f", -- stick_roll_sec + --[190] = "%.4f", -- stick_pitch_sec + --[207] = "%.4f", -- collective_position_operator + -- Gauges Pilot + [117] = "%0.4f", -- AIRSPEED_Nose {0.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 120.0, 150.0} {0.0, 0.075, 0.19, 0.32, 0.395, 0.44, 0.55, 0.825, 1.0} + [118] = "%0.4f", -- AIRSPEED_Roof {0.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 120.0, 150.0} {0.0, 0.075, 0.19, 0.32, 0.395, 0.44, 0.55, 0.825, 1.0} + -- Course Indicator ID-1347 + [151] = "%.4f", -- VerticalBar {-1.0, 1.0} {-0.7, 0.7} + [152] = "%.4f", -- HorisontalBar {-1.0, 1.0} {-0.7, 0.7} + [153] = "%.4f", -- ToMarker + [154] = "%.4f", -- FromMarker + [156] = "%.4f", -- RotCourseCard + [157] = "%.1f", -- VerticalOFF + [158] = "%.1f", -- HorisontalOFF + -- ADF_ARN83 + [45] = "%0.2f", -- ADF_ARN83_Frequency {0.0, 1.0} {0.0, 0.55} + [40] = "%.4f", -- ARN83_SignalLevel + -- GMC + [159] = "%.4f", -- GMC_CoursePointer1 + [160] = "%.4f", -- GMC_CoursePointer2 + [162] = "%.4f", -- GMC_HeadingMarker + [165] = "%.4f", -- GMC_Heading + [166] = "%.4f", -- GMC_Annunciator {-1.0, 1.0} {0.0, 1.0} + [167] = "%.2f", -- GMC_PowerFail + -- Copilot RMI + [266] = "%.4f", -- RMI_CoursePointer1 + [267] = "%.4f", -- RMI_CoursePointer2 + [269] = "%.4f", -- RMI_Heading + -- Altimeter Indicator AAU-32/A (operator) + [168] = "%.4f", -- Pointer {0.0, 1000.0} {0.0, 1.0} + [169] = "%.4f", -- Alt1AAU_10000_footCount {0.0, 10.0} {0.0, 1.0} + [170] = "%.4f", -- Alt1AAU_1000_footCount {0.0, 10.0} {0.0, 1.0} + [171] = "%.4f", -- Alt1AAU_100_footCount {0.0, 10.0} {0.0, 1.0} + [174] = "%.2f", -- AAU_32_Drum_Counter {-2.0, 1.0} {0.0, 0.3} + [175] = "%.2f", -- AAU_32_Drum_Counter {0.0, 10.0} {0.0, 1.0} + [176] = "%.2f", -- AAU_32_Drum_Counter {0.0, 10.0} {0.0, 1.0} + [177] = "%.1f", -- CodeOff_flag + -- Altimeter Indicator AAU-7/A (pilot) (AAU-31/A) + [178] = "%.4f", -- Alt_10000_AAU_7A {0.0, 100000.0} {0.0, 1.0} + [179] = "%.4f", -- Alt_1000_AAU_7A {0.0, 10000.0} {0.0, 1.0} + [180] = "%.4f", -- Alt_100_AAU_7A {0.0, 1000.0} {0.0, 1.0} + [182] = "%.4f", -- Press_AAU_7A {28.1, 31.0} {0.0, 1.0} + -- Gauges + [113] = "%.4f", -- EngOilPress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0} + [114] = "%.4f", -- EngOilTemp {-70.0, -50.0, 0.0, 100.0, 150.0} {0.0, 0.13, 0.38, 0.71, 1.0} + [115] = "%.4f", -- TransmOilPress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0} + [116] = "%.4f", -- TransmOilTemp {-70.0, -50.0, 0.0, 100.0, 150.0} {0.0, 0.13, 0.38, 0.71, 1.0} + --[117] = "%.4f", -- AIRSPEED_Nose + --[118] = "%.4f", -- AIRSPEED_Roof + [121] = "%.4f", -- ExhaustTemp {0.0, 1000.0} {0.0, 1.0} + [122] = "%.4f", -- EngineTach {0.0, 7200.0} {0.0, 1.0} + [123] = "%.4f", -- RotorTach {0.0, 360.0} {0.0, 1.0} + [119] = "%.4f", -- GasProducerTach {0.0, 101.5} {0.0, 1.0} + [120] = "%.4f", -- GasProducerTach_U {0.0, 10.0} {0.0, 1.0} + [124] = "%.4f", -- TorquePress {-3.0, 0.0, 100.0} {0.0, 0.029, 1.0} + [149] = "%.4f", -- VoltageDC {0.0, 30.0} {0.0, 1.0} + [150] = "%.4f", -- VoltageAC {0.0, 150.0} {0.0, 1.0} + [436] = "%.4f", -- LoadmeterMainGen {-1.5, 0.0, 12.5} {0.0, 0.156, 1.0} + [125] = "%.4f", -- LoadmeterSTBYGen {-1.5, 0.0, 12.5} {0.0, 0.09, 1.0} + [126] = "%.4f", -- FuelPress {-2.0, 0.0, 50.0} {0.0, 0.015, 1.0} + [239] = "%.4f", -- FuelQuantity {0.0, 1580.0} {0.0, 1.0} + -- Mechanic clock + [127] = "%.4f", -- CLOCK_hours {0.0, 12.0} {0.0, 1.0} + [128] = "%.4f", -- CLOCK_minutes {0.0, 60.0} {0.0, 1.0} + [129] = "%.4f", -- CLOCK_seconds {0.0, 60.0} {0.0, 1.0} + -- + [132] = "%.4f", -- TurnPtr {-1.0, 1.0} + [133] = "%.4f", -- SideSlip {-1.0, 1.0} + [134] = "%.2f", -- VertVelocPilot {-4000.0, -3000.0, -1500.0, -1000.0, 1000.0, 1500.0, 3000.0, 4000.0} {-1.0, -0.81, -0.54, -0.36, 0.36, 0.54, 0.81, 1.0} + [251] = "%.2f", -- VertVelocCopilot {-4000.0, -3000.0, -1500.0, -1000.0, 1000.0, 1500.0, 3000.0, 4000.0} {-1.0, -0.81, -0.54, -0.36, 0.36, 0.54, 0.81, 1.0} + -- ADI - pilot + [142] = "%.4f", -- Attitude_Roll {1.0, -1.0} + [143] = "%.4f", -- Attitude_Pitch {1.0, -1.0} + [148] = "%.1f", -- Attitude_Off_flag + -- ADI - operator + [135] = "%.4f", -- Attitude_Roll_left {1.0, -1.0} + [136] = "%.4f", -- Attitude_Pitch_left {1.0, -1.0} + [141] = "%.1f", -- Attitude_Off_flag_left {0.0, 1.0} {1.0, 0.0} + [138] = "%.4f", -- Attitude_PitchShift {0.0, 1.0} {-1.0, 1.0} + -- operator + --[149] = "%.4f", -- DCVoltmeter + --[150] = "%.4f", -- ACVoltmeter + -- UHF_ARC51 + [10] = "%.4f", -- UHF_ARC51_Freq1 {2.0, 3.0} {0.0, 1.0} + [11] = "%.4f", -- UHF_ARC51_Freq2 {0.0, 10.0} {0.0, 1.0} + [12] = "%.4f", -- UHF_ARC51_Freq3 {0.0, 10.0} {0.0, 1.0} + [13] = "%.4f", -- UHF_ARC51_Freq4 {0.0, 10.0} {0.0, 1.0} + [14] = "%.4f", -- UHF_ARC51_Freq5 {0.0, 10.0} {0.0, 1.0} + -- NAV_ARN82 + [46] = "%.4f", -- NAV_ARN82_Freq1 {0.0, 10.0} {0.0, 1.0} + [47] = "%.4f", -- NAV_ARN82_Freq2 {0.0, 10.0} {0.0, 1.0} + [48] = "%.4f", -- NAV_ARN82_Freq3 {0.0, 10.0} {0.0, 1.0} + [49] = "%.4f", -- NAV_ARN82_Freq4 {0.0, 10.0} {0.0, 1.0} + [50] = "%.4f", -- NAV_ARN82_Freq5 {0.0, 10.0} {0.0, 1.0} + -- VHF_ARC134 + [1] = "%.4f", -- VHF_ARC134_Freq1 {0.0, 10.0} {0.0, 1.0} + [2] = "%.4f", -- VHF_ARC134_Freq2 {0.0, 10.0} {0.0, 1.0} + [3] = "%.4f", -- VHF_ARC134_Freq3 {0.0, 10.0} {0.0, 1.0} + [4] = "%.4f", -- VHF_ARC134_Freq4 {0.0, 10.0} {0.0, 1.0} + -- + [56] = "%.1f", -- Marker_Beacon_Lamp {0.0, 1.0} {0.0, 0.9} + -- Panel_Shake + --[264] = "%.1f", -- Panel_Shake_Z + --[265] = "%.1f", -- Panel_Shake_Y + --[282] = "%.1f", -- Panel_Rot_X + -- Wiper + --[284] = "%.4f", -- Wiper_Pilot + --[283] = "%.4f", -- Wiper_Operator + -- Pilot Model + --[242] = "%.1f", -- Pilot_Model + --[245] = "%.1f", -- Operator_Model + -- Flexible sight station + --[263] = "%.2f", -- FlexSightHeight + --[261] = "%.4f", -- FlexSightAzimuth + --[262] = "%.4f", -- FlexSightElevation + -- Pilot sight station + --[438] = "%.4f", -- PilotSightHeight + --[442] = "%.2f", -- PilotSightGlass + -- Light + [279] = "%.4f", -- light_ConsoleLight + [410] = "%.4f", -- light_DomeLight + [411] = "%.4f", -- light_DomeLightGreen + -- Damage + --[248] = "%.1f", -- DeadPilot + --[249] = "%.1f", -- DeadCoPilot + --[414] = "%.4f", -- LeftWindShield + --[413] = "%.4f", -- RightWindShield + --[412] = "%.4f", -- DownBlisters + --[417] = "%.4f", -- UpRightBlister + --[418] = "%.4f", -- UpLeftBlister + --[415] = "%.4f", -- RightWindow + --[416] = "%.4f", -- LeftWindow + --[422] = "%.4f", -- RightDoor + --[420] = "%.4f", -- LeftDoor + -- + [437] = "%.3f", -- RamTemp + -- Radar Altimeter + [443] = "%.4f", -- RALT_Needle {0.0, 0.98} {0.0, 0.98} + [467] = "%.1f", -- RALT_Off_Flag + [447] = "%.f", -- RALT_LO_Lamp + [465] = "%.f", -- RALT_HI_Lamp + [444] = "%.4f", -- RALT_LO_Index {-0.02, -0.01, -0.0001,0.0, 0.744} {0.97, 0.99, 1.0, 0.0, 0.744} + [466] = "%.4f", -- RALT_HI_Index {0.0, 0.744} {0.0, 0.744} + [468] = "%0.1f", -- RALT_Digit_1 {0.0, 10.0} {0.0, 1.0} + [469] = "%0.1f", -- RALT_Digit_2 {0.0, 10.0} {0.0, 1.0} + [470] = "%0.1f", -- RALT_Digit_3 {0.0, 10.0} {0.0, 1.0} + [471] = "%0.1f", -- RALT_Digit_4 {0.0, 10.0} {0.0, 1.0} + -- FLARE CHAFF + [460] = "%.1f", -- FLARE_Digit_1 {0.0, 10.0} {0.0, 1.0} + [461] = "%.1f", -- FLARE_Digit_2 {0.0, 10.0} {0.0, 1.0} + [462] = "%.1f", -- CHAFF_Digit_1 {0.0, 10.0} {0.0, 1.0} + [463] = "%.1f", -- CHAFF_Digit_2 {0.0, 10.0} {0.0, 1.0} + -- XM130 Chaff Flare + [458] = "%.f", -- lamp_XM130_ARMED + -- SIGHTS_FOR_CIVIL + [473] = "$.1f", -- SIGHTS_FOR_CIVIL + -- Main Panel Lights + [277] = "%.f", -- lamp_MASTER + [276] = "%.f", -- lamp_LOW_RPM + [275] = "%.f", -- lamp_FIRE + -- Caution Panel Lights + [91] = "%.f", -- lamp_ENGINE_OIL_PRESS + [92] = "%.f", -- lamp_ENGINE_ICING + [93] = "%.f", -- lamp_ENGINE_ICE_JET + [94] = "%.f", -- lamp_ENGINE_CHIP_DET + [95] = "%.f", -- lamp_LEFT_FUEL_BOOST + [96] = "%.f", -- lamp_RIGHT_FUEL_BOOST + [97] = "%.f", -- lamp_ENG_FUEL_PUMP + [98] = "%.f", -- lamp_20_MINUTE + [99] = "%.f", -- lamp_FUEL_FILTER + [100] = "%.f", -- lamp_GOV_EMERG + [101] = "%.f", -- lamp_AUX_FUEL_LOW + [102] = "%.f", -- lamp_XMSN_OIL_PRESS + [103] = "%.f", -- lamp_XMSN_OIL_HOT + [104] = "%.f", -- lamp_HYD_PRESSURE + [105] = "%.f", -- lamp_ENGINE_INLET_AIR + [106] = "%.f", -- lamp_INST_INVERTER + [107] = "%.f", -- lamp_DC_GENERATOR + [108] = "%.f", -- lamp_EXTERNAL_POWER + [109] = "%.f", -- lamp_CHIP_DETECTOR + [110] = "%.f", -- lamp_IFF + -- M21 + [254] = "%.f", -- lamp_M21_ARMED + [255] = "%.f", -- lamp_M21_SAFE + -- + [76] = "%.f", -- lamp_IFF_REPLY + [77] = "%.f", -- lamp_IFF_TEST + -- Electic Gauges + [526] = "%.4f", -- DC_voltage {0.0, 30.0} {0.0, 1.0} + [532] = "%.2f", -- AC_voltage {0.0, 100.0, 150.0, 200.0, 250.0} {0.0, 0.14, 0.31, 0.56, 1.0} + [527] = "%.4f", -- DC_battery_I_current {0.0, 400.0} {0.0, 1.0} + [528] = "%.4f", -- DC_battery_II_current {0.0, 400.0} {0.0, 1.0} + [529] = "%.4f", -- DC_VU_I_current {0.0, 400.0} {0.0, 1.0} + [530] = "%.4f", -- DC_VU_II_current {0.0, 400.0} {0.0, 1.0} + [531] = "%.4f", -- DC_VU_III_current {0.0, 400.0} {0.0, 1.0} + [533] = "%.2f", -- AC_generator_I_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} + [534] = "%.2f", -- AC_generator_II_current {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} + [371] = "%.2f" -- AntiIce_ampermeter {0.0, 50, 70, 90, 120, 130, 140, 150} {0.0, 0.1, 0.2, 0.36, 0.63, 0.75, 0.86, 1.0} +} +ExportScript.ConfigArguments = +{ + --[[ + arguments for export in low tick interval + based on "clickabledata.lua" + ]] + -- Electrosystem + [219] = "%1d", -- Battery + [220] = "%1d", -- Starter/Stdby GEN + [218] = "%.1f", -- DC Voltmeter Selector + [221] = "%1d", -- Non Essential bus + [214] = "%.1f", -- AC Voltmeter Selector + [215] = "%1d", -- Inverter + -- Electrosystem circuit breakers + -- Essential BUS. line 1 + [285] = "%1d", -- CB IFF APX 1 (N/F) + [287] = "%1d", -- CB IFF APX 2 (N/F) + [289] = "%1d", -- CB Prox. warn.(N/F) + [291] = "%1d", -- CB Marker beacon + [293] = "%1d", -- CB VHF Nav. (ARN-82) + [295] = "%1d", -- CB LF Nav. (ARN-83) + [297] = "%1d", -- CB Intercom CPLT(N/F) + [299] = "%1d", -- CB Intercom PLT + [349] = "%1d", -- CB ARC-102 HF Static INVTR(N/F) + [351] = "%1d", -- CB HF ANT COUPLR(N/F) + [353] = "%1d", -- CB HF ARC-102(N/F) + [355] = "%1d", -- CB FM Radio + [357] = "%1d", -- CB UHF Radio + [359] = "%1d", -- CB FM 2 Radio(N/F) + [361] = "%1d", -- CB VHF AM Radio + [321] = "%1d", -- CB Pitot tube(N/F) + [345] = "%1d", -- CB Rescue hoist CTL(N/F) + [347] = "%1d", -- CB Rescue hoist cable cutter (N/F) + -- Essential BUS. line 2 + [303] = "%1d", -- CB Wind wiper PLT + [301] = "%1d", -- CB Wind wiper CPLT + [305] = "%1d", -- CB KY-28 voice security(N/F) + [403] = "%1d", -- CB Starter Relay(N/F) + [307] = "%1d", -- CB Search light power(N/F) + [309] = "%1d", -- CB Landing light power(N/F) + [311] = "%1d", -- CB Landing & Search light control(N/F) + [313] = "%1d", -- CB Anticollision light(N/F) + [363] = "%1d", -- CB Fuselage lights(N/F) + [365] = "%1d", -- CB Navigation lights(N/F) + [367] = "%1d", -- CB Dome lights(N/F) + [369] = "%1d", -- CB Cockpit lights(N/F) + [371] = "%1d", -- CB Caution lights(N/F) + [373] = "%1d", -- CB Console lights(N/F) + [375] = "%1d", -- CB INST Panel lights(N/F) + [377] = "%1d", -- CB INST SEC lights(N/F) + [323] = "%1d", -- CB Cabin heater (Outlet valve)(N/F) + [325] = "%1d", -- CB Cabin heater (Air valve)(N/F) + [343] = "%1d", -- CB Rescue hoist PWR(N/F) + -- Essential BUS. line 3 + [327] = "%1d", -- CB RPM Warning system(N/F) + [329] = "%1d", -- CB Engine anti-ice(N/F) + [331] = "%1d", -- CB Fire detector(N/F) + [333] = "%1d", -- CB LH fuel boost pump(N/F) + [335] = "%1d", -- CB Turn & Slip indicator + [337] = "%1d", -- CB TEMP indicator(N/F) + [339] = "%1d", -- CB HYD Control(N/F) + [341] = "%1d", -- CB FORCE Trim(N/F) + [379] = "%1d", -- CB Cargo hook release(N/F) + [381] = "%1d", -- CB EXT Stores jettison(N/F) + [383] = "%1d", -- CB Spare inverter PWR(N/F) + [385] = "%1d", -- CB Inverter CTRL (N/F) + [387] = "%1d", -- CB Main inverter PWR(N/F) + [389] = "%1d", -- CB Generator & Bus Reset(N/F) + [391] = "%1d", -- CB STBY Generator Field(N/F) + [393] = "%1d", -- CB Governor Control(N/F) + [395] = "%1d", -- CB IDLE Stop release(N/F) + [397] = "%1d", -- CB RH fuel boost pump(N/F) + [399] = "%1d", -- CB Fuel TRANS(N/F) + [401] = "%1d", -- CB Fuel valves(N/F) + -- Non Essential BUS + [315] = "%1d", -- CB Heated blanket 1(N/F) + [317] = "%1d", -- CB Heated blanket 2(N/F) + [319] = "%1d", -- CB Voltmeter Non Ess Bus(N/F) + -- other circuit breakers + [405] = "%1d", -- CB Ignition system(N/F) + -- AC BUS circuit breakers + [423] = "%1d", -- CB Pilot ATTD1(N/F) + [424] = "%1d", -- CB Pilot ATTD2(N/F) + [425] = "%1d", -- CB Copilot ATTD1(N/F) + [426] = "%1d", -- CB Copilot ATTD2(N/F) + [427] = "%1d", -- CB Gyro Cmps(N/F) + [428] = "%1d", -- CB Fuel Quantity(N/F) + [429] = "%1d", -- CB 28V Trans(N/F) + [430] = "%1d", -- CB Fail Relay(N/F) + [431] = "%1d", -- CB Pressure Fuel(N/F) + [432] = "%1d", -- CB Pressure Torque(N/F) + [433] = "%1d", -- CB Pressure XMSN(N/F) + [434] = "%1d", -- CB Pressure Eng(N/F) + [435] = "%1d", -- CB Course Ind(N/F) + -- + [238] = "%1d", -- Pitot Heater + [216] = "%1d", -- Main generator (Left button - ON/OFF. Right button RESET) {-1, 0, 1} + [217] = "%1d", -- Main generator switch cover + -- + [111] = "%1d", -- Reset/Test switch {-1, 0, 1} + [112] = "%1d", -- Bright/Dim switch {-1, 0, 1} + -- Fuel system + [81] = "%1d", -- Main Fuel + [240] = "%1d", -- Test Fuel Gauge + --Transponder APX-72 + [58] = "%.1f", -- Code + [59] = "%.1f", -- Master + [60] = "%1d", -- Audio/light + + [61] = "%1d", -- Test M-1 {-1, 0, 1} + [62] = "%1d", -- Test M-2 {-1, 0, 1} + [63] = "%1d", -- Test M-3A {-1, 0, 1} + [64] = "%1d", -- Test M-C {-1, 0, 1} + -- + [65] = "%1d", -- RAD Test/Mon {-1, 0, 1} + [66] = "%1d", -- Ident/Mic {-1, 0, 1} + -- IFF + [67] = "%1d", -- IFF On/Out + + [68] = "%1d", -- MODE1-WHEEL1 + [69] = "%1d", -- MODE1-WHEEL2 + + [70] = "%1d", -- "MODE3A-WHEEL1 + [71] = "%1d", -- "MODE3A-WHEEL2 + [72] = "%1d", -- "MODE3A-WHEEL3 + [73] = "%1d", -- "MODE3A-WHEEL4 + + [74] = "%.4f", -- Reply test, Axis + [78] = "%1d", -- Reply test, Button + + [75] = "%.4f", -- Test test, Axis + [79] = "%1d", -- Test test, Button + + [130] = "%1d", -- Winding/Adjustment Clock, Axis ?? + [131] = "%1d", -- Winding/Adjustment Clock, Button ?? + -- ENGINE INTERFACE + [250] = "%.4f", -- Throttle {-1.0, 0.4} + [206] = "%1d", -- Throttle Stop + + [84] = "%1d", -- De-Ice On/Off + [80] = "%1d", -- Low RPM Warning + [86] = "%1d", -- Chip Detector {-1, 0, 1} + [85] = "%1d", -- Governor Emer/Auto + [90] = "%1d", -- Hydraulic Control + [89] = "%1d", -- Force Trim + [203] = "%1d", -- Governor {-1, 0, 1} + [278] = "%1d", -- Fire Test + -- ADI OPERATOR + -- Copilot's attutude indicator + [140] = "%1d", -- Cage Copilot's Attitude Indicator, Button + [146] = "%.4f", -- Attitude Indicator Pitch Trim Knob, Axis + -- ADI PILOT + [145] = "%.4f", -- Attitude Indicator Pitch Trim Knob, Axis + [144] = "%.4f", -- Attitude Indicator Roll Trim Knob, Axis + -- AAU32 + -- Copilot's altimeter + [172] = "%.4f", -- Pressure Adjustment, Axis + -- AAU7 + -- Pilot's altimeter + [181] = "%.4f", -- Pressure Adjustment, Axis + -- VHF ARC-134 + [6] = "%1d", -- Comm Test Button + [7] = "%1d", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Button + [5] = "%.4f", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Axis + [8] = "%1d", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume, Button + [9] = "%.4f", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume, Axis + -- Intercom Control Panel + [29] = "%.4f", -- Intercom volume {0.3,1.0} + [23] = "%1d", -- VHF AM Radio Receiver + [24] = "%1d", -- UHF Radio Receiver + [25] = "%1d", -- VHF FM Radio Receiver + [26] = "%1d", -- Receiver 4 N/F + [27] = "%1d", -- INT Receiver + [28] = "%1d", -- Receiver NAV + [30] = "%.1f", -- Intercom Mode (PVT - hot line; INT - interphone; 1 - VHF FM transmitter; 2 - UHF transmitter; 3 - VHF AM transmitter; 4 - Not used) + [194] = "%.1f", -- Radio/ICS + -- ARC 51BX UHF Raido + [16] = "%.1f", -- Preset Channel Selector + [18] = "%.4f", -- 10 MHz Selector, Axis + [19] = "%.4f", -- 1 MHz Selector, Axis + [20] = "%.4f", -- 50 kHz Selector, Axis + + [15] = "%.1f", -- Frequency Mode Dial + [17] = "%.1f", -- Function Dial + [22] = "%1d", -- Squelch + [21] = "%.4f", -- Volume, Axis + -- VHF ARC 131 + [31] = "%.1f", -- Frequency Tens MHz + [32] = "%.1f", -- Frequency Ones MHz + [33] = "%.1f", -- Frequency Decimals MHz + [34] = "%.1f", -- Frequency Hundredths MHz + [35] = "%.1f", -- Mode OFF/TR/RETRAN(N/F)/HOME(N/F) + [36] = "%.1f", -- quelch Mode + [37] = "%.4f", -- Volume, Axis + -- ARN-82 + [52] = "%1d", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Button + [51] = "%.4f", -- Frequency MHz / Power. Right mouse click to cycle power. Rotate mouse wheel to change frequency value, Axis + [53] = "%1d", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume, Button + [54] = "%.4f", -- Frequency kHz / Volume. Rotate mouse wheel to change frequency value. Left or Right click to adjust volume, Axis + -- Marker beakon + [57] = "%.4f", -- Marker beacon On/Off/Volume + [55] = "%1d", -- Marker beacon sensing + -- AN/ARN-83 + [42] = "%.1f", -- ADF Loop Antenna speed {0.1,0.3} + [41] = "%1d", -- BFO (N/F) + [43] = "%1d", -- Gain control / Mode. Right mouse click to cycle mode. Rotate mouse wheel to adjust gain, Button + [44] = "%.4f", -- Gain control / Mode. Right mouse click to cycle mode. Rotate mouse wheel to adjust gain, Axis + [38] = "%1d", -- Tune control / Band selection. Right mouse click to select a band. Rotate mouse wheel to adjust tune, Button + [39] = "%.4f", -- Tune control / Band selection. Right mouse click to select a band. Rotate mouse wheel to adjust tune, Axis + -- Nav lights + [222] = "%.1f", -- Navigation lights + [223] = "%1d", -- Position Lights, STEADY/OFF/FLASH + [224] = "%1d", -- Position Lights, DIM/BRIGHT + [225] = "%1d", -- Anti-Collision Lights, ON/OFF + [202] = "%1d", -- Landing Light + [201] = "%1d", -- Search Light + [205] = "%1d", -- Landing Light Ctrl + -- Light System + [230] = "%.4f", -- "Overhead Console Panel Lights Brightness Rheostat, Axis + [231] = "%.4f", -- Pedestal Lights Brightness Rheostat, Axis + [232] = "%.4f", -- Secondary Instrument Lights Brightness Rheostat, Axis + [233] = "%.4f", -- Engine Instrument Lights Brightness Rheostat, Axis + [234] = "%.4f", -- Copilot Instrument Lights Brightness Rheostat, Axis + [235] = "%.4f", -- Pilot Instrument Lights Brightness Rheostat, Axis + [226] = "%1d", -- Dome Light Ctrl + -- HEATING SYSTEM + [236] = "%.1f", -- Bleed Air + -- GCI(ID-998/ASN) + [163] = "%.4f", -- Heading Set Knob, Axis + [161] = "%.4f", -- Compass Synchronizing, Axis + [164] = "%1d", -- ADF/VOR control + [241] = "%1d", -- DG/Slave gyro mode + -- COURSE IND + [155] = "%.4f", -- Course select knob, Axis + -- weapon system + [252] = "%1d", -- Armed/Safe/Off + [253] = "%1d", -- Left/Right/All + [256] = "%1d", -- 7.62/2.75/40 + [257] = "%.1f", -- Rocket Pair + [258] = "%1d", -- Rocket Reset + [259] = "%1d", -- Jettison Cover + [260] = "%1d", -- Jettison + -- sighting station + [281] = "%.4f", -- Sighting Station Intensity + [408] = "%1d", -- Sighting Station Lamp Switch BACKUP/OFF/MAIN + + [0] = "%1d", -- Pilot Sight Armed/Safe ?? + [439] = "%1d", -- Pilot Sight On/Off + [440] = "%.4f", -- Pilot Sighting Station Intensity, Axis + [441] = "%.4f", -- Sight Elevation, Axis + -- Windshield Wipers + [227] = "%1d", -- Pilot/Both/Operator + [229] = "%.1f", -- Wipers Speed + -- Stick + [189] = "%1d", -- Force Trim ON/OFF (Pilot) + [193] = "%1d", -- Force Trim ON/OFF (CoPilot) + -- XM 130 Chaff Flare + [450] = "%1d", -- Ripple Fire Cover + [451] = "%1d", -- Ripple Fire + [456] = "%1d", -- SAFE/ARMED Switcher + [459] = "%1d", -- MAN/PGRM Mode + [464] = "%1d", -- Flare Dispense + [457] = "%1d", -- Armed lamp Test + [453] = "%1d", -- Flare counter Reset. Rotate mouse wheel to set Number, Button + [452] = "%.4f", -- Flare counter Reset. Rotate mouse wheel to set Number, Axis + [455] = "%1d", -- Chaff counter Reset. Rotate mouse wheel to set Number, Button + [454] = "%.4f", -- Chaff counter Reset. Rotate mouse wheel to set Number, Axis + -- Radar Altimeter + [449] = "%1d", -- Radar Altimeter Power + [445] = "%.4f", -- Turn On. Low Set. + [446] = "%1d", -- Test / Hight Set. Left mouse click to Test. Rotate mouse wheel to set Hight, Button + [464] = "%1d", -- Test / Hight Set. Left mouse click to Test. Rotate mouse wheel to set Hight, Axis + -- Doors + [419] = "%1d", -- Open Left Doors + [421] = "%1d" -- Open Right Doors +} + +----------------------------- +-- HIGH IMPORTANCE EXPORTS -- +-- done every export event -- +----------------------------- + +-- Pointed to by ProcessIkarusDCSHighImportance +function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice) + --[[ + export in low tick interval to Ikarus + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice) + --[[ + every frame export to DAC + Example from A-10C + Get Radio Frequencies + get data from device + local UHF_RADIO = GetDevice(54) + ExportScript.Tools.SendDataDAC("ExportID", "Format") + ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000)) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000), 2) -- export to Hardware '2' Config + ]] +end + +----------------------------------------------------- +-- LOW IMPORTANCE EXPORTS -- +-- done every gExportLowTickInterval export events -- +----------------------------------------------------- + +-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance +function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) + --[[ + export in low tick interval to GlassCockpit + Example from A-10C + Get Radio Frequencies + get data from device + local lUHFRadio = GetDevice(54) + ExportScript.Tools.SendData("ExportID", "Format") + ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) <- special function for get frequency data + ]] +end + +function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice) +--[[ + export in low tick interval to hardware + Example from A-10C + Landing Gear + mainPanelDevice, basis panel + ExportScript.Tools.SendDataDAC("2004", mainPanelDevice:get_argument_value(659)) -- GEAR_N_SAFE + ExportScript.Tools.SendDataDAC("2005", mainPanelDevice:get_argument_value(660)) -- GEAR_L_SAFE + ExportScript.Tools.SendDataDAC("2006", mainPanelDevice:get_argument_value(661)) -- GEAR_R_SAFE + ]] + + -- Radio comunication + -- UHF_ARC_51 + local lUHF_ARC_51 = GetDevice(22) + ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", lUHF_ARC_51:get_frequency()/1000000)) + + local lUHF_ARC_51_PRESET = {[0.00]="1",[0.05]="2",[0.10]="3",[0.15]="4",[0.20]="5",[0.25]="6",[0.30]="7",[0.35]="8",[0.40]="9",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"} + ExportScript.Tools.SendDataDAC("2001", lUHF_ARC_51_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(16), 2)]) + + -- VHF_ARC_131 + local lVHF_ARC_131 = GetDevice(23) + ExportScript.Tools.SendDataDAC("2002", string.format("%7.3f", lVHF_ARC_131:get_frequency()/1000000)) + + -- VHF_ARC_134 + local lVHF_ARC_134 = GetDevice(20) + ExportScript.Tools.SendDataDAC("2003", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000)) + + -- ARN_82 VHF Navigation Set NOT FUNCTIONAL + --local lARN_82 = GetDevice(26) + --ExportScript.Tools.WriteToLog('lARN_82: '..ExportScript.Tools.dump(lARN_82)) + --ExportScript.Tools.WriteToLog('lARN_82 (metatable): '..ExportScript.Tools.dump(getmetatable(lARN_82))) + --ExportScript.Tools.SendDataDAC("2004", string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000)) + + -- XM130 FLARE CHAFF + ExportScript.Tools.SendDataDAC("2005", string.format("%1d", ExportScript.Tools.round(mainPanelDevice:get_argument_value(460) * 10, 0)..ExportScript.Tools.round(mainPanelDevice:get_argument_value(461) * 10, 0))) -- FLARE_Digit_1 -- FLARE_Digit_2 + ExportScript.Tools.SendDataDAC("2006", string.format("%1d", ExportScript.Tools.round(mainPanelDevice:get_argument_value(462) * 10, 0)..ExportScript.Tools.round(mainPanelDevice:get_argument_value(463) * 10, 0))) -- CHAFF_Digit_1 -- CHAFF_Digit_2 + + -- ADF_ARN83 + local lpos1, pos2, lpos3, pos4 + local lADF_ARN83 = "" + local lCockpitParams = list_cockpit_params() + if lCockpitParams ~= nil then + lpos1, pos2 = lCockpitParams:find("ADF_FREQ:", 1) + if pos2 ~= nil then + lpos3, pos4 = lCockpitParams:find("%c", pos2) + if lpos3 ~= nil then + lADF_ARN83 = lCockpitParams:sub(pos2 + 1, lpos3 - 2) + else + lADF_ARN83 = lCockpitParams:sub(pos2 + 1) + end + lADF_ARN83 = ExportScript.Tools.round(tonumber(lADF_ARN83) / 1000, 2) + end + end + + ExportScript.Tools.SendDataDAC("2007", string.format("%s", lADF_ARN83)) + + -- Radar Altimeter - AN/APN-209 + -- [468] = "%0.1f", -- RALT_Digit_1 + -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' + -- [469] = "%0.1f", -- RALT_Digit_2 + -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' + -- [470] = "%0.1f", -- RALT_Digit_3 + -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' + -- [471] = "%0.1f", -- RALT_Digit_4 + -- {0.0, 1.0} 0.0=0, 0.1=1, 0.2=2,..., 0.9=9, 1.0=' ' + local lAN_APN_209_PRESET = {[0.0]="0",[0.1]="1",[0.2]="2",[0.3]="3",[0.4]="4",[0.5]="5",[0.6]="6",[0.7]="7",[0.8]="8",[0.9]="9",[1.0]=" "} + local lAN_APN_209 = "" + lAN_APN_209 = lAN_APN_209_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(468), 2)] + lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(469), 2)] + lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(470), 2)] + lAN_APN_209 = lAN_APN_209 .. lAN_APN_209_PRESET[ExportScript.Tools.round(mainPanelDevice:get_argument_value(471), 2)] + ExportScript.Tools.SendDataDAC("2008", string.format("%s", lAN_APN_209)) + + -- generic Radio display and frequency rotarys + ------------------------------------------------- + ExportScript.genericRadio(nil, nil, ExportScript.Config.genericRadioHardwareID) + + + ExportScript.Tools.WriteToLog('VHF_ARC_134: '..string.format("%7.3f", lVHF_ARC_134:get_frequency()/1000000)) + ExportScript.Tools.WriteToLog('VHF_ARC134_Freq1: '..mainPanelDevice:get_argument_value(1)) + ExportScript.Tools.WriteToLog('VHF_ARC134_Freq2: '..mainPanelDevice:get_argument_value(2)) + ExportScript.Tools.WriteToLog('VHF_ARC134_Freq3: '..mainPanelDevice:get_argument_value(3)) + ExportScript.Tools.WriteToLog('VHF_ARC134_Freq4: '..mainPanelDevice:get_argument_value(4)) + + --[[ + -- ENGINE_INTERFACE + local lENGINE_INTERFACE = GetDevice(3) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_rpm '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_rpm())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_fire_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_fire_lamp())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_gas_prod_tach '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_gas_prod_tach())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_fire_test_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_fire_test_lamp())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_trans_oil_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_trans_oil_temp())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_torq '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_torq())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_trans_oil_press '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_trans_oil_press())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_exhaust_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_exhaust_temp())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_low_rpm_lamp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_low_rpm_lamp())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_oil_temp '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_oil_temp())) + ExportScript.Tools.WriteToLog('lENGINE_INTERFACE:get_eng_oil_press '..ExportScript.Tools.dump(lENGINE_INTERFACE:get_eng_oil_press())) + + -- ADI_PILOT + local lADI_PILOT = GetDevice(6) + ExportScript.Tools.WriteToLog('lADI_PILOT:get_sideslip '..ExportScript.Tools.dump(lADI_PILOT:get_sideslip())) + ExportScript.Tools.WriteToLog('lADI_PILOT:get_bank '..ExportScript.Tools.dump(lADI_PILOT:get_bank())) + ExportScript.Tools.WriteToLog('lADI_PILOT:get_pitch '..ExportScript.Tools.dump(lADI_PILOT:get_pitch())) + + -- RADAR_ALTIMETER + local lRADAR_ALTIMETER = GetDevice(13) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_distance_limit '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_distance_limit())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_aperture_size '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_aperture_size())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_mode '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_mode())) + ExportScript.Tools.WriteToLog('lRADAR_ALTIMETER:get_altitude '..ExportScript.Tools.dump(lRADAR_ALTIMETER:get_altitude())) + ]] + --[[ + -- VHF_ARC_134 + local lVHF_ARC_134 = GetDevice(20) + ExportScript.Tools.WriteToLog('lVHF_ARC_134:is_on '..ExportScript.Tools.dump(lVHF_ARC_134:is_on())) + ExportScript.Tools.WriteToLog('lVHF_ARC_134:get_frequency '..ExportScript.Tools.dump(lVHF_ARC_134:get_frequency())) + --ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_frequency '..ExportScript.Tools.dump(lVHF_ARC_134:set_frequency())) -- test parameters + --ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_modulation '..ExportScript.Tools.dump(lVHF_ARC_134:set_modulation())) -- test parameters + --ExportScript.Tools.WriteToLog('lVHF_ARC_134:set_channel '..ExportScript.Tools.dump(lVHF_ARC_134:set_channel())) -- test parameters + + -- INTERCOM + local lINTERCOM = GetDevice(21) + ExportScript.Tools.WriteToLog('lINTERCOM:is_communicator_available '..ExportScript.Tools.dump(lINTERCOM:is_communicator_available())) + ExportScript.Tools.WriteToLog('lINTERCOM:get_noise_level '..ExportScript.Tools.dump(lINTERCOM:get_noise_level())) + ExportScript.Tools.WriteToLog('lINTERCOM:get_signal_level '..ExportScript.Tools.dump(lINTERCOM:get_signal_level())) + --ExportScript.Tools.WriteToLog('lINTERCOM:set_communicator '..ExportScript.Tools.dump(lINTERCOM:set_communicator())) -- test parameters + --ExportScript.Tools.WriteToLog('lINTERCOM:set_voip_mode '..ExportScript.Tools.dump(lINTERCOM:set_voip_mode())) -- test parameters + + -- UHF_ARC_51 + local lUHF_ARC_51 = GetDevice(22) + ExportScript.Tools.WriteToLog('lUHF_ARC_51:is_on '..ExportScript.Tools.dump(lUHF_ARC_51:is_on())) + ExportScript.Tools.WriteToLog('lUHF_ARC_51:get_frequency '..ExportScript.Tools.dump(lUHF_ARC_51:get_frequency())) + --ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_frequency '..ExportScript.Tools.dump(lUHF_ARC_51:set_frequency())) -- test parameters + --ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_modulation '..ExportScript.Tools.dump(lUHF_ARC_51:set_modulation())) -- test parameters + --ExportScript.Tools.WriteToLog('lUHF_ARC_51:set_channel '..ExportScript.Tools.dump(lUHF_ARC_51:set_channel())) -- test parameters + + -- VHF_ARC_131 + local lVHF_ARC_131 = GetDevice(23) + ExportScript.Tools.WriteToLog('lVHF_ARC_131:is_on '..ExportScript.Tools.dump(lVHF_ARC_131:is_on())) + ExportScript.Tools.WriteToLog('lVHF_ARC_131:get_frequency '..ExportScript.Tools.dump(lVHF_ARC_131:get_frequency())) + --ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_frequency '..ExportScript.Tools.dump(lVHF_ARC_131:set_frequency())) -- test parameters + --ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_modulation '..ExportScript.Tools.dump(lVHF_ARC_131:set_modulation())) -- test parameters + --ExportScript.Tools.WriteToLog('lVHF_ARC_131:set_channel '..ExportScript.Tools.dump(lVHF_ARC_131:set_channel())) -- test parameters + + ExportScript.Tools.WriteToLog('Frequency Mode Dial '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(15))) + ExportScript.Tools.WriteToLog('Function Dial '..ExportScript.Tools.dump(mainPanelDevice:get_argument_value(17))) + ]] + --[[ + Device test, Device 2 to 32 + is value "userdata", is only DLL intern functions + local ltmp1 = 0 + for ltmp2 = 1, 49, 1 do + ltmp1 = GetDevice(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] + --[[ + ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params())) + + local ltmp1 = 0 + for ltmp2 = 1, 8, 1 do + ltmp1 = list_indication(ltmp2) + ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1)) + --ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1))) + end + ]] +end + +----------------------------- +-- Custom functions -- +----------------------------- + +function ExportScript.genericRadio(key, value, hardware) + local lHardware = hardware or 1 + -- Werte werden per Encoder im Bereich von 0.0 bis 2.0 in 0.1 Schritten uebergeben + -- im jeweiligen Abschnitt muessen die Eingangsdaten auf den Zulaessigen Bereich eingeschraengt werden + local lRotaryFrequency_1, lRotaryFrequency_2, lVolume, lPreset, lLoad, lSquelch, lManualPreset, lPower, lDevice, lClickAction, lSetFrequency = nil + local lMainPanelDevice = GetDevice(0) + local lMaxRadios = 3 + + if gES_genericRadio == nil then + gES_genericRadio = 0 + end + if gES_genericRadioFrequency1 == nil then + gES_genericRadioFrequency1 = 0.0 + end + if gES_genericRadioFrequency2 == nil then + gES_genericRadioFrequency2 = 0.0 + end + if gES_genericRadioPresetChannel == nil then + gES_genericRadioPresetChannel = 0.0 + end + if gES_genericRadioPower == nil then + gES_genericRadioPower = {} + end + if gES_genericRadioPresetManual == nil then + gES_genericRadioPresetManual = {} + end + if gES_genericRadioSquelch == nil then + gES_genericRadioSquelch = {} + end + + if key == "3001" then + gES_genericRadio = tonumber(value) + end + if key == "3002" then + lRotaryFrequency_1 = tonumber(value) + end + if key == "3003" then + lRotaryFrequency_2 = tonumber(value) + end + if key == "3004" then + lVolume = tonumber(value) + end + if key == "3005" then + lPreset = tonumber(value) + end + if key == "3006" then + lLoad = tonumber(value) + end + if key == "3007" then + lSquelch = tonumber(value) + end + if key == "3008" then + lManualPreset = tonumber(value) + end + if key == "3009" then + lPower = tonumber(value) + end + + if gES_genericRadio > lMaxRadios then + ExportScript.Tools.WriteToLog("Radio Nr. "..gES_genericRadio.." not defined.") + return + end + + if gES_genericRadio == 1 then + -- AN/ARC-131 VHF FM Radio + local lDeviceID = 23 + local lVHF_FM_RADIO = GetDevice(lDeviceID) + + -- check status of the radio + if gES_genericRadioPower[gES_genericRadio] == nil then + if lVHF_FM_RADIO:is_on() then + gES_genericRadioPower[gES_genericRadio] = 1.0 + else + gES_genericRadioPower[gES_genericRadio] = 0.0 + end + end + if gES_genericRadioPresetManual[gES_genericRadio] == nil then + gES_genericRadioPresetManual[gES_genericRadio] = 0 -- no preset channels + end + if gES_genericRadioSquelch[gES_genericRadio] == nil then + gES_genericRadioSquelch[gES_genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(36), 1) == 0.1) and 0 or 1) + end + + local lVHF_FM_RADIO_FREQUENCY = ExportScript.Tools.round(lVHF_FM_RADIO:get_frequency()/1000000 , 3, "floor") + + ExportScript.Tools.SendDataDAC("3000", string.format("%.3f", lVHF_FM_RADIO_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3001", string.format("-"), lHardware) + ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lVHF_FM_RADIO_FREQUENCY), lHardware) + + if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lVHF_FM_RADIO_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 25) + lFrequency[2] = ltmp * 25 + end + if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then + lFrequency[1] = lFrequency[1] - 1 + if lFrequency[1] == 99 then + lFrequency[1] = 399 + end + gES_genericRadioFrequency1 = lRotaryFrequency_1 + else + lFrequency[1] = lFrequency[1] + 1 + if lFrequency[1] == 400 then + lFrequency[1] = 100 + end + gES_genericRadioFrequency1 = lRotaryFrequency_1 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("1. genericUH-1H AN/ARC-131 VHF FM Radio, don't split frequency: "..lFrequency) + end + end + + if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lVHF_FM_RADIO_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 25) + lFrequency[2] = ltmp * 25 + end + if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then + lFrequency[2] = lFrequency[2] - 25 + if lFrequency[2] == -25 then + lFrequency[2] = 975 + end + gES_genericRadioFrequency2 = lRotaryFrequency_2 + else + lFrequency[2] = lFrequency[2] + 25 + if lFrequency[2] == 1000 then + lFrequency[2] = 0 + end + gES_genericRadioFrequency2 = lRotaryFrequency_2 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("2. generic UH-1H AN/ARC-131 VHF FM Radio, don't split frequency: "..lFrequency) + end + end + + if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then + lVolume = lVolume / 2 + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3006, + Value = lVolume} + end +--[[ + if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then + -- Preset 0.0 to 0.20 in 0.01 steps + if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3001, + Value = 0.01} + gES_genericRadioPresetChannel = lPreset + else + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3002, + Value = -0.01} + gES_genericRadioPresetChannel = lPreset + end + end + if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3006, + Value = lLoad} + end + if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then + if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then + -- Manual on + lManualPreset = 0.1 + gES_genericRadioPresetManual[gES_genericRadio] = 0 + elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then + -- Preset on + lManualPreset = 0.0 + gES_genericRadioPresetManual[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3005, + Value = lManualPreset} + end +]] + if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then + if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then + -- Squelch off + lSquelch = 0.0 + gES_genericRadioSquelch[gES_genericRadio] = 0 + elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then + -- Squelch on + lSquelch = 0.1 + gES_genericRadioSquelch[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3005, + Value = lSquelch} + end + if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then + if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then + -- Power off + lPower = 0.0 + gES_genericRadioPower[gES_genericRadio] = 0 + elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then + -- Power on + lPower = 0.1 + gES_genericRadioPower[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3007, + Value = lPower} + end + + elseif gES_genericRadio == 2 then + -- AN/ARC-51BX UHF AM Radio + local lDeviceID = 22 + local lUHF_AM_RADIO = GetDevice(lDeviceID) + + -- check status of the radio + if gES_genericRadioPower[gES_genericRadio] == nil then + if lUHF_AM_RADIO:is_on() then + gES_genericRadioPower[gES_genericRadio] = 1.0 + else + gES_genericRadioPower[gES_genericRadio] = 0.0 + end + end + if gES_genericRadioPresetManual[gES_genericRadio] == nil then + gES_genericRadioPresetManual[gES_genericRadio] = ((ExportScript.Tools.round(lMainPanelDevice:get_argument_value(15), 1) == 0.1) and 0 or 1) + end + if gES_genericRadioSquelch[gES_genericRadio] == nil then + gES_genericRadioSquelch[gES_genericRadio] = ExportScript.Tools.round(lMainPanelDevice:get_argument_value(22), 1) + end + + local lPresetChannel = ExportScript.Tools.round(lMainPanelDevice:get_argument_value(16), 2) + + local lUHF_AM_RADIO_PRESET = {[0.0]="01",[0.05]="02",[0.10]="03",[0.15]="04",[0.20]="05",[0.25]="06",[0.30]="07",[0.35]="08",[0.40]="09",[0.45]="10",[0.50]="11",[0.55]="12",[0.60]="13",[0.65]="14",[0.70]="15",[0.75]="16",[0.80]="17",[0.85]="18",[0.90]="19",[0.95]="20"} + local lUHF_AM_RADIO_FREQUENCY = ExportScript.Tools.round(lUHF_AM_RADIO:get_frequency()/1000000 , 3, "floor") + + ExportScript.Tools.SendDataDAC("3000", string.format("%s%.3f", lUHF_AM_RADIO_PRESET[lPresetChannel], lUHF_AM_RADIO_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3001", string.format("%s", lUHF_AM_RADIO_PRESET[lPresetChannel]), lHardware) + ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lUHF_AM_RADIO_FREQUENCY), lHardware) + + if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lUHF_AM_RADIO_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 50) + lFrequency[2] = ltmp * 50 + end + if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then + lFrequency[1] = lFrequency[1] - 1 + if lFrequency[1] == 224 then + lFrequency[1] = 399 + end + gES_genericRadioFrequency1 = lRotaryFrequency_1 + else + lFrequency[1] = lFrequency[1] + 1 + if lFrequency[1] == 400 then + lFrequency[1] = 225 + end + gES_genericRadioFrequency1 = lRotaryFrequency_1 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("1. generic UH-1H AN/ARC-51BX UHF AM Radio, don't split frequency: "..lFrequency) + end + end + + if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lUHF_AM_RADIO_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 50) + lFrequency[2] = ltmp * 50 + end + if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then + lFrequency[2] = lFrequency[2] - 50 + if lFrequency[2] == -50 then + lFrequency[2] = 950 + end + gES_genericRadioFrequency2 = lRotaryFrequency_2 + else + lFrequency[2] = lFrequency[2] + 50 + if lFrequency[2] == 1000 then + lFrequency[2] = 0 + end + gES_genericRadioFrequency2 = lRotaryFrequency_2 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("2. generic UH-1H AN/ARC-51BX UHF AM Radio, don't split frequency: "..lFrequency) + end + end + if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then + lVolume = lVolume / 2 + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3008, + Value = lVolume} + end + if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then + -- Preset 0.0 to 0.95 in 0.05 steps + if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then + lPresetChannel = lPresetChannel + 0.05 + gES_genericRadioPresetChannel = lPreset + if lPresetChannel == 1.00 then + lPresetChannel = 0.0 + end + else + lPresetChannel = lPresetChannel - 0.05 + gES_genericRadioPresetChannel = lPreset + if lPresetChannel == -0.05 then + lPresetChannel = 0.95 + end + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3001, + Value = lPresetChannel} + end + if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then + if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then + -- Power off + lSquelch = 0.0 + gES_genericRadioSquelch[gES_genericRadio] = 0 + elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then + -- Power on + lSquelch = 1.0 + gES_genericRadioSquelch[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3007, + Value = lSquelch} + end + if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then + if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then + -- Manual on + lManualPreset = 0.1 + gES_genericRadioPresetManual[gES_genericRadio] = 0 + elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then + -- Preset on + lManualPreset = 0.0 + gES_genericRadioPresetManual[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3005, + Value = lManualPreset} + end + if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then + if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then + -- Power off + lPower = 0.0 + gES_genericRadioPower[gES_genericRadio] = 0 + elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then + -- Power on + lPower = 0.1 + gES_genericRadioPower[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3006, + Value = lPower} + end + + elseif gES_genericRadio == 3 then + -- AN/ARC-134 VHF AM Radio + local lDeviceID = 20 + local lVHF_AM_RADIO = GetDevice(lDeviceID) + + -- check status of the radio + if gES_genericRadioPower[gES_genericRadio] == nil then + if lVHF_AM_RADIO:is_on() then + gES_genericRadioPower[gES_genericRadio] = 1.0 + else + gES_genericRadioPower[gES_genericRadio] = 0.85 + end + end + if gES_genericRadioPresetManual[gES_genericRadio] == nil then + gES_genericRadioPresetManual[gES_genericRadio] = 0.0 -- no preset channels + end + if gES_genericRadioSquelch[gES_genericRadio] == nil then + gES_genericRadioSquelch[gES_genericRadio] = 0.0 -- no Squelch + end + + local lVHF_AM_RADIO_FREQUENCY = ExportScript.Tools.round(lVHF_AM_RADIO:get_frequency()/1000000 , 3, "floor") + + ExportScript.Tools.SendDataDAC("3000", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware) + ExportScript.Tools.SendDataDAC("3001", string.format("-"), lHardware) + ExportScript.Tools.SendDataDAC("3002", string.format("%.3f", lVHF_AM_RADIO_FREQUENCY), lHardware) + + if lRotaryFrequency_1 ~= nil and (lRotaryFrequency_1 >= 0.0 and lRotaryFrequency_1 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 25) + lFrequency[2] = ltmp * 25 + end + if lRotaryFrequency_1 < gES_genericRadioFrequency1 or lRotaryFrequency_1 == 0.0 or lRotaryFrequency_1 == 2.0 then + lFrequency[1] = lFrequency[1] - 1 + if lFrequency[1] == 99 then + lFrequency[1] = 399 + end + gES_genericRadioFrequency1 = lRotaryFrequency_1 + else + lFrequency[1] = lFrequency[1] + 1 + if lFrequency[1] == 400 then + lFrequency[1] = 100 + end + gES_genericRadioFrequency1 = lRotaryFrequency_1 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("1. genericUH-1H AN/ARC-134 VHF AM Radio, don't split frequency: "..lFrequency) + end + end + + if lRotaryFrequency_2 ~= nil and (lRotaryFrequency_2 >= 0.0 and lRotaryFrequency_2 <= 2.0) then + + local lFrequency = ExportScript.Tools.StrSplit(lVHF_AM_RADIO_FREQUENCY, "%.") + + if type(lFrequency) == "table" and lFrequency[1] ~= nil then + lFrequency[1] = tonumber(lFrequency[1]) + if lFrequency[2] == nil then + lFrequency[2] = 0 + else + lFrequency[2] = tonumber(lFrequency[2]) + local ltmp = string.format("%.0f", lFrequency[2] / 25) + lFrequency[2] = ltmp * 25 + end + if lRotaryFrequency_2 < gES_genericRadioFrequency2 or lRotaryFrequency_2 == 0.0 or lRotaryFrequency_2 == 2.0 then + lFrequency[2] = lFrequency[2] - 25 + if lFrequency[2] == -25 then + lFrequency[2] = 975 + end + gES_genericRadioFrequency2 = lRotaryFrequency_2 + else + lFrequency[2] = lFrequency[2] + 25 + if lFrequency[2] == 1000 then + lFrequency[2] = 0 + end + gES_genericRadioFrequency2 = lRotaryFrequency_2 + end + + lFrequency[2] = string.format("%.3f", lFrequency[2] / 1000) + local ltempFrequency = string.format("%.3f", lFrequency[1] + lFrequency[2]) + ltempFrequency = tonumber(ltempFrequency) + lSetFrequency = {DeviceID = lDeviceID, + Frequency = ltempFrequency * 1000000} + + else + ExportScript.Tools.WriteToLog("2. generic UH-1H AN/ARC-134 VHF AM Radio, don't split frequency: "..lFrequency) + end + end + + if lVolume ~= nil and (lVolume >= 0.0 and lVolume <= 2.0) then + lVolume = lVolume / 3 + if lVolume > 0.65 then + lVolume = 0.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3003, + Value = lVolume} + end +--[[ + if lPreset ~= nil and (lPreset >= 0.0 and lPreset <= 2.0) then + -- Preset 0.0 to 0.20 in 0.01 steps + if lPreset < gES_genericRadioPresetChannel or lPreset == 0.0 or lPreset == 2.0 then + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3001, + Value = 0.01} + gES_genericRadioPresetChannel = lPreset + else + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3002, + Value = -0.01} + gES_genericRadioPresetChannel = lPreset + end + end + if lLoad ~= nil and (lLoad == 0.0 or lLoad <= 1.0) then + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3006, + Value = lLoad} + end + if lSquelch ~= nil and (lSquelch == 0.0 or lSquelch <= 1.0) then + if lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 1.0 then + -- Power off + lSquelch = 0.0 + gES_genericRadioSquelch[gES_genericRadio] = 0 + elseif lSquelch == 1.0 and gES_genericRadioSquelch[gES_genericRadio] == 0 then + -- Power on + lSquelch = 1.0 + gES_genericRadioSquelch[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3007, + Value = lSquelch} + end + if lManualPreset ~= nil and (lManualPreset == 0.0 or lManualPreset <= 1.0) then + if lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 1.0 then + -- Manual on + lManualPreset = 0.1 + gES_genericRadioPresetManual[gES_genericRadio] = 0 + elseif lManualPreset == 1.0 and gES_genericRadioPresetManual[gES_genericRadio] == 0 then + -- Preset on + lManualPreset = 0.0 + gES_genericRadioPresetManual[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3005, + Value = lManualPreset} + end +]] + if lPower ~= nil and (lPower == 0.0 or lPower <= 1.0) then + if lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 1.0 then + -- Power off + lPower = 0.85 + gES_genericRadioPower[gES_genericRadio] = 0 + elseif lPower == 1.0 and gES_genericRadioPower[gES_genericRadio] == 0 then + -- Power on + lPower = 1.0 + gES_genericRadioPower[gES_genericRadio] = 1.0 + end + lClickAction = {DeviceID = lDeviceID, + ButtonID = 3001, + Value = lPower} + end + + else + ExportScript.Tools.SendDataDAC("3000", "-", lHardware) + ExportScript.Tools.SendDataDAC("3001", "-", lHardware) + ExportScript.Tools.SendDataDAC("3002", "-", lHardware) + ExportScript.Tools.SendDataDAC("3010", 0, lHardware) + ExportScript.Tools.SendDataDAC("3011", 0, lHardware) + ExportScript.Tools.SendDataDAC("3012", 0, lHardware) + return + end + + ExportScript.Tools.SendDataDAC("3010", gES_genericRadioPower[gES_genericRadio], lHardware) + ExportScript.Tools.SendDataDAC("3011", gES_genericRadioPresetManual[gES_genericRadio], lHardware) + ExportScript.Tools.SendDataDAC("3012", gES_genericRadioSquelch[gES_genericRadio], lHardware) + + if lClickAction ~= nil then + lDevice = GetDevice(lClickAction.DeviceID) + if type(lDevice) == "table" then + --ExportScript.Tools.WriteToLog("GetDevice("..lClickAction.DeviceID.."):performClickableAction("..lClickAction.ButtonID..", "..lClickAction.Value..") ") + lDevice:performClickableAction(lClickAction.ButtonID, lClickAction.Value) + end + elseif lSetFrequency ~= nil then + lDevice = GetDevice(lSetFrequency.DeviceID) + if type(lDevice) == "table" and lDevice:is_on() then + --ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID.."):set_frequency("..lSetFrequency.Frequency..") ") + lDevice:set_frequency(lSetFrequency.Frequency) + else + ExportScript.Tools.WriteToLog("GetDevice("..lSetFrequency.DeviceID..") is no table or Radio is not on") + end + end +end diff --git a/Scripts/DCS-ExportScript/lib/Tools.lua b/Scripts/DCS-ExportScript/lib/Tools.lua new file mode 100644 index 0000000..418b051 --- /dev/null +++ b/Scripts/DCS-ExportScript/lib/Tools.lua @@ -0,0 +1,429 @@ +-- Ikarus and D.A.C. Export Script +-- Version 1.0.0 BETA +-- +-- Tools +-- +-- Copyright by Michael aka McMicha 2014 +-- Contact dcs2arcaze.micha@farbpigmente.org + +ExportScript.Tools = {} + +function ExportScript.Tools.WriteToLog(message) + if ExportScript.logFile then + local ltmp, lMiliseconds = math.modf(os.clock()) + if lMiliseconds==0 then + lMiliseconds='000' + else + lMiliseconds=tostring(lMiliseconds):sub(3,5) + end + ExportScript.logFile:write(os.date("%X")..":"..lMiliseconds.." : "..message.."\r\n") + end +end + +function ExportScript.Tools.ProcessInput() + local lCommand, lCommandArgs, lDevice + -- C1,3001,4 + -- lComand = C + -- lCommandArgs[1] = 1 => lDevice + -- lCommandArgs[2] = 3001 + -- lCommandArgs[3] = 4 + + if ExportScript.Config.IkarusExport then + local lInput,from,port = ExportScript.UDPsender:receivefrom() + + if lInput then + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("lInput: "..lInput..", from: "..from..", port: "..port) + end + lCommand = string.sub(lInput,1,1) + + if lCommand == "R" then + ExportScript.Tools.ResetChangeValues() + end + + if (lCommand == "C") then + lCommandArgs = ExportScript.Tools.StrSplit(string.sub(lInput,2),",") + lDevice = GetDevice(lCommandArgs[1]) + if type(lDevice) == "table" then + lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3]) + end + end + end + end + + if ExportScript.Config.DACExport then + local lInput2,from2,port2 = ExportScript.UDPListener:receivefrom() -- Hardware + + if lInput2 then + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("lInput2: "..lInput2..", from2: "..from2..", port2: "..port2) + end + lCommand = string.sub(lInput2,1,1) + + if lCommand == "C" then + ExportScript.Tools.ResetChangeValuesDAC() + end + + if (lCommand == "C") then + lCommandArgs = ExportScript.Tools.StrSplit(string.sub(lInput2,2),",") + lDevice = GetDevice(lCommandArgs[1]) + if lDevice ~= "1000" then + if type(lDevice) == "table" then + lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3]) + end + elseif lDevice == "1000" then + --ExportScript.genericRadio(key, value, hardware) + ExportScript.genericRadio(lCommandArgs[2],lCommandArgs[3], ExportScript.Config.genericRadioHardwareID) + end + end + end + end +end + +function ExportScript.Tools.StrSplit(str, delim, maxNb) + -- Eliminate bad cases... + if string.find(str, delim) == nil then + return { str } + end + if maxNb == nil or maxNb < 1 then + maxNb = 0 -- No limit + end + local lResult = {} + local lPat = "(.-)" .. delim .. "()" + local lNb = 0 + local lLastPos + for part, pos in string.gfind(str, lPat) do + lNb = lNb + 1 + lResult[lNb] = part + lLastPos = pos + if lNb == maxNb then break end + end + -- Handle the last field + if lNb ~= maxNb then + lResult[lNb + 1] = string.sub(str, lLastPos) + end + return lResult +end + +function ExportScript.Tools.round(num, idp) + local lMult = 10^(idp or 0) + return math.floor(num * lMult + 0.5) / lMult +end + +-- Status Gathering Functions +function ExportScript.Tools.ProcessArguments(device, arguments) + local lArgument , lFormat , lArgumentValue + local lCounter = 0 + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("======Begin========") + end + + for lArgument, lFormat in pairs(arguments) do + lArgumentValue = string.format(lFormat,device:get_argument_value(lArgument)) + if ExportScript.Config.Debug then + lCounter = lCounter + 1 + ExportScript.Tools.WriteToLog(lCounter..". ID: "..lArgument..", Fromat: "..lFormat..", Value: "..lArgumentValue) + end + if ExportScript.Config.IkarusExport then + ExportScript.Tools.SendData(lArgument, lArgumentValue) + end + if ExportScript.Config.DACExport then + ExportScript.Tools.SendDataDAC(lArgument, lArgumentValue) + end + end + + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("======End========") + end +end + +-- Network Functions for GlassCockpit +function ExportScript.Tools.SendData(id, value) + if string.len(value) > 3 and value == string.sub("-0.00000000",1, string.len(value)) then + value = value:sub(2) + end + + if ExportScript.LastData[id] == nil or ExportScript.LastData[id] ~= value then + local ldata = id .. "=" .. value + local ldataLen = string.len(ldata) + + if ldataLen + ExportScript.PacketSize > 576 then + ExportScript.Tools.FlushData() + end + + table.insert(ExportScript.SendStrings, ldata) + ExportScript.LastData[id] = value + ExportScript.PacketSize = ExportScript.PacketSize + ldataLen + 1 + end +end + +-- Network Functions for DAC +function ExportScript.Tools.SendDataDAC(id, value) + for hardware=1, #ExportScript.Config.DAC, 1 do + if ExportScript.Config.DAC[hardware] == nil then + ExportScript.Tools.WriteToLog("unknown hardware ID '"..hardware.."' for value: '"..id.."="..value.."'") + return + end + + if string.len(value) > 3 and value == string.sub("-0.00000000",1, string.len(value)) then + value = value:sub(2) + end + + if ExportScript.LastDataDAC[hardware][id] == nil or ExportScript.LastDataDAC[hardware][id] ~= value then + local ldata = id .. "=" .. value + local ldataLen = string.len(ldata) + + if ldataLen + ExportScript.PacketSizeDAC[hardware] > 576 then + ExportScript.Tools.FlushDataDAC(hardware) + end + + table.insert(ExportScript.SendStringsDAC[hardware], ldata) + ExportScript.LastDataDAC[hardware][id] = value + ExportScript.PacketSizeDAC[hardware] = ExportScript.PacketSizeDAC[hardware] + ldataLen + 1 + --ExportScript.Tools.WriteToLog("id=ldata: "..ldata) + --ExportScript.Tools.WriteToLog("ExportScript.LastDataDAC["..hardware.."]: "..ExportScript.Tools.dump(ExportScript.LastDataDAC[hardware])) + end + end +end + +function ExportScript.Tools.FlushData() + if #ExportScript.SendStrings > 0 then + local lES_SimID = "" + if ExportScript.GlassCockpitType == 1 then + lES_SimID = ExportScript.SimID + elseif ExportScript.GlassCockpitType == 2 then + lES_SimID = "" + end + local lPacket = lES_SimID .. table.concat(ExportScript.SendStrings, ExportScript.Config.IkarusSeparator) .. "\n" + ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.IkarusHost, ExportScript.Config.IkarusPort)) + ExportScript.SendStrings = {} + ExportScript.PacketSize = 0 + end +end + +function ExportScript.Tools.FlushDataDAC(hardware) + hardware = hardware or 1 + + if ExportScript.Config.DAC[hardware] == nil then + ExportScript.Tools.WriteToLog("unknown hardware ID '"..hardware.."'") + return + end + + if #ExportScript.SendStringsDAC[hardware] > 0 then + local lPacket = ExportScript.SimID .. table.concat(ExportScript.SendStringsDAC[hardware], ExportScript.Config.DAC[hardware].Separator) .. "\n" + ExportScript.socket.try(ExportScript.UDPsender:sendto(lPacket, ExportScript.Config.DAC[hardware].Host, ExportScript.Config.DAC[hardware].SendPort)) + ExportScript.SendStringsDAC[hardware] = {} + ExportScript.PacketSizeDAC[hardware] = 0 + end +end + +function ExportScript.Tools.ResetChangeValues() + ExportScript.LastData = {} + ExportScript.TickCount = 10 +end + +function ExportScript.Tools.ResetChangeValuesDAC() + for i = 1, #ExportScript.Config.DAC, 1 do + ExportScript.LastDataDAC[i] = {} + end + ExportScript.TickCount = 10 + ExportScript.TickCountDAC = 0 +end + +function ExportScript.Tools.SelectModule() + -- Select Module... + ExportScript.FoundDCSModule = false + ExportScript.FoundFCModule = false + ExportScript.FoundNoModul = true + + local lMyInfo = LoGetSelfData() + if lMyInfo == nil then -- End SelectModule, if don't selected a aircraft + return + end + + ExportScript.ModuleName = lMyInfo.Name + local lModuleName = ExportScript.ModuleName..".lua" + local lModuleFile = "" + + ExportScript.FoundNoModul = false + + for file in lfs.dir(ExportScript.Config.ExportModulePath) do + if lfs.attributes(ExportScript.Config.ExportModulePath..file,"mode") == "file" then + if file == lModuleName then + lModuleFile = ExportScript.Config.ExportModulePath..file + end + end + end + + ExportScript.Tools.WriteToLog("File Path: "..lModuleFile) + + if string.len(lModuleFile) > 1 then + ExportScript.Tools.ResetChangeValuesDAC() + + -- load Aircraft File + dofile(lModuleFile) + ExportScript.Tools.SendDataDAC("File", lMyInfo.Name) + for i=1, #ExportScript.Config.DAC, 1 do + ExportScript.Tools.FlushDataDAC(i) + end + ExportScript.Tools.SendData("File", lMyInfo.Name) + ExportScript.Tools.FlushData() + + ExportScript.Tools.WriteToLog("File '"..lModuleFile.."' loaded") + + ExportScript.FirstNewDataSend = true + ExportScript.FirstNewDataSendCount = 5 + + if ExportScript.FoundDCSModule then + local lCounter = 0 + for k, v in pairs(ExportScript.ConfigEveryFrameArguments) do + lCounter = lCounter + 1 + end + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("ExportScript.ConfigEveryFrameArguments Count: "..lCounter) + end + if lCounter > 0 then + ExportScript.EveryFrameArguments = ExportScript.ConfigEveryFrameArguments + else + -- no Arguments + ExportScript.EveryFrameArguments = {} + end + lCounter = 0 + for k, v in pairs(ExportScript.ConfigArguments) do + lCounter = lCounter + 1 + end + if ExportScript.Config.Debug then + ExportScript.Tools.WriteToLog("ExportScript.ConfigArguments Count: "..lCounter) + end + if lCounter > 0 then + ExportScript.Arguments = ExportScript.ConfigArguments + else + -- no Arguments + ExportScript.Arguments = {} + end + + ExportScript.ProcessIkarusDCSHighImportance = ExportScript.ProcessIkarusDCSConfigHighImportance + ExportScript.ProcessIkarusDCSLowImportance = ExportScript.ProcessIkarusDCSConfigLowImportance + ExportScript.ProcessDACHighImportance = ExportScript.ProcessDACConfigHighImportance + ExportScript.ProcessDACLowImportance = ExportScript.ProcessDACConfigLowImportance + + elseif ExportScript.FoundFCModule then + ExportScript.ProcessIkarusFCHighImportance = ExportScript.ProcessIkarusFCHighImportanceConfig + ExportScript.ProcessIkarusFCLowImportance = ExportScript.ProcessIkarusFCLowImportanceConfig + ExportScript.ProcessDACHighImportance = ExportScript.ProcessDACConfigHighImportance + ExportScript.ProcessDACLowImportance = ExportScript.ProcessDACConfigLowImportance + else + ExportScript.Tools.WriteToLog("Unknown Module Type: "..lMyInfo.Name) + end + + else -- Unknown Module + ExportScript.ProcessIkarusDCSHighImportance = ExportScript.ProcessIkarusDCSHighImportanceNoConfig + ExportScript.ProcessIkarusDCSLowImportance = ExportScript.ProcessIkarusDCSLowImportanceNoConfig + ExportScript.ProcessIkarusFCHighImportance = ExportScript.ProcessIkarusFCHighImportanceNoConfig + ExportScript.ProcessIkarusFCLowImportance = ExportScript.ProcessIkarusFCLowImportanceNoConfig + ExportScript.ProcessDACHighImportance = ExportScript.ProcessDACHighImportanceNoConfig + ExportScript.ProcessDACLowImportance = ExportScript.ProcessDACLowImportanceNoConfig + ExportScript.EveryFrameArguments = {} + ExportScript.Arguments = {} + ExportScript.Tools.WriteToLog("Unknown Module Name: "..lMyInfo.Name) + end +end + +-- The ExportScript.Tools.dump function show the content of the specified variable. +-- ExportScript.Tools.dump is similar to PHP function dump and show variables from type +-- "nil, "number", "string", "boolean, "table", "function", "thread" and "userdata" +function ExportScript.Tools.dump(var, depth) + depth = depth or 0 + if type(var) == "string" then + return 'string: "' .. var .. '"\n' + elseif type(var) == "nil" then + return 'nil\n' + elseif type(var) == "number" then + return 'number: "' .. var .. '"\n' + elseif type(var) == "boolean" then + return 'boolean: "' .. tostring(var) .. '"\n' + elseif type(var) == "function" then + if debug and debug.getinfo then + fcnname = tostring(var) + local info = debug.getinfo(var, "S") + if info.what == "C" then + return string.format('%q', fcnname .. ', C function') .. '\n' + else + if (string.sub(info.source, 1, 2) == [[./]]) then + return string.format('%q', fcnname .. ', defined in (' .. info.linedefined .. '-' .. info.lastlinedefined .. ')' .. info.source) ..'\n' + else + return string.format('%q', fcnname .. ', defined in (' .. info.linedefined .. '-' .. info.lastlinedefined .. ')') ..'\n' + end + end + else + return 'a function\n' + end + elseif type(var) == "thread" then + return 'thread\n' + elseif type(var) == "userdata" then + return tostring(var)..'\n' + elseif type(var) == "table" then + depth = depth + 1 + out = "{\n" + for k,v in pairs(var) do + out = out .. (" "):rep(depth*4).. "["..k.."] = " .. ExportScript.Tools.dump(v, depth) + end + return out .. (" "):rep((depth-1)*4) .. "}\n" + else + return tostring(var) .. "\n" + end +end + +-- round function for math libraray +-- number : value +-- decimals: number of decimal +-- method : ceil: Returns the smallest integer larger than or equal to number +-- floor: Returns the smallest integer smaller than or equal to number +function ExportScript.Tools.round(number, decimals, method) + if string.find(number, "%p" ) ~= nil then + decimals = decimals or 0 + local lFactor = 10 ^ decimals + if (method == "ceil" or method == "floor") then + -- ceil: Returns the smallest integer larger than or equal to number + -- floor: Returns the smallest integer smaller than or equal to number + return math[method](number * lFactor) / lFactor + else + return tonumber(("%."..decimals.."f"):format(number)) + end + else + return number + end +end + +-- split function for string libraray +-- stringvalue: value +-- delimiter : delimiter for split +-- for example, see http://www.lua.org/manual/5.1/manual.html#5.4.1 +function ExportScript.Tools.split(stringvalue, delimiter) + result = {}; + for match in (stringvalue..delimiter):gmatch("(.-)"..delimiter) do + table.insert(result, match); + end + return result; +end + + +-- Pointed to by ExportScript.ProcessIkarusDCSHighImportance, if the player aircraft is something else +function ExportScript.ProcessIkarusDCSHighImportanceNoConfig(mainPanelDevice) +end +-- Pointed to by ExportScript.ProcessIkarusDCSLowImportance, if the player aircraft is something else +function ExportScript.ProcessIkarusDCSLowImportanceNoConfig(mainPanelDevice) +end + +-- the player aircraft is a Flaming Cliffs or similar aircraft +function ExportScript.ProcessIkarusFCHighImportanceNoConfig() +end +function ExportScript.ProcessIkarusFCLowImportanceNoConfig() +end + +-- Hardware exports +function ExportScript.ProcessDACHighImportanceNoConfig(mainPanelDevice) +end +function ExportScript.ProcessDACLowImportanceNoConfig(mainPanelDevice) +end diff --git a/Scripts/Export.lua b/Scripts/Export.lua index e022405..dd803a6 100644 --- a/Scripts/Export.lua +++ b/Scripts/Export.lua @@ -1,722 +1,3 @@ --- HELIOS and Arcaze Export Script --- Version 0.9.9 BETA --- --- Copyright by Michael aka McMicha 2014 --- Contact dcs2arcaze.micha@farbpigmente.org --- List of all DCS Module Scripts - ----------- --- DATA -- ----------- - --- Glass Cockpit Software --- for example --- HELIOS (http://www.gadrocsworkshop.com/helios/), Type 1 --- HawgTouch (http://forums.eagle.ru/showthread.php?t=71729), Type 2 -gES_GlassCockpitExport = true -- false for not use -gES_GlassCockpitHost = "127.0.0.1" -- IP for HELIOS or HawgToch -gES_GlassCockpitPort = 1625 -- Port for HELIOS (9089) or HawgTouch (1625) -gES_GlassCockpitSeparator = ":" -gES_GlassCockpitType = 2 -- 1 = HELIOS, 2 = HawgTouch - --- for example D.A.C. or SIOC -gES_HARDWAREExport = true -- false for not use -gES_HARDWARE = {} --- first hardware -gES_HARDWARE[1] = {} -gES_HARDWARE[1].Host = "127.0.0.1" -- IP for hardware 1 -gES_HARDWARE[1].SendPort = 26026 -- Port for hardware 1 -gES_HARDWARE[1].Separator = ":" --- secound to n hardware ---gES_HARDWARE[2] = {} ---gES_HARDWARE[2].Host = "127.0.0.1" -- IP for hardware 2 ---gES_HARDWARE[2].SendPort = 9092 -- Port for hardware 2 ---gES_HARDWARE[2].Separator = ";" - --- D.A.C. can data send -gES_HARDWAREListner = true -- false for not use -gES_HARDWAREListnerPort = 26027 -- Listener Port for D.A.C. - -gES_ExportInterval = 0.05 -gES_ExportLowTickInterval = 1 -gES_ExportModulePath = lfs.writedir().."ExportsModules\\" -gES_LogPath = lfs.writedir().."Logs\\Export.log" -gES_Debug = false -gES_FirstNewDataSend = true -gES_FirstNewDataSendCount = 5 -gES_genericRadioHardwareID = 1 - ------------- --- SCRIPT -- ------------- - -os.setlocale("ISO-8559-1", "numeric") - --- Simulation id -gES_SimID = string.format("%08x*",os.time()) - --- State data for export -gES_PacketSize = 0 -gES_SendStrings = {} -gES_LastData = {} - -gES_PacketSizeHW = {} -gES_SendStringsHW = {} -gES_LastDataHW = {} - -for i = 1, #gES_HARDWARE, 1 do - gES_PacketSizeHW[i] = 0 - gES_SendStringsHW[i] = {} - gES_LastDataHW[i] = {} -end - --- Frame counter for non important data -gES_TickCount = 0 -gES_TickCountHW = 0 - --- Found DCS or FC Module -gES_FoundDCSModule = false -gES_FoundFCModule = false -gES_FoundNoModul = true - ---------------------------------------------- --- DCS Export API Function Implementations -- ---------------------------------------------- - -function LuaExportStart() --- Works once just before mission start. --- (and before player selects their aircraft, if there is a choice!) - - -- 2) Setup udp sockets to talk to GlassCockpit - package.path = package.path..";.\\LuaSocket\\?.lua" - package.cpath = package.cpath..";.\\LuaSocket\\?.dll" - - gES_socket = require("socket") - - gES_c = gES_socket.udp() - gES_c:setsockname("*", 0) - gES_c:setoption('broadcast', true) - gES_c:settimeout(.001) -- set the timeout for reading the socket - - if gES_HARDWAREListner then - gES_c2 = gES_socket.udp() - gES_c2:setsockname("*", gES_HARDWAREListnerPort) - gES_c2:setoption('broadcast', true) - gES_c2:settimeout(.001) -- set the timeout for reading the socket - end - --- local lrename1, lrename2 = os.rename(gES_LogPath, gES_LogPath..".old") - gES_logFile = io.open(gES_LogPath, "w+") - WriteToLog("Export Modules Script Path: "..gES_ExportModulePath) --- if lrenmae1 == nil then --- WriteToLog("Rename Error: "..lrename2) --- end - - SelectModule() -- point globals to Module functions and data. -end - -function WriteToLog(message) - if gES_logFile then - gES_logFile:write(os.date("%X :")..message.."\r\n") - end -end - -function LuaExportBeforeNextFrame() - ProcessInput() -end - -function LuaExportAfterNextFrame() -end - -function LuaExportStop() --- Works once just after mission stop. - for i=1, #gES_HARDWARE, 1 do - SendDataHW("DAC", "stop", i) - FlushDataHW(i) - end - - gES_c:close() - if gES_HARDWAREListner then - gES_c2:close() - end - - if gES_logFile then - gES_logFile:flush() - gES_logFile:close() - gES_logFile = nil - end -end - -function ProcessInput() - local lCommand, lCommandArgs, lDevice - -- C1,3001,4 - -- lComand = C - -- lCommandArgs[1] = 1 => lDevice - -- lCommandArgs[2] = 3001 - -- lCommandArgs[3] = 4 - - if gES_GlassCockpitExport then - local lInput,from,port = gES_c:receivefrom() - - if lInput then - if gES_Debug then - WriteToLog("lInput: "..lInput..", from: "..from..", port: "..port) - end - lCommand = string.sub(lInput,1,1) - - if lCommand == "R" then - ResetChangeValues() - end - - if (lCommand == "C") then - lCommandArgs = StrSplit(string.sub(lInput,2),",") - lDevice = GetDevice(lCommandArgs[1]) - if type(lDevice) == "table" then - lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3]) - end - end - end - end - - if gES_HARDWAREListner then - local lInput2,from2,port2 = gES_c2:receivefrom() -- Hardware - - if lInput2 then - if gES_Debug then - WriteToLog("lInput2: "..lInput2..", from2: "..from2..", port2: "..port2) - end - lCommand = string.sub(lInput2,1,1) - - if lCommand == "C" then - ResetChangeValuesHW() - end - - if (lCommand == "C") then - lCommandArgs = StrSplit(string.sub(lInput2,2),",") - lDevice = GetDevice(lCommandArgs[1]) - if lDevice ~= "1000" then - if type(lDevice) == "table" then - lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3]) - end - elseif lDevice == "1000" then - --genericRadio(key, value, hardware) - genericRadio(lCommandArgs[2],lCommandArgs[3], gES_genericRadioHardwareID) - end - end - end - end -end - -function LuaExportActivityNextEvent(t) - t = t + gES_ExportInterval - - gES_TickCount = gES_TickCount + 1 - - local lMyInfo = LoGetSelfData() - if lMyInfo ~= nil then - if gES_ModuleName ~= lMyInfo.Name then - SelectModule() -- point globals to Module functions and data. - end - lMyInfo = nil - end - - local lDevice = GetDevice(0) - if type(lDevice) == "table" and gES_FoundDCSModule then - - lDevice:update_arguments() - - if gES_GlassCockpitExport then - --ProcessArguments(lDevice, gES_EveryFrameArguments) -- Module arguments as appropriate - coProcessArguments_EveryFrame = coroutine.create(ProcessArguments) - status = coroutine.resume( coProcessArguments_EveryFrame, lDevice, gES_EveryFrameArguments) - if gES_Debug then - WriteToLog("coProcessArguments_EveryFrame Status: "..dump(status)) - end - --ProcessGlassCockpitDCSHighImportance(lDevice) -- Module, as appropriate; determined in SelectModule() - coProcessGlassCockpitDCSHighImportance = coroutine.create(ProcessGlassCockpitDCSHighImportance) - status = coroutine.resume( coProcessGlassCockpitDCSHighImportance, lDevice) - if gES_Debug then - WriteToLog("coProcessGlassCockpitDCSHighImportance Status: "..dump(status)) - end - end - if gES_HARDWAREExport then - --ProcessHARDWAREHighImportance(lDevice) -- Module, as appropriate; determined in SelectModule() - coProcessHARDWAREHighImportance = coroutine.create(ProcessHARDWAREHighImportance) - status = coroutine.resume( coProcessHARDWAREHighImportance, lDevice) - if gES_Debug then - WriteToLog("coProcessHARDWAREHighImportance Status: "..dump(status)) - end - end - - if gES_FirstNewDataSend and gES_FirstNewDataSendCount == 0 then - if gES_HARDWAREExport then - ResetChangeValuesHW() - end - if gES_GlassCockpitExport then - ResetChangeValues() - end - gES_FirstNewDataSend = false - else - gES_FirstNewDataSendCount = gES_FirstNewDataSendCount - 1 - end - - if gES_TickCount >= gES_ExportLowTickInterval then - if gES_GlassCockpitExport then - --ProcessArguments(lDevice, gES_Arguments) -- Module arguments as appropriate - coProcessArguments_Arguments = coroutine.create(ProcessArguments) - status = coroutine.resume( coProcessArguments_Arguments, lDevice, gES_Arguments) - if gES_Debug then - WriteToLog("coProcessArguments_Arguments Status: "..dump(status)) - end - --ProcessGlassCockpitDCSLowImportance(lDevice) -- Module as appropriate; determined in SelectModule() - coProcessGlassCockpitDCSLowImportance = coroutine.create(ProcessGlassCockpitDCSLowImportance) - status = coroutine.resume( coProcessGlassCockpitDCSLowImportance, lDevice) - if gES_Debug then - WriteToLog("coProcessGlassCockpitDCSLowImportance Status: "..dump(status)) - end - end - - if gES_HARDWAREExport then - --ProcessHARDWARELowImportance(lDevice) -- Module, as appropriate; determined in SelectModule() - coProcessHARDWARELowImportance = coroutine.create(ProcessHARDWARELowImportance) - status = coroutine.resume( coProcessHARDWARELowImportance, lDevice) - if gES_Debug then - WriteToLog("coProcessHARDWARELowImportance Status: "..dump(status)) - end - gES_TickCountHW = gES_TickCountHW + 1 - end - gES_TickCount = 0 - end - - if gES_GlassCockpitExport then - FlushData() - end - - if gES_HARDWAREExport then - for i=1, #gES_HARDWARE, 1 do - FlushDataHW(i) - end - end - elseif gES_FoundFCModule then -- Assume FC Aircraft - if gES_GlassCockpitExport then - --ProcessGlassCockpitFCHighImportance() - coProcessGlassCockpitFCHighImportance = coroutine.create(ProcessGlassCockpitFCHighImportance) - status = coroutine.resume( coProcessGlassCockpitFCHighImportance) - if gES_Debug then - WriteToLog("coProcessGlassCockpitFCHighImportance Status: "..dump(status)) - end - end - if gES_HARDWAREExport then - --ProcessHARDWAREHighImportance(lDevice) - coProcessHARDWAREHighImportance = coroutine.create(ProcessHARDWAREHighImportance) - status = coroutine.resume( coProcessHARDWAREHighImportance, lDevice) - if gES_Debug then - WriteToLog("coProcessHARDWAREHighImportance Status: "..dump(status)) - end - end - - if gES_FirstNewDataSend and gES_FirstNewDataSendCount == 0 then - if gES_HARDWAREExport then - ResetChangeValuesHW() - end - if gES_GlassCockpitExport then - ResetChangeValues() - end - gES_FirstNewDataSend = false - else - gES_FirstNewDataSendCount = gES_FirstNewDataSendCount - 1 - end - - if gES_TickCount >= gES_ExportLowTickInterval then - if gES_GlassCockpitExport then - --ProcessGlassCockpitFCLowImportance() - coProcessGlassCockpitFCLowImportance = coroutine.create(ProcessGlassCockpitFCLowImportance) - status = coroutine.resume( coProcessGlassCockpitFCLowImportance) - if gES_Debug then - WriteToLog("coProcessGlassCockpitFCLowImportance Status: "..dump(status)) - end - end - - if gES_HARDWAREExport then - --ProcessHARDWARELowImportance(lDevice) - coProcessHARDWARELowImportance = coroutine.create(ProcessHARDWARELowImportance) - status = coroutine.resume( coProcessHARDWARELowImportance, lDevice) - if gES_Debug then - WriteToLog("coProcessHARDWARELowImportance Status: "..dump(status)) - end - gES_TickCountHW = gES_TickCountHW + 1 - end - gES_TickCount = 0 - end - - if gES_GlassCockpitExport then - FlushData() - end - - if gES_HARDWAREExport then - for i=1, #gES_HARDWARE, 1 do - FlushDataHW(i) - end - end - else -- No Module found - if gES_FoundNoModul then - WriteToLog("No Module Found.") - SelectModule() -- point globals to Module functions and data. - end - end - - return t -end - --- Helper Functions -function StrSplit(str, delim, maxNb) - -- Eliminate bad cases... - if string.find(str, delim) == nil then - return { str } - end - if maxNb == nil or maxNb < 1 then - maxNb = 0 -- No limit - end - local lResult = {} - local lPat = "(.-)" .. delim .. "()" - local lNb = 0 - local lLastPos - for part, pos in string.gfind(str, lPat) do - lNb = lNb + 1 - lResult[lNb] = part - lLastPos = pos - if lNb == maxNb then break end - end - -- Handle the last field - if lNb ~= maxNb then - lResult[lNb + 1] = string.sub(str, lLastPos) - end - return lResult -end - -function round(num, idp) - local lMult = 10^(idp or 0) - return math.floor(num * lMult + 0.5) / lMult -end - - - --- Status Gathering Functions -function ProcessArguments(device, arguments) - local lArgument , lFormat , lArgumentValue - local lCounter = 0 - - if gES_Debug then - WriteToLog("======Begin========") - end - - for lArgument, lFormat in pairs(arguments) do - lArgumentValue = string.format(lFormat,device:get_argument_value(lArgument)) - if gES_Debug then - lCounter = lCounter + 1 - WriteToLog(lCounter..". ID: "..lArgument..", Fromat: "..lFormat..", Value: "..lArgumentValue) - end - SendData(lArgument, lArgumentValue) - end - - if gES_Debug then - WriteToLog("======End========") - end -end - --- Network Functions for GlassCockpit -function SendData(id, value) - if string.len(value) > 3 and value == string.sub("-0.00000000",1, string.len(value)) then - value = value:sub(2) - end - - if gES_LastData[id] == nil or gES_LastData[id] ~= value then - local ldata = id .. "=" .. value - local ldataLen = string.len(ldata) - - if ldataLen + gES_PacketSize > 576 then - FlushData() - end - - table.insert(gES_SendStrings, ldata) - gES_LastData[id] = value - gES_PacketSize = gES_PacketSize + ldataLen + 1 - end -end - --- Network Functions for Hardware -function SendDataHW(id, value, hardware) - hardware = hardware or 1 - - if gES_HARDWARE[hardware] == nil then - WriteToLog("unknown hardware ID '"..hardware.."' for value: '"..id.."="..value.."'") - return - end - - if string.len(value) > 3 and value == string.sub("-0.00000000",1, string.len(value)) then - value = value:sub(2) - end - - if gES_LastDataHW[hardware][id] == nil or gES_LastDataHW[hardware][id] ~= value then - local ldata = id .. "=" .. value - local ldataLen = string.len(ldata) - - if ldataLen + gES_PacketSizeHW[hardware] > 576 then - FlushDataHW(hardware) - end - - table.insert(gES_SendStringsHW[hardware], ldata) - gES_LastDataHW[hardware][id] = value - gES_PacketSizeHW[hardware] = gES_PacketSizeHW[hardware] + ldataLen + 1 - --WriteToLog("id=ldata: "..ldata) - --WriteToLog("gES_LastDataHW["..hardware.."]: "..dump(gES_LastDataHW[hardware])) - end -end - -function FlushData() - if #gES_SendStrings > 0 then - local lES_SimID = "" - if gES_GlassCockpitType == 1 then - lES_SimID = gES_SimID - elseif gES_GlassCockpitType == 2 then - lES_SimID = "" - end - local lPacket = lES_SimID .. table.concat(gES_SendStrings, gES_GlassCockpitSeparator) .. "\n" - gES_socket.try(gES_c:sendto(lPacket, gES_GlassCockpitHost, gES_GlassCockpitPort)) - gES_SendStrings = {} - gES_PacketSize = 0 - end -end - -function FlushDataHW(hardware) - hardware = hardware or 1 - - if gES_HARDWARE[hardware] == nil then - WriteToLog("unknown hardware ID '"..hardware.."'") - return - end - - if #gES_SendStringsHW[hardware] > 0 then - local lPacket = gES_SimID .. table.concat(gES_SendStringsHW[hardware], gES_HARDWARE[hardware].Separator) .. "\n" - gES_socket.try(gES_c:sendto(lPacket, gES_HARDWARE[hardware].Host, gES_HARDWARE[hardware].SendPort)) - gES_SendStringsHW[hardware] = {} - gES_PacketSizeHW[hardware] = 0 - - - - end -end - -function ResetChangeValues() - gES_LastData = {} - gES_TickCount = 10 -end - -function ResetChangeValuesHW() - for i = 1, #gES_HARDWARE, 1 do - gES_LastDataHW[i] = {} - end - gES_TickCount = 10 - gES_TickCountHW = 0 -end - -function SelectModule() - -- Select Module... - gES_FoundDCSModule = false - gES_FoundFCModule = false - gES_FoundNoModul = true - - local lMyInfo = LoGetSelfData() - if lMyInfo == nil then -- End SelectModule, if don't selected a aircraft - return - end - - gES_ModuleName = lMyInfo.Name - local lModuleName = gES_ModuleName..".lua" - local lModuleFile = "" - - gES_FoundNoModul = false - - for file in lfs.dir(gES_ExportModulePath) do - if lfs.attributes(gES_ExportModulePath..file,"mode") == "file" then - if file == lModuleName then - lModuleFile = gES_ExportModulePath..file - end - end - end - - WriteToLog("File Path: "..lModuleFile) - - if string.len(lModuleFile) > 1 then - ResetChangeValuesHW() - - -- load Aircraft File - dofile(lModuleFile) - for i=1, #gES_HARDWARE, 1 do - SendDataHW("File", lMyInfo.Name, i) - FlushDataHW(i) - end - - WriteToLog("File '"..lModuleFile.."' loaded") - - gES_FirstNewDataSend = true - gES_FirstNewDataSendCount = 5 - - if gES_FoundDCSModule then - local lCounter = 0 - for k, v in pairs(gES_GlassCockpitConfigEveryFrameArguments) do - lCounter = lCounter + 1 - end - if gES_Debug then - WriteToLog("gES_GlassCockpitConfigEveryFrameArguments Count: "..lCounter) - end - if lCounter > 0 then - gES_EveryFrameArguments = gES_GlassCockpitConfigEveryFrameArguments - else - -- no Arguments - gES_EveryFrameArguments = {} - end - lCounter = 0 - for k, v in pairs(gES_GlassCockpitConfigArguments) do - lCounter = lCounter + 1 - end - if gES_Debug then - WriteToLog("gES_GlassCockpitConfigArguments Count: "..lCounter) - end - if lCounter > 0 then - gES_Arguments = gES_GlassCockpitConfigArguments - else - -- no Arguments - gES_Arguments = {} - end - - ProcessGlassCockpitDCSHighImportance = ProcessGlassCockpitDCSConfigHighImportance - ProcessGlassCockpitDCSLowImportance = ProcessGlassCockpitDCSConfigLowImportance - ProcessHARDWAREHighImportance = ProcessHARDWAREConfigHighImportance - ProcessHARDWARELowImportance = ProcessHARDWAREConfigLowImportance - - elseif gES_FoundFCModule then - ProcessGlassCockpitFCHighImportance = ProcessGlassCockpitFCHighImportanceConfig - ProcessGlassCockpitFCLowImportance = ProcessGlassCockpitFCLowImportanceConfig - ProcessHARDWAREHighImportance = ProcessHARDWAREConfigHighImportance - ProcessHARDWARELowImportance = ProcessHARDWAREConfigLowImportance - else - WriteToLog("Unknown Module Type: "..lMyInfo.Name) - end - - else -- Unknown Module - ProcessGlassCockpitDCSHighImportance = ProcessGlassCockpitDCSHighImportanceNoConfig - ProcessGlassCockpitDCSLowImportance = ProcessGlassCockpitDCSLowImportanceNoConfig - ProcessGlassCockpitFCHighImportance = ProcessGlassCockpitFCHighImportanceNoConfig - ProcessGlassCockpitFCLowImportance = ProcessGlassCockpitFCLowImportanceNoConfig - ProcessHARDWAREHighImportance = ProcessHARDWARENoConfigHighImportance - ProcessHARDWARELowImportance = ProcessHARDWARENoConfigLowImportance - gES_EveryFrameArguments = {} - gES_Arguments = {} - WriteToLog("Unknown Module Name: "..lMyInfo.Name) - end -end - --- The dump function show the content of the specified variable. --- dump is similar to PHP function var_dump and show variables from type --- "nil, "number", "string", "boolean, "table", "function", "thread" and "userdata" -function dump(var, depth) - depth = depth or 0 - if type(var) == "string" then - return 'string: "' .. var .. '"\n' - elseif type(var) == "nil" then - return 'nil\n' - elseif type(var) == "number" then - return 'number: "' .. var .. '"\n' - elseif type(var) == "boolean" then - return 'boolean: "' .. tostring(var) .. '"\n' - elseif type(var) == "function" then - if debug and debug.getinfo then - fcnname = tostring(var) - local info = debug.getinfo(var, "S") - if info.what == "C" then - return string.format('%q', fcnname .. ', C function') .. '\n' - else - if (string.sub(info.source, 1, 2) == [[./]]) then - return string.format('%q', fcnname .. ', defined in (' .. info.linedefined .. '-' .. info.lastlinedefined .. ')' .. info.source) ..'\n' - else - return string.format('%q', fcnname .. ', defined in (' .. info.linedefined .. '-' .. info.lastlinedefined .. ')') ..'\n' - end - end - else - return 'a function\n' - end - elseif type(var) == "thread" then - return 'thread\n' - elseif type(var) == "userdata" then - return tostring(var)..'\n' - elseif type(var) == "table" then - depth = depth + 1 - out = "{\n" - for k,v in pairs(var) do - out = out .. (" "):rep(depth*4).. "["..k.."] = " .. dump(v, depth) - end - return out .. (" "):rep((depth-1)*4) .. "}\n" - else - return tostring(var) .. "\n" - end -end - --- round function for math libraray --- number : value --- decimals: number of decimal --- method : ceil: Returns the smallest integer larger than or equal to number --- floor: Returns the smallest integer smaller than or equal to number -function math.round(number, decimals, method) - if string.find(number, "%p" ) ~= nil then - decimals = decimals or 0 - local lFactor = 10 ^ decimals - if (method == "ceil" or method == "floor") then - -- ceil: Returns the smallest integer larger than or equal to number - -- floor: Returns the smallest integer smaller than or equal to number - return math[method](number * lFactor) / lFactor - else - return tonumber(("%."..decimals.."f"):format(number)) - end - else - return number - end -end - --- split function for string libraray --- stringvalue: value --- delimiter : delimiter for split --- for example, see http://www.lua.org/manual/5.1/manual.html#5.4.1 -function string.split(stringvalue, delimiter) - result = {}; - for match in (stringvalue..delimiter):gmatch("(.-)"..delimiter) do - table.insert(result, match); - end - return result; -end - --- Pointed to by ProcessGlassCockpitDCSHighImportance, if the player aircraft is something else -function ProcessGlassCockpitDCSHighImportanceNoConfig(mainPanelDevice) -end --- Pointed to by ProcessGlassCockpitDCSLowImportance, if the player aircraft is something else -function ProcessGlassCockpitDCSLowImportanceNoConfig(mainPanelDevice) -end - ------------------------------------------ --- FLAMING CLIFFS AIRCRAFT / Su-25T -- --- FC aircraft don't support GetDevice -- ------------------------------------------ --- the player aircraft is a Flaming Cliffs or similar aircraft -function ProcessGlassCockpitFCHighImportanceNoConfig() -end -function ProcessGlassCockpitFCLowImportanceNoConfig() -end - --- Hardware exports -function ProcessHARDWARENoConfigHighImportance(mainPanelDevice) -end -function ProcessHARDWARENoConfigLowImportance(mainPanelDevice) -end - ---dofile("./AriesWings/AriesRadio.luac") +-- load the DCS ExportScript for DAC and Ikarus +dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\ExportScript.lua]])