using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using XImaging.Automation.Service.Instruction; namespace BiosenSocketService.Instruction { public enum eMovement { NoMovement, InOnly, OutOnly, InAndOut }; #region 此处对应InsProtocol的每个方法为指令参数解析类的定义 public class StartExperimentInsArgs : HxInsParser, IProtocolArgs { private string m_strBatchID; private string m_strBarCode; private string m_strMode; // public Dictionary m_Data = new Dictionary(); public string BatchID { get { return m_strBatchID; } } public string BarCode { get { return m_strBarCode; } } public string Mode { get { return m_strMode; } } public StartExperimentInsArgs(JObject parameters) { m_strBatchID = parameters.GetValue("BatchID").ToString(); m_strBarCode = parameters.GetValue("BarCode").ToString(); m_strMode = parameters.GetValue("Mode").ToString(); /*JToken jt = parameters.GetValue("Data"); foreach (JProperty item in jt) { m_Data.Add(item.Name, item.Value); }*/ } //public Dictionary Args = new Dictionary(); //public string MethodName //{ // get { return m_strMethodName; } //} //public string ProjectID //{ // get { return m_strProjectID; } //} //public RunMethodArgs(JObject parameters) //{ // m_strMethodName = parameters.GetValue("method").ToString(); // m_strArguments = parameters.GetValue("args").ToString(); // m_strProjectID = parameters.GetValue("projectID").ToString(); // if (string.IsNullOrEmpty(m_strArguments)) // { // return; // } // string[] NameNValue = m_strArguments.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries); // foreach (string nameNvalue in NameNValue) // { // string[] temp = nameNvalue.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); // Args.Add(temp[0], int.Parse(temp[1])); // } //} } public class CloseDeviceInsArgs : HxInsParser, IProtocolArgs { private int m_nHasPCR; public int hasPCR { get { return m_nHasPCR; } } public CloseDeviceInsArgs(JObject parameters) { m_nHasPCR = int.Parse(parameters.GetValue("hasPCR").ToString()); } } public class GetDeviceStatusInsArgs : HxInsParser, IProtocolArgs { public GetDeviceStatusInsArgs(JObject parameters) { } } #endregion }