using FEIApiControl; using OTSCLRINTERFACE; using OTSDataType; using OTSMeasureApp.ServiceCenter; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace OTSModelSharp.ServiceCenter { public class ScanController : IScanController { private OTSCLRINTERFACE.COTSControlFunExport scan; static IScanController scanctrl=null; public static APIClass ApiClass = null; int imageWidth = 0; int imageHeight = 0; public static IScanController GetScanController() { if (scanctrl == null) { if (FileHelper.GetXMLInformations("SemControllerName") == "FEI") { scanctrl = new FEIScanController(); } else { scanctrl = new ScanController(); } } return scanctrl; } private ScanController() { this.scan = OTSCLRINTERFACE.COTSControlFunExport.GetControllerInstance(); } public CBSEImgClr AcquireBSEImage() { if (!scan.IsConnected()) { return null; } Rectangle r = new Rectangle(); CBSEImgClr bse = new CBSEImgClr(r); if (!scan.AcquireBSEImage( ref bse)) { return null; } return bse; } public bool Init() { if (!scan.IsConnected()) { scan.ConncetSem(); } return scan.ScanInit(); } public bool SetDwellTime(double val) { if (!scan.IsConnected()) { return false; } return scan.SetDwellTime((int)val); } public bool SetImageSize(int width,int height) { imageWidth = width; imageHeight = height; if (!scan.IsConnected()) { return false; } return scan.SetImageSize(width, height); } } }