public FlightControlsViewModel(ISimulatorModel m) { this.model = m; this.model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
public MapViewModel(ISimulatorModel m) { model = m; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); MySimulatorModel = new MySimulatorModel(Configuration); services.AddSingleton <ISimulatorModel>(MySimulatorModel); services.AddSingleton <CommandController>(new CommandController(MySimulatorModel)); services.AddSingleton <ScreenshotController>(new ScreenshotController(Configuration)); }
public ErrorViewModel(ISimulatorModel simulatorModel) { this.SimulatorModel = simulatorModel; SimulatorModel.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM" + e.PropertyName); }; }
// Constructor. public DashboardViewModel(ISimulatorModel model) { this.model = model; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
public SimulatorMapViewModel(ISimulatorModel m) { model = m; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { SetProperty("Vm" + e.PropertyName); }; }
public void SetModel(ISimulatorModel model) { this.model = model; model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
public MainViewModel(ISimulatorModel m) { model = m; ConnectionButtons_vm = new ConnectionButtonsViewModel(this.model); Dashboard_vm = new DashboardViewModel(this.model); // Map_vm = new MapViewModel(this.model); FlightControls_vm = new FlightControlsViewModel(this.model); }
private void StartUp_App(object sender, StartupEventArgs e) { // Initiate the model with ip and port from app.config _model = new SimulatorModel(); MainWindow mw = new MainWindow(_model); mw.Show(); }
// Ctor. public ConnectVM(ISimulatorModel newModel) { this.model = newModel; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
public SimulatorViewModel(ISimulatorModel model) { this.model = model; model.PropertyChanged += (Object sender, PropertyChangedEventArgs e) => { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
public SimulatorDashboardViewModel(ISimulatorModel m) { model = m; vmStatus = ""; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { SetProperty("Vm" + e.PropertyName); }; }
public ConnectViewModel(ISimulatorModel model) { this.model = model; // Every time the model notify about change, the vm also notify about change. model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }
public MainWindow(ISimulatorModel model) { _model = model; InitiateViewModels(); InitializeComponent(); DataContext = _mainViewModel; SetModelToViewModel(); Closing += OnWindowClosing; }
public VM_Main(ISimulatorModel model) { this.model = model; this.map = new VM_Map(); this.map.SetModel(model); this.cp = new VM_ControlPanel(); this.cp.SetModel(model); this.steers = new VM_JoystickControl(); this.steers.SetModel(model); this.connect = new VM_Connect(); this.connect.SetModel(model); this.errorLine = new VM_ErrorLine(); this.errorLine.SetModel(model); }
/// <summary> /// Create a new FlightSimulator object /// </summary> /// <param name="aircraft">The aircraft that will be used in the simulation</param> /// <param name="endPoint">The position the aircraft will fly towards</param> /// <param name="numberOfSegments">The number of segments used in the simulation. The simulation starts and ends with a straight segment, so the number of segments should be odd.</param> /// <param name="settings">The control parameters, which are a list of doubles between 0 and 1. The number of controls needed for any number of segments can be calculated by calling TrajectoryChromosome.ChromosomeLength().</param> public FlightSimulator(ISimulatorModel aircraft, Point3D endPoint, int numberOfSegments, List <double> settings, TrajectoryGenerator trajectoryGenerator) { _trajectoryGenerator = trajectoryGenerator; _settings = settings; _vertical_state = VERTICAL_STATE.TAKEOFF; _aircraft = aircraft; _speed = 160; _x = 0; _y = 0; _heading = Math.PI / 2; _endPoint = endPoint; _numberOfSegments = numberOfSegments; _segmentIndex = 1; }
public MySimulatorViewModel(ISimulatorModel sm) { this.model = sm; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { OnPropertyChanged("VM_" + e.PropertyName); if (e.PropertyName.ToLower().Contains("lon") || e.PropertyName.ToLower().Contains("lat")) { MySimulatorModel se = sender as MySimulatorModel; lon = se.longitude; lat = se.latitude; Location loc = new Location(lat, lon); VM_Location = loc; } }; Err_visiblity_Cannot_Connect = Visibility.Collapsed; model.Err_Server_Format = Visibility.Collapsed; VM_Err_visiblity_Not_Connected = Visibility.Visible; model.Err_Server_IO = Visibility.Collapsed; color = new SolidColorBrush(); color.Color = System.Windows.Media.Color.FromRgb(255, 0, 0); VM_Color = color; VM_Ip_address = "127.0.0.1"; VM_Info_port = "5402"; VM_Command_port = "5400"; settings_ip_saved = VM_Ip_address; settings_info_port_saved = VM_Info_port; settings_command_port_saved = VM_Command_port; Settings_Cancel_Click = new RelayCommand(SettingsCancelClicked); Settings_Ok_Click = new RelayCommand(SettingsOkClicked); MW_ConnectCommand = new RelayCommand(connect); }
public DashboardTableViewModel(ISimulatorModel model) { Model = model; }
public SimulatorControlsViewModel(ISimulatorModel m) { model = m; }
public MapVM(ISimulatorModel sm) : base(sm) { }
public ControlsViewModel(ISimulatorModel simulatorModel) { SimulatorModel = simulatorModel; }
public ConnectWindowViewModel(ISimulatorModel model) { Model = model; }
public BingMapViewModel(ISimulatorModel model) { Model = model; CreateBitmap(); }
public MainWindowViewModel(ISimulatorModel model) { Model = model; }
public ControlsVM(ISimulatorModel sm) : base(sm) { }
public CommandController(ISimulatorModel mySimulatorModel) { this.mySimulatorModel = mySimulatorModel; }
public ErrorVm(ISimulatorModel model) : base(model) { }
public DashBoardVM(ISimulatorModel sm) : base(sm) { }
public void SetModel(ISimulatorModel model) { this.model = model; }
public UserNavigationViewModel(ISimulatorModel model) { Model = model; }