123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
-
- using FEIApiControl;
- using OINA.Extender.Data.Image;
- 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 BrukerScanController : IScanController
- {
- private OTSCLRINTERFACE.COTSControlFunExport scan;
- static IScanController scanctrl=null;
- public static APIClass ApiClass = null;
-
- int imageWidth = 0;
- int imageHeight = 0;
- public static IScanController GetScanController()
- {
- var semtype = FileHelper.GetXMLInformations("SemControllerName");
- if (scanctrl == null)
- {
- if (semtype == "FEI")
- {
- scanctrl = new FEIScanController();
- }
- else if (semtype == "Oxford")
- {
- var srcType = FileHelper.GetOxfordInputSourceType();
- ImageInputSources imageSrcType=ImageInputSources.Bse;
- if (srcType == "SE")
- {
- imageSrcType = ImageInputSources.SE;
- }
- else if (srcType == "BSE")
- {
- imageSrcType = ImageInputSources.Bse;
- }
-
- scanctrl = new OxfordScanController(imageSrcType);
- }
- else
- {
- scanctrl = new BrukerScanController(semtype);
- }
-
-
- }
- return scanctrl;
- }
- private BrukerScanController(string devicetype)
- {
-
- this.scan = OTSCLRINTERFACE.COTSControlFunExport.GetControllerInstance(devicetype);
- }
- 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);
-
- }
- }
- }
|