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

            UpdateDependentHudCheckBoxes(hudConfig.ShowHud);
        }
예제 #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));
            }
        }
예제 #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;
        }
예제 #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;
 }
예제 #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;
        }
예제 #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;
        }
예제 #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));
        }
예제 #13
0
        private void InitializeHudInterface()
        {
            _currentHudConfig = new HudConfig();

            HudConstants hudConstants = new HudConstants( _droneControl.FrontCameraFieldOfViewDegrees );

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

            InitializeHudInterface(currentHudConfig);
        }
예제 #18
0
        private void SaveDroneAndHudConfigStates(DroneConfig droneConfig, HudConfig hudConfig)
        {
            currentDroneConfig = droneConfig;
            currentHudConfig = hudConfig;

            droneConfig.Save();
            hudConfig.Save();
        }
예제 #19
0
        private void InitializeHudInterface(HudConfig hudConfig)
        {
            HudConstants hudConstants = new HudConstants(droneControl.FrontCameraFieldOfViewDegrees);

            hudInterface = new HudInterface(hudConfig, hudConstants);
        }