コード例 #1
0
 public void NotifyInspectieEdited(Inspectie i)
 {
     InspectionList.Remove(InspectionList.FirstOrDefault(inspectie => inspectie.Id == i.Id));
     InspectionList.Add(new InspectieVM(i));
     _editWindow.Close();
     _editWindow = null;
 }
コード例 #2
0
 /// <summary>
 /// 数据加载完成后更新
 /// </summary>
 private void OnDataLoadedCompleted()
 {
     if(IsInspection)
     {
         SelectedInspectionItem = InspectionList.FirstOrDefault();
     }
 }
コード例 #3
0
        public DataFilterViewModel()
        {
            ClearCommond = new RelayCommand(DoClearCommond);
            StartFilterCommond = new RelayCommand(DoStartFilterCommond);

            BookmarkSource = new Dictionary<int, string>()
            {
                {-2, Languagekeys.BookmarkAll },
                {0, Languagekeys.BookmarkYes },
                {-1, Languagekeys.BookmarkNone },
            };
            DataStateSource = new Dictionary<EnumDataState, string>()
            {
                { EnumDataState.None, Languagekeys.DataStateAll },
                { EnumDataState.Normal,Languagekeys.DataStateNormal },
                { EnumDataState.Deleted ,Languagekeys.DataStateDelete }
            };
            KeywordTypeSource = new Dictionary<int, string>()
            {
                {0, Languagekeys.Keyword },
                {1, Languagekeys.ZhengZe},
            };

            MessageAggregation.RegisterGeneralMsg<ObservableCollection<DataExtactionItem>>(this, MessageKeys.SetDataListKey, SetDataListKey);
            MessageAggregation.RegisterGeneralMsg<object>(this, MessageKeys.DataLoadedCompletedKey, b=> OnDataLoadedCompleted());
            //设置智能预警参数
            MessageAggregation.RegisterGeneralMsg<List<Inspection>>(this, MessageKeys.InspectionKey, b =>
            {
                IsInspection = true;
                InspectionList.Clear();
                InspectionList.AddRange(b.Parameters.Select(i => new InspectionItem() { Id = i.ID, Name = LanguageHelper.LanguageManager.Type == Framework.Language.LanguageType.En ? i.CategoryEn : i.CategoryCn, Icon = null }));
                //SelectedInspectionItem = InspectionList.FirstOrDefault();
            });
        }
コード例 #4
0
 public void DeleteInspectie()
 {
     if (providerItem.dataServer.GetVragenlijstenWithInspectieId(SelectedInspectie.Id).Count < 1)
     {
         providerItem.dataServer.RemoveInspection(SelectedInspectie.InspectieModel);
         InspectionList.Remove(SelectedInspectie);
     }
     else
     {
         MessageBox.Show("Kan inspectie niet verwijderen. Inspectie heeft één of meerdere vragenlijsten");
     }
 }
コード例 #5
0
        /// <summary>
        /// 外観検査モード主処理
        /// </summary>
        /// <returns>正常終了/異常終了</returns>
        public bool MainProc()
        {
            log.System("検査モード 開始");
            string recipe_fpath = m_cfg.RecipeFileList[m_recipeNo];

            // レシピファイルリード
            m_insList = InspectionList.LoadRecipeFile(recipe_fpath);
            if (m_insList == null)
            {
                CommonUI.MsgBox.Error($"検査レシピ取得エラー\r\nレシピ'{m_recipeNo}'をリード中に異常がありました");
                return(false);
            }
            // デバイス異常時のコールバック設定
            m_devMgr.OnErrorEnd += OnDeviceErrorEnd;

            m_devMgr.InputID += OnDeviceInputId;
            m_step            = InspectionStep.None;

            // プリンタの使用有無設定更新
            m_devMgr.Printer.Use = !string.IsNullOrEmpty(m_insList.TemplateFileNameBarcode);

            // メイン画面生成
            m_fmMain = new UI.FormAppearanceInspection(m_recipeNo, m_user, m_insList);
            var fmtask = UITask(m_fmMain);

            // 検査処理タスク
            var insTask = Task.Factory.StartNew(MainInspectionTask, TaskCreationOptions.LongRunning);

            insTask.ContinueWith(t => {
                if (t.Result == ProcResult.Error)
                {
                    m_fmMain.Destroy();
                }
            });

            try
            {
                // メイン画面終了待ち
                fmtask.Wait(m_cts.Token);
            }
            catch (Exception)
            {
                m_cts.Cancel();
            }
            m_cts.Dispose();


            m_devMgr.InputID -= OnDeviceInputId;
            bool bret = fmtask.Result == CommonUI.FormResult.OK  || fmtask.Result == CommonUI.FormResult.Cancel;

            log.System("検査モード 終了 : 結果={0}", bret);
            return(bret);
        }