Esempio n. 1
0
 public CommandInterpreter(DroneState droneState, VideoServer videoServer, StateServer stateServer, ILog log)
 {
     _droneState  = droneState ?? throw new ArgumentNullException(nameof(droneState));
     _videoServer = videoServer ?? throw new ArgumentNullException(nameof(videoServer));
     _stateServer = stateServer ?? throw new ArgumentNullException(nameof(stateServer));
     _log         = log;
 }
Esempio n. 2
0
        public Drone(ILog log, byte[] videoData, Sample[] sampleDefs)
        {
            _log = log;

            _udpReceiver = new Udp.UdpListener(8889);
            _udpReceiver.DatagramReceived += _udpReceiver_DatagramReceived;

            _droneState  = new DroneState();
            _stateServer = new StateServer(8890, _droneState);
            _videoServer = new VideoServer(11111, videoData, sampleDefs);

            _commandInterpreter = new CommandInterpreter(_droneState, _videoServer, _stateServer, log);

            _batteryTimer = new Timer(UpdateBattery, null, 10000, 10000);
        }