Jump to content

Ruahatu

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by Ruahatu

  1. Thanks for your help Hansolo :thumbup: Here is my code definePushButton("UHF_1", 31, 3006, 388, "UHF RADIO", "UHF 1") -- OK definePushButton("UHF_2", 31, 3007, 389, "UHF RADIO", "UHF 2") -- OK definePushButton("UHF_3", 31, 3008, 390, "UHF RADIO", "UHF 3") -- OK definePushButton("UHF_4", 31, 3009, 391, "UHF RADIO", "UHF 4") -- OK definePushButton("UHF_5", 31, 3010, 392, "UHF RADIO", "UHF 5") -- OK definePushButton("UHF_6", 31, 3011, 393, "UHF RADIO", "UHF 6") -- OK definePushButton("UHF_7", 31, 3012, 394, "UHF RADIO", "UHF 7") -- OK definePushButton("UHF_8", 31, 3013, 395, "UHF RADIO", "UHF 8") -- OK definePushButton("UHF_9", 31, 3014, 396, "UHF RADIO", "UHF 9") -- OK definePushButton("UHF_0", 31, 3015, 397, "UHF RADIO", "UHF 0") -- OK
  2. Hello, I made a custom keypad for the radio of the GAZELLE. The "-" are connected to each other then to the card. my problem is that when I press, I have a repeat send key. is this a problem with my welds?? should I add a resistor? If yes where and what kind? Tanks for your help and sorry for my english.
  3. https://forums.eagle.ru/showthread.php?t=190806
  4. Thank you Ian for your explanations and your wonderful program :thumbup:
  5. :cheer3nc: EUREKA I found it local vhf_lut1 = { ["0"] = "00", ["25"] = "25", ["50"] = "50", ["75"] = "75" } local function getVhfAmFreqency() local freq1 = string.format("%.0f", GetDevice(0):get_argument_value(133)*10) local freq2 = string.format("%.0f", GetDevice(0):get_argument_value(134)*10)--:sub(3) local freq3 = string.format("%.0f", GetDevice(0):get_argument_value(136)*10)--:sub(3) local freq4 = string.format("%.0f", GetDevice(0):get_argument_value(138)*10)--:sub(3) local freq5 = vhf_lut1[string.format("%.0f", GetDevice(0):get_argument_value(139)*100)] return freq1 .. freq2 .. freq3 .. "." .. freq4 .. freq5 end defineString("AM_DISPLAY", getVhfAmFreqency, 7, "VHFAM Panel", "VHFAM Display") But still want info about this :sub(3)
  6. Always busy investigating If I understand correctly, the %.0f is used to format the number exactly as many digits as needed by the argument?? Someone can explain to me wthat it is the function sub(3) ??? Thanks
  7. For more visibility, I open a new post concerning my questions about my library for the Gazelle. My problem is related to the display of the AM radio. The radio have 6 digits Here is the argument AM_Radio_freq_cent = 133, AM_Radio_freq_dix = 134, AM_Radio_freq_unite = 136, AM_Radio_freq_dixieme = 138, AM_Radio_freq_centieme = 139, The frequency increases by 0.025 When i use this code local function getVhfNavFreq() local function a(n) return GetDevice(0):get_argument_value(n) end return string.format("%.0f%.0f%.0f", a(133)*10, a(134)*10, a(136)*10) .. "." .. string.format("%.0f%.0f", a(138)*10, a(139)*10) end defineString("VHFNAV_FREQ", getVhfNavFreq, 7, "VHF NAV Radio", "VHF NAV Frequency") I can see in the controle reference the frequency but the 2 last digit are wrong 0.000 = 0 0.025 = 3 0.050 = 5 0.075 = 8 I understand that i have to use this type of code local vhf_lut1 = { ["0.00"] = "0", ["0.25"] = "3", ["0.50"] = "5", ["0.75"] = "8" } local function getVhfAmFreqency() local freq1 = string.format("%.0f",GetDevice(0):get_argument_value(133)):sub(3) local freq2 = string.format("%.0f", GetDevice(0):get_argument_value(134)):sub(3) local freq3 = string.format("%.0f", GetDevice(0):get_argument_value(136)):sub(3) local freq4 = string.format("%.0f", GetDevice(0):get_argument_value(138)):sub(3) local freq5 = vhf_lut1[string.format("%.2f",GetDevice(0):get_argument_value(139))] return freq1 .. freq2 .. freq3 "." .. freq3 .. freq4 .. freq5 end defineString("AM_DISPLAY", getVhfAmFreqency, 7, "VHFAM Panel", "VHFAM Display") But it does not work and once again i dont understand :cry: Thanks for your help
  8. :music_whistling: I am back for the VHF AM for the Gazelle :cry: The radio have 6 digits AM_Radio_freq_cent = 133, AM_Radio_freq_dix = 134, AM_Radio_freq_unite = 136, AM_Radio_freq_dixieme = 138, AM_Radio_freq_centieme = 139, The frequency increases by 0.025 When i use this code local function getVhfNavFreq() local function a(n) return GetDevice(0):get_argument_value(n) end return string.format("%.0f%.0f%.0f", a(133)*10, a(134)*10, a(136)*10) .. "." .. string.format("%.0f%.0f", a(138)*10, a(139)*10) end defineString("VHFNAV_FREQ", getVhfNavFreq, 7, "VHF NAV Radio", "VHF NAV Frequency") I can see in the controle reference the frequency but the 2 last digit are wrong 0.000 = 0 0.025 = 3 0.050 = 5 0.075 = 8 I understand that i have to use this type of code local vhf_lut1 = { ["0.00"] = "0", ["0.25"] = "3", ["0.50"] = "5", ["0.75"] = "8" } local function getVhfAmFreqency() local freq1 = string.format("%.0f",GetDevice(0):get_argument_value(133)):sub(3) local freq2 = string.format("%.0f", GetDevice(0):get_argument_value(134)):sub(3) local freq3 = string.format("%.0f", GetDevice(0):get_argument_value(136)):sub(3) local freq4 = string.format("%.0f", GetDevice(0):get_argument_value(138)):sub(3) local freq5 = vhf_lut1[string.format("%.2f",GetDevice(0):get_argument_value(139))] return freq1 .. freq2 .. freq3 "." .. freq3 .. freq4 .. freq5 end defineString("AM_DISPLAY", getVhfAmFreqency, 7, "VHFAM Panel", "VHFAM Display") But it does not work and once again i dont understand :cry: Thanks for your help
  9. Thanks for your help Ian :thumbup: Here is my code where the LED work BIOS.protocol.beginModule("SA342", 0x4200) BIOS.protocol.setExportModuleAircrafts({"SA342M", "SA342L", "SA342Mistral"}) local document = BIOS.util.document local defineIndicatorLight = BIOS.util.defineIndicatorLight local definePushButton = BIOS.util.definePushButton local definePotentiometer = BIOS.util.definePotentiometer local defineRotary = BIOS.util.defineRotary local defineSetCommandTumb = BIOS.util.defineSetCommandTumb local defineTumb = BIOS.util.defineTumb local defineToggleSwitch = BIOS.util.defineToggleSwitch local defineToggleSwitchToggleOnly = BIOS.util.defineToggleSwitchToggleOnly local defineFixedStepTumb = BIOS.util.defineFixedStepTumb local defineVariableStepTumb = BIOS.util.defineVariableStepTumb local defineString = BIOS.util.defineString local defineRockerSwitch = BIOS.util.defineRockerSwitch local defineMultipositionSwitch = BIOS.util.defineMultipositionSwitch local defineElectricallyHeldSwitch = BIOS.util.defineElectricallyHeldSwitch local defineFloat = BIOS.util.defineFloat local define8BitFloat = BIOS.util.define8BitFloat defineIndicatorLight("Voyant_DEM", 300, "Front Panel", "Voyant Start engine") defineIndicatorLight("Voyant_RLT", 301, "Front Panel", "Voyant RLT") defineIndicatorLight("Voyant_BLOC", 302, "Front Panel", "Voyant BLOC") defineIndicatorLight("Voyant_ALARME", 303, "Front Panel", "Voyant Alarme") defineIndicatorLight("Voyant_RSUPP", 320, "Front Panel", "Voyant RSUPP") defineIndicatorLight("Voyant_RCONV", 321, "Front Panel", "Voyant RCONV") defineIndicatorLight("Voyant_FILTAS", 322, "Front Panel", "Voyant Sand Filter") If I add the code for the radio display local function getUHFFrequency() local ind = BIOS.util.parse_indication(5) if ind == nil then return " " end local freqStatus = ind["UHF_Freq"] -- e.g. "251.000" return freqStatus end defineString("UHF_FREQUENCY", getUHFFrequency, 7, "UHF RADIO", "UHF Frequency Display") The display work in the control reference but the Sand filter led stay on and the Ralenti, Bloc, RSUP and RCONV dont work in my panel but are right in the control reference. If i turn on the radio, the BLOC and RCONV led goes on. In game to test the LED simply pusch the test button near the DEM, RLT, BLOC LED. The Sand Filter must equip the gazelle via emport in the mission editor and simply put the switch bellow the LED on. wait a few second and the LED must be on to. Here my arduino squetch for the first MEGA /* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board * does not feature an ATMega328 or ATMega2650 controller. */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" /* Declare a Master Caution Reset button on pin 10 */ DcsBios::RotaryEncoder labelsPtr("LABELS_PTR", "-3200", "+3200", 22, 23); DcsBios::Switch3Pos paModePtr("PA_MODE_PTR", 24, 25); DcsBios::Switch2Pos paLacetPtr("PA_LACET_PTR", 26); DcsBios::Switch2Pos paRoulisPtr("PA_ROULIS_PTR", 27); DcsBios::Switch2Pos paTangagePtr("PA_TANGAGE_PTR", 28); DcsBios::Switch2Pos paMasterPtr("PA_MASTER_PTR", 29); DcsBios::Switch3Pos interMaPtr("INTER_MA_PTR", 30, 31); DcsBios::Switch2Pos fuelPumpFrontPtr("FUEL_PUMP_FRONT_PTR", 32); DcsBios::Switch2Pos clockStartstopPtr("CLOCK_STARTSTOP_PTR", 33); DcsBios::Switch2Pos clockResetPtr("CLOCK_RESET_PTR", 34); DcsBios::Switch2Pos rsuppPtr("RSUPP_PTR", 35); DcsBios::Switch2Pos rconvPtr("RCONV_PTR", 36); DcsBios::Switch2Pos filtasPtr("FILTAS_PTR", 37); DcsBios::Switch2Pos fmagPtr("FMAG_PTR", 38); DcsBios::LED voyantFiltas(0x4254, 0x0020, 41); DcsBios::LED voyantRconv(0x4254, 0x0010, 40); DcsBios::LED voyantRsupp(0x4254, 0x0008, 39); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } And the second UNO in RS485 #define DCSBIOS_RS485_SLAVE 5 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 #include "DcsBios.h" /* paste code snippets from the reference documentation here */ DcsBios::Switch2Pos trimPtr("TRIM_PTR", 3); DcsBios::ActionButton vatestPtrToggle("VATEST_PTR", "TOGGLE", 4); DcsBios::Switch2Pos batteriePtr("BATTERIE_PTR", 5); DcsBios::Switch2Pos alterPtr("ALTER_PTR", 6); DcsBios::Switch2Pos genePtr("GENE_PTR", A0); const byte artvisvhfdopPtrPins[4] = {7, 8, 9, 10}; DcsBios::SwitchMultiPos artvisvhfdopPtr("ArtVisVhfDop_PTR", artvisvhfdopPtrPins, 4); DcsBios::Switch3Pos egPilotePtr("EG_PILOTE_PTR", 11, 12); DcsBios::LED voyantBloc(0x4254, 0x0002, A1); DcsBios::LED voyantRlt(0x4254, 0x0001, A2); DcsBios::LED voyantDem(0x4252, 0x8000, A3); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } I think it uses the same Buffer or adress 4254 ??? Here the info in control reference for the display Output Type: string Address: 0x4254 Max. Length: 7 Description: UHF Frequency Display I hope you have enough information. Thanks again
  10. For the Gazelle the indicator information are in the arg_int.lua
  11. Thanks Ian, It works in the control reference but it make conflicts with somme led??? They no longer work Any idea?? Thanks
  12. Hello, I still have problems displaying the radio of the Gazelle. I look in the lua console to find the indication number and the function for the display. I use this code in my lib local function getUHFFrequency() local ind = list_indication(5) if ind == nil then return " " end local freqStatus = ind["UHF_Freq"] -- e.g. "251000" return freqStatus:sub(0,3) .. "." .. freqStatus:sub(4,6) end defineString("UHF_FREQUENCY", getUHFFrequency, 7, "UHF RADIO", "UHF Frequency Display") But it does not work I dont anderstand, Thanks for your help
  13. Nobody for some help :helpsmilie:
  14. Hello, I'm back and sorry to bother you with my question :cry:. Always busy on the Gazelle and i don't anderstand how i have to code the diferent radio display and weapon display. Can someone help me and tell me what file it needs. I have also problem with this switch elements["PE_ZOOM"] = default_button_tumb(_("SA342 Zoom"), devices.PE,device_commands.Button_4, device_commands.Button_3, arg_int.PE_ZOOM,2) -- 9 -- 365 arg number I do not find the right function in Util.lua Thanks
  15. Thanks. If i anderstand, for the general module: In the lib folder a SA342.lua BIOS.protocol.beginModule("SA342", 0x2000) BIOS.protocol.setExportModuleAircrafts({"SA342M", "SA342L", "SA342Mistral"}) By module In the Lib folder a SA342M.lua, SA342L.lua and SA342Mistral.lua BIOS.protocol.beginModule("SA342M", 0x1234) BIOS.protocol.setExportModuleAircrafts({"SA342M"}) BIOS.protocol.beginModule("SA342L", 0x2340) BIOS.protocol.setExportModuleAircrafts({"SA342L"}) Have I to declare the SA342 to aircraftlist, BIOS.lua? Thanks
  16. Hello Ian, I am busy doing the library for the Gazelle. For the moment it works :D But here is my problem. There are three kinds of the Gazelle 342M, 342L and 342Mistral. The interactive control reference confirm that 3 name. All the Gazelle have the same clickabledata.lua and in 90% the same switch. Only the weapon panel change. For exemple in the electric panel the 3 gazelle have the same fonction. Is it possible to say to DCS BIOS to look in 1 library for the 3 gazelle? I hope I am clear :D Not easy to explain with my bad english Thanks for your help and your great tool DCS BIOS.
  17. Hello Ian an thanks for your help. I instal again DCS BIOS and evering work now. Lets begin with the Gazelle. Thanks
  18. Hello, I make it again and always nothing. DCS BIOS is in the script folder in my saved game folder. I enable the interactive control reference in chrome pointing to de Doc folder located in the script folder I launch DCS jump in the Gazelle, open the APP interactive control reference and nothing :(, same with the A-10. My firewall and antivirus are off. Here is my export.lua gHost = "127.0.0.1" gPort = 9089 gExportInterval = 0.067 gExportLowTickInterval = 1 gEveryFrameArguments = {[540]="%0.1f", [541]="%0.1f", [542]="%0.1f", [730]="%0.1f", [731]="%0.1f", [732]="%0.1f", [76]="%.4f", [77]="%.4f", [78]="%.4f", [80]="%.4f", [84]="%.4f", [85]="%.4f", [70]="%.4f", [73]="%.4f", [82]="%.4f", [83]="%.4f", [13]="%.4f", [14]="%.4f", [48]="%.4f", [12]="%.4f", [4]="%.4f", [55]="%0.1f", [17]="%.4f", [18]="%.4f", [24]="%.4f", [23]="%.4f", [25]="%0.1f", [19]="%0.1f", [26]="%0.1f", [20]="%.4f", [21]="%.4f", [27]="%.4f", [63]="%.4f", [64]="%.4f", [65]="%0.1f", [715]="%.4f", [40]="%0.1f", [32]="%0.1f", [46]="%0.1f", [34]="%.4f", [36]="%.4f", [47]="%.4f", [41]="%.4f", [33]="%.4f", [35]="%.4f", [662]="%0.1f", [663]="%0.1f", [665]="%0.1f", [664]="%0.1f", [215]="%0.1f", [216]="%0.1f", [217]="%0.1f", [404]="%0.1f", [372]="%0.1f", [373]="%0.1f", [374]="%0.1f", [654]="%1d", [659]="%0.1f", [660]="%0.1f", [661]="%0.1f", [737]="%0.1f", [653]="%.4f", [88]="%.4f", [89]="%.4f", [647]="%.4f", [648]="%.4f", [606]="%0.1f", [608]="%0.1f", [610]="%0.1f", [612]="%0.1f", [614]="%0.1f", [616]="%0.1f", [618]="%0.1f", [619]="%0.1f", [620]="%0.1f", [274]="%.4f", [604]="%.4f", [600]="%0.1f", [281]="%.4f", [289]="%1d", [480]="%0.1f", [481]="%0.1f", [482]="%0.1f", [483]="%0.1f", [484]="%0.1f", [485]="%0.1f", [486]="%0.1f", [487]="%0.1f", [488]="%0.1f", [489]="%0.1f", [490]="%0.1f", [491]="%0.1f", [492]="%0.1f", [493]="%0.1f", [494]="%0.1f", [495]="%0.1f", [496]="%0.1f", [497]="%0.1f", [498]="%0.1f", [499]="%0.1f", [500]="%0.1f", [501]="%0.1f", [502]="%0.1f", [503]="%0.1f", [504]="%0.1f", [505]="%0.1f", [506]="%0.1f", [507]="%0.1f", [508]="%0.1f", [509]="%0.1f", [510]="%0.1f", [511]="%0.1f", [512]="%0.1f", [513]="%0.1f", [514]="%0.1f", [515]="%0.1f", [516]="%0.1f", [517]="%0.1f", [518]="%0.1f", [519]="%0.1f", [520]="%0.1f", [521]="%0.1f", [522]="%0.1f", [523]="%0.1f", [524]="%0.1f", [525]="%0.1f", [526]="%0.1f", [527]="%0.1f", [260]="%0.1f", [269]="%.4f", [129]="%1d", [185]="%1d", [186]="%1d", [187]="%1d", [188]="%1d", [191]="%0.1f", [798]="%0.1f", [799]="%0.1f", [178]="%0.1f", [179]="%0.1f", [181]="%0.1f", [182]="%0.1f"} gArguments = {[22]="%.3f", [101]="%.1f", [102]="%1d", [103]="%1d", [104]="%1d", [105]="%1d", [300]="%.1f", [301]="%.1f", [302]="%.1f", [303]="%.1f", [304]="%.1f", [305]="%.1f", [306]="%.1f", [307]="%.1f", [308]="%.1f", [309]="%.1f", [310]="%.1f", [311]="%.1f", [312]="%.1f", [313]="%.1f", [314]="%.1f", [315]="%.1f", [316]="%.1f", [317]="%.1f", [318]="%.1f", [319]="%.1f", [320]="%1d", [321]="%1d", [322]="%1d", [323]="%1d", [324]="%1d", [325]="%0.1f", [326]="%.1f", [327]="%.1f", [328]="%.1f", [329]="%.1f", [330]="%.1f", [331]="%.1f", [332]="%.1f", [333]="%.1f", [334]="%.1f", [335]="%.1f", [336]="%.1f", [337]="%.1f", [338]="%.1f", [339]="%.1f", [340]="%.1f", [341]="%.1f", [342]="%.1f", [343]="%.1f", [344]="%.1f", [345]="%.1f", [346]="%1d", [347]="%1d", [348]="%1d", [349]="%1d", [350]="%1d", [351]="%0.1f", [385]="%.1f", [386]="%.1f", [387]="%.1f", [388]="%.1f", [389]="%.1f", [390]="%.1f", [391]="%.1f", [392]="%.1f", [393]="%.1f", [395]="%.1f", [396]="%.1f", [394]="%.1f", [397]="%.1f", [398]="%.1f", [399]="%.1f", [400]="%.1f", [401]="%.1f", [402]="%.1f", [405]="%1d", [406]="%1d", [407]="%1d", [408]="%1d", [409]="%1d", [531]="%.1f", [532]="%.1f", [533]="%.1f", [403]="%.1f", [365]="%.1f", [366]="%.1f", [369]="%.1f", [370]="%.1f", [371]="%.1f", [367]="%.3f", [368]="%.3f", [716]="%1d", [655]="%0.1f", [651]="%.1f", [375]="%0.1f", [376]="%0.1f", [377]="%0.1f", [378]="%1d", [379]="%0.1f", [380]="%1d", [381]="%1d", [382]="%1d", [383]="%1d", [384]="%0.1f", [645]="%0.1f", [646]="%.1f", [605]="%.1f", [607]="%.1f", [609]="%.1f", [611]="%.1f", [613]="%.1f", [615]="%.1f", [617]="%.1f", [621]="%1d", [711]="%.1f", [622]="%0.1f", [623]="%1d", [624]="%.3f", [626]="%.3f", [636]="%0.2f", [638]="%0.2f", [640]="%0.2f", [642]="%0.2f", [644]="%1d", [628]="%.1f", [630]="%.1f", [632]="%.1f", [634]="%.1f", [410]="%.1f", [411]="%.1f", [412]="%.1f", [413]="%.1f", [414]="%.1f", [415]="%.1f", [416]="%.1f", [417]="%.1f", [418]="%.1f", [419]="%.1f", [420]="%.1f", [421]="%.1f", [422]="%.1f", [423]="%.1f", [425]="%.1f", [426]="%.1f", [427]="%.1f", [428]="%.1f", [429]="%.1f", [430]="%.1f", [431]="%.1f", [432]="%.1f", [433]="%.1f", [434]="%.1f", [435]="%.1f", [436]="%.1f", [437]="%.1f", [438]="%.1f", [439]="%.1f", [440]="%.1f", [441]="%.1f", [442]="%.1f", [443]="%.1f", [444]="%.1f", [445]="%.1f", [446]="%.1f", [447]="%.1f", [448]="%.1f", [449]="%.1f", [450]="%.1f", [451]="%.1f", [452]="%.1f", [453]="%.1f", [454]="%.1f", [455]="%.1f", [456]="%.1f", [457]="%.1f", [458]="%.1f", [459]="%.1f", [460]="%.1f", [461]="%.1f", [462]="%.1f", [466]="%.1f", [467]="%.1f", [468]="%.1f", [470]="%.1f", [471]="%.1f", [424]="%1d", [463]="%1d", [469]="%1d", [472]="%1d", [241]="%1d", [242]="%1d", [243]="%1d", [244]="%1d", [245]="%1d", [246]="%1d", [601]="%1d", [602]="%1d", [603]="%1d", [712]="%0.2f", [352]="%.1f", [353]="%.1f", [354]="%.1f", [355]="%.1f", [356]="%1d", [357]="%.1f", [358]="%1d", [359]="%.3f", [360]="%0.1f", [361]="%0.1f", [362]="%0.1f", [363]="%0.1f", [364]="%0.1f", [275]="%.1f", [276]="%1d", [277]="%.3f", [278]="%1d", [279]="%1d", [280]="%1d", [282]="%1d", [283]="%1d", [284]="%.3f", [287]="%1d", [288]="%.3f", [290]="%.3f", [291]="%1d", [292]="%.3f", [293]="%.3f", [294]="%1d", [295]="%1d", [296]="%.3f", [297]="%.3f", [258]="%0.2f", [259]="%.1f", [261]="%.3f", [262]="%0.1f", [266]="%1d", [247]="%1d", [248]="%0.1f", [250]="%0.1f", [249]="%.3f", [251]="%0.1f", [252]="%0.1f", [270]="%1d", [273]="%1d", [272]="%1d", [271]="%.3f", [267]="%.1f", [268]="%.3f", [473]="%0.1f", [474]="%1d", [475]="%0.1f", [476]="%1d", [477]="%1d", [106]="%1d", [107]="%1d", [108]="%1d", [109]="%1d", [110]="%1d", [111]="%1d", [112]="%1d", [113]="%1d", [114]="%1d", [115]="%.1f", [117]="%1d", [118]="%1d", [119]="%1d", [120]="%1d", [121]="%1d", [116]="%.3f", [122]="%1d", [123]="%1d", [124]="%1d", [125]="%1d", [126]="%1d", [127]="%.1f", [132]="%1d", [131]="%.1f", [130]="%1d", [137]="%0.3f", [138]="%0.1f", [135]="%0.1f", [133]="%.3f", [136]="%.1f", [134]="%1d", [139]="%0.2f", [140]="%0.2f", [141]="%0.2f", [142]="%0.2f", [151]="%0.3f", [153]="%0.2f", [154]="%0.2f", [155]="%0.2f", [156]="%0.2f", [152]="%0.1f", [149]="%0.1f", [147]="%.3f", [150]="%.1f", [148]="%1d", [189]="%1d", [190]="%.1f", [192]="%.3f", [197]="%.1f", [196]="%1d", [193]="%.3f", [195]="%.3f", [194]="%0.1f", [198]="%.1f", [161]="%0.2f", [162]="%0.1f", [163]="%0.2f", [164]="%0.2f", [165]="%0.2f", [166]="%0.2f", [167]="%0.1f", [168]="%0.1f", [169]="%1d", [170]="%1d", [171]="%.3f", [172]="%.1f", [173]="%.1f", [735]="%.1f", [734]="%1d", [779]="%1d", [778]="%1d", [780]="%1d", [781]="%0.1f", [782]="%0.1f", [783]="%0.1f", [784]="%1d", [772]="%1d", [199]="%0.1f", [200]="%0.1f", [201]="%1d", [202]="%1d", [203]="%1d", [204]="%1d", [205]="%1d", [206]="%1d", [207]="%1d", [208]="%1d", [209]="%0.2f", [210]="%0.2f", [211]="%0.2f", [212]="%0.2f", [213]="%0.2f", [214]="%0.2f", [174]="%1d", [175]="%1d", [176]="%0.1f", [177]="%1d", [180]="%1d", [183]="%1d", [184]="%1d", [221]="%.3f", [222]="%1d", [223]="%.3f", [224]="%1d", [225]="%.3f", [226]="%1d", [227]="%.3f", [228]="%1d", [229]="%.3f", [230]="%1d", [231]="%.3f", [232]="%1d", [233]="%.3f", [234]="%1d", [235]="%.3f", [236]="%1d", [237]="%1d", [238]="%.3f", [239]="%0.1f", [240]="%.1f", [704]="%.3f", [705]="%.3f", [718]="%1d", [722]="%.1f", [733]="%1d"} function ProcessHighImportance(mainPanelDevice) -- 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))) 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))) end function ProcessLowImportance(mainPanelDevice) -- Get Radio Frequencies local lUHFRadio = GetDevice(54) SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- ILS Frequency --SendData(2251, string.format("%0.1f;%0.1f", mainPanelDevice:get_argument_value(251), mainPanelDevice:get_argument_value(252))) -- 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))) end -- os.setlocale("ISO-8559-1", "numeric") -- Simulation id gSimID = string.format("%08x*",os.time()) -- State data for export gPacketSize = 0 gSendStrings = {} gLastData = {} -- Frame counter for non important data gTickCount = 0 -- DCS Export Functions function LuaExportStart() -- Works once just before mission start. -- 2) Setup udp sockets to talk to helios package.path = package.path..";.\\LuaSocket\\?.lua" package.cpath = package.cpath..";.\\LuaSocket\\?.dll" socket = require("socket") c = socket.udp() c:setsockname("*", 0) c:setoption('broadcast', true) c:settimeout(.001) -- set the timeout for reading the socket end function LuaExportBeforeNextFrame() ProcessInput() end function LuaExportAfterNextFrame() end function LuaExportStop() -- Works once just after mission stop. c:close() end function ProcessInput() local lInput = c:receive() local lCommand, lCommandArgs, lDevice, lArgument, lLastValue if lInput then 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 function LuaExportActivityNextEvent(t) t = t + gExportInterval gTickCount = gTickCount + 1 local lDevice = GetDevice(0) if type(lDevice) == "table" then lDevice:update_arguments() ProcessArguments(lDevice, gEveryFrameArguments) ProcessHighImportance(lDevice) if gTickCount >= gExportLowTickInterval then ProcessArguments(lDevice, gArguments) ProcessLowImportance(lDevice) gTickCount = 0 end FlushData() 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 result = {} local pat = "(.-)" .. delim .. "()" local nb = 0 local lastPos for part, pos in string.gfind(str, pat) do nb = nb + 1 result[nb] = part lastPos = pos if nb == maxNb then break end end -- Handle the last field if nb ~= maxNb then result[nb + 1] = string.sub(str, lastPos) end return result end function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end -- Status Gathering Functions function ProcessArguments(device, arguments) local lArgument , lFormat , lArgumentValue for lArgument, lFormat in pairs(arguments) do lArgumentValue = string.format(lFormat,device:get_argument_value(lArgument)) SendData(lArgument, lArgumentValue) end end -- Network Functions 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 gLastData[id] == nil or gLastData[id] ~= value then local data = id .. "=" .. value local dataLen = string.len(data) if dataLen + gPacketSize > 576 then FlushData() end table.insert(gSendStrings, data) gLastData[id] = value gPacketSize = gPacketSize + dataLen + 1 end end function FlushData() if #gSendStrings > 0 then local packet = gSimID .. table.concat(gSendStrings, ":") .. "\n" socket.try(c:sendto(packet, gHost, gPort)) gSendStrings = {} gPacketSize = 0 end end function ResetChangeValues() gLastData = {} gTickCount = 10 end local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[scripts\DCS-SimpleRadioStandalone.lua]]) local Tacviewlfs=require('lfs');dofile(Tacviewlfs.writedir()..'Scripts/TacviewExportDCS.lua') dofile(lfs.writedir()..[[scripts\DCS-BIOS\BIOS.lua]]) :helpsmilie:
  19. Hello, I follow your step by step vidéo to activate the extention in google chrome. My dcs bios folder is not in my saved games folder but my export.lua have been patched. Maybe my firewall?? My panel work fine with DCS BIOS Back home i will trie again. Any other idea?? Thanks
  20. Hello, I would like to create a library for the Gazelle. I take a look at the developper guide but i have my first problem. I don't have information in the interactive control reference, so no name off the module. I tried with the A10 and also no information?? Have I to launch someting to connect DCS to the interactive control reference? Thanks for your help.
  21. thank you very much :thumbup::thumbup: I will equip myself and test this. My chips come from china, little price :D and probably counterfeit or bad quality. Where do you buy your chips? I see several types of MAX-487 (CSA-ESA-CPA-EPA,...) what is the best for DCS-BIOS?? Thank you again for your help
×
×
  • Create New...