123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
-
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ServiceInterface
- {
- public class SemController
- {
- public static OTSCLRINTERFACE.COTSControlFunExport hw=null;
- public SemController()
- {
-
-
- }
- public bool Connect()
- {
- if (hw == null)
- {
- hw = OTSCLRINTERFACE.COTSControlFunExport.GetControllerInstance();
- }
- if (hw.IsConnected())
- {
- return true;
- }
- else
- { //和电镜建立通讯连接
- return hw.ConncetSem();
- }
- }
- public bool DisConnect()
- {
- if (hw != null)
- {
- if (hw.IsConnected())
- {
- return hw.DisconnectSem();
- }
- }
-
- return true;
- }
- public bool GetMagnification(ref double a_dMagnification)
- {
- Connect();
- return hw.GetSemMagnification(ref a_dMagnification);
-
- }
- public bool GetScanFieldSize(ref double dScanFieldSizeX, ref double dScanFieldSizeY)
- {
- Connect();
- return hw.GetSemScanFieldSize(ref dScanFieldSizeX, ref dScanFieldSizeY);
- }
- public bool GetSemPositionXY(ref double a_dPositionX, ref double a_dPositionY, ref double a_dPositionR)
- {
- Connect();
- return hw.GetSemPositionXY(ref a_dPositionX, ref a_dPositionY, ref a_dPositionR);
- }
-
- public bool GetWorkingDistance(ref double a_distance)
- {
- Connect();
- return hw.GetSemWorkingDistance(ref a_distance);
- }
- public bool IsConnected()
- {
- //return true;
- return hw.IsConnected();
- }
- public bool MoveSEMToPoint(Point poi, double rotation)
- {
- Connect();
- return hw.MoveSEMToPoint(poi.X, poi.Y, rotation);
- }
- public bool SetMagnification(double a_dMagnification)
- {
- Connect();
- //hw.SetMagnification(a_dMagnification);
- hw.SetSemMagnification(a_dMagnification);
- return true;
- }
- public bool SetScanExternal(bool b)
- {
- Connect();
- //int seValue = b ? 1 : 0;
- return hw.SetSemScanExternal(b);
- }
- public bool SetWorkingDistance(double a_distance)
- {
- Connect();
- return hw.SetSemWorkingDistance(a_distance);
- }
- public OTSCLRINTERFACE.COTSControlFunExport GetHardwareInterface()
- {
- return hw;
- }
- }
- }
|