using DataEntity.Share; using DriverLib.Engine; using System; using System.Configuration; using System.Linq; using System.Reflection; using System.Windows; using System.Xml; using System.Xml.Linq; using XCommon.Log; using XCore; using XHandler.Controls.Run.Com; using XHandler.View; using XHandler.View.MethodProperty; using XImagingXhandler.XDAL; namespace XHandler.Controls { /// /// 超声探测单命令 /// public class UltrasonicControl { #region 变量 private string strCurrentCulture = ""; private WellCalc wellCalc = new WellCalc(); private LatticeBll latticeBll = new LatticeBll(); private AspirateBll aspirateBll = new AspirateBll(); private UltrasonicBll ultrasonicBll = new UltrasonicBll(); public RunWnd launchView = null; #endregion /// /// 构造函数 /// /// public UltrasonicControl(string strCurrentCulture) { this.strCurrentCulture = strCurrentCulture; } #region 执行超声探测,返回结果字符串 /// /// 执行超声探测 /// /// /// /// /// public bool ExecuteUltrasonic(XmlNode xmlEnv, XmlNode methodNode, bool isSimulator) { bool result = true; if (launchView._cancelSource.IsCancellationRequested) { result = false; return result; } if (strCurrentCulture.Equals("zh-CN")) { launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】> Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strStart.ToString()); } else { launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】> Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】start:"); } // 超声探测 int nRtn = ControlCom.DoUltrasonic(launchView, xmlEnv, methodNode, isSimulator); if (nRtn == 2) // 2:停止 { result = false; return result; } if (strCurrentCulture.Equals("zh-CN")) { launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】> Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strEnd.ToString()); } else { launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】complete;"); } return result; } #endregion } }