|
@@ -1,27 +1,27 @@
|
|
-using EZSockets;
|
|
|
|
-using RequestServer.HttpServer;
|
|
|
|
-using ResponseServer.HttpServer;
|
|
|
|
-using System;
|
|
|
|
-using System.Collections.Generic;
|
|
|
|
-using System.Linq;
|
|
|
|
|
|
+using EZSockets;
|
|
|
|
+using RequestServer.HttpServer;
|
|
|
|
+using ResponseServer.HttpServer;
|
|
|
|
+using System;
|
|
|
|
+using System.Collections.Generic;
|
|
|
|
+using System.Linq;
|
|
using System.Net.NetworkInformation;
|
|
using System.Net.NetworkInformation;
|
|
-using System.Text;
|
|
|
|
-using System.Threading;
|
|
|
|
-using System.Threading.Tasks;
|
|
|
|
-
|
|
|
|
-namespace HttpServer.mitsubishi
|
|
|
|
-{
|
|
|
|
- class MitsubishiServer
|
|
|
|
- {
|
|
|
|
- private static string ON_LINE_STATE = "在线";
|
|
|
|
- public static Dictionary<string, MitCom> deviceList { get; set; } = new Dictionary<string, MitCom>();
|
|
|
|
- public static ResponseBody requestHttpServer(RequestBody requestBody)
|
|
|
|
- {
|
|
|
|
- string ip = requestBody.serverUrl;
|
|
|
|
- string port = requestBody.port;
|
|
|
|
- string fun = requestBody.type;
|
|
|
|
-
|
|
|
|
- ResponseBody responseBody = new ResponseBody();
|
|
|
|
|
|
+using System.Text;
|
|
|
|
+using System.Threading;
|
|
|
|
+using System.Threading.Tasks;
|
|
|
|
+
|
|
|
|
+namespace HttpServer.mitsubishi
|
|
|
|
+{
|
|
|
|
+ class MitsubishiServer
|
|
|
|
+ {
|
|
|
|
+ private static string ON_LINE_STATE = "在线";
|
|
|
|
+ public static Dictionary<string, MitCom> deviceList { get; set; } = new Dictionary<string, MitCom>();
|
|
|
|
+ public static ResponseBody requestHttpServer(RequestBody requestBody)
|
|
|
|
+ {
|
|
|
|
+ string ip = requestBody.serverUrl;
|
|
|
|
+ string port = requestBody.port;
|
|
|
|
+ string fun = requestBody.type;
|
|
|
|
+
|
|
|
|
+ ResponseBody responseBody = new ResponseBody();
|
|
MitCom mitCom = null;
|
|
MitCom mitCom = null;
|
|
//先ping
|
|
//先ping
|
|
Ping pingSender = new Ping();
|
|
Ping pingSender = new Ping();
|
|
@@ -83,7 +83,7 @@ namespace HttpServer.mitsubishi
|
|
//mitCom.GetParaValue(30, 8002, 1, 1, out pvValue);
|
|
//mitCom.GetParaValue(30, 8002, 1, 1, out pvValue);
|
|
int runTime;
|
|
int runTime;
|
|
mitCom.GetRunTime(out runTime);
|
|
mitCom.GetRunTime(out runTime);
|
|
- responseBody.powerOnTime = runTime.ToString();
|
|
|
|
|
|
+ responseBody.powerOnTime = (runTime/60).ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
@@ -93,9 +93,9 @@ namespace HttpServer.mitsubishi
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
-
|
|
|
|
- return responseBody;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return responseBody;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|