|
|
|
@ -31,7 +31,6 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static WebApiClient AirportAGVClient;
|
|
|
|
|
public static WebApiClient AirportManipulatorClient;
|
|
|
|
|
|
|
|
|
|
private WebApiClient CreateWebApiClient(string IpHost)
|
|
|
|
|
{
|
|
|
|
@ -63,25 +62,14 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static string AGVCallRequest()
|
|
|
|
|
{
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("POST:", null, new AGVSingalEntity());
|
|
|
|
|
|
|
|
|
|
return responseValue.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// AGV下发任务请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="aGVStateRequest"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static AGVResponseEntity<ResponseAddTaskDataEntity> AGVAddTaskRequest(AGVRequestAddTaskEntity addTaskEntity)
|
|
|
|
|
public static AGVResponseEntity<ResponseAddTaskDataEntity> AGVAddTaskRequest(AGVRequestAddTaskEntity requestValue)
|
|
|
|
|
{
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("POST:/api/task/addTask", null, addTaskEntity);
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("POST:/api/task/addTask", null, requestValue);
|
|
|
|
|
if (responseValue == null)
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<ResponseAddTaskDataEntity>();
|
|
|
|
@ -96,15 +84,57 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
return responseEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 取消/终止任务请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static AGVResponseEntity<object> AGVOperationalTaskRequest(AGVRequestOperationalTaskEntity requestValue)
|
|
|
|
|
{
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("POST:/api/task/operationalTask", null, requestValue);
|
|
|
|
|
if (responseValue == null)
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<object>();
|
|
|
|
|
}
|
|
|
|
|
string json = responseValue.ToString();
|
|
|
|
|
if (string.IsNullOrEmpty(json))
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<object>();
|
|
|
|
|
}
|
|
|
|
|
AGVResponseEntity<object> responseEntity;
|
|
|
|
|
responseEntity = JsonSerializer.Deserialize<AGVResponseEntity<object>>(json);
|
|
|
|
|
return responseEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取AGV所有信息
|
|
|
|
|
/// 查询任务状态请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="aGVStateRequest"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static AGVResponseEntity<List<ResponseRobotAtrributeDataEntity>> AGVStateRequest()
|
|
|
|
|
public static AGVResponseEntity<ResponseTaskStateDetailDataEntity> AGVGetTaskStateDetailRequest(AGVRequestTaskStateDetailEntity requestValue)
|
|
|
|
|
{
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("GET:http://192.168.40.81:5102/api/task/robot/getRobot", null);
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("PUT:/api/task/getTaskStateDetail", null, requestValue);
|
|
|
|
|
if (responseValue == null)
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<ResponseTaskStateDetailDataEntity>();
|
|
|
|
|
}
|
|
|
|
|
string json = responseValue.ToString();
|
|
|
|
|
if (string.IsNullOrEmpty(json))
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<ResponseTaskStateDetailDataEntity>();
|
|
|
|
|
}
|
|
|
|
|
AGVResponseEntity<ResponseTaskStateDetailDataEntity> ResponseEntity;
|
|
|
|
|
ResponseEntity = JsonSerializer.Deserialize<AGVResponseEntity<ResponseTaskStateDetailDataEntity>>(json);
|
|
|
|
|
return ResponseEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取所有AGV信息请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="aGVStateRequest"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static AGVResponseEntity<List<ResponseRobotAtrributeDataEntity>> AGVAllStateRequest()
|
|
|
|
|
{
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("GET:/api/task/robot/getRobot", null);
|
|
|
|
|
if (responseValue == null)
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<List<ResponseRobotAtrributeDataEntity>>();
|
|
|
|
@ -118,6 +148,52 @@ namespace SlnMesnac.TouchSocket
|
|
|
|
|
ResponseEntity = JsonSerializer.Deserialize<AGVResponseEntity<List<ResponseRobotAtrributeDataEntity>>>(json);
|
|
|
|
|
return ResponseEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取当前激活地图信息请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="aGVStateRequest"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static AGVResponseEntity<ResponseActiveMapDataEntity> AGVMapActiveRequest()
|
|
|
|
|
{
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("GET:/api/v1.0.0/Maps/mapActive", null);
|
|
|
|
|
if (responseValue == null)
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<ResponseActiveMapDataEntity>();
|
|
|
|
|
}
|
|
|
|
|
string json = responseValue.ToString();
|
|
|
|
|
if (string.IsNullOrEmpty(json))
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<ResponseActiveMapDataEntity>();
|
|
|
|
|
}
|
|
|
|
|
AGVResponseEntity<ResponseActiveMapDataEntity> ResponseEntity;
|
|
|
|
|
ResponseEntity = JsonSerializer.Deserialize<AGVResponseEntity<ResponseActiveMapDataEntity>>(json);
|
|
|
|
|
return ResponseEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取当前地图所有位置点请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="aGVStateRequest"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static AGVResponseEntity<List<ResponseMapPositionDataEntity>> AGVMapPositionRequest(string requestValue)
|
|
|
|
|
{
|
|
|
|
|
JToken responseValue = AirportAGVClient.InvokeT<JToken>("GET:/api/v1.0.0/Positions?mapId={0}", null, requestValue);
|
|
|
|
|
if (responseValue == null)
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<List<ResponseMapPositionDataEntity>>();
|
|
|
|
|
}
|
|
|
|
|
string json = responseValue.ToString();
|
|
|
|
|
if (string.IsNullOrEmpty(json))
|
|
|
|
|
{
|
|
|
|
|
return new AGVResponseEntity<List<ResponseMapPositionDataEntity>>();
|
|
|
|
|
}
|
|
|
|
|
AGVResponseEntity<List<ResponseMapPositionDataEntity>> ResponseEntity;
|
|
|
|
|
ResponseEntity = JsonSerializer.Deserialize<AGVResponseEntity<List<ResponseMapPositionDataEntity>>>(json);
|
|
|
|
|
return ResponseEntity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|