Jump to content

Recommended Posts

Posted (edited)

Hello all,

 

I started the pitbuilding adventure! and it's not an easy thing for me!

 

I use IOCards and SIOC to manage inputs/ouputs from DCS the ACHP is fully functionnal but i run into problems with some switchs who used the momentary position, like the canopy open/close switch.

 

i found this in the clickabledata.lua but i cant figure out how to manage this!

 

arg_value = {1.0 ,0},

arg_lim = {{0.5, 1.0} ,{0,0.5}},

 

action = {device_commands.Button_6,device_commands.Button_7},

stop_action = {0 ,device_commands.Button_7},

stop_value = {nil ,0.5},

i have tried with simplerotary and simpleswitchbutton but nothing works!

in the sim this button never get back to center position, it goes up or down but never stops in middle position even if i place my real switch in middle position.

 

I see this buttons works fine in Helios but i dont know how?

 

another thing i have found is that to open using sim switch it sends button 6 1 to open and 0.5 to stop and button 7 0 to close and 0.5 to stop

Edited by icemaker
Posted

Here are my first pannels :

 

attachment.php?attachmentid=24315&stc=1&d=1297893767

 

the AHCP is not at the good sizes because i dont know the good ones.

but it's fully operational, the elec power is the next to be configured in DCS and then the Fuel Panel.

Posted

As far as I can tell the stop actions are sent when the user releases pressure on the switch. This let's DCS know when the user has stopped clicking and let's the simulation make a decision as to whether to move the switch back. It used on the magnetically held switches as well as momentary switch positions.

 

class  	 = {class_type.TUMB, class_type.BTN},
arg_value   =  {1.0, 0},
arg_lim 	 = {{0.5, 1.0}, {0,0.5}},
									 
action 	 = {device_commands.Button_6, device_commands.Button_7},
stop_action = {0, device_commands.Button_7}, 
stop_value	 = {nil, 0.5},									 
use_release_message = {false, true}}	}

 

For the example you give you have to look at a few other lines to know what to do. Notice that it has two different classes. Left click is TUMB or switch which interprets the arg_value differently than the right click which is treated as a BTN or button.

 

In this scenario when the switch is left click it triggers the thumb class which will trigger button 6 and add the arg_value to the current value and clamp it to the arg_lim. Ultimately in this case left clicking toggles between 0.5 and 1.0 (show behaviors between things are inconsistent). In the case of the right click it will trigger the button class and trigger button 7 which will use the arg_value as the absolute value. In addition the stop action will be triggered when the user releases the mouse button which will trigger button 7 again but this time use the stop_value.

 

To emulate this with SIOC you will have to be able to trigger a different action when exiting the up position vs the down position. So when the switch goes into the up position you need to ultimate call device(x).performClickableAction(3007, 0) and when the switch leaves the up position device(x).performClickableAction(3007, 0.5). Then when the switch enters the down position device(x).performClickableAction(3006, 1) and device(x).performClickableAction(3006, 0.5) when the switch leave the down position.

 

There are other switches where your stop action is a different button than the regular action.

Posted (edited)

Finally it works!

here the new lie to add in siocConfig.lua depending on type of mom button

 

[511] = {OnOffMom, 39, 6, 7, 1} -- For buttons With -1;1 range
[511] = {OnOffMom, 39, 6, 7, 0.5} -- For buttons with 0;1 range

And the code to add in ExportSupport.lua

 

function OnOffMom(pValue, pDevice, pNumber1, pNumber2, pType)
   local pVal, PNumb
   if    pType == 0.5 then
       if    pValue == 1 then
           pNumb = pNumber1
           pVal = 1
       elseif pValue == 2 then
           pNumb = pNumber1
           pVal = 0.5
       elseif pValue == 3 then
           pNumb = pNumber2
           pVal = 0
       else
           pNumb = pNumber2
           pVal = 0.5
       end
   end

   if    pType == 1 then
       if    pValue == 1 then
           pNumb = pNumber1
           pVal = 1
       elseif pValue == 2 then
           pNumb = pNumber1
           pVal = 0
       elseif pValue == 3 then
           pNumb = pNumber2
           pVal = -1
       else
           pNumb = pNumber2
           pVal = 0
       end
   end
   
   GetDevice(pDevice):performClickableAction(pNumb + 3000, pVal)
end

And the code for SIOC

 

Var 0511, name Canopy

Var 1010, name Canopy_Open, Link IOCARD_SW, Input 16
{
 IF &Canopy_Open = 1
 {
   &Canopy = 1    
 }
 IF &Canopy_Open = 0
 {
   &Canopy = 2    
 }
}

Var 1011, name Canopy_Close, Link IOCARD_SW, Input 15
{
 IF &Canopy_Close = 1
 {
   &Canopy = 3    
 }
 IF &Canopy_Close = 0
 {
   &Canopy = 4    
 }
}

Thanks for help gadroc

Edited by icemaker
Posted (edited)

Edited my previous post, i have updated the OnOffMom function.

All my panels works.

EMER FLOOD has been intentionally deactivated in clickabledata so i use it for cdu on off.

Edited by icemaker
  • 5 months later...
Posted

No news for a while so there is some news!!!

 

Finally managed to use servos with DCS thanks to OAKES and his verry good work in LUA that really helped me!

 

Implemented all lamps too but nothing that could be shown at the moment...

Posted (edited)
No news for a while so there is some news!!!

 

Finally managed to use servos with DCS thanks to OAKES and his verry good work in LUA that really helped me!

 

Implemented all lamps too but nothing that could be shown at the moment...

Are you using something like that ?

 

http://www.opencockpits.com/modules.php?name=Content2&pa=showpage&pid=47

 

Check this as well, is the manual. Is in Spanish Language but with the pictures, and diagrams you will understand it.

http://www.andare-ing.com/uploads/Manual_USBServos.pdf

 

Check this too:

 

Edited by juankeiko

---=ONLY ANGELS FLY HIGHER=----[sIGPIC][/sIGPIC]

 

Cuando llegues al final de tu cuerda, haz un nudo y aguanta. Franklin Delano Roosevelt

 

When you reach the end of your rope, tie a knot and hang on. Franklin Delano Roosevelt

:pilotfly::thumbup: Buenos Vuelos-Good flights

Posted
Are you using something like that ?

 

http://www.opencockpits.com/modules.php?name=Content2&pa=showpage&pid=47

 

Check this as well, is the manual. Is in Spanish Language but with the pictures, and diagrams you will understand it.

http://www.andare-ing.com/uploads/Manual_USBServos.pdf

No i use an SSC-32 USB Card that can manage up to 32 Servos but i use SIOC to put and get values from\to DCS.

I have created a program to read from SIOC the desired data then send servo positions to SSC-32 Card. This way i can manage ALL my cockpit gauges from one USB card.

The ligths are managed by 2 opencockpits MasterCards that are used to manage switches and buttons of the cockpit, then the encoders are managed by a Leo Bodnar Card.

Posted

Impressive!!! the gauge stuff... I suppose a full working cockpit will be awesome with such features.

HaF 922, Asus rampage extreme 3 gene, I7 950 with Noctua D14, MSI gtx 460 hawk, G skill 1600 8gb, 1.5 giga samsung HD.

Track IR 5, Hall sensed Cougar, Hall sensed TM RCS TM Warthog(2283), TM MFD, Saitek pro combat rudder, Cougar MFD.

  • 4 weeks later...
  • Recently Browsing   0 members

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