Jump to content

Oakes

Members
  • Posts

    219
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Oakes

  1. New beta: Beta 0_93 - Targeting System/Weapons displays fix + added support for variometer http://dcsbsexport.googlecode.com/files/Export_0_93_beta.zip /Oakes
  2. Anybody? ED? /Oakes
  3. Yep, me too. Here is another interesting test case: You can select weapons with the Targeting System off and the LUA functions for getting weapons info will report back as if the targeting system was on. Funny enough DCS itself doesn't update the display :) Select ATGM (outer stations), switch Targeting system off, select rockets (inner stations), switch targeting system on. DSC Simulated weapon type is still ATGM:doh: And what about damage....how do we detect that the Targeting system or some subsystem etc is causing the displays to be blank etc....blehh I say, "Ed, give some display info to the people":) /Oakes
  4. Excellent. I'll copy that list in no time......:music_whistling: btw, here is another case that is somewhat tricky: Select a station with rockets, jettison the rockets (station is now reported as "EMPTY") but DCS still displays the NC/HP etc on the type display.... Wish ED could give us a"getInfoOnDisplay(2)" function :helpsmilie: /Oakes
  5. Well, the script has support for cannon ammo count, missile/bombs etc count and weaponstype. -- Enter the SIOC parameter number for the Remain and RNDS disply on the Weapons Control panel ammoCountersAndType = {Remain=208, RNDS=207, Type = 300}"RNDS = 207" => please update the SIOC variable nbr 207 with the nummer of cannons rounds remaining. "Remain = 208" => same as above but for missiles, bombs etc "Type=300" => gets a value based on the selected weapon according to the weaponsTypeIndicator table (in weaponsIndicator.lua). Your SIOC code needs to interpret this value and display the correct info on the display. weaponsTypeIndicator = { ["EMPTY"] = 0, ["S-8KOM"] = 1, -- HP ["9A4172"] = 2, -- NC ["FAB-250"] = 3 -- A6 } SIOC Code: Var 0300, name WeaponType, Value 0 { IF &WeaponType = 1 // HP { &UL1 = 1 &C1 = 1 &B1 = 0 &LL1 = 1 &T1 = 0 &UR1 = 1 &LR1 = 1 &UL2 = 1 &C2 = 1 &B2 = 0 &LL2 = 1 &T2 = 1 &UR2 = 1 &LR2 = 0 } IF &WeaponType = 2 // NC { &UL1 = 1 &C1 = 0 &B1 = 0 &LL1 = 1 &T1 = 1 &UR1 = 1 &LR1 = 1 &UL2 = 1 &C2 = 0 &B2 = 1 &LL2 = 1 &T2 = 1 &UR2 = 0 &LR2 = 0 } IF &WeaponType = 3 // A6 { &UL1 = 1 &C1 = 1 &B1 = 0 &LL1 = 1 &T1 = 1 &UR1 = 1 &LR1 = 1 &UL2 = 1 &C2 = 1 &B2 = 1 &LL2 = 1 &T2 = 1 &UR2 = 0 &LR2 = 1 } }UL1 => Upper left segment display 1, B2 => bottom segment display 2 etc... What I need help with is adding all the weapons to the weaponIndicatorTable. So far I have simply made a little debug code in the script that prints the Weapon name to Export.log and compared that with the simulated display for a bunch of weapons. Maybe there is a smarter way. Uncomment these lines in function ProcessAmmoCountAndType(pRemainSIOCParam, pRNDSSIOCParam, pTypeSIOCParamhttp://code.google.com/p/dcsbsexport/source/browse/tags/beta_0_92/ExportSupport.lua#103) in exportsupport.lua --io.write(lWeaponType) --io.write("\n") and make sure that the io.flush() is uncommented at the end of the same function. Now you will see the name of the weapon in the .\temp\Export.log /Oakes
  6. Sioc only supports integers as far as I know. LUA supports all kinds of values but is seem like DCS rotaries and buttons with leds work with decimals while regular switches are just 0 or 1 for on off. Exceptions, maybe, I've only done buttons for the datalink and weapons panel so far. But as you know users can write their own special functions for inputTables. My goal for the scripts are to run my cockpit so I probably won't do support for anything that I don't need. Of course if someone want's to help with adding support for something that is fine. Right now I could use some help with identify all the different weapons types in DCS:BS (for the weaponsIndicator.lua file). Hmm, well the only way to "fix" this problem is to run through a checklist before start-up and set the switches to the correct positions. No other way that I can think of...... When you first connect DCS to SIOC you tell SIOC which variables you are interested in and SIOC then sends the status for all these variables. If you disregard this answer then the switches of the virtual cockpit will remain in their startup position but of course they might not match with the physical switches (not until you manipulate your physical switch that is). /Oakes
  7. Nope, no problem at all..but please explain that only the taged(beta, release etc) versions should be downloaded. Stuff from the trunk comes with no guarantee whatsoever:music_whistling: /Oakes
  8. Stelios, simu12011 is correct. Bottom part explains how to connect and test led's. As you know I've sent you this link before. Please read it. http://personales.ya.com/micabina737/iocards/hard/test1i.htm /Oakes
  9. Master Warning Indicator: SIOC: Check values in mainpanlel_init.lua for indicators: lamp_MasterWarning = CreateGauge() lamp_MasterWarning.arg_number = [color=Blue]44[/color] lamp_MasterWarning.input = {0.0, 0.3} lamp_MasterWarning.output = {0.0, 0.3} lamp_MasterWarning.controller = controllers.lamp_MasterWarning Add this as an indicator in siocConfig (make sure you update to the latest version) warningIndicators = { [[color=Red]your sioc var for the master warning led/lamp[/color]] = {0,[color=Blue]44[/color]} } gIndicatorTables = {warningIndicators} Master warning pushbutton: SIOC: Check values in clickabledata.lua for indicators: elements["CSO-PTR"] = {class = {class_type.BTN}, hint = LOCALIZE("Master caution push-light"), device = [color=DarkGreen]devices.SYST_CONTROLLER[/color], action = {device_commands.Button_[color=DarkOrange]1[/color]}, stop_action = {device_commands.Button_1}, arg = {44}, arg_value = {[color=Blue]0.2[/color]}, arg_lim = {{0.0, 0.2}}, use_release_message = {true} } devices.SYST_CONTROLLER = 14 (from devices.lua) Put this in inputsTable in siocConfig.lua [[color=Red]your sioc var for the master warning button[/color]] = {TwoPositionSwitch, [color=Green]14[/color], [color=DarkOrange]1[/color], [color=Blue]0.2[/color]} /Oakes
  10. This is a 11 (0 to 10) position rotary switch with an argument between 0 and 1, this means that GetDevice(pDevice):performClickableAction(x,y) (the command that set a switch to any of its positions) expects to get: y= 0 for pos 0 y= 0.1 for pos 1 y= 0.2 for pos 3 . . . y = 1 for pos 10 So, you need to make some SIOC code that based on you inputs sets a parameter to a value between 1 and 11 based on the position of you rotary. Below is an example for a 4 position rotary (the datalink id rotary of my cockpit). The rotary electrically activates one input per position and performClickableAction thus expects to get 0, 0.1, 02 or 0.3 as it input. Var 0590, name DL_ID, Value 1 Var 0591, name DL_ID_1, Link IOCARD_SW, Input 28 { IF &DL_ID_1 = 1 { &DL_ID = 1 } } Var 0592, name DL_ID_2, Link IOCARD_SW, Input 30 { IF &DL_ID_2 = 1 { &DL_ID = 2 } } Var 0593, name DL_ID_3, Link IOCARD_SW, Input 31 { IF &DL_ID_3 = 1 { &DL_ID = 3 } } Var 0594, name DL_ID_4, Link IOCARD_SW, Input 34 { IF &DL_ID_4 = 1 { &DL_ID = 4 } } Below is the line from inputsTable for the same rotary. [590] = {SimpleRotary, [color=Green]25[/color], 14},[590] = {SimpleRotary, 25, 14} means that the rotary switch is connected to SIOC parameter 590, Device ID is 25 = devices.DATALINK, Button Nbr is 14 = Datalink self ID, whenever the SIOC Param 590 is changed these parameters gets fed into the SimpleRotary function => SimpleRotary(Value of SIOC Parameter 590 (<= 1 to 4), 25, 14). The SimpleRotary function then subtracts 1 from the Value of SIOC Parameter 590 and then divides the reminder by 10 (<= 0 to 0.3). This value the gets sent to the applicable device via the performClickableAction command. Function below: function SimpleRotary([color=Red]pValue[/color], [color=Green]pDevice[/color], [color=DarkOrange]pNumber[/color]) GetDevice([color=Green]pDevice[/color]):performClickableAction([color=DarkOrange]pNumber[/color] + 3000,([color=Red]pValue[/color] - 1)/10) end /Oakes
  11. Yep Nope Nope, LEDs are done via the indicatorTables in siocConfig. Rotaries(not encoders) are done with the SimpleRotary Function. I'll post about this in a little while. ?? Adapting the solution to their needs I guess. Also, please note that I've made a soulution that works for two types of inputs Switches and simple rotaries, there is lots of other stuff that needs to be handled, instruments etc Np :thumbup: /Oakes
  12. Online LUA demo....good for testing quick things while learning. http://www.lua.org/demo.html /Oakes
  13. Ok, no problem with the error log, this is normal. Did you update the inputsTable table in siocConfig.lua to reflect your settings? Since you downloaded the new version you need to redo this step (the new version takes it's input from siocConfig.lua and not the old inputsTable.lua) Basically replace this: inputsTable = { [501] = {TwoPositionSwitch, 12, 1, 1}, [502] = {TwoPositionSwitch, 12, 3, 1}, [503] = {TwoPositionSwitch, 12, 22, 1}, [504] = {TwoPositionSwitch, 12, 21, 1}, [505] = {TwoPositionSwitch, 12, 5, 1, 1}, [508] = {TwoPositionSwitch, 12, 6, 1, 1}, [509] = {TwoPositionSwitch, 12, 20, 1, 1}, [510] = {SimpleRotary, 12, 4}, [530] = {TwoPositionSwitch, 12, 9, 1}, [531] = {TwoPositionSwitch, 60, 2, 1}, [532] = {TwoPositionSwitch, 23, 2, 1}, [533] = {TwoPositionSwitch, 12, 17, 1}, [534] = {TwoPositionSwitch, 11, 1, 1}, [535] = {TwoPositionSwitch, 12, 16, 1}, [540] = {TwoPositionSwitch, 12, 10, 1}, [541] = {TwoPositionSwitch, 12, 12, 1}, [542] = {TwoPositionSwitch, 12, 11, 1}, [543] = {TwoPositionSwitch, 12, 13, 1}, [555] = {SimpleRotary, 12, 14}, [578] = {TwoPositionSwitch, 25, 5, 0.2}, [590] = {SimpleRotary, 25, 14}, [595] = {SimpleRotary, 25, 15}, }with this inputsTable = {[10] = {TwoPositionSwitch, 60, 2, 1}} in siocConfig.lua Sorry for the confusion, by this I meant you should replace any default Export.lua etc with my version, not remove everything else:music_whistling: And yes, that is the switch we are trying to move. /Oakes
  14. What does the Error.log file say? Do you get a connection to SIOC when you run DSC:BS (SIOC must be running btw)? You can check this under <IOCP> Server -> Clients Connected. You should have 0 when not running DCS and 1 client when running DCS (IOCP Console connects to this as well so every IOCP Console window means +1 on this value). In the export directory you should have my Export.lua, ExportSupport.lua, weaponsTypeIndicator and in the subdir SIOCConfig you should have siocConfig.lua. /Oakes
  15. Export.lua. /Oakes
  16. New release: http://code.google.com/p/dcsbsexport/wiki/Beta_0_92 Download: http://dcsbsexport.googlecode.com/files/Export_0_92_beta.zip /Oakes
  17. That seems right, just make sure that the Var 10 shift between 0 and 1 when you flip the switch. Ok, next step is to download the latest version of the scripts from http://code.google.com/p/dcsbsexport/downloads/list and unzip the files into the Export directory of BS (make a backup first). <--(I'm assuming you have already done this but I included it for new people following this thread.) Anyway, you then need to set EnableExportScript = true in the Config/Export/Config.lua to get the export going. Edit your inputsTable.lua so that you only have the line below. inputsTable = {[10] = {TwoPositionSwitch, 60, 2, 1}}Now comment all the stuff in LuaExportAfterNextFrame() since you do not have any indicators, ammo counters etc function LuaExportAfterNextFrame() -- Works just after every simulation frame. -- Generate the SIOC string for all indicatortables in the master gIndicatorTables table -- local lSIOC_SendString = ProcessIndicators(gIndicatorTables) --Generate and add the SIOC string for the ammocounters to SIOC string --lSIOC_SendString = lSIOC_SendString..ProcessAmmoCount(ammoCounters.Remain,ammoCounters.RNDS) --Send the string to SIOC if --if lSIOC_SendString ~= "" then --socket.try(c:send("Arn.Resp:"..lSIOC_SendString.."\n")) --end end Run DCS:BS, if everything works correctly you should now see the simulated Targeting System Power Switch (same panel as Auto Turn, Moving Gnd Target etc) follow you physical switch. If it doesn't work check the Temp\Error.log file for errors. (I use the Kiwi Log Viewer http://www.kiwisyslog.com/kiwi-log-viewer-overview/ for this but of course you can just open the file with Notepad etc.) Btw, PSPad is a good editor for LUA files http://www.pspad.com/ To enable LUA highlighting in PSPAD do this: 1. Settings -> Highlighter Settings 2. Select one of the <not assigned> entries at the bottom of the list to the left 3. Select LUA in the list of User Highlighters 4. Click OK. /Oakes
  18. Hmm...the link does not work.....whats the ELFA part no? /Oakes
  19. Hi I think you missed this step: Your "CONFIG_FILE=" (maybe "CONFIG_FILE=.\sioc.ssi") might be different from mine. The important thing is that we start a new file...otherwise we get a lot of old stuff. Like VSI etc. So basically change the CONFIG_FILE=something to CONFIG_FILE=.\dcs_001.ssi, restart SIOC and then repeat the adding of a variable in the editor (this time you should get a blank file when you hit the CONFIG button). Yes you can use any variable number you like, but I choose 10 as the example. /Oakes
  20. Ok, now for the fun part. Hit the Config button on the SIOC page. This opens the editor. Now right click and select Insert Var or New var. Double click on the rectangle that appears. In the new window that opens, left click on the "NOT LINKED" text and select Switches (under IO Cards Master). Set Var Num to 10, Name to Test, InS/Outs/# to 1 (this is the physical number of the input for your switch, corresponds to the number in contraldor program). Hit Ok. Now you should have this line in the editor: Var 0010, name Test, Link IOCARD_SW, Input 1 Now save the file (Files-> Save) Now hit Reload on the Main SIOC window. Then hit IOCPCONSOLE, check that the status is CONNECTED. Now when you flip the switch (connected to input 001 on the master card) you should see var 10 (also named Test) in the IPOCCONSOLE window shift from 0 to 1 (or vise versa)....if this works then the connection from the switch to the master to the USB to the SIOC to the variable works. Next we do the scriptfiles. /Oakes
  21. Ok, now we need to connect the mastercard and the switch to SIOC. For this you need to find the Device ID of the USB Expansion card and add (or modify) the following line to sioc.ini (under masters). MASTER=0,4,1,X "X" is the Device id of the USB card, you can find this number by starting SIOC, then on the upper right window you can see this number, it says "Something something - Device = 123" I belive. You should only have one USB expansion card connected to the computer for this to work I believe. (You can also use USBCheck to see the device ID http://www.opencockpits.com/modules.php?name=Downloads&d_op=getit&lid=254) Here is some more info about the device number. http://www.lekseecon.nl/howto.html#device While you are editing sioc.ini also change the CONFIG_FILE=.\keys.ssi to something appropriate like CONFIG_FILE=.\dcs_001.ssi or similar. This is the SIOC file that we will use for DCS (defines all the inputs/outputs/logic) etc. /Oakes
  22. I've created a Google Project to keep tabs on the code for the scripts. Future releases will be posted there. http://code.google.com/p/dcsbsexport/ If you want access to the code you can 1. use http://tortoisesvn.tigris.org/ for simple export to your computer 2. you can download complete releases from http://code.google.com/p/dcsbsexport/downloads/list 3. You can download individual files from the repository via the source code browser http://code.google.com/p/dcsbsexport/source/browse/ (click on the file and then right click on the "View raw" link). /Oakes
  23. I've created a Google Project to keep tabs on the code for the scripts. Future releases will be posted there. http://code.google.com/p/dcsbsexport/ If you want access to the code you can 1. use http://tortoisesvn.tigris.org/ for simple export to your computer 2. you can download complete releases from http://code.google.com/p/dcsbsexport/downloads/list 3. You can download individual files from the repository via the source code browser http://code.google.com/p/dcsbsexport/source/browse/ (click on the file and then right click on the "View raw" link). /Oakes
  24. Hi Mate Thank you for the link..expensive stuff.... I've implemented a software solution to solve the non-linearity of common RC servos, basically you map certain points on the dial to certain servo input values and then I do a simple linear/proportional interpolation. => the more points you map the better accuracy you get. /Oakes
  25. Hi Stelios Np, lets start with the mastercards/usb expansion etc 1. Connect the USB Expansion to the Master Card and test that it works (you don't need to test the outputs yet etc, just test a few inputs) , here is a very good link http://personales.ya.com/micabina737/iocards/hard/test1i.htm for this. btw, If you do not have the appropriate parallel cable for connecting the master card to the USB Expansion card you can remove the jack posts (see picture at http://media.digikey.com/photos/Tyco%20Amp%20Photos/5207719-3.jpg) from the mastercard 25 pin dsub and connect them directly. Just make sure you use the J1 connector on the USB Expansion card (http://personales.ya.com/micabina737/iocards/hard/numi.htm) I didn't connect any 5 volt source to the master card initially and this worked fine until I started connecting LEDS/displays etc so I guess you can skip that step for now. 2. Connect a simple two position switch to any input on the master card. http://personales.ya.com/micabina737/iocards/hard/elementosi.htm 3. Check that this works with the Controlador software. ..and then we will take it from there. Links from http://personales.ya.com/micabina737/iocards/hard/guiai.htm /Oakes
×
×
  • Create New...