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
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace XImaging.Automation.Service.Message
{
    public class ReqMessage : BiosenDriverMessage
    {
        protected string m_strDescription;
 
        protected int m_iEstimateTime;
 
        protected int m_iTimeout;
 
        protected long m_lExpiredTime;
 
        public JObject OriginJSON
        {
            get
            {
                return this.m_jsonOriginMessage;
            }
        }
 
        public JObject Parameters
        {
            get
            {
                return this.m_jsonParameters;
            }
        }
 
        public int Troubleshoot
        {
            get
            {
                return this.m_iTroubleshoot;
            }
        }
 
        public string Description
        {
            get
            {
                return this.m_strDescription;
            }
        }
 
        public int EstimateTime
        {
            get
            {
                return this.m_iEstimateTime;
            }
        }
 
        public int Timeout
        {
            get
            {
                return this.m_iTimeout;
            }
        }
 
        public long ExpiredTime
        {
            get
            {
                return this.m_lExpiredTime;
            }
        }
 
        public ReqMessage(string message)
        {
            JObject jObject = (JObject)JsonConvert.DeserializeObject(message);
            this.m_jsonOriginMessage = jObject;
            this.m_strGUID = jObject["guid"].ToString();
            this.m_strEndpoint = jObject.Value<int>("endpoint");
            this.m_strMessageID = jObject["message_id"].ToString();
            this.m_iMessageType = jObject.Value<int>("message_type");
            this.m_strEquipmentID = jObject["equipment_id"].ToString();
            bool flag = base.MessageType != BiosenDriverMessage.MESSAGE_TYPE_HEARTBEAT;
            if (flag)
            {
                this.m_strWorkflowID = jObject["workflow_id"].ToString();
                this.m_strExperimentID = jObject["experiment_id"].ToString();
                this.m_strMethod = jObject["method"].ToString();
                this.m_strDescription = jObject["description"].ToString();
            }
            bool flag2 = base.MessageType == BiosenDriverMessage.MESSAGE_TYPE_TASK || base.MessageType == BiosenDriverMessage.MESSAGE_TYPE_QUERY;
            if (flag2)
            {
                this.m_jsonParameters = (JObject)jObject["parameters"];
                this.m_iEstimateTime = jObject.Value<int>("estimate_time");
                this.m_iTimeout = jObject.Value<int>("timeout");
            }
            else
            {
                this.m_jsonParameters = null;
                this.m_iEstimateTime = 0;
                this.m_iTimeout = 0;
            }
            bool flag3 = base.MessageType == BiosenDriverMessage.MESSAGE_TYPE_TROUBLESHOOT;
            if (flag3)
            {
                this.m_iTroubleshoot = jObject.Value<int>("troubleshoot");
            }
            else
            {
                this.m_iTroubleshoot = 0;
            }
            this.m_lExpiredTime = jObject.Value<long>("expired");
            this.m_strTimestamp = jObject["timestamp"].ToString();
        }
    }
}