Alex Posted April 6, 2010 Report Share Posted April 6, 2010 Hi All. I am currently setting up a VA for an airline that runs on a simulator other than msfs or xplane. It is FlightGear which is a free open source sim. It's not quite upto all the bells and whistles that the aforementioned sims have, but i want to provide a top notch va for the community there. FlightGear has its own multiplayer servers and a flight can be tracked via these, so i would like to know if the Acars systems can be adapted to point to servers other than msfs etc? Where would i begin looking? i have very limited programming skills unfortunately.. Thanks Alex Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 6, 2010 Administrators Report Share Posted April 6, 2010 Not to my knowledge, but others might know. phpVMS doesn't care what the client is - xacars works with xplane Quote Link to comment Share on other sites More sharing options...
Alex Posted April 6, 2010 Author Report Share Posted April 6, 2010 Nabeel, FlightGear is extensively xml based, so do you think it would be feasibly possible to do? Being open source and GPL licenced all the source code for the tracking system is available. Source Available Here Do-able? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 6, 2010 Administrators Report Share Posted April 6, 2010 Is there an ACARS client/can you tell it where to send status updates/PIREPs? Either case, yes, it would be do-able. You just have to write the module for phpVMS to do it, which is straight-forward for the most part. Quote Link to comment Share on other sites More sharing options...
Alex Posted April 7, 2010 Author Report Share Posted April 7, 2010 Can you explain to me what you mean by "client", do you mean a program which collects the required data from the Simulator and stores it as an xml file at any given time? If so not at the moment sofar as i am aware, All the data is there, it's just how do i go about capturing it and posting it? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 7, 2010 Administrators Report Share Posted April 7, 2010 Can you explain to me what you mean by "client", do you mean a program which collects the required data from the Simulator and stores it as an xml file at any given time? If so not at the moment sofar as i am aware, All the data is there, it's just how do i go about capturing it and posting it? Yes, exactly. Like kACARS or FSFK which run in the background collecting data from FS and sending it off to phpVMS Quote Link to comment Share on other sites More sharing options...
Alex Posted April 7, 2010 Author Report Share Posted April 7, 2010 collecting data from FS and sending it off to phpVMS Thats the part i need the assistance with. If i had an xml file which had all the required data, what information do i need. I know these are real newby questions, so please bear with me,(i have never used any MSFS or other flightsim software so it's all new) i'm trying to ask the questions so they make sense. It's always much easier knowing it in your head, but to transpose that onto a forum is much more difficult. OK, so my aircraft is online in multiplayer,connected to the FGservers (one of ten). I need to create a module that would at regular intervals take various parameters (heading,speed,altitdue etc) and update a map, save all that data in an xml file which could then be read and transposed into an automatically generated pirep. In essence this is what i understand xacars and the others do. Would be easiest to taker an already established module (if licence permitted) and point it to the FGservers to collect the data, or go from scratch. Thanks for your patience Alex Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 7, 2010 Administrators Report Share Posted April 7, 2010 No prob! You essentially need a program running on the pilot's PC, which sends data to a phpVMS module at regular intervals, the module then parses it and through the API, it will update the map. So essentially, you're sending XML from the program from the app, to a URL, something like: phpvms.net/action.php/flightgear_acars/ Then a function in there would take the XML send via POST, and parse it out into a data structure like this: $data = array( 'pilotid'=>$pilotid, 'code'=>$code, 'flightnum'=>$flightnum, 'depicao'=>$depicao, 'arricao'=>$arricao, 'aircraft'=> $aircraft, 'registration'=>(string) $xml->AircraftTailNumber, 'flighttime'=> $flighttime, 'landingrate'=> (string) $xml->ONVS, 'submitdate'=>'NOW()', 'comment'=> trim((string) $xml->COMMENT), 'fuelused'=> (string) $xml->BlockFuel, 'source'=>'fsfk', 'load'=>$load, 'log'=>$log, 'rawdata'=>$rawdata, ); $ret = ACARSData::FilePIREP($pilotid, $data); That code is pulled from FSFK, which sends in XML, and then it files the PIREP. The rest is taken care of behind the scenes. You can probably use an existing ACARS module in bits and pieces (the data structure and API portions), but you'd have to write the 'fill-ins' to the structures to match the data which is being sent to it. They're all different. Quote Link to comment Share on other sites More sharing options...
Alex Posted April 7, 2010 Author Report Share Posted April 7, 2010 i sort of understand, it's still a way out of my level of understanding really, but i'll see what i can come up with. checking through the properties of the simulator, i can log flight detail (check a logging box) which at the end of the flight spits out a csv file already. Logging in FlightGear --------------------- FlightGear can log any property values at any interval to one or more CSV files (which can be read and graphed using spreadsheets like Gnumeric or Excel). Logging is defined in the '/logging' subbranch of the main property tree; under '/logging', each '/log' subbranch defines a separate log with its own output file and interval. Here is a simple example that logs the rudder and aileron settings every second (1000ms) to the file steering.csv, using a comma (the default, anyway) as the field delimiter: <PropertyList> <logging> <log> <enabled>true</enabled> <filename>steering.csv</filename> <interval-ms>1000</interval-ms> <delimiter>,</delimiter> <entry> <enabled>true</enabled> <title>Rudder</title> <property>/controls/flight/rudder</property> </entry> <entry> <enabled>true</enabled> <title>Ailerons</title> <property>/controls/flight/aileron</property> </entry> </log> </logging> </PropertyList> Each 'log' subbranch contains a required 'enabled' property, an optional 'filename' property (defaults to "fg_log.csv"), an optional 'delimiter' property (defaults to a comma), an optional 'interval-ms' property (defaults to 0, which logs every frame), and a series of 'entry' subbranches. The 'delimiter' property uses only the first character of the property value as the delimiter. Note that the logger does no escaping, so you must choose a delimiter that will not appear in the property values (that's not hard, since most of the values are numeric, but watch for commas in the titles). Each 'entry' subbranch contains a required 'enabled' property, a 'property' property specifying the name of the property to be logged, and an optional 'title' property specifying the title to use in the CSV file (defaults to the full path of the property). The elapsed time in milliseconds since the start of the simulation is always included as the first entry with the title "Time", so there is no need to include it explicitly. Here's a sample of the logging output for the above log: Time,Rudder,Ailerons 6522,0.000000,0.000000 7668,-0.000000,0.000000 8702,-0.000000,0.000000 9705,-0.000000,0.000000 10784,-0.000000,0.000000 11792,-0.000000,0.000000 12808,-0.000000,-0.210000 13826,-0.000000,-0.344000 14881,-0.000000,-0.066000 15901,-0.000000,-0.806000 16943,-0.000000,-0.936000 17965,-0.000000,-0.534000 19013,-0.000000,-0.294000 20044,-0.000000,0.270000 21090,-0.000000,-1.000000 22097,-0.000000,-0.168000 Note that the requested interval is only a minimum; most of the time, the actual interval is slightly longer than the requested one. The easiest way for an end-user to define logs is to put the log in a separate XML file (usually under the user's home directory), then refer to it using the --config option, like this: fgfs --config=log-config.xml The output log files are always relative to the current directory. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 7, 2010 Administrators Report Share Posted April 7, 2010 Looks interesting - you'll have to have it generate a log file with info for a PIREP, it seems like you can generate status reports every few minutes. You'll need a program which is running which picks up the latest status report and sends it off to phpVMS Quote Link to comment Share on other sites More sharing options...
Alex Posted April 8, 2010 Author Report Share Posted April 8, 2010 OK that helps, it actually updates every 10 ms, so i would need to capture each property that i needed for the pirep, some lets say every 5 seconds such as lat/long/heading and altitude, then have it read static properties like dep icao/arr icao, calculate fuel use etc. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 8, 2010 Administrators Report Share Posted April 8, 2010 OK that helps, it actually updates every 10 ms, so i would need to capture each property that i needed for the pirep, some lets say every 5 seconds such as lat/long/heading and altitude, then have it read static properties like dep icao/arr icao, calculate fuel use etc. Every 5 seconds is too soon, I would say every 2-5 minutes. Otherwise you'll effectively be DOS'ing your own server Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.