]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/props.cxx
Make several assumptions:
[flightgear.git] / src / Network / props.cxx
index ba72a1aeb0bbeaaa06f756e33b97b92bc5bf0b8d..3504f99c8c75115730f0a0584e6e49310d05a8f4 100644 (file)
 
 #include <simgear/compiler.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/misc/commands.hxx>
+#include <simgear/structure/commands.hxx>
 #include <simgear/misc/strutils.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/props/props_io.hxx>
 
-#include STL_STRSTREAM
+#include <sstream>
 
 #include <Main/globals.hxx>
 #include <Main/viewmgr.hxx>
 
 #include "props.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
-SG_USING_STD(strstream);
+SG_USING_STD(stringstream);
 SG_USING_STD(ends);
-#endif
 
 /**
  * Props connection class.
@@ -213,18 +211,18 @@ PropsChannel::foundTerminator()
                push( line.c_str() );
            }
        } else if ( command == "dump" ) {
-           strstream buf;
+           stringstream buf;
            if ( tokens.size() <= 1 ) {
                writeProperties( buf, node );
                buf << ends; // null terminate the string
-               push( buf.str() );
+               push( buf.str().c_str() );
                push( getTerminator() );
            } else {
                SGPropertyNode *child = node->getNode( tokens[1].c_str() );
                if ( child ) {
                    writeProperties ( buf, child );
                    buf << ends; // null terminate the string
-                   push( buf.str() );
+                   push( buf.str().c_str() );
                    push( getTerminator() );
                } else {
                    node_not_found_error( tokens[1] );
@@ -332,6 +330,30 @@ PropsChannel::foundTerminator()
                             = args.getNode("subsystem", i-2, true);
                         node->setStringValue( tokens[i].c_str() );
                     }
+                } else if ( tokens[1] == "set-sea-level-air-temp-degc" ) {
+                    for ( unsigned int i = 2; i < tokens.size(); ++i ) {
+                        cout << "props: set-sl command = " << tokens[i]
+                             << endl;
+                        SGPropertyNode *node
+                            = args.getNode("temp-degc", i-2, true);
+                        node->setStringValue( tokens[i].c_str() );
+                    }
+                } else if ( tokens[1] == "set-outside-air-temp-degc" ) {
+                    for ( unsigned int i = 2; i < tokens.size(); ++i ) {
+                        cout << "props: set-oat command = " << tokens[i]
+                             << endl;
+                        SGPropertyNode *node
+                            = args.getNode("temp-degc", i-2, true);
+                        node->setStringValue( tokens[i].c_str() );
+                    }
+                } else if ( tokens[1] == "timeofday" ) {
+                    for ( unsigned int i = 2; i < tokens.size(); ++i ) {
+                        cout << "props: time of day command = " << tokens[i]
+                             << endl;
+                        SGPropertyNode *node
+                            = args.getNode("timeofday", i-2, true);
+                        node->setStringValue( tokens[i].c_str() );
+                    }
                 }
                 if ( !globals->get_commands()
                          ->execute(tokens[1].c_str(), &args) )
@@ -462,6 +484,7 @@ FGProps::open()
 bool
 FGProps::close()
 {
+    SG_LOG( SG_IO, SG_INFO, "closing FGProps" );   
     return true;
 }