using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using System.Xml;
using XImagingXhandler.XDAL;
using System.Data;
using System.Xml.Linq;
using XCommon;
namespace XCore
{
public class MethodFrame
{
public MethodFrame() { }
#region 将吸液设置的数据转化成xml节点
///
/// 将吸液设置的数据转化成xml节点
///
///
public JObject AspirateMethodConfig()
{
return null;
}
#endregion
#region 将排液设置的数据转化成xml节点
///
/// 将排液设置的数据转化成xml节点
///
///
public JObject DispenseMethodConfig()
{
return null;
}
#endregion
#region 将混合液体设置的数据转化成xml节点
///
/// 将混合液体设置的数据转化成xml节点
///
///
public JObject MixMethodConfig()
{
return null;
}
#endregion
#region 将安装吸头设置的数据转化成xml节点
///
/// 将安装吸头设置的数据转化成xml节点
///
///
public JObject LoadTipsMethodConfig()
{
return null;
}
#endregion
#region 将卸载吸头设置的数据转化成xml节点
///
/// 将卸载吸头设置的数据转化成xml节点
///
///
public JObject UnloadMethodConfig()
{
return null;
}
#endregion
#region 将移动液体设置的数据转化成xml节点
///
/// 将移动液体设置的数据转化成xml节点
///
///
public JObject FileMoveMethodConfig()
{
return null;
}
#endregion
#region 将设置通道的数据转化成xml节点
///
/// 将设置通道的数据转化成xml节点
///
///
public JObject SetChannelMethodConfig()
{
return null;
}
#endregion
#region 将复位设置的数据转化成xml节点
///
/// 将复位设置的数据转化成xml节点
///
///
public JObject HomeMethodConfig()
{
return null;
}
#endregion
#region 将抓板设置的数据转化成xml节点
///
/// 将抓板设置的数据转化成xml节点
///
///
public JObject GrabMethodConfig()
{
return null;
}
#endregion
#region 将组合设置的数据转化成xml节点
///
/// 将组合设置的数据转化成xml节点
///
///
public JObject CombineMethodConfig()
{
return null;
}
#endregion
#region 将暂停设置的数据转化成xml节点
///
/// 将暂停设置的数据转化成xml节点
///
///
public JObject PauseMethodConfig()
{
return null;
}
#endregion
#region 将备注设置的数据转化成xml节点
///
/// 将备注设置的数据转化成xml节点
///
///
public JObject RemarkMethodConfig()
{
return null;
}
#endregion
#region 获取所有方法对应再序列显示时的初始文字描述集合
public List GenerateStringOfMethod()
{
List strInfoList = new List();
//开始
strInfoList.Add("方法序列的起点");
//结束
strInfoList.Add("方法序列的结束点");
//吸液
strInfoList.Add("参数:{台面位置:}{臂:}{吸头:}{孔位:}{体积:}{液体参数:}");
//排液
strInfoList.Add("参数:{台面位置:}{臂:}{吸头:}{孔位:}{体积:}{液体参数:}");
//加载吸头
strInfoList.Add("参数:{台面位置:}{臂:}{吸头:}{孔位:}");
//卸载吸头
strInfoList.Add("参数:{台面位置:}{臂:}");
//设置通道
strInfoList.Add("参数:{臂:}{通道:}");
//开始循环
strInfoList.Add("循环方法序列的起点");
//结束循环
strInfoList.Add("循环方法序列的结束点");
//开始组合
strInfoList.Add("组合方法序列的起点");
//结束组合
strInfoList.Add("组合方法序列的结束点");
//文件
strInfoList.Add("参数:{文件路径:}{源板列:}{源孔列:}{目标板列:}{目标孔列:}{体积列:}{液体参数:}{枪头参数:}");
//抓板转移
strInfoList.Add("参数:{臂:}{从台面位置:}{移动到台面位置:}{抓手抓位置:}");
//混合
strInfoList.Add("参数:{台面位置:}{臂:}{吸头:}{孔位:}{液体参数:}");
//暂停
strInfoList.Add("参数:{台面位置:}{臂:}{吸头:}{暂停时长:}{提示消息:}");
//振荡
strInfoList.Add("振荡参数:{转速:}{方向:}{时长:}加热参数:{温度:}{时长:}");
//复位
strInfoList.Add("复位:设备回到初始化为零的位置");
//备注
strInfoList.Add("备注:对工作方法流程和内容的解释说明等");
//拍照
strInfoList.Add("拍照:设置拍照控制的参数");
//挑选
strInfoList.Add("挑选:设置挑选控制的参数");
//涂布
strInfoList.Add("涂布:设置涂布控制的参数");
//涂布文件
strInfoList.Add("涂布文件:设置涂布文件数据");
//涂布报告
strInfoList.Add("涂布报告:设置涂布报告数据列");
//设置变量
strInfoList.Add("设置变量:设置控制变量数据");
return strInfoList;
}
#endregion
#region 根据吸液方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据吸液方法属性对象,构建流程列表中方法显示的文字内容
///
/// 吸液属性对象
/// 吸液内容显示字符串
public string UpdateMethodListItemContent(MethodAspirate methodAspirate)
{
string strResult = string.Empty;
strResult = "参数:{台面位置:"+methodAspirate.positionText+"}{臂:"+methodAspirate.armText+"}{吸头:"+methodAspirate.labwaretipText+"}{孔位:"+methodAspirate.wellarray+"}{体积:"+methodAspirate.wellvolume+"}{液体参数:"+methodAspirate.liquididText+"}";
return strResult;
}
///
/// 生成吸液方法的xml节点属性对象
///
/// 吸液方法的xml节点
/// 吸液方法的xml节点属性对象
public MethodAspirate GenerateMethodAspirate(XmlNode xmlNodeAspirate)
{
MethodAspirate methodAspirate = new MethodAspirate();
methodAspirate.isrun = xmlNodeAspirate.SelectSingleNode("isrun").InnerText;
methodAspirate.status = xmlNodeAspirate.SelectSingleNode("status").InnerText;
methodAspirate.name = xmlNodeAspirate.SelectSingleNode("name").InnerText;
methodAspirate.label = xmlNodeAspirate.SelectSingleNode("label").InnerText;
methodAspirate.labwareText = xmlNodeAspirate.SelectSingleNode("labware/text").InnerText;
methodAspirate.labwareValue = xmlNodeAspirate.SelectSingleNode("labware/value").InnerText;
methodAspirate.positionText = xmlNodeAspirate.SelectSingleNode("position/text").InnerText;
methodAspirate.positionValue = xmlNodeAspirate.SelectSingleNode("position/value").InnerText;
methodAspirate.armText = xmlNodeAspirate.SelectSingleNode("arm/text").InnerText;
methodAspirate.armValue = xmlNodeAspirate.SelectSingleNode("arm/value").InnerText;
methodAspirate.labwaretipText = xmlNodeAspirate.SelectSingleNode("labwaretip/text").InnerText;
methodAspirate.labwaretipValue = xmlNodeAspirate.SelectSingleNode("labwaretip/value").InnerText;
methodAspirate.wellarray = xmlNodeAspirate.SelectSingleNode("wellarray").InnerText;
methodAspirate.mixvolume = Convert.ToDouble(xmlNodeAspirate.SelectSingleNode("mixvolume").InnerText);
methodAspirate.mixcount = Convert.ToInt32(xmlNodeAspirate.SelectSingleNode("mixcount").InnerText);
methodAspirate.wellvolume = Convert.ToDouble(xmlNodeAspirate.SelectSingleNode("wellvolume").InnerText);
methodAspirate.liquididText = xmlNodeAspirate.SelectSingleNode("liquidid/text").InnerText;
methodAspirate.liquididValue = xmlNodeAspirate.SelectSingleNode("liquidid/value").InnerText;
return methodAspirate;
}
#endregion
#region 根据排液方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据排液方法属性对象,构建流程列表中方法显示的文字内容
///
/// 排液属性对象
/// 排液内容显示字符串
public string UpdateMethodListItemContent(MethodDispense methodDispense)
{
string strResult = string.Empty;
strResult = "参数:{台面位置:" + methodDispense.positionText + "}{臂:" + methodDispense.armText + "}{吸头:" + methodDispense.labwaretipText + "}{孔位:" + methodDispense.wellarray + "}{体积:" + methodDispense.wellvolume + "}{液体参数:" + methodDispense.liquididText + "}";
return strResult;
}
///
/// 生成排液方法的xml节点属性对象
///
/// 排液方法的xml节点
/// 排液方法的xml节点属性对象
public MethodDispense GenerateMethodDispense(XmlNode xmlNode)
{
MethodDispense methodDispense = new MethodDispense();
methodDispense.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodDispense.status = xmlNode.SelectSingleNode("status").InnerText;
methodDispense.name = xmlNode.SelectSingleNode("name").InnerText;
methodDispense.label = xmlNode.SelectSingleNode("label").InnerText;
methodDispense.labwareText = xmlNode.SelectSingleNode("labware/text").InnerText;
methodDispense.labwareValue = xmlNode.SelectSingleNode("labware/value").InnerText;
methodDispense.positionText = xmlNode.SelectSingleNode("position/text").InnerText;
methodDispense.positionValue = xmlNode.SelectSingleNode("position/value").InnerText;
methodDispense.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
methodDispense.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
methodDispense.labwaretipText = xmlNode.SelectSingleNode("labwaretip/text").InnerText;
methodDispense.labwaretipValue = xmlNode.SelectSingleNode("labwaretip/value").InnerText;
methodDispense.wellarray = xmlNode.SelectSingleNode("wellarray").InnerText;
methodDispense.mixvolume = Convert.ToDouble(xmlNode.SelectSingleNode("mixvolume").InnerText);
methodDispense.mixcount = Convert.ToInt32(xmlNode.SelectSingleNode("mixcount").InnerText);
methodDispense.wellvolume = Convert.ToDouble(xmlNode.SelectSingleNode("wellvolume").InnerText);
methodDispense.isNull = Convert.ToBoolean(xmlNode.SelectSingleNode("isNull").InnerText);
methodDispense.liquididText = xmlNode.SelectSingleNode("liquidid/text").InnerText;
methodDispense.liquididValue = xmlNode.SelectSingleNode("liquidid/value").InnerText;
return methodDispense;
}
#endregion
#region 根据安装吸头方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据安装吸头方法属性对象,构建流程列表中方法显示的文字内容
///
/// 安装吸头属性对象
/// 安装吸头内容显示字符串
public string UpdateMethodListItemContent(MethodLoadTips methodLoadTips)
{
string strResult = string.Empty;
strResult = "参数:{台面位置:" + methodLoadTips.positionText + "}{臂:" + methodLoadTips.armText + "}{吸头:" + methodLoadTips.labwaretipText + "}{孔位:" + methodLoadTips.wellarray + "}";
return strResult;
}
///
/// 生成安装吸头方法的xml节点属性对象
///
/// 安装吸头方法的xml节点
/// 安装吸头方法的xml节点属性对象
public MethodLoadTips GenerateMethodLoadTips(XmlNode xmlNode)
{
MethodLoadTips methodLoadTips = new MethodLoadTips();
methodLoadTips.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodLoadTips.status = xmlNode.SelectSingleNode("status").InnerText;
methodLoadTips.name = xmlNode.SelectSingleNode("name").InnerText;
methodLoadTips.label = xmlNode.SelectSingleNode("label").InnerText;
methodLoadTips.labwareText = xmlNode.SelectSingleNode("labware/text").InnerText;
methodLoadTips.labwareValue = xmlNode.SelectSingleNode("labware/value").InnerText;
methodLoadTips.positionText = xmlNode.SelectSingleNode("position/text").InnerText;
methodLoadTips.positionValue = xmlNode.SelectSingleNode("position/value").InnerText;
methodLoadTips.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
methodLoadTips.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
methodLoadTips.labwaretipText = xmlNode.SelectSingleNode("labwaretip/text").InnerText;
methodLoadTips.labwaretipValue = xmlNode.SelectSingleNode("labwaretip/value").InnerText;
methodLoadTips.wellarray = xmlNode.SelectSingleNode("wellarray").InnerText;
return methodLoadTips;
}
#endregion
#region 根据卸载吸头方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据卸载吸头方法属性对象,构建流程列表中方法显示的文字内容
///
/// 卸载吸头方法的属性对象
/// 卸载吸头内容显示字符串
public string UpdateMethodListItemContent(MethodUnloadTips methodUnloadTips)
{
string strResult = string.Empty;
strResult = "参数:{台面位置:" + methodUnloadTips.positionText + "}{臂:" + methodUnloadTips.armText + "}{吸头:" + methodUnloadTips.labwaretipText + "}{孔位:" + methodUnloadTips.wellarray + "}";
return strResult;
}
///
/// 生成卸载吸头方法的xml节点属性对象
///
/// 卸载吸头方法的xml节点
/// 卸载吸头方法的xml节点属性对象
public MethodUnloadTips GenerateMethodUnLoadTips(XmlNode xmlNode)
{
MethodUnloadTips methodUnloadTips = new MethodUnloadTips();
methodUnloadTips.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodUnloadTips.status = xmlNode.SelectSingleNode("status").InnerText;
methodUnloadTips.name = xmlNode.SelectSingleNode("name").InnerText;
methodUnloadTips.label = xmlNode.SelectSingleNode("label").InnerText;
methodUnloadTips.labwareText = xmlNode.SelectSingleNode("labware/text").InnerText;
methodUnloadTips.labwareValue = xmlNode.SelectSingleNode("labware/value").InnerText;
methodUnloadTips.positionText = xmlNode.SelectSingleNode("position/text").InnerText;
methodUnloadTips.positionValue = xmlNode.SelectSingleNode("position/value").InnerText;
methodUnloadTips.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
methodUnloadTips.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
methodUnloadTips.labwaretipText = xmlNode.SelectSingleNode("labwaretip/text").InnerText;
methodUnloadTips.labwaretipValue = xmlNode.SelectSingleNode("labwaretip/value").InnerText;
methodUnloadTips.wellarray = xmlNode.SelectSingleNode("wellarray").InnerText;
return methodUnloadTips;
}
#endregion
#region 根据设置通道方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据设置通道方法属性对象,构建流程列表中方法显示的文字内容
///
/// 设置通道方法的属性
/// 设置通道内容显示字符串
public string UpdateMethodListItemContent(MethodSetChannel methodSetChannel)
{
string strResult = string.Empty;
strResult = "参数:{臂:" + methodSetChannel.armText + "}{通道:" + methodSetChannel.ChannelText + "}";
return strResult;
}
///
/// 生成设置通道方法的xml节点属性对象
///
/// 设置通道方法的xml节点
/// 设置通道方法的xml节点属性对象
public MethodSetChannel GenerateMethodSetChannel(XmlNode xmlNode)
{
MethodSetChannel methodSetChannel = new MethodSetChannel();
methodSetChannel.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodSetChannel.status = xmlNode.SelectSingleNode("status").InnerText;
methodSetChannel.name = xmlNode.SelectSingleNode("name").InnerText;
methodSetChannel.label = xmlNode.SelectSingleNode("label").InnerText;
methodSetChannel.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
methodSetChannel.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
methodSetChannel.labwaretipText = xmlNode.SelectSingleNode("labwaretip/text").InnerText;
methodSetChannel.labwaretipValue = xmlNode.SelectSingleNode("labwaretip/value").InnerText;
methodSetChannel.ChannelText = xmlNode.SelectSingleNode("ChannelArray").InnerText;
return methodSetChannel;
}
#endregion
#region 根据循环方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据循环方法属性对象,构建流程列表中方法显示的文字内容
///
/// 循环方法的属性对象
/// 循环方法内容显示字符串
public string UpdateMethodListItemContent(MethodLoop methodLoop)
{
string strResult = string.Empty;
strResult = "参数:{循环变量:" + methodLoop.variableName + "}{初始值:" + methodLoop.variablesValue + "}{终止值:" + methodLoop.variableeValue + "}{增值:" + methodLoop.incrementValue + "}";
return strResult;
}
///
/// 生成循环方法的xml节点属性对象
///
/// 循环方法的xml节点
/// 循环方法的xml节点属性对象
public MethodLoop GenerateMethodLoop(XmlNode xmlNode)
{
MethodLoop methodLoop = new MethodLoop();
methodLoop.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodLoop.status = xmlNode.SelectSingleNode("status").InnerText;
methodLoop.name = xmlNode.SelectSingleNode("name").InnerText;
methodLoop.label = xmlNode.SelectSingleNode("label").InnerText;
methodLoop.variableName = xmlNode.SelectSingleNode("variableName").InnerText;
methodLoop.variablesValue = xmlNode.SelectSingleNode("variablesValue").InnerText;
methodLoop.variableeValue = xmlNode.SelectSingleNode("variableeValue").InnerText;
methodLoop.incrementValue = xmlNode.SelectSingleNode("incrementValue").InnerText;
methodLoop.content = xmlNode.SelectSingleNode("content").InnerText;
return methodLoop;
}
#endregion
#region 根据文件方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据文件方法属性对象,构建流程列表中方法显示的文字内容
///
/// 文件方法的属性对象
/// 文件方法的属性内容字符串
public string UpdateMethodListItemContent(MethodTransferFile methodTransferFile)
{
string strResult = string.Empty;
strResult = "参数:{文件路径:" + methodTransferFile.filePath + "}{源板列:" + methodTransferFile.sourceLabware + "}{源孔列:" + methodTransferFile.sourceWell + "}{目标板列:" + methodTransferFile.destinationLabware + "}"
+"{目标孔列:"+methodTransferFile.destinationWell+"}{体积列:"+methodTransferFile.destVolume+"}{液体参数:"+methodTransferFile.liquididText+"}{枪头参数:"+methodTransferFile.changeToTipValue+"}";
return strResult;
}
///
/// 生成文件方法的xml节点属性对象
///
/// 文件方法的xml节点
/// 文件方法的xml节点属性对象
public MethodTransferFile GenerateMethodTransferFile(XmlNode xmlNode)
{
MethodTransferFile methodTransferFile = new MethodTransferFile();
methodTransferFile.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodTransferFile.status = xmlNode.SelectSingleNode("status").InnerText;
methodTransferFile.name = xmlNode.SelectSingleNode("name").InnerText;
methodTransferFile.label = xmlNode.SelectSingleNode("label").InnerText;
methodTransferFile.filePath = xmlNode.SelectSingleNode("filePath").InnerText;
methodTransferFile.transferDataTable = GenerateTransferFileDataTable(xmlNode);//根据节点构建移液表
methodTransferFile.sourceLabware = xmlNode.SelectSingleNode("sourceLabware").InnerText;
methodTransferFile.sourceWell = xmlNode.SelectSingleNode("sourceWell").InnerText;
methodTransferFile.destinationLabware = xmlNode.SelectSingleNode("destinationLabware").InnerText;
methodTransferFile.destinationWell = xmlNode.SelectSingleNode("destinationWell").InnerText;
methodTransferFile.destVolume = xmlNode.SelectSingleNode("destVolume").InnerText;
//methodTransferFile.aspirateMixCount = xmlNode.SelectSingleNode("aspirateMixCount").InnerText;
//methodTransferFile.aspirateMixVolume = xmlNode.SelectSingleNode("aspirateMixVolume").InnerText;
//methodTransferFile.dispenseMixCount = xmlNode.SelectSingleNode("dispenseMixCount").InnerText;
//methodTransferFile.dispenseMixVolume = xmlNode.SelectSingleNode("dispenseMixVolume").InnerText;
methodTransferFile.jump0Volume = xmlNode.SelectSingleNode("jump0Volume").InnerText.ToLower() == "true" ? true : false;
methodTransferFile.liquididText = xmlNode.SelectSingleNode("liquidid/text").InnerText;
methodTransferFile.liquididValue = xmlNode.SelectSingleNode("liquidid/value").InnerText;
methodTransferFile.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
methodTransferFile.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
methodTransferFile.labwaretipText = xmlNode.SelectSingleNode("labwaretip/text").InnerText;
methodTransferFile.labwaretipValue = xmlNode.SelectSingleNode("labwaretip/value").InnerText;
//methodTransferFile.ChannelText = xmlNode.SelectSingleNode("ChannelText").InnerText;
//methodTransferFile.directionText = xmlNode.SelectSingleNode("direction/text").InnerText;
//methodTransferFile.directionValue = xmlNode.SelectSingleNode("direction/value").InnerText;
//methodTransferFile.changeToTipValue = xmlNode.SelectSingleNode("changeToTipValue").InnerText;
//methodTransferFile.transferModelValue = xmlNode.SelectSingleNode("transferModelValue").InnerText;
return methodTransferFile;
}
///
/// 根据xml节点构建移液表
///
/// xml节点对象
/// 移液表
public DataTable GenerateTransferFileDataTable(XmlNode xmlNode)
{
XmlNode xmlNodeList = xmlNode.SelectSingleNode("transferDataTable");
DataTable dt = new DataTable();
foreach(XmlNode xn in xmlNodeList.ChildNodes)// 列名称
{
DataColumn dc = new DataColumn();
dc.ColumnName = xn.Attributes["columnname"].Value.ToString();
dt.Columns.Add(dc);
}
for (int j = 0; j < xmlNodeList.ChildNodes[0].ChildNodes.Count; j++)//行
{
DataRow dr = dt.NewRow();
for (int i = 0; i < xmlNodeList.ChildNodes.Count; i++)//列
{
dr[i] = xmlNodeList.ChildNodes[i].ChildNodes[j].InnerText;
}
dt.Rows.Add(dr);
}
return dt;
}
#endregion
#region 根据抓板转移方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据抓板转移方法属性对象,构建流程列表中方法显示的文字内容
///
/// 抓板转移方法的实体属性对象
/// 抓板转移方法的属性内容字符串
public string UpdateMethodListItemContent(MethodGripTransport methodGripTransport)
{
string strResult = string.Empty;
strResult = "参数:{臂:" + methodGripTransport.armText + "}{从台面位置:" + methodGripTransport.srcPositionText + "}{移动到台面位置:" + methodGripTransport.desPositionText + "}{抓手抓位置:" + methodGripTransport.gripModelText + "}";
return strResult;
}
///
/// 生成抓板转移方法的xml节点属性对象
///
/// 抓板转移方法的xml节点
/// 抓板转移方法的xml节点属性对象
public MethodGripTransport GenerateMethodGripTransport(XmlNode xmlNode)
{
MethodGripTransport methodGripTransport = new MethodGripTransport();
methodGripTransport.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodGripTransport.status = xmlNode.SelectSingleNode("status").InnerText;
methodGripTransport.name = xmlNode.SelectSingleNode("name").InnerText;
methodGripTransport.label = xmlNode.SelectSingleNode("label").InnerText;
methodGripTransport.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
methodGripTransport.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
methodGripTransport.srcPositionText = xmlNode.SelectSingleNode("sourceLattice/text").InnerText;
methodGripTransport.srcPositionValue = xmlNode.SelectSingleNode("sourceLattice/value").InnerText;
methodGripTransport.desPositionText = xmlNode.SelectSingleNode("destinationLattice/text").InnerText;
methodGripTransport.desPositionValue = xmlNode.SelectSingleNode("destinationLattice/value").InnerText;
methodGripTransport.gripModelText = xmlNode.SelectSingleNode("gripModel/text").InnerText;
methodGripTransport.gripModelValue = Convert.ToInt32(xmlNode.SelectSingleNode("gripModel/value").InnerText);
return methodGripTransport;
}
#endregion
#region 根据混合方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据混合方法属性对象,构建流程列表中方法显示的文字内容
///
/// 混合方法实体属性对象
/// 实体方法属性内容字符串
public string UpdateMethodListItemContent(MethodMixing methodMixing)
{
string strResult = string.Empty;
strResult = "参数:{台面位置:" + methodMixing.positionText + "}{臂:" + methodMixing.armText + "}{吸头:" + methodMixing.labwaretipText + "}{孔位:" + methodMixing.wellarray + "}{液体参数:" + methodMixing.liquididText + "}";
return strResult;
}
///
/// 生成吸液方法的xml节点属性对象
///
/// 吸液方法的xml节点
/// 吸液方法的xml节点属性对象
public MethodMixing GenerateMethodMixing(XmlNode xmlNodeAspirate)
{
MethodMixing methodMixing = new MethodMixing();
methodMixing.isrun = xmlNodeAspirate.SelectSingleNode("isrun").InnerText;
methodMixing.status = xmlNodeAspirate.SelectSingleNode("status").InnerText;
methodMixing.name = xmlNodeAspirate.SelectSingleNode("name").InnerText;
methodMixing.label = xmlNodeAspirate.SelectSingleNode("label").InnerText;
methodMixing.labwareText = xmlNodeAspirate.SelectSingleNode("labware/text").InnerText;
methodMixing.labwareValue = xmlNodeAspirate.SelectSingleNode("labware/value").InnerText;
methodMixing.positionText = xmlNodeAspirate.SelectSingleNode("position/text").InnerText;
methodMixing.positionValue = xmlNodeAspirate.SelectSingleNode("position/value").InnerText;
methodMixing.armText = xmlNodeAspirate.SelectSingleNode("arm/text").InnerText;
methodMixing.armValue = xmlNodeAspirate.SelectSingleNode("arm/value").InnerText;
methodMixing.labwaretipText = xmlNodeAspirate.SelectSingleNode("labwaretip/text").InnerText;
methodMixing.labwaretipValue = xmlNodeAspirate.SelectSingleNode("labwaretip/value").InnerText;
methodMixing.wellarray = xmlNodeAspirate.SelectSingleNode("wellarray").InnerText;
methodMixing.mixvolume = Convert.ToDouble(xmlNodeAspirate.SelectSingleNode("mixvolume").InnerText);
methodMixing.mixcount = Convert.ToInt32(xmlNodeAspirate.SelectSingleNode("mixcount").InnerText);
methodMixing.liquididText = xmlNodeAspirate.SelectSingleNode("liquidid/text").InnerText;
methodMixing.liquididValue = xmlNodeAspirate.SelectSingleNode("liquidid/value").InnerText;
return methodMixing;
}
#endregion
#region 根据暂停方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据暂停方法属性对象,构建流程列表中方法显示的文字内容
///
/// 暂停方法实体属性对象
/// 暂停方法属性内容字符串
public string UpdateMethodListItemContent(MethodPauseMove methodPauseMove)
{
string strResult = string.Empty;
strResult = "参数:{台面位置:" + methodPauseMove.positionText + "}{臂:" + methodPauseMove.armText + "}{吸头:" + methodPauseMove.labwaretipText + "}{暂停时长:" + methodPauseMove.pauseTime + "}{提示消息:" + methodPauseMove.pauseTipInfo + "}";
return strResult;
}
///
/// 生成吸液方法的xml节点属性对象
///
/// 吸液方法的xml节点
/// 吸液方法的xml节点属性对象
public MethodPauseMove GenerateMethodPauseMove(XmlNode xmlNode)
{
MethodPauseMove methodPauseMove = new MethodPauseMove();
methodPauseMove.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodPauseMove.status = xmlNode.SelectSingleNode("status").InnerText;
methodPauseMove.name = xmlNode.SelectSingleNode("name").InnerText;
methodPauseMove.label = xmlNode.SelectSingleNode("label").InnerText;
methodPauseMove.labwareText = xmlNode.SelectSingleNode("labware/text").InnerText;
methodPauseMove.labwareValue = xmlNode.SelectSingleNode("labware/value").InnerText;
methodPauseMove.positionText = xmlNode.SelectSingleNode("position/text").InnerText;
methodPauseMove.positionValue = xmlNode.SelectSingleNode("position/value").InnerText;
methodPauseMove.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
methodPauseMove.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
methodPauseMove.labwaretipText = xmlNode.SelectSingleNode("labwaretip/text").InnerText;
methodPauseMove.labwaretipValue = xmlNode.SelectSingleNode("labwaretip/value").InnerText;
methodPauseMove.pauseTime = xmlNode.SelectSingleNode("pauseTime").InnerText;
methodPauseMove.pauseTipInfo = xmlNode.SelectSingleNode("pauseTipInfo").InnerText;
return methodPauseMove;
}
#endregion
#region 根据振荡方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据振荡方法属性对象,构建流程列表中方法显示的文字内容
///
/// 振荡方法实体类对象
/// 振荡方法属性内容字符串
public string UpdateMethodListItemContent(MethodShaker methodShaker)
{
string strResult = string.Empty;
strResult = "振荡参数:{转速:" + methodShaker.shakerSpeed + "}{方向:" + methodShaker.shakerDirectionText + "}{时长:" + methodShaker.shakerTime + "}加热参数:{温度:" + methodShaker.warmTemperature + "}{时长:" + methodShaker.warmTime + "}";
return strResult;
}
///
/// 生成吸液方法的xml节点属性对象
///
/// 吸液方法的xml节点
/// 吸液方法的xml节点属性对象
public MethodShaker GenerateMethodShaker(XmlNode xmlNode)
{
MethodShaker methodShaker = new MethodShaker();
methodShaker.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodShaker.status = xmlNode.SelectSingleNode("status").InnerText;
methodShaker.name = xmlNode.SelectSingleNode("name").InnerText;
methodShaker.label = xmlNode.SelectSingleNode("label").InnerText;
methodShaker.turnOnShaker = xmlNode.SelectSingleNode("turnOnShaker").InnerText;
methodShaker.shakerSpeed = xmlNode.SelectSingleNode("shakerSpeed").InnerText;
methodShaker.shakerDirectionText = xmlNode.SelectSingleNode("shakerDirectionText").InnerText;
methodShaker.shakerDirectionValue = xmlNode.SelectSingleNode("shakerDirectionValue").InnerText;
methodShaker.shakerTime = xmlNode.SelectSingleNode("shakerTime").InnerText;
methodShaker.turnOnWarm = xmlNode.SelectSingleNode("turnOnWarm").InnerText;
methodShaker.warmTemperature = xmlNode.SelectSingleNode("warmTemperature").InnerText;
methodShaker.warmTime = xmlNode.SelectSingleNode("warmTime").InnerText;
return methodShaker;
}
#endregion
#region 根据复位方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据复位方法属性对象,构建流程列表中方法显示的文字内容
///
/// 复位方法实体类对象
/// 复位方法属性内容字符串
public string UpdateMethodListItemContent(MethodHome methodHome)
{
string strResult = string.Empty;
strResult = "复位:{"+methodHome.name+"}设备回到初始化为零的位置";
return strResult;
}
///
/// 生成复位方法的xml节点属性对象
///
/// 复位方法的xml节点
/// 复位方法的xml节点属性对象
public MethodHome GenerateMethodHome(XmlNode xmlNode)
{
MethodHome methodHome = new MethodHome();
methodHome.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodHome.status = xmlNode.SelectSingleNode("status").InnerText;
methodHome.name = xmlNode.SelectSingleNode("name").InnerText;
methodHome.label = xmlNode.SelectSingleNode("label").InnerText;
return methodHome;
}
#endregion
#region 根据备注方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据备注方法属性对象,构建流程列表中方法显示的文字内容
///
/// 备注方法实体类对象
/// 备注方法属性内容字符串
public string UpdateMethodListItemContent(MethodRemark methodRemark)
{
string strResult = string.Empty;
strResult = "备注:{" + methodRemark.remark + "}";
return strResult;
}
///
/// 生成备注方法的xml节点属性对象
///
/// 备注方法的xml节点
/// 备注方法的xml节点属性对象
public MethodRemark GenerateMethodRemark(XmlNode xmlNode)
{
MethodRemark methodRemark = new MethodRemark();
methodRemark.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodRemark.status = xmlNode.SelectSingleNode("status").InnerText;
methodRemark.name = xmlNode.SelectSingleNode("name").InnerText;
methodRemark.label = xmlNode.SelectSingleNode("label").InnerText;
methodRemark.remark = xmlNode.SelectSingleNode("remark").InnerText;
return methodRemark;
}
#endregion
#region 根据拍照方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据拍照方法属性对象,构建流程列表中方法显示的文字内容
///
/// 拍照方法实体类对象
/// 拍照方法属性内容字符串
public string UpdateMethodListItemContent(MethodTakePhoto methodTakePhoto)
{
string strResult = string.Empty;
strResult = "拍照参数:{参数模式:" + (methodTakePhoto.ismanualconfig == 1 ? "手动配置" : "自动配置") + "}{菌名:" +
methodTakePhoto.bacteriaids + "}{菌间隙:" + methodTakePhoto.gapValue + "mm}{挑选方式:" + (methodTakePhoto.identification==1?"手工":"自动") + "}";
return strResult;
}
///
/// 生成备注方法的xml节点属性对象
///
/// 备注方法的xml节点
/// 备注方法的xml节点属性对象
public MethodTakePhoto GenerateMethodTakePhoto(XmlNode xmlNode)
{
MethodTakePhoto methodTakePhoto = new MethodTakePhoto();
methodTakePhoto.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodTakePhoto.status = xmlNode.SelectSingleNode("status").InnerText;
methodTakePhoto.name = xmlNode.SelectSingleNode("name").InnerText;
methodTakePhoto.label = xmlNode.SelectSingleNode("label").InnerText;
methodTakePhoto.ismanualconfig = Convert.ToInt32(xmlNode.SelectSingleNode("ismanualconfig").InnerText);
methodTakePhoto.bacteriaids= xmlNode.SelectSingleNode("bacteriaids").InnerText;
methodTakePhoto.paramfilepath= xmlNode.SelectSingleNode("paramfilepath")==null?"": xmlNode.SelectSingleNode("paramfilepath").InnerText;
methodTakePhoto.gapValue = xmlNode.SelectSingleNode("gapValue").InnerText;
methodTakePhoto.identification= Convert.ToInt32(xmlNode.SelectSingleNode("identification").InnerText); // 识别方法:0:成像系统自动挑选菌落; 1:人工挑选菌落
return methodTakePhoto;
}
#endregion
#region 根据挑选方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据挑选方法属性对象,构建流程列表中方法显示的文字内容
///
/// 挑选属性对象
/// 挑选内容显示字符串
public string UpdateMethodListItemContent(MethodChoice methodChoice)
{
string strResult = string.Empty;
strResult = "参数:{台面位置:" + methodChoice.positionText + "}{臂:" + methodChoice.armText + "}{挑菌头:" + methodChoice.labwaretipText + "}{菌落:" + methodChoice.bacteriaText + "}";
return strResult;
}
///
/// 生成挑选方法的xml节点属性对象
///
/// 挑选方法的xml节点
/// 挑选方法的xml节点属性对象
public MethodChoice GenerateMethodChoice(XmlNode xmlNodeChoice)
{
MethodChoice methodChoice = new MethodChoice();
methodChoice.isrun = xmlNodeChoice.SelectSingleNode("isrun").InnerText;
methodChoice.status = xmlNodeChoice.SelectSingleNode("status").InnerText;
methodChoice.name = xmlNodeChoice.SelectSingleNode("name").InnerText;
methodChoice.label = xmlNodeChoice.SelectSingleNode("label").InnerText;
methodChoice.labwareText = xmlNodeChoice.SelectSingleNode("labware/text").InnerText;
methodChoice.labwareValue = xmlNodeChoice.SelectSingleNode("labware/value").InnerText;
methodChoice.positionText = xmlNodeChoice.SelectSingleNode("position/text").InnerText;
methodChoice.positionValue = xmlNodeChoice.SelectSingleNode("position/value").InnerText;
methodChoice.armText = xmlNodeChoice.SelectSingleNode("arm/text").InnerText;
methodChoice.armValue = xmlNodeChoice.SelectSingleNode("arm/value").InnerText;
methodChoice.labwaretipText = xmlNodeChoice.SelectSingleNode("labwaretip/text").InnerText;
methodChoice.labwaretipValue = xmlNodeChoice.SelectSingleNode("labwaretip/value").InnerText;
methodChoice.bacteriaText = xmlNodeChoice.SelectSingleNode("bacteria/text").InnerText;
methodChoice.bacteriaValue = xmlNodeChoice.SelectSingleNode("bacteria/value").InnerText;
return methodChoice;
}
#endregion
#region 根据涂布方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据涂布方法属性对象,构建流程列表中方法显示的文字内容
///
/// 涂布属性对象
/// 涂布内容显示字符串
public string UpdateMethodListItemContent(MethodCoating methodCoating)
{
string strResult = string.Empty;
//strResult = "参数:{台面位置:" + methodCoating.positionText + "}{臂:" + methodCoating.armText + "}{菌落:" + methodCoating.bacteriaText + "}{涂布方式:" + methodCoating.coatingmodeText + "}";
return strResult;
}
///
/// 生成涂布方法的xml节点属性对象
///
/// 涂布方法的xml节点
/// 涂布方法的xml节点属性对象
public MethodCoating GenerateMethodCoating(XmlNode xmlNodeCoating)
{
MethodCoating methodCoating = new MethodCoating();
methodCoating.isrun = xmlNodeCoating.SelectSingleNode("isrun").InnerText;
methodCoating.status = xmlNodeCoating.SelectSingleNode("status").InnerText;
methodCoating.name = xmlNodeCoating.SelectSingleNode("name").InnerText;
methodCoating.label = xmlNodeCoating.SelectSingleNode("label").InnerText;
methodCoating.labwareText = xmlNodeCoating.SelectSingleNode("labware/text").InnerText;
methodCoating.labwareValue = xmlNodeCoating.SelectSingleNode("labware/value").InnerText;
methodCoating.positionText = xmlNodeCoating.SelectSingleNode("position/text").InnerText;
methodCoating.positionValue = xmlNodeCoating.SelectSingleNode("position/value").InnerText;
methodCoating.armText = xmlNodeCoating.SelectSingleNode("arm/text").InnerText;
methodCoating.armValue = xmlNodeCoating.SelectSingleNode("arm/value").InnerText;
methodCoating.coatingmodeText = xmlNodeCoating.SelectSingleNode("coatingmode/text").InnerText;
methodCoating.coatingmodeValue = xmlNodeCoating.SelectSingleNode("coatingmode/value").InnerText;
return methodCoating;
}
#endregion
#region 根据涂布文件方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据涂布文件方法属性对象,构建流程列表中方法显示的文字内容
///
/// 涂布文件方法的属性对象
/// 涂布文件方法的属性内容字符串
public string UpdateMethodListItemContent(MethodCoatingFile methodCoatingFile)
{
string strResult = string.Empty;
strResult = "参数:{文件路径:" + methodCoatingFile.filePath + "}{源板列:" + methodCoatingFile.sourceLabware + "}{源孔列:" + methodCoatingFile.sourceWell + "}{目标板列:" + methodCoatingFile.destinationLabware + "}"
+ "{目标孔列:" + methodCoatingFile.destinationWell + "}{菌名:" + methodCoatingFile.bacteriaText + "}";
return strResult;
}
///
/// 生成涂布文件方法的xml节点属性对象
///
/// 涂布文件方法的xml节点
/// 涂布文件方法的xml节点属性对象
public MethodCoatingFile GenerateMethodCoatingFile(XmlNode xmlNode)
{
MethodCoatingFile methodCoatingFile = new MethodCoatingFile();
methodCoatingFile.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodCoatingFile.status = xmlNode.SelectSingleNode("status").InnerText;
methodCoatingFile.name = xmlNode.SelectSingleNode("name").InnerText;
methodCoatingFile.label = xmlNode.SelectSingleNode("label").InnerText;
methodCoatingFile.strIndex= xmlNode.SelectSingleNode("strIndex").InnerText;
string strchs = xmlNode.SelectSingleNode("channels").InnerText;
methodCoatingFile.channels = ComUtility.GetChannelsFromXml(strchs);
methodCoatingFile.beginLine = Convert.ToInt32(xmlNode.SelectSingleNode("beginLine").InnerText);
methodCoatingFile.filePath = xmlNode.SelectSingleNode("filePath").InnerText;
methodCoatingFile.transferDataTable = GenerateTransferFileDataTable(xmlNode);//根据节点构建移液表
methodCoatingFile.sourceLabware = xmlNode.SelectSingleNode("sourceLabware").InnerText;
methodCoatingFile.sourceWell = xmlNode.SelectSingleNode("sourceWell").InnerText;
methodCoatingFile.destinationLabware = xmlNode.SelectSingleNode("destinationLabware").InnerText;
methodCoatingFile.destinationWell = xmlNode.SelectSingleNode("destinationWell").InnerText;
methodCoatingFile.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
methodCoatingFile.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
methodCoatingFile.bacteriaText = xmlNode.SelectSingleNode("bacteria/text").InnerText;
methodCoatingFile.bacteriaValue = xmlNode.SelectSingleNode("bacteria/value").InnerText;
methodCoatingFile.coatingModeValue= Convert.ToInt32(xmlNode.SelectSingleNode("coatingmodeValue").InnerText);
methodCoatingFile.choiceCategory = Convert.ToInt32(xmlNode.SelectSingleNode("choiceCategory").InnerText);
methodCoatingFile.coatingCount = Convert.ToInt32(xmlNode.SelectSingleNode("coatingCount").InnerText);
return methodCoatingFile;
}
#endregion
#region 根据涂布报告方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据涂布报告方法属性对象,构建流程列表中方法显示的文字内容
///
/// 涂布报告方法的属性对象
/// 涂布报告方法的属性内容字符串
public string UpdateMethodListItemContent(MethodCoatingReport methodCoatingReport)
{
string strResult = string.Empty;
strResult = "参数:{文件路径:" + methodCoatingReport.filePath + "}{文件名:"+ methodCoatingReport.fileName+ "}{文件后缀:"+ methodCoatingReport.filePostfix+ "}";
return strResult;
}
///
/// 生成涂布报告方法的xml节点属性对象
///
/// 涂布报告方法的xml节点
/// 涂布报告方法的xml节点属性对象
public MethodCoatingReport GenerateMethodCoatingReport(XmlNode xmlNode)
{
MethodCoatingReport methodCoatingReport = new MethodCoatingReport();
methodCoatingReport.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodCoatingReport.status = xmlNode.SelectSingleNode("status").InnerText;
methodCoatingReport.name = xmlNode.SelectSingleNode("name").InnerText;
methodCoatingReport.label = xmlNode.SelectSingleNode("label").InnerText;
methodCoatingReport.filePath = xmlNode.SelectSingleNode("filePath").InnerText;
methodCoatingReport.reportColumns = new List();
methodCoatingReport.reportColumns = GenerateReporColumnList(xmlNode);//根据节点构建移液表
methodCoatingReport.filePostfix = xmlNode.SelectSingleNode("filePostfix").InnerText;
methodCoatingReport.fileName = xmlNode.SelectSingleNode("fileName").InnerText;
return methodCoatingReport;
}
private List GenerateReporColumnList(XmlNode xmlNode)
{
List reportColumns= new List();
XmlNode xmlNode1 = xmlNode.SelectSingleNode("transferDataTable");
for (int j = 0; j < xmlNode1.ChildNodes[0].ChildNodes.Count; j++)
{
ReportColumn reportColumn = new ReportColumn();
reportColumn.reportcolumn_id = xmlNode1.ChildNodes[0].ChildNodes[j].InnerText;
reportColumn.reportcolumn_name = xmlNode1.ChildNodes[1].ChildNodes[j].InnerText;
reportColumn.reportcolumn_sname = xmlNode1.ChildNodes[2].ChildNodes[j].InnerText;
reportColumns.Add(reportColumn);
}
return reportColumns;
}
#endregion
#region 根据设置变量方法属性对象,构建流程列表中方法显示的文字内容
///
/// 根据设置变量方法属性对象,构建流程列表中方法显示的文字内容
///
/// 设置变量方法的属性
/// 设置变量内容显示字符串
public string UpdateMethodListItemContent(MethodSetVariable methodSetVariable)
{
string strResult = string.Empty;
strResult = "参数:{变量:" + methodSetVariable.variablename + "}{值:" + methodSetVariable.variablevalue + "}";
return strResult;
}
///
/// 生成设置变量方法的xml节点属性对象
///
/// 设置变量方法的xml节点
/// 设置变量方法的xml节点属性对象
public MethodSetVariable GenerateMethodSetVariable(XmlNode xmlNode)
{
MethodSetVariable methodSetVariable = new MethodSetVariable();
methodSetVariable.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
methodSetVariable.status = xmlNode.SelectSingleNode("status").InnerText;
methodSetVariable.name = xmlNode.SelectSingleNode("name").InnerText;
methodSetVariable.label = xmlNode.SelectSingleNode("label").InnerText;
methodSetVariable.enablepopwin = xmlNode.SelectSingleNode("enablepopwin").InnerText.ToLower() == "true" ? true : false;
methodSetVariable.variablename = xmlNode.SelectSingleNode("variablename").InnerText;
methodSetVariable.variablevalue = xmlNode.SelectSingleNode("variablevalue").InnerText;
return methodSetVariable;
}
#endregion
#region 把数组内的元素转换成字符串输出
///
/// 把数组内的元素转换成字符串输出
///
/// 原始字符串数组
/// 字符串
public string TransferToStringFromArray(string[] arrayString)
{
string strResult=string.Empty;
foreach(string str in arrayString)
{
strResult = strResult + str+",";
}
strResult = strResult.Substring(0, strResult.Length - 1);
return strResult;
}
#endregion
#region 把字符串内的元素转换成数组输出
///
/// 把数组内的元素转换成字符串输出
///
/// 原始字符串
/// 字符串组数
public string[] TransferToArrayFromString(string ChannelString)
{
string[] strResult = new string[] { };
strResult = ChannelString.Split(',');
return strResult;
}
#endregion
}
}