Archived

This topic is now archived and is closed to further replies.

spokes2112

Direct Tune of COM1 Standby, etc.

Recommended Posts

I am designing an RTU4200 control head.There are two of 'em used, one strapped for COM1/NAV1 and another strapped for COM2/NAV2.FS stock key_events only allow for direct tuning of either COM1 (active) OR COM1 Standby frequency, depending on how the radio section of the aircraft.cfg is set up.I need to be able to tune the COM1 Standby directly...I'm thinking that I should be able to use the KEY_COM_STBY_RADIO_SET event to do the deed, based on the contents of my own, custom "tuning variable" but haven't been successful so far...I'm open for suggestions... ;)

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Fr. Bill,Did you try the Horner Schedule?(See FAQ Arne Bartels)XMLany frequency100 * 10000 % intd 10 % r 10 / intd 10 % r 10 / intd 10 % r 10 / int16 * +16 * +16 * +(>K:COM_STBY_RADIO_SET)Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi Bill (L:SetValue, number) 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:COM_STBY_RADIO_SET) Maybe this is what you need, It works OK for me.

Share this post


Link to post
Share on other sites

Thanks for the suggestions. Actually, I have managed to do the deed in C using a combination of bits and pieces from other code I've already written...The main problem was that I couldn't remember just what I'd written a year ago, and scratched my head wondering "Now why did it do that..." :-lol What makes it rather complex is that the same knob is used for all tuning functions, and what the outer and inner knob do is based on what LSK happens to be selected...Plus, the knob has to account for 'rollover' when reaching the upper or lower limits, which of course is different for COM and NAV frequencies...Anyway, I think it's done now... :)For example, NAV1 Standby direct tuning of decimals:if ( rtu_lsk1 == 6 ) { if (rtu_innerknob1 == 1 && NAV_stby < 117.95) { NAV_stby = NAV_stby + 0.025; trigger_key_event (KEY_NAV1_STBY_SET,Dec2Bcd((NAV_stby - 100)*100)); rtu_innerknob1 = 0; } else if (rtu_innerknob1 == 1 ) { NAV_stby = 118.00 ; trigger_key_event (KEY_NAV1_STBY_SET,Dec2Bcd((NAV_stby - 100)*100)); rtu_innerknob1 = 0; } if (rtu_innerknob1 == -1 && NAV_stby > 108.00) { NAV_stby = NAV_stby - 0.025; trigger_key_event (KEY_NAV1_STBY_SET,Dec2Bcd((NAV_stby - 100)*100)); rtu_innerknob1 = 0; } else if (rtu_innerknob1 == -1 ) { NAV_stby = 136.975 ; trigger_key_event (KEY_NAV1_STBY_SET,Dec2Bcd((NAV_stby - 100)*100)); rtu_innerknob1 = 0; } }

Share this post


Link to post
Share on other sites

The main problem was that I couldn't remember just what I'dwritten a year ago, and scratched my head wondering "Nowwhy did it do that..." :-lol Bill, don't scratch too hard... It could get infected.. :-lolI just had to............ :-beerchug Roman

Share this post


Link to post
Share on other sites