Exemple #1
0
 public void UpLoadMachineErrState(string message, string code, string severity, string occurrence_time, string resolved_time, string key)
 {
     if (CAMiClsVariable.isHIVEOpen)
     {
         //rb1.occurrence_time = System.DateTime.Now.ToString("yyyy/MM/ddTHH:mm:ss.ff+0800");
         //rb1.message = "Emergency stop button";
         //rb1.code = "F02ESSP-01-01";
         //rb1.severity = "critical";
         //rb1.resolved_time = System.DateTime.Now.ToString("yyyy/MM/ddTHH:mm:ss.ff+0800");
         //dt1.key = "example";
         //rb1.data = dt1;
         hMes.occurrence_time = occurrence_time;
         hMes.resolved_time   = resolved_time;
         hMes.message         = message;
         hMes.code            = code;
         hMed.key             = key;
         hMes.data            = hMed;
         //var objects1 = new { key = keytext };
         //string datatransfer = JsonConvert.SerializeObject(objects1); //将一个json对象转为json字符串
         ////string datatransfer = Convert.ToString(objects1);
         //var objects = new { message = messagetext, code = codetext, severity = severitytext, occurrence_time = occurrence_timetext, resolved_time = resolved_timetext, data = objects1 };
         //string postcontent = Convert.ToString(objects);
         //string posturl = "http://10.72.184.161:5000/hello";
         string postcontent = JsonConvert.SerializeObject(hMes);  //将一个json对象转为json字符串
         JstWebServiceAgent.Post(CAMiClsVariable.webServiceEmgPath, postcontent);
     }
 }
Exemple #2
0
 public void UpLoadMachineState(int machineState, string stateChangeTime, string message, string code, int errCode)
 {
     if (CAMiClsVariable.isHIVEOpen)
     {
         if (errCode != errorCode)
         {
             hMs.state_change_time = stateChangeTime;
             hMs.machine_state     = machineState;
             hMd.message           = message;
             hMd.code  = code;
             hMs.data  = hMd;
             errorCode = errCode;
             //string datatransfer = Convert.ToString(objects1);
             // var objects = new { message = messagetext, code = codetext, severity = severitytext, occurrence_time = occurrence_timetext, resolved_time = resolved_timetext, data = objects1 };
             //string posturl = "http://10.72.184.161:5000/hello";
             string postcontent = JsonConvert.SerializeObject(hMs);  //将一个json对象转为json字符串
             JstWebServiceAgent.Post(CAMiClsVariable.webServiceStatePath, postcontent);
         }
     }
 }