コード例 #1
0
        /// <summary>
        /// 启动焊接场景
        /// </summary>
        public void StartWeldingScene()
        {
            ExamEnv.SwitchOnComplete();

            //WindowHelper.DeactiveWindow(this);
            DisableUI();

            Topmost = false;

            ExamEnv.StartWeldingScene(() => Dispatcher.Invoke(DispatcherPriority.Normal, new Action(
                                                                  () =>
            {
                //var iniPath = @"E:\Code\1010\VirtualWelding-A0-2016.8.30\bin - 副本\Release\weld\config\Score.ini";
                //MessageBox.Show(ScoreCalculator.CalcResult(ExamEnv.CurrentWeldingType, iniPath).ToString(CultureInfo.InvariantCulture));
                try
                {
                    Topmost = true;

                    StepToSwitchOffPage();

                    EnableUI();
                }
                catch (Exception ex)
                {
                    Logger.Error(ex.Message);
                }
            })));
        }
コード例 #2
0
        /// <summary>
        /// 跳转到检查隐患界面
        /// </summary>
        public void StepToCheckTroublePage()
        {
            CommonHelper.SpeechToPrompt("请检查安全隐患,完成后点击提交。");

            ExamEnv.SwitchOffComplete();

            Content = CheckTroublePage;
        }
コード例 #3
0
        /// <summary>
        /// 跳转到关开关界面
        /// </summary>
        private void StepToSwitchOffPage()
        {
            CommonHelper.SpeechToPrompt("关闭焊接相关的所有开关,完成后点击下一步。");

            ExamEnv.WeldingComplete();

            Content = SwitchOffPage;
        }
コード例 #4
0
        /// <summary>
        /// 跳转到推开关界面
        /// </summary>
        public void StepToSwitchOnPage()
        {
            CommonHelper.SpeechToPrompt("打开焊接相关的开关,完成后点击就绪按钮。");

            ExamEnv.InspectionBeforeWeldingComplete();

            Content = SwitchOnPage;
        }
コード例 #5
0
        private void Reset()
        {
            CommonHelper.examineeInfo = null;

            ExamEnv.Reset();

            Content = LoginPage;

            ResetIdCardReader();
        }
コード例 #6
0
        /// <summary>
        /// 跳转到焊前检查界面
        /// </summary>
        public void StepToInspectionPage()
        {
            CommonHelper.SpeechToPrompt("请检查电源线、二次线是否完好,完成后点击下一步。");

            ExamEnv.DressComplete();

            ExamEnv.PrintSelectedUtensil();

            Content = InspectionBeforeWeldingPage;
        }
コード例 #7
0
        public void Commit()
        {
            ExamEnv.CheckTroubleComplete();

            var score = ScoreCalculator.CalcResultAndCommit();

            Logger.Info("得分:{score.ToString(CultureInfo.InvariantCulture)}");

            //TODO
            StepToExamCompletePage();
            //Reset();
        }
コード例 #8
0
        /// <summary>
        /// 跳转到穿戴界面
        /// </summary>
        public void StepToDressPage()
        {
            CommonHelper.SpeechToPrompt("请根据焊接类型从工具柜中检查挑选正确的安全用具,并穿戴,操作完成后点击下一步。");

            ExamEnv.Reset();
            ExamEnv.RandomWelding();

            DressPage.Model.WeldingDescription = EnumHelper.GetEnumDescription(ExamEnv.CurrentWeldingType);//将随机产生的焊接类型赋值给穿戴界面

            Content = DressPage;
            ExamEnv.StartDetectUtensils();

            DressPage.DisableNextButtonFor1S();
        }
コード例 #9
0
        public MainWindow()
        {
            InitializeComponent();

            InitPages();

            InitSerialPort();

            Content = LoginPage;

            ResetIdCardReader();

            SetMaxWindow();

            ExamEnv = new ExamEnv();

            WindowInteropHelper = new WindowInteropHelper(this);

            DeviceStateConfig.LoadConfig();

            this.Loaded += MainWindowLoaded;
            Closed      += MainWindowClosed;
        }