Commit a44da5a2 张东亮

0420

1 个父辈 8c2b595c
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>AGV_UI</RootNamespace> <RootNamespace>AGV_UI</RootNamespace>
<AssemblyName>AGV_UI</AssemblyName> <AssemblyName>AGV_UI</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
......
...@@ -24,7 +24,7 @@ namespace AGV_UI ...@@ -24,7 +24,7 @@ namespace AGV_UI
missionShow.Add(item, new Label() { Name = item, missionShow.Add(item, new Label() { Name = item,
Font = new Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), Font = new Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))),
AutoSize = true, AutoSize = true,
BorderStyle = BorderStyle.Fixed3D //BorderStyle = BorderStyle.Fixed3D
}); });
} }
flowPanelMissionState.Controls.AddRange(missionShow.Values.ToArray()); flowPanelMissionState.Controls.AddRange(missionShow.Values.ToArray());
......
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common</RootNamespace> <RootNamespace>Common</RootNamespace>
<AssemblyName>Common</AssemblyName> <AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
......
...@@ -34,7 +34,7 @@ namespace Common ...@@ -34,7 +34,7 @@ namespace Common
public const string FileName_tempData = "tempData.ini"; public const string FileName_tempData = "tempData.ini";
public const string IsUse = "IsUse"; public const string IsUse = "IsUse";
public const string RFID = "RFID"; public const string RFID = "RFID";
public const string ReelString_RFID_Prefix = "F";
//云仓出料口 //云仓出料口
public const string D1 = "D1"; public const string D1 = "D1";
public const string D2 = "D2"; public const string D2 = "D2";
......
任务名称,任务别名,任务GUID 任务名称,任务别名,任务GUID
Init,初始化,219cd91a-61da-11eb-96a9-0001297a1dca
Standby,待机位,615cef05-61f4-11eb-96a9-0001297a1dca
AutoCharge1,充电桩4,b4a9e87a-7768-11eb-8758-54b2038d1924
AutoCharge2,充电桩5,c4326dfb-7768-11eb-8758-54b2038d1924
CheckShelf,检查负载,cc5f1d78-75a2-11eb-8565-0001297a1dca
Leave,出料,28a2ab7b-75ac-11eb-8565-0001297a1dca
Enter,进料,4bf5d4c5-75a4-11eb-8565-0001297a1dca
D1,云仓出料口1,4c533e85-75c6-11eb-a7fe-0001297a1dca
D2,云仓出料口2,3a0d8f1b-75c8-11eb-a7fe-0001297a1dca
D3,云仓出料口3,d2ee5b8e-75c5-11eb-a7fe-0001297a1dca
S1,SMT1线,968abc82-75c5-11eb-a7fe-0001297a1dca
S2,SMT2线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S3,SMT3线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S4,SMT4线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S5,SMT5线,968abc82-75c5-11eb-a7fe-0001297a1dca
S6,SMT6线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S7,SMT7线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S8,SMT8线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S9,SMT9线,968abc82-75c5-11eb-a7fe-0001297a1dca
S10,SMT10线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S11,SMT11线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S12,SMT12线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S13,SMT13线,968abc82-75c5-11eb-a7fe-0001297a1dca
S14,SMT14线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S15,SMT15线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S16,SMT16线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S17,SMT17线,968abc82-75c5-11eb-a7fe-0001297a1dca
S18,SMT18线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S19,SMT19线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
S20,SMT20线,1d40c7c7-75c5-11eb-a7fe-0001297a1dca
\ No newline at end of file \ No newline at end of file
Init,初始化,079fdb1f-8df0-11eb-8766-0001297a205c
Standby,待机位,1f51c9d1-8df4-11eb-8766-0001297a205c
AutoCharge1,充电桩1,8b7aa527-8dee-11eb-8766-0001297a205c
AutoCharge2,充电桩2,d340077e-8dee-11eb-8766-0001297a205c
Leave,出料,47619ae8-8eca-11eb-b3c1-0001297a205c
Enter,进料,da717775-8eaa-11eb-b3c1-0001297a205c
A1,缓存线出口,22236ced-985c-11eb-bc75-54b2038d1fb1
A2,缓存线入口,4be3a323-985c-11eb-bc75-54b2038d1fb1
D1,云仓出料口1,eb59ef9f-8f8b-11eb-8ff4-0001297a205c
D2,云仓出料口2,11d68633-8e20-11eb-8766-0001297a205c
D3,云仓出料口3,d1d041c7-8e0c-11eb-8766-0001297a205c
S1,SMT1线,743b96e3-8d45-11eb-8674-0001297a205c
S2,SMT2线,b684ade5-8ebd-11eb-b3c1-0001297a205c
S3,SMT3线,1f1c3591-8ebe-11eb-b3c1-0001297a205c
S4,SMT4线,605cabc1-8ebe-11eb-b3c1-0001297a205c
S5,SMT5线,405e1c4a-8ebf-11eb-b3c1-0001297a205c
S6,SMT6线,af7657bc-8ebe-11eb-b3c1-0001297a205c
S7,SMT7线,772bae5c-8ebf-11eb-b3c1-0001297a205c
S8,SMT8线,15ccd887-8ec0-11eb-b3c1-0001297a205c
S9,SMT9线,5cb5a0f4-8ec0-11eb-b3c1-0001297a205c
S10,SMT10线,8d6abfed-8ec0-11eb-b3c1-0001297a205c
S11,SMT11线,c2dbf9d2-8ec0-11eb-b3c1-0001297a205c
S12,SMT12线,1756a49d-8ec1-11eb-b3c1-0001297a205c
S13,SMT13线,5dcf1db7-8ec1-11eb-b3c1-0001297a205c
S14,SMT14线,5fafb312-97b1-11eb-bc75-54b2038d1fb1
S15,SMT15线,b68828ae-8ec1-11eb-b3c1-0001297a205c
S16,SMT16线,f2fa0b98-8ec1-11eb-b3c1-0001297a205c
S17,SMT17线,2a5916d6-8ec2-11eb-b3c1-0001297a205c
S18,SMT18线,5a3bf7eb-8ec2-11eb-b3c1-0001297a205c
S19,SMT19线,97914d5f-8ec2-11eb-b3c1-0001297a205c
S20,SMT20线,c755faf6-8ec2-11eb-b3c1-0001297a205c
\ No newline at end of file \ No newline at end of file
Fleet ID,agv名称,IP,授权码,IOID Fleet ID,agv名称,IP,授权码,IOID
1,1号车,10.85.199.123,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,5d084001-6155-11eb-bee4-0001297a2016 2,1号车,172.74.52.117,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,241538ac-8dd1-11eb-8766-0001297a205c
3,2号车,172.74.52.188,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,241538ac-8dd1-11eb-8766-0001297a205c
4,3号车,172.74.52.242,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,241538ac-8dd1-11eb-8766-0001297a205c
5,4号车,172.74.54.254,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,241538ac-8dd1-11eb-8766-0001297a205c
产线名,节点名,IP,产线别名 产线名,节点名,IP,产线别名
A2,A2,127.0.0.1,料架存放线入口 A2,A2,172.74.200.80,料架存放线入口
A1,A1,127.0.0.1,料架存放线出口 A1,A1,172.74.200.80,料架存放线出口
D1,D1,127.0.0.1,云仓出料口1 D1,D1,172.74.200.80,云仓出料口1
D2,D2,127.0.0.1,云仓出料口2 D2,D2,172.74.200.80,云仓出料口2
D3,D3,127.0.0.1,云仓出料口3 D3,D3,172.74.200.80,云仓出料口3
SMT1,S1,,SMT1线 SMT1,S1,,SMT1线
SMT2,S2,,SMT2线 SMT2,S2,,SMT2线
SMT3,S3,,SMT3线 SMT3,S3,,SMT3线
......
...@@ -149,7 +149,7 @@ namespace DeviceLibrary ...@@ -149,7 +149,7 @@ namespace DeviceLibrary
//获取AGV状态 //获取AGV状态
rtn = MiR_API.Get_State(AGVManager.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.MirPosition position); rtn = MiR_API.Get_State(AGVManager.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.MirPosition position);
Thread.Sleep(50); Thread.Sleep(50);
if (rtn) change = AGVManager.agvInfo[i].SetState(stateID, taskStateStr, battery, mission_text, position); change = AGVManager.agvInfo[i].SetState(stateID, taskStateStr, battery, mission_text, position);
// if (change) // if (change)
{ {
...@@ -215,7 +215,6 @@ namespace DeviceLibrary ...@@ -215,7 +215,6 @@ namespace DeviceLibrary
return null; return null;
if (job != null) if (job != null)
{ {
log.Debug(agv_Info.Name + " GetJob OK " + job.ToString());
return job; return job;
} }
} }
...@@ -250,12 +249,6 @@ namespace DeviceLibrary ...@@ -250,12 +249,6 @@ namespace DeviceLibrary
{ {
agv.CurJob = job; agv.CurJob = job;
} }
//else
//{
// //if (agv.Battery < Common.chargeStatus.chargeMax)
// agv.CurJob = new ChargeJob(agv.Place);
//}
} }
if (agv.CurJob != null) if (agv.CurJob != null)
...@@ -280,11 +273,7 @@ namespace DeviceLibrary ...@@ -280,11 +273,7 @@ namespace DeviceLibrary
bool rtn = MiR_API.CheckIP(AGVManager.agvInfo[idx].IP); bool rtn = MiR_API.CheckIP(AGVManager.agvInfo[idx].IP);
if (rtn) if (rtn)
{ {
if (AGVManager.agvInfo[idx].IsCon) if (!AGVManager.agvInfo[idx].IsCon)
{
log.Debug(AGVManager.agvInfo[idx].Name + " Online");
}
else
{ {
AGVManager.agvInfo[idx].IsCon = true; AGVManager.agvInfo[idx].IsCon = true;
log.Info(AGVManager.agvInfo[idx].Name + " Online"); log.Info(AGVManager.agvInfo[idx].Name + " Online");
...@@ -299,10 +288,6 @@ namespace DeviceLibrary ...@@ -299,10 +288,6 @@ namespace DeviceLibrary
log.Info(AGVManager.agvInfo[idx].Name + " Offline"); log.Info(AGVManager.agvInfo[idx].Name + " Offline");
AgvOnline?.Invoke(idx); AgvOnline?.Invoke(idx);
} }
else
{
log.Debug(AGVManager.agvInfo[idx].Name + " Offline");
}
} }
return rtn; return rtn;
} }
......
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceLibrary</RootNamespace> <RootNamespace>DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName> <AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
......
...@@ -157,7 +157,7 @@ namespace DeviceLibrary ...@@ -157,7 +157,7 @@ namespace DeviceLibrary
/// <returns></returns> /// <returns></returns>
public static bool CheckTaskFinished(Agv_Info agv, string taskName, string curTaskState) public static bool CheckTaskFinished(Agv_Info agv, string taskName, string curTaskState)
{ {
LogUtil.debug(agv.Name + " 检查当前任务是否结束: " + taskName + " " + curTaskState); LogUtil.debug(agv.Name + " 检查当前任务是否结束: " + taskName + " " + curTaskState + " "+agv.CurTaskID);
return GetMissionGuidByTaskName(taskName).Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done); return GetMissionGuidByTaskName(taskName).Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done);
} }
/// <summary> /// <summary>
......
...@@ -144,7 +144,8 @@ namespace DeviceLibrary ...@@ -144,7 +144,8 @@ namespace DeviceLibrary
/// 当前料架的工单信息 /// 当前料架的工单信息
/// </summary> /// </summary>
public string BoxDestInfo { get; set; } = ""; public string BoxDestInfo { get; set; } = "";
public string IOInState { get; set; } = "";
public string IOOutState { get; set; } = "";
/// <summary> /// <summary>
/// 任务重发 /// 任务重发
/// </summary> /// </summary>
...@@ -190,6 +191,12 @@ namespace DeviceLibrary ...@@ -190,6 +191,12 @@ namespace DeviceLibrary
MiR_API.Get_IO_Status(this, out bool[] input, out bool[] output); MiR_API.Get_IO_Status(this, out bool[] input, out bool[] output);
if (input != null && input.Length == 4) if (input != null && input.Length == 4)
{ {
try
{
IOInState = string.Join(",", input.ToArray());
IOOutState = string.Join(",", output.ToArray());
}
catch { }
bool reachIoValue = input[3].Equals(true); bool reachIoValue = input[3].Equals(true);
if (reachIoValue) if (reachIoValue)
{ {
......
...@@ -74,6 +74,7 @@ namespace DeviceLibrary ...@@ -74,6 +74,7 @@ namespace DeviceLibrary
JavaScriptSerializer serializer = new JavaScriptSerializer(); JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json); Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
if (dic == null) if (dic == null)
{ {
log.Error("URL: " + url + "\n" + "Return: " + json); log.Error("URL: " + url + "\n" + "Return: " + json);
...@@ -95,7 +96,7 @@ namespace DeviceLibrary ...@@ -95,7 +96,7 @@ namespace DeviceLibrary
{ {
input = null; input = null;
output = null; output = null;
//log.Error("Get_IO_Status", ex); log.Error("Get_IO_Status", ex);
return false; return false;
} }
} }
......
...@@ -19,10 +19,11 @@ namespace DeviceLibrary ...@@ -19,10 +19,11 @@ namespace DeviceLibrary
/// 载空料架返回任务 /// 载空料架返回任务
/// </summary> /// </summary>
/// <param name="lineName">产线的节点名称</param> /// <param name="lineName">产线的节点名称</param>
public EmptyShelfBackJob(string lineName, eShelfType shelfType) public EmptyShelfBackJob(string emptyShelfPlace, eShelfType shelfType,string emptyShelfTargetPlace)
{ {
EmptyShelfPlace = lineName; EmptyShelfPlace = emptyShelfPlace;
this.shelfType = shelfType; this.shelfType = shelfType;
EmptyShelfTargetPlace = emptyShelfTargetPlace;
} }
/// <summary> /// <summary>
...@@ -156,7 +157,6 @@ namespace DeviceLibrary ...@@ -156,7 +157,6 @@ namespace DeviceLibrary
CurTaskState = MissionSys.GetTakJobState(agv); CurTaskState = MissionSys.GetTakJobState(agv);
if (MissionSys.CheckTaskFinished(agv, SettingString.Leave, CurTaskState)) if (MissionSys.CheckTaskFinished(agv, SettingString.Leave, CurTaskState))
{ {
AGVManager.SetNodeOccupy(EmptyShelfTargetPlace,LineState.None);
agv.RFID = ""; agv.RFID = "";
Job job = AGVManager.control.GetJob(agv); Job job = AGVManager.control.GetJob(agv);
if (job != null) if (job != null)
......
...@@ -153,8 +153,8 @@ namespace DeviceLibrary ...@@ -153,8 +153,8 @@ namespace DeviceLibrary
runInfo = "空料架在[" + EmptyShelfPlace + "]进入小车完成" + "[RFID=" + RFID + "]"; runInfo = "空料架在[" + EmptyShelfPlace + "]进入小车完成" + "[RFID=" + RFID + "]";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg; jobStep.Msg = msg;
return new EmptyShelfBackJob(EmptyShelfPlace, eShelfType.SmallShelf); AGVManager.CheckBoxNeedShelfState(agv, out string nodeName);
return new EmptyShelfBackJob(EmptyShelfPlace,eShelfType.SmallShelf, nodeName);
} }
else if (jobStep.IsTimeOut(60000, out double timeOutValue)) else if (jobStep.IsTimeOut(60000, out double timeOutValue))
{ {
......
...@@ -11,17 +11,18 @@ namespace DeviceLibrary ...@@ -11,17 +11,18 @@ namespace DeviceLibrary
/// </summary> /// </summary>
/// <param name="agvCurPlace">接到任务时,AGV的位置(空表示待机位)</param> /// <param name="agvCurPlace">接到任务时,AGV的位置(空表示待机位)</param>
/// <param name="palce"></param> /// <param name="palce"></param>
public GoFullShelfStationJob(string palce,string agvCurPlace = SettingString.Standby) public GoFullShelfStationJob(string palce, string agvCurPlace, string rfid)
{ {
FullShelfStationPlace = palce; FullShelfStationPlace = palce;
agvPlace = agvCurPlace; agvPlace = agvCurPlace;
RFID = rfid;
} }
/// <summary> /// <summary>
/// 出满料位置点 /// 出满料位置点
/// </summary> /// </summary>
public string FullShelfStationPlace { get; set; } public string FullShelfStationPlace { get; set; }
public string RFID { get; set; }
/// <summary> /// <summary>
/// 接到任务时,AGV的位置 /// 接到任务时,AGV的位置
/// </summary> /// </summary>
...@@ -32,9 +33,9 @@ namespace DeviceLibrary ...@@ -32,9 +33,9 @@ namespace DeviceLibrary
/// </summary> /// </summary>
public override string RunInfo public override string RunInfo
{ {
get { return string.Format("接满料任务[{0}]:{1}", CurTaskID, runInfo); } get { return string.Format("接满料任务[{0}][rfid={1}]:{2}", CurTaskID, RFID, runInfo); }
} }
private bool noneTargetHandle = false;
/// <summary> /// <summary>
/// AGV上是否有负载 /// AGV上是否有负载
/// </summary> /// </summary>
...@@ -91,39 +92,36 @@ namespace DeviceLibrary ...@@ -91,39 +92,36 @@ namespace DeviceLibrary
CurTaskState = MissionSys.GetTakJobState(agv); CurTaskState = MissionSys.GetTakJobState(agv);
if (MissionSys.CheckTaskFinished(agv, FullShelfStationPlace, CurTaskState)) if (MissionSys.CheckTaskFinished(agv, FullShelfStationPlace, CurTaskState))
{ {
//if (HttpManager.FindFullShelfTarget(node.RFID, out FullShelfDestInfo)) if (HttpManager.FindFullShelfTarget(RFID, out FullShelfDestInfo))
//{ {
// jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_DOUBLE_LINE_RESPONSE); if (FullShelfDestInfo != null && AGVManager.GetLineNameByNodeName(FullShelfDestInfo.data, out string line))
// if (FullShelfDestInfo != null) {
// { jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_DOUBLE_LINE_RESPONSE);
// AGVManager.GetLineNameByNodeName(FullShelfDestInfo.location, out string line); runInfo = "AGV到达 " + FullShelfStationPlace + ",并发送出料架请求[ReadyLeave]";
// agv.BoxDestInfo = FullShelfDestInfo.ShowInfo(line); msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
// } jobStep.Msg = msg;
// runInfo = "AGV到达 " + FullShelfStationPlace + ",并发送出料架请求[ReadyLeave]"; AGVManager.server.ReadyLeave(FullShelfStationPlace);
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); }
// jobStep.Msg = msg; else
// AGVManager.server.ReadyLeave(FullShelfStationPlace); {
//} jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_STANDBY);
//else runInfo = "从" + FullShelfStationPlace + "回到待机位,因不存在该节点" + FullShelfDestInfo.data;
//{ msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
// if (FullShelfDestInfo != null) jobStep.Msg = msg;
// { MissionSys.AssignMission(agv, SettingString.Standby);
// AGVManager.GetLineNameByNodeName(FullShelfDestInfo.location, out string line); UpdateJobTaskInfo(agv);
// runInfo = "AGV到达 " + FullShelfStationPlace + ",查询满料架目的地:" + FullShelfDestInfo.ShowInfo(line); }
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); ;
// jobStep.Msg = msg; }
// } else
// else {
// { noneTargetHandle = true;
// //[{"msg":"0料车已解绑或未发新料"}] jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_DOUBLE_LINE_RESPONSE);
// jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_STANDBY); runInfo = "AGV到达 " + FullShelfStationPlace + ",并发送出料架请求[ReadyLeave][该料架无目的地]";
// runInfo = "从产线" + agvPlace + "回到待机位"; msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); jobStep.Msg = msg;
// jobStep.Msg = msg; AGVManager.server.ReadyLeave(FullShelfStationPlace);
// MissionSys.AssignMission(agv, SettingString.Standby); }
// UpdateJobTaskInfo(agv);
// }
//}
...@@ -156,10 +154,10 @@ namespace DeviceLibrary ...@@ -156,10 +154,10 @@ namespace DeviceLibrary
if (!agv.CurTarName.Equals("Enter")) if (!agv.CurTarName.Equals("Enter"))
{ {
jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT__FULL_SHELF_IN_AGV); jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT__FULL_SHELF_IN_AGV);
runInfo = "收到双层线出料架请求[ReadyLeave]的响应 " + FullShelfStationPlace + "出料架,小车链条运行"; runInfo = "收到请求[ReadyLeave]的响应 " + FullShelfStationPlace + "出料架,小车链条运行";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg; jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.Enter); MissionSys.AssignMission(agv, SettingString.Enter);
UpdateJobTaskInfo(agv); UpdateJobTaskInfo(agv);
} }
...@@ -176,12 +174,25 @@ namespace DeviceLibrary ...@@ -176,12 +174,25 @@ namespace DeviceLibrary
CurTaskState = MissionSys.GetTakJobState(agv); CurTaskState = MissionSys.GetTakJobState(agv);
if (MissionSys.CheckTaskFinished(agv, SettingString.Enter, CurTaskState)) if (MissionSys.CheckTaskFinished(agv, SettingString.Enter, CurTaskState))
{ {
HttpManager.AgvRemoveRfid(RFID);
//GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.END); if (noneTargetHandle)
{
jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_TEMP_PLACE);
runInfo = FullShelfStationPlace + "满料架进入小车完成,由于该料架无目的地,去临时点卸料";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
//FullShelfStationPlace = SettingString.A2;
MissionSys.AssignMission(agv, SettingString.A2);
UpdateJobTaskInfo(agv);
}
else
{
runInfo = FullShelfStationPlace + "满料架进入小车完成"; runInfo = FullShelfStationPlace + "满料架进入小车完成";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg; jobStep.Msg = msg;
return new SendFullShelfToLineJob(FullShelfDestInfo); return new SendFullShelfToLineJob(FullShelfDestInfo, RFID);
}
} }
else if (jobStep.IsTimeOut(60000, out double timeOutValue)) else if (jobStep.IsTimeOut(60000, out double timeOutValue))
{ {
...@@ -192,7 +203,28 @@ namespace DeviceLibrary ...@@ -192,7 +203,28 @@ namespace DeviceLibrary
} }
} }
else if (jobStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_TEMP_PLACE))
{
CurTaskState = MissionSys.GetTakJobState(agv);
if (MissionSys.CheckTaskFinished(agv, SettingString.A2, CurTaskState))
{
MiR_API.Get_IO_Status(agv, out bool[] input, out bool[] output);
System.Threading.Thread.Sleep(500);
if ((input != null && (input[0] || input[1])))
{
runInfo = "人员在临时区卸料完成[无目的地],回收料架";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
AGVManager.CheckBoxNeedShelfState(agv, out string nodeName);
return new EmptyShelfBackJob(SettingString.A2, eShelfType.SmallShelf,nodeName);
}
}
}
else if (jobStep.IsStep(GO_FULL_SHELF_STATION_STEP.END))
{
return null;
}
return this; return this;
} }
...@@ -227,6 +259,10 @@ namespace DeviceLibrary ...@@ -227,6 +259,10 @@ namespace DeviceLibrary
/// </summary> /// </summary>
WAIT_REACH_STANDBY, WAIT_REACH_STANDBY,
/// <summary> /// <summary>
/// 无目的地,放到临时位置
/// </summary>
WAIT_REACH_TEMP_PLACE,
/// <summary>
/// 送上双层线 /// 送上双层线
/// </summary> /// </summary>
END END
......
...@@ -12,10 +12,10 @@ namespace DeviceLibrary ...@@ -12,10 +12,10 @@ namespace DeviceLibrary
/// <param name="palce">产线名</param> /// <param name="palce">产线名</param>
/// <param name="rfid">料架RFID</param> /// <param name="rfid">料架RFID</param>
/// <param name="isIgNoreBigShelf">是否忽略大料架</param> /// <param name="isIgNoreBigShelf">是否忽略大料架</param>
public SendFullShelfToLineJob(HttpManager.BoxDestInfo boxDestInfo, bool isIgNoreBigShelf = false) public SendFullShelfToLineJob(HttpManager.BoxDestInfo boxDestInfo, string rfid,bool isIgNoreBigShelf = false)
{ {
FullShelfPlace = boxDestInfo.location; FullShelfPlace = boxDestInfo.data;
RFID = boxDestInfo.id; RFID =rfid;
BoxDestInfo = boxDestInfo; BoxDestInfo = boxDestInfo;
IsIgnoreBigShelf = isIgNoreBigShelf; IsIgnoreBigShelf = isIgNoreBigShelf;
} }
...@@ -53,7 +53,6 @@ namespace DeviceLibrary ...@@ -53,7 +53,6 @@ namespace DeviceLibrary
agv.RFID = RFID; agv.RFID = RFID;
if (jobStep.IsStep(SEND_FULL_SHELF_STEP.NONE)) if (jobStep.IsStep(SEND_FULL_SHELF_STEP.NONE))
{ {
HttpManager.AgvRemoveRfid(RFID);
jobStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE); jobStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE);
runInfo = "从云仓送往[" + FullShelfPlace + "]"; runInfo = "从云仓送往[" + FullShelfPlace + "]";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
...@@ -77,12 +76,13 @@ namespace DeviceLibrary ...@@ -77,12 +76,13 @@ namespace DeviceLibrary
{ {
MiR_API.Get_IO_Status(agv, out bool[] input, out bool[] output); MiR_API.Get_IO_Status(agv, out bool[] input, out bool[] output);
System.Threading.Thread.Sleep(500); System.Threading.Thread.Sleep(500);
if ((input != null && input[0])) if ((input != null && (input[0]|| input[1])))
{ {
runInfo = "人员在" + FullShelfPlace + "卸料完成"; runInfo = "人员在" + FullShelfPlace + "卸料完成";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg; jobStep.Msg = msg;
return new EmptyShelfBackJob(FullShelfPlace, eShelfType.SmallShelf); AGVManager.CheckBoxNeedShelfState(agv, out string nodeName);
return new EmptyShelfBackJob(FullShelfPlace, eShelfType.SmallShelf,nodeName);
} }
} }
......
...@@ -29,7 +29,7 @@ namespace DeviceLibrary ...@@ -29,7 +29,7 @@ namespace DeviceLibrary
if (AGVManager.CheckShelfStorageOutState(agv)) if (AGVManager.CheckShelfStorageOutState(agv))
{ {
AGVManager.SetNodeOccupy(nodename,LineState.Busy); LogUtil.debug(string.Format("{0} Get Job OK:{1},place={2}",agv.Name, "GoEmptyShelfLineJob", nodename));
return new GoEmptyShelfLineJob(agv.Place, SettingString.A1, ""); return new GoEmptyShelfLineJob(agv.Place, SettingString.A1, "");
} }
......
...@@ -24,8 +24,103 @@ namespace DeviceLibrary ...@@ -24,8 +24,103 @@ namespace DeviceLibrary
if (!AGVManager.CheckAGVStatusNone(currentAgv)) if (!AGVManager.CheckAGVStatusNone(currentAgv))
return null; return null;
//查看云仓出料口情况 //查看云仓出料口情况
string rfid;
string checkPlace = SettingString.D1;
//查找云仓出料的任务
if (FindNeedLeaveMission(currentAgv, checkPlace, out rfid))
{
LogUtil.info(string.Format("{0} [{1}]需要出满料串{2}", currentAgv.Name, checkPlace, rfid));
return new GoFullShelfStationJob(checkPlace, currentAgv.Place,rfid);
}
checkPlace = SettingString.D2;
//查找云仓出料的任务
if (FindNeedLeaveMission(currentAgv, checkPlace, out rfid))
{
LogUtil.info(string.Format("{0} [{1}]需要出满料串{2}", currentAgv.Name, checkPlace, rfid));
return new GoFullShelfStationJob(checkPlace, currentAgv.Place, rfid);
}
checkPlace = SettingString.D3;
//查找云仓出料的任务
if (FindNeedLeaveMission(currentAgv, checkPlace, out rfid))
{
LogUtil.info(string.Format("{0} [{1}]需要出满料串{2}", currentAgv.Name, checkPlace, rfid));
return new GoFullShelfStationJob(checkPlace, currentAgv.Place, rfid);
}
return null; return null;
} }
public static bool CheckFullTask(string rfid, out string targetName)
{
targetName = "";
if (HttpManager.FindFullShelfTarget(rfid, out HttpManager.BoxDestInfo destInfo))
{
targetName = destInfo.data;
return true;
}
return false;
}
/// <summary>
/// 查询节点出料架[满]任务
/// </summary>
/// <param name="agv"></param>
/// <param name="nodeName"></param>
/// <param name="RFID"></param>
/// <param name="empty">料架类型</param>
/// <returns></returns>
public static bool FindNeedLeaveMission(Agv_Info agv, string nodeName, out string RFID, bool empty=false)
{
RFID = "";
if (FindNeedLeave(agv, nodeName, out string rfid))
{
int idx = AGVManager.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob != null &&
(s.CurJob is GoFullShelfStationJob && (((GoFullShelfStationJob)s.CurJob).FullShelfStationPlace.Equals(nodeName)))
);
HttpManager.FindFullShelfTarget(rfid, out HttpManager.BoxDestInfo boxDestInfo);
if (idx == -1 && boxDestInfo!=null)// && HttpManager.FindFullShelfTarget(rfid,out HttpManager.BoxDestInfo boxDestInfo)
{
RFID = rfid;
LogUtil.debug(string.Format("{0} FindNeedLeaveMission", agv.Name));
return true;
}
}
return false;
}
/// <summary>
/// 需要离开料架
/// </summary>
/// <param name="agv"></param>
/// <param name="nodeName"></param>
/// <param name="rfid"></param>
/// <param name="empty">料架类型</param>
/// <returns></returns>
public static bool FindNeedLeave(Agv_Info agv, string nodeName, out string rfid)
{
rfid = "";
int nodeIdx = AGVManager.FindNode(nodeName);
List<AlarmMsg> msglist = new List<AlarmMsg>();
if (nodeIdx > -1)
{
nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name.Equals(nodeName) && s.StateEquals(eNodeStatus.NeedLeave));
if (nodeIdx > -1)
{
if (AGVManager.nodeInfo[nodeIdx].RFID.StartsWith(SettingString.ReelString_RFID_Prefix))
{
rfid = AGVManager.nodeInfo[nodeIdx].RFID;
return true;
}
else
{
msglist.Add(new AlarmMsg(nodeName, "Using." + nodeName, "出口为出料任务,但是RFID状态异常:rfid=" + AGVManager.nodeInfo[nodeIdx].RFID));
}
}
}
else
{
msglist.Add(new AlarmMsg(nodeName, "Using." + nodeName, "调用关闭"));
}
if(msglist.Count>0)
HttpManager.updateDeviceAlarmMsg(msglist);
return false;
}
} }
} }
...@@ -33,12 +33,9 @@ namespace DeviceLibrary ...@@ -33,12 +33,9 @@ namespace DeviceLibrary
public string LineName { set; get; } public string LineName { set; get; }
public ClientLevel ClientLevel { get; set; } = ClientLevel.Low; public ClientLevel ClientLevel { get; set; } = ClientLevel.Low;
/// <summary>
/// 节点状态(AGV占用情况)
/// </summary>
public LineState State = LineState.None;
public string AliceName { get; set; } public string AliceName { get; set; }
public string DestInfo { get; set; }
/// <summary> /// <summary>
/// 客户端节点 /// 客户端节点
/// </summary> /// </summary>
...@@ -88,7 +85,7 @@ namespace DeviceLibrary ...@@ -88,7 +85,7 @@ namespace DeviceLibrary
// if (Online) // if (Online)
// { // {
s[2] = nodeStatus.ToString(); s[2] = nodeStatus.ToString();
s[3] = State.ToString(); s[3] = "None";
s[4] = RFID; s[4] = RFID;
// s[5] = AgvName; // s[5] = AgvName;
// } // }
......
...@@ -154,23 +154,7 @@ namespace DeviceLibrary ...@@ -154,23 +154,7 @@ namespace DeviceLibrary
return idx; return idx;
} }
/// <summary> //private static object checkLocObj = new object();
/// 设置节点的状态占用
/// </summary>
/// <param name="nodeName"></param>
/// <param name="state"></param>
public static void SetNodeOccupy(string nodeName,LineState state)
{
int i = nodeInfo.FindIndex(s=>s.Name.Equals(nodeName));
if(i>-1)
{
if (nodeInfo[i].State.Equals(state))
return;
nodeInfo[i].State = state;
log.Debug(string.Format("设置{0}的占用状态为{1}", nodeName, state));
}
}
private static object checkLocObj = new object();
/// <summary> /// <summary>
/// 查看云仓需要料架的状况 /// 查看云仓需要料架的状况
/// </summary> /// </summary>
...@@ -180,14 +164,14 @@ namespace DeviceLibrary ...@@ -180,14 +164,14 @@ namespace DeviceLibrary
{ {
nodeName = ""; nodeName = "";
if (Monitor.TryEnter(checkLocObj)) // if (Monitor.TryEnter(checkLocObj))
{ {
try try
{ {
int tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D1 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse); int tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D1 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse);
if (tarIdx > -1) if (tarIdx > -1)
{ {
if (!CheckLineBusy(SettingString.D1)) if (CheckAgvEmptyJob(agv, SettingString.D1))
{ {
nodeName = SettingString.D1; nodeName = SettingString.D1;
log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D1)); log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D1));
...@@ -198,7 +182,7 @@ namespace DeviceLibrary ...@@ -198,7 +182,7 @@ namespace DeviceLibrary
tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D2 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse); tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D2 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse);
if (tarIdx > -1) if (tarIdx > -1)
{ {
if (!CheckLineBusy(SettingString.D2)) if (CheckAgvEmptyJob(agv, SettingString.D2))
{ {
nodeName = SettingString.D2; nodeName = SettingString.D2;
log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D2)); log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D2));
...@@ -208,7 +192,7 @@ namespace DeviceLibrary ...@@ -208,7 +192,7 @@ namespace DeviceLibrary
tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D3 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse); tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D3 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse);
if (tarIdx > -1) if (tarIdx > -1)
{ {
if (!CheckLineBusy(SettingString.D3)) if (CheckAgvEmptyJob(agv, SettingString.D3))
{ {
nodeName = SettingString.D3; nodeName = SettingString.D3;
log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D3)); log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D3));
...@@ -222,7 +206,7 @@ namespace DeviceLibrary ...@@ -222,7 +206,7 @@ namespace DeviceLibrary
} }
finally finally
{ {
Monitor.Exit(checkLocObj); // Monitor.Exit(checkLocObj);
} }
} }
...@@ -230,16 +214,16 @@ namespace DeviceLibrary ...@@ -230,16 +214,16 @@ namespace DeviceLibrary
} }
/// <summary> /// <summary>
/// 检查云仓出料口是否被agv占用 /// 检查是否有AGV送空架子
/// </summary> /// </summary>
/// <param name="nodeName"></param> /// <param name="nodeName"></param>
/// <returns></returns> /// <returns></returns>
public static bool CheckLineBusy(string nodeName) public static bool CheckAgvEmptyJob(Agv_Info agv, string nodename)
{ {
int i = nodeInfo.FindIndex(s=>s.Name.Equals(nodeName)); int i = agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob is EmptyShelfBackJob &&
if (i>-1 && nodeInfo[i].State.Equals(LineState.Busy)) ((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace.Equals(nodename));
if (i > -1) return false;
return true; return true;
return false;
} }
/// <summary> /// <summary>
/// 查看料架存放处是否可以放空料架 /// 查看料架存放处是否可以放空料架
...@@ -264,12 +248,12 @@ namespace DeviceLibrary ...@@ -264,12 +248,12 @@ namespace DeviceLibrary
/// <param name="agv"></param> /// <param name="agv"></param>
/// <param name="nodeName"></param> /// <param name="nodeName"></param>
/// <returns></returns> /// <returns></returns>
public static bool CheckNeedEmptyShelf(Agv_Info agv,out string nodeName) public static bool CheckNeedEmptyShelf(Agv_Info agv, out string nodeName)
{ {
if(!CheckBoxNeedShelfState(agv,out nodeName)) if (!CheckBoxNeedShelfState(agv, out nodeName))
{ {
if(CheckShelfStorageInState(agv)) if (CheckShelfStorageInState(agv))
{ {
nodeName = SettingString.A2; nodeName = SettingString.A2;
return true; return true;
...@@ -285,8 +269,10 @@ namespace DeviceLibrary ...@@ -285,8 +269,10 @@ namespace DeviceLibrary
public static bool CheckShelfStorageOutState(Agv_Info agv) public static bool CheckShelfStorageOutState(Agv_Info agv)
{ {
int tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.A1 int tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.A1
&& (s.StateEquals(eNodeStatus.NeedEnter)) && s.IsUse); && (s.StateEquals(eNodeStatus.NeedLeave)) && s.IsUse);
if (tarIdx > -1) int idx = AGVManager.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob is GoEmptyShelfLineJob &&
((GoEmptyShelfLineJob)s.CurJob).EmptyShelfPlace.Equals(SettingString.A1));
if (tarIdx > -1 && idx == -1)
{ {
log.Debug(string.Format("{0} {1}可以出料架", agv.Name, SettingString.A1)); log.Debug(string.Format("{0} {1}可以出料架", agv.Name, SettingString.A1));
return true; return true;
......
...@@ -4,21 +4,21 @@ ...@@ -4,21 +4,21 @@
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections> </configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup> </startup>
<appSettings> <appSettings>
<add key="Port_AGV_Server" value="9501"/> <add key="Port_AGV_Server" value="9501"/>
<add key="http.server" value="http://10.85.162.124/myproject/"/> <add key="http.server" value="http://172.74.200.81/smdbox/"/>
<add key="FLEET" value="10.85.19.3"/> <add key="FLEET" value="172.74.200.82"/>
<add key="UseFleet" value="False"/> <add key="UseFleet" value="True"/>
<add key="ChargeThreshold" value="20,90"/> <add key="ChargeThreshold" value="20,90"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="AgvServer" type="log4net.Appender.RollingFileAppender"> <appender name="AgvServer" type="log4net.Appender.RollingFileAppender">
<file value="logs/AgvServer.log"/> <file value="logs/AgvServer/AgvServer.log"/>
<param name="Encoding" value="UTF-8"/> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/> <param name="MaxSizeRollBackups" value="10"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
</layout> </layout>
</appender> </appender>
<appender name="HttpManager" type="log4net.Appender.RollingFileAppender"> <appender name="HttpManager" type="log4net.Appender.RollingFileAppender">
<file value="logs/HttpManager.log"/> <file value="logs/HttpManager/HttpManager.log"/>
<param name="Encoding" value="UTF-8"/> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/> <param name="MaxSizeRollBackups" value="10"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</layout> </layout>
</appender> </appender>
<appender name="AGV_3D_Line" type="log4net.Appender.RollingFileAppender"> <appender name="AGV_3D_Line" type="log4net.Appender.RollingFileAppender">
<file value="logs/AGV_3D_Line.log"/> <file value="logs/AGV/AGV_Line.log"/>
<param name="Encoding" value="UTF-8"/> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<rollingStyle value="Date"/> <rollingStyle value="Date"/>
...@@ -46,11 +46,11 @@ ...@@ -46,11 +46,11 @@
<conversionPattern value="[%date][%t][%c:%L]%-5p %m%n"/> <conversionPattern value="[%date][%t][%c:%L]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="LineWebService" type="log4net.Appender.RollingFileAppender"> <appender name="MiR_API" type="log4net.Appender.RollingFileAppender">
<file value="logs/UnlockInfo.log"/> <file value="logs/MiR_API/MiR_API.log"/>
<param name="Encoding" value="UTF-8"/> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/> <appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/> <param name="MaxSizeRollBackups" value="10"/>
<!-- 切割最多文件数 --> <!-- 切割最多文件数 -->
<param name="MaximumFileSize" value="50MB"/> <param name="MaximumFileSize" value="50MB"/>
<!-- 每个文件的大小 --> <!-- 每个文件的大小 -->
...@@ -60,9 +60,9 @@ ...@@ -60,9 +60,9 @@
<conversionPattern value="[%date]%-5p %m%n"/> <conversionPattern value="[%date]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<logger name="LineWebService"> <logger name="MiR_API">
<level value="Info"/> <level value="Info"/>
<appender-ref ref="LineWebService"/> <appender-ref ref="MiR_API"/>
</logger> </logger>
<logger name="AgvServer"> <logger name="AgvServer">
<level value="Info"/> <level value="Info"/>
......
...@@ -12,6 +12,8 @@ using System.Threading.Tasks; ...@@ -12,6 +12,8 @@ using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using Common; using Common;
using DeviceLibrary; using DeviceLibrary;
using static DeviceLibrary.HttpManager;
namespace AGVControl namespace AGVControl
{ {
public partial class FrmMain : Form public partial class FrmMain : Form
...@@ -26,7 +28,7 @@ namespace AGVControl ...@@ -26,7 +28,7 @@ namespace AGVControl
InitializeComponent(); InitializeComponent();
showTimer = new System.Timers.Timer(); showTimer = new System.Timers.Timer();
showTimer.Interval = 5000; showTimer.Interval = 5000;
//showTimer.Enabled = true; showTimer.Enabled = true;
showTimer.AutoReset = true; showTimer.AutoReset = true;
showTimer.Elapsed += ShowTimer_Elapsed; showTimer.Elapsed += ShowTimer_Elapsed;
showTimer.Start(); showTimer.Start();
...@@ -43,7 +45,7 @@ namespace AGVControl ...@@ -43,7 +45,7 @@ namespace AGVControl
if (input != null && input.Length == 4) if (input != null && input.Length == 4)
AGVManager.agvInfo[i].IsExistShelf = input[3]; AGVManager.agvInfo[i].IsExistShelf = input[3];
flowLayoutPanel1.Controls.Add(AGVManager.agvInfo[i].StateKanban); flowLayoutPanel1.Controls.Add(AGVManager.agvInfo[i].StateKanban);
AddForm(AGVManager.agvInfo[i].Name,new Manual(AGVManager.agvInfo[i])); AddForm(AGVManager.agvInfo[i].Name, new Manual(AGVManager.agvInfo[i]));
AGVManager.agvInfo[i].StateKanban.Init(); AGVManager.agvInfo[i].StateKanban.Init();
} }
...@@ -64,8 +66,12 @@ namespace AGVControl ...@@ -64,8 +66,12 @@ namespace AGVControl
{ {
Invoke(new Action(() => Invoke(new Action(() =>
{ {
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = AGVManager.nodeInfo[nodeIndex].Online && AGVManager.nodeInfo[nodeIndex].IsUse ? Color.Black : Color.Red; for (int i = 0; i < AGVManager.nodeInfo.Count; i++)
DgvNode.Rows[nodeIndex].SetValues(AGVManager.nodeInfo[nodeIndex].ToRow()); {
DgvNode.Rows[i].DefaultCellStyle.ForeColor = AGVManager.nodeInfo[i].Online && AGVManager.nodeInfo[i].IsUse ? Color.Black : Color.Red;
DgvNode.Rows[i].SetValues(AGVManager.nodeInfo[i].ToRow());
}
})); }));
System.GC.Collect(); System.GC.Collect();
} }
...@@ -74,8 +80,11 @@ namespace AGVControl ...@@ -74,8 +80,11 @@ namespace AGVControl
{ {
Invoke(new Action(() => Invoke(new Action(() =>
{ {
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = AGVManager.nodeInfo[nodeIndex].Online ? Color.Black : Color.Red; // for (int i = 0; i < AGVManager.nodeInfo.Count; i++)
{
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = AGVManager.nodeInfo[nodeIndex].Online && AGVManager.nodeInfo[nodeIndex].IsUse ? Color.Black : Color.Red;
DgvNode.Rows[nodeIndex].SetValues(AGVManager.nodeInfo[nodeIndex].ToRow()); DgvNode.Rows[nodeIndex].SetValues(AGVManager.nodeInfo[nodeIndex].ToRow());
}
})); }));
System.GC.Collect(); System.GC.Collect();
} }
...@@ -161,24 +170,111 @@ namespace AGVControl ...@@ -161,24 +170,111 @@ namespace AGVControl
bool InShhow = false; bool InShhow = false;
Dictionary<string, string> destInfoMap = new Dictionary<string, string>();
private void ShowTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) private void ShowTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
//ShowEmptyTask(); //ShowEmptyTask();
if (InShhow) if (InShhow)
return; return;
InShhow = true; InShhow = true;
BoxDestInfo destInfo;
ClientNode node;
Invoke(new Action(() => Invoke(new Action(() =>
{ {
node = AGVManager.nodeInfo.Find(s => s.Name.Equals(SettingString.D1) && s.RFID.StartsWith(SettingString.ReelString_RFID_Prefix));
if (node != null)
{
if (!destInfoMap.ContainsKey(SettingString.D1))
{
FindFullShelfTarget(node.RFID, out destInfo);
if (destInfo != null)
{
lblD1.Text = destInfo.ToString();
destInfoMap.Add(SettingString.D1, node.RFID);
}
}
else if (!destInfoMap[SettingString.D1].Equals(node.RFID))
{
FindFullShelfTarget(node.RFID, out destInfo);
if (destInfo != null)
{
lblD1.Text = destInfo.ToString();
destInfoMap[SettingString.D1] = node.RFID;
}
}
}
else
{
lblD1.Text = "";
if (destInfoMap.ContainsKey(SettingString.D1))
destInfoMap.Remove(SettingString.D1);
}
node = AGVManager.nodeInfo.Find(s => s.Name.Equals(SettingString.D2) && s.RFID.StartsWith(SettingString.ReelString_RFID_Prefix));
if (node != null)
{
if (!destInfoMap.ContainsKey(SettingString.D2))
{
FindFullShelfTarget(node.RFID, out destInfo);
if (destInfo != null)
{
lblD2.Text = destInfo.ToString();
destInfoMap.Add(SettingString.D2, node.RFID);
}
}
else if (!destInfoMap[SettingString.D2].Equals(node.RFID))
{
FindFullShelfTarget(node.RFID, out destInfo);
if (destInfo != null)
{
lblD2.Text = destInfo.ToString();
destInfoMap[SettingString.D2] = node.RFID;
}
}
}
else
{
lblD2.Text = "";
if (destInfoMap.ContainsKey(SettingString.D2))
destInfoMap.Remove(SettingString.D2);
}
node = AGVManager.nodeInfo.Find(s => s.Name.Equals(SettingString.D3) && s.RFID.StartsWith(SettingString.ReelString_RFID_Prefix));
if (node != null)
{
if (!destInfoMap.ContainsKey(SettingString.D3))
{
FindFullShelfTarget(node.RFID, out destInfo);
if (destInfo != null)
{
lblD3.Text = destInfo.ToString();
destInfoMap.Add(SettingString.D3, node.RFID);
}
}
else if (!destInfoMap[SettingString.D3].Equals(node.RFID))
{
FindFullShelfTarget(node.RFID, out destInfo);
if (destInfo != null)
{
lblD3.Text = destInfo.ToString();
destInfoMap[SettingString.D3] = node.RFID;
}
}
}
else
{
lblD3.Text = "";
if (destInfoMap.ContainsKey(SettingString.D3))
destInfoMap.Remove(SettingString.D3);
}
Application.DoEvents(); Application.DoEvents();
//if (!Common.doubleLine_WO.Equals(""))
lblWO.Text = AGVManager.doubleLine_WO;
// if (!AGVManager.A6_Target.Equals(""))
//lblDestInfo.Text = HttpManager.A6_Target;
lblCharge1.Text = "充电桩1:" ;
lblCharge2.Text = "充电桩2:" ;
lblWarn.Text = AGVManager.warnMsg; lblWarn.Text = AGVManager.warnMsg;
})); }));
...@@ -214,5 +310,28 @@ namespace AGVControl ...@@ -214,5 +310,28 @@ namespace AGVControl
} }
} }
private void btnAgvRemoveRfid_Click(object sender, EventArgs e)
{
try
{
if (txtBoxRFID.Text.Equals(""))
return;
Task.Factory.StartNew(() =>
{
bool rtn = HttpManager.AgvRemoveRfid(txtBoxRFID.Text.ToUpper());
this.Invoke(new Action(() =>
{
label1.BackColor = rtn ? Color.Green : Color.Red;
label1.Text = rtn ? "清理料架的缓存信息成功:" + txtBoxRFID.Text.ToUpper() : "清理料架的缓存信息失败:" + txtBoxRFID.Text.ToUpper();
}));
LogUtil.info(string.Format("手动清理料架的缓存信息成功[{0}]", txtBoxRFID.Text.ToUpper()));
txtBoxRFID.Text = "";
});
}
catch (Exception ex)
{
}
}
} }
} }
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Manual)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Manual));
this.panelInfo = new System.Windows.Forms.Panel(); this.panelInfo = new System.Windows.Forms.Panel();
this.lblInfo = new System.Windows.Forms.Label(); this.lblInfo = new System.Windows.Forms.Label();
...@@ -42,6 +43,9 @@ ...@@ -42,6 +43,9 @@
this.grpBxMission = new System.Windows.Forms.GroupBox(); this.grpBxMission = new System.Windows.Forms.GroupBox();
this.btnAssignTask = new System.Windows.Forms.Button(); this.btnAssignTask = new System.Windows.Forms.Button();
this.cmbBxMission = new System.Windows.Forms.ComboBox(); this.cmbBxMission = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.panelInfo.SuspendLayout(); this.panelInfo.SuspendLayout();
this.grpBxRunMode.SuspendLayout(); this.grpBxRunMode.SuspendLayout();
this.grpBxOperation.SuspendLayout(); this.grpBxOperation.SuspendLayout();
...@@ -72,6 +76,8 @@ ...@@ -72,6 +76,8 @@
// //
// grpBxRunMode // grpBxRunMode
// //
this.grpBxRunMode.Controls.Add(this.label2);
this.grpBxRunMode.Controls.Add(this.label1);
this.grpBxRunMode.Controls.Add(this.chkBxAuto); this.grpBxRunMode.Controls.Add(this.chkBxAuto);
this.grpBxRunMode.Controls.Add(this.btnReSendTask); this.grpBxRunMode.Controls.Add(this.btnReSendTask);
this.grpBxRunMode.Dock = System.Windows.Forms.DockStyle.Top; this.grpBxRunMode.Dock = System.Windows.Forms.DockStyle.Top;
...@@ -96,7 +102,7 @@ ...@@ -96,7 +102,7 @@
// //
// btnReSendTask // btnReSendTask
// //
this.btnReSendTask.Location = new System.Drawing.Point(251, 11); this.btnReSendTask.Location = new System.Drawing.Point(96, 11);
this.btnReSendTask.Name = "btnReSendTask"; this.btnReSendTask.Name = "btnReSendTask";
this.btnReSendTask.Size = new System.Drawing.Size(75, 53); this.btnReSendTask.Size = new System.Drawing.Size(75, 53);
this.btnReSendTask.TabIndex = 3; this.btnReSendTask.TabIndex = 3;
...@@ -194,6 +200,30 @@ ...@@ -194,6 +200,30 @@
this.cmbBxMission.Size = new System.Drawing.Size(159, 20); this.cmbBxMission.Size = new System.Drawing.Size(159, 20);
this.cmbBxMission.TabIndex = 0; this.cmbBxMission.TabIndex = 0;
// //
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(194, 11);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 12);
this.label1.TabIndex = 4;
this.label1.Text = "label1";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(194, 52);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(47, 12);
this.label2.TabIndex = 5;
this.label2.Text = "label2";
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Manual // Manual
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
...@@ -232,5 +262,8 @@ ...@@ -232,5 +262,8 @@
private System.Windows.Forms.GroupBox grpBxMission; private System.Windows.Forms.GroupBox grpBxMission;
private System.Windows.Forms.Button btnAssignTask; private System.Windows.Forms.Button btnAssignTask;
private System.Windows.Forms.ComboBox cmbBxMission; private System.Windows.Forms.ComboBox cmbBxMission;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer timer1;
} }
} }
...@@ -33,6 +33,7 @@ namespace AGVControl ...@@ -33,6 +33,7 @@ namespace AGVControl
} }
cmbBxMission.SelectedIndex = 0; cmbBxMission.SelectedIndex = 0;
isIni = true; isIni = true;
timer1.Enabled = true;
} }
private void chkBxAuto_CheckedChanged(object sender, EventArgs e) private void chkBxAuto_CheckedChanged(object sender, EventArgs e)
...@@ -58,12 +59,14 @@ namespace AGVControl ...@@ -58,12 +59,14 @@ namespace AGVControl
if (Agv.IsExistShelf) if (Agv.IsExistShelf)
{ {
LogUtil.error(string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name)); LogUtil.error(string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name));
MessageBox.Show(this,string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name));
chkBxAuto.Checked = false;
return; return;
} }
if (MessageBox.Show(this, "是否继续上一次的任务?\r\n" + Agv.Msg, "提示", MessageBoxButtons.YesNo).Equals(DialogResult.No)) if (MessageBox.Show(this, "是否继续上一次的任务?\r\n" + Agv.Msg, "提示", MessageBoxButtons.YesNo).Equals(DialogResult.No))
{ {
LogUtil.info(string.Format("{0} 中断上一次任务:{1}", Agv.Name, Agv.Msg));
Agv.CurJob = null; Agv.CurJob = null;
AGVManager.SetNodeOccupy(Agv.Place, LineState.None);
if (Agv.Place.Equals(SettingString.Standby) || Agv.Place.Equals(SettingString.AutoCharge)) if (Agv.Place.Equals(SettingString.Standby) || Agv.Place.Equals(SettingString.AutoCharge))
Agv.Place = ""; Agv.Place = "";
MiR_API.Del_Mission(Agv); MiR_API.Del_Mission(Agv);
...@@ -151,5 +154,13 @@ namespace AGVControl ...@@ -151,5 +154,13 @@ namespace AGVControl
{ {
Close(); Close();
} }
private void timer1_Tick(object sender, EventArgs e)
{
this.Invoke(new Action(()=> {
label1.Text = Agv.IOInState;
label2.Text = Agv.IOOutState;
}));
}
} }
} }
...@@ -117,6 +117,9 @@ ...@@ -117,6 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>SO827_AGV</RootNamespace> <RootNamespace>SO827_AGV</RootNamespace>
<AssemblyName>SO827-AGV</AssemblyName> <AssemblyName>SO827-AGV</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
...@@ -37,9 +37,6 @@ ...@@ -37,9 +37,6 @@
<ApplicationIcon>line.ico</ApplicationIcon> <ApplicationIcon>line.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="AsaPL.AgvClient">
<HintPath>..\AgvClient\bin\Debug\AsaPL.AgvClient.dll</HintPath>
</Reference>
<Reference Include="log4net"> <Reference Include="log4net">
<HintPath>dll\log4net.dll</HintPath> <HintPath>dll\log4net.dll</HintPath>
</Reference> </Reference>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!