Beispiel #1
0
        public CamControl(ICam cam, RefreshRate refreshRate)
        {
            _cam = cam;
            _cam.ImageChangedEvent += UnderlyingImageChanged;

            RefreshRate = refreshRate;
            RefreshTimer = new Timer(Convert.ToDouble(refreshRate));
            RefreshTimer.Elapsed += RefreshTimerOnElapsed;
            RefreshTimer.Start();
        }
Beispiel #2
0
        public CamControl(ICam cam, RefreshRate refreshRate)
        {
            _cam = cam;
            _cam.ImageChangedEvent += UnderlyingImageChanged;

            RefreshRate           = refreshRate;
            RefreshTimer          = new Timer(Convert.ToDouble(refreshRate));
            RefreshTimer.Elapsed += RefreshTimerOnElapsed;
            RefreshTimer.Start();
        }
Beispiel #3
0
        public CamUi(ICam cam, int refreshRateInMs)
        {
            _camera = cam;
            _refreshInMiliseconds = refreshRateInMs;

            SizeMode = PictureBoxSizeMode.Zoom;
            Click   += OnClick;

            BackColor = Color.Black;

            _timer          = new System.Timers.Timer(1);
            _timer.Elapsed += TimerOnElapsed;
            _timer.Start();

            ImageLoaded += OnLoadCompleted;
            Paint       += OnPaint;

            _camera.ImageChangedEvent += ImageChangedEvent;
        }
Beispiel #4
0
        public CamUi(ICam cam, int refreshRateInMs)
        {
            _camera = cam;
            _refreshInMiliseconds = refreshRateInMs;

            SizeMode = PictureBoxSizeMode.Zoom;
            Click += OnClick;

            BackColor = Color.Black;

            _timer = new System.Timers.Timer(1);
            _timer.Elapsed += TimerOnElapsed;
            _timer.Start();

            ImageLoaded += OnLoadCompleted;
            Paint += OnPaint;

            _camera.ImageChangedEvent += ImageChangedEvent;
        }
Beispiel #5
0
        public ICam Connect()
        {
            if(Address == null)
                throw new CamException("No Address given");

            if(UserName == null)
                throw new CamException("No UserName given");

            if(Password == null)
                throw new CamException("No Password given");

            if(_cam == null)
            {
                _cam = CamFactory.Connect(Address, Port, UserName, Password, (ex) =>
                {
                    MessageBoxHelper.ShowError(ex);
                });
            }

            return _cam;
        }
Beispiel #6
0
 public void Disconnect()
 {
     _cam = null;
 }