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 { /// /// 运行时消息处理 /// 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; } } }