public GeneralConfigWindow(DroneConfig droneConfig, HudConfig hudConfig)
        {
            InitializeComponent();
            SetDialogSettings(droneConfig, hudConfig);

            UpdateDependentHudCheckBoxes(hudConfig.ShowHud);
        }
Exemplo n.º 2
0
        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));
            }
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 5
0
        public HudInterface(HudConfig hudConfig, HudConstants constants)
        {
            drawingUtils = new DrawingUtils();
            currentState = new HudState();

            ConfigureHud(hudConfig, constants);
        }
        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;
 }
Exemplo n.º 9
0
        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;
        }
Exemplo n.º 10
0
        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;
        }
Exemplo n.º 11
0
        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));
        }
Exemplo n.º 13
0
        private void InitializeHudInterface()
        {
            _currentHudConfig = new HudConfig();

            HudConstants hudConstants = new HudConstants( _droneControl.FrontCameraFieldOfViewDegrees );

            _hudInterface = new HudInterface( _currentHudConfig, hudConstants );
        }
Exemplo n.º 14
0
        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();
 }
Exemplo n.º 17
0
        private void InitializeHudInterface()
        {
            currentHudConfig = new HudConfig();
            currentHudConfig.Load();

            InitializeHudInterface(currentHudConfig);
        }
Exemplo n.º 18
0
        private void SaveDroneAndHudConfigStates(DroneConfig droneConfig, HudConfig hudConfig)
        {
            currentDroneConfig = droneConfig;
            currentHudConfig = hudConfig;

            droneConfig.Save();
            hudConfig.Save();
        }
Exemplo n.º 19
0
        private void InitializeHudInterface(HudConfig hudConfig)
        {
            HudConstants hudConstants = new HudConstants(droneControl.FrontCameraFieldOfViewDegrees);

            hudInterface = new HudInterface(hudConfig, hudConstants);
        }