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();
        }
예제 #5
0
        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);
        }
예제 #7
0
        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;
        }
예제 #8
0
        private void Init(DroneConfig droneConfig)
        {
            this.droneConfig = droneConfig;
            droneConfig.Initialize();

            CreateDroneWorkers();

            internalDroneConfiguration = new InternalDroneConfiguration();
        }
예제 #9
0
        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;
        }
예제 #10
0
        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;
        }
예제 #11
0
        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;
        }
예제 #13
0
        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;
        }
예제 #14
0
        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;
        }
예제 #17
0
        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;
        }
예제 #18
0
        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;
        }
예제 #19
0
 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;
        }
예제 #21
0
        private void SaveDroneAndHudConfigStates(DroneConfig droneConfig, HudConfig hudConfig)
        {
            currentDroneConfig = droneConfig;
            currentHudConfig = hudConfig;

            droneConfig.Save();
            hudConfig.Save();
        }
예제 #22
0
        private void InitializeDroneControl()
        {
            currentDroneConfig = new DroneConfig();
            currentDroneConfig.Load();

            InitializeDroneControl(currentDroneConfig);
        }
예제 #23
0
 private void InitializeDroneControl(DroneConfig droneConfig)
 {
     droneControl = new DroneControl(droneConfig);
     //gps_start = new GPSDataRetriever();
 }
예제 #24
0
 private void InitializeDroneControl(DroneConfig droneConfig)
 {
     droneControl = new DroneControl();
     droneControl.Init(droneConfig);
 }
예제 #25
0
        public void Load()
        {
            CheckForDroneConfigState();

            DroneConfig droneConfig = new DroneConfig();
            try
            {
                droneConfig = (DroneConfig)serializationUtils.Deserialize(this.GetType(), serializationFileName);
            }
            catch (Exception)
            { }

            CopySettingsFrom(droneConfig);
        }
 public DroneSettingsWindowViewModel( DroneConfig config )
 {
     if ( config == null )
     {
         throw new ArgumentNullException( "Config cannot be null." );
     }
     this._droneConfig = config;
 }
예제 #27
0
        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();
 }
예제 #29
0
        private void Init(DroneConfig droneConfig)
        {
            this.droneConfig = droneConfig;
            droneConfig.Initialize();

            CreateDroneWorkers();

            internalDroneConfiguration = new InternalDroneConfiguration();
        }
예제 #30
0
        private void SaveDroneAndHudConfigStates(DroneConfig droneConfig/*, HudConfig hudConfig*/)
        {
            currentDroneConfig = droneConfig;
            //currentHudConfig = hudConfig;

            droneConfig.Save();
            //hudConfig.Save();
        }
예제 #31
0
 public DroneControl(DroneConfig droneConfig)
 {
     Init(droneConfig);
 }
예제 #32
0
        public void Init(DroneConfig droneConfig)
        {
            checkFlightMoveCommandStrategy = new CheckFlightMoveCommandStrategy();
            this.droneConfig = droneConfig;
            droneConfig.Initialize();

            CreateDroneWorkers();
        }
 public DroneSettingsEventArgs( DroneConfig newConfig, bool isPaired )
 {
     this.DroneConfig = newConfig;
     this.IsPaired = isPaired;
 }