schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using XCommon;
using XCore;
using XImagingXhandler.XDAL;
using DataEntity;
using DriverLib.Engine;
 
namespace XCoreBLL
{
    public class SwitchLidBll
    {
        string strCurrentCulture = "";
        WellCalc wellCalc = new WellCalc();
        LatticeBll latticeBll = new LatticeBll();
 
        public SwitchLidBll()
        {
            strCurrentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
        }
 
        public MethodSwitchLid GenerateMethodSwitchLidDataByXmlNode(XmlNode xmlNode)
        {
            MethodSwitchLid methodSwitchLid = new MethodSwitchLid();
            methodSwitchLid.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
            methodSwitchLid.status = xmlNode.SelectSingleNode("status").InnerText;
            methodSwitchLid.name = xmlNode.SelectSingleNode("name").InnerText;
            methodSwitchLid.label = xmlNode.SelectSingleNode("label").InnerText;
            methodSwitchLid.strIndex = xmlNode.SelectSingleNode("strIndex").InnerText;
            methodSwitchLid.labwareText = xmlNode.SelectSingleNode("labware/text").InnerText;
            methodSwitchLid.labwareValue = xmlNode.SelectSingleNode("labware/value").InnerText;
            methodSwitchLid.positionText = xmlNode.SelectSingleNode("position/text").InnerText;
            methodSwitchLid.positionValue = xmlNode.SelectSingleNode("position/value").InnerText;
            methodSwitchLid.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
            methodSwitchLid.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
            methodSwitchLid.wellarray = xmlNode.SelectSingleNode("wellarray").InnerText;
            methodSwitchLid.switchState= Convert.ToInt32(xmlNode.SelectSingleNode("switchState").InnerText);
            methodSwitchLid.switchSpeed = Convert.ToDouble(xmlNode.SelectSingleNode("switchSpeed").InnerText);
            methodSwitchLid.numOfCircle = Convert.ToDouble(xmlNode.SelectSingleNode("numOfCircle").InnerText);
            return methodSwitchLid;
        }
 
        public HxResult ExecuteSwitchLid(ScrewTubeCapMParam screwTubeCapMParam,int modeVal, bool isSimulator = false)
        {
            HxResult ret = new HxResult();
            if (!isSimulator)
            {
                if (modeVal == 0)
                {
                    ret = MethodAction.Instance.OpenTubeCap(screwTubeCapMParam);//开盖
                }
                else
                {
                    ret = MethodAction.Instance.CloseTubeCap(screwTubeCapMParam);//关盖
                }
            }
            else
            {
                CommonBll.DoSimulateDelay();
                ret.Result = ResultType.Success;
            }
 
            return ret;
        }
    }
}