public GeneralConfigWindow(DroneConfig droneConfig, HudConfig hudConfig) { InitializeComponent(); SetDialogSettings(droneConfig, hudConfig); UpdateDependentHudCheckBoxes(hudConfig.ShowHud); }
private void ConfigureHud(HudConfig hudConfig, HudConstants constants) { showHud = hudConfig.ShowHud; hudElements = new List <HudElement>(); if (hudConfig.ShowTarget) { hudElements.Add(new TargetElement(constants)); } if (hudConfig.ShowBaseLine) { hudElements.Add(new BaseLineElement(constants)); } if (hudConfig.ShowHeading) { hudElements.Add(new HeadingElement(constants)); } if (hudConfig.ShowAltitude) { hudElements.Add(new AltitudeElement(constants)); } if (hudConfig.ShowSpeed) { hudElements.Add(new SpeedElement(constants)); } if (hudConfig.ShowBattery) { hudElements.Add(new BatteryElement(constants)); } }
public HudInterface(HudConfig hudConfig, HudConstants constants) { drawingUtils = new DrawingUtils(); currentState = new HudState(); ConfigureHud(hudConfig, constants); }
private void SetDialogSettings(DroneConfig droneConfig, HudConfig hudConfig) { configSettings = new GeneralConfigBinding(droneConfig, hudConfig); configSettings.PropertyChanged += configSettings_PropertyChanged; this.DataContext = configSettings; }
public GeneralConfigBinding(DroneConfig droneConfig, HudConfig hudConfig) { networkUtils = new NetworkUtils(); TakeOverDroneConfigSettings(droneConfig); TakeOverHudConfigSettings(hudConfig); }
public GeneralConfigWindow(DroneConfig droneConfig, HudConfig hudConfig) { InitializeComponent(); SetDialogSettings(droneConfig, hudConfig); UpdateDependentHudCheckBoxes(hudConfig.ShowHud); UpdateFirmwareVersionComboBox(droneConfig.UseSpecificFirmwareVersion); }
private void TakeOverHudConfigSettings(HudConfig hudConfig) { showHud = hudConfig.ShowHud; showHudTarget = hudConfig.ShowTarget; showHudBaseLine = hudConfig.ShowBaseLine; showHudHeading = hudConfig.ShowHeading; showHudAltitude = hudConfig.ShowAltitude; showHudSpeed = hudConfig.ShowSpeed; showHudBattery = hudConfig.ShowBattery; }
private void CopySettingsFrom(HudConfig hudConfig) { this.ShowHud = hudConfig.showHud; this.ShowTarget = hudConfig.ShowTarget; this.ShowBaseLine = hudConfig.ShowBaseLine; this.ShowHeading = hudConfig.ShowHeading; this.ShowAltitude = hudConfig.ShowAltitude; this.ShowSpeed = hudConfig.ShowSpeed; this.ShowBattery = hudConfig.ShowBattery; }
public void Load() { CheckForHudConfigState(); HudConfig hudConfig = new HudConfig(); try { hudConfig = (HudConfig)serializationUtils.Deserialize(this.GetType(), serializationFileName); } catch (Exception) { } CopySettingsFrom(hudConfig); }
private void ConfigureHud(HudConfig hudConfig, HudConstants constants) { showHud = hudConfig.ShowHud; hudElements = new List<HudElement>(); if (hudConfig.ShowTarget) hudElements.Add(new TargetElement(constants)); if (hudConfig.ShowBaseLine) hudElements.Add(new BaseLineElement(constants)); if (hudConfig.ShowHeading) hudElements.Add(new HeadingElement(constants)); if (hudConfig.ShowAltitude) hudElements.Add(new AltitudeElement(constants)); if (hudConfig.ShowSpeed) hudElements.Add(new SpeedElement(constants)); if (hudConfig.ShowBattery) hudElements.Add(new BatteryElement(constants)); }
private void InitializeHudInterface() { _currentHudConfig = new HudConfig(); HudConstants hudConstants = new HudConstants( _droneControl.FrontCameraFieldOfViewDegrees ); _hudInterface = new HudInterface( _currentHudConfig, hudConstants ); }
public void Load() { CheckForHudConfigState(); HudConfig hudConfig = new HudConfig(); try { hudConfig = (HudConfig) serializationUtils.Deserialize(this.GetType(), serializationFileName); } catch (Exception) { } CopySettingsFrom(hudConfig); }
public HudConfig GetResultingHudConfig() { HudConfig hudConfig = new HudConfig(); hudConfig.ShowHud = showHud; hudConfig.ShowTarget = showHudTarget; hudConfig.ShowBaseLine = showHudBaseLine; hudConfig.ShowHeading = showHudHeading; hudConfig.ShowAltitude = showHudAltitude; hudConfig.ShowSpeed = showHudSpeed; hudConfig.ShowBattery = showHudBattery; return hudConfig; }
private void CreateNewHudConfig() { hudConfig = configSettings.GetResultingHudConfig(); }
private void InitializeHudInterface() { currentHudConfig = new HudConfig(); currentHudConfig.Load(); InitializeHudInterface(currentHudConfig); }
private void SaveDroneAndHudConfigStates(DroneConfig droneConfig, HudConfig hudConfig) { currentDroneConfig = droneConfig; currentHudConfig = hudConfig; droneConfig.Save(); hudConfig.Save(); }
private void InitializeHudInterface(HudConfig hudConfig) { HudConstants hudConstants = new HudConstants(droneControl.FrontCameraFieldOfViewDegrees); hudInterface = new HudInterface(hudConfig, hudConstants); }