

Oakes
Members-
Posts
219 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Oakes
-
Rotary encoder: Haven't had the time for those yet, have some ideas though... Should we collaborate a little to get it to work? Which rotary would you like to start with? Can you give me the clickabledata.lua and device number for the rotary? Have you connected a rotary to the mastercard etc..? Does it work in SIOC? /Oakes
-
Hi Snipes Take a look at Nico's site: http://www.lekseecon.nl/opencockpits.html /Oakes
-
I suspected as much....I guess that's why the "real" switches have a little hat on them...to get a good grip. Snipes, would you be so kind and enlighten me as to where you bought the switches you used for your panel? /brds Oakes
-
Looking good... If you don't mind me asking....What is a Locking Lever toogle switch? /brds Oakes
-
Nope. Use Autohotkey for this: http://www.autohotkey.com/ For example here is how to use a joybutton to send the b key: ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder) ; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 1Joy1:: Send, [color=Magenta]{b down}[/color] ; Sends b press to the application SetTimer, WaitForButtonUp1, 10 return WaitForButtonUp1: if GetKeyState("1Joy1") ; The button is still, down, so keep waiting. return ; Otherwise, the button has been released. Send, [color=Magenta]{b up}[/color] ; Sends b release to the application SetTimer, WaitForButtonUp1, off return1Joy1 => First Joystick in the windows list (2 => second joystick and so on) Joystickbutton number You need to change the {b down} and {b up} to suit your application. Note: Your application/game etc will still see the joystick button being pressed => you need to make sure that this is unassigned in the application/games et. /Oakes
-
Hi Mate This is how the parameters are connected [12] = {SimpleRotary, 2, 10} => function SimpleRotary([color=Red]pValue[/color], [color=Blue]pDevice[/color], [color=Lime]pNumber[/color]) GetDevice([color=Blue]pDevice[/color]):performClickableAction([color=Lime]pNumber[/color] + 3000,([color=Red]pValue[/color] - 1)/10) end Note: pValue is not equal to 12, pValue is equal to the value of SIOC parameter nbr 12 (in this case 1, 2 or 3 depending on the switch position). In other words we have written some code with the following meaning: "Please Mr Lua, whenever the value of SIOC variable nbr 12 changes I would like you to take this new value, subtract 1 and then divide the result with 10 and then send it to the button nbr 10 on the device with device-id of 2" So, you have a 3 position switch and a SIOC variable that will be either 1, 2 or 3 depending on the position of the switch. When ever you change this variable, the LUA code will send an appropriate value to the DCS:BS. In this case DCS:BS wants to have 0, 0.1 and 0.2 for the 3 positions of the switch. (hence the (pValue -1) /10) => SIOC variable nbr 12 = 1 => (1-1)/10 = 0 => SIOC variable nbr 12 = 2 => (2-1)/10 = 0.1 => SIOC variable nbr 12 = 1 => (3-1)/10 = 0.2 btw, which switch are you trying to set, button number 10 on device nbr 2? or button nbr 11 on device nbr 2 (this one doesnt exist btw). Why using 0, 0.1 and 0.2? If we assume that you want to set button number 10 on on device nbr 2 this is the code (from clickabledata.lua), intresting bit in purple: elements["CONVERTER-PTR"] = {class = {class_type.TUMB, class_type.TUMB}, hint = LOCALIZE("DC/AC inverter"), device = devices.ELEC_INTERFACE, action = {device_commands.Button_10, device_commands.Button_11}, arg = {270, 270}, [color=Magenta]arg_value = {-direction*0.1, direction*0.1}, arg_lim = {{0.0, 0.2}, {0.0, 0.2}}[/color], use_OBB = true, updatable = true}The direction bit tells us how much we need to add/remove to move 1 position up or down (0.1 in this case) for the switch and the arg_lim tells us the limits (0.0 to 0.2) => 0, 0.1 and 0.2 are acceptable values for this switch. This principle works for most of the multiposition switches in the cockpit (as far as I know anyway). A 4 position rotary is really not anything different than a 3 position microswitch etc....just write some SIOC code that assigns 1,2,3,4 to a SIOC variable depending on the position and feed this variable to LUA and it should work. If it doesn't check the clickabledata.lua to see if the particular switch is different in some way. btw, here is a compilation file for devices.lua and clickabledata.lua:http://forums.eagle.ru/showpost.php?p=764486&postcount=30 This is the code for the Datalink Master mode rotary, a 4 position rotary: elements["DTLK-MASTER-MODES-PTR"] = {class = {class_type.TUMB, class_type.TUMB}, hint = LOCALIZE("Datalink Master mode"), device = devices.DATALINK, action = {device_commands.Button_15, device_commands.Button_15}, arg = {329, 329}, arg_value = [color=Magenta]{-direction*0.1, direction*0.1}, arg_lim = {{0.0, 0.3}, {0.0, 0.3}}[/color]}and its corresponding SIOCConfig line [595] = {SimpleRotary, 25, 15}, 595 = 1 ,2 3, or 4 depending on the position of the rotary => DCS:BS gets 0, 0.1, 0.2 or 0.3 which is OK according to clickabledata.lua /Oakes /Oakes
-
Hmm....I'm thinking about using Shapeways for this. http://www.shapeways.com/materials/transparent_detail This material is not completely clear but should suffice, I'm a little bit worried about the max tem of 48 deg C, that is is to brittle etc and that it won't las t in the long run. Anyway, a quick calculation (a disc with a diameter of 30 mm and a height of 15 mm) comes to about 30 USD (including shipping). This is without any cavities for the lights etc => the finished design should be cheaper. Duckling, can you take some detailed pictures of the knob, the light holders etc + would it be possible for you to measure the diameter and thickness of the knob? /Oakes
-
Casting resin is a new thing for me, is this hard to do? Expensive? /Oakes
-
Does anybody have a close up of the nob on the Landing Gear Handle itself, I'm trying to figure out how the lenses and light etc are incorporated into the round knob, or is the entire knob made out of a transparent material? What is the little round extrusion on top of the knob for, is this a button...? I'm assuming this is the Downlock override button (marked with Yellow stripes) or...? /Oakes
-
Ok, thank you. /Oakes
-
Thank you all for helping me. One more question, the Master Caution on the UFC, is this just an indicator or is it also a button (for Master Caution reset)? I've always assumed that it is both but I'm not sure.... /Oakes
-
Hi mate I don't have the sim yet so ixnay on the fraps thing. Hence the request for a picture of the master caution light so that I can see the colors and text etc......I was hoping for a good quality picture, otherwise I'll go trawling on youtube :) /Oakes
-
Anyone now the size of the Armament HUD Control Panel (AHCP)? /Oakes
-
Anybody got a picture of the UFC with the Master Caution lit up? Thinking of doing this one as my first panel for DCS A10...I think I've got a good idea on how to do the buttons and rockers, but I need to think about the Master Caution a little bit.... /Oakes
-
Np mate, but I'm still confused :) Did my new function (SimpleRotaryTest) solve the problem? or was it all just a missing comma i.e. the old SimpleRotary function was ok for this switch? /Oakes
-
For your second question regarding the K041 device, I honestly don't have a clue at the moment. Anybody like to chime in? /Oakes
-
Hi mate As you know, from SIOC we get at string like this: Arn.Inicio:123=1:234=2:345=3: whenever any SIOC parameter changes its value i.e. the SIOC server this string to export.lua, (the client in this case) when it registers a change in one of its parameters, this of course usually happens when we flip a physical switch. The syntax of this string is quite simple 123=1 means parameter 123 now has the value of 1, 234=2 means that parameter 234 now has the value of 2 etc. We handle this in the function LuaEXportBeforeNextFrame() in Export.lua. http://code.google.com/p/dcsbsexport/source/browse/trunk/Export.lua#101 local [color=Magenta]inpst[/color] = c:receive() This code read the input buffer and puts the result into inpst. The result may be nothing (since SIOC hasn't sent any data since the last time we read the buffer) -> we do a check for this with if [color=Magenta]inpst[/color] then If there is data in inpst we continue otherwise we exit the LuaEXportBeforeNextFrame() function. Assuming inpst contained data (ie Arn.Inicio:123=1:234=2:345=3) we now need to parse this data to get the SIOC parameters and their respective value: We do this here: for lSIOC_Param, lSIOCValue in SIOC_Parse([color=Magenta]inpst[/color]) do This piece of clever LUA code is not easy to read but it simply gives us for each iteration (through the SIOC_Parse() function) the parameter and its value, the parameter is put into lSIOC_Param and the value is put into lSIOCValue. In our example the first iteration gives us lSIOC_Param = 123 and lSIOCValue = 1. We now check that lSIOC_Param is not nil (sometimes SIOC sends an empty string): if inputsTable[lSIOC_Param] ~= nil then If lSIOC_Param is not nil we input take lSIOC_Param and lSIOCValue input into this line: inputsTable[[color=DarkRed]lSIOC_Param[/color]][1]([color=Blue]lSIOCValue[/color], inputsTable[lSIOC_Param][2],inputsTable[lSIOC_Param][3],inputsTable[lSIOC_Param][4],inputsTable[lSIOC_Param][5],inputsTable[lSIOC_Param][6],inputsTable[lSIOC_Param][7],inputsTable[lSIOC_Param][8],inputsTable[lSIOC_Param][9]) Now, this is where it gets somewhat complicated, in LUA you can store function names in variables -> you can store variables in arrays -> you can store arrays in tables -> you can store function names in arrays in tables. inputsTable is such a table, for each SIOC parameter we store an array of functions and values. The line below (from SIOCConfig.lua) simply stores an array containing one function (TwoPositionSwitch) and four integers (12,5,1,1) at table position 123 in the table inputsTable [[color=DarkRed]123[/color]] = {TwoPositionSwitch, 12, 5, 1, 1} The call: inputsTable[[color=DarkRed]123[/color]][1] will return the first array element of the array stored at table position 123, in this case it will return the function TwoPositionSwitch The call: inputsTable[[color=DarkRed]123[/color]][2] will return the second array element of the array stored at table position 123, in this case it will return the integer 12 and so on. Now lets get back to: inputsTable[[color=DarkRed]lSIOC_Param[/color]][1]([color=Blue]lSIOCValue[/color], inputsTable[lSIOC_Param][2],inputsTable[lSIOC_Param][3],inputsTable[lSIOC_Param][4],inputsTable[lSIOC_Param][5],inputsTable[lSIOC_Param][6],inputsTable[lSIOC_Param][7],inputsTable[lSIOC_Param][8],inputsTable[lSIOC_Param][9]) Remember, in our example lSIOC_Param = 123 and lSIOCValue = 1. What we are really doing here is calling the first element of the array stored at table position lSIOC_Param (in this example this means stored at table position 123), this will return the function TwoPositionSwitch -> inputsTable[[color=DarkRed]lSIOC_Param[/color]][1]([color=Blue]lSIOCValue[/color], inputsTable[[color=DarkRed]lSIOC_Param[/color]][2],inputsTable[[color=DarkRed]lSIOC_Param[/color]][3],inputsTable[[color=DarkRed]lSIOC_Param[/color]][4],inputsTable[[color=DarkRed]lSIOC_Param[/color]][5],inputsTable[[color=DarkRed]lSIOC_Param[/color]][6].............. goes to inputsTable[[color=DarkRed]123[/color]][1]([color=Blue]lSIOCValue[/color], inputsTable[[color=DarkRed]123[/color]][2],inputsTable[[color=DarkRed]123[/color]][3],inputsTable[[color=DarkRed]123[/color]][4],inputsTable[[color=DarkRed]123[/color]][5],inputsTable[[color=DarkRed]123[/color]][6].............. goes to TwoPositionSwitch([color=Blue]lSIOCValue[/color], inputsTable[[color=DarkRed]123[/color]][2],inputsTable[[color=DarkRed]123[/color]][3],inputsTable[[color=DarkRed]123[/color]][4],inputsTable[[color=DarkRed]123[/color]][5],inputsTable[[color=DarkRed]123[/color]][6].............. Remember lSIOCValue = 1 => TwoPositionSwitch([color=Blue]1[/color], inputsTable[[color=DarkRed]123[/color]][2],inputsTable[[color=DarkRed]123[/color]][3],inputsTable[[color=DarkRed]123[/color]][4],inputsTable[[color=DarkRed]123[/color]][5],inputsTable[[color=DarkRed]123[/color]][6].............. and inputsTable[lSIOC_Param][2] => inputsTable[123][2] => 12 TwoPositionSwitch([color=Blue]1[/color], 12, inputsTable[[color=DarkRed]123[/color]][3],inputsTable[[color=DarkRed]123[/color]][4],inputsTable[[color=DarkRed]123[/color]][5],inputsTable[[color=DarkRed]123[/color]][6].............. and inputsTable[lSIOC_Param][3] => inputsTable[123][3] => 5 TwoPositionSwitch([color=Blue]1[/color], 12, 5, inputsTable[[color=DarkRed]123[/color]][4],inputsTable[[color=DarkRed]123[/color]][5],inputsTable[[color=DarkRed]123[/color]][6].............. and so on until we end up with this call TwoPositionSwitch([color=Blue]1[/color], 12, 5, 1, 1) Which means: function TwoPositionSwitch(pValue, pDevice, pNumber, pOnValue, pInvert)pValue = 1, pDevice = 12, PNumber = 5, pOnValue = 1 and pInvert = 1 A somewhat long explanation that pValue is not nil, its it in fact the value of the SIOC parameter. pInvert means invert the behavior of the switch, if you leave it blank (nil) or set it to 0 then we don't invert and if you set it to 1 we invert. /Oakes
-
Hi mate Should be: GetDevice(pDevice):performClickableAction(pNumber + 3000,[color=Red]pValue - 2[/color]) not: GetDevice(pDevice):performClickableAction(pNumber + 3000,([color=Red]pValue -2/10[/color]) i.e. don't divide by 10. Secondly, please note that I made a new function called SimpleRotaryTest (if you just change the SimpleRotary function you will affect every other switch in the cockpit as well, so don't do that) Thirdly, make sure that variable 1080 (or 1070) only has the values 1,2 and 3 depending on the switch position(your code seems to have 1, 6 and 12 for some reason in it -> &rethud_LNK = 6 ?). And finally, sometimes you use 1070, sometimes 1052 and sometimes 1080 as the variable name, I'm confused, are we still talking about the initial problem with the HUD Mode rotary or are you having other problems? /Oakes
-
Hi mate Try adding this function to ExportSupport.lua: function SimpleRotaryTest(pValue, pDevice, pNumber) GetDevice(pDevice):performClickableAction(pNumber + 3000,pValue - 2) end and change the line in SIOCConfig.lua to: [1070] = {SimpleRotaryTest, 7, 2} Let me know if this works. Your SIOC code should send the value of 1, 2 or 3 (depending on the switch position) to parameter 1070 for this to work. /Oakes
-
All my files are available here http://code.google.com/p/dcsbsexport/source/browse/#svn/trunk Also, please have a look at this thread (start at post #48 ), you will get more or less a step by step guide on how to connect a switch to the OC card and getting it's inputs to the sim. http://forums.eagle.ru/showthread.php?t=45071&page=5 If you use export.lua, all the virtual switches will be synced at sim startup with the physical (i.e real) ones (watch out and remember to reset your physical eject switch before you start the sim...ask me how I know :lol:) This is up to ED, we can control any number of 7-segment displays through SIOC, but ED needs to enable us to get the correct numbers by calling some LUA function. /Oakes
-
Hi mate Keyclient was used before we could connect directly to DCS:BS through export.lua = > you shouldn't use the Keyclient when using the direct connection through export.lua, this will most likely introduce some sort of race condition between the keyclient and export.lua which will cause you to see erratic behavior (depending on whether keyclient or export.lua manipulates the switch first). /Oakes
-
I don't know if this problem was solved or not, but if you still need a SIOC to keyboard client, have a look here: http://forums.eagle.ru/showthread.php?t=37417 /Oakes
-
Hi mate I really can't see any reason for this not to work, but then again I'm no expert at network stuff. /Oakes
-
I got the 1.5 mm version of Gravoply, and I've made a quick test with a flashlight behind one of my panels (1.5 mm Gravoply + 4mm acrylic glued together) and it looked good in a darkend room. No light leakage whatsoever (the black surface is thin but it is very opaque apparently). However, I believe there are thinner version of the Gravoply material => even better for backlight. /Oakes
-
Yep, unless you can find the lua code for the devices somewhere among the files. /Oakes