//using OINA.Extender.Data.Image; using OTSCLRINTERFACE; using OxfordExtenderWrapper; using OTSModelSharp.ServiceCenter; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.Remoting.Channels.Ipc; using System.Runtime.Remoting.Channels; using OTSMeasureApp.ServiceCenter.OxfordExtender; using static OxfordExtenderWrapper.ExtenderIpcUI; namespace OTSMeasureApp.ServiceCenter { class OxfordScanController : IScanController { int imageWidth = 0; int imageHeight = 0; double dwelltime = 0; ExtenderIpcUI iExtender; ImageInputSourceType imagesourceType; public OxfordScanController(ImageInputSourceType sourceType) { iExtender = ExtenderWrapperIpc.GetExtenderWrapper(); imagesourceType = sourceType; } public CBSEImgClr AcquireBSEImage() { Rectangle r = new Rectangle(); CBSEImgClr bse = new CBSEImgClr(r); bse.InitImageData(imageWidth, imageHeight); ImageAquistionParam p = new ImageAquistionParam(); p.width = imageWidth; p.height = imageHeight; p.DwellTime = dwelltime; p.sourceType = imagesourceType; NLog.LogManager.GetCurrentClassLogger().Info("Begin to acquire BSE image!"); iExtender.AquisitionImage(ref p); NLog.LogManager.GetCurrentClassLogger().Info("End acquiring BSE image!"); bse.SetImageData(p.ImageData, imageWidth, imageHeight); return bse; } public bool Init() { iExtender = ExtenderWrapperIpc.GetExtenderWrapper(); return true; } public bool SetDwellTime(double val) { dwelltime = val; return true; } public bool SetImageSize(int nWidth, int nHeight) { imageWidth = nWidth; imageHeight = nHeight; return true; } } }