public static IVisionDevice getInstance() { if (instance == null) { instance = new VisionDevice(); } return instance; }
public VisionDevice() { Name = "Mario"; m_lockObject = new object(); isCapturing = false; if (instance == null) { instance = this; } }
private void UserInterface_FormClosed(Object sender, FormClosedEventArgs e) { if (vision != null) { vision.Stop(); vision = null; } if (controller != null) { //force the thread to die controller.emergencyStop(); controller = null; } }
/// <summary> /// Initailizes the carmera and starts continueus image capture /// </summary> private void startVideo() { vision = VisionDevice.getInstance(); vision.Start(); vision.ImageCaptured += new EventHandler<ImageDeviceArgs>(updatIimage); vision.CameraStopped += new EventHandler(captureStopped); }