using OTSCLRINTERFACE; using OTSDataType; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OTSModelSharp.ServiceInterface { public class ScanController : IScanController { private OTSCLRINTERFACE.COTSControlFunExport scan; private bool m_init=false; public ScanController() { this.scan = SemController.hw; } public CBSEImgClr AcquireBSEImage(int matrixIndex, int reads, int dwell) { if (!scan.IsConnected()) { return null; } if (!m_init) { return null; } Rectangle r = new Rectangle(); CBSEImgClr bse = new CBSEImgClr(r); if (!scan.AcquireBSEImage(matrixIndex, reads, dwell, ref bse)) { return null; } return bse; } public bool Init() { m_init= scan.ScanInit(); return m_init; } public bool SetDwellTime(long val) { if (!scan.IsConnected()) { return false; } if (!m_init) { return false; } return scan.SetDwellTime((int)val); } public bool SetImageSize(int width,int height) { if (!scan.IsConnected()) { return false; } if (!m_init) { return false; } return scan.SetImageSize(width,height); } } }