static StationDisplay() { var db = DbScheme.GetConnection("Main"); int ccdCount = CcdCount; Panels = new Panel[ccdCount]; DisplayWindows = new CogRecordDisplay[ccdCount]; var tp = MyTabs["Display", 0]; int width = tp.Width / 2; int height = tp.Height; for (int i = 0; i < ccdCount; i++) { Panels[i] = new Panel(); DisplayWindows[i] = new CogRecordDisplay(); Panels[i] = new Panel(); DisplayWindows[i] = new CogRecordDisplay(); DisplayWindows[i].Dock = DockStyle.Fill; DisplayWindows[i].Tag = false; Panels[i].Controls.Add(DisplayWindows[i]); tp.Controls.Add(Panels[i]); } Panels[0].Location = new Point(0, 0); Panels[0].Size = new Size(width, height); Panels[1].Location = new Point(width, 0); Panels[1].Size = new Size(width, height); for (int i = 0; i < CcdCount; i++) { Panels[i].Tag = i; } Stations = new Dictionary <int, StationDisplay>(); for (int i = 0; i < ccdCount; i++) { Stations[i] = new StationDisplay(i); Stations[i].SetDoubleClick(); Label myLabel = new Label(); myLabel.Text = string.Format("画面{0}", i + 1); myLabel.Location = new Point(20, 20); myLabel.ForeColor = Color.Yellow; Stations[i][i].Controls.Add(myLabel); } }
public bool init(string vpppath, CogRecordDisplay cogRecordDisplayin = null) { if (null == vpppath) { return false; } try { myJobManager = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath); myJob = myJobManager.Job(0); myJobIndependent = myJob.OwnedIndependent; myJobManager.UserQueueFlush(); myJobManager.FailureQueueFlush(); myJob.ImageQueueFlush(); myJobIndependent.RealTimeQueueFlush(); updateDisplaySource(cogRecordDisplayin); } catch { } return true; }
public bool init0(string vpppath0, CogRecordDisplay cogRecordDisplayin0 = null) { updateDisplaySource0(cogRecordDisplayin0); if (null == vpppath0) { return false; } try { myJobManager0 = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath0); myJob0 = myJobManager0.Job(0); myJobIndependent0 = myJob0.OwnedIndependent; myJobManager0.UserQueueFlush(); myJobManager0.FailureQueueFlush(); myJob0.ImageQueueFlush(); myJobIndependent0.RealTimeQueueFlush(); } catch { return false; } return true; }
public Boolean ROI_create(CogRecordDisplay CogRecordDisplay1) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { //initial RunParams mFindLineTool.RunParams.ExpectedLineSegment.StartX = mStartX; mFindLineTool.RunParams.ExpectedLineSegment.StartY = mStartY; mFindLineTool.RunParams.ExpectedLineSegment.EndX = mEndX; mFindLineTool.RunParams.ExpectedLineSegment.EndY = mEndY; mFindLineTool.RunParams.NumCalipers = mNumCalipers; mFindLineTool.RunParams.CaliperSearchLength = mCaliperSearchLength; mFindLineTool.RunParams.CaliperProjectionLength = mCaliperProjectionLength; mFindLineTool.RunParams.CaliperSearchDirection = mCaliperSearchDirection; mFindLineTool.InputImage = (CogImage8Grey)CogRecordDisplay1.Image; CogRecordDisplay1.Record = mFindLineTool.CreateCurrentRecord().SubRecords["InputImage"]; return(true); } catch (Exception ex) { SaveLog.Msg_("FindLineTool ROI_create Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); FindLineTool_Status = false; return(false); } }
public bool ROI_Create(CogRecordDisplay mCogRecordDisplay) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { Double CenterX = 107.25; Double CenterY = 89.25; Double XLength = 107.5; Double YLength = 89.5; mOCR_ROI.GraphicDOFEnable = CogRectangleAffineDOFConstants.All; mOCR_ROI.Interactive = true; mOCR_ROI.CenterX = CenterX; mOCR_ROI.CenterY = CenterY; mOCR_ROI.SideXLength = XLength; mOCR_ROI.SideYLength = YLength; mCogRecordDisplay.InteractiveGraphics.Add(mOCR_ROI, "ID_ROI_Area", false);//在影像上加入教讀框 return(true); } catch (Exception ex) { SaveLog.Msg_("OCRMaxTool Teach Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); return(false); } }
public bool Run(CogRecordDisplay mCogRecordDisplay) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { mOCRMaxTool.Run(); ICogRunStatus aRunStatus = mOCRMaxTool.RunStatus; if (aRunStatus.Result == CogToolResultConstants.Error) { SaveLog.Msg_("Error running CogOCRMaxTool."); mOCRMaxTool_Status = false; return(false); } else { mCogRecordDisplay.Record = mOCRMaxTool.CreateLastRunRecord().SubRecords["InputImage"]; SaveLog.Msg_(mOCRMaxTool.LineResult.ResultString); mOCRMaxTool_Status = true; return(true); } } catch (Exception ex) { SaveLog.Msg_("OCRMaxTool Run Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); mOCRMaxTool_Status = false; return(false); } }
public bool ROI_Create(CogRecordDisplay mCogRecordDisplay) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { mLineMaxTool_ROI.GraphicDOFEnable = CogRectangleAffineDOFConstants.All; mLineMaxTool_ROI.Interactive = true; mLineMaxTool_ROI.CenterX = mCogRecordDisplay.PanX; mLineMaxTool_ROI.CenterY = mCogRecordDisplay.PanY; mLineMaxTool_ROI.SideXLength = 100; mLineMaxTool_ROI.SideYLength = 100; mLineMaxTool.InputImage = (CogImage8Grey)mCogRecordDisplay.Image; //mCogRecordDisplay.InteractiveGraphics.Add(mLineMaxTool_ROI, "LineMAx_ROI_Area", false);//在影像上加入教讀框 mCogRecordDisplay.Record = mLineMaxTool.CreateCurrentRecord().SubRecords["InputImage"]; return(true); } catch (Exception ex) { SaveLog.Msg_("LineMaxTool ROI_Create Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); return(false); } }
public Boolean LoadFromVPPFile(string FileName, CogRecordDisplay mCogRecordDisplay)//檔案參數載入 { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); string TempFileName = (string)FileName; try { //從CogTool裡面讀出來 string strFolderPath = @"D:\VPS_File\Product\PMA_Tool\" + @FileName + @"\"; CogToolBlock ToolBlock1 = new CogToolBlock(); FileName = strFolderPath + FileName + "_PMA.vpp"; ToolBlock1 = (CogToolBlock)CogSerializer.LoadObjectFromFile(FileName);//開啟ToolBlock vpp檔案 //依序載入 mPMA_Tool = (CogPMAlignTool)ToolBlock1.Tools[TempFileName + "_PMA_Tool_"]; this.ROI_Create(mCogRecordDisplay); SaveLog.Msg_("Data of PMA_Tool Loaded : " + @FileName); ToolBlock1 = null; return(true); } catch (Exception ex) { SaveLog.Msg_("Load PMA_Tool Data Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); return(false); } }
public MainWindow() { InitializeComponent(); cogDisplay = new CogRecordDisplay(); CogDisplay_WFH.Child = cogDisplay; }
public bool Run(CogRecordDisplay mCogRecordDisplay) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { mIDTool.InputImage = (CogImage8Grey)mCogRecordDisplay.Image; mIDTool.RunParams.DisableAllCodes(); mIDTool.RunParams.QRCode.Enabled = true; mIDTool.Region = mID_ROI; mIDTool.Run(); if (mIDTool.RunStatus.Result == CogToolResultConstants.Accept && mIDTool.Results.Count > 0) { mCogRecordDisplay.StaticGraphics.Add(mIDTool.Results[0].CreateResultGraphics(CogIDResultGraphicConstants.All), "Result"); mIDTool_Status = true; mDecodedData = mIDTool.Results[0].DecodedData.DecodedString; SaveLog.Msg_("2D Code : " + mIDTool.Results[0].DecodedData.DecodedString); return(true); } else { mDecodedData = "NG"; SaveLog.Msg_("讀取2D Code失敗。"); return(false); } } catch (Exception ex) { SaveLog.Msg_("IDTool Run Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); return(false); } }
public WindowTweak(LeiSai leiSai, DataLogger dataLogger, CogRecordDisplay recordDisplay, string vppPath, Button btnRunManually, ResultCategories resultCategories = ResultCategories.OK_NG) { // set up style of recordDisplay _recordDisplay = recordDisplay; _recordDisplay.CreateControl(); _recordDisplay.AutoFit = true; _recordDisplay.VerticalScrollBar = false; _recordDisplay.HorizontalScrollBar = false; _recordDisplay.DoubleClick += (sender, args) => ShowDialog(); _resultCategories = resultCategories; // disable button before vpp is loaded _btnRunManually = btnRunManually; _btnRunManually.Click += BtnRunOnClick; _btnRunManually.IsEnabled = false; _vppPath = vppPath; // vpp loaded here InitializeComponent(); // Triggered can only be subscribed after vpp is loaded _leiSai = leiSai; _leiSai.Triggered += (sender, args) => cond_ReadyToRun.Set(); _leiSai.StartListening(); _dataLogger = dataLogger; Task.Factory.StartNew(Execute, _cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); }
public bool clearAllDisplaySource() { cogRecordDisplay0 = null; cogRecordDisplay1 = null; cogRecordDisplay2 = null; return true; }
public Boolean ROI_create(CogRecordDisplay CogRecordDisplay1) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { //initial RunParams mFindCircleTool.RunParams.ExpectedCircularArc.CenterX = mCenterX; mFindCircleTool.RunParams.ExpectedCircularArc.CenterY = mCenterY; mFindCircleTool.RunParams.ExpectedCircularArc.Radius = mRadius; mFindCircleTool.RunParams.ExpectedCircularArc.AngleStart = mAngleStart; mFindCircleTool.RunParams.ExpectedCircularArc.AngleSpan = mAngleSpan; mFindCircleTool.RunParams.NumCalipers = mNumCalipers; mFindCircleTool.RunParams.CaliperSearchLength = mCaliperSearchLength; mFindCircleTool.RunParams.CaliperProjectionLength = mCaliperProjectionLength; mFindCircleTool.RunParams.CaliperSearchDirection = mCircleSearchDirectionOption; mFindCircleTool.RunParams.NumToIgnore = mNumToIgnore; mFindCircleTool.RunParams.CaliperRunParams.Edge0Polarity = mCogCaliperPolarityConstants; mFindCircleTool.InputImage = (CogImage8Grey)CogRecordDisplay1.Image; CogRecordDisplay1.Record = mFindCircleTool.CreateCurrentRecord().SubRecords["InputImage"]; return(true); } catch (Exception ex) { SaveLog.Msg_("FindCircleTool ROI_create Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); FindCircleTool_Status = false; return(false); } }
public Boolean ROI_create(CogRecordDisplay CogRecordDisplay1, Runparams runparams) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { //initial RunParams m_FindCircleTool.RunParams.ExpectedCircularArc.CenterX = runparams.mCenterX; m_FindCircleTool.RunParams.ExpectedCircularArc.CenterY = runparams.mCenterY; m_FindCircleTool.RunParams.ExpectedCircularArc.Radius = runparams.mRadius; m_FindCircleTool.RunParams.ExpectedCircularArc.AngleStart = runparams.mAngleStart; m_FindCircleTool.RunParams.ExpectedCircularArc.AngleSpan = runparams.mAngleSpan; m_FindCircleTool.RunParams.NumCalipers = runparams.mNumCalipers; m_FindCircleTool.RunParams.CaliperSearchLength = runparams.mCaliperSearchLength; m_FindCircleTool.RunParams.CaliperProjectionLength = runparams.mCaliperProjectionLength; m_FindCircleTool.RunParams.CaliperSearchDirection = runparams.mCircleSearchDirectionOption; m_FindCircleTool.RunParams.NumToIgnore = runparams.mNumToIgnore; m_FindCircleTool.RunParams.CaliperRunParams.Edge0Polarity = runparams.mCogCaliperPolarityConstants; m_FindCircleTool.InputImage = (CogImage8Grey)CogRecordDisplay1.Image; CogRecordDisplay1.Record = m_FindCircleTool.CreateCurrentRecord().SubRecords["InputImage"]; return(true); } catch (Exception ex) { MessageBox.Show(ex.ToString()); FindCircleTool_Status = false; return(false); } }
/// <summary> /// 更新显示源 /// </summary> /// /// <param name="cogRecordDisplayin">< VisionPro显示控件句柄 ></param> /// /// <returns>< bool判定是否更新成功 ></returns> public bool updateDisplaySource(CogRecordDisplay cogRecordDisplayin = null) { if (null == cogRecordDisplayin) { return false; } cogRecordDisplay = cogRecordDisplayin; return true; }
/// <summary> /// 更新显示源 /// </summary> /// /// <param name="cogRecordDisplayin">< VisionPro显示控件句柄 ></param> /// /// <returns>< bool判定是否更新成功 ></returns> public bool updateDisplaySource(CogRecordDisplay cogRecordDisplayin = null) { if (null == cogRecordDisplayin) { return(false); } cogRecordDisplay = cogRecordDisplayin; return(true); }
public bool updateDisplaySource3(CogRecordDisplay cogRecordDisplayin) { if (null == cogRecordDisplayin) { return false; } cogRecordDisplay3 = cogRecordDisplayin; return true; }
public VisionAppObject() { // Khởi tạo Acq cogAcqFifoEdit = new CogAcqFifoEditV2(); cogAcqFifoEdit.Subject = new CogAcqFifoTool(); // Khởi tạo Image file Tool cogImageFileTool = new CogImageFileEditV2(); cogImageFileTool.Subject = new CogImageFileTool(); // Khởi tạo Fixture Tool cogFixtureTool = new CogFixtureEditV2(); cogFixtureTool.Subject = new CogFixtureTool(); // Khởi tạo PM Align Tool pmAlignToolEdit = new CogPMAlignEditV2(); pmAlignToolEdit.Subject = new CogPMAlignTool(); // Khởi tạo Sharpness Tool sharpnessToolEdit1 = new CogImageSharpnessEditV2(); sharpnessToolEdit1.Subject = new CogImageSharpnessTool(); sharpnessToolEdit2 = new CogImageSharpnessEditV2(); sharpnessToolEdit2.Subject = new CogImageSharpnessTool(); // Giá trị max, min Sharpness mặc định minSharpness1 = Settings.Default.MinSharpness1; maxSharpness1 = Settings.Default.MaxSharpness1; minSharpness2 = Settings.Default.MinSharpness2; maxSharpness2 = Settings.Default.MaxSharpness2; // Khởi tạo Cogdisplay cogDisplayMain = new CogRecordDisplay(); // Load Old Job LoadCameraJobFromUrl(); // Xóa Binding cũ if (cogFixtureTool.Subject.DataBindings.Contains("InputImage")) { cogFixtureTool.Subject.DataBindings.Remove("InputImage"); } if (pmAlignToolEdit.Subject.DataBindings.Contains("InputImage")) { pmAlignToolEdit.Subject.DataBindings.Remove("InputImage"); } if (sharpnessToolEdit1.Subject.DataBindings.Contains("InputImage")) { sharpnessToolEdit1.Subject.DataBindings.Remove("InputImage"); } if (sharpnessToolEdit2.Subject.DataBindings.Contains("InputImage")) { sharpnessToolEdit2.Subject.DataBindings.Remove("InputImage"); } cogDisplayMain.DataBindings.Clear(); /// Khởi tạo Binding Image /// cogFixtureTool.Subject.DataBindings.Add("InputImage", cogAcqFifoEdit.Subject, "OutputImage"); pmAlignToolEdit.Subject.DataBindings.Add("InputImage", cogAcqFifoEdit.Subject, "OutputImage"); sharpnessToolEdit1.Subject.DataBindings.Add("InputImage", cogFixtureTool.Subject, "OutputImage"); sharpnessToolEdit2.Subject.DataBindings.Add("InputImage", cogFixtureTool.Subject, "OutputImage"); cogDisplayMain.DataBindings.Add("Image", cogFixtureTool.Subject, "OutputImage", true); cogDisplayMain.BackColor = System.Drawing.Color.Gray; }
/// <summary> /// HostLoaded 호출 시 실행되는 내용 /// </summary> /// <param name="host">UI에 나타낼 WindowsFormsHost</param> private void OnHostLoaded(WindowsFormsHost host) { //CogRecordDisplay 선언 m_Display = new CogRecordDisplay(); //Winform Control을 WPF UI에 연결 host.Child = m_Display; //임의의 이미지 추가 m_Display.Image = new CogImage8Grey(100, 100); //레코드 추가 m_Display.Record = m_OriginRecord; }
public static void ShowLabel_Invoke(CogRecordDisplay disp, float size, double posX, double posY, CogColorConstants color, string text) { var label = new CogGraphicLabel(); label.SelectedSpaceName = "#"; label.Alignment = CogGraphicLabelAlignmentConstants.TopLeft; label.Font = new Font("Arial", size); label.Color = color; label.SetXYText(posX, posY, text); _formMain.Invoke((MethodInvoker)(() => { disp.StaticGraphics.Add(label, "label"); })); }
public SettingWindow() { InitializeComponent(); List <string> list = new List <string>(); list.Add("Model 1"); list.Add("Model 2"); listView.ItemsSource = list; display = new CogRecordDisplay(); Display_WFH.Child = display; }
public ToolBlockImageLogger(CogRecordDisplay display, string logBaseDir, int outdatedDays, CogDisplayContentBitmapConstants bitmapStyle, RunResult logScenario = RunResult.NG | RunResult.ProductMissing, string subrecordPath = "CogIPOneImageTool1.OutputImage") { _display = display; _logBaseDir = logBaseDir; _outdatedDays = outdatedDays; _bitmapStyle = bitmapStyle; _logScenario = logScenario; _subrecordPath = subrecordPath; Logged += (sender, args) => RemoveOutdatedImageDirs(); }
private void DisplayResult(CogRecordDisplay Display, CogToolBlock checker) { if (checker.RunStatus.Result != 0) { Display.Image = (checker.Outputs["OutputImage"].Value as Cognex.VisionPro.ICogImage); Display.Fit(false); } else { Cognex.VisionPro.ICogRecord record = checker.CreateLastRunRecord(); Display.Image = (checker.Outputs["OutputImage"].Value as Cognex.VisionPro.ICogImage); Display.Record = record; Display.Fit(false); } }
public MainWindow_ViewModel() { CogRecordDisplay = new CogRecordDisplay(); m_Control = new ViDi2.Runtime.Local.Control(); string wsPath = AppDomain.CurrentDomain.BaseDirectory + "CrevisBox.vrws"; string wsName = wsPath.Split('\\').Last().Split('.').First(); m_Workspace = m_Control.Workspaces.Add(wsName, wsPath); m_Stream = m_Workspace.Streams.First(); files = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory + "images").ToList(); index = 0; }
//保存图像,自定义文件名 private void SaveImg(CogRecordDisplay cogRecordDisplay, string path) { if (cogRecordDisplay.Image == null) //判断是否有图片 { return; } if (!Directory.Exists(Application.StartupPath + path)) //如果没有同名文件夹,就创建一个文件夹 { Directory.CreateDirectory(Application.StartupPath + path); } //保存图片至文件(24位位图) Image image = default(Image); image = cogRecordDisplay.CreateContentBitmap(Cognex.VisionPro.Display.CogDisplayContentBitmapConstants.Image, null, 0); image.Save(Application.StartupPath + path + DateTime.Now.ToString("yyyyMMddhhmmssff") + ".png", ImageFormat.Bmp); //路径、时间、格式 }
public bool Run(CogRecordDisplay mCogRecordDisplay) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { mPMA_Tool.InputImage = (CogImage8Grey)mCogRecordDisplay.Image; mPMA_Tool.Run(); mCogRecordDisplay.Record = mPMA_Tool.CreateLastRunRecord().SubRecords["InputImage"]; return(true); } catch (Exception ex) { SaveLog.Msg_("PMATool Run Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); return(false); } }
public void DisplayResult(object disp) { CogRecordDisplay Display = disp as CogRecordDisplay; CogToolBlock checker = visionProAlg; if (Display.InvokeRequired) { Display.BeginInvoke((Action) delegate { DisplayResult(Display, checker); }); } else { DisplayResult(Display, checker); } }
public static void GCF(CogRecordDisplay mdisplay, string s1, string font, int size, double d1, double d2, string lab, CogColorConstants mcolor, CogGraphicLabelAlignmentConstants mali) { var mlable = new CogGraphicLabel(); //mfont = "微软雅黑"; var mfont = new Font(font, size, FontStyle.Regular); mlable.GraphicDOFEnableBase = CogGraphicDOFConstants.None; mlable.SelectedSpaceName = s1; mlable.Interactive = false; mlable.Font = mfont; mlable.Color = mcolor; mlable.Alignment = mali; mlable.SetXYText(d1, d2, lab); mdisplay.InteractiveGraphics.Add(mlable, "", false); }
private void DisplayStation_DoubleClick(object sender, EventArgs e) { CogRecordDisplay display = sender as CogRecordDisplay; Panel panel = display.Parent as Panel; int displayIndex = (int)panel.Tag; bool status = (bool)display.Tag; int ccdCount = DbScheme.GetUiParams("CcdCount"); if (!status) { panel.Location = new Point(0, 0); panel.Size = new Size(Tp.Width, Tp.Height); for (int i = 0; i < ccdCount; i++) { if (i != displayIndex) { Panels[i].Hide(); } else { Panels[i].Show(); } } display.Tag = true; } else { var tp = MyTabs["Display", 0]; int width = tp.Width / 2; int height = tp.Height; Panels[0].Location = new Point(0, 0); Panels[0].Size = new Size(width, height); Panels[1].Location = new Point(width, 0); Panels[1].Size = new Size(width, height); for (int i = 0; i < CcdCount; i++) { Panels[i].Show(); } display.Tag = false; } }
public bool init(string vpppath, CogRecordDisplay cogRecordDisplayin = null) { if (null == vpppath) { return(false); } try { myJobManager = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath); myJob = myJobManager.Job(0); myJobIndependent = myJob.OwnedIndependent; myJobManager.UserQueueFlush(); myJobManager.FailureQueueFlush(); myJob.ImageQueueFlush(); myJobIndependent.RealTimeQueueFlush(); updateDisplaySource(cogRecordDisplayin); } catch { } return(true); }
public Boolean Run(CogRecordDisplay CogRecordDisplay1) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); FindCircleTool_Status = false; try { mFindCircleTool.InputImage = (CogImage8Grey)CogRecordDisplay1.Image; mFindCircleTool.Run(); CogRecordDisplay1.Record = mFindCircleTool.CreateLastRunRecord().SubRecords["InputImage"]; FindCircleTool_Status = true; return(true); } catch (Exception ex) { SaveLog.Msg_("FindCircleTool Run Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); return(false); } }
public bool init1(string vpppath1, CogRecordDisplay cogRecordDisplayin1 = null) { updateDisplaySource1(cogRecordDisplayin1); if (null == vpppath1) { return false; } try { myJobManager1 = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath1); myJob1 = myJobManager1.Job(0); myJobIndependent1 = myJob1.OwnedIndependent; myJobManager1.UserQueueFlush(); myJobManager1.FailureQueueFlush(); myJob1.ImageQueueFlush(); myJobIndependent1.RealTimeQueueFlush(); } catch { return false; } return true; }
public bool init(string vpppath0,string vpppath1, string vpppath2, CogRecordDisplay cogRecordDisplayin0 = null, CogRecordDisplay cogRecordDisplayin1 = null, CogRecordDisplay cogRecordDisplayin2 = null) { bool initS1 = false; bool initS2 = false; bool initS3 = false; updateDisplaySource0(cogRecordDisplayin0); updateDisplaySource1(cogRecordDisplayin1); updateDisplaySource2(cogRecordDisplayin2); if (null == vpppath0) { return false; } try { myJobManager0 = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath0); myJob0 = myJobManager0.Job(0); myJobIndependent0 = myJob0.OwnedIndependent; myJobManager0.UserQueueFlush(); myJobManager0.FailureQueueFlush(); myJob0.ImageQueueFlush(); myJobIndependent0.RealTimeQueueFlush(); // updateDisplaySource0(cogRecordDisplayin0); initS1 = true; } catch { initS1 = false; } if (null == vpppath1) { return false; } try { myJobManager1 = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath1); myJob1 = myJobManager1.Job(0); myJobIndependent1 = myJob1.OwnedIndependent; myJobManager1.UserQueueFlush(); myJobManager1.FailureQueueFlush(); myJob1.ImageQueueFlush(); myJobIndependent1.RealTimeQueueFlush(); // updateDisplaySource1(cogRecordDisplayin1); initS2 = true; } catch { initS2 = false; } if (null == vpppath2) { return false; } try { myJobManager2 = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath2); myJob2 = myJobManager2.Job(0); myJobIndependent2 = myJob2.OwnedIndependent; myJobManager2.UserQueueFlush(); myJobManager2.FailureQueueFlush(); myJob2.ImageQueueFlush(); myJobIndependent2.RealTimeQueueFlush(); // updateDisplaySource2(cogRecordDisplayin2); initS3 = true; } catch { inits3 = false; } if(inits1 == true && inits2 == true && initS3 == true) { return true; } return false; }
public bool init3(string vpppath3, CogRecordDisplay cogRecordDisplayin3 = null) { updateDisplaySource3(cogRecordDisplayin3); if (null == vpppath3) { return false; } try { myJobManager3 = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath3); myJob3 = myJobManager3.Job(0); myJobIndependent3 = myJob3.OwnedIndependent; myJobManager3.UserQueueFlush(); myJobManager3.FailureQueueFlush(); myJob3.ImageQueueFlush(); myJobIndependent3.RealTimeQueueFlush(); } catch { return false; } return true; }
public bool init2(string vpppath2, CogRecordDisplay cogRecordDisplayin2 = null) { updateDisplaySource2(cogRecordDisplayin2); if (null == vpppath2) { return false; } try { myJobManager2 = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath2); myJob2 = myJobManager2.Job(0); myJobIndependent2 = myJob2.OwnedIndependent; myJobManager2.UserQueueFlush(); myJobManager2.FailureQueueFlush(); myJob2.ImageQueueFlush(); myJobIndependent2.RealTimeQueueFlush(); } catch { return false; } return true; }
public bool clearDisplaySource() { cogRecordDisplay = null; return true; }
public bool Run(CogRecordDisplay mCogRecordDisplay) { string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(); try { mLineMaxTool.InputImage = (CogImage8Grey)mCogRecordDisplay.Image; mLineMaxTool.Run(); mCogRecordDisplay.Record = mLineMaxTool.CreateLastRunRecord().SubRecords["InputImage"]; mLineMaxTool_status = true; if (mLineMaxTool.Results != null) { iLine = new CogLine[mLineMaxTool.Results.Count]; iLineSegment = new CogLineSegment[mLineMaxTool.Results.Count]; for (int i = 0; i < mLineMaxTool.Results.Count; i++) { iLine[i] = mLineMaxTool.Results[i].GetLine(); iLineSegment[i] = mLineMaxTool.Results[i].GetLineSegment(); } } return(true); } catch (Exception ex) { SaveLog.Msg_("LineMaxTool Run Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString()); mLineMaxTool_status = false; return(false); } }