This is our project for "Advanced Programming 2" course in Bar-Ilan University. Our application can load CSV files representing flight data, visualize the plane's state and controls, connect to "FlightGear" flight simulator for simulating the course of the flight, analyze it to detect anomalies with a dynamically loaded anomaly detection algorithm and present the results with different graphs.
FlightGear Flight Simulator is a free, open-source program for Mac, Windows or Linux. It simulates a plane in various modes, such as taking off, flight and landing. It includes features such as viewing the plane from different angles, changing the time of the day or the location.
-
- Our program can connect to FlightGear and send the flight data to simulate the course of the flight. The user can use the player bar in order to change the current timestep of the flight, and use the different controls to play, pause, fast forward or rewind.
-
- The data tab in our program visually presents various data during the flight, such as altimeter, air speed, roll, pitch and yaw degrees, heading degree, the aileron, elevator, throttle and rudder controls.
-
- The research tab allows flight researches to analyze anomalies in a flight, by using another flight data for learning the correlation between different features, and using an anomaly detection algorithm which can be dynamically loadad via dll. The user can select a feature to present its values in a constantly updating graph, alongside its correlated feature if one exists. The correlation between the features is presented dynamically according to loaded algorithm (for example by showing a linear regression line or minimal circle). The values of the recent 30 seconds are presented with the anomalies highlighted in red. The user can see the list of timesteps during flight with anomalous values and choose to go back to these anytime.
The project files include the following:
- The Views folder includes the multiple views in the project: DataView, PlayerView, ResearchView, SettingsView (UserControls) and also the configuration window (which is shown at startup). Each one includes both XAML and CS files.
- The ViewModels folder includes all the ViewModel classes for the views above: DataViewModel, PlayerViewModel, ResearchViewModel and SettingsViewModel. All of the view models extend the general ViewModel class, and are responsible for presentation logic.
- The Model folder includes all of the classes and interfaces which are part of the program's model:
- The IFlightControl interface, implemented by the FlightControl class.
- The IFlightData interface, implemented by the FlightData class.
- The IClient interface, implemented by the SimpleClient class.
- The Pilot abstract class, inherited by the SimplePilot class.
- The IResearch interface, implemented by the Research class.
- The PathInfo class.
- The MainWindow class and XAML.
- The Plugins folder contains 2 DLL files, which are anomaly detection plugins that can be loaded into the program. Both were written in C# and use a dll written in C++. Each one is responsible for using a different anomaly detection algorithm and create its graphics accordingly. Additional info on plugins for the app can be found here.
- The Resources folder includes additional resources required for the project (such as the feature names xml and neccesary dll written in C++).
- The images folder contains images used in the project.
Additional details on each class/interface can be found here.
- Either the latest FlightGear Simulator or any older version from 2018.3.1 and above.
- The playback_small.xml file which can be found in the "Resources" folder is required to be located at the data/protocol folder in FlightGear installation folder.
- Latest version of Visual Studio 2019
- .NET 5.0
- MaterialDesignTheme v4.0
- MaterialMessageBox v4.0.2
- OxyPlot.Wpf v2.0.0
- Microsoft Expression Drawing v1.0
Make sure you have all of the above installed. Clone the project using:
git clone https://github.com/lielgut/FlightMonitor.git
then open the project via Visual Studio 2019, build and run the application.
When running the application you will be presented with the configuration window where you should enter the following:
- Correlation threshold - a threshold by which the anomaly detection algorithm will determine which features are correlated.
- Anomaly detection DLL path - the plugin that the application will use to learn correlations, detect and present the anomalies.
- Normal flight CSV path - a CSV file with data of a normal flight is required for the algorithm to learn which values are considered noraml, in order to later recognize anomalies.
- New flight CSV path - a CSV file with data of the new flight you'd like to show on FlightGear, present its data and analyze it for anomalies detection.
note: both CSV files must be in a CSV format, without a line with the feature names, with values for each of the 42 features seperated by commas. - XML file path - a XML file with the names of the features. Use the playback_small.xml file in the resources folder.
- FlightGear installation folder - The location where FlightGear is installed on your computer. Will be used to make sure the required playback_small.xml file is found in the proper location. You can also choose to launch FlightGear via the configuration window. (You have to specify a port which will be used for opening a FlightGear server). Alternatively you could launch FlightGear manually, and copy the settings presented in the configuration window to your FlightGear program before pressing "fly".
FlightGear must be running at chosen port in order for the program to run. These settings are used to open the FlightGear server, specifying the XML file for FlightGear to use in order to map the values to its matching features. For easier viewing of the flight the time of the day setting is set to morning, but can be changed via FlightGear.
