Exemplo n.º 1
0
        void MeasureWindow_Loaded(object sender, RoutedEventArgs e)
        {
            SetInfo(stringRes.checkResult1, System.Windows.Media.Brushes.Black);
            workingCameraID = 1;
            myCanvas.Children.Clear();
            myCanvas.Visibility = Visibility.Hidden;
            loading.Visibility = Visibility.Visible;
            try
            {
                int samples2Show = GetSampleCountThisSnapShot();
                visualHost = new MyVisualHost(false, samples2Show);
                visualHost.onPositionChanged += new MyVisualHost.PositionChanged(visualHost_onPositionChanged);
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);
            }
            //SetStage(curStage);
            myCanvas.Children.Add(visualHost);
            if (winMoreInfo == null)
                winMoreInfo = new MoreInfo();
            winMoreInfo.Show();
            winMoreInfo.Visibility = System.Windows.Visibility.Hidden;
            winMoreInfo.Topmost = true;
            winMoreInfo.Top = 0;
            winMoreInfo.Left = SystemParameters.PrimaryScreenWidth - winMoreInfo.Width;

            string sLatest = Helper.GetLatestImagePath();
            if(!bUseTestImage)
                EnableButtons(false);
            StartAcquire();
        }
Exemplo n.º 2
0
        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            log.Info("Next click");
            EnableButtons(false);
            bool bok = SaveMeasureInfo();
            if (!bok)
            {
                EnableButtons(true);
                return;
            }
            if (workingCameraID == 1 && GlobalVals.samplesThisBatch > GlobalVals.samplesPerCamera) //second camera
            {
                SetInfo(stringRes.checkResult2, System.Windows.Media.Brushes.Black);
                workingCameraID = 2;
                visualHost = new MyVisualHost(false,
                    GlobalVals.samplesThisBatch - GlobalVals.samplesPerCamera,
                    GlobalVals.samplesPerCamera);
                myCanvas.Children.Clear();
                visualHost.onPositionChanged +=new MyVisualHost.PositionChanged(visualHost_onPositionChanged);
                myCanvas.Children.Add(visualHost);
                StartAcquire();
                return;
            }

            if (winMoreInfo != null)
            {
                winMoreInfo.Close();
                winMoreInfo = null;
            }
            workingCameraID = 1; //switch back to first camera;
            onFinished();
        }