[simpits-tech] milestones...
Gene Buckle
geneb at deltasoft.com
Mon Jun 30 09:15:30 PDT 2008
Yesterday marked another milestone in the development of the cockpit
interface software I'm working on.
The software now not only takes input data from the BI hardware, but now
also works with DirectX input devices.
Here's an example of the Lua code I use to handle the step-up and
step-down of the COMM radios in FlightGear:
-- Testing FREQ_UP and FREQ_DOWN buttons
Com1Freq = CIM:GetStringValue("COM1_FRQ")
if CIM:GetInput("FREQ_DOWN") == true then
repeat
-- do nothing
until CIM:GetInput("FREQ_DOWN") == false
Com1Freq = Com1Freq - .250
CIM:SetStringValue("COM1_FRQ", Com1Freq)
CIM:SetValue(0, "FREQ_DOWN - " .. Com1Freq)
return
end
if CIM:GetInput("FREQ_UP") == true then
repeat
-- do nothing
until CIM:GetInput("FREQ_UP") == false
Com1Freq = Com1Freq + .250
CIM:SetStringValue("COM1_FRQ", Com1Freq)
CIM:SetValue(0, "FREQ_UP - " .. Com1Freq)
return
end
This basically checks to see if there has been an input on one of the
buttons matching the "FREQ_UP" or "FREQ_DOWN" definitions. If it sees
that one has been pressed, it will sit there and wait until the button is
released and then perform the needed action.
The wait-until-release is done because the script executes in its own
thread and would cause a flurry of up or down frequency changes if it
didn't wait for the button to be released.
Full end-to-end communication with FlightGear (http://www.flightgear.org)
is now fully operational. This means that you can pull data from
FlightGear as well as change things within FlightGear.
I've done some initial work with MSFS 10 using version 4 of Peter Dowson's
FSUIPC. I need to spend more time on that this week to get it nailed down
the rest of the way. I'll also take a peek at what it will take to
integrate SimConnect.
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