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; }
/// <summary> /// This function is responsible for the initial setup of the app. /// It loads and prepares the saved QuickBuild app into a CogJobManager /// object, attaches event handlers to to interesting CogJobManager /// events, and sets up the CogDisplayStatusBar to reflect the status /// of the CogDisplay we are using. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { // Depersist the CogJobManager saved via QuickBuild myJobManager = CogSerializer.LoadObjectFromFile( Environment.GetEnvironmentVariable("VPRO_ROOT") + "\\Samples\\Programming\\QuickBuild\\advancedAppOne.vpp") as CogJobManager; // Initialize Variables myJob = myJobManager.Job(0); myIndependentJob = myJob.OwnedIndependent; // Flush queues myJobManager.UserQueueFlush(); myJobManager.FailureQueueFlush(); myJob.ImageQueueFlush(); myIndependentJob.RealTimeQueueFlush(); // Register handler for Stopped event myJobManager.Stopped += new CogJobManager.CogJobManagerStoppedEventHandler( myJobManager_Stopped); // Register handler for UserResultAvailable event myJobManager.UserResultAvailable += new CogJobManager.CogUserResultAvailableEventHandler( myJobManager_UserResultAvailable); // Connect the status bar this.cogDisplayStatusBar1.Display = this.cogRecordDisplay1; }
//初始化函数1 private void InitialVPP() { string path = System.Environment.CurrentDirectory; m_strVppFileName = path + "//" + m_strVppFileName; Console.WriteLine(m_strVppFileName); // 加载Vpp if (!System.IO.File.Exists(m_strVppFileName)) { MessageBox.Show("Vpp Job文件不存在\n退出软件?", "警告"); this.Close(); return; } m_JobManager = (CogJobManager)CogSerializer.LoadObjectFromFile(m_strVppFileName); if (m_JobManager == null) { MessageBox.Show("NULL错误", "警告"); this.Close(); } int nCount = m_JobManager.JobCount; if (nCount < 3) { MessageBox.Show("Wrong CCD Model:Job count less than 3."); this.Close(); } m_Job_1 = m_JobManager.Job(0); m_Job_2 = m_JobManager.Job(1); m_Job_3 = m_JobManager.Job(2); // 注册Job完成事件 m_Job_1.Stopped += new CogJob.CogJobStoppedEventHandler(myJob1_Stopped); m_Job_2.Stopped += new CogJob.CogJobStoppedEventHandler(myJob2_Stopped); m_Job_3.Stopped += new CogJob.CogJobStoppedEventHandler(myJob3_Stopped); //Job_1_Ran += new Job_1_RanEventHandler(testJob_1); // 刷新队列 m_JobManager.UserQueueFlush(); m_JobManager.FailureQueueFlush(); }
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 init(string vpppath, int amountOfJobs, List <CogRecordDisplay> cogRecordDisplayin = null) { if (null == vpppath) { return(false); } try { myJobManager = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath); for (int i = 0; i < amountOfJobs; i++) { myJob[i] = myJobManager.Job(i); myJobIndependent[i] = myJob[i].OwnedIndependent; myJob[i].ImageQueueFlush(); myJobIndependent[i].RealTimeQueueFlush(); } myJobManager.UserQueueFlush(); myJobManager.FailureQueueFlush(); updateAllDisplaySource(cogRecordDisplayin); } catch { } return(true); }
public bool init(string vpppath, int amountOfJobs, List<CogRecordDisplay> cogRecordDisplayin = null) { if (null == vpppath) { return false; } try { myJobManager = (CogJobManager)CogSerializer.LoadObjectFromFile(vpppath); for (int i = 0; i < amountOfJobs; i++) { myJob[i] = myJobManager.Job(i); myJobIndependent[i] = myJob[i].OwnedIndependent; myJob[i].ImageQueueFlush(); myJobIndependent[i].RealTimeQueueFlush(); } myJobManager.UserQueueFlush(); myJobManager.FailureQueueFlush(); updateAllDisplaySource(cogRecordDisplayin); } catch { } return true; }
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 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 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; }