public void OptimisationCompleted(FlightSimulator sim) { //CompletedForm.lblDuration.Text = sim.duration.ToString() + " sec"; //CompletedForm.lblFuel.Text = Math.Round(sim.fuel,2).ToString() + " kg"; //CompletedForm.lblDistance.Text = Math.Round(sim.distance/1000,2).ToString() + " km"; CompletedForm.RefreshGraph(sim.CreateTrajectory()); CompletedForm.BringToFront(); }
public MainWindowViewModel() { model = FlightSimulator.ModelInstance; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
public void FlightSimulatorBasic3SegmentRightTurnTest() { var aircraft = new Boeing747_400(); var settings = new List <double>() { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0 }; FlightSimulator sim = new FlightSimulator(aircraft, new Point3D(50000, 50000, 0, CoordinateUnit.metric), 3, settings); sim.Simulate(); Assert.AreEqual(50000, sim._x, 150); Assert.AreEqual(50000, sim._y, 150); }
public void FlightSimulatorFlyFarStraightTest() { var aircraft = new Boeing747_400(); var settings = new List <double>() { 1, 1, 1 }; FlightSimulator sim = new FlightSimulator(aircraft, new Point3D(50000, 0, 0, CoordinateUnit.metric), 1, settings); sim.Simulate(); Assert.AreEqual(50000, sim._x, 150); Assert.AreEqual(0, sim._y, 0.001); }
public UserFeaturesWindow(string csvFile) { InitializeComponent(); FlightSimulator FSmodel = FlightSimulator.ModelInstance; fsView = new FlightSimulatorViewModel(); fsView.VM_UploadReg(csvFile); DataContext = fsView; flags = fsView.VM_Flags; graphsAndList = new GraphsAndList(); DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += timer_Tick; timer.Start(); }
public Pilot( string callsign, string vid, string name, ClientType clientType, GPS location, string server, string protocol, DateTime connectionTime, string softwareName, string softwareVersion, AdministrativeRating administrativeVersion, int clientRating, PilotRating rating, int groundSpeed, string transponderCode, int heading, bool isOnGround, FlightSimulator flightSimulator, string planeMTL, FlightPlan flightPlan) : base(callsign, vid, name, clientType, location, server, protocol, connectionTime, softwareName, softwareVersion, administrativeVersion, clientRating, rating) { GroundSpeed = groundSpeed; TransponderCode = transponderCode ?? string.Empty; Heading = heading; IsOnGround = isOnGround; Simulator = flightSimulator; PlaneMTL = planeMTL ?? string.Empty; FlightPlan = flightPlan; }
public void AngleDifferenceTest() { var aircraft = new Boeing747_400(); FlightSimulator sim = new FlightSimulator(aircraft, null, 0, null); Assert.AreEqual(R(45), sim.AngleDifference(R(45), R(90)), 0.001); Assert.AreEqual(R(100), sim.AngleDifference(R(350), R(90)), 0.001); Assert.AreEqual(R(260), sim.AngleDifference(R(90), R(350)), 0.001); Assert.AreEqual(R(190), sim.AngleDifference(R(90), R(280)), 0.001); Assert.AreEqual(R(170), sim.AngleDifference(R(280), R(90)), 0.001); Assert.AreEqual(R(180), sim.AngleDifference(R(360), R(180)), 0.001); Assert.AreEqual(R(180), sim.AngleDifference(R(0), R(180)), 0.001); Assert.AreEqual(R(91), sim.AngleDifference(R(359), R(90)), 0.001); Assert.AreEqual(R(200), sim.AngleDifference(R(250), R(90)), 0.001); Assert.AreEqual(R(190), sim.AngleDifference(R(180), R(10)), 0.001); Assert.AreEqual(R(359), sim.AngleDifference(R(90), R(89)), 0.001); Assert.AreEqual(R(271), sim.AngleDifference(R(179), R(90)), 0.001); }
public PilotBuilder WithFlightSimulator(FlightSimulator flightSimulator) { _flightSimulator = flightSimulator; return(this); }