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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
using DriverLib.Engine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XCoreBLL.Resource;
using XImagingXhandler.XDAL;
using DriverLib;
using System.Xml;
using XCommon;
 
namespace XCore
{
    public class UnloadTipsBll
    {
        string strCurrentCulture = "";
        public UnloadTipsBll()
        {
            strCurrentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
        }
 
        public MethodUnloadTips GenerateMethodUnloadTipsDataByXmlNode(XmlNode xmlNode)
        {
            MethodUnloadTips methodUnloadTips = new MethodUnloadTips();
 
            methodUnloadTips.isrun = xmlNode.SelectSingleNode("isrun").InnerText;
            methodUnloadTips.status = xmlNode.SelectSingleNode("status").InnerText;
            methodUnloadTips.name = xmlNode.SelectSingleNode("name").InnerText;
            methodUnloadTips.label = xmlNode.SelectSingleNode("label").InnerText;
            methodUnloadTips.strIndex = xmlNode.SelectSingleNode("strIndex").InnerText;
            methodUnloadTips.positionText = xmlNode.SelectSingleNode("position/text").InnerText;
            methodUnloadTips.positionValue = xmlNode.SelectSingleNode("position/value").InnerText;
            methodUnloadTips.armText = xmlNode.SelectSingleNode("arm/text").InnerText;
            methodUnloadTips.armValue = xmlNode.SelectSingleNode("arm/value").InnerText;
            string strchs = xmlNode.SelectSingleNode("channels").InnerText;
            methodUnloadTips.channels = ComUtility.GetChannelsFromXml(strchs);
            methodUnloadTips.isputToSource= xmlNode.SelectSingleNode("isputToSource").InnerText.ToLower()=="true"?true:false;
 
            return methodUnloadTips;
        }
 
        #region 检查所有属性设置是否满足要求
        /// <summary>
        /// 检查所有属性设置是否满足要求
        /// </summary>
        /// <param name="methodAspirate">吸液属性对象</param>
        /// <returns>检查所有属性设置是否满足要求</returns>
        public MethodPropertyInfo CheckProperty(MethodUnloadTips methodUnloadTips)
        {
            MethodPropertyInfo methodPropertyInfo = new MethodPropertyInfo();
 
            if (strCurrentCulture == "zh-CN")
            {
                methodPropertyInfo.property_tips_info = AspirateResourceCHS.tipsInfo.ToString();
 
                //if (methodUnloadTips.labwareValue == null || methodUnloadTips.labwaretipValue == "")
                //{
                //    methodPropertyInfo.property_name_info = AspirateResourceCHS.labwareText.ToString();
                //}
                if (methodUnloadTips.positionValue == null || methodUnloadTips.positionValue == "" || methodUnloadTips.positionValue == "0")
                {
                    methodPropertyInfo.property_name_info = AspirateResourceCHS.positionText.ToString();
                }
                if (methodUnloadTips.armValue == null || methodUnloadTips.armValue == "" || methodUnloadTips.armValue == "0")
                {
                    methodPropertyInfo.property_name_info = AspirateResourceCHS.armText.ToString();
                }
                //if (methodUnloadTips.wellarray == null || methodUnloadTips.wellarray == "")
                //{
                //    methodPropertyInfo.property_name_info = AspirateResourceCHS.labwareText.ToString();
                //}
            }
            else if (strCurrentCulture == "en-US")
            {
                methodPropertyInfo.property_tips_info = AspirateResourceENU.tipsInfo.ToString();
 
                //if (methodUnloadTips.labwareValue == null || methodUnloadTips.labwaretipValue == "")
                //{
                //    methodPropertyInfo.property_name_info = AspirateResourceENU.labwareText.ToString();
                //}
                if (methodUnloadTips.positionValue == null || methodUnloadTips.positionValue == "" || methodUnloadTips.positionValue == "0")
                {
                    methodPropertyInfo.property_name_info = AspirateResourceENU.positionText.ToString();
                }
                if (methodUnloadTips.armValue == null || methodUnloadTips.armValue == "" || methodUnloadTips.armValue == "0")
                {
                    methodPropertyInfo.property_name_info = AspirateResourceENU.armText.ToString();
                }
                //if (methodUnloadTips.wellarray == null || methodUnloadTips.wellarray == "")
                //{
                //    methodPropertyInfo.property_name_info = AspirateResourceENU.labwareText.ToString();
                //}
            }
            return methodPropertyInfo;
        }
        #endregion
 
        #region 执行卸载吸头,返回结果字符串
        /// <summary>
        /// 执行卸载吸头,返回结果字符串
        /// </summary>
        /// <param name="labwareNode">卸载吸头的板位节点对象</param>
        /// <param name="isSimulator">true:仿真;false:实际运行</param>
        /// <returns>结果实体对象</returns>
        public HxResult ExecuteUnLoadTips(UnloadTipsMParam unloadTipsMParam, bool isSimulator = false)
        {
            HxResult ret = new HxResult();
            if (!isSimulator)
            {
                ret = MethodAction.Instance.UnloadTip(unloadTipsMParam);
            }
            else
            {
                ret.Result = ResultType.Success;
            }
 
            return ret;
        }
 
        public HxResult ExecuteUnLoadTips(UnloadTipsMParamSH unloadTipsMParam, bool isSimulator = false)
        {
            HxResult ret = new HxResult();
            if (!isSimulator)
            {
                ret = MethodAction.Instance.UnloadTip(unloadTipsMParam);
            }
            else
            {
                ret.Result = ResultType.Success;
            }
 
            return ret;
        }
        #endregion
    }
}