APPROACH,
DEPARTURE,
ENROUTE
-};
+};
+
+const int ATC_NUM_TYPES = 7;
// DCL - new experimental ATC data store
struct ATCData {
double length; // In *METERS*
double width; // ditto
string rwyID;
+ int patternDirection; // -1 for left, 1 for right
};
ostream& operator << (ostream& os, atc_type atc);
// Run the internal calculations
// Derived classes should call this method from their own Update methods if they
// wish to use the response timer functionality.
- void Update(double dt);
+ virtual void Update(double dt);
+
+ // Recieve a coded callback from the ATC menu system based on the user's selection
+ virtual void ReceiveUserCallback(int code);
// Add plane to a stack
virtual void AddPlane(string pid);
// Indicate that this instance should not output to the display
virtual void SetNoDisplay();
+ // Generate the text of a message from its parameters and the current context.
+ virtual string GenText(const string& m, int c);
+
// Returns true if OK to transmit on this frequency
inline bool GetFreqClear() { return freqClear; }
// Indicate that the frequency is in use
- inline void SetFreqInUse() { freqClear = false; }
+ inline void SetFreqInUse() { freqClear = false; receiving = true; }
// Transmission to the ATC is finished and a response is required
void SetResponseReqd(string rid);
+ // Transmission finished - let ATC decide if a response is reqd and clear freq if necessary
+ void NotifyTransmissionFinished(string rid);
+ // Transmission finished and no response required
+ inline void ReleaseFreq() { freqClear = true; receiving = false; } // TODO - check that the plane releasing the freq is the right one etc.
// The above 3 funcs under development!!
// The idea is that AI traffic or the user ATC dialog box calls FreqInUse() when they begin transmitting,
// and that the tower control sets freqClear back to true following a reply.
FGATCVoice* vPtr;
bool freqClear; // Flag to indicate if the frequency is clear of ongoing dialog
+ bool receiving; // Flag to indicate we are receiving a transmission
bool responseReqd; // Flag to indicate we should be responding to a request/report
+ bool runResponseCounter; // Flag to indicate the response counter should be run
double responseTime; // Time to take from end of request transmission to beginning of response
// The idea is that this will be slightly random.
double responseCounter; // counter to implement the above
a.name = "";
fin >> ch;
- a.name += ch;
+ if(ch != '"') a.name += ch;
while(1) {
//in >> noskipws
fin.unsetf(ios::skipws);
fin >> ch;
- a.name += ch;
if((ch == '"') || (ch == 0x0A)) {
break;
} // we shouldn't need the 0x0A but it makes a nice safely in case someone leaves off the "
+ a.name += ch;
}
fin.setf(ios::skipws);
//cout << "Comm name = " << a.name << '\n';