This knob is supposed to initialise the INS longitude of the A/C. It is supposed to decrease with LClick/Wheel and increase with RClick/Wheel.
The degrees are going from -180 to +180, and MOA from 0-60 for positive degrees, -60 to 0 for negatives.
The problem I'm having is in the RightSingle operation (first section):
When the input is 179deg 59MOA and I increase, it goes to 180o 0'. But after that, it doesn't switch to -180o 0'. Instead it increases to 180o 1'. Also, the animated drums don't animate, although the L:vars produce a result in the 2D debugging gauge I have. Any ideas?
The degrees are going from -180 to +180, and MOA from 0-60 for positive degrees, -60 to 0 for negatives.
The problem I'm having is in the RightSingle operation (first section):
When the input is 179deg 59MOA and I increase, it goes to 180o 0'. But after that, it doesn't switch to -180o 0'. Instead it increases to 180o 1'. Also, the animated drums don't animate, although the L:vars produce a result in the 2D debugging gauge I have. Any ideas?
Code:
<PartInfo>
<Name>ASN-39_long_knob</Name>
<AnimLength>360</AnimLength>
<Animation>
<Parameter>
<Code>
(L:ASN-39_Long_knob, number)
</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<MouseFlags>LeftSingle+RightSingle+Wheel+DownRepeat</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
(M:Event) 'WheelDown' scmp 0 == or if{
(L:ASN-39_Long_knob, number) -- 0 max (>L:ASN-39_Long_knob, number)
(L:ASN-39_Long_knob, number) 0 == if{ 360 (>L:ASN-39_Long_knob, number) }
(L:F4_Long_deg, number) 0 > if{
(L:F4_Long_moa, number) -- 0 max (>L:F4_Long_moa, number)
(L:F4_Long_moa, number) 1 < if{
(L:F4_Long_deg, number) -- 0 max (>L:F4_Long_deg, number)
59 (>L:F4_Long_moa, number)
}
}
(L:F4_Long_deg, number) 0 == if{
(L:F4_Long_moa, number) -- -60 max (>L:F4_Long_moa, number)
(L:F4_Long_moa, number) -59 < if{
(L:F4_Long_deg, number) 1 - (>L:F4_Long_deg, number)
0 (>L:F4_Long_moa, number)
}
}
(L:F4_Long_deg, number) 0 < if{
(L:F4_Long_moa, number) -- -60 max (>L:F4_Long_moa, number)
(L:F4_Long_moa, number) -59 < if{
(L:F4_Long_deg, number) -- -180 max (>L:F4_Long_deg, number)
0 (>L:F4_Long_moa, number)
(L:F4_Long_deg, number) -180 == (L:F4_Long_moa, number) 0 == and if{ 180 (>L:F4_Long_deg, number) }
}
}
}
(M:Event) 'RightSingle' scmp 0 ==
(M:Event) 'WheelUp' scmp 0 == or if{
(L:ASN-39_Long_knob, number) ++ 360 min (>L:ASN-39_Long_knob, number)
(L:ASN-39_Long_knob, number) 360 == if{ 0 (>L:ASN-39_Long_knob, number) }
(L:F4_Long_deg, number) 0 > if{
(L:F4_Long_moa, number) ++ 60 min (>L:F4_Long_moa, number)
(L:F4_Long_moa, number) 59 > if{
(L:F4_Long_deg, number) ++ 180 min (>L:F4_Long_deg, number)
0 (>L:F4_Long_moa, number)
(L:F4_Long_deg, number) 179 >= (L:F4_Long_moa, number) 59 > and if{ -180 (>L:F4_Long_deg, number) 0 (>L:F4_Long_moa, number) }
}
}
(L:F4_Long_deg, number) 0 == if{
(L:F4_Long_moa, number) ++ 60 min (>L:F4_Long_moa, number)
(L:F4_Long_moa, number) 59 > if{
(L:F4_Long_deg, number) 1 + (>L:F4_Long_deg, number)
0 (>L:F4_Long_moa, number)
}
}
(L:F4_Long_deg, number) 0 < if{
(L:F4_Long_moa, number) ++ 0 min (>L:F4_Long_moa, number)
(L:F4_Long_moa, number) -1 > if{
(L:F4_Long_deg, number) ++ 0 max (>L:F4_Long_deg, number)
-59 (>L:F4_Long_moa, number)
}
}
}
</CallbackCode>
</MouseRect>
</PartInfo>
Last edited:


