Jump to content

OpenCockpits question


Recommended Posts

Hey guys... I'm trying to follow the manual/tutorial on the open cockpits site and it's very FSX leaning. My question is, once I get the master card hooked into the usb card and that hooked into the pc, will the pc see it ( plug and play wise ) as a valid set of inputs?

 

if so, then I would just need to solder a push button or switch into the master card, then whatever input I chose ( say pin 30 ) would that then show up in A-10 or the windows HID window as input #30 ( or whatever input it is )? Or do I need to continue to program the master card to send some sort of signal to windows?

 

I know I don't need all the fsuipc nonsense that the manual goes in depth about, but I'm wondering if it's just that easy to create a switch input into A-10??

 

I'm simply trying to create a cdu input device for A-10, not expecting anything back from the sim at this point. Just want more switch inputs.

Home built i5 quadcore. dual ATI 4850 in xfire mode. 16GB ram Warthog HOTAS, Thrustmaster Rudder, TrackIR 5, TM MFD's, windows 7 64 ultimate.. 40" primary screen, 19" secondary

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

ummm... I missed a turn somewhere...

 

Hi mate

 

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.

Code:

inputsTable = {[10] = {TwoPositionSwitch, 60, 2, 1}}

Now comment all the stuff in LuaExportAfterNextFrame() since you do not have any indicators, ammo counters etc

 

Code:

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

 

I followed you so far into this thread... but when you tell him to put inputsTable = {[10] = {TwoPositionSwitch, 60, 2, 1}} into the file... how in the world do you just pull the Targeting System Power Switch out of thin air as being the switch that would move???

Home built i5 quadcore. dual ATI 4850 in xfire mode. 16GB ram Warthog HOTAS, Thrustmaster Rudder, TrackIR 5, TM MFD's, windows 7 64 ultimate.. 40" primary screen, 19" secondary

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Hi Cezar

 

{[10] = {TwoPositionSwitch, 60, 2, 1}

 

 

60 is the device number and 2 is the button number on the device that we want to change. So thin of 60,2 as the "adress" of the button you want to change.

 

 

Devices are specified in the Devices.lua file and button numbers in clickableData.lua.

 

So if you want to change a button/switch you first find the button/switch in clickableData.lua (below is the relevant line for the "K-041 Targeting-navigation system power switch").

 

 

elements["K-041-PTR"]            = { class = {class_type.TUMB,class_type.TUMB},
hint = LOCALIZE("K-041 Targeting-navigation system power switch"),
device = [color=Red]devices.K041[/color], 
action={device_commands.Button_[color=Lime]2[/color],device_commands.Button_2},
arg = {433,433}, arg_value = {-direction*1.0,direction*1.0}, arg_lim = {{0.0, 1.0},{0.0, 1.0}},
use_OBB = true, updatable = true}

Then you check devices.lua for the device number of devices.K041, you will find that devices.K041 = 60.

 

Here is a helpful compilation of all the buttons and their device and button numbers.

http://forums.eagle.ru/showpost.php?p=764486&postcount=30

 

 

Also have a look here:

http://forums.eagle.ru/showpost.php?p=1049142&postcount=114

 

/Oakes

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...