using DataEntity.Share;
using DataRWDAL;
//using DataRWDalDrive.Model;
using DriverLib.Engine;
using DriverLibrary;
using HxEnum;
using HxSocket;
using MySqlX.XDevAPI.Common;
using MySqlX.XDevAPI.Relational;
using NPOI.HPSF;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Xml;
using XCommon;
using XCommon.Log;
using XCore;
using XHandler.Class;
using XHandler.Class.DataEx;
using XHandler.Controls.Run.Com;
using XHandler.View;
using XHandler.View.Liquids;
using XHandler.View.MethodProperty;
using XImaging.Automation.Service.Interface;
using XImagingXhandler.XDAL;
using static HxEnum.OperationTypeEnum;
namespace XHandler.Controls
{
public class TransferFileSubSHControl
{
#region 变量
string strCurrentCulture = "";
WellCalc wellCalc = new WellCalc();
LatticeBll latticeBll = new LatticeBll();
AspirateBll aspirateBll = new AspirateBll();
public RunWnd launchView = null;
MethodFrame methodFrame = new MethodFrame();
CoatingFileBll coatingFileBll = new CoatingFileBll();
CoatingBll coatingBll = new CoatingBll();
//Operate.UIElement uiElement = new Operate.UIElement();//控件元素操作类对象
TransferFileBll transferFileBll = new TransferFileBll();
DispenseBll dispenseBll = new DispenseBll();
LoadTipsBll loadTipsBll = new LoadTipsBll();
public HxSocketClient socketTcpClientToRemote = null;
LiquidAccuracyBll liquidAccuracyBll = new LiquidAccuracyBll();
//private string labwareLimit = ConfigurationManager.AppSettings["labwareLimit"].ToString();
#endregion
public TransferFileSubSHControl(string strCurrentCulture)
{
this.strCurrentCulture = strCurrentCulture;
}
#region 执行移液文件,返回结果字符串
///
/// 执行移液文件,返回结果字符串
///
/// 所有放板的板位
/// 装载方法属性节点对象
/// 文件数据
/// z轴安全距离
/// false:连接谁;true:仿真
///
public bool ExecuteTransferFilegByWholeTipPriorForSH(XmlNode xmlEnv, XmlNode methodNode, DataTable dtTransferData,
float zAxisVal, bool isSimulator)
{
bool result = true;
var platformNodeList = xmlEnv.SelectNodes("platform");
string strMethodName = methodNode.SelectSingleNode("name").InnerText;
try
{
#region 数据准备
string labwaretipText = methodNode.SelectSingleNode("labwaretip/text").InnerText;
string strlabwaretipId = methodNode.SelectSingleNode("labwaretip/value").InnerText;
string channelNums = methodNode.SelectSingleNode("channels").InnerText;
string armName = methodNode.SelectSingleNode("arm/text").InnerText;
string armId = methodNode.SelectSingleNode("arm/value").InnerText;
string filePath = methodNode.SelectSingleNode("filePath").InnerText;
int beginLine = Convert.ToInt32(methodNode.SelectSingleNode("beginLine").InnerText);
MethodTransferFile methodTransferFile = methodFrame.GenerateMethodTransferFile(methodNode); // 获取移液表
string cnSourceLabware = methodNode.SelectSingleNode("sourceLabware").InnerText; // 来源板列名
string cnSourceWell = methodNode.SelectSingleNode("sourceWell").InnerText; // 来源孔列名
string cnDestinationLabware = methodNode.SelectSingleNode("destinationLabware").InnerText; // 目标板列名
string cnDestinationWell = methodNode.SelectSingleNode("destinationWell").InnerText; // 目标孔列名
string cnDestVolume = methodNode.SelectSingleNode("destVolume").InnerText; // 目标体积列名
string cnTipSet = methodNode.SelectSingleNode("tipSet").InnerText; // Tip设置
int cnChangeTipsMode = Convert.ToInt32(methodNode.SelectSingleNode("changeTipsMode").InnerText); // 更换枪头方式: 0-不换枪头, 1-根据表单内容更换枪头,2-每次吸加液后更换枪头
string cnChangeToTipText = methodNode.SelectSingleNode("changeToTipText").InnerText; // 更换枪头设置下拉项名称
string cnChangeToTipValue = methodNode.SelectSingleNode("changeToTipValue").InnerText; // 更换枪头设置下拉项Id
bool cnJump0Volume = methodNode.SelectSingleNode("jump0Volume").InnerText.ToLower() == "true" ? true : false; // 是否跳过为0的体积
string cnLiquididText = methodNode.SelectSingleNode("liquidid/text").InnerText; // 液体名称
string cnLiquididValue = methodNode.SelectSingleNode("liquidid/value").InnerText; // 液体Id
string cnliquidrangeidText = methodNode.SelectSingleNode("liquidrangeid/text").InnerText; // 液体范围名称
string cnliquidrangeidValue = methodNode.SelectSingleNode("liquidrangeid/value").InnerText; // 液体范围Id
string cnliquidpidText = methodNode.SelectSingleNode("liquidpid/text").InnerText; // 液体参数名称
string cnliquidpidVaue = methodNode.SelectSingleNode("liquidpid/value").InnerText; // 液体参数Id
bool enableMix = methodNode.SelectSingleNode("enableMix").InnerText.ToLower() == "true" ? true : false; // 是否混合
double mixvolume = Convert.ToDouble(methodNode.SelectSingleNode("mixvolume").InnerText); // 混合体积
int mixcount = Convert.ToInt32(methodNode.SelectSingleNode("mixcount").InnerText); // 混合次数
string mixAspiratePositionText = methodNode.SelectSingleNode("mixAspiratePosition/text").InnerText; // 吸液混合位置名称
string mixAspiratePositionValue = methodNode.SelectSingleNode("mixAspiratePosition/value").InnerText; // 吸液混合位置Id
double mixAspirateDistance = Convert.ToDouble(methodNode.SelectSingleNode("mixAspirateDistance").InnerText); // 吸液混合时距离
double mixAspirateSpeed = Convert.ToDouble(methodNode.SelectSingleNode("mixAspirateSpeed").InnerText); // 吸液混合时速度
string mixDispensePositionText = methodNode.SelectSingleNode("mixDispensePosition/text").InnerText; // 排液混合位置名称
string mixDispensePositionValue = methodNode.SelectSingleNode("mixDispensePosition/value").InnerText; // 排液混合位置Id
double mixDispenseDistance = Convert.ToDouble(methodNode.SelectSingleNode("mixDispenseDistance").InnerText); // 排液混合时距离
double mixDispenseSpeed = Convert.ToDouble(methodNode.SelectSingleNode("mixDispenseSpeed").InnerText); // 排液混合时速度
bool enableLiquidSensor = methodNode.SelectSingleNode("enableLiquidSensor").InnerText.ToLower() == "true" ? true : false;
int liquidSensorCount = Convert.ToInt32(methodNode.SelectSingleNode("liquidSensorCount").InnerText);
double liquidSensorDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorDistance").InnerText);
double liquidSensorEndDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorEndDistance").InnerText);
double liquidSensorSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorSpeed").InnerText);
double liquidSensorRadio = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorRadio").InnerText);
string liquidSensorDisIdText = methodNode.SelectSingleNode("liquidSensorDisId/text").InnerText;
string liquidSensorDisIdValue = methodNode.SelectSingleNode("liquidSensorDisId/value").InnerText;
bool enableLiquidFollow = methodNode.SelectSingleNode("enableLiquidFollow").InnerText.ToLower() == "true" ? true : false;
int liquidFollowType = Convert.ToInt32(methodNode.SelectSingleNode("liquidFollowType/value").InnerText);
string liquidFollowTypeName = methodNode.SelectSingleNode("liquidFollowType/text").InnerText;
double liquidFollowSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowSpeed").InnerText);
double liquidFollowDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowDistance").InnerText);
double liquidFollowArea = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowArea").InnerText);
bool enableMixFollow = methodNode.SelectSingleNode("enableMixFollow").InnerText.ToLower() == "true" ? true : false;
liquidSensorDisIdValue = Convert.ToInt32(liquidSensorDisIdValue) >= 3 ? (Convert.ToInt32(liquidSensorDisIdValue) + 1).ToString() : Convert.ToInt32(liquidSensorDisIdValue).ToString();
bool enableSensorBlock = methodNode.SelectSingleNode("enableSensorBlock").InnerText.ToLower() == "true" ? true : false; // 是否开启堵塞探测
//double liquidSensorBlockDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorBlockDistance").InnerText); // 堵塞探测距离
string aspirateBlockDisIdText = methodNode.SelectSingleNode("aspirateBlockDisId/text").InnerText; // 吸液堵塞处理选项名称
int aspirateBlockDisIdValue = Convert.ToInt32(methodNode.SelectSingleNode("aspirateBlockDisId/value").InnerText); // 吸液堵塞处理选项Id
string dispenseBlockDisIdText = methodNode.SelectSingleNode("dispenseBlockDisId/text").InnerText; // 排液堵塞处理选项名称
int dispenseBlockDisIdValue = Convert.ToInt32(methodNode.SelectSingleNode("dispenseBlockDisId/value").InnerText); // 排液堵塞处理选项Id
string aspirateAirDisIdText = methodNode.SelectSingleNode("aspirateAirDisId/text").InnerText; // 吸空处理选项名称
int aspirateAirDisIdValue = Convert.ToInt32(methodNode.SelectSingleNode("aspirateAirDisId/value").InnerText); // 吸空处理选项Id
#endregion
//channelNums = ""; // 通道字符串
string targetWellName = dtTransferData.Rows[0][cnDestinationWell].ToString(); // 目标板孔位
int targetWellIndex0 = Convert.ToInt32(ComUtility.GetRowIndex(targetWellName.Substring(0, 1))); // 行号
int countOfLeftColTip = 0; // 枪头盒一列的剩余量
int recordAllCount = dtTransferData.Rows.Count; // 文件记录总数
int recordIndex = 0; // 循环控制总的切分次数
TipsTable tipsTable = new TipsTable(); // 选中的枪头
// OneBatch(批次)、Node(节点)
// 1个批次根据有效孔位会拆分成多个节点:最少1个节点,最多N个节点
while (recordIndex < recordAllCount)
{
int loadTipsIndex = 0; // 一个批次执行index
int loadTipsCountOneBatch = 0; // 一个批次安装枪头的个数
string srcLabwareName = dtTransferData.Rows[0][cnSourceLabware].ToString(); // 来源板名称
string scrLabwareId = ""; // 来源板id;
string scrLatticeId = ""; // 来源板位置Id
// 用目标板名字查找目标板的类型
string desLabwareName = dtTransferData.Rows[0][cnDestinationLabware].ToString(); // 目标板名称
string desLabwareId = ""; // 目标板id;
string desLatticeId = ""; // 目标板位置Id
XmlNode desPlatformNode = transferFileBll.GetXmlNodeByBoardName(xmlEnv.SelectNodes("platform"), desLabwareName);
XmlNode desXml = desPlatformNode.SelectSingleNode("labware[@id='" + desPlatformNode.SelectNodes("labware").Count + "']");
//var desXml = xmlEnv.SelectSingleNode("platform[labware_sname='" + desLabwareName + "']");
XmlNode srcPlatformNode = transferFileBll.GetXmlNodeByBoardName(xmlEnv.SelectNodes("platform"), srcLabwareName);
XmlNode srcXml = srcPlatformNode.SelectSingleNode("labware[@id='" + srcPlatformNode.SelectNodes("labware").Count + "']");
//var srcXml = xmlEnv.SelectSingleNode("platform[labware_sname='" + srcLabwareName + "']");
if (srcXml != null)
{
scrLabwareId = srcXml.SelectSingleNode("labware_id").InnerText;
scrLatticeId = srcPlatformNode.SelectSingleNode("lattice_id").InnerText;
// 获取枪头盒一列的剩余量
countOfLeftColTip = GetNumberOfLeftTipsByCurrentLoading(xmlEnv, methodNode);
// 枪头盒一列的剩余量 <= 待做的孔
if (countOfLeftColTip <= (recordAllCount - recordIndex))
{
if (channelNums.Split(',').Length <= countOfLeftColTip)
{
loadTipsCountOneBatch = channelNums.Split(',').Length;
}
else
{
loadTipsCountOneBatch = countOfLeftColTip;
}
}
else if (countOfLeftColTip > (recordAllCount - recordIndex))
{
loadTipsCountOneBatch = (recordAllCount - recordIndex);
}
#region 安装枪头
if ((cnChangeTipsMode == 0 && recordIndex == 0) ||
(cnChangeTipsMode == 2))
{
channelNums = "";
for (int channelNo = 1; channelNo <= loadTipsCountOneBatch; channelNo++)
{
channelNums += channelNo.ToString() + ",";
}
channelNums = channelNums.Substring(0, channelNums.Length - 1);
// 更新枪通道数据
methodNode.SelectSingleNode("channels").InnerText = channelNums;
// 自动计算位置安装Tip
bool bLoadTipResult = ControlCom.LoadTipAutomation(xmlEnv.SelectNodes("platform"), methodNode,
isSimulator, launchView, socketTcpClientToRemote, 0);
if (!bLoadTipResult)
{
return false;
}
}
#endregion
#region 当前批次的移液数据
DataTable dtTransferDataOneBatch = new DataTable();
dtTransferDataOneBatch = dtTransferData.Clone();
for (loadTipsIndex = 0; loadTipsIndex < loadTipsCountOneBatch; loadTipsIndex++)
{
DataRow drow = dtTransferDataOneBatch.NewRow();
drow.ItemArray = dtTransferData.Rows[0].ItemArray;
dtTransferDataOneBatch.Rows.Add(drow);
dtTransferData.Rows.RemoveAt(0);
}
#endregion
List> tipsTablesOneBatchList = new List>(); // 一个批次所有孔的孔位信息(已拆分):ListItem1:连续孔,ListItem2:换行孔
List tipsTablesOneNodeList = new List(); // 一个批次连续孔的孔位信息
TipsTableRemote tipsTableRemote = new TipsTableRemote(); // 吸放液点位信息
List> pVolumeOneBatchList = new List>(); // 一个批次所有孔的体积(已拆分):ListItem1:连续孔,ListItem2:换行孔
List pVolumeOneNodeList = new List(); // 一个批次连续孔的体积
string latticeIdPre = ""; // 前一个板位Id
string labwareIdPre = ""; // 前一个耗材id
string wellPrefixPre = ""; // 前一个孔名前缀
string wellSuffixPre = ""; // 前一个孔名序号
string wellPrefixCur = ""; // 当前孔名前缀
string wellSuffixCur = ""; // 当前孔名序号
{
#region 吸液
tipsTablesOneBatchList = new List>(); // 一个批次所有孔的孔位信息(已拆分):ListItem1:连续孔,ListItem2:换行孔
tipsTablesOneNodeList = new List(); // 一个批次连续孔的孔位信息
pVolumeOneBatchList = new List>(); // 一个批次所有孔的体积(已拆分):ListItem1:连续孔,ListItem2:换行孔
pVolumeOneNodeList = new List(); // 一个批次连续孔的体积
tipsTableRemote = new TipsTableRemote();
latticeIdPre = ""; // 前一个板位Id
labwareIdPre = ""; // 前一个耗材id
wellPrefixPre = ""; // 前一个孔名前缀
wellSuffixPre = ""; // 前一个孔名序号
wellPrefixCur = ""; // 当前孔名前缀
wellSuffixCur = ""; // 当前个孔名序号
for (loadTipsIndex = 0; loadTipsIndex < loadTipsCountOneBatch; loadTipsIndex++) // 兼容不连续孔位,兼容不同类型板材
{
tipsTable = null;
srcLabwareName = dtTransferDataOneBatch.Rows[loadTipsIndex][cnSourceLabware].ToString(); // 来源板名称
string globalVariableValue = ControlCom.SearchValueOfGlobalVariable(launchView, srcLabwareName);
if(!string.IsNullOrEmpty(globalVariableValue))
{
srcLabwareName = globalVariableValue;
}
srcPlatformNode = transferFileBll.GetXmlNodeByBoardName(xmlEnv.SelectNodes("platform"), srcLabwareName);
srcXml = srcPlatformNode.SelectSingleNode("labware[@id='" + srcPlatformNode.SelectNodes("labware").Count + "']");
//srcXml = xmlEnv.SelectSingleNode("platform[labware_sname='" + srcLabwareName + "']");
scrLabwareId = srcXml.SelectSingleNode("labware_id").InnerText; // 来源耗材Id
scrLatticeId = srcPlatformNode.SelectSingleNode("lattice_id").InnerText; // 来源LatticeId
// 来源板位信息
Labware srcLabware = LabwareDB.GetLabware(scrLabwareId);
int pid = ControlCom.GetLatticeId(Convert.ToInt32(scrLatticeId));
Lattice srcLattice = LatticeDB.GetLatticeDataByIdFromdb(pid.ToString());
string srcWell = dtTransferDataOneBatch.Rows[loadTipsIndex][cnSourceWell].ToString(); // 来源板孔位
globalVariableValue = "";
globalVariableValue = ControlCom.SearchValueOfGlobalVariable(launchView, srcWell);
if (!string.IsNullOrEmpty(globalVariableValue))
{
srcWell = globalVariableValue;
}
float pVolume = 0f; // 吸放液体积
globalVariableValue = "";
globalVariableValue = ControlCom.SearchValueOfGlobalVariable(launchView, dtTransferDataOneBatch.Rows[loadTipsIndex][cnDestVolume].ToString());
if (!string.IsNullOrEmpty(globalVariableValue))
{
pVolume = (float)Convert.ToDouble(globalVariableValue);
}
else
{
pVolume = (float)Convert.ToDouble(dtTransferDataOneBatch.Rows[loadTipsIndex][cnDestVolume].ToString()); // 吸放液体积
}
string indexCoating = "";
string tagBarCode = "";
#region Del
//if (launchView.isRemotingOper)
//{
// if (dataTable.Columns.Contains("序号"))
// {
// indexCoating = dataTable.Rows[loadTipsIndex]["序号"].ToString();
// tagBarCode = dataTable.Rows[loadTipsIndex]["目标板码"].ToString();
// }
// else
// {
// indexCoating = dataTable.Rows[loadTipsIndex]["CoatingDataId"].ToString();
// tagBarCode = dataTable.Rows[loadTipsIndex]["TargetBarcode"].ToString();
// }
//}
//else
#endregion
{
if (dtTransferDataOneBatch.Columns.Contains("TargetBarcode"))
{
tagBarCode = dtTransferDataOneBatch.Rows[loadTipsIndex]["TargetBarcode"].ToString();
globalVariableValue = "";
globalVariableValue = ControlCom.SearchValueOfGlobalVariable(launchView, tagBarCode);
if (!string.IsNullOrEmpty(globalVariableValue))
{
tagBarCode = globalVariableValue;
}
}
}
// 获取板位孔的坐标数据
List srcTips = ControlCom.GenerateWellCoordinate(srcLabware, srcLattice);
wellPrefixCur = ComUtility.GetRowChar(srcWell); // 孔字母
wellSuffixCur = ComUtility.GetColNum(srcWell).ToString(); // 孔数字
// 查找出来源板上指定的孔位坐标
tipsTable = srcTips.SingleOrDefault(t => t.lattice_id.Equals(pid.ToString())
&& t.labware_id.Equals(scrLabwareId)
&& t.wellname.Equals(srcWell));
if (tipsTable == null)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs($"【{DateTime.Now.ToString("HH:mm:ss:fff")}】> Xhandler: 【{strMethodName}】{Properties.MachineRunResource.strProgress.ToString()}板位信息不存在!" +
$"lattice_id = {pid.ToString()}, labware_id= {scrLabwareId}");
}
else
{
launchView.AddLogs($"【{DateTime.Now.ToString("HH:mm:ss:fff")}】> Xhandler: 【{strMethodName}】process: lattice does not exist! " +
$"lattice_id = {pid.ToString()}, labware_id= {scrLabwareId}");
}
result = false;
return result;
}
if (loadTipsIndex == 0)
{
tipsTablesOneNodeList = new List();
pVolumeOneNodeList = new List();
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = scrLabwareId;
}
else
{
// 是连续的孔位 AND 和上次是同一个点位、同一个耗材
if ((ComUtility.GetRowIndex(wellPrefixPre) + 1 == ComUtility.GetRowIndex(wellPrefixCur)) &&
wellSuffixPre == wellSuffixCur &&
latticeIdPre == pid.ToString() && labwareIdPre == scrLabwareId)
{
// 判断相邻两孔之间的间距,与目标板位相邻的板位高度是否有障碍
if ((float)srcLabware.a1_b1_distance < 16f &&
srcLabware.labware_type_id != EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // != 试剂槽
{
// 判断当前板位左右是否有障碍耗材:
// 0:没有障碍,夹爪正常位抓取;1:较小编号台面有障碍; 3:较大编号台面有障碍;2;前后两个都有障碍
int iDirection = IsExistObstacle(xmlEnv, scrLatticeId);
if (iDirection == 0)
{
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTablesOneNodeList.Add(tipsTableRemote);
pVolumeOneNodeList.Add(pVolume);
latticeIdPre = pid.ToString();
labwareIdPre = scrLabwareId;
}
else if (iDirection == 1)
{
tipsTablesOneNodeList = new List();
pVolumeOneNodeList = new List();
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = scrLabwareId;
}
else if (iDirection == 2
//&& srcLattice.lattice_num != "P8" &&
//srcLattice.lattice_num != "P15" &&
//srcLattice.lattice_num != "P22" &&
//srcLattice.lattice_num != "P28"
)
{
tipsTablesOneNodeList = new List();
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = scrLabwareId;
}
else if (iDirection == 3)
{
tipsTablesOneNodeList = new List();
pVolumeOneNodeList = new List();
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = scrLabwareId;
}
}
else if ((float)srcLabware.a1_b1_distance >= 16f)
{
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
// 判断和上一条数据是孔位是否连续的,是否需要分板
pVolumeOneNodeList.Add(pVolume);
tipsTablesOneNodeList.Add(tipsTableRemote);
latticeIdPre = pid.ToString();
labwareIdPre = scrLabwareId;
}
}
// 来源板是试剂槽
else if (srcLabware.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString())
{
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTablesOneNodeList.Add(tipsTableRemote);
pVolumeOneNodeList.Add(pVolume);
latticeIdPre = pid.ToString();
labwareIdPre = scrLabwareId;
}
else
{
tipsTablesOneNodeList = new List();
//判断和上一条数据是孔位是否连续的,是否需要分板
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = scrLabwareId;
}
}
wellPrefixPre = ComUtility.GetRowChar(srcWell); // 孔字母
wellSuffixPre = ComUtility.GetColNum(srcWell).ToString(); // 孔数字
}
List aspirateMParamSHes = new List();//保存本次吸液的分组数据
if (tipsTablesOneBatchList.Count > 0)
{
for (int oneBatchIndex = 0; oneBatchIndex < tipsTablesOneBatchList.Count; oneBatchIndex++)
{
// 获取来源板位的坐标
Labware labwares = LabwareDB.GetLabware(tipsTablesOneBatchList[oneBatchIndex][0].labware_id);
int pid = Convert.ToInt32(tipsTablesOneBatchList[oneBatchIndex][0].lattice_id);
Lattice slattice = LatticeDB.GetLatticeDataByIdFromdb(pid.ToString());
srcXml = xmlEnv.SelectSingleNode("platform[lattice_id='" + ControlCom.GetLatticeId(Convert.ToInt32(slattice.lattice_id), false).ToString() + "']");
var mediaXml = srcXml.SelectSingleNode("labware[@id='" + srcXml.SelectNodes("labware").Count + "']");
srcLabwareName = mediaXml.SelectSingleNode("labware_sname").InnerText;
AspirateMParamSH aspirateMParamWH = new AspirateMParamSH();
float[] xArray = new float[tipsTablesOneBatchList[oneBatchIndex].Count];
float[] yArray = new float[tipsTablesOneBatchList[oneBatchIndex].Count];
float[] zArray = new float[tipsTablesOneBatchList[oneBatchIndex].Count];
string[] indexArray = new string[tipsTablesOneBatchList[oneBatchIndex].Count];
string[] barcodeArray = new string[tipsTablesOneBatchList[oneBatchIndex].Count];
string[] sourceArray = new string[tipsTablesOneBatchList[oneBatchIndex].Count];
int[] chArray = new int[tipsTablesOneBatchList[oneBatchIndex].Count];
aspirateMParamWH = GenerateAspirateParamSH(methodNode, methodTransferFile, labwares, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
for (int k = 0; k < tipsTablesOneBatchList[oneBatchIndex].Count; k++)
{
if (k == 0 && tipsTablesOneBatchList[oneBatchIndex].Count == 1)
{
aspirateMParamWH.xAxisVal = (float)Convert.ToDouble(tipsTablesOneBatchList[oneBatchIndex][k].axis_b_X.ToString());
aspirateMParamWH.yAxisVal = (float)Convert.ToDouble(tipsTablesOneBatchList[oneBatchIndex][k].axis_b_Y.ToString());
aspirateMParamWH.yChannelGapVal = 20f;
}
else if (k == 0 && tipsTablesOneBatchList[oneBatchIndex].Count > 1)
{
aspirateMParamWH.xAxisVal = (float)Convert.ToDouble(tipsTablesOneBatchList[oneBatchIndex][k].axis_b_X.ToString());
aspirateMParamWH.yAxisVal = (float)Convert.ToDouble(tipsTablesOneBatchList[oneBatchIndex][k].axis_b_Y.ToString());
aspirateMParamWH.yChannelGapVal = ((float)labwares.a1_b1_distance).Equals(0f) ? 9f : (float)labwares.a1_b1_distance;
}
sourceArray[k] = tipsTablesOneBatchList[oneBatchIndex][k].wellname;
indexArray[k] = tipsTablesOneBatchList[oneBatchIndex][k].indexCoating;
barcodeArray[k] = tipsTablesOneBatchList[oneBatchIndex][k].tagCodeCoating;
}
string strWell = string.Join(",", sourceArray);
tipsTable = tipsTableRemoteChangeToTipsTable(tipsTablesOneBatchList[oneBatchIndex][0]);
launchView.UpdateLabwareWells(tipsTable, sourceArray, 2); // 2:正在吸液红色
aspirateMParamSHes.Add(aspirateMParamWH);
HxResult ret = aspirateBll.ExecuteAspirate(aspirateMParamWH, isSimulator);
if (ret.Result != ResultType.Success)
{
if (ret.AlarmCode == AlarmCodeType.吸堵)//吸液堵塞
{
if (enableSensorBlock)
{
if (aspirateBlockDisIdValue == 0)//排掉样本到垃圾桶,更换枪头,重新吸样本
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 排掉样本到垃圾桶,更换枪头,重新吸样本");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 排掉样本到垃圾桶,更换枪头,重新吸样本");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is starting deal with ");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is starting deal with ");
}
#region 丢掉失败的枪头
List channels = ret.Details;//失败的枪头编号
UnloadTipsControl unloadTipsControl = new UnloadTipsControl(Shared.SoftwareInformation.currentculture);
unloadTipsControl.launchView = launchView;
bool bUnloadResult = unloadTipsControl.ExecuteUnloadTipsInToTrash(platformNodeList, methodNode, isSimulator);
if (!bUnloadResult)
{
result = false;
return result;
}
launchView.currentIsLoadingTips = false;
#endregion
#region 安装丢掉枪的通道
// 自动计算位置安装Tip
var loadTipMethodNode = GetLoadTipMethod();
bool bLoadTipResult = ControlCom.LoadTipAutomation(xmlEnv.SelectNodes("platform"), loadTipMethodNode,
isSimulator, launchView, null, 0);
if (!bLoadTipResult)
{
return false;
}
#endregion
#region 丢掉枪的通道重吸样本
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
int[] chArr = aspirateMParamWH.channelId;
float xAxisVal = aspirateMParamWH.xAxisVal;
float yAxisVal = aspirateMParamWH.yAxisVal;
float yChannelGapVal = aspirateMParamWH.yChannelGapVal;
bool bAspirateResult = ExecuteFailAfterAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice);
#region 不支持失败通道执行
/*
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
string[] currentSourceArray = new string[] { sourceArray[chIndex] };
string[] currentIndexArray = new string[] { indexArray[chIndex] };
bool bAspirateResult = ExecuteAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice, methodTransferFile,
tipsTable, srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), currentSourceArray, barcodeArray[0], currentIndexArray);
//(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
//strWell, slattice, methodTransferFile, labwares, tipsTable,
//srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, barcodeArray[0], indexArray
//, enableSensorBlock, aspirateBlockDisIdValue,
//platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
if (!bAspirateResult)
{
//return result; 再次失败不去处理了,继续做剩余的
}
}
*/
#endregion
#endregion
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 处理完毕");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 处理完毕");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is finished");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is finished");
}
}
else if (aspirateBlockDisIdValue == 1)//排掉样本到垃圾桶,不换枪头,重新吸样本
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 排掉样本到垃圾桶,不换枪头,重新吸样本");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 排掉样本到垃圾桶,不换枪头,重新吸样本");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is starting deal with ");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is starting deal with ");
}
#region 堵塞的通道排样本到垃圾桶
// 获取当前垃圾桶台面板位信息
List lattice = LatticeDB.GetTrashLatticeDataByIdFromdb(Shared.ChanelArmId.ToString(), Shared.SoftwareInformation.software_device_number);
Random random = new Random();
int index = random.Next(0, lattice.Count);
DispenseMParamSH dispenseMParamWH = new DispenseMParamSH();
dispenseMParamWH = GenerateDispenseParamForTrashSH(methodNode, lattice[index], aspirateMParamWH.channelId, aspirateMParamWH.pAxisVal[0]);
dispenseMParamWH.yChannelGapVal = 20f;
DispenseMParamSH dispenseMParamWHBak = DeepCopyByReflection.Copy(dispenseMParamWH);
int[] chArr = dispenseMParamWH.channelId;
float xAxisVal = dispenseMParamWH.xAxisVal;
float yAxisVal = dispenseMParamWH.yAxisVal;
float yChannelGapVal = dispenseMParamWH.yChannelGapVal;
bool bDispenseResult = ExecuteDispenseIntoTrash(dispenseMParamWH, isSimulator, methodTransferFile);
#region X3不支持失败的通道排液
/*
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
dispenseMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
dispenseMParamWH.channelCount = 1;
dispenseMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
dispenseMParamWH.pAxisVal = new float[] { dispenseMParamWHBak.pAxisVal[chIndex] };
bool bDispenseResult = ExecuteDispenseIntoTrash(dispenseMParamWH, isSimulator, methodTransferFile);
//(dispenseMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
//strWell, slattice, methodTransferFile, labwares, tipsTable,
//srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, barcodeArray[0], indexArray);
if(!bDispenseResult)
{
//return result; 失败的就忽略了
}
}
*/
#endregion
#endregion
#region 堵塞的通道,重吸样本
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
chArr = aspirateMParamWH.channelId;
xAxisVal = aspirateMParamWH.xAxisVal;
yAxisVal = aspirateMParamWH.yAxisVal;
yChannelGapVal = aspirateMParamWH.yChannelGapVal;
bool bAspirateResult = ExecuteFailAfterAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice);
#region 不支持失败的通道重新吸
/*//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
string[] currentSourceArray = new string[] { sourceArray[chIndex] };
string[] currentIndexArray = new string[] { indexArray[chIndex] };
bool bAspirateResult = ExecuteAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice, methodTransferFile,
tipsTable, srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), currentSourceArray, barcodeArray[0], currentIndexArray);
//(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
//strWell, slattice, methodTransferFile, labwares, tipsTable,
//srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, barcodeArray[0], indexArray
//, enableSensorBlock, aspirateBlockDisIdValue,
//platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
if (!bAspirateResult)
{
return result;
}
}
*/
#endregion
#endregion
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 处理完毕");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 处理完毕");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is finished");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is finished");
}
}
else if (aspirateBlockDisIdValue == 2)//排掉样本到来源孔,不换枪头,吸空气
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 排掉样本到来源孔,不换枪头,吸空气");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 排掉样本到来源孔,不换枪头,吸空气");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is starting deal with ");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is starting deal with ");
}
#region 堵塞的通道排样本到来源孔
DispenseMParamSH dispenseMParamWH = new DispenseMParamSH();
dispenseMParamWH = GenerateDispenseParamForSH(methodNode, labwares, aspirateMParamWH.channelId, aspirateMParamWH.pAxisVal[0], tipsTable);//GenerateDispenseParamForSH(methodNode, methodTransferFile, labwares, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
dispenseMParamWH.yChannelGapVal = (float)labwares.a1_b1_distance;
DispenseMParamSH dispenseMParamWHBak = DeepCopyByReflection.Copy(dispenseMParamWH);
int[] chArr = dispenseMParamWH.channelId;
float xAxisVal = dispenseMParamWH.xAxisVal;
float yAxisVal = dispenseMParamWH.yAxisVal;
float yChannelGapVal = dispenseMParamWH.yChannelGapVal;
bool bDispenseResult = ExecuteDispenseIntoSource(dispenseMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice);
#region 不支持失败的通道排
/*
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
dispenseMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
dispenseMParamWH.channelCount = 1;
dispenseMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
dispenseMParamWH.pAxisVal = new float[] { dispenseMParamWHBak.pAxisVal[chIndex] };
bool bDispenseResult = ExecuteDispenseIntoSource(dispenseMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice, methodTransferFile, labwares, tipsTable,
srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, barcodeArray[0], indexArray);
if (!bDispenseResult)
{
//return result; 失败则继续执行后面的
}
}
*/
#endregion
#endregion
#region 堵塞的通道,吸空气
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
chArr = aspirateMParamWH.channelId;
xAxisVal = aspirateMParamWH.xAxisVal;
yAxisVal = aspirateMParamWH.yAxisVal;
yChannelGapVal = aspirateMParamWH.yChannelGapVal;
for (int k = 0; k < chArr.Length; k++)
{
aspirateMParamWH.zAxisVal[k] = 0f;
}
aspirateMParamWH.isSurvey = false;
bool bAspirateResult = ExecuteFailAfterAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice);
#region 不支持失败的通道
/*//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
aspirateMParamWH.zAxisVal = new float[] { 0f };
string[] currentSourceArray = new string[] { sourceArray[chIndex] };
string[] currentIndexArray = new string[] { indexArray[chIndex] };
bool bAspirateResult = ExecuteAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice, methodTransferFile,
tipsTable, srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), currentSourceArray, barcodeArray[0], currentIndexArray);
//ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
//strWell, slattice, methodTransferFile, labwares, tipsTable,
//srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, barcodeArray[0], indexArray
//, enableSensorBlock, aspirateBlockDisIdValue,
//platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
if (!bAspirateResult)
{
return result;
}
}
*/
#endregion
#endregion
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 处理完毕");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 处理完毕");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is finished");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is finished");
}
}
else if (aspirateBlockDisIdValue == 3)//忽略此错误,继续执行后续操作
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamWH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamWH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
}
else if (aspirateBlockDisIdValue == 4)//终止执行
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamWH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamWH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "block", barcodeArray[0], indexArray);
return result;
}
else if (aspirateBlockDisIdValue == 5)//弹窗选择
{
OperateDialog plsConfirmOper = null;
if (!launchView.isRemotingOper)
{
System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>
{
plsConfirmOper = new OperateDialog(strCurrentCulture.Equals("zh-CN") ? Properties.RunAspirateResource.strFailWhatToDo + "失败通道号:" + string.Join(",", ret.Details) : "Aspirate are fail! What do you want to do? Failed channels:" + string.Join(",", ret.Details));
plsConfirmOper.ShowDialog();
}));
}
if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Retry) // 重试
{
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
int[] chArr = aspirateMParamWH.channelId;
float xAxisVal = aspirateMParamWH.xAxisVal;
float yAxisVal = aspirateMParamWH.yAxisVal;
float yChannelGapVal = aspirateMParamWH.yChannelGapVal;
bool bAspirateResult = ExecuteFailAfterAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice);
#region 不支持的通道吸
/*
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
aspirateMParamWH.zAxisVal = new float[] { 0f };
string[] currentSourceArray = new string[] { sourceArray[chIndex] };
string[] currentIndexArray = new string[] { indexArray[chIndex] };
bool bAspirateResult = ExecuteAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice, methodTransferFile,
tipsTable, srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), currentSourceArray, barcodeArray[0], currentIndexArray);
if (!bAspirateResult)
{
//return result; 再次失败就继续
}
}
//ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
// strWell, slattice, methodTransferFile, labwares, tipsTable,
// srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, barcodeArray[0], indexArray
// , enableSensorBlock, aspirateBlockDisIdValue,
// platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
*/
#endregion
return result;
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Cancel) // 终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasStopped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was stopped!");
}
result = false;
return result;
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Continue) // 跳过
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasSkipped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was skipped!");
}
}
}
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "block", barcodeArray[0], indexArray);
return result;
}
}
else if (ret.AlarmCode == AlarmCodeType.液面探测失败)//液面探测
{
if (liquidSensorDisIdValue == "0")//终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "block", barcodeArray[0], indexArray);
return result;
}
else if (liquidSensorDisIdValue == "1")//从孔底继续执行--不处理
{
}
else if (liquidSensorDisIdValue == "2")//从孔口继续执行--不处理
{
}
else if (liquidSensorDisIdValue == "4")//弹框选择
{
OperateDialog plsConfirmOper = null;
if (!launchView.isRemotingOper)
{
System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>
{
plsConfirmOper = new OperateDialog(strCurrentCulture.Equals("zh-CN") ? Properties.RunAspirateResource.strFailWhatToDo + " 失败通道:" + string.Join(",", ret.Details) : "Aspirate are fail, fialed channel:" + string.Join(",", ret.Details) + "! What do you want to do?");
plsConfirmOper.ShowDialog();
}));
}
if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Retry) // 重试
{
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
int[] chArr = aspirateMParamWH.channelId;
float xAxisVal = aspirateMParamWH.xAxisVal;
float yAxisVal = aspirateMParamWH.yAxisVal;
float yChannelGapVal = aspirateMParamWH.yChannelGapVal;
bool bAspirateResult = ExecuteFailAfterAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice);//
if (!bAspirateResult)
{
//return result; 再次失败就继续
}
#region X3设备不支持失败的通道重试
/*
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
aspirateMParamWH.zAxisVal = new float[] { 0f };
string[] currentSourceArray = new string[] { sourceArray[chIndex] };
string[] currentIndexArray = new string[] { indexArray[chIndex] };
bool bAspirateResult = ExecuteAspirate(aspirateMParamWH, isSimulator, methodNode, strWell, slattice, methodTransferFile,
tipsTable, srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), currentSourceArray, barcodeArray[0], currentIndexArray);
if (!bAspirateResult)
{
//return result; 再次失败就继续
}
}
//ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
// strWell, slattice, methodTransferFile, labwares, tipsTable,
// srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, barcodeArray[0], indexArray
// , enableSensorBlock, aspirateBlockDisIdValue,
// platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
//return result;
*/
#endregion
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Cancel) // 终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasStopped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was stopped!");
}
result = false;
return result;
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Continue) // 跳过
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasSkipped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was skipped!");
}
}
}
else if (liquidSensorDisIdValue == "5")//从当前继续执行--不处理
{
//PlsConfirmOper
}
}
else if (ret.AlarmCode == AlarmCodeType.吸空)//吸空
{
if(aspirateAirDisIdValue==0)//从孔底再次吸液
{
methodNode.SelectSingleNode("channels").InnerText = string.Join(",", ret.Details);
int[] channelArray= new int[ret.Details.Count];
float[] wellBottomArray= new float[ret.Details.Count];
float[] wellVolumeArray = new float[ret.Details.Count];
int[] channelIndexArray=new int[ret.Details.Count];//通道在源数组中的下标
for (int q=0;q 0) //失败的孔继续执行
{
aspirateMParamWH.channelId = channelArray;
aspirateMParamWH.channelCount = channelArray.Length;
aspirateMParamWH.zAxisVal = wellBottomArray;
for (int q = 0; q < channelIndexArray.Length; q++)
{
wellVolumeArray[q] = aspirateMParamWH.pAxisVal[channelIndexArray[q]];
}
aspirateMParamWH.pAxisVal = wellVolumeArray;
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
int[] chArr = aspirateMParamSHBak.channelId;
float yAxisVal = aspirateMParamSHBak.yAxisVal;
float yChannelGapVal = aspirateMParamSHBak.yChannelGapVal;
if (labwares.labware_height >= 22 && aspirateMParamWH.yChannelGapVal < 15) //拆分做
{
List channelArrayFailed = new List();//记录下这次失败的通道
for (int q = 0; q < ret.Details.Count; q++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[q]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[q]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
aspirateMParamWH.zAxisVal = new float[] { aspirateMParamWH.wellBottomzAxisVal };
//string[] currentSourceArray = new string[] { wells[chIndex] };
//string[] currentIndexArray = new string[] { indexArray[chIndex] };
aspirateMParamWH.yChannelGapVal = 20f;
ret = aspirateBll.ExecuteAspirate(aspirateMParamWH, isSimulator);
if (ret.Result != ResultType.Success)
{
channelArrayFailed.Add(aspirateMParamWH.channelId[0].ToString());
}
else
{
}
}
string strWellArray = string.Empty;
for (int q = 0; q < channelArrayFailed.Count; q++)
{
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(channelArrayFailed[q]));
strWellArray += sourceArray[chIndex] + ",";
}
if (strWellArray != string.Empty)
{
strWellArray = strWellArray.Substring(0, strWellArray.Length - 1);
}
if (channelArrayFailed.Count > 0)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWellArray + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWellArray + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWellArray + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWellArray + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
string[] strResultArray = new string[aspirateMParamSHBak.channelCount];
for (int q = 0; q < aspirateMParamSHBak.channelCount; q++)
{
strResultArray[q] = "pass";
for (int p = 0; p < channelArrayFailed.Count; p++)
{
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(channelArrayFailed[p]));
if (q == chIndex)
{
strResultArray[q] = "block";
break;
}
}
}
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, strResultArray, barcodeArray[0], indexArray);
return result;
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWellArray + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWellArray + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWellArray + " of " + slattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWellArray + " of " + slattice.lattice_num + " lattice!");
}
if (labwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
{
launchView.UpdateLabwareWells(tipsTable, strWellArray.Split(','), 1); // 无效孔白色
}
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "pass", barcodeArray[0], indexArray);
}
}
else
{
string strWellArray = string.Empty;
for (int q = 0; q < ret.Details.Count; q++)
{
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[q]));
strWellArray += sourceArray[chIndex] + ",";
}
if (strWellArray != string.Empty)
{
strWellArray = strWellArray.Substring(0, strWellArray.Length - 1);
}
ret = aspirateBll.ExecuteAspirate(aspirateMParamWH, isSimulator);
if (ret.Result != ResultType.Success)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWellArray + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWellArray + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWellArray + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWellArray + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
string[] strResultArray = new string[aspirateMParamSHBak.channelCount];
for (int q = 0; q < aspirateMParamSHBak.channelCount; q++)
{
strResultArray[q] = "pass";
for (int p = 0; p < ret.Details.Count; p++)
{
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[p]));
if (q == chIndex)
{
strResultArray[q] = "block";
break;
}
}
}
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, strResultArray, barcodeArray[0], indexArray);
return result;
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWellArray + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWellArray + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWellArray + " of " + slattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWellArray + " of " + slattice.lattice_num + " lattice!");
}
if (labwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
{
launchView.UpdateLabwareWells(tipsTable, strWell.Split(','), 1); // 无效孔白色
}
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "pass", barcodeArray[0], indexArray);
}
}
}
}
else if(aspirateAirDisIdValue == 1)//当前位置吸空气
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
}
if (labwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
{
launchView.UpdateLabwareWells(tipsTable, strWell.Split(','), 1); // 无效孔白色
}
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "pass", barcodeArray[0], indexArray);
}
else if (aspirateAirDisIdValue == 2)//忽略
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamWH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamWH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
}
else if (aspirateAirDisIdValue ==3)//终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamWH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamWH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "block", barcodeArray[0], indexArray);
return result;
}
}
//else if (ret.AlarmCode == AlarmCodeType.吸气泡)//吸气泡
//{
//}
//else if (ret.AlarmCode == AlarmCodeType.少吸)//少吸
//{
//}
else //其他、检查吸头未通过、null
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "block", barcodeArray[0], indexArray);
return result;
}
}
else
{
if (ret.AlarmCollection != null && ret.AlarmCollection.Count > 0)//有其它底层处理的失败
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunAspirateResource.strAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:aspirate " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul liquid is fail from " + strWell + " well on " + slattice.lattice_num + " lattice!error information:" + ret.AlarmInfo);
}
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "block", barcodeArray[0], indexArray);
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + pVolumeOneBatchList[oneBatchIndex][0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
}
if (labwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
{
launchView.UpdateLabwareWells(tipsTable, strWell.Split(','), 1); // 无效孔白色
}
launchView.addDataIntoReport(srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, "pass", barcodeArray[0], indexArray);
}
}
}
}
#endregion
#region 放液
tipsTablesOneBatchList = new List>(); // 一个批次所有孔的孔位信息(已拆分):ListItem1:连续孔,ListItem2:换行孔
tipsTablesOneNodeList = new List(); // 一个批次连续孔的孔位信息
pVolumeOneBatchList = new List>(); // 一个批次所有孔的体积(已拆分):ListItem1:连续孔,ListItem2:换行孔
pVolumeOneNodeList = new List(); // 一个批次连续孔的体积
tipsTableRemote = new TipsTableRemote();
latticeIdPre = ""; // 前一个板位Id
labwareIdPre = ""; // 前一个耗材id
wellPrefixPre = ""; // 前一个孔名前缀
wellSuffixPre = ""; // 前一个孔名序号
wellPrefixCur = ""; // 当前孔名前缀
wellSuffixCur = ""; // 当前孔名序号
for (loadTipsIndex = 0; loadTipsIndex < loadTipsCountOneBatch; loadTipsIndex++) // 兼容不连续孔位,兼容不同类型板材
{
tipsTable = null;
desLabwareName = dtTransferDataOneBatch.Rows[loadTipsIndex][cnDestinationLabware].ToString(); // 目标板名称
string globalVariableValue = "";
globalVariableValue = ControlCom.SearchValueOfGlobalVariable(launchView, desLabwareName);
if (!string.IsNullOrEmpty(globalVariableValue))
{
desLabwareName = globalVariableValue;
}
desPlatformNode = transferFileBll.GetXmlNodeByBoardName(xmlEnv.SelectNodes("platform"), desLabwareName);
desXml = desPlatformNode.SelectSingleNode("labware[@id='" + desPlatformNode.SelectNodes("labware").Count + "']");
desLabwareId = desXml.SelectSingleNode("labware_id").InnerText;
desLatticeId = desPlatformNode.SelectSingleNode("lattice_id").InnerText;
// 目标板位信息
Labware deslabwares = LabwareDB.GetLabware(desLabwareId);
int pid = ControlCom.GetLatticeId(Convert.ToInt32(desLatticeId));
Lattice desLattice = LatticeDB.GetLatticeDataByIdFromdb(pid.ToString());
string desWell = dtTransferDataOneBatch.Rows[loadTipsIndex][cnDestinationWell].ToString(); // 目标板孔位
globalVariableValue = "";
globalVariableValue = ControlCom.SearchValueOfGlobalVariable(launchView, desWell);
if (!string.IsNullOrEmpty(globalVariableValue))
{
desWell = globalVariableValue;
}
float pVolume = 0f; // 吸放液体积
globalVariableValue = "";
globalVariableValue = ControlCom.SearchValueOfGlobalVariable(launchView, dtTransferDataOneBatch.Rows[loadTipsIndex][cnDestVolume].ToString());
if (!string.IsNullOrEmpty(globalVariableValue))
{
pVolume = (float)Convert.ToDouble(globalVariableValue);
}
else
{
pVolume = (float)Convert.ToDouble(dtTransferDataOneBatch.Rows[loadTipsIndex][cnDestVolume].ToString()); // 吸放液体积
}
string indexCoating = "";
string tagBarCode = "";
#region Del
//if (launchView.isRemotingOper)
//{
// if (dtTransferData.Columns.Contains("序号"))
// {
// indexCoating = dtTransferDataOneBatch.Rows[loadTipsIndex]["序号"].ToString();
// tagBarCode = dtTransferDataOneBatch.Rows[loadTipsIndex]["目标板码"].ToString();
// }
// else
// {
// indexCoating = dtTransferDataOneBatch.Rows[loadTipsIndex]["CoatingDataId"].ToString();
// tagBarCode = dtTransferDataOneBatch.Rows[loadTipsIndex]["TargetBarcode"].ToString();
// }
//}
//else
#endregion
{
if (dtTransferDataOneBatch.Columns.Contains("TargetBarcode"))
{
tagBarCode = dtTransferDataOneBatch.Rows[loadTipsIndex]["TargetBarcode"].ToString();
globalVariableValue = "";
globalVariableValue = ControlCom.SearchValueOfGlobalVariable(launchView, tagBarCode);
if (!string.IsNullOrEmpty(globalVariableValue))
{
tagBarCode = globalVariableValue;
}
}
}
// 获取板位孔的坐标数据
List dtsTips = ControlCom.GenerateWellCoordinate(deslabwares, desLattice);
wellPrefixCur = ComUtility.GetRowChar(desWell); // 孔字母
wellSuffixCur = ComUtility.GetColNum(desWell).ToString(); // 孔数字
//查找出目标板上指定的孔位坐标
tipsTable = dtsTips.SingleOrDefault(t => t.lattice_id.Equals(pid.ToString())
&& t.labware_id.Equals(desLabwareId)
&& t.wellname.Equals(desWell));
if (tipsTable == null)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs($"【{DateTime.Now.ToString("HH:mm:ss:fff")}】> Xhandler: 【{strMethodName}】{Properties.MachineRunResource.strProgress.ToString()}板位信息不存在!" +
$"lattice_id = {pid.ToString()}, labware_id= {desLabwareId}, well_name= {desWell}");
}
else
{
launchView.AddLogs($"【{DateTime.Now.ToString("HH:mm:ss:fff")}】> Xhandler: 【{strMethodName}】process: lattice does not exist! " +
$"lattice_id = {pid.ToString()}, labware_id= {desLabwareId}, well_name= {desWell}");
}
result = false;
return result;
}
if (loadTipsIndex == 0)
{
tipsTablesOneNodeList = new List();
pVolumeOneNodeList = new List();
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = desLabwareId;
}
else
{
// 是连续的孔位 AND 和上次是同一个点位、同一个耗材
if ((ComUtility.GetRowIndex(wellPrefixPre) + 1 == ComUtility.GetRowIndex(wellPrefixCur)) &&
wellSuffixPre == wellSuffixCur &&
latticeIdPre == pid.ToString() && labwareIdPre == desLabwareId)
{
//判断相邻两孔之间的间距,与目标板位相邻的板位高度是否有障碍
if ((float)deslabwares.a1_b1_distance < 16f &&
deslabwares.labware_type_id != EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // != 试剂槽
{
// 判断当前板位左右是否有障碍耗材:
// 0:没有障碍,夹爪正常位抓取;1:较小编号台面有障碍; 3:较大编号台面有障碍;2;前后两个都有障碍
int iDirection = IsExistObstacle(xmlEnv, desLatticeId);
if (iDirection == 0)
{
//看看剩余的孔数是否小于这一批的总数,如果小于就需要单独分批
int currentWellRow = ComUtility.GetRowIndex(desWell.Substring(0,1)); // 孔字母
int countleftWell = deslabwares.number_row - currentWellRow;
if (countleftWell <= loadTipsCountOneBatch-1&&Shared.DeviceArmList.FirstOrDefault(x=>x.arm_type.Equals(1)).device_arm_property.Split(',').Length!= (tipsTablesOneNodeList.Count+ countleftWell))
{
tipsTablesOneNodeList = new List();
pVolumeOneNodeList = new List();
}
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
//判断和上一条数据是孔位是否连续的,是否需要分板
tipsTablesOneNodeList.Add(tipsTableRemote);
pVolumeOneNodeList.Add(pVolume);
if (countleftWell <= loadTipsCountOneBatch - 1 && Shared.DeviceArmList.FirstOrDefault(x => x.arm_type.Equals(1)).device_arm_property.Split(',').Length != ((tipsTablesOneNodeList.Count-1) + countleftWell))
{
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
}
latticeIdPre = pid.ToString();
labwareIdPre = desLabwareId;
}
else if (iDirection == 1)
{
tipsTablesOneNodeList = new List();
pVolumeOneNodeList = new List();
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = desLabwareId;
}
else if (iDirection == 2
//&& desLattice.lattice_num != "P8" &&
//desLattice.lattice_num != "P15" &&
//desLattice.lattice_num != "P22" &&
//desLattice.lattice_num != "P28"
)
{
tipsTablesOneNodeList = new List();
//判断和上一条数据是孔位是否连续的,是否需要分板
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
tipsTablesOneNodeList.Add(tipsTableRemote);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = desLabwareId;
}
else if (iDirection == 3)
{
tipsTablesOneNodeList = new List();
pVolumeOneNodeList = new List();
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = desLabwareId;
}
}
else if ((float)deslabwares.a1_b1_distance >= 16f)
{
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTablesOneNodeList.Add(tipsTableRemote);
pVolumeOneNodeList.Add(pVolume);
latticeIdPre = pid.ToString();
labwareIdPre = desLabwareId;
}
}
// 来源板是试剂槽
else if (deslabwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString())
{
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
//判断和上一条数据是孔位是否连续的,是否需要分板
tipsTablesOneNodeList.Add(tipsTableRemote);
pVolumeOneNodeList.Add(pVolume);
latticeIdPre = pid.ToString();
labwareIdPre = desLabwareId;
}
else
{
tipsTablesOneNodeList = new List();
// 判断和上一条数据是孔位是否连续的,是否需要分板
tipsTableRemote = tipsTableChangeToRemote(tipsTable);
tipsTableRemote.indexCoating = indexCoating;
tipsTableRemote.tagCodeCoating = tagBarCode;
tipsTablesOneNodeList.Add(tipsTableRemote);
tipsTablesOneBatchList.Add(tipsTablesOneNodeList);
pVolumeOneNodeList.Add(pVolume);
pVolumeOneBatchList.Add(pVolumeOneNodeList);
latticeIdPre = pid.ToString();
labwareIdPre = desLabwareId;
}
}
wellPrefixPre = ComUtility.GetRowChar(desWell); // 孔字母
wellSuffixPre = ComUtility.GetColNum(desWell).ToString(); // 孔数字
}
if (tipsTablesOneBatchList.Count != 0)
{
//计算出排液的孔位总数
int totalDispense = 0;
for(int k=0;k tagCodeList = new List(); ;
int idex = 0;
//channelNums = string.Empty;
Labware deslabwares = LabwareDB.GetLabware(tipsTablesOneBatchList[oneBatchIndex][0].labware_id);
Lattice desLattice = LatticeDB.GetLatticeDataByIdFromdb(Convert.ToInt32(tipsTablesOneBatchList[oneBatchIndex][0].lattice_id).ToString());
desXml = xmlEnv.SelectSingleNode("platform[lattice_id='" + ControlCom.GetLatticeId(Convert.ToInt32(desLattice.lattice_id), false).ToString() + "']");
var mediaDesXml = desXml.SelectSingleNode("labware[@id='" + desXml.SelectNodes("labware").Count + "']");
desLabwareName = mediaDesXml.SelectSingleNode("labware_sname").InnerText;
DispenseMParamSH dispenseMParamWH = new DispenseMParamSH();
dispenseMParamWH = GenerateDispenseParamForSH(methodNode, methodTransferFile, deslabwares, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
if (tipsTablesOneBatchList[oneBatchIndex].Count == 1)
{
dispenseMParamWH.yChannelGapVal = 20f;
}
else if (tipsTablesOneBatchList[oneBatchIndex].Count >= 2)
{
dispenseMParamWH.yChannelGapVal = ((float)deslabwares.a1_b1_distance).Equals(0f) ? 9f : (float)deslabwares.a1_b1_distance;
}
idex = GetChannelNumByTipsTableRemote(tipsTablesOneBatchList, oneBatchIndex);
for (int q = 0; q < tipsTablesOneBatchList[oneBatchIndex].Count; q++)
{
wellJoin += tipsTablesOneBatchList[oneBatchIndex][q].wellname + ",";
indexList += tipsTablesOneBatchList[oneBatchIndex][q].indexCoating + ",";
//channelNums += (idex + q + 1).ToString() + ",";
tagCodeList.Add(tipsTablesOneBatchList[oneBatchIndex][q].tagCodeCoating);
}
wellJoin = wellJoin.Substring(0, wellJoin.Length - 1);
string[] wellNameArray = wellJoin.Split(',');
indexList = indexList.Substring(0, indexList.Length - 1);
//channelNums = channelNums.Substring(0, channelNums.Length - 1);
tipsTable = tipsTableRemoteChangeToTipsTable(tipsTablesOneBatchList[oneBatchIndex][0]);
launchView.UpdateLabwareWells(tipsTable, wellNameArray, 3); // 正在放液水红色
DateTime startTime = DateTime.Now;
HxResult ret = dispenseBll.ExecuteDispense(dispenseMParamWH, isSimulator);
DateTime endTime = DateTime.Now;
//计算当前执行了几个孔了
int totalExecutedWell = 0;
for(int k=0;k< oneBatchIndex+1;k++)
{
totalExecutedWell += tipsTablesOneBatchList[k].Count;
}
if (ret.Result != ResultType.Success)
{
if (ret.AlarmCode == AlarmCodeType.排堵)
{
if (enableSensorBlock)//设置堵塞处理
{
if (dispenseBlockDisIdValue == 0)//排掉样本到垃圾桶,更换枪头,重新吸样本,再次排液
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 排掉样本到垃圾桶,更换枪头,重新吸样本,再次排液");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 排掉样本到垃圾桶,更换枪头,重新吸样本,再次排液");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is starting deal with ");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is starting deal with ");
}
#region 卸载堵塞失败的通道枪头
List channels = ret.Details;//失败的枪头编号
UnloadTipsControl unloadTipsControl = new UnloadTipsControl(Shared.SoftwareInformation.currentculture);
unloadTipsControl.launchView = launchView;
unloadTipsControl.socketTcpClientToRemote = socketTcpClientToRemote;
string strChannelBak = methodNode.SelectSingleNode("channels").InnerText;
methodNode.SelectSingleNode("channels").InnerText = string.Join(",", ret.Details);
bool bUnloadResult = unloadTipsControl.ExecuteUnloadTipsInToTrash(platformNodeList, methodNode, isSimulator);
if (!bUnloadResult)
{
result = false;
return result;
}
launchView.currentIsLoadingTips = false;
#endregion
#region 安装堵塞失败的通道新枪头
// 自动计算位置安装Tip
bool bLoadTipResult = ControlCom.LoadTipAutomation(xmlEnv.SelectNodes("platform"), methodNode,
isSimulator, launchView, socketTcpClientToRemote, 0);
if (!bLoadTipResult)
{
return false;
}
methodNode.SelectSingleNode("channels").InnerText = strChannelBak;
#endregion
#region 重新回来源孔吸液
if (aspirateMParamSHes.Count > 0)
{
foreach (AspirateMParamSH aspirateMParamWH in aspirateMParamSHes)
{
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
int[] deschArr = aspirateMParamWH.channelId;
float desxAxisVal = aspirateMParamWH.xAxisVal;
float desyAxisVal = aspirateMParamWH.yAxisVal;
float desyChannelGapVal = aspirateMParamWH.yChannelGapVal;
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
if (System.Array.Exists(aspirateMParamWH.channelId, element => element == Convert.ToInt32(ret.Details[i])))//通道号相同
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(deschArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = desyAxisVal + desyChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
//调用执行方法执行一次吸液
ret = aspirateBll.ExecuteAspirate(aspirateMParamWH, isSimulator);
if (ret.Result != ResultType.Success)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 源孔位 ");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + " 源孔位 ");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on the source well! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on the source well! Error info:" + ret.AlarmInfo);
}
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 源孔位 ");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 源孔位 ");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on the source well!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on the source well!");
}
}
}
}
}
}
#endregion
//#region 再次排液
//DispenseMParamSH dispenseMParamSHBak = DeepCopyByReflection.Copy(dispenseMParamWH);
//int[] chArr = dispenseMParamWH.channelId;
//float xAxisVal = dispenseMParamWH.xAxisVal;
//float yAxisVal = dispenseMParamWH.yAxisVal;
//float yChannelGapVal = dispenseMParamWH.yChannelGapVal;
////拆分通道为一个一个排
//for (int i = 0; i < ret.Details.Count; i++)
//{
// //重新计算通道和坐标
// int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
// dispenseMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
// dispenseMParamWH.channelCount = 1;
// dispenseMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
// dispenseMParamWH.pAxisVal = new float[] { dispenseMParamSHBak.pAxisVal[chIndex] };
// bool dispenseResult = ExecuteDispese(dispenseMParamWH, isSimulator, methodTransferFile,
// wellJoin, desLattice, tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, tagCodeList.ToArray(), indexList, tipsTablesOneBatchList[oneBatchIndex].Count);
// if(!dispenseResult)
// {
// }
//}
//#endregion
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 处理完毕");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strBlockBaseInfo + " 处理完毕");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is finished");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: aspirate action of blocking is finished");
}
}
else if (dispenseBlockDisIdValue == 1)//忽略此错误,继续执行后续操作
{
}
else if (dispenseBlockDisIdValue == 2)//终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
string[] indexCoatingList = new string[] { };
if (!string.IsNullOrEmpty(indexList))
{
indexCoatingList = indexList.Split(',');
}
launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
return result;
}
else if (dispenseBlockDisIdValue == 3)//弹窗选择
{
OperateDialog plsConfirmOper = null;
if (!launchView.isRemotingOper)
{
System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>
{
plsConfirmOper = new OperateDialog(strCurrentCulture.Equals("zh-CN") ? Properties.RunAspirateResource.strFailWhatToDo + " 失败通道:" + string.Join(",", ret.Details) : "Dispense are fail, fialed channel:" + string.Join(",", ret.Details) + "! What do you want to do?");
plsConfirmOper.ShowDialog();
}));
}
if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Retry) // 重试
{
DispenseMParamSH dispenseMParamSHBak = DeepCopyByReflection.Copy(dispenseMParamWH);
int[] chArr = dispenseMParamWH.channelId;
float xAxisVal = dispenseMParamWH.xAxisVal;
float yAxisVal = dispenseMParamWH.yAxisVal;
float yChannelGapVal = dispenseMParamWH.yChannelGapVal;
//拆分通道为一个一个排
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
dispenseMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
dispenseMParamWH.channelCount = 1;
dispenseMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
dispenseMParamWH.pAxisVal = new float[] { dispenseMParamSHBak.pAxisVal[chIndex] };
bool dispenseResult = ExecuteDispese(dispenseMParamWH, isSimulator, methodTransferFile,
wellJoin, desLattice, tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, tagCodeList.ToArray(), indexList, tipsTablesOneBatchList[oneBatchIndex].Count);
if (!dispenseResult)
{
}
}
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Cancel) // 终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
string[] indexCoatingList = new string[] { };
if (!string.IsNullOrEmpty(indexList))
{
indexCoatingList = indexList.Split(',');
}
launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
return result;
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Continue) // 跳过
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasSkipped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was skipped!");
}
}
}
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
string[] indexCoatingList = new string[] { };
if (!string.IsNullOrEmpty(indexList))
{
indexCoatingList = indexList.Split(',');
}
launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
return result;
}
}
else if(ret.AlarmCode== AlarmCodeType.液面探测失败)
{
if(liquidSensorDisIdValue=="0")//终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
string[] indexCoatingList = new string[] { };
if (!string.IsNullOrEmpty(indexList))
{
indexCoatingList = indexList.Split(',');
}
launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
return result;
}
if(liquidSensorDisIdValue=="5")//当前位置继续
{
}
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
string[] indexCoatingList = new string[] { };
if (!string.IsNullOrEmpty(indexList))
{
indexCoatingList = indexList.Split(',');
}
launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
tagCodeList.ToArray(), totalDispense, totalExecutedWell);
return result;
}
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Coating was successful on " + wellJoin + " of " + desLattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Coating was successful on " + wellJoin + " of " + desLattice.lattice_num + " lattice!");
}
if (deslabwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
{
launchView.UpdateLabwareWells(tipsTable, wellNameArray, 1); // 无效孔白色
}
else
{
launchView.UpdateLabwareWells(tipsTable, wellNameArray, 4); // 放液完成绿色
}
launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "pass",
tagCodeList.ToArray(), totalDispense, totalExecutedWell);//tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
}
}
}
#endregion
#region 卸载Tip,丢在垃圾桶
if ((cnChangeTipsMode == 0 && recordIndex + loadTipsCountOneBatch >= recordAllCount) ||
(cnChangeTipsMode == 2))
{
UnloadTipsControl unloadTipsControl = new UnloadTipsControl(Shared.SoftwareInformation.currentculture);
unloadTipsControl.launchView = launchView;
unloadTipsControl.socketTcpClientToRemote = socketTcpClientToRemote;
bool bUnloadResult = unloadTipsControl.ExecuteUnloadTipsInToTrash(platformNodeList, methodNode, isSimulator);
if (!bUnloadResult)
{
result = false;
return result;
}
launchView.currentIsLoadingTips = false;
}
#endregion
}
}
recordIndex = recordIndex + loadTipsCountOneBatch;
}
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.RunTransferFileResource.strAllStepsCompleted.ToString());
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.RunTransferFileResource.strAllStepsCompleted.ToString());
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】All steps of " + methodNode.SelectSingleNode("name").InnerText + " have been completed;");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】All steps of " + methodNode.SelectSingleNode("name").InnerText + " have been completed;");
}
}
catch (Exception ex)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strError.ToString() + " 源 " + ex.Source + " 错误信息 " + ex.Message + ";");
LoggerRunHelper.ErrorLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strError.ToString() + " 源 " + ex.Source + " 错误信息 " + ex.Message + ";");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】error:source:" + ex.Source + ";error:" + ex.Message + ";");
LoggerRunHelper.ErrorLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】error:source:" + ex.Source + ";error:" + ex.Message + ";");
}
if (launchView.isRemotingOper)
{
launchView.OnError?.Invoke(launchView.remoteObjectCmd, "EC-1001", 5, "error:source:" + ex.Source + ";error:" + ex.Message + ";", 2);
}
result = false;
}
return result;
}
#endregion
#region 创建安装枪头方法的xml
public XmlNode GetLoadTipMethod()
{
MethodLoadTips methodLoadTips = new MethodLoadTips();
methodLoadTips.name = "安装枪头";
methodLoadTips.label = "安装枪头";
methodLoadTips.armText = "通道臂";
methodLoadTips.armValue = Shared.ChanelArmId.ToString();
methodLoadTips.channels = Shared.ChannelsId;
methodLoadTips.labwaretipText = ControlCom.CurrentTipLabware.labware_name;
methodLoadTips.labwaretipValue = ControlCom.CurrentTipLabware.labware_id;
MethodEx mi = new MethodEx();
mi.method_isrun = "";
mi.isEnabled = true;
mi.strIndex = "3";
XmlNode xmlNode = this.CreateLoadTipsXmlNode(0, methodLoadTips, mi);
return xmlNode;
}
public XmlNode CreateLoadTipsXmlNode(int index, MethodLoadTips methodLoadTips, MethodEx mi)
{
XmlNode xmlNodeResult = null;
XmlDocument xmlDoc = new XmlDocument();
XmlElement xeKey = xmlDoc.CreateElement("method");//创建子节点,并且设置子节点的属性
XmlAttribute xeType = xmlDoc.CreateAttribute("id");
xeType.InnerText = index.ToString();
xeKey.SetAttributeNode(xeType);
XmlElement xeformX = xmlDoc.CreateElement("isrun");
xeformX.InnerText = mi.method_isrun;
xeKey.AppendChild(xeformX);
xeformX = xmlDoc.CreateElement("status");
//xeformX.InnerText = methodLoadTips.status;
xeformX.InnerText = (mi.isEnabled ? "enable" : "disable");
xeKey.AppendChild(xeformX);
xeformX = xmlDoc.CreateElement("name");
xeformX.InnerText = methodLoadTips.name;
xeKey.AppendChild(xeformX);
xeformX = xmlDoc.CreateElement("strIndex");
//xeformX.InnerText = methodLoadTips.strIndex;
xeformX.InnerText = mi.strIndex;
xeKey.AppendChild(xeformX);
xeformX = xmlDoc.CreateElement("label");
xeformX.InnerText = methodLoadTips.label;
xeKey.AppendChild(xeformX);
xeformX = xmlDoc.CreateElement("arm");
xeKey.AppendChild(xeformX);
XmlElement xeformX1 = xmlDoc.CreateElement("text");
xeformX1.InnerText = methodLoadTips.armText;
xeformX.AppendChild(xeformX1);
xeformX1 = xmlDoc.CreateElement("value");
xeformX1.InnerText = methodLoadTips.armValue;
xeformX.AppendChild(xeformX1);
xeformX = xmlDoc.CreateElement("channels");
string chs = string.Empty;
if (methodLoadTips.channels.Length != 0)
{
for (int i = 0; i < methodLoadTips.channels.Length; i++)
{
chs += methodLoadTips.channels[i] + ",";
}
chs = chs.Substring(0, chs.Length - 1);
}
xeformX.InnerText = chs;
xeKey.AppendChild(xeformX);
xeformX = xmlDoc.CreateElement("labwaretip");
xeKey.AppendChild(xeformX);
xeformX1 = xmlDoc.CreateElement("text");
xeformX1.InnerText = methodLoadTips.labwaretipText;
xeformX.AppendChild(xeformX1);
xeformX1 = xmlDoc.CreateElement("value");
xeformX1.InnerText = methodLoadTips.labwaretipValue;
xeformX.AppendChild(xeformX1);
xmlNodeResult = xeKey;
return xmlNodeResult;
}
#endregion
#region 出错处理的吸液方法
public bool ExecuteFailAfterAspirate(AspirateMParamSH aspirateMParamSH, bool isSimulator, XmlNode methodNode, string strWell, Lattice slattice)//, MethodAspirate methodAspirate)//,
//TipsTable tipsTable, string srcLabwareName, string volumn, string[] sourceArray, string barcode, string[] indexArray)
{
bool result = true;
HxResult ret = aspirateBll.ExecuteAspirate(aspirateMParamSH, isSimulator);
if (ret.Result != ResultType.Success)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunAspirateResource.strAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamSH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunAspirateResource.strAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamSH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
if (launchView.isRemotingOper)
{
launchView.OnError?.Invoke(launchView.remoteObjectCmd, "EC-1022", 5, Properties.RunAspirateResource.strAspirateFail.ToString() + ret.AlarmInfo + " 体积 " + aspirateMParamSH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num, 2);
}
result = false;
//launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "block", barcode, indexArray);
return result;
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunAspirateResource.strAspirateSuccess.ToString() + " 体积 " + aspirateMParamSH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunAspirateResource.strAspirateSuccess.ToString() + " 体积 " + aspirateMParamSH.pAxisVal[0].ToString() + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:Aspirate was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:Aspirate was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
}
//if (aspirateMParamWH.zAxisVal[0] == 0f)
//{
// launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "block", barcode, indexArray);
//}
//else
//{
// launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "pass", barcode, indexArray);
//}
}
return result;
}
#endregion
public bool ExecuteAspirate(AspirateMParamSH aspirateMParamWH, bool isSimulator, XmlNode methodNode, string strWell, Lattice slattice, MethodTransferFile methodTransferFile,
TipsTable tipsTable, string srcLabwareName, string volumn, string[] sourceArray, string barcode, string[] indexArray)//(AspirateMParamSH aspirateMParamWH, bool isSimulator, string liquidSensorDisIdValue, XmlNode methodNode,
//string strWell, Lattice slattice, MethodTransferFile methodTransferFile, Labware labwares, TipsTable tipsTable,
//string srcLabwareName, string volumn, string[] sourceArray, string barcode, string[] indexArray,
//bool enableSensorBlock, int aspirateBlockDisIdValue, XmlNodeList platformNodeList, XmlNode xmlEnv,
//List> tipsTablesOneBatchList, List> pVolumeOneBatchList, int oneBatchIndex)
{
bool result = true;
HxResult ret = aspirateBll.ExecuteAspirate(aspirateMParamWH, isSimulator);
if (ret.Result != ResultType.Success)
{
#region 失败
/*if (ret.AlarmCode == 1)//吸液堵塞
{
if (enableSensorBlock)
{
if (aspirateBlockDisIdValue == 0)//排掉样本到垃圾桶,更换枪头,重新吸样本
{
#region 丢掉失败的枪头
List channels = ret.Details;//失败的枪头编号
UnloadTipsControl unloadTipsControl = new UnloadTipsControl(Shared.SoftwareInformation.currentculture);
unloadTipsControl.launchView = launchView;
unloadTipsControl.socketTcpClientToRemote = socketTcpClientToRemote;
string strChannelBak = methodNode.SelectSingleNode("channels").InnerText;
methodNode.SelectSingleNode("channels").InnerText = string.Join(",", ret.Details);
bool bUnloadResult = unloadTipsControl.ExecuteUnloadTipsInToTrash(platformNodeList, methodNode, isSimulator);
if (!bUnloadResult)
{
result = false;
return result;
}
launchView.currentIsLoadingTips = false;
#endregion
#region 安装丢掉枪的通道
// 自动计算位置安装Tip
bool bLoadTipResult = ControlCom.LoadTipAutomation(xmlEnv.SelectNodes("platform"), methodNode,
isSimulator, launchView, socketTcpClientToRemote, 0);
if (!bLoadTipResult)
{
return false;
}
methodNode.SelectSingleNode("channels").InnerText = strChannelBak;
#endregion
#region 丢掉枪的通道重吸样本
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
int[] chArr = aspirateMParamWH.channelId;
float xAxisVal = aspirateMParamWH.xAxisVal;
float yAxisVal = aspirateMParamWH.yAxisVal;
float yChannelGapVal = aspirateMParamWH.yChannelGapVal;
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
bool bAspirateResult = ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice, methodTransferFile, labwares, tipsTable,
srcLabwareName, volumn, sourceArray, barcode, indexArray, enableSensorBlock, aspirateBlockDisIdValue,
platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
if (!bAspirateResult)
{
return result;
}
}
#endregion
}
else if (aspirateBlockDisIdValue == 1)//排掉样本到垃圾桶,不换枪头,重新吸样本
{
#region 堵塞的通道排样本到垃圾桶
// 获取当前垃圾桶台面板位信息
List lattice = LatticeDB.GetTrashLatticeDataByIdFromdb(Shared.ChanelArmId.ToString(), Shared.SoftwareInformation.software_device_number);
Random random = new Random();
int index = random.Next(0, lattice.Count);
DispenseMParamSH dispenseMParamWH = new DispenseMParamSH();
dispenseMParamWH = GenerateDispenseParamForTrashSH(methodNode, methodTransferFile, lattice[index], tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
dispenseMParamWH.yChannelGapVal = 20f;
DispenseMParamSH dispenseMParamWHBak = DeepCopyByReflection.Copy(dispenseMParamWH);
int[] chArr = dispenseMParamWH.channelId;
float xAxisVal = dispenseMParamWH.xAxisVal;
float yAxisVal = dispenseMParamWH.yAxisVal;
float yChannelGapVal = dispenseMParamWH.yChannelGapVal;
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
dispenseMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
dispenseMParamWH.channelCount = 1;
dispenseMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
dispenseMParamWH.pAxisVal = new float[] { dispenseMParamWHBak.pAxisVal[chIndex] };
bool bDispenseResult = ExecuteDispenseIntoTrash(dispenseMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice, methodTransferFile, labwares, tipsTable,
srcLabwareName, volumn, sourceArray, barcode, indexArray);
if (!bDispenseResult)
{
return result;
}
}
#endregion
#region 堵塞的通道,重吸样本
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
chArr = aspirateMParamWH.channelId;
xAxisVal = aspirateMParamWH.xAxisVal;
yAxisVal = aspirateMParamWH.yAxisVal;
yChannelGapVal = aspirateMParamWH.yChannelGapVal;
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
bool bAspirateResult = ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice, methodTransferFile, labwares, tipsTable,
srcLabwareName, volumn, sourceArray, barcode, indexArray
, enableSensorBlock, aspirateBlockDisIdValue,
platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
if (!bAspirateResult)
{
return result;
}
}
#endregion
}
else if (aspirateBlockDisIdValue == 2)//排掉样本到来源孔,不换枪头,吸空气
{
#region 堵塞的通道排样本到来源孔
DispenseMParamSH dispenseMParamWH = new DispenseMParamSH();
dispenseMParamWH = GenerateDispenseParamForSH(methodNode, methodTransferFile, labwares, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
dispenseMParamWH.yChannelGapVal = 20f;
DispenseMParamSH dispenseMParamWHBak = DeepCopyByReflection.Copy(dispenseMParamWH);
int[] chArr = dispenseMParamWH.channelId;
float xAxisVal = dispenseMParamWH.xAxisVal;
float yAxisVal = dispenseMParamWH.yAxisVal;
float yChannelGapVal = dispenseMParamWH.yChannelGapVal;
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
dispenseMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
dispenseMParamWH.channelCount = 1;
dispenseMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
dispenseMParamWH.pAxisVal = new float[] { dispenseMParamWHBak.pAxisVal[chIndex] };
bool bDispenseResult = ExecuteDispenseIntoSource(dispenseMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice, methodTransferFile, labwares, tipsTable,
srcLabwareName, volumn, sourceArray, barcode, indexArray);
if (!bDispenseResult)
{
return result;
}
}
#endregion
#region 堵塞的通道,吸空气
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
chArr = aspirateMParamWH.channelId;
xAxisVal = aspirateMParamWH.xAxisVal;
yAxisVal = aspirateMParamWH.yAxisVal;
yChannelGapVal = aspirateMParamWH.yChannelGapVal;
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
aspirateMParamWH.zAxisVal = new float[] { 0f };
bool bAspirateResult = ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice, methodTransferFile, labwares, tipsTable,
srcLabwareName, volumn, sourceArray, barcode, indexArray
, enableSensorBlock, aspirateBlockDisIdValue,
platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
if (!bAspirateResult)
{
return result;
}
}
#endregion
}
else if (aspirateBlockDisIdValue == 3)//忽略此错误,继续执行后续操作
{
}
else if (aspirateBlockDisIdValue == 4)//终止执行
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "block", barcode, indexArray);
return result;
}
else if (aspirateBlockDisIdValue == 5)//弹窗选择
{
OperateDialog plsConfirmOper = null;
if (!launchView.isRemotingOper)
{
System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>
{
plsConfirmOper = new OperateDialog(strCurrentCulture.Equals("zh-CN") ? Properties.RunAspirateResource.strFailWhatToDo + "失败通道号:" + string.Join(",", ret.Details) : "Aspirate are fail! What do you want to do? Failed channels:" + string.Join(",", ret.Details));
plsConfirmOper.ShowDialog();
}));
}
if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Retry) // 重试
{
ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice, methodTransferFile, labwares, tipsTable,
srcLabwareName, volumn, sourceArray, barcode, indexArray
, enableSensorBlock, aspirateBlockDisIdValue,
platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
return result;
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Cancel) // 终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasStopped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was stopped!");
}
result = false;
return result;
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Continue) // 跳过
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasSkipped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was skipped!");
}
}
}
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "block", barcode, indexArray);
return result;
}
}
else if (ret.AlarmCode == 2)//液面探测
{
if (liquidSensorDisIdValue == "0")//终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "block", barcode, indexArray);
return result;
}
else if (liquidSensorDisIdValue == "1")//从孔底继续执行--不处理
{
}
else if (liquidSensorDisIdValue == "2")//从孔口继续执行--不处理
{
}
else if (liquidSensorDisIdValue == "4")//弹框选择
{
OperateDialog plsConfirmOper = null;
if (!launchView.isRemotingOper)
{
System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>
{
plsConfirmOper = new OperateDialog(strCurrentCulture.Equals("zh-CN") ? Properties.RunAspirateResource.strFailWhatToDo : "Aspirate are fail! What do you want to do?");
plsConfirmOper.ShowDialog();
}));
}
if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Retry) // 重试
{
ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
strWell, slattice, methodTransferFile, labwares, tipsTable,
srcLabwareName, volumn, sourceArray, barcode, indexArray
, enableSensorBlock, aspirateBlockDisIdValue,
platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
return result;
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Cancel) // 终止
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasStopped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was stopped!");
}
result = false;
return result;
}
else if (plsConfirmOper != null && plsConfirmOper.OperMark == NodeOperationTypeEnum.Continue) // 跳过
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunAspirateResource.strLoadTipWasSkipped);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:load tip was skipped!");
}
}
}
else if (liquidSensorDisIdValue == "5")//从当前继续执行--不处理
{
//PlsConfirmOper
}
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "block", barcode, indexArray);
return result;
}
*/
#endregion
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Aspirate was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
if (launchView.isRemotingOper)
{
launchView.OnError?.Invoke(launchView.remoteObjectCmd, "EC-1022", 5, Properties.RunTransferFileResource.strFileAspirateFail.ToString() + ret.AlarmInfo + "孔 " + strWell + " 板位 " + slattice.lattice_num, 2);
}
result = false;
launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "block", barcode, indexArray);
return result;
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + volumn + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress.ToString() + Properties.RunTransferFileResource.strFileAspirateSuccess.ToString() + " 体积 " + volumn + "ul 孔 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Aspirate was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
}
//if (labwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
//{
// launchView.UpdateLabwareWells(tipsTable, strWell.Split(','), 1); // 无效孔白色
//}
if (aspirateMParamWH.zAxisVal[0] == 0f)
{
launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "block", barcode, indexArray);
}
else
{
launchView.addDataIntoReport(srcLabwareName, volumn, sourceArray, "pass", barcode, indexArray);
}
}
return result;
}
#region 执行因堵塞失败的通道到垃圾桶放液
public bool ExecuteDispenseIntoTrash(DispenseMParamSH dispenseMParamWH, bool isSimulator, MethodTransferFile methodTransferFile)
//(DispenseMParamSH dispenseMParamWH, bool isSimulator, string liquidSensorDisIdValue, XmlNode methodNode,
//string strWell, Lattice slattice, MethodTransferFile methodTransferFile, Labware labwares, TipsTable tipsTable,
//string srcLabwareName, string volumn, string[] sourceArray, string barcode, string[] indexArray)
{
bool result = true;
HxResult ret = dispenseBll.ExecuteDispense(dispenseMParamWH, isSimulator);
DateTime endTime = DateTime.Now;
if (ret.Result != ResultType.Success)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 在垃圾桶 " + Properties.MachineRunResource.strError + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 在垃圾桶 " + Properties.MachineRunResource.strError + ret.AlarmInfo);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Dispense was failed on the trash bin! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Dispense was failed on the trash bin! Error info:" + ret.AlarmInfo);
}
if (launchView.isRemotingOper)
{
launchView.OnError?.Invoke(launchView.remoteObjectCmd, "EC-1024", 5, Properties.RunCoatingFileResource.strDispenseErrorExec + " 在垃圾桶 " + Properties.MachineRunResource.strError + ret.AlarmInfo, 2);
}
result = false;
//string[] indexCoatingList = new string[] { };
//if (!string.IsNullOrEmpty(indexList))
//{
// indexCoatingList = indexList.Split(',');
//}
//launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
// indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
//launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
// tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
return result;
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 在垃圾桶。 ");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 在垃圾桶。 ");
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Dispense was successful on the trash bin!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Dispense was successful on the trash bin!");
}
//if (deslabwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
//{
// launchView.UpdateLabwareWells(tipsTable, wellNameArray, 1); // 无效孔白色
//}
//else
//{
// launchView.UpdateLabwareWells(tipsTable, wellNameArray, 4); // 放液完成绿色
//}
//launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "pass",
// tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
}
return result;
}
#endregion
#region 执行因堵塞失败的通道到来源孔位放液
public bool ExecuteDispenseIntoSource(DispenseMParamSH dispenseMParamSH, bool isSimulator, string liquidSensorDisIdValue, XmlNode methodNode,
string strWell, Lattice slattice)
{
bool result = true;
DispenseBll dispenseBll = new DispenseBll();
HxResult ret = dispenseBll.ExecuteDispense(dispenseMParamSH, isSimulator);
DateTime endTime = DateTime.Now;
if (ret.Result != ResultType.Success)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress: Dispense was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress: Dispense was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
if (launchView.isRemotingOper)
{
launchView.OnError?.Invoke(launchView.remoteObjectCmd, "EC-1024", 5, Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo, 2);
}
result = false;
return result;
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:Coating was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodNode.SelectSingleNode("name").InnerText + "】progress:Coating was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
}
}
return result;
}
#endregion
//#region 执行因堵塞失败的通道到来源孔位放液
//public bool ExecuteDispenseIntoSource(DispenseMParamSH dispenseMParamWH, bool isSimulator, string liquidSensorDisIdValue, XmlNode methodNode,
// string strWell, Lattice slattice, MethodTransferFile methodTransferFile, Labware labwares, TipsTable tipsTable,
// string srcLabwareName, string volumn, string[] sourceArray, string barcode, string[] indexArray)
//{
// bool result = true;
// HxResult ret = dispenseBll.ExecuteDispense(dispenseMParamWH, isSimulator);
// DateTime endTime = DateTime.Now;
// if (ret.Result != ResultType.Success)
// {
// if (strCurrentCulture.Equals("zh-CN"))
// {
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
// }
// else
// {
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Dispense was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Dispense was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
// }
// result = false;
// //string[] indexCoatingList = new string[] { };
// //if (!string.IsNullOrEmpty(indexList))
// //{
// // indexCoatingList = indexList.Split(',');
// //}
// //launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
// // indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
// //launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
// // tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
// return result;
// }
// else
// {
// if (strCurrentCulture.Equals("zh-CN"))
// {
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num);
// }
// else
// {
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Coating was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Coating was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
// }
// //if (deslabwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
// //{
// // launchView.UpdateLabwareWells(tipsTable, wellNameArray, 1); // 无效孔白色
// //}
// //else
// //{
// // launchView.UpdateLabwareWells(tipsTable, wellNameArray, 4); // 放液完成绿色
// //}
// //launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "pass",
// // tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
// }
// return result;
//}
//#endregion
#region
public bool ExecuteDispese(DispenseMParamSH dispenseMParamWH, bool isSimulator, MethodTransferFile methodTransferFile,
string strWell, Lattice slattice,
TipsTable tipsTable, string desLabwareName, string volumn, string[] desArray, string[] barcode, string indexList,int atimeTotal)
{
bool result = true;
HxResult ret = dispenseBll.ExecuteDispense(dispenseMParamWH, isSimulator);
DateTime endTime = DateTime.Now;
if (ret.Result != ResultType.Success)
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Dispense was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Dispense was failed on " + strWell + " of " + slattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
}
result = false;
string[] indexCoatingList = new string[] { };
if (!string.IsNullOrEmpty(indexList))
{
indexCoatingList = indexList.Split(',');
}
launchView.addFinishDataIntoReport(tipsTable, desLabwareName, volumn, desArray, "block",
barcode.ToArray(), atimeTotal, desArray.Length);
#region 失败
/*if (ret.AlarmCode == 3)
{
if (enableSensorBlock)
{
if (dispenseBlockDisIdValue == 0)//排掉样本到垃圾桶,更换枪头,重新吸样本,再次排液
{
#region 卸载堵塞失败的通道枪头
List channels = ret.Details;//失败的枪头编号
UnloadTipsControl unloadTipsControl = new UnloadTipsControl(Shared.SoftwareInformation.currentculture);
unloadTipsControl.launchView = launchView;
unloadTipsControl.socketTcpClientToRemote = socketTcpClientToRemote;
string strChannelBak = methodNode.SelectSingleNode("channels").InnerText;
methodNode.SelectSingleNode("channels").InnerText = string.Join(",", ret.Details);
bool bUnloadResult = unloadTipsControl.ExecuteUnloadTipsInToTrash(platformNodeList, methodNode, isSimulator);
if (!bUnloadResult)
{
result = false;
return result;
}
launchView.currentIsLoadingTips = false;
#endregion
#region 安装堵塞失败的通道新枪头
// 自动计算位置安装Tip
bool bLoadTipResult = ControlCom.LoadTipAutomation(xmlEnv.SelectNodes("platform"), methodNode,
isSimulator, launchView, socketTcpClientToRemote, 0);
if (!bLoadTipResult)
{
return false;
}
methodNode.SelectSingleNode("channels").InnerText = strChannelBak;
#endregion
#region 重新回来源孔吸液
if (aspirateMParamSHes.Count > 0)
{
foreach (AspirateMParamSH aspirateMParamWH in aspirateMParamSHes)
{
AspirateMParamSH aspirateMParamSHBak = DeepCopyByReflection.Copy(aspirateMParamWH);
int[] chArr = aspirateMParamWH.channelId;
float xAxisVal = aspirateMParamWH.xAxisVal;
float yAxisVal = aspirateMParamWH.yAxisVal;
float yChannelGapVal = aspirateMParamWH.yChannelGapVal;
//拆分丢掉枪的通道为一个一个重吸样本
for (int i = 0; i < ret.Details.Count; i++)
{
if (System.Array.Exists(aspirateMParamWH.channelId, element => element == Convert.ToInt32(ret.Details[i])))
{
//重新计算通道和坐标
int chIndex = Utilities.GetArrayIndex(chArr, Convert.ToInt32(ret.Details[i]));
aspirateMParamWH.yAxisVal = yAxisVal + yChannelGapVal * chIndex;
aspirateMParamWH.channelCount = 1;
aspirateMParamWH.channelId = new int[] { Convert.ToInt32(ret.Details[i]) };
aspirateMParamWH.pAxisVal = new float[] { aspirateMParamSHBak.pAxisVal[chIndex] };
bool bAspirateResult = true;//ExecuteAspirate(aspirateMParamWH, isSimulator, liquidSensorDisIdValue, methodNode,
//strWell, slattice, methodTransferFile, labwares, tipsTable,
//srcLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), sourceArray, barcodeArray[0], indexArray
//, enableSensorBlock, aspirateBlockDisIdValue,
//platformNodeList, xmlEnv, tipsTablesOneBatchList, pVolumeOneBatchList, oneBatchIndex);
if (!bAspirateResult)
{
return result;
}
}
}
}
}
#endregion
#region 再次排液
#endregion
}
else if (dispenseBlockDisIdValue == 1)//忽略此错误,继续执行后续操作
{
}
else if (dispenseBlockDisIdValue == 2)//终止
{
MethodMsg methodMsg = new MethodMsg(Guid.NewGuid().ToString(), "ID202_Choice_machine", 5, "", "ExecuteDispense", "1017",
"排液失败,方法终止运行。错误信息:" + ret.AlarmInfo, 6, 0);
if (socketTcpClientToRemote != null)
{
socketTcpClientToRemote.sendmessageError(socketTcpClientToRemote.CreateSendMsgContent(methodMsg, false), launchView.isRemotingOper);
}
//if (strCurrentCulture.Equals("zh-CN"))
//{
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
//}
//else
//{
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
//}
result = false;
//string[] indexCoatingList = new string[] { };
//if (!string.IsNullOrEmpty(indexList))
//{
// indexCoatingList = indexList.Split(',');
//}
//launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
// indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
//launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
// tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
return result;
}
else if (dispenseBlockDisIdValue == 3)//弹窗选择
{
}
}
else
{
MethodMsg methodMsg = new MethodMsg(Guid.NewGuid().ToString(), "ID202_Choice_machine", 5, "", "ExecuteDispense", "1017",
"排液失败,方法终止运行。错误信息:" + ret.AlarmInfo, 6, 0);
if (socketTcpClientToRemote != null)
{
socketTcpClientToRemote.sendmessageError(socketTcpClientToRemote.CreateSendMsgContent(methodMsg, false), launchView.isRemotingOper);
}
//if (strCurrentCulture.Equals("zh-CN"))
//{
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
//}
//else
//{
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
//}
result = false;
//string[] indexCoatingList = new string[] { };
//if (!string.IsNullOrEmpty(indexList))
//{
// indexCoatingList = indexList.Split(',');
//}
//launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
// indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
//launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
// tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
return result;
}
}
else if (ret.AlarmCode == 2)
{
}
else
{
MethodMsg methodMsg = new MethodMsg(Guid.NewGuid().ToString(), "ID202_Choice_machine", 5, "", "ExecuteDispense", "1017",
"排液失败,方法终止运行。错误信息:" + ret.AlarmInfo, 6, 0);
if (socketTcpClientToRemote != null)
{
socketTcpClientToRemote.sendmessageError(socketTcpClientToRemote.CreateSendMsgContent(methodMsg, false), launchView.isRemotingOper);
}
//if (strCurrentCulture.Equals("zh-CN"))
//{
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseErrorExec + " 孔位 " + wellJoin + " 板位 " + desLattice.lattice_num + Properties.MachineRunResource.strError + ret.AlarmInfo);
//}
//else
//{
// launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
// LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress: Coating was failed on " + wellJoin + " of " + desLattice.lattice_num + " lattice! Error info:" + ret.AlarmInfo);
//}
result = false;
//string[] indexCoatingList = new string[] { };
//if (!string.IsNullOrEmpty(indexList))
//{
// indexCoatingList = indexList.Split(',');
//}
//launchView.addCoatingFinishDataIntoReport(null, desLabwareName, "0", wellNameArray, "0",
// indexCoatingList, tagCodeList[0], startTime, endTime, "Dispense", idex, 0);
//launchView.addFinishDataIntoReport(tipsTable, desLabwareName, pVolumeOneBatchList[oneBatchIndex][0].ToString(), wellNameArray, "block",
// tagCodeList.ToArray(), tipsTablesOneBatchList[oneBatchIndex].Count, wellNameArray.Length);
return result;
}*/
#endregion
}
else
{
if (strCurrentCulture.Equals("zh-CN"))
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num);
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】" + Properties.MachineRunResource.strProgress + Properties.RunCoatingFileResource.strDispenseSuccessExec + " 孔位 " + strWell + " 板位 " + slattice.lattice_num);
}
else
{
launchView.AddLogs("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Dispense was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
LoggerRunHelper.InfoLog("【" + DateTime.Now.ToString("HH:mm:ss:fff") + "】>Xhandler: 【" + methodTransferFile.name + "】progress:Dispense was successful on " + strWell + " of " + slattice.lattice_num + " lattice!");
}
//if (deslabwares.labware_type_id == EnumManagement.GetEnumValue(ConsumableTypeEnum.Through).ToString()) // 试剂槽
//{
// launchView.UpdateLabwareWells(tipsTable, wellNameArray, 1); // 无效孔白色
//}
//else
//{
// launchView.UpdateLabwareWells(tipsTable, wellNameArray, 4); // 放液完成绿色
//}
launchView.addFinishDataIntoReport(tipsTable, desLabwareName, volumn, desArray, "pass",
barcode.ToArray(), atimeTotal, desArray.Length);
}
return result;
}
#endregion
#region 根据当前的孔位集合数据个数计算起点的通道号
///
/// 根据当前的孔位集合数据个数计算起点的通道号
///
///
///
///
public int GetChannelNumByTipsTableRemote(List> tipsTableRemoteArray, int currentIndex)
{
int result = 0;
for (int i = 0; i < tipsTableRemoteArray.Count; i++)
{
if (i < currentIndex)
{
result += tipsTableRemoteArray[i].Count;
}
}
return result;
}
#endregion
#region 获取当前安装的Tip盒子列中剩余的枪头个数
///
/// 获取当前安装的Tip盒子列中剩余的枪头个数
///
/// 当前台面xml节点集对象
/// 当前执行的方法xml节点对象
/// 当前安装的Tip盒子列中剩余的枪头个数
public int GetNumberOfLeftTipsByCurrentLoading(XmlNode plateNode, XmlNode methodNode)
{
//int result = 0;
//LoadTipsControl loadTipsControl = new LoadTipsControl(strCurrentCulture);
//loadTipsControl.launchView = this.launchView;
//List lstTipWellsNoUsed = loadTipsControl.GetLeftTipsByLoadTips(plateNode.SelectNodes("platform"), methodNode);
//TipsTable tipsTable = lstTipWellsNoUsed.FirstOrDefault(t => t.isUsed.Equals(0));
//if (tipsTable != null)
//{
// string wellName = tipsTable.wellname;
// int loadWellIndex = Convert.ToInt32(ComUtility.GetRowIndex(wellName.Substring(0, 1)));//Tip头行号
// result = Shared.ChannelCount - (loadWellIndex);//枪头列剩余的量
//}
//return result;
int count = DeviceArmDB.GetDeviceArmFromdb(Shared.SoftwareInformation.software_information_id).FirstOrDefault(x => x.arm_type.Equals(1)).device_arm_property.Split(',').Length;
//GetNumberOfLeftTipsByCurrentLoading:
// 来源板剩余的未执行一列有几个和通道数量相结合,决定取tip的数量
// 取tip的数量和tip和未使用最前一列的剩余个数,取最小值。
return count;//Shared.ChannelCount;
}
#endregion
#region 孔位数据转换为TipsTableRemote
///
/// 孔位数据转换为TipsTableRemote
///
///
///
public TipsTableRemote tipsTableChangeToRemote(TipsTable tipsTable)
{
TipsTableRemote tipsTableRemote = new TipsTableRemote();
tipsTableRemote.indexCoating = "";
tipsTableRemote.tagCodeCoating = "";
tipsTableRemote.lattice_id = tipsTable.lattice_id;
tipsTableRemote.labware_id = tipsTable.labware_id;
tipsTableRemote.wellname = tipsTable.wellname;
tipsTableRemote.axis_b_X = tipsTable.axis_b_X;
tipsTableRemote.axis_b_Y = tipsTable.axis_b_Y;
tipsTableRemote.axis_b_Z = tipsTable.axis_b_Z;
tipsTableRemote.well_top_shape = tipsTable.well_top_shape;
tipsTableRemote.axis_b_r = tipsTable.axis_b_r;
tipsTableRemote.isUsed = tipsTable.isUsed;
tipsTableRemote.lattice_num = tipsTable.lattice_num;
tipsTableRemote.isUsedCount = tipsTable.isUsedCount;
return tipsTableRemote;
}
#endregion
#region 孔位数据转换为TipsTable
///
/// 孔位数据转换为TipsTable
///
///
///
public TipsTable tipsTableRemoteChangeToTipsTable(TipsTableRemote tipsTableRemote)
{
TipsTable tipsTable = new TipsTable();
tipsTable.lattice_id = tipsTableRemote.lattice_id;
tipsTable.labware_id = tipsTableRemote.labware_id;
tipsTable.wellname = tipsTableRemote.wellname;
tipsTable.axis_b_X = tipsTableRemote.axis_b_X;
tipsTable.axis_b_Y = tipsTableRemote.axis_b_Y;
tipsTable.axis_b_Z = tipsTableRemote.axis_b_Z;
tipsTable.well_top_shape = tipsTableRemote.well_top_shape;
tipsTable.axis_b_r = tipsTableRemote.axis_b_r;
tipsTable.isUsed = tipsTableRemote.isUsed;
tipsTable.lattice_num = tipsTableRemote.lattice_num;
tipsTable.isUsedCount = tipsTableRemote.isUsedCount;
return tipsTable;
}
#endregion
#region 判断当前板位左右是否有障碍耗材
///
/// 判断当前板位左右是否有障碍耗材
///
/// 当前板位数据节点xml
/// 夹爪方法属性参数xml节点对象
/// 0:没有障碍,夹爪正常位抓取;1:较小编号台面有障碍;3:较大编号台面有障碍;2;前后两个都有障碍
public int IsExistObstacle(XmlNode latticesNode, string strSrcLatticeid)
{
int iResult = 0;
//Lattice lattice = LatticeDB.GetLatticeDataByIdFromdb(strSrcLatticeid.ToString());
//int currentLatticeIndex = Convert.ToInt32(lattice.lattice_num.Substring(1, lattice.lattice_num.Length - 1));
//ArrayList arrayList = GetFourDirectionLatticeId(strSrcLatticeid);
//for (int i = 0; i < arrayList.Count; i++)
//{
// string latticeIdStr = LatticeDB.GetLatticeDataByIdFromdb(arrayList[i].ToString(), Shared.ChanelArmId, Shared.SoftwareInformation.software_device_number).lattice_id;
// int latticeIndex = Convert.ToInt32((arrayList[i].ToString()).Substring(1, (arrayList[i].ToString()).Length - 1));
// var latticeXn = latticesNode.SelectSingleNode("platform[lattice_id=" + latticeIdStr + "]");
// string strlabwareId = "";
// if (latticeXn != null)
// {
// strlabwareId = latticeXn.SelectSingleNode("labware_id").InnerText;//板位上放的耗材Id
// //数据库读取耗材个总高度
// //判断耗材的高度是否在夹爪的安全抓取范围
// //夹爪正向耗材是在范围;夹爪纵向耗材是在范围;两者都在安全范围;两者都不在安全范围;
// ObservableCollection labwares = LabwareDB.GetLabware(1, strlabwareId);
// if (labwares.Count == 0)
// {
// labwares = LabwareDB.GetLabware(0, strlabwareId);
// }
// if (labwares.Count >= 1)
// {
// if (labwares[0].labware_height >= Convert.ToDouble(labwareLimit))
// {
// if (arrayList.Count == 1 && (latticeIndex < currentLatticeIndex))
// {
// iResult = 1;
// }
// else if (arrayList.Count == 1 && (latticeIndex > currentLatticeIndex))
// {
// iResult = 3;
// }
// else
// {
// iResult++;
// }
// }
// }
// }
// else
// {
// }
//}
return iResult;
}
#endregion
#region 根据当前板位Id,获取其四周的板位Id
///
/// 根据当前板位Id,获取其四周的板位Id
///
/// 当前板位id
/// 当前设备号
///
public ArrayList GetFourDirectionLatticeId(string currentLatticeId)
{
ArrayList arrayList = new ArrayList();
Lattice lattice = LatticeDB.GetLatticeDataByIdFromdb(currentLatticeId.ToString());
int currentLatticeIndex = Convert.ToInt32(lattice.lattice_num.Substring(1, lattice.lattice_num.Length - 1));
string latticeName = string.Empty;
if (currentLatticeIndex == 1 || currentLatticeIndex == 7 || currentLatticeIndex == 13 || currentLatticeIndex == 19 || currentLatticeIndex == 25 || currentLatticeIndex == 31 || currentLatticeIndex == 37)
{
latticeName = "P" + (currentLatticeIndex + 1).ToString();
arrayList.Add(latticeName);
}
else if (currentLatticeIndex == 6 || currentLatticeIndex == 12 || currentLatticeIndex == 18 || currentLatticeIndex == 24 || currentLatticeIndex == 30 || currentLatticeIndex == 36 || currentLatticeIndex == 42)
{
latticeName = "P" + (currentLatticeIndex - 1).ToString();
arrayList.Add(latticeName);
}
else
{
latticeName = "P" + (currentLatticeIndex - 1).ToString();
arrayList.Add(latticeName);
latticeName = "P" + (currentLatticeIndex + 1).ToString();
arrayList.Add(latticeName);
}
return arrayList;
}
#endregion
#region 吸液--上海
public AspirateMParamSH GenerateAspirateParamSH(XmlNode methodNode, MethodTransferFile methodCoatingFile,
Labware labware, List> tipsTableRemoteArrayList, List> pVolumeArrayList, int n)
{
#region 数据准备
string liquididText = methodNode.SelectSingleNode("liquidid/text").InnerText;
string liquididValue = methodNode.SelectSingleNode("liquidid/value").InnerText;
string liquidrangeidText = methodNode.SelectSingleNode("liquidrangeid/text").InnerText;
string liquidrangeidValue = methodNode.SelectSingleNode("liquidrangeid/value").InnerText;
string liquidpidText = methodNode.SelectSingleNode("liquidpid/text").InnerText;
string liquidpidValue = methodNode.SelectSingleNode("liquidpid/value").InnerText;
string channelNums = methodNode.SelectSingleNode("channels").InnerText;
string cnSourceLabware = methodNode.SelectSingleNode("sourceLabware").InnerText; // 来源板列名
string cnSourceWell = methodNode.SelectSingleNode("sourceWell").InnerText; // 来源孔列名
string cnDestinationLabware = methodNode.SelectSingleNode("destinationLabware").InnerText; // 目标板列名
string cnDestinationWell = methodNode.SelectSingleNode("destinationWell").InnerText; // 目标孔列名
string cnDestVolume = methodNode.SelectSingleNode("destVolume").InnerText; // 目标体积列名
bool enableMix = methodNode.SelectSingleNode("enableMix").InnerText.ToLower() == "true" ? true : false; // 是否混合
double mixvolume = Convert.ToDouble(methodNode.SelectSingleNode("mixvolume").InnerText); // 混合体积
int mixcount = Convert.ToInt32(methodNode.SelectSingleNode("mixcount").InnerText); // 混合次数
string mixAspiratePositionText = methodNode.SelectSingleNode("mixAspiratePosition/text").InnerText; // 吸液混合位置名称
string mixAspiratePositionValue = methodNode.SelectSingleNode("mixAspiratePosition/value").InnerText; // 吸液混合位置Id
double mixAspirateDistance = Convert.ToDouble(methodNode.SelectSingleNode("mixAspirateDistance").InnerText);// 吸液混合时距离
double mixAspirateSpeed = Convert.ToDouble(methodNode.SelectSingleNode("mixAspirateSpeed").InnerText); // 吸液混合时速度
string mixDispensePositionText = methodNode.SelectSingleNode("mixDispensePosition/text").InnerText; // 排液混合位置名称
string mixDispensePositionValue = methodNode.SelectSingleNode("mixDispensePosition/value").InnerText; // 排液混合位置Id
double mixDispenseDistance = Convert.ToDouble(methodNode.SelectSingleNode("mixDispenseDistance").InnerText);// 排液混合时距离
double mixDispenseSpeed = Convert.ToDouble(methodNode.SelectSingleNode("mixDispenseSpeed").InnerText); // 排液混合时速度
bool enableLiquidSensor = methodNode.SelectSingleNode("enableLiquidSensor").InnerText.ToLower() == "true" ? true : false;
int liquidSensorCount = Convert.ToInt32(methodNode.SelectSingleNode("liquidSensorCount").InnerText);
double liquidSensorDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorDistance").InnerText);
double liquidSensorEndDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorEndDistance").InnerText);
double liquidSensorSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorSpeed").InnerText);
double liquidSensorRadio = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorRadio").InnerText);
string liquidSensorDisIdText = methodNode.SelectSingleNode("liquidSensorDisId/text").InnerText;
string liquidSensorDisIdValue = methodNode.SelectSingleNode("liquidSensorDisId/value").InnerText;
bool enableLiquidFollow = methodNode.SelectSingleNode("enableLiquidFollow").InnerText.ToLower() == "true" ? true : false;
int liquidFollowType = Convert.ToInt32(methodNode.SelectSingleNode("liquidFollowType/value").InnerText);
string liquidFollowTypeName = methodNode.SelectSingleNode("liquidFollowType/text").InnerText;
double liquidFollowSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowSpeed").InnerText);
double liquidFollowDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowDistance").InnerText);
double liquidFollowArea = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowArea").InnerText);
bool enableMixFollow = methodNode.SelectSingleNode("enableMixFollow").InnerText.ToLower() == "true" ? true : false;
bool enableSensorBlock = methodNode.SelectSingleNode("enableSensorBlock").InnerText.ToLower() == "true" ? true : false; // 是否开启堵塞探测
//double liquidSensorBlockDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorBlockDistance").InnerText); // 堵塞探测距离
//string liquidSensorBlockDisIdText = methodNode.SelectSingleNode("liquidSensorBlockDisId/text").InnerText; // 未探测到堵塞时选项名称
//int liquidSensorBlockDisIdValue = Convert.ToInt32(methodNode.SelectSingleNode("liquidSensorBlockDisId/value").InnerText); // 未探测到堵塞时选项Id
string aspirateBlockDisIdText = methodNode.SelectSingleNode("aspirateBlockDisId/text").InnerText;
string aspirateBlockDisIdValue = methodNode.SelectSingleNode("aspirateBlockDisId/value").InnerText;
string dispenseBlockDisIdText = methodNode.SelectSingleNode("dispenseBlockDisId/text").InnerText;
string dispenseBlockDisIdValue = methodNode.SelectSingleNode("dispenseBlockDisId/value").InnerText;
string strWell = tipsTableRemoteArrayList[n][0].wellname; // 第一个孔位名称
int[] chs = new int[tipsTableRemoteArrayList[n].Count];
for (int m = 0; m < tipsTableRemoteArrayList[n].Count; m++)
{
chs[m] = this.GetChannelNumByTipsTableRemote(tipsTableRemoteArrayList, n) + m + 1;
}
string[] wellnames = new string[chs.Length];
float[] zAxisVals = new float[chs.Length];
float[] pVolmunVals = new float[chs.Length];
#endregion
// 液体参数
Liquid liquid = LiquidDB.GetALiquidFromdb(liquidpidValue);
AspirateMParamSH aspirateMParam = new AspirateMParamSH();
aspirateMParam.channelCount = chs.Length;
aspirateMParam.channelId = chs;
aspirateMParam.afterAirDelay = (int)liquid.after_aspirate_delay;
aspirateMParam.armId = Convert.ToInt32(methodCoatingFile.armValue);
aspirateMParam.aspirateAcceleration = (float)liquid.aspirate_acceleration;
aspirateMParam.aspirateDeceleration = (float)liquid.aspirate_deceleration;
aspirateMParam.aspirateDelay = (int)liquid.aspirate_delay;
aspirateMParam.aspirateEnterSpeed = (float)liquid.aspirate_enter_speed;
aspirateMParam.aspirateOutSpeed = (float)liquid.aspirate_out_speed;
aspirateMParam.aspirateSpeed = (float)liquid.aspirate_speed;
aspirateMParam.basezAxisVal = (float)Convert.ToDouble(ConfigurationManager.AppSettings["zAxisSafeVal"]);
aspirateMParam.beforeAirDelay = (int)liquid.before_aspirate_delay;
#region 后吸空气的体积
if ((float)liquid.after_aspirate_volume == 0f)
{
aspirateMParam.isAfterAir = false;
}
else
{
aspirateMParam.isAfterAir = true;
aspirateMParam.afterAirpAxisVal = (float)liquid.after_aspirate_volume;
}
#endregion
#region 前吸空气的体积
if (liquid.before_aspirate_volume == 0d)
{
aspirateMParam.isBeforeAir = false;
}
else
{
aspirateMParam.isBeforeAir = true;
aspirateMParam.beforeAirpAxisVal = (float)liquid.before_aspirate_volume;
}
#endregion
#region 吸液后多吸液体的体积
if (liquid.after_a_liquid_volume == 0d)
{
aspirateMParam.isIncLiquidAfter = false;
}
else
{
aspirateMParam.isIncLiquidAfter = true;
aspirateMParam.IncLiquidAfterpAxisVal = (float)liquid.after_a_liquid_volume;
}
#endregion
#region 吸液前多吸液体的体积
if (liquid.before_a_liquid_volume == 0d)
{
aspirateMParam.isIncLiquidBefore = false;
}
else
{
aspirateMParam.isIncLiquidBefore = true;
aspirateMParam.IncLiquidBeforepAxisVal = (float)liquid.before_a_liquid_volume;
}
#endregion
aspirateMParam.liquidVolumeType = (int)Convert.ToInt32((liquid.liquid_volume_type != null ? "1" : liquid.liquid_volume_type));
//aspirateMParam.wellzAxisVal = (float)liquid.well_top_length;
if (labware.labware_type_id.Equals("4"))
{
aspirateMParam.wellzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height);
}
else
{
aspirateMParam.wellzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labware.well_height);// - (float)liquid.well_top_length);
}
if (labware.well_shape == 2)
{
aspirateMParam.wellDiameter = (float)labware.well_top_x;
}
else if (labware.well_shape == 1)
{
aspirateMParam.wellDiameter = (float)(labware.well_mouth_radius * 2);
}
#region 碰壁
if (liquid.aspirate_is_knock_wall == 0)
{
aspirateMParam.isKnockWall = false;
}
else
{
aspirateMParam.isKnockWall = true;
aspirateMParam.knockDirection = (int)liquid.knock_direction;
aspirateMParam.knockSpeed = (int)Convert.ToInt32(liquid.knock_speed);
aspirateMParam.knockWallDelay = (int)liquid.knock_wall_delay;
aspirateMParam.knockWellxOryAxisVal = (float)liquid.knock_wall_length;
aspirateMParam.knockWellzAxisVal = (float)liquid.knock_well_height;
}
#endregion
//多点吸液
if (liquid.aspirate_well_bottom_length != "")
{
string[] strXoffset = liquid.aspirate_well_x.Split(',');
string[] strYoffset = liquid.aspirate_well_y.Split(',');
string[] strZoffset = liquid.aspirate_well_bottom_length.Split(',');
if (liquid.aspirate_well_x.Contains(","))
{
aspirateMParam.isMultiPointAspirate = true;
aspirateMParam.multiPointAspirateCount = strXoffset.Length;
aspirateMParam.xAxisAspirateOffsetVal = Utilities.GetFloatArrayFromStringArray(strXoffset);
aspirateMParam.yAxisAspirateOffsetVal = Utilities.GetFloatArrayFromStringArray(strYoffset);
aspirateMParam.zAxisAspirateOffsetVal = Utilities.GetFloatArrayFromStringArray(strZoffset);
}
else
{
aspirateMParam.isMultiPointAspirate = false;
}
//aspirateMParam.isMultiPointAspirate=
}
aspirateMParam.isMix = false;
aspirateMParam.mixAspirateDistance = 0;
aspirateMParam.mixAspirateSpeed = 100;
aspirateMParam.mixDispenseDistance = 0;
aspirateMParam.mixDispenseSpeed = 100;
aspirateMParam.xAxisVal = tipsTableRemoteArrayList[n][0].axis_b_X;
aspirateMParam.yAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Y;
aspirateMParam.zAxisVal = zAxisVals;
aspirateMParam.pAxisVal = pVolmunVals;
float pVolumnVas = 0f;
for (int k = 0; k < tipsTableRemoteArrayList[n].Count; k++)
{
strWell = tipsTableRemoteArrayList[n][k].wellname.ToString(); // 来源板孔位
pVolumnVas = pVolumeArrayList[n][k]; // 体积
// 移液精度
LiquidAccuracy liquidAccuracy = liquidAccuracyBll.GetLiquidAccuracyFromdb(Convert.ToInt32(liquidrangeidValue),
Convert.ToInt32(aspirateMParam.armId), Convert.ToDouble(pVolumnVas), liquididValue);
// 计算枪头的吸液体积
double targetVolume = liquidAccuracyBll.CalculateAspirateParamVolume(Convert.ToDouble(pVolumnVas), liquidAccuracy);
float zVal = tipsTableRemoteArrayList[n][k].axis_b_Z; // + 1.7f
string[] zOffsiteArray = liquid.aspirate_well_bottom_length.Split(',');
//aspirateMParam.wellzAxisVal = zVal - (float)labware.well_height;
if (liquid.aspirate_position_type == 0) // Liquid(液面)
{
zVal = tipsTableRemoteArrayList[n][k].axis_b_Z - (float)labware.well_height;
}
else if (liquid.aspirate_position_type == 1) // 孔口
{
zVal = aspirateMParam.wellzAxisVal + (float)Convert.ToDouble(zOffsiteArray[0]);
}
else if (liquid.aspirate_position_type == 2) // 孔底部
{
if (labware.labware_type_id.Equals("4"))
{
zVal = tipsTableRemoteArrayList[n][k].axis_b_Z - (float)Convert.ToDouble(zOffsiteArray[0]) - ControlCom.CalculateWellBottomThickness(labware.piled_script);
}
else
{
zVal = tipsTableRemoteArrayList[n][k].axis_b_Z - (float)Convert.ToDouble(zOffsiteArray[0]);
}
}
zAxisVals[k] = zVal < 0 ? 0 : zVal;
wellnames[k] = strWell;
pVolmunVals[k] = (float)targetVolume == 0f ? 20f : (float)targetVolume;
}
aspirateMParam.mixzAxisVal = (float)Convert.ToDouble(aspirateMParam.zAxisVal[0]);
aspirateMParam.isSurvey = enableLiquidSensor;
if (aspirateMParam.isSurvey == true)
{
if (labware.labware_type_id.Equals("4"))
{
Labware centrifugalLabware = ControlCom.GetCentrifugalLabwer(labware.piled_script);
aspirateMParam.surveyInitzVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height - (float)liquidSensorDistance);
aspirateMParam.surveyMaxzVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height - (float)liquidSensorEndDistance);
aspirateMParam.surveySpeed = (float)liquidSensorSpeed;
aspirateMParam.wellzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height);
aspirateMParam.wellBottomzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height - (float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_height);
aspirateMParam.surveyFailHandleType = Convert.ToInt32(liquidSensorDisIdValue);
if (enableLiquidFollow)
{
aspirateMParam.followupType = liquidFollowType;
aspirateMParam.followupSpeed = (float)liquidFollowSpeed;
aspirateMParam.followupDistance = (float)liquidFollowDistance;
float area = 0.0f;
if (labware.well_shape == (int)WellSharpe.Round)
{
area = (float)(Math.PI * (float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_mouth_radius * (float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_mouth_radius);
}
else if (labware.well_shape == (int)WellSharpe.Rectangle)
{
area = (float)((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_top_x * (float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_top_y);
}
aspirateMParam.sectionalArea = area;
aspirateMParam.isMixFollowup = enableMixFollow;
}
else
{
}
}
else
{
aspirateMParam.surveyRetryCount = liquidSensorCount;
aspirateMParam.surveyInitzVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labware.well_height - (float)liquidSensorDistance);
aspirateMParam.surveyMaxzVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labware.well_height - (float)liquidSensorEndDistance);
aspirateMParam.surveySpeed = (float)liquidSensorSpeed;
aspirateMParam.surveyCoefficient = Convert.ToInt32(liquidSensorRadio);
aspirateMParam.wellzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labware.well_height);// - (float)liquid.well_top_length);
aspirateMParam.wellBottomzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z;
aspirateMParam.surveyFailHandleType = Convert.ToInt32(liquidSensorDisIdValue);
if (enableLiquidFollow)
{
aspirateMParam.followupType = liquidFollowType;
aspirateMParam.followupSpeed = (float)liquidFollowSpeed;
aspirateMParam.followupDistance = (float)liquidFollowDistance;
float area = 0.0f;
if (labware.well_shape == (int)WellSharpe.Round)
{
area = (float)(Math.PI * labware.well_mouth_radius * labware.well_mouth_radius);
}
else if (labware.well_shape == (int)WellSharpe.Rectangle)
{
area = (float)(labware.well_top_x * labware.well_top_y);
}
aspirateMParam.sectionalArea = area;
aspirateMParam.isMixFollowup = enableMixFollow;
}
else
{
}
}
}
else
{
}
aspirateMParam.isMix = enableMix;
if (aspirateMParam.isMix == true)
{
aspirateMParam.mixAspiratePositionValue = Convert.ToInt32(mixAspiratePositionValue);
aspirateMParam.mixAspiratePositionText = mixAspiratePositionText;
#region 混合时,吸液距离类型Id,0:液面; 1顶部;2:底部
if (labware.labware_type_id.Equals("4"))
{
if (mixAspiratePositionValue == "0")//liquid
{
}
else if (mixAspiratePositionValue == "1")//top
{
aspirateMParam.mixAspirateDistance = ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_height - (float)mixAspirateDistance);
}
else if (mixAspiratePositionValue == "2")//bottom
{
aspirateMParam.mixAspirateDistance = (float)mixAspirateDistance;
}
}
else
{
if (mixAspiratePositionValue == "0") // liquid
{
}
else if (mixAspiratePositionValue == "1") // top
{
aspirateMParam.mixAspirateDistance = ((float)labware.well_height - (float)mixAspirateDistance);
}
else if (mixAspiratePositionValue == "2") // bottom
{
aspirateMParam.mixAspirateDistance = (float)mixAspirateDistance;
}
}
#endregion
aspirateMParam.mixAspirateSpeed = (float)Convert.ToDouble(mixAspirateSpeed);
aspirateMParam.mixDispensePositionValue = Convert.ToInt32(mixDispensePositionValue);
aspirateMParam.mixDispensePositionText = mixDispensePositionText;
#region 混合时,排液距离类型
if (labware.labware_type_id.Equals("4"))
{
if (mixDispensePositionValue == "0")//liquid
{
}
else if (mixDispensePositionValue == "1")//top
{
aspirateMParam.mixDispenseDistance = ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_height - (float)mixDispenseDistance);
}
else if (mixDispensePositionValue == "2")//bottom
{
aspirateMParam.mixDispenseDistance = (float)mixDispenseDistance;
}
}
else
{
if (mixDispensePositionValue == "0") // liquid
{
}
else if (mixDispensePositionValue == "1") // top
{
aspirateMParam.mixDispenseDistance = ((float)labware.well_height - (float)mixDispenseDistance);
}
else if (mixDispensePositionValue == "2") // bottom
{
aspirateMParam.mixDispenseDistance = (float)mixDispenseDistance;
}
}
#endregion
aspirateMParam.mixDispenseSpeed = (float)Convert.ToDouble(mixDispenseSpeed);
aspirateMParam.mixvolume = (float)mixvolume;
aspirateMParam.mixCount = mixcount;
}
else
{
aspirateMParam.mixAspirateDistance = 0;
aspirateMParam.mixAspirateSpeed = 100;
aspirateMParam.mixDispenseDistance = 0;
aspirateMParam.mixDispenseSpeed = 100;
}
return aspirateMParam;
}
#endregion
#region 放液
public DispenseMParamSH GenerateDispenseParamForSH(XmlNode methodNode,
Labware labware, int[] channelIds, double targetVolume, TipsTable tipsTable)
{
#region 数据准备
string liquididText = methodNode.SelectSingleNode("liquidid/text").InnerText;
string liquididValue = methodNode.SelectSingleNode("liquidid/value").InnerText;
string liquidrangeidText = methodNode.SelectSingleNode("liquidrangeid/text").InnerText;
string liquidrangeidValue = methodNode.SelectSingleNode("liquidrangeid/value").InnerText;
string liquidpidText = methodNode.SelectSingleNode("liquidpid/text").InnerText;
string liquidpidValue = methodNode.SelectSingleNode("liquidpid/value").InnerText;
bool enableLiquidSensor = methodNode.SelectSingleNode("enableLiquidSensor").InnerText.ToLower() == "true" ? true : false;
int liquidSensorCount = Convert.ToInt32(methodNode.SelectSingleNode("liquidSensorCount").InnerText);
double liquidSensorDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorDistance").InnerText);
double liquidSensorEndDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorEndDistance").InnerText);
double liquidSensorSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorSpeed").InnerText);
double liquidSensorRadio = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorRadio").InnerText);
string liquidSensorDisIdText = methodNode.SelectSingleNode("liquidSensorDisId/text").InnerText;
string liquidSensorDisIdValue = methodNode.SelectSingleNode("liquidSensorDisId/value").InnerText;
bool enableLiquidFollow = methodNode.SelectSingleNode("enableLiquidFollow").InnerText.ToLower() == "true" ? true : false;
int liquidFollowType = Convert.ToInt32(methodNode.SelectSingleNode("liquidFollowType/value").InnerText);
string liquidFollowTypeName = methodNode.SelectSingleNode("liquidFollowType/text").InnerText;
double liquidFollowSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowSpeed").InnerText);
double liquidFollowDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowDistance").InnerText);
double liquidFollowArea = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowArea").InnerText);
bool enableMixFollow = methodNode.SelectSingleNode("enableMixFollow").InnerText.ToLower() == "true" ? true : false;
string channelNums = methodNode.SelectSingleNode("channels").InnerText;
int[] chs = new int[channelIds.Length];
for (int m = 0; m < channelIds.Length; m++)
{
chs[m] = channelIds[m];
}
float[] zAxisVals = new float[channelIds.Length];
float[] pVolmunVals = new float[channelIds.Length];
#endregion
// 液体参数
Liquid liquid = LiquidDB.GetALiquidFromdb(liquidpidValue);
DispenseMParamSH dispenseMParam = new DispenseMParamSH();
dispenseMParam.channelCount = channelIds.Length;
dispenseMParam.channelId = chs;
dispenseMParam.afterAirDelay = (int)liquid.after_dispense_delay;
dispenseMParam.armId = Convert.ToInt32(methodNode.SelectSingleNode("arm/value").InnerText);
dispenseMParam.dispenseAcceleration = (float)liquid.dispense_acceleration;
dispenseMParam.dispenseDeceleration = (float)liquid.dispense_deceleration;
dispenseMParam.dispenseDelay = (int)liquid.dispense_delay;
dispenseMParam.dispenseEnterSpeed = (float)liquid.dispense_enter_speed;
dispenseMParam.dispenseOutSpeed = (float)liquid.dispense_out_speed;
dispenseMParam.dispenseSpeed = (float)liquid.dispense_speed;
dispenseMParam.basezAxisVal = (float)Convert.ToDouble(ConfigurationManager.AppSettings["zAxisSafeVal"]);
dispenseMParam.beforeAirDelay = (int)liquid.before_dispense_delay;
#region 后吸空气
if ((float)liquid.after_dispense_volume == 0f)
{
dispenseMParam.isAfterAir = false;
}
else
{
dispenseMParam.isAfterAir = true;
dispenseMParam.afterAirpAxisVal = (float)liquid.after_dispense_volume;
}
#endregion
#region 前吸空气
if (liquid.before_dispense_volume == 0d)
{
dispenseMParam.isBeforeAir = false;
}
else
{
dispenseMParam.isBeforeAir = true;
dispenseMParam.beforeAirpAxisVal = (float)liquid.before_dispense_volume;
}
#endregion
dispenseMParam.liquidVolumeType = (int)Convert.ToInt32((liquid.liquid_volume_type != null ? "1" : liquid.liquid_volume_type));
dispenseMParam.wellzAxisVal = (float)liquid.well_top_length; // 孔位平面的z轴
#region 碰壁
if (liquid.dispense_is_knock_wall == 0)
{
dispenseMParam.isKnockWall = false;
}
else
{
dispenseMParam.isKnockWall = true;
dispenseMParam.knockDirection = (int)liquid.knock_direction;
dispenseMParam.knockSpeed = (float)liquid.knock_speed;
dispenseMParam.knockWallDelay = (int)liquid.knock_wall_delay;
dispenseMParam.knockWellxOryAxisVal = (float)liquid.knock_wall_length;
dispenseMParam.knockWellzAxisVal = (float)liquid.knock_well_height;
}
#endregion
dispenseMParam.isSurvey = enableLiquidSensor;
if (dispenseMParam.isSurvey == true)
{
//dispenseMParam.surveyRetryCount = liquidSensorCount;
dispenseMParam.surveyInitzVal = tipsTable.axis_b_Z - ((float)labware.labware_height - (float)liquidSensorDistance);
dispenseMParam.surveyMaxzVal = tipsTable.axis_b_Z - ((float)labware.labware_height - (float)liquidSensorEndDistance);
dispenseMParam.surveySpeed = (float)liquidSensorSpeed;
//aspirateMParam.surveyCoefficient =;
dispenseMParam.wellzAxisVal = tipsTable.axis_b_Z - ((float)labware.labware_height - (float)liquid.well_top_length);
//dispenseMParam.wellBottomzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labwares.labware_height - (float)labwares.well_height);
//dispenseMParam.surveyFailHandlType = Convert.ToInt32(liquidSensorDisIdValue);
if (enableLiquidFollow)
{
//dispenseMParam.followupType = liquidFollowType;
dispenseMParam.followupSpeed = (float)liquidFollowSpeed;
dispenseMParam.followupDistance = (float)liquidFollowDistance;
float area = 0.0f;
if (labware.well_shape == (int)WellSharpe.Round)
{
area = (float)(Math.PI * labware.well_mouth_radius * labware.well_mouth_radius);
}
else if (labware.well_shape == (int)WellSharpe.Rectangle)
{
area = (float)(labware.well_top_x * labware.well_top_y);
}
dispenseMParam.sectionalArea = area;
dispenseMParam.isMixFollowup = enableMixFollow;
}
else
{
}
}
else
{
}
dispenseMParam.isMix = false;
dispenseMParam.mixAspirateDistance = 0;
dispenseMParam.mixAspirateSpeed = 100;
dispenseMParam.mixDispenseDistance = 0;
dispenseMParam.mixDispenseSpeed = 100;
dispenseMParam.enableVolumeToNull = true;
dispenseMParam.zAxisVal = zAxisVals;
dispenseMParam.pAxisVal = pVolmunVals;
dispenseMParam.mixzAxisVal = 0f;
float pVolumnVas = 0f;
for (int k = 0; k < channelIds.Length; k++)
{
pVolumnVas = (float)targetVolume; // 体积
if (k == 0)
{
dispenseMParam.xAxisVal = tipsTable.axis_b_X;
dispenseMParam.yAxisVal = tipsTable.axis_b_Y;
}
// 孔位平面的z轴
float zVal = tipsTable.axis_b_Z + ControlCom.CurrentLengthOfTipOffSetVal;
dispenseMParam.wellzAxisVal = zVal - (float)labware.well_height;
#region 孔位的z轴
if (liquid.dispense_position_type == 0)
{
}
else if (liquid.dispense_position_type == 2)
{
zVal = zVal - (float)liquid.dispense_well_bottom_length;
}
else if (liquid.dispense_position_type == 1)
{
zVal = dispenseMParam.wellzAxisVal + (float)liquid.dispense_well_bottom_length;
}
zAxisVals[k] = zVal < 0 ? 0 : zVal;
#endregion
//// 精度校准后的体积
//LiquidAccuracy liquidAccuracy = liquidAccuracyBll.GetLiquidAccuracyFromdb(Convert.ToInt32(liquidrangeidValue), Convert.ToInt32(dispenseMParam.armId), Convert.ToDouble(pVolumeArrayList[n][0]), liquididValue);
//double targetVolume = liquidAccuracyBll.CalculateAspirateParamVolume(Convert.ToDouble(pVolumnVas), liquidAccuracy);
pVolmunVals[k] = (float)targetVolume == 0f ? 20f : (float)targetVolume;
}
return dispenseMParam;
}
#endregion
#region 放液
public DispenseMParamSH GenerateDispenseParamForSH(XmlNode methodNode, MethodTransferFile methodCoatingFile,
Labware labware, List> tipsTableRemoteArrayList, List> pVolumeArrayList, int n)
{
#region 数据准备
string liquididText = methodNode.SelectSingleNode("liquidid/text").InnerText;
string liquididValue = methodNode.SelectSingleNode("liquidid/value").InnerText;
string liquidrangeidText = methodNode.SelectSingleNode("liquidrangeid/text").InnerText;
string liquidrangeidValue = methodNode.SelectSingleNode("liquidrangeid/value").InnerText;
string liquidpidText = methodNode.SelectSingleNode("liquidpid/text").InnerText;
string liquidpidValue = methodNode.SelectSingleNode("liquidpid/value").InnerText;
bool enableLiquidSensor = methodNode.SelectSingleNode("enableLiquidSensor").InnerText.ToLower() == "true" ? true : false;
int liquidSensorCount = Convert.ToInt32(methodNode.SelectSingleNode("liquidSensorCount").InnerText);
double liquidSensorDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorDistance").InnerText);
double liquidSensorEndDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorEndDistance").InnerText);
double liquidSensorSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorSpeed").InnerText);
double liquidSensorRadio = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorRadio").InnerText);
string liquidSensorDisIdText = methodNode.SelectSingleNode("liquidSensorDisId/text").InnerText;
string liquidSensorDisIdValue = methodNode.SelectSingleNode("liquidSensorDisId/value").InnerText;
bool enableLiquidFollow = methodNode.SelectSingleNode("enableLiquidFollow").InnerText.ToLower() == "true" ? true : false;
int liquidFollowType = Convert.ToInt32(methodNode.SelectSingleNode("liquidFollowType/value").InnerText);
string liquidFollowTypeName = methodNode.SelectSingleNode("liquidFollowType/text").InnerText;
double liquidFollowSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowSpeed").InnerText);
double liquidFollowDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowDistance").InnerText);
double liquidFollowArea = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowArea").InnerText);
bool enableMixFollow = methodNode.SelectSingleNode("enableMixFollow").InnerText.ToLower() == "true" ? true : false;
string channelNums = methodNode.SelectSingleNode("channels").InnerText;
int[] chs = new int[tipsTableRemoteArrayList[n].Count];
for (int m = 0; m < tipsTableRemoteArrayList[n].Count; m++)
{
chs[m] = GetChannelNumByTipsTableRemote(tipsTableRemoteArrayList, n) + m + 1;
}
string[] wellnames = new string[tipsTableRemoteArrayList[n].Count];
string[] indexLC = new string[tipsTableRemoteArrayList[n].Count];
string[] tagCodeLC = new string[tipsTableRemoteArrayList[n].Count];
float[] zAxisVals = new float[tipsTableRemoteArrayList[n].Count];
float[] pVolmunVals = new float[tipsTableRemoteArrayList[n].Count];
#endregion
// 液体参数
Liquid liquid = LiquidDB.GetALiquidFromdb(liquidpidValue);
DispenseMParamSH dispenseMParam = new DispenseMParamSH();
dispenseMParam.channelCount = tipsTableRemoteArrayList[n].Count;
dispenseMParam.channelId = chs;
dispenseMParam.afterAirDelay = (int)liquid.after_dispense_delay;
dispenseMParam.armId = Convert.ToInt32(methodCoatingFile.armValue);
dispenseMParam.dispenseAcceleration = (float)liquid.dispense_acceleration;
dispenseMParam.dispenseDeceleration = (float)liquid.dispense_deceleration;
dispenseMParam.dispenseDelay = (int)liquid.dispense_delay;
dispenseMParam.dispenseEnterSpeed = (float)liquid.dispense_enter_speed;
dispenseMParam.dispenseOutSpeed = (float)liquid.dispense_out_speed;
dispenseMParam.dispenseSpeed = (float)liquid.dispense_speed;
dispenseMParam.basezAxisVal = (float)Convert.ToDouble(ConfigurationManager.AppSettings["zAxisSafeVal"]);
dispenseMParam.beforeAirDelay = (int)liquid.before_dispense_delay;
#region 后吸空气
if ((float)liquid.after_dispense_volume == 0f)
{
dispenseMParam.isAfterAir = false;
}
else
{
dispenseMParam.isAfterAir = true;
dispenseMParam.afterAirpAxisVal = (float)liquid.after_dispense_volume;
}
#endregion
#region 前吸空气
if (liquid.before_dispense_volume == 0d)
{
dispenseMParam.isBeforeAir = false;
}
else
{
dispenseMParam.isBeforeAir = true;
dispenseMParam.beforeAirpAxisVal = (float)liquid.before_dispense_volume;
}
#endregion
dispenseMParam.liquidVolumeType = (int)Convert.ToInt32((liquid.liquid_volume_type != null ? "1" : liquid.liquid_volume_type));
//dispenseMParam.wellzAxisVal = (float)liquid.well_top_length; // 孔位平面的z轴
if (labware.labware_type_id.Equals("4"))
{
dispenseMParam.wellzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height);
}
else
{
dispenseMParam.wellzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labware.well_height);// - (float)liquid.well_top_length);
}
#region 碰壁
if (liquid.dispense_is_knock_wall == 0)
{
dispenseMParam.isKnockWall = false;
}
else
{
dispenseMParam.isKnockWall = true;
dispenseMParam.knockDirection = (int)liquid.knock_direction;
dispenseMParam.knockSpeed = (float)liquid.knock_speed;
dispenseMParam.knockWallDelay = (int)liquid.knock_wall_delay;
dispenseMParam.knockWellxOryAxisVal = (float)liquid.knock_wall_length;
dispenseMParam.knockWellzAxisVal = (float)liquid.knock_well_height;
}
#endregion
dispenseMParam.isSurvey = false;// enableLiquidSensor;
if (dispenseMParam.isSurvey == true)
{
if (labware.labware_type_id.Equals("4"))
{
Labware centrifugalLabware = ControlCom.GetCentrifugalLabwer(labware.piled_script);
dispenseMParam.surveyInitzVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height - (float)liquidSensorDistance);
dispenseMParam.surveyMaxzVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height - (float)liquidSensorEndDistance);
dispenseMParam.surveySpeed = (float)liquidSensorSpeed;
dispenseMParam.wellzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height);
dispenseMParam.wellBottomzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).labware_height - (float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_height);
dispenseMParam.surveyFailHandleType = Convert.ToInt32(liquidSensorDisIdValue);
if (enableLiquidFollow)
{
dispenseMParam.followupType = liquidFollowType;
dispenseMParam.followupSpeed = (float)liquidFollowSpeed;
dispenseMParam.followupDistance = (float)liquidFollowDistance;
float area = 0.0f;
if (labware.well_shape == (int)WellSharpe.Round)
{
area = (float)(Math.PI * (float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_mouth_radius * (float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_mouth_radius);
}
else if (labware.well_shape == (int)WellSharpe.Rectangle)
{
area = (float)((float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_top_x * (float)ControlCom.GetCentrifugalLabwer(labware.piled_script).well_top_y);
}
dispenseMParam.sectionalArea = area;
dispenseMParam.isMixFollowup = enableMixFollow;
}
else
{
}
}
else
{
//dispenseMParam.surveyRetryCount = liquidSensorCount;
dispenseMParam.surveyInitzVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labware.well_height - (float)liquidSensorDistance);
dispenseMParam.surveyMaxzVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labware.well_height - (float)liquidSensorEndDistance);
dispenseMParam.surveySpeed = (float)liquidSensorSpeed;
//aspirateMParam.surveyCoefficient =;
dispenseMParam.wellzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z - ((float)labware.well_height);// - (float)liquid.well_top_length);
dispenseMParam.wellBottomzAxisVal = tipsTableRemoteArrayList[n][0].axis_b_Z;
dispenseMParam.surveyFailHandleType = Convert.ToInt32(liquidSensorDisIdValue);
if (enableLiquidFollow)
{
//dispenseMParam.followupType = liquidFollowType;
dispenseMParam.followupSpeed = (float)liquidFollowSpeed;
dispenseMParam.followupDistance = (float)liquidFollowDistance;
float area = 0.0f;
if (labware.well_shape == (int)WellSharpe.Round)
{
area = (float)(Math.PI * labware.well_mouth_radius * labware.well_mouth_radius);
}
else if (labware.well_shape == (int)WellSharpe.Rectangle)
{
area = (float)(labware.well_top_x * labware.well_top_y);
}
dispenseMParam.sectionalArea = area;
dispenseMParam.isMixFollowup = enableMixFollow;
}
else
{
}
}
}
else
{
}
dispenseMParam.isMix = false;
dispenseMParam.mixAspirateDistance = 0;
dispenseMParam.mixAspirateSpeed = 100;
dispenseMParam.mixDispenseDistance = 0;
dispenseMParam.mixDispenseSpeed = 100;
dispenseMParam.enableVolumeToNull = true;
dispenseMParam.zAxisVal = zAxisVals;
dispenseMParam.pAxisVal = pVolmunVals;
dispenseMParam.mixzAxisVal = 0f;
float pVolumnVas = 0f;
for (int k = 0; k < tipsTableRemoteArrayList[n].Count; k++)
{
pVolumnVas = pVolumeArrayList[n][k]; // 体积
if (k == 0)
{
dispenseMParam.xAxisVal = tipsTableRemoteArrayList[n][k].axis_b_X;
dispenseMParam.yAxisVal = tipsTableRemoteArrayList[n][k].axis_b_Y;
}
// 孔位平面的z轴
float zVal = dispenseMParam.wellzAxisVal;//tipsTableRemoteArrayList[n][k].axis_b_Z + ControlCom.CurrentLengthOfTipOffSetVal;
//dispenseMParam.wellzAxisVal = zVal - (float)labware.well_height;
#region 孔位的z轴
if (liquid.dispense_position_type == 0)
{
}
else if (liquid.dispense_position_type == 1)
{
zVal = zVal + (float)liquid.dispense_well_bottom_length;
}
else if (liquid.dispense_position_type == 2)
{
//zVal = dispenseMParam.wellzAxisVal + (float)liquid.dispense_well_bottom_length;
if (labware.labware_type_id.Equals("4"))
{
zVal = tipsTableRemoteArrayList[n][k].axis_b_Z - (float)Convert.ToDouble(liquid.dispense_well_bottom_length) - ControlCom.CalculateWellBottomThickness(labware.piled_script);
}
else
{
zVal = tipsTableRemoteArrayList[n][k].axis_b_Z - (float)Convert.ToDouble(liquid.dispense_well_bottom_length);
}
}
zAxisVals[k] = zVal < 0 ? 0 : zVal;
#endregion
wellnames[k] = tipsTableRemoteArrayList[n][k].wellname; // 孔位
// 精度校准后的体积
LiquidAccuracy liquidAccuracy = liquidAccuracyBll.GetLiquidAccuracyFromdb(Convert.ToInt32(liquidrangeidValue), Convert.ToInt32(dispenseMParam.armId), Convert.ToDouble(pVolumeArrayList[n][0]), liquididValue);
double targetVolume = liquidAccuracyBll.CalculateAspirateParamVolume(Convert.ToDouble(pVolumnVas), liquidAccuracy);
pVolmunVals[k] = (float)targetVolume == 0f ? 20f : (float)targetVolume;
}
dispenseMParam.mixzAxisVal = zAxisVals[0];
return dispenseMParam;
}
#endregion
#region 出错处理的放液到垃圾桶参数
public DispenseMParamSH GenerateDispenseParamForTrashSH(XmlNode methodNode, Lattice latticeTrash,
int[] channelIds, double targetVolume)
{
#region 数据准备
string liquididText = methodNode.SelectSingleNode("liquidid/text").InnerText;
string liquididValue = methodNode.SelectSingleNode("liquidid/value").InnerText;
string liquidrangeidText = methodNode.SelectSingleNode("liquidrangeid/text").InnerText;
string liquidrangeidValue = methodNode.SelectSingleNode("liquidrangeid/value").InnerText;
string liquidpidText = methodNode.SelectSingleNode("liquidpid/text").InnerText;
string liquidpidValue = methodNode.SelectSingleNode("liquidpid/value").InnerText;
bool enableLiquidSensor = methodNode.SelectSingleNode("enableLiquidSensor").InnerText.ToLower() == "true" ? true : false;
int liquidSensorCount = Convert.ToInt32(methodNode.SelectSingleNode("liquidSensorCount").InnerText);
double liquidSensorDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorDistance").InnerText);
double liquidSensorEndDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorEndDistance").InnerText);
double liquidSensorSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorSpeed").InnerText);
double liquidSensorRadio = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorRadio").InnerText);
string liquidSensorDisIdText = methodNode.SelectSingleNode("liquidSensorDisId/text").InnerText;
string liquidSensorDisIdValue = methodNode.SelectSingleNode("liquidSensorDisId/value").InnerText;
bool enableLiquidFollow = methodNode.SelectSingleNode("enableLiquidFollow").InnerText.ToLower() == "true" ? true : false;
int liquidFollowType = Convert.ToInt32(methodNode.SelectSingleNode("liquidFollowType/value").InnerText);
string liquidFollowTypeName = methodNode.SelectSingleNode("liquidFollowType/text").InnerText;
double liquidFollowSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowSpeed").InnerText);
double liquidFollowDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowDistance").InnerText);
double liquidFollowArea = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowArea").InnerText);
bool enableMixFollow = methodNode.SelectSingleNode("enableMixFollow").InnerText.ToLower() == "true" ? true : false;
string channelNums = methodNode.SelectSingleNode("channels").InnerText;
int[] chs = new int[channelIds.Length];
for (int m = 0; m < channelIds.Length; m++)
{
chs[m] = channelIds[m];
}
float[] zAxisVals = new float[channelIds.Length];
float[] pVolmunVals = new float[channelIds.Length];
#endregion
// 液体参数
Liquid liquid = LiquidDB.GetALiquidFromdb(liquidpidValue);
DispenseMParamSH dispenseMParam = new DispenseMParamSH();
dispenseMParam.channelCount = channelIds.Length;
dispenseMParam.channelId = chs;
dispenseMParam.afterAirDelay = (int)liquid.after_dispense_delay;
dispenseMParam.armId = Convert.ToInt32(methodNode.SelectSingleNode("arm/value").InnerText);
dispenseMParam.dispenseAcceleration = (float)liquid.dispense_acceleration;
dispenseMParam.dispenseDeceleration = (float)liquid.dispense_deceleration;
dispenseMParam.dispenseDelay = (int)liquid.dispense_delay;
dispenseMParam.dispenseEnterSpeed = (float)liquid.dispense_enter_speed;
dispenseMParam.dispenseOutSpeed = (float)liquid.dispense_out_speed;
dispenseMParam.dispenseSpeed = (float)liquid.dispense_speed;
dispenseMParam.basezAxisVal = (float)Convert.ToDouble(ConfigurationManager.AppSettings["zAxisSafeVal"]);
dispenseMParam.beforeAirDelay = (int)liquid.before_dispense_delay;
#region 后吸空气
if ((float)liquid.after_dispense_volume == 0f)
{
dispenseMParam.isAfterAir = false;
}
else
{
dispenseMParam.isAfterAir = true;
dispenseMParam.afterAirpAxisVal = (float)liquid.after_dispense_volume;
}
#endregion
#region 前吸空气
if (liquid.before_dispense_volume == 0d)
{
dispenseMParam.isBeforeAir = false;
}
else
{
dispenseMParam.isBeforeAir = true;
dispenseMParam.beforeAirpAxisVal = (float)liquid.before_dispense_volume;
}
#endregion
dispenseMParam.liquidVolumeType = (int)Convert.ToInt32((liquid.liquid_volume_type != null ? "1" : liquid.liquid_volume_type));
dispenseMParam.wellzAxisVal = (float)liquid.well_top_length; // 孔位平面的z轴
#region 碰壁
dispenseMParam.isKnockWall = false;
#endregion
dispenseMParam.isSurvey = false;
dispenseMParam.isMix = false;
dispenseMParam.mixAspirateDistance = 0;
dispenseMParam.mixAspirateSpeed = 100;
dispenseMParam.mixDispenseDistance = 0;
dispenseMParam.mixDispenseSpeed = 100;
dispenseMParam.enableVolumeToNull = true;
dispenseMParam.zAxisVal = zAxisVals;
dispenseMParam.pAxisVal = pVolmunVals;
dispenseMParam.mixzAxisVal = 0f;
float pVolumnVas = 0f;
for (int k = 0; k < channelIds.Length; k++)
{
pVolumnVas = (float)targetVolume; // 体积
if (k == 0)
{
dispenseMParam.xAxisVal = (float)latticeTrash.lattice_X - 50f;//tipsTableRemoteArrayList[n][k].axis_b_X;
dispenseMParam.yAxisVal = (float)latticeTrash.lattice_Y + 10f;//tipsTableRemoteArrayList[n][k].axis_b_Y;
}
// 孔位平面的z轴
float zVal = (float)latticeTrash.lattice_Z - ControlCom.CurrentLengthOfTip - 50;//tipsTableRemoteArrayList[n][k].axis_b_Z + ControlCom.CurrentLengthOfTipOffSetVal;
dispenseMParam.wellzAxisVal = zVal;// - (float)labware.well_height;
#region 孔位的z轴
if (liquid.dispense_position_type == 0)
{
}
else if (liquid.dispense_position_type == 2)
{
zVal = zVal - (float)liquid.dispense_well_bottom_length;
}
else if (liquid.dispense_position_type == 1)
{
zVal = dispenseMParam.wellzAxisVal;// + (float)liquid.dispense_well_bottom_length;
}
zAxisVals[k] = zVal < 0 ? 0 : zVal;
#endregion
// 精度校准后的体积
//LiquidAccuracy liquidAccuracy = liquidAccuracyBll.GetLiquidAccuracyFromdb(Convert.ToInt32(liquidrangeidValue), Convert.ToInt32(dispenseMParam.armId), Convert.ToDouble(pVolumeArrayList[n][0]), liquididValue);
//double targetVolume = liquidAccuracyBll.CalculateAspirateParamVolume(Convert.ToDouble(pVolumnVas), liquidAccuracy);
pVolmunVals[k] = (float)targetVolume == 0f ? 20f : (float)targetVolume;
}
return dispenseMParam;
}
#endregion
//#region 放液到垃圾桶
//public DispenseMParamSH GenerateDispenseParamForTrashSH(XmlNode methodNode, MethodTransferFile methodCoatingFile,Lattice latticeTrash,
// List> tipsTableRemoteArrayList, List> pVolumeArrayList, int n)
//{
// #region 数据准备
// string liquididText = methodNode.SelectSingleNode("liquidid/text").InnerText;
// string liquididValue = methodNode.SelectSingleNode("liquidid/value").InnerText;
// string liquidrangeidText = methodNode.SelectSingleNode("liquidrangeid/text").InnerText;
// string liquidrangeidValue = methodNode.SelectSingleNode("liquidrangeid/value").InnerText;
// string liquidpidText = methodNode.SelectSingleNode("liquidpid/text").InnerText;
// string liquidpidValue = methodNode.SelectSingleNode("liquidpid/value").InnerText;
// bool enableLiquidSensor = methodNode.SelectSingleNode("enableLiquidSensor").InnerText.ToLower() == "true" ? true : false;
// int liquidSensorCount = Convert.ToInt32(methodNode.SelectSingleNode("liquidSensorCount").InnerText);
// double liquidSensorDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorDistance").InnerText);
// double liquidSensorEndDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorEndDistance").InnerText);
// double liquidSensorSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorSpeed").InnerText);
// double liquidSensorRadio = Convert.ToDouble(methodNode.SelectSingleNode("liquidSensorRadio").InnerText);
// string liquidSensorDisIdText = methodNode.SelectSingleNode("liquidSensorDisId/text").InnerText;
// string liquidSensorDisIdValue = methodNode.SelectSingleNode("liquidSensorDisId/value").InnerText;
// bool enableLiquidFollow = methodNode.SelectSingleNode("enableLiquidFollow").InnerText.ToLower() == "true" ? true : false;
// int liquidFollowType = Convert.ToInt32(methodNode.SelectSingleNode("liquidFollowType/value").InnerText);
// string liquidFollowTypeName = methodNode.SelectSingleNode("liquidFollowType/text").InnerText;
// double liquidFollowSpeed = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowSpeed").InnerText);
// double liquidFollowDistance = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowDistance").InnerText);
// double liquidFollowArea = Convert.ToDouble(methodNode.SelectSingleNode("liquidFollowArea").InnerText);
// bool enableMixFollow = methodNode.SelectSingleNode("enableMixFollow").InnerText.ToLower() == "true" ? true : false;
// string channelNums = methodNode.SelectSingleNode("channels").InnerText;
// int[] chs = new int[tipsTableRemoteArrayList[n].Count];
// for (int m = 0; m < tipsTableRemoteArrayList[n].Count; m++)
// {
// chs[m] = GetChannelNumByTipsTableRemote(tipsTableRemoteArrayList, n) + m + 1;
// }
// float[] zAxisVals = new float[tipsTableRemoteArrayList[n].Count];
// float[] pVolmunVals = new float[tipsTableRemoteArrayList[n].Count];
// #endregion
// // 液体参数
// Liquid liquid = LiquidDB.GetALiquidFromdb(liquidpidValue);
// DispenseMParamSH dispenseMParam = new DispenseMParamSH();
// dispenseMParam.channelCount = tipsTableRemoteArrayList[n].Count;
// dispenseMParam.channelId = chs;
// dispenseMParam.afterAirDelay = (int)liquid.after_dispense_delay;
// dispenseMParam.armId = Convert.ToInt32(methodCoatingFile.armValue);
// dispenseMParam.dispenseAcceleration = (float)liquid.dispense_acceleration;
// dispenseMParam.dispenseDeceleration = (float)liquid.dispense_deceleration;
// dispenseMParam.dispenseDelay = (int)liquid.dispense_delay;
// dispenseMParam.dispenseEnterSpeed = (float)liquid.dispense_enter_speed;
// dispenseMParam.dispenseOutSpeed = (float)liquid.dispense_out_speed;
// dispenseMParam.dispenseSpeed = (float)liquid.dispense_speed;
// dispenseMParam.basezAxisVal = (float)Convert.ToDouble(ConfigurationManager.AppSettings["zAxisSafeVal"]);
// dispenseMParam.beforeAirDelay = (int)liquid.before_dispense_delay;
// #region 后吸空气
// if ((float)liquid.after_dispense_volume == 0f)
// {
// dispenseMParam.isAfterAir = false;
// }
// else
// {
// dispenseMParam.isAfterAir = true;
// dispenseMParam.afterAirpAxisVal = (float)liquid.after_dispense_volume;
// }
// #endregion
// #region 前吸空气
// if (liquid.before_dispense_volume == 0d)
// {
// dispenseMParam.isBeforeAir = false;
// }
// else
// {
// dispenseMParam.isBeforeAir = true;
// dispenseMParam.beforeAirpAxisVal = (float)liquid.before_dispense_volume;
// }
// #endregion
// dispenseMParam.liquidVolumeType = (int)Convert.ToInt32((liquid.liquid_volume_type != null ? "1" : liquid.liquid_volume_type));
// dispenseMParam.wellzAxisVal = (float)liquid.well_top_length; // 孔位平面的z轴
// #region 碰壁
// dispenseMParam.isKnockWall = false;
// #endregion
// dispenseMParam.isSurvey = false;
// dispenseMParam.isMix = false;
// dispenseMParam.mixAspirateDistance = 0;
// dispenseMParam.mixAspirateSpeed = 100;
// dispenseMParam.mixDispenseDistance = 0;
// dispenseMParam.mixDispenseSpeed = 100;
// dispenseMParam.enableVolumeToNull = true;
// dispenseMParam.zAxisVal = zAxisVals;
// dispenseMParam.pAxisVal = pVolmunVals;
// dispenseMParam.mixzAxisVal = 0f;
// float pVolumnVas = 0f;
// for (int k = 0; k < tipsTableRemoteArrayList[n].Count; k++)
// {
// pVolumnVas = pVolumeArrayList[n][k]; // 体积
// if (k == 0)
// {
// dispenseMParam.xAxisVal = (float)latticeTrash.lattice_X + 50f;//tipsTableRemoteArrayList[n][k].axis_b_X;
// dispenseMParam.yAxisVal = (float)latticeTrash.lattice_Y + 10f;//tipsTableRemoteArrayList[n][k].axis_b_Y;
// }
// // 孔位平面的z轴
// float zVal = (float)latticeTrash.lattice_Z;//tipsTableRemoteArrayList[n][k].axis_b_Z + ControlCom.CurrentLengthOfTipOffSetVal;
// dispenseMParam.wellzAxisVal = zVal;// - (float)labware.well_height;
// #region 孔位的z轴
// if (liquid.dispense_position_type == 0)
// {
// }
// else if (liquid.dispense_position_type == 2)
// {
// zVal = zVal - (float)liquid.dispense_well_bottom_length;
// }
// else if (liquid.dispense_position_type == 1)
// {
// zVal = dispenseMParam.wellzAxisVal;// + (float)liquid.dispense_well_bottom_length;
// }
// zAxisVals[k] = zVal < 0 ? 0 : zVal;
// #endregion
// // 精度校准后的体积
// LiquidAccuracy liquidAccuracy = liquidAccuracyBll.GetLiquidAccuracyFromdb(Convert.ToInt32(liquidrangeidValue), Convert.ToInt32(dispenseMParam.armId), Convert.ToDouble(pVolumeArrayList[n][0]), liquididValue);
// double targetVolume = liquidAccuracyBll.CalculateAspirateParamVolume(Convert.ToDouble(pVolumnVas), liquidAccuracy);
// pVolmunVals[k] = (float)targetVolume == 0f ? 20f : (float)targetVolume;
// }
// return dispenseMParam;
//}
//#endregion
}
}