]> git.mxchange.org Git - flightgear.git/commitdiff
emit to different message properties:
authormfranz <mfranz>
Tue, 7 Feb 2006 22:35:22 +0000 (22:35 +0000)
committermfranz <mfranz>
Tue, 7 Feb 2006 22:35:22 +0000 (22:35 +0000)
/sim/messages/{atc,pilot,ai-plane,ground,approach}
These can the be used for differenct screen.log colors and for different
voices. (Aircraft & tutoruals may want to write to /sim/messages/copilot)

src/ATC/AIPlane.cxx
src/ATC/ATC.cxx
src/ATC/ATCDialog.cxx
src/ATC/ATCdisplay.cxx
src/ATC/approach.cxx
src/ATC/approach.hxx
src/ATC/ground.cxx

index a20bffcb35426dea8722c4b9569fcf0ac24f4258..3bcb4e5482d073c4f79a9b1984256782e9c025d6 100644 (file)
@@ -182,6 +182,7 @@ void FGAIPlane::ProcessCallback(int code) {
 // The refname is a string to identify this sample to the sound manager
 // The repeating flag indicates whether the message should be repeated continuously or played once.
 void FGAIPlane::Render(const string& refname, bool repeating) {
+       fgSetString("/sim/messages/ai-plane", pending_transmission.c_str());
 #ifdef ENABLE_AUDIO_SUPPORT
        voice = (voiceOK && fgGetBool("/sim/sound/voice"));
        if(voice) {
index 1301a54252926900c38f7ca4aacf7fbfab80ca12..973783aab80c7d55e0acdfe28d22f4c4a7d4d159 100644 (file)
@@ -225,6 +225,7 @@ void FGATC::SetData(ATCData* d) {
 // The refname is a string to identify this sample to the sound manager
 // The repeating flag indicates whether the message should be repeated continuously or played once.
 void FGATC::Render(string& msg, const string& refname, bool repeating) {
+       fgSetString("/sim/messages/atc", msg.c_str());
        #ifdef ENABLE_AUDIO_SUPPORT
        _voice = (_voiceOK && fgGetBool("/sim/sound/voice"));
        if(_voice) {
index b54679d5cdb1a6ea3755b0c3c6582bcc5466986d..d24b1b0249dc170bca68b7f5fe89cff3a2c63429 100644 (file)
@@ -268,8 +268,10 @@ void FGATCDialog::PopupCallback(int num) {
                        //cout << "Doing callback...\n";
                        ATCMenuEntry a = atcmlist[num];
                        atcptr->SetFreqInUse();
+                       string pilot = atcptr->GenText(a.transmission, a.callback_code);
+                       fgSetString("/sim/messages/pilot", pilot.c_str());
                        // This is the user's speech getting displayed.
-                       globals->get_ATC_display()->RegisterSingleMessage(atcptr->GenText(a.transmission, a.callback_code));
+                       globals->get_ATC_display()->RegisterSingleMessage(pilot);
                        _callbackPending = true;
                        _callbackTimer = 0.0;
                        _callbackWait = 5.0;
index 4d5fe97351ce16b6980e6e998e5d3205e9921791..cd05ca4d08f5de330a8f09a09168f2fb3c142bc8 100644 (file)
@@ -215,14 +215,12 @@ void FGATCDisplay::RegisterSingleMessage(const string& msg, double delay) {
        m.dsp_offset = 0.0;
        
        msgList.push_back(m);
-       fgSetString("/sim/messages/atc", msg.c_str());
        //cout << "Single message registered\n";
 }
 
 void FGATCDisplay::RegisterRepeatingMessage(const string& msg) {
        rep_msg = true;
        rep_msg_str = msg;
-       fgSetString("/sim/messages/atc", msg.c_str());
        return;
 }
 
index 0d46355a31a32be0bc160d29102da00545626d3a..110bf61b86b845d577c272f12991283d1cf398fc 100644 (file)
@@ -179,7 +179,7 @@ void FGApproach::Update(double dt) {
                                tpars.alt = planes[i].aalt;
                                message = current_transmissionlist->gen_text(station, code, tpars, true );
                                //cout << message << '\n';
-                               globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
+                               set_message(message);
                                planes[i].lmc = code;
                                planes[i].tlm = etime_node->getDoubleValue();
                                planes[i].on_crs = true;
@@ -237,8 +237,7 @@ void FGApproach::Update(double dt) {
                                        message = current_transmissionlist->gen_text(station, code, tpars, true );
                                        //cout << "Approach transmitting...\n";
                                        //cout << message << endl;
-                                       globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
-                                       
+                                       set_message(message);
                                }
                                else {
                                        code.c1 = 1;
@@ -248,7 +247,7 @@ void FGApproach::Update(double dt) {
                                        message = current_transmissionlist->gen_text(station, code, tpars, true);
                                        //cout << "Approach transmitting 2 ...\n";
                                        //cout << message << endl;
-                                       globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
+                                       set_message(message);
                                }
                                planes[i].lmc = code;
                                planes[i].tlm = etime_node->getDoubleValue();
@@ -295,7 +294,7 @@ void FGApproach::Update(double dt) {
                                        message = current_transmissionlist->gen_text(station, code, tpars, true);
                                        //cout << "Approach transmitting 3 ...\n";
                                        //cout << message << '\n';
-                                       globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
+                                       set_message(message);
                                        planes[i].lmc = code;
                                        planes[i].tlm = etime_node->getDoubleValue();
                                }
@@ -325,7 +324,7 @@ void FGApproach::Update(double dt) {
                                        message = current_transmissionlist->gen_text(station, code, tpars, true);
                                        //cout << "Approach transmitting 4 ...\n";
                                        //cout << message << '\n';
-                                       globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
+                                       set_message(message);
                                        planes[i].lmc = code;
                                        planes[i].tlm = etime_node->getDoubleValue();
                                        
@@ -352,7 +351,7 @@ void FGApproach::Update(double dt) {
                                message = current_transmissionlist->gen_text(station, code, tpars, true);
                                //cout << "Approach transmitting 5 ...\n";
                                //cout << message << '\n';
-                               globals->get_ATC_display()->RegisterSingleMessage( message, 0 );
+                               set_message(message);
                                planes[i].lmc = code;
                                planes[i].tlm = etime_node->getDoubleValue();
                                
@@ -752,3 +751,11 @@ int FGApproach::RemovePlane() {
 
   return num_planes;
 }
+
+
+void FGApproach::set_message(const string &msg)
+{
+  fgSetString("/sim/messages/approach", msg.c_str());
+  globals->get_ATC_display()->RegisterSingleMessage( msg, 0 );
+}
+
index 282f0c4bdc94308299d33a87336d758b249aa027..9109e45210b6c5ecb4c1fccc4f699c0ea6ff27b2 100644 (file)
@@ -176,6 +176,8 @@ private:
 
   double angle_diff_deg( const double &a1, const double &a2);
 
+  void set_message(const string &s);
+
 // ========================================================================
 // get point2 given starting point1 and course and distance
 // input:  point1 = heading in degrees, distance
index de018cae663eafa67ea0dde33dfc827898fffe7e..ebd172d2319731508187897d9403e51540bab321 100644 (file)
@@ -320,6 +320,7 @@ void FGGround::Update(double dt) {
                                // eg " taxi holding point G2 runway "
                                trns += ConvertRwyNumToSpokenString(activeRwy);
                                if(_display) {
+                                       fgSetString("/sim/messages/ground", trns.c_str());
                                        globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
                                }
                                g->planePtr->RegisterTransmission(1);   // cleared to taxi
@@ -338,6 +339,7 @@ void FGGround::Update(double dt) {
                        sprintf(buf, "%.2f", f);
                        trns += buf;
                        if(_display) {
+                               fgSetString("/sim/messages/ground", trns.c_str());
                                globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
                        }
                        g->planePtr->RegisterTransmission(2);   // contact tower