July 24, 200817 yr Moderator 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... ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 24, 200817 yr 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..." Jan "Beatus ille qui procul negotiis..."
July 24, 200817 yr 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. Paul EGLD
July 24, 200817 yr Moderator 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; } } Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
July 25, 200817 yr Author 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 FS RTWR SHRS F-111 JoinFS Little Navmap
Create an account or sign in to comment