Exemplo n.º 1
0
 private void SetVariables(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue)
 {
     this.networkConnector = networkConnector;
     this.remoteIpAddress = remoteIpAddress;
     this.port = port;
     this.timeoutValue = timeoutValue;
 }
        public VideoDataRetriever(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue)
            : base(networkConnector, remoteIpAddress, port, timeoutValue)
        {
            bitmapUtils = new BitmapUtils();

            ResetVariables();
        }
        public ControlInfoRetriever(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue, SupportedFirmwareVersion firmwareVersion)
            : base(networkConnector, remoteIpAddress, port, timeoutValue)
        {
            this.firmwareVersion = firmwareVersion;

            ResetVariables();
        }
        public CommandSender(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue, DroneCameraMode defaultCameraMode)
            : base(networkConnector, remoteIpAddress, port, timeoutValue)
        {
            this.defaultCameraMode = defaultCameraMode;

            ResetVariables();
        }
 private void SetVariables(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue)
 {
     this.networkConnector = networkConnector;
     this.remoteIpAddress = remoteIpAddress;
     this.port = port;
     this.timeoutValue = timeoutValue;
     this.firmwareVersion = DroneConfig.DefaultSupportedFirmwareVersion;
 }
        public VideoDataRetriever(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue, SupportedFirmwareVersion firmwareVersion)
            : base(networkConnector, remoteIpAddress, port, timeoutValue)
        {
            this.firmwareVersion = firmwareVersion;

            bitmapUtils = new BitmapUtils();

            ResetVariables();
        }
        public CommandSender(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue, SupportedFirmwareVersion firmwareVersion, DroneCameraMode defaultCameraMode, DroneConfig droneConfig)
            : base(networkConnector, remoteIpAddress, port, timeoutValue)
        {
            this.firmwareVersion = firmwareVersion;
            this.defaultCameraMode = defaultCameraMode;
            this.droneConfig = droneConfig;

            ResetVariables();
        }
Exemplo n.º 8
0
 public TcpWorker(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue)
     : base(networkConnector, remoteIpAddress, port, timeoutValue)
 { }
Exemplo n.º 9
0
 public NetworkWorker(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue)
 {
     SetVariables(networkConnector, remoteIpAddress, port, timeoutValue);
 }
 public NavigationDataRetriever(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue)
     : base(networkConnector, remoteIpAddress, port, timeoutValue)
 {
     ResetVariables();
 }
Exemplo n.º 11
0
        private void CreateDroneWorkers()
        {
            networkConnector = new NetworkConnector(droneConfig.DroneNetworkIdentifierStart, droneConfig.StandardOwnIpAddress, droneConfig.DroneIpAddress);
            networkConnector.ConnectionStateChanged += networkConnector_ConnectionStateChanged;
            networkConnector.Error += networkWorker_Error;

            videoDataRetriever = new VideoDataRetriever(networkConnector, droneConfig.DroneIpAddress, droneConfig.VideoPort, droneConfig.TimeoutValue);
            videoDataRetriever.ConnectionStateChanged += networkWorker_ConnectionStateChanged;
            videoDataRetriever.Error += networkWorker_Error;

            navigationDataRetriever = new NavigationDataRetriever(networkConnector, droneConfig.DroneIpAddress, droneConfig.NavigationPort, droneConfig.TimeoutValue);
            navigationDataRetriever.ConnectionStateChanged += networkWorker_ConnectionStateChanged;
            navigationDataRetriever.Error += networkWorker_Error;

            commandSender = new CommandSender(networkConnector, droneConfig.DroneIpAddress, droneConfig.CommandPort, droneConfig.TimeoutValue, droneConfig.DefaultCameraMode);
            commandSender.ConnectionStateChanged += networkWorker_ConnectionStateChanged;
            commandSender.Error += networkWorker_Error;

            controlInfoRetriever = new ControlInfoRetriever(droneConfig.DroneIpAddress);

            // Interop between the different threads
            commandSender.DataRetriever = navigationDataRetriever;

            networkSanityChecker = new NetworkSanityChecker(videoDataRetriever, navigationDataRetriever, commandSender, droneConfig.FirmwareVersion);
            networkSanityChecker.SanityCheckComplete += networkSanityChecker_SanityChecked;
        }
 public KeepAliveNetworkWorker(NetworkConnector networkConnector, String remoteIpAddress, int port, int timeoutValue)
     : base(networkConnector, remoteIpAddress, port, timeoutValue)
 {
     keepAliveStopwatch = new Stopwatch();
 }
Exemplo n.º 13
0
        private void CreateDroneWorkers()
        {
            if (MessageBox.Show("Please turn on your AR Drone. Make sure the LED's are green.\n\nMake sure your wireless adapter is turned on.\nYou do not have to be connected to the drone yet.\n\nAre you using an Parrot AR Drone 2.0?", "AR Drone 2.0?", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                this.setDroneVersion(2);
            }
            else
            {
                this.setDroneVersion(1);
            }

            networkConnector = new NetworkConnector(droneConfig.DroneNetworkIdentifierStart, droneConfig.StandardOwnIpAddress, droneConfig.DroneIpAddress);
            networkConnector.ConnectionStateChanged += networkConnector_ConnectionStateChanged;
            networkConnector.Error += networkWorker_Error;

            videoDataRetriever = new VideoDataRetriever(networkConnector, droneConfig.DroneIpAddress, droneConfig.VideoPort, droneConfig.TimeoutValue);
            videoDataRetriever.ConnectionStateChanged += networkWorker_ConnectionStateChanged;
            videoDataRetriever.Error += networkWorker_Error;

            //ADDED THIS CODE!
            //gpsDataRetriever = new GPSDataRetriever(networkConnector, droneConfig.DroneIpAddress, droneConfig.GPSPort, droneConfig.TimeoutValue);
            //gpsDataRetriever.ConnectionStateChanged += networkWorker_ConnectionStateChanged;
            //gpsDataRetriever.Error += networkWorker_Error;

            navigationDataRetriever = new NavigationDataRetriever(networkConnector, droneConfig.DroneIpAddress, droneConfig.NavigationPort, droneConfig.TimeoutValue);
            navigationDataRetriever.ConnectionStateChanged += networkWorker_ConnectionStateChanged;
            navigationDataRetriever.Error += networkWorker_Error;

            commandSender = new CommandSender(networkConnector, droneConfig.DroneIpAddress, droneConfig.CommandPort, droneConfig.TimeoutValue, droneConfig.DefaultCameraMode);
            commandSender.ConnectionStateChanged += networkWorker_ConnectionStateChanged;
            commandSender.Error += networkWorker_Error;

            controlInfoRetriever = new ControlInfoRetriever(droneConfig.DroneIpAddress);

            // Interop between the different threads
            commandSender.DataRetriever = navigationDataRetriever;

            networkSanityChecker = new NetworkSanityChecker(videoDataRetriever, navigationDataRetriever, commandSender, droneConfig.FirmwareVersion);
            networkSanityChecker.SanityCheckComplete += networkSanityChecker_SanityChecked;
        }