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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Sodao.FastSocket.Server.Messaging;
 
namespace XHandler.Runtime
{
    /// <summary>
    /// 运行时消息处理
    /// </summary>
    public class RuntimeMsgBLL
    {
        public JObject GenerateReturnMsg(HxMessage hxMessage)
        {
            JObject result = new JObject();
            var dataJson=JObject.Parse(@"{""message_id"":"""+hxMessage.MessageID+@"""}");
            dataJson["message_type"] = hxMessage.MessageType;
            dataJson["method"] = hxMessage.Method;
            dataJson["equipment_id"] = hxMessage.EquipmentID;
            dataJson["workflow_id"] = hxMessage.WorkflowID;
            dataJson["experiment_id"] = hxMessage.ExperimentID;
            dataJson["data"] = null;
            dataJson["method_status"] = hxMessage.EquipmentStatus;
            dataJson["process_info"] = null;
            dataJson["error"]= JObject.FromObject(new { error_code = "", error_text = "test", troubleshoot=0 });
            dataJson["timestamp"] = DateTime.Now.ToString("G");
            result = dataJson;
            return result;
        }
    }
}