{"id":22830991,"url":"https://github.com/eyalgolan/flightsimulatorapp","last_synced_at":"2026-07-17T14:36:42.136Z","repository":{"id":80018473,"uuid":"248187594","full_name":"eyalgolan/FlightSimulatorApp","owner":"eyalgolan","description":"Advanced Programming 2 course, Flight Simulator App","archived":false,"fork":false,"pushed_at":"2020-05-08T10:31:22.000Z","size":599,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T22:24:36.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyalgolan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-18T09:25:12.000Z","updated_at":"2020-07-05T07:04:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"61d1651b-e568-4ce8-88c2-e7b4c9a0c9ff","html_url":"https://github.com/eyalgolan/FlightSimulatorApp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eyalgolan/FlightSimulatorApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalgolan%2FFlightSimulatorApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalgolan%2FFlightSimulatorApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalgolan%2FFlightSimulatorApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalgolan%2FFlightSimulatorApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyalgolan","download_url":"https://codeload.github.com/eyalgolan/FlightSimulatorApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalgolan%2FFlightSimulatorApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35585713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-17T02:00:06.162Z","response_time":116,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T20:16:18.036Z","updated_at":"2026-07-17T14:36:42.103Z","avatar_url":"https://github.com/eyalgolan.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlightSimulatorApp\nAdvanced Programming 2 course, Flight Simulator App\n\nCreated by: Yair Hanimov and Eyal Golan\n\n## Preview\nA flight simulator desktop application that interacts with a dedicated server. We built our multithread application using C# and WPF with the MVVM software architectural pattern. The program features a convenient user interface for operating a small aircraft. The GUI contains four main components: A map components, a dashboard, a joystick and a connection section.\n\nThe user can connect to a server using the connect section, and fly the plane using the joystick. The plane moves on the map according to the data received from the server. The dashboard data is also displayed according to the data received from the server.\n\n![flightSimulator](images/flightSimulator.JPG)\n\n## Program explanation\n### MVVM software architectural pattern\nThe program contains four main components: A map components, a dashboard, a joystick and a connection section.\nEach component has it's own View - View-Model - Model:\nEach components has it's own model, view-model and view. The model implements an interface, that inherits from the ```INotifyPropertyChanged``` interface.\n\nIn the dashboard, connection and map components, the models update the view-model when a property has changed, as the view-model updates the view - about changes that arrived from the server.\n\nFor example, the LatitudeError property in the dashboard's model:\n```\n//Property holding errors regarding the plane's latitude\npublic String LatitudeError\n{\n        get\n        {\n                return this.latitudeError;\n        }\n        set\n        {\n                this.latitudeError = value;\n                NotifyPropertyChanged(\"LatitudeError\");\n        }\n}\n```\nIn the view-model we update the matching property and immediatly update the view:\n```\nmodel.PropertyChanged += delegate (object sender, PropertyChangedEventArgs e)\n{\n        NotifyPropertyChanged(\"Vm\" + e.PropertyName);\n};\n...\n//Property responsible for relaying latitude errors\npublic String VmLatitudeError\n{\n        get\n        {\n                return this.model.LatitudeError;\n        }\n}\n```\nThe property is binded to the relavent field in the view.\n\nIn the Gear component, the view updates the view-model which then updates the view - about changes the user made to the joystick.\n\n### Threads\n\nThe models of the dashboard, map and gear each open a thread in order to read and write data to and from the server.\nIn the gear's model we used a command queue to update the server:\n```\n// We maintain a queue which collects the set commands, and send them to the server in the proper order\nprivate void StartWriting()\n{\n    new Thread(delegate ()\n    {\n        while (true)\n        {\n            // sending the data until we disconnected or the queue is empty \n            if (String.Equals(tc.IsConnected, \"Connected\") \u0026\u0026 this.writeQueue.Count != 0)\n            {\n                string writeCommand = writeQueue.Peek();\n                writeQueue.Dequeue();\n                tc.Write(writeCommand);\n                tc.Read();\n            }\n            else if(String.Equals(tc.IsConnected, \"Disconnected\") \u0026\u0026 this.writeQueue.Count != 0)\n            {\n                writeQueue.Clear();\n            }\n        }\n    }).Start();\n}\n```\n\n### Communicating with the server\nThe ```MyTelnetClient``` singelton class implements the ```ITelnetClient``` interface, and is responsible for all communications made with the server. All the models contain the same instance of the class and convery communicate with the server using that instance.\n\n## Error handling\n### Server status\nThe application displays the different connection states:\n\nIf the application is disconnected from a server:\n\n![Disconnected from server](images/DisconnectedFromServer.JPG)\n\nIf there is a timeout from the server:\n\n![Server timeout](images/serverTimeout.JPG)\n### Validating the data\n\nThe application validates the incoming data from the server, and show if any received data from the server is incorrect. The application will not use that data, and will show the last correct information.\n\n![Dashboard when data is all valid](images/DashboardWithAlllValid.JPG)\n![Dashboard when some data is not valid](images/DasboardDataError.JPG)\n\nThe application also validates the latitude and longtitude infromation that are received from the server, and shows if wrong data was received. Simillarly, it will show the last correct information.\n\n![Map when bad latitude received](images/BadLatitude.JPG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyalgolan%2Fflightsimulatorapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyalgolan%2Fflightsimulatorapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyalgolan%2Fflightsimulatorapp/lists"}