Explorar el Código

AGV更新

样式分支
taoye hace 2 años
padre
commit
acb2a2184d
Se han modificado 15 ficheros con 475 adiciones y 2 borrados
  1. +60
    -0
      BPASmartClient.AGV/AGVHelper.cs
  2. +19
    -0
      BPASmartClient.AGV/AGVLoadInteracteModel.cs
  3. +49
    -0
      BPASmartClient.AGV/AGVModel.cs
  4. +42
    -0
      BPASmartClient.AGV/AGVRequestUrl.cs
  5. +19
    -0
      BPASmartClient.AGV/AGVTaskCancelModel.cs
  6. +21
    -0
      BPASmartClient.AGV/AGVTaskCompleteNotifyModel.cs
  7. +27
    -0
      BPASmartClient.AGV/AGV_PointRollerJobData.cs
  8. +26
    -0
      BPASmartClient.AGV/AGV_SlotRollerJobData.cs
  9. +13
    -0
      BPASmartClient.AGV/BPASmartClient.AGV.csproj
  10. +17
    -0
      BPASmartClient.AGV/HttpRequestHeaderModel.cs
  11. +15
    -0
      BPASmartClient.AGV/HttpResponseData.cs
  12. +16
    -0
      BPASmartClient.AGV/HttpResponseModel.cs
  13. +13
    -0
      BPASmartClient.AGV/JobData.cs
  14. +114
    -1
      BPASmartClient.MorkF/Control_MorkF.cs
  15. +24
    -1
      SmartClient.sln

+ 60
- 0
BPASmartClient.AGV/AGVHelper.cs Ver fichero

@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Web;
using Newtonsoft.Json;
using System.Net.Http;


namespace BPASmartClient.AGV
{
public class AGVHelper
{
public static AGVHelper _Instance { get; set; }
public static AGVHelper GetInstance => _Instance ?? (_Instance = new AGVHelper());
public AGVHelper()
{
}

public string HttpRequest(string url, string head, string body)
{
return PostData(url, head, body);
}
public string PostData(string url, string head, string body)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.Headers["header"] = head;
//request.Proxy = new WebProxy("192.168.1.12",80);
byte[] bytes = Encoding.UTF8.GetBytes(body);
request.ContentType = "application/json; charset=UTF-8"; ;//窗体数据被编码为名称/值对形式
//request.ContentType = "application/json";
request.ContentLength = bytes.Length;
Stream myResponseStream = request.GetRequestStream();
myResponseStream.Write(bytes, 0, bytes.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader myStreamReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
string retString = myStreamReader.ReadToEnd();
myStreamReader.Close();
myResponseStream.Close();

if (response != null)
{
response.Close();
}
if (request != null)
{
request.Abort();
}
return retString;//返回响应报文


}
}
}

+ 19
- 0
BPASmartClient.AGV/AGVLoadInteracteModel.cs Ver fichero

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
/// <summary>
/// AGV上下料交互反馈接口(上游系统->快仓系统)
/// </summary>
internal class AGVLoadInteracteModel
{
public string agvCode { get; set;}
public string jobId { get; set; }
public string msgId { get; set; }
public bool? complete { get; set; }
}
}

+ 49
- 0
BPASmartClient.AGV/AGVModel.cs Ver fichero

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
/// <summary>
/// AGV任务下发
/// </summary>
internal class AGVModel
{
/// <summary>
/// 必填项
/// </summary>
public string robotJobId { get; set; }
/// <summary>
/// 必填项
/// </summary>
public long warehouseId { get; set; }
public string? robotJobGroupId { get; set; }
public int? sequence { get; set; }
/// <summary>
/// 必填项
/// </summary>
public int jobPriority { get; set; }
/// <summary>
/// 必填项
/// </summary>
public int jobPriorityType { get; set; }
public string? deadline { get; set; }
public string? agvType { get; set; }
public string? agvEndPoint { get; set; }
public bool? needOperation { get; set; }
public string? agvCode { get; set; }
public int? taskCountDown { get; set; }
public string? businessType { get; set; }
/// <summary>
/// 必填项
/// </summary>
public string jobType { get; set; }
/// <summary>
/// 必填项
/// </summary>
public IJobData jobData { get; set; }
}
}

+ 42
- 0
BPASmartClient.AGV/AGVRequestUrl.cs Ver fichero

@@ -0,0 +1,42 @@
namespace BPASmartClient.AGV
{
public class AGVRequestUrl
{
//public string HttpHeader { get; set; }
//public string TaskSendBody { get; set; }
public AGVRequestUrl(string IpAddress)
{
TaskSendUrl= $"http://{IpAddress}/api/quicktron/wcs/standardized.robot.job.submit";
TaskCancelUrl= $"http://{IpAddress}/api/quicktron/wcs/standardized.robot.job.cancel";
TaskCompleteUrl= $"http://{IpAddress}/api/quicktron/wcs/standardized.operation.notice";
AGVInteracteUrl= $"http://{IpAddress}/api/quicktron/wcs/standardized.roller.job.upstream.response";
}


#region Url汇总
//各种AGV的移动及搬运任务。
// 本接口请求参数包含公共字段及具体任务字段两部分组成。
//支持批量任务下发。
public string TaskSendUrl { get; set; }

//货架搬运任务指令下发后,允许上游系统调用该接口取消移位任务,支持取消策略。不同车型允许取消的任务节点不同,具体信息见API文档
public string TaskCancelUrl { get; set; }

//工作站任务实操完成后调用该接口。如果bucket有其他任务去执行其他任务。在线工作站货架直接回库,离线工作站分配AGV回库。
public string TaskCompleteUrl { get; set; }

//1.辊筒AGV在手动上下料时请求上游交互后,上游下发的反馈接口
//2.料箱AGV在任务下发需要和上游进行交互时调用此接口
//3.翻板车AGV在投递点前确认时上游反馈接口
public string AGVInteracteUrl { get; set; }
#endregion
}
}









+ 19
- 0
BPASmartClient.AGV/AGVTaskCancelModel.cs Ver fichero

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
/// <summary>
/// AGV任务取消
/// </summary>
internal class AGVTaskCancelModel
{
public string robotJobId { get; set; }
public long warehouseId { get; set; }
public string? executeMode { get; set; }
public string? reason { get; set; }
}
}

+ 21
- 0
BPASmartClient.AGV/AGVTaskCompleteNotifyModel.cs Ver fichero

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
/// <summary>
/// AGV任务完成通知
/// </summary>
internal class AGVTaskCompleteNotifyModel
{
public string? robotJobId { get; set; }
public string? bucketCode { get; set; }
public string? bucketslotCode { get; set; }
public long warehouseId { get; set; }
public bool? nullFlag { get; set; }
public string? jobId { get; set; }
}
}

+ 27
- 0
BPASmartClient.AGV/AGV_PointRollerJobData.cs Ver fichero

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
/// <summary>
/// 辊筒点到点搬运
/// </summary>
internal class AGV_PointRollerJobData:IJobData
{
public string? containerCode { get; set; }
public string startPoint { get; set; }
public string endPoint { get; set; }
public bool autoLoad { get; set; }
public bool enableIOLoad { get; set; }
public bool autoUnload { get; set; }
public bool enableIOUnload { get; set; }
public long? loadEquipmentId { get; set; } = null;
public long? unloadEquipmentId { get; set; } = null;
public bool? loadInteractive { get; set; }
public int? loadHeight { get; set; }
public int? unloadHeight { get; set; }
}
}

+ 26
- 0
BPASmartClient.AGV/AGV_SlotRollerJobData.cs Ver fichero

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
/// <summary>
/// 辊筒货位到货位搬运
/// </summary>
internal class AGV_SlotRollerJobData:IJobData
{
public string? containerCode { get; set; }
public string startIotCode { get; set; }
public string endSlotCode { get; set; }
public bool autoLoad { get; set; }
public bool enableIOLoad { get; set; }
public bool autoUnload { get; set; }
public bool enableIOUnload { get; set; }
public long? loadEquipmentId { get; set; } = null;
public long? unLoadEquipmentId { get; set; } = null;

public bool? loadInteractive { get; set; }
}
}

+ 13
- 0
BPASmartClient.AGV/BPASmartClient.AGV.csproj Ver fichero

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

</Project>

+ 17
- 0
BPASmartClient.AGV/HttpRequestHeaderModel.cs Ver fichero

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
internal class HttpRequestHeaderModel
{
public string appKey { get; set; }
public string appSecret { get; set; }
public string requestId { get; set; }
public string timestamp { get; set; }
public string version { get; set; }
}
}

+ 15
- 0
BPASmartClient.AGV/HttpResponseData.cs Ver fichero

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
internal class HttpResponseData
{
public string code { get; set; }
public bool message { get; set; }
public string robotJobId { get; set; }
}
}

+ 16
- 0
BPASmartClient.AGV/HttpResponseModel.cs Ver fichero

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
internal class HttpResponseModel
{
public string code { get; set; }
public string message { get; set; }
public bool success { get; set; }
public HttpResponseData data { get; set; }
}
}

+ 13
- 0
BPASmartClient.AGV/JobData.cs Ver fichero

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.AGV
{
public interface IJobData
{

}
}

+ 114
- 1
BPASmartClient.MorkF/Control_MorkF.cs Ver fichero

@@ -411,7 +411,120 @@ namespace BPASmartClient.MorkF
{
stirFryGoods = stirFry.stirFrymessage.stirFryGoods;
MessageLog.GetInstance.Show("接收到小炒流程信息");
}
//流程解析
foreach (var item in stirFryGoods)
{
MessageLog.GetInstance.ShowEx($"执行菜谱{item.GoodsKey}");
// morkF.listStirBom.Add(item.StirFryBomInfo);//添加订单制作流程
foreach (var items in item.StirFryBomInfo.StirFryActions)
{
MessageLog.GetInstance.Show($"执行流程{items.Time}");
foreach (var pro in items.RobotActions)
{
switch (pro)
{
case StirFryRobotAction.等待:
MessageLog.GetInstance.Show($"等待");
break;
case StirFryRobotAction.清洗槽取锅:
MessageLog.GetInstance.Show($"清洗槽取锅");
break;
case StirFryRobotAction.灶放锅:
MessageLog.GetInstance.Show($"灶放锅");
break;
case StirFryRobotAction.清洗槽放锅:
MessageLog.GetInstance.Show($"清洗槽放锅");
break;
case StirFryRobotAction.取A料:
MessageLog.GetInstance.Show($"取A料");
break;
case StirFryRobotAction.取B料:
MessageLog.GetInstance.Show($"取B料");
break;
case StirFryRobotAction.取C料:
MessageLog.GetInstance.Show($"取C料");
break;
case StirFryRobotAction.加入A料:
MessageLog.GetInstance.Show($"加入A料");
break;
case StirFryRobotAction.加入B料:
MessageLog.GetInstance.Show($"加入B料");
break;
case StirFryRobotAction.加入C料:
MessageLog.GetInstance.Show($"加入C料");
break;
case StirFryRobotAction.切换快速:
MessageLog.GetInstance.Show($"切换快速");
break;
case StirFryRobotAction.切换中速:
MessageLog.GetInstance.Show($"切换中速");
break;
case StirFryRobotAction.丢料盒:
MessageLog.GetInstance.Show($"丢料盒");
break;
case StirFryRobotAction.倒菜:
MessageLog.GetInstance.Show($"倒菜");
break;
case StirFryRobotAction.灶取锅:
MessageLog.GetInstance.Show($"灶取锅");
break;
}
}
foreach (var pro in items.PotActions)
{
switch (pro)
{
case StirFryPotAction.NONE:
break;
case StirFryPotAction.加热:
MessageLog.GetInstance.Show($"加热");
break;
case StirFryPotAction.大火t1s:
MessageLog.GetInstance.Show($"大火1s");
break;
case StirFryPotAction.加油:
MessageLog.GetInstance.Show($"加油");
break;
case StirFryPotAction.中火t2s:
MessageLog.GetInstance.Show($"中火2s");
break;
case StirFryPotAction.小火持续:
MessageLog.GetInstance.Show($"小火持续");
break;
case StirFryPotAction.中火持续:
MessageLog.GetInstance.Show($"中火持续");
break;
case StirFryPotAction.大火持续:
MessageLog.GetInstance.Show($"大火持续");
break;
case StirFryPotAction.停止火力:
MessageLog.GetInstance.Show($"停止火力");
break;
case StirFryPotAction.搅拌臂上位:
MessageLog.GetInstance.Show($"搅拌臂上位");
break;
case StirFryPotAction.搅拌臂中位:
MessageLog.GetInstance.Show($"搅拌臂中位");
break;
case StirFryPotAction.搅拌臂下位:
MessageLog.GetInstance.Show($"搅拌臂下位");
break;
case StirFryPotAction.低速旋转:
MessageLog.GetInstance.Show($"低速旋转");
break;
case StirFryPotAction.快速旋转:
MessageLog.GetInstance.Show($"快速旋转");
break;
case StirFryPotAction.停止旋转:
MessageLog.GetInstance.Show($"停止旋转");
break;
}
}
}
}
}
});

}


+ 24
- 1
SmartClient.sln Ver fichero

@@ -96,7 +96,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT_HQ", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DosingSystem", "DosingSystem\DosingSystem.csproj", "{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkTJuicer", "BPASmartClient.MorkTJuicer\BPASmartClient.MorkTJuicer.csproj", "{724087A3-E7E7-4494-B844-414FF5CD1D40}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTJuicer", "BPASmartClient.MorkTJuicer\BPASmartClient.MorkTJuicer.csproj", "{724087A3-E7E7-4494-B844-414FF5CD1D40}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.AGV", "BPASmartClient.AGV\BPASmartClient.AGV.csproj", "{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -892,6 +894,26 @@ Global
{724087A3-E7E7-4494-B844-414FF5CD1D40}.Release|x64.Build.0 = Release|Any CPU
{724087A3-E7E7-4494-B844-414FF5CD1D40}.Release|x86.ActiveCfg = Release|Any CPU
{724087A3-E7E7-4494-B844-414FF5CD1D40}.Release|x86.Build.0 = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|ARM.ActiveCfg = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|ARM.Build.0 = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|ARM64.Build.0 = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|x64.ActiveCfg = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|x64.Build.0 = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|x86.ActiveCfg = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Debug|x86.Build.0 = Debug|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|Any CPU.Build.0 = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|ARM.ActiveCfg = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|ARM.Build.0 = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|ARM64.ActiveCfg = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|ARM64.Build.0 = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|x64.ActiveCfg = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|x64.Build.0 = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|x86.ActiveCfg = Release|Any CPU
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -936,6 +958,7 @@ Global
{00C17D87-A323-4A97-BC21-7039E55614DE} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB} = {8712125E-14CD-4E1B-A1CE-4BDE03805942}
{724087A3-E7E7-4494-B844-414FF5CD1D40} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F}
{507A30E2-246E-4AC9-82F4-BE8FBBC1C5B8} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}


Cargando…
Cancelar
Guardar