n4gix
Resource contributor
- Messages
- 11,674
- Country

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.
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 &
</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 &
</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 &
</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 &
</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>




