• 热门标签

当前位置: 主页 > 航空资料 > 国外资料 >

时间:2010-08-18 09:13来源:蓝天飞行翻译 作者:admin
曝光台 注意防骗 网曝天猫店富美金盛家居专营店坑蒙拐骗欺诈消费者

Direct Input.
connector(<name>)
This device descriptor associates analogs and module and rows (modrows) with a
connector. The elements in this list are relative; therefore, the first analog in the list
is 0, the second 1, etc. The same relative ordering is true for modrows. You must
define devices with axes, buttons, and POVs before devices with no buttons, axes,
or POVs.Example:
connector(mod1)
{
analog(<input analog number>);
modrow(<module number>,<row number>);
};
device(<name>)
This device descriptor establishes a device <name> that connectors can be
attached to. Below is the syntax that may follow the device<name>:
connector(<connector name>);
analog(<relative analog>,<name>,<WinAxis>,[type],[source],[min],[max]);
If this is a relative analog then the virtual axis is not associated with connector. For
a real axis the defaults for type are Analog8, source=0, min=0, max = 255(0xFF).
For WinAxis = X,Y,Z,,Rx,Ry,Rz ,Slider,Dial,Wheel for Gaming Options axis.??????
button(<relative mod,row>,<bit>,<name>);
toggle(row, start-bit, name, num_bits, num_positions, ["all_off",] "bit0", "bit1" ...);
If the num_positions > num_bits then "all_off" must be specified.
hat4(<relative mod,row>,<up bit>,<down bit>,<left bit>,<right bit>,<name>);
output(<name>,<module>,<row>) ;
A row can be broken into bits or a combination of bits.
output(<name>,<module>,<row>) {<name> = <bit definitions>; <name>=<bit
definitions>;}; Example:
output(leds1,3,13){ //a row of output points on
//module 3 row 13.
rightLEDred = 0x08; //right gear led red assigned to bit 3
rightLEDgrn = 0x10;
51
noseLEDred = 0x20;
noseLEDgrn = 0x40;
leftLEDred = 0x80; //left gear led red assigned to bit 7
};
In the source file to turn on the above: Mydevice0.leds1.rightLEDred = on;
to turn off that led Mydevice0.leds1.rightLEDred = off;
To turn off the whole row: Mydevice0.leds1 = 0;
To test an output point for being on:
if(Mydevice0.leds1.rightLEDred) { if “on” execute this} else {if “off” execute this}
or
if(!Mydevice0.leds1.rightLEDred) {if “off” execute this} else {if “on” execute this}
The following are not associated with the “connector”.
pov(<point of view name>);
display(<name>,<module>,<start digit>,<format>,<DP type flag>);};
deviceName.displayName = blank;
Allows displays to be blanked.
deviceName.displayName = dash; //for module 2 type displays
// 32 digit display modules
Allows displays to be dashed.
deviceName.displayName = Edash; //for KR1 radio displays
Allows KR1 radio displays to be dashed.
21
Part 5: Sample Pigeonhole Code
5.1 C++ software to interface to Pigeon Holes and Q-Procs
5.1.1 Generic Pigeon Hole code
The EPIC “_SendPH” command is used to send data to EPIC. The SendPH
command comes in two forms and uses a handle to identify which EPIC device
you’re talking to, identified which Pigeonhole you want to send data to and allows
you to send 2-16bit words or 4-8 bit bytes (32 bits total).
Since the lights of an Output Module are represented by individual bits, we have to
provide the data in a special way to ensure we can command the correct bits. To
accomplish this task using 4-8 bit bytes, we “AND” the set of bits we’re interested in
and shift them to the correct position. As an example, for the 3rd byte of data, we
must define it as a UCHAR and logically “AND” (“&”) it with 0xFF0000 and shift it to
the 3rd byte position “()>>16”.
Below is the _SendPH command for sending 4-8 bit bytes to EPIC:
_SendPH(handle,PHnum,(UCHAR)(tempLight&0xFF),(UCHAR)((tempLight&0xFF0
0)>>8),(UCHAR)((tempLight&0xFF0000)>>16),(UCHAR)((tempLight&0xFF000000)
>>24));
_GetData(handle);
Since the current EPIC code does not start sending data automatically, we’re using
the _GetData command to force EPIC to start the data transfer.
_GetData(handle); //Temporary fix of a bug in EPIC
Of course there is additional code you need so I’ve included my entire Memory
Reader project below that’s shows how I interface to Falcon4.
5.1.2 Generic Q-Proc code
To be provided in a later update.
21
5.1.3 Falcon4SP3 Memory Reader: JAMmemreader Project
//Legal Stuff: The following is provided free to non-commercial simbuilders
 
中国航空网 www.aero.cn
航空翻译 www.aviation.cn
本文链接地址:航空资料18(16)