コード例 #1
0
ファイル: MainWindow.cs プロジェクト: grasmanek94/LPA
        private void SearchDevices()
        {
            //set _DecompressieKamer if found to != null
            Searcher searcher = new Searcher(this);

            if (_DecompressieKamer != null)
            {
                _DecompressieKamer.Dispose();
                _DecompressieKamer = null;
                searcher.Text = "Connection lost, reconnecting...";
                //reset all local stats here and wait for remote stats then update here
            }

            searcher.ShowDialog();
            if (_DecompressieKamer == null)
            {
                Application.Exit();
            }
            else
            {
                //success, connected with Decompression chamber
                _DecompressieKamer.OnEvent += _DecompressieKamer_OnEvent;
                _DecompressieKamer.StartProcessing();
            }
        }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: grasmanek94/LPA
        private void SearchDevices()
        {
            //set _DecompressieKamer if found to != null
            Searcher searcher = new Searcher(this);

            if (_DecompressieKamer != null)
            {
                _DecompressieKamer.Dispose();
                _DecompressieKamer = null;
                searcher.Text      = "Connection lost, reconnecting...";
                //reset all local stats here and wait for remote stats then update here
            }

            searcher.ShowDialog();
            if (_DecompressieKamer == null)
            {
                Application.Exit();
            }
            else
            {
                //success, connected with Decompression chamber
                _DecompressieKamer.OnEvent += _DecompressieKamer_OnEvent;
                _DecompressieKamer.StartProcessing();
            }
        }
コード例 #3
0
 private void _SearchThread_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     if (_SearchThread.Interval == 10)
     {
         _SearchThread.Interval = 600000;
         try
         {
             //search for an available decompression chamber, if not found exception is thrown because the class cannot do it's work then.. ask user what to do
             _DecompressieKamer = new DecompressieKamer(15000);
         }
         catch (NoDeviceFoundException)
         {
         }
         _SearchThread.Stop();
     }
 }
コード例 #4
0
ファイル: Searcher.cs プロジェクト: grasmanek94/LPA
        private void _SearchThread_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (_SearchThread.Interval == 10)
            {
                _SearchThread.Interval = 600000;
                try
                {
                    //search for an available decompression chamber, if not found exception is thrown because the class cannot do it's work then.. ask user what to do
                    _DecompressieKamer = new DecompressieKamer(15000);
                }
                catch (NoDeviceFoundException)
                {

                }
                _SearchThread.Stop();
            }
        }
コード例 #5
0
ファイル: Searcher.cs プロジェクト: grasmanek94/LPA
        public Searcher(MainWindow main)
        {
            InitializeComponent();

            _MainWindow = main;

            _DecompressieKamer = null;

            _SearchThread = new System.Timers.Timer();
            _SearchThread.Interval = 10;
            _SearchThread.Elapsed += _SearchThread_Elapsed;
            _SearchThread.Start();

            _RefreshTimer = new Timer();
            _RefreshTimer.Interval = 50;
            _RefreshTimer.Tick += _RefreshTimer_Tick;
            _RefreshTimer.Start();
        }
コード例 #6
0
        public Searcher(MainWindow main)
        {
            InitializeComponent();

            _MainWindow = main;

            _DecompressieKamer = null;

            _SearchThread          = new System.Timers.Timer();
            _SearchThread.Interval = 10;
            _SearchThread.Elapsed += _SearchThread_Elapsed;
            _SearchThread.Start();

            _RefreshTimer          = new Timer();
            _RefreshTimer.Interval = 50;
            _RefreshTimer.Tick    += _RefreshTimer_Tick;
            _RefreshTimer.Start();
        }
コード例 #7
0
ファイル: MainWindow.cs プロジェクト: grasmanek94/LPA
 public MainWindow()
 {
     InitializeComponent();
     _DecompressieKamer = null;
 }
コード例 #8
0
ファイル: MainWindow.cs プロジェクト: grasmanek94/LPA
 public MainWindow()
 {
     InitializeComponent();
     _DecompressieKamer = null;
 }