[simpits-tech] Hello, hello, hello
Gene Buckle
geneb at deltasoft.com
Tue Jul 22 08:59:03 PDT 2008
>> You'd best spend some time practicing your Mad Lua Skillz, 'cause Cockpit
>> Interface Master is going beta soon. Head over to http://www.lua.org and
>> start yer learnin'. :)
>
> g
>
> Ok so I went to the site.
>
> Do you have some sample code for the Analog Output?
>
Do you mean code for the AC360 gauges? Not yet - I had forgotten to order
interconnect hardware when I first got them and I place the part order
yesterday.
It'll go something like this though:
Airspeed = CIM:GetNumericValue("AIRSPEED")
NeedlePos = CIM:Scale(InMin, InMax, OutMin, OutMax, Airspeed)
CIM:SetGauge("AIRSPEED", NeedlePos)
GetNumericValue() would look up the value that matches the name "AIRSPEED"
in whatever sim you're using and return it.
With MSFS, many of the parameters need to be "adjusted" to get human
readable values out of them. For instance, the IAS data requires that you
divide the result by 128 to get IAS in knots.
To do this, you'd write:
Airspeed = CIM:GetNumericValue("AIRSPEED") / 128
To get a value you could send to a gauge.
For MSFS and X-Plane users, I'm including a helper tool that will show you
what is available to you when you're configuring what data you want to
work with. (Something similar will be available for IL2 & LOMAC users.)
Here's what the MSFS version looks like:
http://www.simpits.org/~geneb/msfs_offset_list_screen.jpg
This is basically used as a quick reference for the user. If you want to
know more about a particular offset than what I show, you'll need to look
at the FSUIPC documentation. Often times more detail can be found there.
Double-clicking on a parameter you want will fill in most of the fields
needed to add that parameter to CIM.
The Scale() routine will provide a good needle position based on the
parameters passed. InMin & InMax would be the input range - for instance
0 to 500Kts. OutMin & OutMax would be the min & max values that the gauge
you're working with could handle.
Note that anything you see that is prefixed with "CIM" means that it's
part of the Lua extentions that CIM provides and not part of Lua itself.
g.
--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
More information about the Simpits-tech
mailing list