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
|
{
|
/// <summary>
|
/// 超声探测单命令
|
/// </summary>
|
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
|
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
/// <param name="strCurrentCulture"></param>
|
public UltrasonicControl(string strCurrentCulture)
|
{
|
this.strCurrentCulture = strCurrentCulture;
|
}
|
|
#region 执行超声探测,返回结果字符串
|
/// <summary>
|
/// 执行超声探测
|
/// </summary>
|
/// <param name="xmlEnv"></param>
|
/// <param name="methodNode"></param>
|
/// <param name="isSimulator"></param>
|
/// <returns></returns>
|
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
|
}
|
}
|