private void SetDialogSettings(DroneConfig droneConfig, HudConfig hudConfig) { configSettings = new GeneralConfigBinding(droneConfig, hudConfig); configSettings.PropertyChanged += configSettings_PropertyChanged; this.DataContext = configSettings; }
public GeneralConfigWindow(DroneConfig droneConfig, HudConfig hudConfig) { InitializeComponent(); SetDialogSettings(droneConfig, hudConfig); UpdateDependentHudCheckBoxes(hudConfig.ShowHud); }
public GeneralConfigBinding(DroneConfig droneConfig, HudConfig hudConfig) { networkUtils = new NetworkUtils(); TakeOverDroneConfigSettings(droneConfig); TakeOverHudConfigSettings(hudConfig); }
public DroneSettingsWindow(DroneConfig config, bool droneIsPaired) { if ( config == null ) { throw new ArgumentNullException( "Config cannot be null" ); } // Clone config. Active one cannot be modified when used. DroneConfig newConfig = new DroneConfig() { DroneIpAddress = config.DroneIpAddress, StandardOwnIpAddress = config.StandardOwnIpAddress, DroneNetworkIdentifierStart = config.DroneNetworkIdentifierStart, NavigationPort = config.NavigationPort, VideoPort = config.VideoPort, CommandPort = config.CommandPort, ControlInfoPort = config.ControlInfoPort, UseSpecificFirmwareVersion = config.UseSpecificFirmwareVersion, FirmwareVersion = config.FirmwareVersion, TimeoutValue = config.TimeoutValue }; _viewModel = new DroneSettingsWindowViewModel( newConfig ); _viewModel.DroneIsPaired = droneIsPaired; this.DataContext = _viewModel; InitializeComponent(); }
public void Init(DroneConfig droneConfig) { checkFlightMoveCommandStrategy = new CheckFlightMoveCommandStrategy(); this.droneConfig = droneConfig; droneConfig.Initialize(); CreateDroneWorkers(); }
public GeneralConfigWindow(DroneConfig droneConfig, HudConfig hudConfig) { InitializeComponent(); SetDialogSettings(droneConfig, hudConfig); UpdateDependentHudCheckBoxes(hudConfig.ShowHud); UpdateFirmwareVersionComboBox(droneConfig.UseSpecificFirmwareVersion); }
private void InitializeDroneControl() { DroneConfig droneConfig = new DroneConfig(); droneConfig.DefaultCameraMode = DroneCameraMode.BottomCamera; droneControl = new DroneControl(droneConfig); droneControl.Error += droneControl_Error_Async; droneControl.ConnectionStateChanged += droneControl_ConnectionStateChanged_Async; }
private void Init(DroneConfig droneConfig) { this.droneConfig = droneConfig; droneConfig.Initialize(); CreateDroneWorkers(); internalDroneConfiguration = new InternalDroneConfiguration(); }
private void InitializeDroneControl() { DroneConfig droneConfig = new DroneConfig(); droneConfig.FirmwareVersion = SupportedFirmwareVersion.Firmware_164_Or_Above; droneConfig.DefaultCameraMode = DroneCameraMode.FrontCamera; droneControl = new DroneControl(droneConfig); droneControl.Error += droneControl_Error_Async; droneControl.ConnectionStateChanged += droneControl_ConnectionStateChanged_Async; }
private void CopySettingsFrom(DroneConfig droneConfig) { this.StandardOwnIpAddress = droneConfig.StandardOwnIpAddress; this.DroneIpAddress = droneConfig.DroneIpAddress; this.DroneNetworkIdentifierStart = droneConfig.DroneNetworkIdentifierStart; this.VideoPort = droneConfig.VideoPort; this.NavigationPort = droneConfig.NavigationPort; this.CommandPort = droneConfig.CommandPort; this.ControlInfoPort = droneConfig.ControlInfoPort; this.FirmwareVersion = droneConfig.FirmwareVersion; }
private void TakeOverDroneConfigSettings(DroneConfig droneConfig) { DroneNetworkSSID = droneConfig.DroneNetworkIdentifierStart; DroneIpAddress = droneConfig.DroneIpAddress; OwnIpAddress = droneConfig.StandardOwnIpAddress; VideoPortText = droneConfig.VideoPort.ToString(); CommandPortText = droneConfig.CommandPort.ToString(); NavigationPortText = droneConfig.NavigationPort.ToString(); ControlPortText = droneConfig.ControlInfoPort.ToString(); firmwareVersion = droneConfig.FirmwareVersion; }
public DroneControler(ref Label l) { _label = l; currentDroneConfig = new DroneConfig(); currentDroneConfig.Load(); droneControl = new DroneControl(currentDroneConfig); droneControl.Error += droneControl_Error_Async; droneControl.ConnectionStateChanged += droneControl_ConnectionStateChanged_Async; droneControl.NetworkConnectionStateChanged += droneControl_NetworkConnectionStateChanged_Async; }
public void Load() { CheckForDroneConfigState(); DroneConfig droneConfig = new DroneConfig(); try { droneConfig = (DroneConfig)serializationUtils.Deserialize(this.GetType(), serializationFileName); } catch (Exception) { } CopySettingsFrom(droneConfig); }
private void TakeOverDroneConfigSettings(DroneConfig droneConfig) { DroneNetworkSSID = droneConfig.DroneNetworkIdentifierStart; DroneIpAddress = droneConfig.DroneIpAddress; OwnIpAddress = droneConfig.StandardOwnIpAddress; VideoPortText = droneConfig.VideoPort.ToString(); CommandPortText = droneConfig.CommandPort.ToString(); NavigationPortText = droneConfig.NavigationPort.ToString(); ControlPortText = droneConfig.ControlInfoPort.ToString(); firmwareVersion = droneConfig.FirmwareVersion; UseP264 = droneConfig.InitialSettings.Any(x => x.Key == videoCodec && x.Value == VideoCodecs.P264); }
public DroneConfig GetResultingDroneConfig() { DroneConfig droneConfig = new DroneConfig(); droneConfig.DroneNetworkIdentifierStart = droneNetworkSSID; droneConfig.DroneIpAddress = droneIpAddress; droneConfig.StandardOwnIpAddress = ownIpAddress; droneConfig.CommandPort = Int32.Parse(commandPortText); droneConfig.NavigationPort = Int32.Parse(navigationPortText); droneConfig.VideoPort = Int32.Parse(videoPortText); droneConfig.ControlInfoPort = Int32.Parse(controlPortText); droneConfig.FirmwareVersion = firmwareVersion; return droneConfig; }
private void CopySettingsFrom(DroneConfig droneConfig) { this.StandardOwnIpAddress = droneConfig.StandardOwnIpAddress; this.DroneIpAddress = droneConfig.DroneIpAddress; this.DroneNetworkIdentifierStart = droneConfig.DroneNetworkIdentifierStart; this.VideoPort = droneConfig.VideoPort; this.NavigationPort = droneConfig.NavigationPort; this.CommandPort = droneConfig.CommandPort; this.ControlInfoPort = droneConfig.ControlInfoPort; this.FirmwareVersion = droneConfig.FirmwareVersion; ApplicationId = droneConfig.ApplicationId; UserId = droneConfig.UserId; SessionId = droneConfig.SessionId; InitialSettings = droneConfig.InitialSettings; }
public DroneControl(DroneConfig droneConfig) { Init(droneConfig); }
public DroneConfig GetResultingDroneConfig() { DroneConfig droneConfig = new DroneConfig(); droneConfig.DroneNetworkIdentifierStart = droneNetworkSSID; droneConfig.DroneIpAddress = droneIpAddress; droneConfig.StandardOwnIpAddress = ownIpAddress; droneConfig.CommandPort = Int32.Parse(commandPortText); droneConfig.NavigationPort = Int32.Parse(navigationPortText); droneConfig.VideoPort = Int32.Parse(videoPortText); droneConfig.ControlInfoPort = Int32.Parse(controlPortText); droneConfig.FirmwareVersion = firmwareVersion; droneConfig.InitialSettings.RemoveAll(x => x.Key == videoCodec); droneConfig.InitialSettings.Add(new DroneSetting(videoCodec, UseP264 ? VideoCodecs.P264 : VideoCodecs.VLIB)); return droneConfig; }
private void SaveDroneAndHudConfigStates(DroneConfig droneConfig, HudConfig hudConfig) { currentDroneConfig = droneConfig; currentHudConfig = hudConfig; droneConfig.Save(); hudConfig.Save(); }
private void InitializeDroneControl() { currentDroneConfig = new DroneConfig(); currentDroneConfig.Load(); InitializeDroneControl(currentDroneConfig); }
private void InitializeDroneControl(DroneConfig droneConfig) { droneControl = new DroneControl(droneConfig); //gps_start = new GPSDataRetriever(); }
private void InitializeDroneControl(DroneConfig droneConfig) { droneControl = new DroneControl(); droneControl.Init(droneConfig); }
public DroneSettingsWindowViewModel( DroneConfig config ) { if ( config == null ) { throw new ArgumentNullException( "Config cannot be null." ); } this._droneConfig = config; }
public DroneInitializer( DroneConfig config ) { _currentDroneConfig = config; _droneControl = new DroneControl( _currentDroneConfig ); _droneCommand = new DroneCommand( _droneControl ); _droneControl.Error += droneControl_Error; _droneControl.ConnectionStateChanged += droneControl_ConnectionStateChanged; _droneControl.NetworkConnectionStateChanged += droneControl_NetworkConnectionStateChanged; InitializeVideoUpdate(); InitializeHudInterface(); _timerStatusUpdate = new DispatcherTimer(); _timerStatusUpdate.Interval = new TimeSpan( 0, 0, 0, 0, 30 ); _timerStatusUpdate.Tick += new EventHandler( timerStatusUpdate_Tick ); }
private void CreateNewDroneConfig() { droneConfig = configSettings.GetResultingDroneConfig(); }
private void SaveDroneAndHudConfigStates(DroneConfig droneConfig/*, HudConfig hudConfig*/) { currentDroneConfig = droneConfig; //currentHudConfig = hudConfig; droneConfig.Save(); //hudConfig.Save(); }
public DroneSettingsEventArgs( DroneConfig newConfig, bool isPaired ) { this.DroneConfig = newConfig; this.IsPaired = isPaired; }