Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
  Latest info can be found on the YaBB Chat and Support Community.

FFDS Home | TIPS Section | Tutorials Section | Resources Section | Utilities Section

Military | FSDS | Jetliners | Real Planes Section | Gmax | Rotorcraft | Business | Civilian

  HomeHelpSearchLoginRegister  
 
 
Page Index Toggle Pages: 1
Send Topic Print
XML - Mechanical Digits Transponder Display (Read 1043 times)
14th Mar, 2011 at 7:12pm

Fr. Bill   Offline
YaBB Moderator
I used to have a life:
now I have GMax...
Hammond, IN

Gender: male
Posts: 5426
*****
 
The following are four XML scripts for controlling/displaying a transponder code with mechanical (drum) type displays.

Each drum is keyframe animated from 0 to 9 (10 steps). Since the transponder code is returned from FS in BCD16 format, we need to strip out each of the four digits of the number so we can animate each drum individually.

The prototype for this is:

(A:TRANSPONDER1 CODE, BCO16)
nn
>> 15 &


where
nn
represents the 4 bytes we wish to be returned. The highest 4 bytes would be 12, the next 4 bytes would be 8, the next 4 bytes would be 4, and the final 4 bytes would be 0 (or nothing at all).

I've also set up the mouse to work for left/right click and the wheel.

Code:
 <PartInfo>
  <Name>T38_Xpdr_1000s</Name>
  <AnimLength>10</AnimLength>
  <Animation>
  <Parameter>
   <Code>
    (A:TRANSPONDER1 CODE, BCO16) 12 >> 15 &amp;
   </Code>
  </Parameter>
  </Animation>
  <MouseRect>
  <Cursor>Hand</Cursor>
  <TooltipID>TOOLTIPTEXT_TRANSPONDER_ID</TooltipID>
  <MouseFlags>LeftSingle+RightSingle+Wheel</MouseFlags>
  <CallbackCode>
   (M:Event) 'RightSingle' scmp 0 ==
   if{ (>K:XPNDR_1000_INC) }
   (M:Event) 'LeftSingle' scmp 0 ==
   if{ (>K:XPNDR_1000_DEC) }
   (M:Event) 'WheelUp' scmp 0 ==
   if{ (>K:XPNDR_1000_INC) }
   (M:Event) 'WheelDown' scmp 0 ==
   if{ (>K:XPNDR_1000_DEC) }
   1 (>L:XMLSND1,bool)
  </CallbackCode>
  </MouseRect>
 </PartInfo>

 <PartInfo>
  <Name>T38_Xpdr_100s</Name>
  <AnimLength>10</AnimLength>
  <Animation>
  <Parameter>
   <Code>
    (A:TRANSPONDER1 CODE, BCO16) 8 >> 15 &amp;
   </Code>
  </Parameter>
  </Animation>
  <MouseRect>
  <Cursor>Hand</Cursor>
  <TooltipID>TOOLTIPTEXT_TRANSPONDER_ID</TooltipID>
  <MouseFlags>LeftSingle+RightSingle+Wheel</MouseFlags>
  <CallbackCode>
   (M:Event) 'RightSingle' scmp 0 ==
   if{ (>K:XPNDR_100_INC) }
   (M:Event) 'LeftSingle' scmp 0 ==
   if{ (>K:XPNDR_100_DEC) }
   (M:Event) 'WheelUp' scmp 0 ==
   if{ (>K:XPNDR_100_INC) }
   (M:Event) 'WheelDown' scmp 0 ==
   if{ (>K:XPNDR_100_DEC) }
   1 (>L:XMLSND1,bool)
  </CallbackCode>
  </MouseRect>
 </PartInfo>

 <PartInfo>
  <Name>T38_Xpdr_10s</Name>
  <AnimLength>10</AnimLength>
  <Animation>
  <Parameter>
   <Code>
    (A:TRANSPONDER1 CODE, BCO16) 4 >> 15 &amp;
   </Code>
  </Parameter>
  </Animation>
  <MouseRect>
  <Cursor>Hand</Cursor>
  <TooltipID>TOOLTIPTEXT_TRANSPONDER_ID</TooltipID>
  <MouseFlags>LeftSingle+RightSingle+Wheel</MouseFlags>
  <CallbackCode>
   (M:Event) 'RightSingle' scmp 0 ==
   if{ (>K:XPNDR_10_INC) }
   (M:Event) 'LeftSingle' scmp 0 ==
   if{ (>K:XPNDR_10_DEC) }
   (M:Event) 'WheelUp' scmp 0 ==
   if{ (>K:XPNDR_10_INC) }
   (M:Event) 'WheelDown' scmp 0 ==
   if{ (>K:XPNDR_10_DEC) }
   1 (>L:XMLSND1,bool)
  </CallbackCode>
  </MouseRect>
 </PartInfo>

 <PartInfo>
  <Name>T38_Xpdr_1s</Name>
  <AnimLength>10</AnimLength>
  <Animation>
  <Parameter>
   <Code>
    (A:TRANSPONDER1 CODE, BCO16) 15 &amp;
   </Code>
  </Parameter>
  </Animation>
  <MouseRect>
  <Cursor>Hand</Cursor>
  <TooltipID>TOOLTIPTEXT_TRANSPONDER_ID</TooltipID>
  <MouseFlags>LeftSingle+RightSingle+Wheel</MouseFlags>
  <CallbackCode>
   (M:Event) 'RightSingle' scmp 0 ==
   if{ (>K:XPNDR_1_INC) }
   (M:Event) 'LeftSingle' scmp 0 ==
   if{ (>K:XPNDR_1_DEC) }
   (M:Event) 'WheelUp' scmp 0 ==
   if{ (>K:XPNDR_1_INC) }
   (M:Event) 'WheelDown' scmp 0 ==
   if{ (>K:XPNDR_1_DEC) }
   1 (>L:XMLSND1,bool)
  </CallbackCode>
  </MouseRect>
 </PartInfo>
 

 

Fr. Bill
Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4 GB DDRII Crucial PC6400-500 GB SATA-ATI Radeon HD2400 Pro 256MB
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print