private void RunMode_btn_Click(object sender, RoutedEventArgs e) { // Show Buffer View //bufferView1.Show(); // we can do this using two methods: // 1. change WFHost1.Child to either BufferView1 or SetupManager1 // 2. use two WFHost1 and 2, assign one a BufferView, second a SetupManager // then use WFHost1.Visibility.hide or something if (WFHost1.Child != BufferView1) { WFHost1.Child = BufferView1; } // Hide Setup Manager //setupManager1.Hide(); SetupManager1.RootStep = null; //WFHost1.Child // Download Job to Device m_Dev.Download(m_Job, true); // Connect reports to the inspection on the device m_RepCon1.Connect(DEVICENAME, 1, ReportConnection.ConnectOptions.DEFAULT); // Make images part of the report m_RepCon1.AddSnapBuffers((Visionscape.Steps.InspectionStep)m_Job.FindBySymName("Insp1")); // Now start the device m_Dev.StartAll(); }
void m_Coord_OnDeviceFocus(VsDevice objDevice) { // Get handle to the Device m_Dev = objDevice; // Connect the IO control to the device. Only do this once. m_IO.Connect(m_Dev); // Create an event so that we see when IO on camera changes // m_IO.IOTransition += new EventHandler<IOConnectionEventArgs>(m_IO_IOTransition); // Initialize all IO to low, in this case Virtual 1 m_IO.PointWrite(VsIoType.Virtual, 0, false); // Load our job from disk m_Job.Load("C:\\Microscan\\Vscape\\Jobs\\test.avp"); // Get the first VisionSystemStep in the job vs = m_Job.VisionSystemStep(); // Connect the VisionSystemStep to our device vs.SelectSystem(m_Dev.Name); //Now we can download to the device(vision system) and run the job on that device m_Dev.Download(vs, true); // Connect reports to the inspection on the device m_RepCon1.Connect(DEVICENAME, 1, ReportConnection.ConnectOptions.DEFAULT); // Make images part of the report m_RepCon1.AddSnapBuffers((Visionscape.Steps.InspectionStep)m_Job.FindBySymName("Insp1")); // Now start the device m_Dev.StartAll(); }
public void DownloadJob() { if (vsDevice == null || jobStep == null) { return; } if (vsDevice.IsAnyInspectionRunning) { vsDevice.StopAll(); } if (vsDevice.DeviceClass == tagDEVCLASS.DEVCLASS_GIGE_VISION_SYSTEM || vsDevice.DeviceClass == tagDEVCLASS.DEVCLASS_SOFTWARE_EMULATED) { if (ConnectionEventCallback != null) { vsDevice.Download(jobStep, true); Event_Progress ep = new Event_Progress(); ep.progress = 1; ep.message = "Download Completed"; vsDevice.StartAll(); ConnectionEventCallback.Invoke(Enum_ConnectionEvent.DOWNLOADED_JOB, ep); } } else { try { _downloadProgress = 0; vsDevice.OnXferProgress += vsDevice_OnXferProgress; vsDevice.OnDownloadComplete += vsDevice_OnDownloadComplete; vsDevice.Download(jobStep, false); } catch (Exception e) { if (ConnectionEventCallback != null) { ConnectionEventCallback.Invoke(Enum_ConnectionEvent.ERROR, e.Message); } } } }