• 热门标签

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

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

evaluates to “false” <label2> will be executed. If there is no “else” condition, a
43
“RETURN” is assumed. If the “call” or “jump” is missing, a “call” is assumed.
Example:
if(testByte > 5) jump Function1; else jump Function2;
if(testByte == testWord) Function1; //call Function1 if the
comparison is equal otherwise execute next line.
if(<datatype>) call/jump <label1>; else call/jump <label2>;
With this command, if the comparison evaluates to “true”, <label1> will be executed.
If the comparison evaluates to “false” <label2> will be executed.
Example:
If(testFlag) jump Function1; // will jump to Function1 if testFlag is true.
If(!testFlag) jump Function2; //will jump to Function2 if testFlag is false
delay(<delay>);
This command will cause the EPIC to pause all execution for <delay> * 20ms,
before continuing. All loops should include some sort of delay or else real-time
interlacing will NOT occur and multiple functions will not be executed. The delay
does not have to encompass the whole function execution time unless it is fairly
endless. Example:
:notendless{
keyhit(1);
delay(2);
loop--;
if(loop) jump notendless;
}
This code would be ok if the variable “loop” was not too large a value. The problem
is that the key buffer is being loaded faster than unloaded and could overflow if we
execute this code too fast and too many keys are sent. Example2:
:endless{
keyhit(1);
delay(2) ;
ifactive(M0R0B0) RETURN; else jump endless;
}
This loop would go on until the key 0 was hit and would overflow the buffer (if
interkey = 40ms and postkey = 30ms) since a key takes 70ms total for each key to
get out and the keyboard buffer is being loaded with a key (plus delays) every 40ms
or about 2 key entries for every key sent. A delay of about 4 (80ms) per key hit in a
loop would be safe.
call(<label>);
This command causes execution to transfer to the referenced procedure block
<label>, then return after that procedure block completes. It is possible to recurse,
i.e. for a procedure block to call itself if needed.
jump(<label>);
44
This command will cause execution to transfer to the procedure block <label>;
however, execution does not return after that procedure block completes. It is
possible to “jump” to the start of the procedure block that is currently being
executed; in this case, execution begins again at the first command in the
procedure block.
setmaxdelta(<channel>,<maxDelta>);
maxDelta range 1-255
This command sets the maximum analog change rate per unit of time. This has the
effect of forcing the analog to change at a constant <maxDelta> rate if the physical
analog has moved at a greater rate than the <maxDelta> limit. This is good for
controlling aiming in programs (such as Mechwarrior) where the analog must be
moved fast to position, then slowed down to fine tune. Example:
:aim{setmaxdelta(mydevice.torso,1)} ;slow move
:no_aim{setmaxdelta(mydevice.torso,0xFF)} ;fast move
definebutton(M0R1B0,on,aim)
definebutton(M0R1B0,off,no_aim)
Queue commands
Queue commands will be sent to the host computer through the PC USB interface.
See appropriate program or interface documentation for meaning of values.
enque|nq(<event index#>,ON/OFF);
This command will send event <event Index#> (0-255) to the PC program, with an
ON or OFF code. Event <event Index#> is a value that the program must interpret.
An example event could be 5 as the gear control, ON code is gear up, OFF code is
gear down:
:gear_up{enque(5,ON)};
:gear_down{enque(5,OFF)};
enque16|nqw(<event #>,<data>);
This command will send event <event#> to the PC program, with <data> which
must be a valid data type for the <event#>. The event <event #> must be in the
range of 0-1023 and <data> must be 16 bit data. The <data> can be any datatype.
For example, for a given event# which equals BtnOn, BtnOff, or BtnP,
deviceName.buttonName = “on, off, or pulse”; can be used as the <data>.
example:
APevents. AP_APR_HOLD = pulse; will send a pulse event.
setenqueuerow|nqrow(<scanrow>) ;
This command will report any changes on a <scanrow> to the PC program.
OUTPUT MODULE COMMANDS
SENDDATA|SD(<module>,<row>,<data>);
45
This command sends raw <data> to <module> <row> (updates internal image).
 
中国航空网 www.aero.cn
航空翻译 www.aviation.cn
本文链接地址:航空资料18(13)