]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_io.cxx
A new comm radio and atis implementation
[flightgear.git] / src / Main / fg_io.cxx
index cd66cf0c6447a7b689067f5446cc57a286c4f13e..059bb97a23ab55cfdec71a9cd45c75fa19889b66 100644 (file)
@@ -49,9 +49,8 @@
 #include <Network/AV400WSim.hxx>
 #include <Network/garmin.hxx>
 #include <Network/httpd.hxx>
-#ifdef FG_JPEG_SERVER
-#  include <Network/jpg-httpd.hxx>
-#endif
+#include <Network/igc.hxx>
+#include <Network/jpg-httpd.hxx>
 #include <Network/joyclient.hxx>
 #include <Network/jsclient.hxx>
 #include <Network/native.hxx>
@@ -66,7 +65,7 @@
 #include <Network/rul.hxx>
 #include <Network/generic.hxx>
 
-#ifdef FG_HAVE_HLA
+#if FG_HAVE_HLA
 #include <Network/HLA/hla.hxx>
 #endif
 
@@ -147,16 +146,28 @@ FGIO::parse_port_config( const string& config )
         } else if ( protocol == "garmin" ) {
             FGGarmin *garmin = new FGGarmin;
             io = garmin;
+        } else if ( protocol == "igc" ) {
+            IGCProtocol *igc = new IGCProtocol;
+            io = igc;
         } else if ( protocol == "httpd" ) {
             // determine port
             string port = tokens[1];
             return new FGHttpd( atoi(port.c_str()) );
-#ifdef FG_JPEG_SERVER
         } else if ( protocol == "jpg-httpd" ) {
             // determine port
-            string port = tokens[1];
-            return new FGJpegHttpd( atoi(port.c_str()) );
-#endif
+            int port = simgear::strutils::to_int(tokens[1]);
+            int frameHz = 8; // maximum frame rate
+            string type = "jpeg";
+            
+            if (tokens.size() > 2) {
+                frameHz = simgear::strutils::to_int(tokens[2]);
+            }
+            
+            if (tokens.size() > 3) {
+                type = tokens[3];
+            }
+                
+            return new FGJpegHttpd(port, frameHz, type);
         } else if ( protocol == "joyclient" ) {
             FGJoyClient *joyclient = new FGJoyClient;
             io = joyclient;
@@ -224,7 +235,7 @@ FGIO::parse_port_config( const string& config )
 
             return NULL;
         }
-#ifdef FG_HAVE_HLA
+#if FG_HAVE_HLA
         else if ( protocol == "hla" ) {
             return new FGHLA(tokens);
         }