Web Site of Robert John Morton
Navigation Functions: Software Integration
Finally, to bring all these radio environment and navigation control functions in this document all together, they are called from the following overall navigation function which should be called regularly every 200 milliseconds.
As an exercise, this function has been headed as a timer call-back function to be called by a designated system timer within an operating system environment.
WORD FAR PASCAL Nav ( //called every 200 ms
HWND hWnd, //identifies the Nav window
WORD wMsg, //timer message resulting in this call
int nIDEvent, //id number of system timer which made the call
DWORD dwTimer //current system time
StnPoll(); //check rough distance of stations
RxInput(); //scan receiver tuner inputs etc.
TxScan(); //get station signal strengths
//The NAV Rx which is currently switched to the NAV computer
struct RxData *r = *(*(Rx + 4) + Air.Sw);
struct TxData *t = r->t ; //dominant station currently being received
double et = ElapsedTime(); //elapsed time since last pass
if((int Sig = r->Sig) > 0) //if in range of nav station
HorzSteer(t, r, et); //do horizontal (roll) steering
//If it is an ILS or ILS/DME and it is within glideslope range
if(((int st = t->StnType) == 4 || st == 5) && (Sig > 85))
VertSteer(t, r, et); //do vertical (pitch) steering
For this to work you will have to set up the timer in the WM_CREATE case in the application's MainWndProc() as follows:
The following schematic shows the relationships between the 'C' functions which have been discussed in these research project notes.
Circuit Breaker Logic
Within the functions discussed in these notes, many of the computations have been made conditional upon the states of various circuit breakers which control the power supplies to the various elements of the aircraft's on-board equipment. The positioning of these circuit breakers is indicated in the diagram below:
Parent Document |
© 1997 Robert John Morton