Esempio n. 1
0
        public Window()
        {
            InitializeComponent();
            _um6Driver = new Um6Driver("COM1", 115200);
            _um6Driver.Init();
            _servoDriver = new ServoDriver();
            _updateTimer = new System.Timers.Timer(50);
            _updateTimer.Elapsed += _updateTimer_Elapsed;
            _cameraDriver = new CameraDriver(this.Handle.ToInt64());
            _cameraDriver.Init(pictureBox.Handle.ToInt64());
            _cameraDriver.CameraCapture += _cameraDriver_CameraCapture;

            // initialize the service
            //_host = new ServiceHost(typeof(SatService));
            NetTcpBinding binding = new NetTcpBinding();
            binding.MaxReceivedMessageSize = 20000000;
            binding.MaxBufferPoolSize = 20000000;
            binding.MaxBufferSize = 20000000;
            binding.Security.Mode = SecurityMode.None;
            _service = new SatService(_cameraDriver);
            _host = new ServiceHost(_service);
            _host.AddServiceEndpoint(typeof(ISatService),
                                   binding,
                                   "net.tcp://localhost:8000");
            _host.Open();

            _stabPitchServo = 6000;
            _stabYawServo = 6000;
        }
Esempio n. 2
0
 /**
  * Initiate the service endpoint for the WCF service contract
  */
 private void initService()
 {
     NetTcpBinding binding = new NetTcpBinding();
     binding.MaxReceivedMessageSize = 20000000;
     binding.MaxBufferPoolSize = 20000000;
     binding.MaxBufferSize = 20000000;
     binding.Security.Mode = SecurityMode.None;
     _service = new SatService(_container);
     _host = new ServiceHost(_service);
     _host.AddServiceEndpoint(typeof(ISatService),
                              binding,
                              "net.tcp://localhost:8000");
     _host.Open();
     _logger.log("Service launched on 'localhost:8000'");
 }