Commit a44da5a2 张东亮

0420

1 个父辈 8c2b595c
......@@ -8,9 +8,10 @@
<OutputType>Library</OutputType>
<RootNamespace>AGV_UI</RootNamespace>
<AssemblyName>AGV_UI</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......
......@@ -24,7 +24,7 @@ namespace AGV_UI
missionShow.Add(item, new Label() { Name = item,
Font = new Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))),
AutoSize = true,
BorderStyle = BorderStyle.Fixed3D
//BorderStyle = BorderStyle.Fixed3D
});
}
flowPanelMissionState.Controls.AddRange(missionShow.Values.ToArray());
......
......@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common</RootNamespace>
<AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......
......@@ -34,7 +34,7 @@ namespace Common
public const string FileName_tempData = "tempData.ini";
public const string IsUse = "IsUse";
public const string RFID = "RFID";
public const string ReelString_RFID_Prefix = "F";
//云仓出料口
public const string D1 = "D1";
public const string D2 = "D2";
......
......@@ -4,6 +4,8 @@ using System.Net;
using System.Net.Sockets;
using Common;
using System.Threading;
using System.Linq;
using System.Collections.Concurrent;
namespace DeviceLibrary
{
......@@ -18,7 +20,7 @@ namespace DeviceLibrary
private List<Client> _client; //所有客户端
private Thread tListenClient; //监听客户端连接
public int PORT = AppConfigHelper.GetIntValue(SettingString.Port_AGV_Server); //端口
private Thread tPingClient; //ping
//private Thread tPingClient; //ping
/// <summary>
/// 节点改变事件
/// </summary>
......@@ -57,8 +59,8 @@ namespace DeviceLibrary
_client = new List<Client>();
tListenClient = new Thread(new ThreadStart(ListenClient));
tListenClient.Start();
tPingClient = new Thread(new ThreadStart(KeepLiveClient));
tPingClient.Start();
//tPingClient = new Thread(new ThreadStart(KeepLiveClient));
//tPingClient.Start();
}
catch (Exception ex)
{
......@@ -88,12 +90,10 @@ namespace DeviceLibrary
public Dictionary<string, DateTime> readyLeaveTime = new Dictionary<string, DateTime>();
public bool ReadyEnter(string nodeName, string rfid = "")
{
int nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = AGVManager.nodeInfo[nodeIdx].IP;
int idx = FindClient(ip);
int idx = FindClient(nodeName);
if (idx == -1)
{
log.Error("ReadyEnter 没有找到" + nodeName + " " + ip);
log.Error("ReadyEnter 没有找到" + nodeName);
return false;
}
else
......@@ -107,12 +107,12 @@ namespace DeviceLibrary
else
{
TimeSpan timeSpan = DateTime.Now - readyEnterTime[nodeName];
if (timeSpan.TotalSeconds < 45)
if (timeSpan.TotalSeconds < 15)
{
log.Debug(nodeName + " " + ip + " ReadyEnter 45秒内不重复发送");
log.Debug(nodeName +" ReadyEnter 15秒内不重复发送");
return false;
}
else if (timeSpan.TotalMinutes > 2)
else if (timeSpan.TotalMinutes > 1)
{
readyEnterTime[nodeName] = DateTime.Now;
}
......@@ -128,12 +128,10 @@ namespace DeviceLibrary
public bool ReadyLeave(string nodeName, string rfid = "")
{
int nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = AGVManager.nodeInfo[nodeIdx].IP;
int idx = FindClient(ip);
int idx = FindClient(nodeName);
if (idx == -1)
{
log.Error("ReadyLeave 没有找到" + nodeName + " " + ip);
log.Error("ReadyLeave 没有找到" + nodeName);
return false;
}
else
......@@ -149,10 +147,10 @@ namespace DeviceLibrary
TimeSpan timeSpan = DateTime.Now - readyLeaveTime[nodeName];
if (timeSpan.TotalSeconds < 45)
{
log.Debug(nodeName + " " + ip + " ReadyLeave 45秒内不重复发送");
log.Debug(nodeName +" ReadyLeave 45秒内不重复发送");
return false;
}
else if (timeSpan.TotalMinutes > 3)
else if (timeSpan.TotalMinutes > 1)
{
readyLeaveTime[nodeName] = DateTime.Now;
}
......@@ -168,12 +166,10 @@ namespace DeviceLibrary
public bool FinishEnter(string nodeName, string rfid = "")
{
int nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = AGVManager.nodeInfo[nodeIdx].IP;
int idx = FindClient(ip);
int idx = FindClient(nodeName);
if (idx == -1)
{
log.Error("FinishEnter 没有找到" + nodeName + " " + ip);
log.Error("FinishEnter 没有找到" + nodeName);
return false;
}
else
......@@ -186,12 +182,10 @@ namespace DeviceLibrary
public bool FinishLeave(string nodeName, string rfid = "")
{
int nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = AGVManager.nodeInfo[nodeIdx].IP;
int idx = FindClient(ip);
int idx = FindClient(nodeName);
if (idx == -1)
{
log.Error("FinishLeave 没有找到" + nodeName + " " + ip);
log.Error("FinishLeave 没有找到" + nodeName);
return false;
}
else
......@@ -229,35 +223,22 @@ namespace DeviceLibrary
if (!_loop) return;
}
int idx = FindClient(clientNode.IP);
if (idx == -1)
{
log.Debug("KeepLive 没有找到" + clientNode.Name);
int index = AGVManager.nodeInfo.IndexOf(clientNode);
AGVManager.nodeInfo[index].Online = false;
continue;
}
else
for (int i = 0; i < AGVManager.nodeInfo.Count; i++)
{
if (clientNode.StateEquals(eNodeStatus.None))
try
{
byte[] buff = new byte[] { 0X00, 0X00 };
int index = AGVManager.nodeInfo.IndexOf(clientNode);
if (!Send(idx, buff))
{
AGVManager.nodeInfo[index].Online = false;
log.Debug(clientNode.Name + " KeepLive 发送失败");
}
else
{
AGVManager.nodeInfo[index].Online = true;
log.Debug(clientNode.Name + " KeepLive 发送成功");
}
if (!_loop)
break;
Thread.Sleep(1000);
if (!AGVManager.nodeInfo[i].IP.Equals(""))
AGVManager.nodeInfo[i].Online = CheckIP(AGVManager.nodeInfo[i].Name, AGVManager.nodeInfo[i].IP);
NodeOnline?.Invoke(i);
}
catch (Exception e)
{
log.Error("PingClient", e);
}
}
NodeOnline?.Invoke(AGVManager.nodeInfo.IndexOf(clientNode));
NodeChanged?.Invoke(AGVManager.nodeInfo.IndexOf(clientNode));
}
}
}
......@@ -346,7 +327,9 @@ namespace DeviceLibrary
}
}
}
//临时缓存
//线程安全的字典
ConcurrentDictionary<string, byte[]> dic = new ConcurrentDictionary<string, byte[]>();
/// <summary>
/// 客户端数据接收
/// </summary>
......@@ -367,31 +350,93 @@ namespace DeviceLibrary
if (client.Socket.Available > 0)
{
time = 0;
byte[] supBuff = null;
int count = client.Socket.Receive(temp);
byte[] buff = new byte[count];
Array.Copy(temp, 0, buff, 0, count);
ClientNode node = Decode(client, buff);
if (node == null)
if (!dic.TryGetValue(client.IP, out supBuff)) //第一次收到开头必须是0xAD开头的字节
{
log.Debug(client.IP + " 解码失败:" + HexBuff(buff));
if (temp[0].Equals(0xAD))
{
supBuff = new byte[count];
Array.Copy(temp, 0, supBuff, 0, count);
//log.Info(string.Format("start with AB receive:{0}", HexBuff(supBuff)));
}
else
{
//log.Info(string.Format("start without AB receive:{0}", HexBuff(temp)));
for (int i = 0; i < count; i++)
{
if (!temp[i].Equals(0xAD))
continue;
supBuff = new byte[count - i];
Array.Copy(temp, i, supBuff, 0, count - i);
//log.Info(string.Format("start without AB receive after filter:{0}", HexBuff(supBuff)));
break;
}
}
dic.TryAdd(client.IP, supBuff);
}
else
{
log.Debug(client.IP + " 解码内容:" + HexBuff(buff));
log.Debug("Receive[" + client.IP + "] " + node.StatetText());
int idx = client.nodeName.FindIndex(s => s == node.Name);
if (idx == -1) client.nodeName.Add(node.Name);
UpdateNode(node);
byte[] tmp = new byte[count];
Array.Copy(temp, 0, tmp, 0, count);
byte[] curBuff = supBuff.Concat(tmp).ToArray();
dic.TryUpdate(client.IP, curBuff, supBuff);
supBuff = curBuff;
//log.Info(string.Format("receive:{0}",HexBuff(tmp)));
//log.Info(string.Format("buff:{0}",HexBuff(supBuff)));
//log.Info(string.Format("curBuf:{0}",HexBuff(curBuff)));
//log.Info(string.Format("dic[0]:{0}", HexBuff(dic[client.IP])));
}
List<byte> buf = new List<byte>();
for (int i = 0; i < supBuff.Length; i++)
{
if (supBuff[i].Equals(0XAD))
{
if (buf.Count > 0)
buf.Clear();
buf.Add(supBuff[i]);
}
else if (supBuff[i].Equals(0XDA))
{
buf.Add(supBuff[i]);
byte[] buff = buf.ToArray();
//Array.Copy(temp, 0, buff, 0, count);
ClientNode node = Decode(client, buff);
if (node == null)
{
log.Debug(client.IP + " 解码失败:" + HexBuff(buff));
}
else
{
log.Debug("Receive[" + client.IP + "]:[" + HexBuff(buff) + "],解码内容:" + node.StatetText());
int idx = client.nodeName.FindIndex(s => s == node.Name);
if (idx == -1) client.nodeName.Add(node.Name);
UpdateNode(node);
}
if (buf.Count > 0)
buf.Clear();
}
else
{
buf.Add(supBuff[i]);
}
}
if (buf.Count > 0)//存在部分包
{
dic.TryUpdate(client.IP, buf.ToArray(), supBuff);
}
else
dic.TryRemove(client.IP, out byte[] bb);
}
else
{
time += sleep;
if (time > sleep*1000*60*60*5)
if (time > 1000*60*60*1)
{
Offline(client);
log.Info("[" + client.IP + "] 超过5H没有收到数据,关闭连接");
log.Info("[" + client.IP + "] 超过1H没有收到数据,关闭连接");
}
}
}
......@@ -533,7 +578,7 @@ namespace DeviceLibrary
/// </summary>
/// <param ip="ip">ip地址</param>
/// <returns></returns>
private int FindClient(string ip)
private int FindClient(string nodename)
{
int index = -1;
if (_client == null) return index;
......@@ -545,7 +590,7 @@ namespace DeviceLibrary
if (item.IsConn)
{
//Common.log.Info("已连接客户端:" + string.Join("#", item.IP));
if (item.IP.Contains(ip))
if (item.nodeName.Contains(nodename))
{
index = _client.IndexOf(item);
break;
......
任务名称,任务别名,任务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
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
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,产线别名
A2,A2,127.0.0.1,料架存放线入口
A1,A1,127.0.0.1,料架存放线出口
D1,D1,127.0.0.1,云仓出料口1
D2,D2,127.0.0.1,云仓出料口2
D3,D3,127.0.0.1,云仓出料口3
A2,A2,172.74.200.80,料架存放线入口
A1,A1,172.74.200.80,料架存放线出口
D1,D1,172.74.200.80,云仓出料口1
D2,D2,172.74.200.80,云仓出料口2
D3,D3,172.74.200.80,云仓出料口3
SMT1,S1,,SMT1线
SMT2,S2,,SMT2线
SMT3,S3,,SMT3线
......
......@@ -149,7 +149,7 @@ namespace DeviceLibrary
//获取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);
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)
{
......@@ -215,7 +215,6 @@ namespace DeviceLibrary
return null;
if (job != null)
{
log.Debug(agv_Info.Name + " GetJob OK " + job.ToString());
return job;
}
}
......@@ -250,12 +249,6 @@ namespace DeviceLibrary
{
agv.CurJob = job;
}
//else
//{
// //if (agv.Battery < Common.chargeStatus.chargeMax)
// agv.CurJob = new ChargeJob(agv.Place);
//}
}
if (agv.CurJob != null)
......@@ -280,11 +273,7 @@ namespace DeviceLibrary
bool rtn = MiR_API.CheckIP(AGVManager.agvInfo[idx].IP);
if (rtn)
{
if (AGVManager.agvInfo[idx].IsCon)
{
log.Debug(AGVManager.agvInfo[idx].Name + " Online");
}
else
if (!AGVManager.agvInfo[idx].IsCon)
{
AGVManager.agvInfo[idx].IsCon = true;
log.Info(AGVManager.agvInfo[idx].Name + " Online");
......@@ -299,10 +288,6 @@ namespace DeviceLibrary
log.Info(AGVManager.agvInfo[idx].Name + " Offline");
AgvOnline?.Invoke(idx);
}
else
{
log.Debug(AGVManager.agvInfo[idx].Name + " Offline");
}
}
return rtn;
}
......
......@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......
......@@ -157,7 +157,7 @@ namespace DeviceLibrary
/// <returns></returns>
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);
}
/// <summary>
......
......@@ -144,7 +144,8 @@ namespace DeviceLibrary
/// 当前料架的工单信息
/// </summary>
public string BoxDestInfo { get; set; } = "";
public string IOInState { get; set; } = "";
public string IOOutState { get; set; } = "";
/// <summary>
/// 任务重发
/// </summary>
......@@ -190,6 +191,12 @@ namespace DeviceLibrary
MiR_API.Get_IO_Status(this, out bool[] input, out bool[] output);
if (input != null && input.Length == 4)
{
try
{
IOInState = string.Join(",", input.ToArray());
IOOutState = string.Join(",", output.ToArray());
}
catch { }
bool reachIoValue = input[3].Equals(true);
if (reachIoValue)
{
......
......@@ -74,6 +74,7 @@ namespace DeviceLibrary
JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
if (dic == null)
{
log.Error("URL: " + url + "\n" + "Return: " + json);
......@@ -95,7 +96,7 @@ namespace DeviceLibrary
{
input = null;
output = null;
//log.Error("Get_IO_Status", ex);
log.Error("Get_IO_Status", ex);
return false;
}
}
......@@ -669,7 +670,7 @@ namespace DeviceLibrary
string s = response.Content;
s = s.Replace("\n", "");
s = s.Replace(" ", "");
log.Debug("HttpGet URL: " + url + " Return: " + s);
log.Debug("HttpGet URL: " + url + " Return: " + s);
return s;
}
......@@ -707,7 +708,7 @@ namespace DeviceLibrary
string s = response.Content;
s = s.Replace("\n", "");
s = s.Replace(" ", "");
log.Debug(string.Format("HttpPut URL: {0}; Body: {1} Return: {2}", url, body, s));
log.Debug(string.Format("HttpPut URL: {0}; Body: {1} Return: {2}", url, body, s));
return s;
}
......@@ -723,7 +724,7 @@ namespace DeviceLibrary
request.AddParameter("application/json", "", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
string s = response.Content;
log.Debug("HttpDel URL: " + url);
log.Debug("HttpDel URL: " + url);
}
#endregion
}
......
......@@ -19,10 +19,11 @@ namespace DeviceLibrary
/// 载空料架返回任务
/// </summary>
/// <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;
EmptyShelfTargetPlace = emptyShelfTargetPlace;
}
/// <summary>
......@@ -156,7 +157,6 @@ namespace DeviceLibrary
CurTaskState = MissionSys.GetTakJobState(agv);
if (MissionSys.CheckTaskFinished(agv, SettingString.Leave, CurTaskState))
{
AGVManager.SetNodeOccupy(EmptyShelfTargetPlace,LineState.None);
agv.RFID = "";
Job job = AGVManager.control.GetJob(agv);
if (job != null)
......
......@@ -153,8 +153,8 @@ namespace DeviceLibrary
runInfo = "空料架在[" + EmptyShelfPlace + "]进入小车完成" + "[RFID=" + RFID + "]";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
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))
{
......
......@@ -11,17 +11,18 @@ namespace DeviceLibrary
/// </summary>
/// <param name="agvCurPlace">接到任务时,AGV的位置(空表示待机位)</param>
/// <param name="palce"></param>
public GoFullShelfStationJob(string palce,string agvCurPlace = SettingString.Standby)
public GoFullShelfStationJob(string palce, string agvCurPlace, string rfid)
{
FullShelfStationPlace = palce;
agvPlace = agvCurPlace;
RFID = rfid;
}
/// <summary>
/// 出满料位置点
/// </summary>
public string FullShelfStationPlace { get; set; }
public string RFID { get; set; }
/// <summary>
/// 接到任务时,AGV的位置
/// </summary>
......@@ -32,9 +33,9 @@ namespace DeviceLibrary
/// </summary>
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>
/// AGV上是否有负载
/// </summary>
......@@ -55,7 +56,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.CheckShelf);
UpdateJobTaskInfo(agv);
UpdateJobTaskInfo(agv);
}
else if (jobStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_CHECK_RESULT))
{
......@@ -79,7 +80,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv);
UpdateJobTaskInfo(agv);
}
}
......@@ -91,40 +92,37 @@ namespace DeviceLibrary
CurTaskState = MissionSys.GetTakJobState(agv);
if (MissionSys.CheckTaskFinished(agv, FullShelfStationPlace, CurTaskState))
{
//if (HttpManager.FindFullShelfTarget(node.RFID, out FullShelfDestInfo))
//{
// jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_DOUBLE_LINE_RESPONSE);
// if (FullShelfDestInfo != null)
// {
// AGVManager.GetLineNameByNodeName(FullShelfDestInfo.location, out string line);
// agv.BoxDestInfo = FullShelfDestInfo.ShowInfo(line);
// }
// runInfo = "AGV到达 " + FullShelfStationPlace + ",并发送出料架请求[ReadyLeave]";
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
// jobStep.Msg = msg;
// AGVManager.server.ReadyLeave(FullShelfStationPlace);
//}
//else
//{
// if (FullShelfDestInfo != null)
// {
// AGVManager.GetLineNameByNodeName(FullShelfDestInfo.location, out string line);
// runInfo = "AGV到达 " + FullShelfStationPlace + ",查询满料架目的地:" + FullShelfDestInfo.ShowInfo(line);
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo); ;
// jobStep.Msg = msg;
// }
// else
// {
// //[{"msg":"0料车已解绑或未发新料"}]
// jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_STANDBY);
// runInfo = "从产线" + agvPlace + "回到待机位";
// msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
// jobStep.Msg = msg;
// MissionSys.AssignMission(agv, SettingString.Standby);
// UpdateJobTaskInfo(agv);
// }
//}
if (HttpManager.FindFullShelfTarget(RFID, out FullShelfDestInfo))
{
if (FullShelfDestInfo != null && AGVManager.GetLineNameByNodeName(FullShelfDestInfo.data, out string line))
{
jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_DOUBLE_LINE_RESPONSE);
runInfo = "AGV到达 " + FullShelfStationPlace + ",并发送出料架请求[ReadyLeave]";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
AGVManager.server.ReadyLeave(FullShelfStationPlace);
}
else
{
jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_REACH_STANDBY);
runInfo = "从" + FullShelfStationPlace + "回到待机位,因不存在该节点" + FullShelfDestInfo.data;
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv);
}
}
else
{
noneTargetHandle = true;
jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT_DOUBLE_LINE_RESPONSE);
runInfo = "AGV到达 " + FullShelfStationPlace + ",并发送出料架请求[ReadyLeave][该料架无目的地]";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
AGVManager.server.ReadyLeave(FullShelfStationPlace);
}
}
......@@ -156,11 +154,11 @@ namespace DeviceLibrary
if (!agv.CurTarName.Equals("Enter"))
{
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);
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.Enter);
UpdateJobTaskInfo(agv);
MissionSys.AssignMission(agv, SettingString.Enter);
UpdateJobTaskInfo(agv);
}
}
......@@ -176,12 +174,25 @@ namespace DeviceLibrary
CurTaskState = MissionSys.GetTakJobState(agv);
if (MissionSys.CheckTaskFinished(agv, SettingString.Enter, CurTaskState))
{
HttpManager.AgvRemoveRfid(RFID);
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 + "满料架进入小车完成";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
return new SendFullShelfToLineJob(FullShelfDestInfo, RFID);
}
//GoFullShelfStationStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.END);
runInfo = FullShelfStationPlace + "满料架进入小车完成";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
return new SendFullShelfToLineJob(FullShelfDestInfo);
}
else if (jobStep.IsTimeOut(60000, out double timeOutValue))
{
......@@ -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;
}
......@@ -227,6 +259,10 @@ namespace DeviceLibrary
/// </summary>
WAIT_REACH_STANDBY,
/// <summary>
/// 无目的地,放到临时位置
/// </summary>
WAIT_REACH_TEMP_PLACE,
/// <summary>
/// 送上双层线
/// </summary>
END
......
......@@ -12,10 +12,10 @@ namespace DeviceLibrary
/// <param name="palce">产线名</param>
/// <param name="rfid">料架RFID</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;
RFID = boxDestInfo.id;
FullShelfPlace = boxDestInfo.data;
RFID =rfid;
BoxDestInfo = boxDestInfo;
IsIgnoreBigShelf = isIgNoreBigShelf;
}
......@@ -53,7 +53,6 @@ namespace DeviceLibrary
agv.RFID = RFID;
if (jobStep.IsStep(SEND_FULL_SHELF_STEP.NONE))
{
HttpManager.AgvRemoveRfid(RFID);
jobStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_AGV_REACH_LINE);
runInfo = "从云仓送往[" + FullShelfPlace + "]";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
......@@ -77,12 +76,13 @@ namespace DeviceLibrary
{
MiR_API.Get_IO_Status(agv, out bool[] input, out bool[] output);
System.Threading.Thread.Sleep(500);
if ((input != null && input[0]))
if ((input != null && (input[0]|| input[1])))
{
runInfo = "人员在" + FullShelfPlace + "卸料完成";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
return new EmptyShelfBackJob(FullShelfPlace, eShelfType.SmallShelf);
AGVManager.CheckBoxNeedShelfState(agv, out string nodeName);
return new EmptyShelfBackJob(FullShelfPlace, eShelfType.SmallShelf,nodeName);
}
}
......
......@@ -26,10 +26,10 @@ namespace DeviceLibrary
//查找料仓口是否需要料架
if (AGVManager.CheckBoxNeedShelfState(agv, out nodename))
{
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, "");
}
......
......@@ -24,8 +24,103 @@ namespace DeviceLibrary
if (!AGVManager.CheckAGVStatusNone(currentAgv))
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;
}
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
public string LineName { set; get; }
public ClientLevel ClientLevel { get; set; } = ClientLevel.Low;
/// <summary>
/// 节点状态(AGV占用情况)
/// </summary>
public LineState State = LineState.None;
public string AliceName { get; set; }
public string DestInfo { get; set; }
/// <summary>
/// 客户端节点
/// </summary>
......@@ -88,7 +85,7 @@ namespace DeviceLibrary
// if (Online)
// {
s[2] = nodeStatus.ToString();
s[3] = State.ToString();
s[3] = "None";
s[4] = RFID;
// s[5] = AgvName;
// }
......
......@@ -154,23 +154,7 @@ namespace DeviceLibrary
return idx;
}
/// <summary>
/// 设置节点的状态占用
/// </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();
//private static object checkLocObj = new object();
/// <summary>
/// 查看云仓需要料架的状况
/// </summary>
......@@ -180,14 +164,14 @@ namespace DeviceLibrary
{
nodeName = "";
if (Monitor.TryEnter(checkLocObj))
// if (Monitor.TryEnter(checkLocObj))
{
try
{
int tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D1 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse);
if (tarIdx > -1)
{
if (!CheckLineBusy(SettingString.D1))
if (CheckAgvEmptyJob(agv, SettingString.D1))
{
nodeName = SettingString.D1;
log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D1));
......@@ -198,7 +182,7 @@ namespace DeviceLibrary
tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D2 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse);
if (tarIdx > -1)
{
if (!CheckLineBusy(SettingString.D2))
if (CheckAgvEmptyJob(agv, SettingString.D2))
{
nodeName = SettingString.D2;
log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D2));
......@@ -208,7 +192,7 @@ namespace DeviceLibrary
tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.D3 && s.StateEquals(eNodeStatus.NeedEnter) && s.IsUse);
if (tarIdx > -1)
{
if (!CheckLineBusy(SettingString.D3))
if (CheckAgvEmptyJob(agv, SettingString.D3))
{
nodeName = SettingString.D3;
log.Debug(string.Format("{0} {1}需要料架", agv.Name, SettingString.D3));
......@@ -222,7 +206,7 @@ namespace DeviceLibrary
}
finally
{
Monitor.Exit(checkLocObj);
// Monitor.Exit(checkLocObj);
}
}
......@@ -230,16 +214,16 @@ namespace DeviceLibrary
}
/// <summary>
/// 检查云仓出料口是否被agv占用
/// 检查是否有AGV送空架子
/// </summary>
/// <param name="nodeName"></param>
/// <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));
if (i>-1 && nodeInfo[i].State.Equals(LineState.Busy))
return true;
return false;
int i = agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob is EmptyShelfBackJob &&
((EmptyShelfBackJob)s.CurJob).EmptyShelfTargetPlace.Equals(nodename));
if (i > -1) return false;
return true;
}
/// <summary>
/// 查看料架存放处是否可以放空料架
......@@ -248,7 +232,7 @@ namespace DeviceLibrary
/// <param name="node"></param>
public static bool CheckShelfStorageInState(Agv_Info agv)
{
int tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.A2
int tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.A2
&& (s.StateEquals(eNodeStatus.NeedEnter)) && s.IsUse);
if (tarIdx > -1)
{
......@@ -264,12 +248,12 @@ namespace DeviceLibrary
/// <param name="agv"></param>
/// <param name="nodeName"></param>
/// <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;
return true;
......@@ -285,8 +269,10 @@ namespace DeviceLibrary
public static bool CheckShelfStorageOutState(Agv_Info agv)
{
int tarIdx = nodeInfo.FindIndex(s => s.Name == SettingString.A1
&& (s.StateEquals(eNodeStatus.NeedEnter)) && s.IsUse);
if (tarIdx > -1)
&& (s.StateEquals(eNodeStatus.NeedLeave)) && s.IsUse);
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));
return true;
......
......@@ -9,156 +9,67 @@ namespace DeviceLibrary
public class HttpManager
{
private static log4net.ILog log = log4net.LogManager.GetLogger("HttpManager");
public static string A6_Target = "";
/// <summary>
/// 查找满料架目的地
/// </summary>
/// <param name="rfid"></param>
/// <param name="dest"></param>
/// <returns></returns>
public static bool FindFullShelfTarget(string rfid, out BoxDestInfo dest)
{
dest = null;
A6_Target = "";
try
{
if (rfid.Equals("") || rfid.Equals("00"))
return false;
string itsHttp = "http://ESMTCommonInterface/CommonService.asmx/VMIGetBoxDestInfo?boxRFID=";
string url = itsHttp + rfid;
var client = new RestClient(url) { Timeout = -1 };
var request = new RestRequest(Method.GET);
//request.AddHeader("Host", "10.85.17.233");
IRestResponse response = client.Execute(request);
string json = response.Content;
json = json.Replace("\r", "");
json = json.Replace("\n", "");
json = json.Replace(" ", "");
log.Debug("ITS URL: " + url + " Return: " + json);
if (string.IsNullOrWhiteSpace(json)) return false;
List<BoxDestInfo> res = JsonHelper.DeserializeJsonToList<BoxDestInfo>(json);
//JavaScriptSerializer serializer = new JavaScriptSerializer();
if (res == null || res.Count == 0)
return false;
string tempLocation = res[0].location;
if (res[0].id == rfid)
{
if (res[0].location.Equals("3DFeeder"))
{
tempLocation = "3DFeederIn";
}
else if (res[0].location.Equals("3CFeeder"))
{
tempLocation = "3CFeederIn";
}
if (AGVManager.GetNodeNameByLineName(tempLocation, out string loc))
{
int i = AGVManager.FindNode(loc);
if (i > -1)
{
#region 检查是否有空料架要出,有则先出空料架
//foreach (var item in Common.missionManager.missionList)
//{
// if (loc.Equals(item.NodeName))
// {
// Common.LogInfo("节点[" + loc + "]当前有空架任务,延迟A6出满料架任务[" + rfid + "]", false);
// return false;
// }
//}
//if (Common.nodeInfo[i].AgvName.Equals("").Equals(false))//有小车在目标任务点(限制4C车间),等待结束后再接任务
//{
// Common.LogInfo("节点[" + loc + "]当前有任务,延迟A6出满料架任务[" + rfid + "]", false);
// return false;
//}
//检查是否有车接到满料架任务,有则不再重复分配
//int id = Common.agvInfo.FindIndex(s => s.RFID == rfid);
//if (id > -1)
//{
// Common.LogInfo(Common.agvInfo[i].Name + " 正在执行满料架任务:目的地为 " + loc + " [产线名 " + res[0].location + "],不可重复分配小车");
// return false;
//}
#endregion
res[0].location = loc;
dest = res[0];
AGVManager.GetLineNameByNodeName(loc, out string line);
A6_Target = res[0].ShowInfo(line);
log.Debug("查找满料架任务[RFID=" + rfid + "]:目的地为 " + loc + " [产线名 " + line + "]");
return true;
}
else
{
log.Warn("节点[" + loc + "]不存在或者未开启调用");
return false;
}
}
}
//[{"msg":"0料车已解绑或未发新料"}]
A6_Target = json;
return false;
}
catch (Exception ex)
{
log.Error("FindA6Destination", ex);
return false;
}
}
public class BoxDestInfo
{
/// <summary>
/// RFID
/// </summary>
public string id { get; set; }
public int code { get; set; }
public string SO { get; set; }
public string location { get; set; }
public string msg { get; set; }
public string data { get; set; }
public string ShowInfo(string loc)
public override string ToString()
{
return string.Format("RFID={0},SO={1},location={2}[{3}]", id, SO, loc, location);
return string.Format("code:{0}, msg:{1}, data:{2}", code, msg, data);
}
}
private static string Addr_FindFullShelfTarget = "/rest/api/dcs/device/shelfDestination";
public static string GetRackBy(string rfid)
/// <summary>
/// 查找满料架目的地
/// </summary>
/// <param name="rfid"></param>
/// <param name="dest"></param>
/// <returns></returns>
public static bool FindFullShelfTarget(string rfid, out BoxDestInfo destInfo)
{
//GET /ESMTCommonInterface/CommonService.asmx/GetRackBy?id=string HTTP/1.1
//Host: 10.85.17.233
string addr = "http://10.85.71.25/ESMTCommonInterface/CommonService.asmx/GetRackBy?id=" + rfid;
//[{"msg":"1OKD1"}]
//[{"msg":"0NGFeeder"}]
destInfo = null;
try
{
string result = HttpHelper.Get(addr);
if (!result.Equals(""))
if (rfid.Equals("") || rfid.Equals("00"))
return false;
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("rfid", rfid);
string server = GetAddr(Addr_FindFullShelfTarget, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
destInfo = JsonHelper.DeserializeJsonToObject<BoxDestInfo>(resultStr);
log.Debug(string.Format("FindFullShelfTarget server:[{0}] return:[{1}]", server, resultStr));
if (destInfo == null)
{
List<Msg> msgs = JsonHelper.DeserializeJsonToList<Msg>(result);
if (msgs == null || msgs.Count == 0)
return "";
return result;
log.Error("查找目的地【" + server + "】【" + resultStr + "】");
return false;
}
else if (destInfo.code.Equals(0).Equals(true))
{
if (destInfo.data.ToLower().Equals("none"))
return false;
else
return true;
}
return false;
}
catch (Exception ex)
{
log.Error(ex.Message);
return "";
log.Error("FindFullShelfTarget", ex);
return false;
}
return "";
}
/// <summary>
/// 大料架接口回复
/// </summary>
public class Msg
{
public string msg { get; set; }
}
private static string Addr_updateDeviceAlarmMsg = "/rest/api/qisda/device/updateDeviceAlarmMsg";
/// <summary>
/// 异常看板
......@@ -178,7 +89,7 @@ namespace DeviceLibrary
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
msgList.ForEach(new Action<AlarmMsg>(k=>log.Debug("deviceAlarmList " + k.ToString())));
log.Debug(string.Format("updateDeviceAlarmMsg server:[{0}] return:[{1}]", server,resultStr));
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
if (data == null)
......@@ -214,91 +125,7 @@ namespace DeviceLibrary
return path;
}
/// <summary>
/// 获取接驳台料架情况
/// </summary>
/// <param name="lineName"></param>
/// <returns></returns>
//public static string GetRFIDs(string lineName)
//{
// string addr = "";
// if (lineName.StartsWith(SettingString.Line_Name_Prefix))
// {
// addr = string.Format("http://{0}/LineGetRFID?line={1}", AppConfigHelper.GetValue(SettingString.IP_3D_Light), lineName);
// }
// //else if (lineName.StartsWith(SettingString.RoomC_Name_Prefix))
// //{
// // addr = string.Format("http://{0}/LineGetRFID?line={1}", AppConfigHelper.GetValue(SettingString.IP_3C_Light), lineName);
// //}
// try
// {
// string result = HttpHelper.Get(addr);
// if (!result.Equals(""))
// {
// Msg1 msgs = JsonHelper.DeserializeJsonToObject<Msg1>(result);
// if (msgs == null)
// return ",,,";
// else
// {
// log.Debug(string.Format("{0}接驳台状态:{1}", lineName, msgs.Msg));
// return msgs.Msg;
// }
// }
// }
// catch (Exception ex)
// {
// log.Error(ex.Message);
// return ",,,";
// }
// return ",,,";
//}
/// <summary>
/// 删除接驳台料架
/// </summary>
/// <param name="lineName"></param>
/// <param name="rfid"></param>
/// <returns></returns>
//public static bool ClearRFID(string nodeName, string rfid)
//{
// string addr = "";
// string lineName = "";
// if (nodeName.StartsWith(SettingString.RoomS_Name_Prefix) && AGVManager.GetLineNameByNodeName(nodeName, out lineName))
// {
// addr = string.Format("http://{0}/LineClearRFID?line={1}&rfid={2}", AppConfigHelper.GetValue(SettingString.IP_3D_Light), lineName, rfid);
// }
// else if (nodeName.StartsWith(SettingString.RoomC_Name_Prefix) && AGVManager.GetLineNameByNodeName(nodeName, out lineName))
// {
// addr = string.Format("http://{0}/LineClearRFID?line={1}&rfid={2}", AppConfigHelper.GetValue(SettingString.IP_3C_Light), lineName, rfid);
// }
// try
// {
// string result = HttpHelper.Get(addr);
// if (!result.Equals(""))
// {
// Msg1 msgs = JsonHelper.DeserializeJsonToObject<Msg1>(result);
// if (msgs == null)
// return false;
// else
// {
// log.Info(string.Format("删除{0}接驳台料架{1}:{2}", lineName, rfid, msgs.Msg));
// return true;
// }
// }
// }
// catch (Exception ex)
// {
// log.Error(ex.Message);
// return false;
// }
// return false;
//}
private static string Addr_agvRemoveRfid = "/rest/api/qisda/device/agvRemoveRfid";
private static string Addr_agvRemoveRfid = "/rest/api/dcs/device/agvRemoveRfid";
/// <summary>
/// 根据RFID清理料架的缓存信息
/// </summary>
......
......@@ -4,21 +4,21 @@
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
<appSettings>
<add key="Port_AGV_Server" value="9501"/>
<add key="http.server" value="http://10.85.162.124/myproject/"/>
<add key="FLEET" value="10.85.19.3"/>
<add key="UseFleet" value="False"/>
<add key="http.server" value="http://172.74.200.81/smdbox/"/>
<add key="FLEET" value="172.74.200.82"/>
<add key="UseFleet" value="True"/>
<add key="ChargeThreshold" value="20,90"/>
</appSettings>
<log4net>
<appender name="AgvServer" type="log4net.Appender.RollingFileAppender">
<file value="logs/AgvServer.log"/>
<file value="logs/AgvServer/AgvServer.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/>
<param name="MaxSizeRollBackups" value="10"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
......@@ -26,10 +26,10 @@
</layout>
</appender>
<appender name="HttpManager" type="log4net.Appender.RollingFileAppender">
<file value="logs/HttpManager.log"/>
<file value="logs/HttpManager/HttpManager.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/>
<param name="MaxSizeRollBackups" value="10"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
......@@ -37,7 +37,7 @@
</layout>
</appender>
<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"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
......@@ -46,11 +46,11 @@
<conversionPattern value="[%date][%t][%c:%L]%-5p %m%n"/>
</layout>
</appender>
<appender name="LineWebService" type="log4net.Appender.RollingFileAppender">
<file value="logs/UnlockInfo.log"/>
<appender name="MiR_API" type="log4net.Appender.RollingFileAppender">
<file value="logs/MiR_API/MiR_API.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/>
<param name="MaxSizeRollBackups" value="10"/>
<!-- 切割最多文件数 -->
<param name="MaximumFileSize" value="50MB"/>
<!-- 每个文件的大小 -->
......@@ -60,9 +60,9 @@
<conversionPattern value="[%date]%-5p %m%n"/>
</layout>
</appender>
<logger name="LineWebService">
<logger name="MiR_API">
<level value="Info"/>
<appender-ref ref="LineWebService"/>
<appender-ref ref="MiR_API"/>
</logger>
<logger name="AgvServer">
<level value="Info"/>
......
......@@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.tabControl1 = new System.Windows.Forms.TabControl();
......@@ -36,32 +37,32 @@
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.lblWO = new System.Windows.Forms.Label();
this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel();
this.lblWarn = new System.Windows.Forms.Label();
this.lblD1 = new System.Windows.Forms.Label();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.lblD2 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.lblD3 = new System.Windows.Forms.Label();
this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.lblCharge2 = new System.Windows.Forms.Label();
this.lblCharge1 = new System.Windows.Forms.Label();
this.lblWarn = new System.Windows.Forms.Label();
this.DgvNode = new System.Windows.Forms.DataGridView();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column16 = new System.Windows.Forms.DataGridViewButtonColumn();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.txtBoxLineName = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnAgvRemoveRfid = new System.Windows.Forms.Button();
this.label7 = new System.Windows.Forms.Label();
this.txtBoxRFID = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tabControlManual = new System.Windows.Forms.TabControl();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column16 = new System.Windows.Forms.DataGridViewButtonColumn();
this.tableLayoutPanel3.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
......@@ -69,9 +70,9 @@
this.groupBox1.SuspendLayout();
this.tableLayoutPanel5.SuspendLayout();
this.groupBox3.SuspendLayout();
this.tableLayoutPanel7.SuspendLayout();
this.groupBox5.SuspendLayout();
this.groupBox6.SuspendLayout();
this.tableLayoutPanel6.SuspendLayout();
this.groupBox8.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DgvNode)).BeginInit();
this.tabPage3.SuspendLayout();
this.groupBox4.SuspendLayout();
......@@ -93,7 +94,7 @@
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 48.43538F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 51.56462F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(1215, 735);
this.tableLayoutPanel3.Size = new System.Drawing.Size(1440, 735);
this.tableLayoutPanel3.TabIndex = 7;
//
// tabControl1
......@@ -104,7 +105,7 @@
this.tabControl1.Location = new System.Drawing.Point(3, 359);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1209, 373);
this.tabControl1.Size = new System.Drawing.Size(1434, 373);
this.tabControl1.TabIndex = 7;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
......@@ -114,7 +115,7 @@
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1201, 347);
this.tabPage1.Size = new System.Drawing.Size(1426, 347);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "节点状态&产线任务";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -122,8 +123,8 @@
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 56.39743F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 43.60257F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 49.64789F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.35211F));
this.tableLayoutPanel2.Controls.Add(this.groupBox1, 1, 0);
this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel6, 0, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
......@@ -132,7 +133,7 @@
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(1195, 341);
this.tableLayoutPanel2.Size = new System.Drawing.Size(1420, 341);
this.tableLayoutPanel2.TabIndex = 34;
//
// groupBox1
......@@ -140,11 +141,11 @@
this.groupBox1.Controls.Add(this.tableLayoutPanel5);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(675, 2);
this.groupBox1.Location = new System.Drawing.Point(707, 2);
this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
this.groupBox1.Size = new System.Drawing.Size(518, 337);
this.groupBox1.Size = new System.Drawing.Size(711, 337);
this.groupBox1.TabIndex = 33;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "任务信息";
......@@ -154,118 +155,115 @@
this.tableLayoutPanel5.ColumnCount = 1;
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel5.Controls.Add(this.groupBox3, 0, 0);
this.tableLayoutPanel5.Controls.Add(this.tableLayoutPanel7, 0, 1);
this.tableLayoutPanel5.Controls.Add(this.groupBox5, 0, 1);
this.tableLayoutPanel5.Controls.Add(this.groupBox6, 0, 2);
this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel5.Location = new System.Drawing.Point(2, 19);
this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
this.tableLayoutPanel5.RowCount = 2;
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel5.RowCount = 3;
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(514, 316);
this.tableLayoutPanel5.Size = new System.Drawing.Size(707, 316);
this.tableLayoutPanel5.TabIndex = 2;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.lblWO);
this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox3.Controls.Add(this.lblD1);
this.groupBox3.Location = new System.Drawing.Point(2, 2);
this.groupBox3.Margin = new System.Windows.Forms.Padding(2);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(2);
this.groupBox3.Size = new System.Drawing.Size(510, 154);
this.groupBox3.Size = new System.Drawing.Size(703, 101);
this.groupBox3.TabIndex = 0;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "云仓出料信息";
//
// lblWO
//
this.lblWO.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWO.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWO.Location = new System.Drawing.Point(2, 19);
this.lblWO.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblWO.Name = "lblWO";
this.lblWO.Size = new System.Drawing.Size(506, 133);
this.lblWO.TabIndex = 40;
this.lblWO.Text = "lblWO";
//
// tableLayoutPanel7
//
this.tableLayoutPanel7.ColumnCount = 1;
this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel7.Controls.Add(this.lblWarn, 0, 0);
this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel7.Location = new System.Drawing.Point(2, 160);
this.tableLayoutPanel7.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel7.Name = "tableLayoutPanel7";
this.tableLayoutPanel7.RowCount = 1;
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel7.Size = new System.Drawing.Size(510, 154);
this.tableLayoutPanel7.TabIndex = 3;
//
// lblWarn
//
this.lblWarn.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWarn.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarn.ForeColor = System.Drawing.Color.Red;
this.lblWarn.Location = new System.Drawing.Point(2, 0);
this.lblWarn.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblWarn.Name = "lblWarn";
this.lblWarn.Size = new System.Drawing.Size(506, 154);
this.lblWarn.TabIndex = 41;
this.lblWarn.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.groupBox3.Text = "D1口出料信息";
//
// lblD1
//
this.lblD1.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblD1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblD1.Location = new System.Drawing.Point(2, 19);
this.lblD1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblD1.Name = "lblD1";
this.lblD1.Size = new System.Drawing.Size(699, 80);
this.lblD1.TabIndex = 40;
this.lblD1.Text = "D1";
this.lblD1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// groupBox5
//
this.groupBox5.Controls.Add(this.lblD2);
this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox5.Location = new System.Drawing.Point(3, 108);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(701, 99);
this.groupBox5.TabIndex = 43;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "D2口出料信息";
//
// lblD2
//
this.lblD2.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblD2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblD2.Location = new System.Drawing.Point(3, 20);
this.lblD2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblD2.Name = "lblD2";
this.lblD2.Size = new System.Drawing.Size(695, 76);
this.lblD2.TabIndex = 42;
this.lblD2.Text = "D2";
this.lblD2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// groupBox6
//
this.groupBox6.Controls.Add(this.lblD3);
this.groupBox6.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox6.Location = new System.Drawing.Point(3, 213);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(701, 100);
this.groupBox6.TabIndex = 44;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "D3口出料信息";
//
// lblD3
//
this.lblD3.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblD3.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblD3.Location = new System.Drawing.Point(3, 20);
this.lblD3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblD3.Name = "lblD3";
this.lblD3.Size = new System.Drawing.Size(695, 77);
this.lblD3.TabIndex = 43;
this.lblD3.Text = "D3";
this.lblD3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tableLayoutPanel6
//
this.tableLayoutPanel6.ColumnCount = 1;
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel6.Controls.Add(this.groupBox8, 0, 1);
this.tableLayoutPanel6.Controls.Add(this.lblWarn, 0, 1);
this.tableLayoutPanel6.Controls.Add(this.DgvNode, 0, 0);
this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 2;
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 52.08333F));
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 47.91667F));
this.tableLayoutPanel6.Size = new System.Drawing.Size(667, 335);
this.tableLayoutPanel6.Size = new System.Drawing.Size(699, 335);
this.tableLayoutPanel6.TabIndex = 34;
//
// groupBox8
//
this.groupBox8.Controls.Add(this.lblCharge2);
this.groupBox8.Controls.Add(this.lblCharge1);
this.groupBox8.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox8.Location = new System.Drawing.Point(2, 176);
this.groupBox8.Margin = new System.Windows.Forms.Padding(2);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Padding = new System.Windows.Forms.Padding(2);
this.groupBox8.Size = new System.Drawing.Size(200, 53);
this.groupBox8.TabIndex = 7;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "位置占用情况";
//
// lblCharge2
//
this.lblCharge2.AutoSize = true;
this.lblCharge2.Dock = System.Windows.Forms.DockStyle.Top;
this.lblCharge2.Location = new System.Drawing.Point(2, 28);
this.lblCharge2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblCharge2.Name = "lblCharge2";
this.lblCharge2.Size = new System.Drawing.Size(65, 12);
this.lblCharge2.TabIndex = 1;
this.lblCharge2.Text = "lblCharge2";
//
// lblCharge1
//
this.lblCharge1.AutoSize = true;
this.lblCharge1.Dock = System.Windows.Forms.DockStyle.Top;
this.lblCharge1.Location = new System.Drawing.Point(2, 16);
this.lblCharge1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblCharge1.Name = "lblCharge1";
this.lblCharge1.Size = new System.Drawing.Size(65, 12);
this.lblCharge1.TabIndex = 0;
this.lblCharge1.Text = "lblCharge1";
// lblWarn
//
this.lblWarn.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblWarn.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarn.ForeColor = System.Drawing.Color.Red;
this.lblWarn.Location = new System.Drawing.Point(2, 174);
this.lblWarn.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblWarn.Name = "lblWarn";
this.lblWarn.Size = new System.Drawing.Size(695, 161);
this.lblWarn.TabIndex = 42;
this.lblWarn.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// DgvNode
//
......@@ -275,6 +273,14 @@
this.DgvNode.AllowUserToResizeRows = false;
this.DgvNode.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.DgvNode.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.DgvNode.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.DgvNode.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DgvNode.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column6,
......@@ -292,10 +298,71 @@
this.DgvNode.RowHeadersVisible = false;
this.DgvNode.RowHeadersWidth = 50;
this.DgvNode.RowTemplate.Height = 23;
this.DgvNode.Size = new System.Drawing.Size(661, 168);
this.DgvNode.Size = new System.Drawing.Size(693, 168);
this.DgvNode.TabIndex = 2;
this.DgvNode.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvNode_CellClick);
//
// Column6
//
this.Column6.FillWeight = 106.0331F;
this.Column6.HeaderText = "地点";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column12
//
this.Column12.FillWeight = 106.0331F;
this.Column12.HeaderText = "IP";
this.Column12.MinimumWidth = 6;
this.Column12.Name = "Column12";
this.Column12.ReadOnly = true;
this.Column12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column7
//
this.Column7.FillWeight = 106.0331F;
this.Column7.HeaderText = "动作";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column10
//
this.Column10.FillWeight = 56.23853F;
this.Column10.HeaderText = "状态";
this.Column10.MinimumWidth = 6;
this.Column10.Name = "Column10";
this.Column10.ReadOnly = true;
//
// Column9
//
this.Column9.FillWeight = 106.0331F;
this.Column9.HeaderText = "RFID";
this.Column9.MinimumWidth = 6;
this.Column9.Name = "Column9";
this.Column9.ReadOnly = true;
this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column5
//
this.Column5.FillWeight = 106.0331F;
this.Column5.HeaderText = "连接";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column16
//
this.Column16.FillWeight = 106.0331F;
this.Column16.HeaderText = "调用";
this.Column16.MinimumWidth = 6;
this.Column16.Name = "Column16";
this.Column16.ReadOnly = true;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.richTextBox1);
......@@ -304,7 +371,7 @@
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(1201, 347);
this.tabPage3.Size = new System.Drawing.Size(1426, 347);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "手动";
this.tabPage3.UseVisualStyleBackColor = true;
......@@ -314,47 +381,47 @@
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(3, 3);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(544, 341);
this.richTextBox1.Size = new System.Drawing.Size(795, 341);
this.richTextBox1.TabIndex = 39;
this.richTextBox1.Text = "";
//
// groupBox4
//
this.groupBox4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.groupBox4.Controls.Add(this.txtBoxLineName);
this.groupBox4.Controls.Add(this.label8);
this.groupBox4.Controls.Add(this.label1);
this.groupBox4.Controls.Add(this.btnAgvRemoveRfid);
this.groupBox4.Controls.Add(this.label7);
this.groupBox4.Controls.Add(this.txtBoxRFID);
this.groupBox4.Dock = System.Windows.Forms.DockStyle.Right;
this.groupBox4.Location = new System.Drawing.Point(547, 3);
this.groupBox4.Location = new System.Drawing.Point(798, 3);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(250, 341);
this.groupBox4.Size = new System.Drawing.Size(224, 341);
this.groupBox4.TabIndex = 38;
this.groupBox4.TabStop = false;
this.groupBox4.Text = " ";
//
// txtBoxLineName
// label1
//
this.txtBoxLineName.Location = new System.Drawing.Point(111, 54);
this.txtBoxLineName.Margin = new System.Windows.Forms.Padding(2);
this.txtBoxLineName.Name = "txtBoxLineName";
this.txtBoxLineName.Size = new System.Drawing.Size(111, 21);
this.txtBoxLineName.TabIndex = 44;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(26, 170);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(0, 12);
this.label1.TabIndex = 46;
//
// label8
// btnAgvRemoveRfid
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(60, 63);
this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(47, 12);
this.label8.TabIndex = 43;
this.label8.Text = "产线名:";
this.btnAgvRemoveRfid.Location = new System.Drawing.Point(51, 86);
this.btnAgvRemoveRfid.Name = "btnAgvRemoveRfid";
this.btnAgvRemoveRfid.Size = new System.Drawing.Size(130, 50);
this.btnAgvRemoveRfid.TabIndex = 45;
this.btnAgvRemoveRfid.Text = "清理料架的缓存信息";
this.btnAgvRemoveRfid.UseVisualStyleBackColor = true;
this.btnAgvRemoveRfid.Click += new System.EventHandler(this.btnAgvRemoveRfid_Click);
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(62, 31);
this.label7.Location = new System.Drawing.Point(33, 42);
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(35, 12);
......@@ -363,7 +430,7 @@
//
// txtBoxRFID
//
this.txtBoxRFID.Location = new System.Drawing.Point(111, 23);
this.txtBoxRFID.Location = new System.Drawing.Point(82, 34);
this.txtBoxRFID.Margin = new System.Windows.Forms.Padding(2);
this.txtBoxRFID.Name = "txtBoxRFID";
this.txtBoxRFID.Size = new System.Drawing.Size(111, 21);
......@@ -374,7 +441,7 @@
this.groupBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.groupBox2.Controls.Add(this.tabControlManual);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Right;
this.groupBox2.Location = new System.Drawing.Point(797, 3);
this.groupBox2.Location = new System.Drawing.Point(1022, 3);
this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
......@@ -404,7 +471,7 @@
this.tableLayoutPanel4.RowCount = 1;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 352F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(1211, 352);
this.tableLayoutPanel4.Size = new System.Drawing.Size(1436, 352);
this.tableLayoutPanel4.TabIndex = 8;
//
// flowLayoutPanel1
......@@ -412,75 +479,14 @@
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1205, 346);
this.flowLayoutPanel1.Size = new System.Drawing.Size(1430, 346);
this.flowLayoutPanel1.TabIndex = 0;
//
// Column6
//
this.Column6.FillWeight = 106.0331F;
this.Column6.HeaderText = "地点";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column12
//
this.Column12.FillWeight = 106.0331F;
this.Column12.HeaderText = "IP";
this.Column12.MinimumWidth = 6;
this.Column12.Name = "Column12";
this.Column12.ReadOnly = true;
this.Column12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column7
//
this.Column7.FillWeight = 106.0331F;
this.Column7.HeaderText = "动作";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column10
//
this.Column10.FillWeight = 56.23853F;
this.Column10.HeaderText = "状态";
this.Column10.MinimumWidth = 6;
this.Column10.Name = "Column10";
this.Column10.ReadOnly = true;
//
// Column9
//
this.Column9.FillWeight = 106.0331F;
this.Column9.HeaderText = "RFID";
this.Column9.MinimumWidth = 6;
this.Column9.Name = "Column9";
this.Column9.ReadOnly = true;
this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column5
//
this.Column5.FillWeight = 106.0331F;
this.Column5.HeaderText = "连接";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column16
//
this.Column16.FillWeight = 106.0331F;
this.Column16.HeaderText = "调用";
this.Column16.MinimumWidth = 6;
this.Column16.Name = "Column16";
this.Column16.ReadOnly = true;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1215, 735);
this.ClientSize = new System.Drawing.Size(1440, 735);
this.Controls.Add(this.tableLayoutPanel3);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmMain";
......@@ -494,10 +500,9 @@
this.groupBox1.ResumeLayout(false);
this.tableLayoutPanel5.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.tableLayoutPanel7.ResumeLayout(false);
this.groupBox5.ResumeLayout(false);
this.groupBox6.ResumeLayout(false);
this.tableLayoutPanel6.ResumeLayout(false);
this.groupBox8.ResumeLayout(false);
this.groupBox8.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.DgvNode)).EndInit();
this.tabPage3.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
......@@ -517,22 +522,15 @@
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.Label lblWO;
private System.Windows.Forms.Label lblD1;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private System.Windows.Forms.TextBox txtBoxRFID;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7;
private System.Windows.Forms.TextBox txtBoxLineName;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label lblWarn;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.TabControl tabControlManual;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6;
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.Label lblCharge2;
private System.Windows.Forms.Label lblCharge1;
private System.Windows.Forms.DataGridView DgvNode;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
......@@ -542,6 +540,13 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column9;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewButtonColumn Column16;
private System.Windows.Forms.Button btnAgvRemoveRfid;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblWarn;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Label lblD2;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.Label lblD3;
}
}
......@@ -12,6 +12,8 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Common;
using DeviceLibrary;
using static DeviceLibrary.HttpManager;
namespace AGVControl
{
public partial class FrmMain : Form
......@@ -26,7 +28,7 @@ namespace AGVControl
InitializeComponent();
showTimer = new System.Timers.Timer();
showTimer.Interval = 5000;
//showTimer.Enabled = true;
showTimer.Enabled = true;
showTimer.AutoReset = true;
showTimer.Elapsed += ShowTimer_Elapsed;
showTimer.Start();
......@@ -43,7 +45,7 @@ namespace AGVControl
if (input != null && input.Length == 4)
AGVManager.agvInfo[i].IsExistShelf = input[3];
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();
}
......@@ -64,8 +66,12 @@ namespace AGVControl
{
Invoke(new Action(() =>
{
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());
for (int i = 0; i < AGVManager.nodeInfo.Count; i++)
{
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();
}
......@@ -74,8 +80,11 @@ namespace AGVControl
{
Invoke(new Action(() =>
{
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = AGVManager.nodeInfo[nodeIndex].Online ? Color.Black : Color.Red;
DgvNode.Rows[nodeIndex].SetValues(AGVManager.nodeInfo[nodeIndex].ToRow());
// 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());
}
}));
System.GC.Collect();
}
......@@ -137,8 +146,8 @@ namespace AGVControl
AGVManager.WriteIni(item.Name, SettingString.RFID, item.RFID);
}
LogUtil.logBox = null;
//showTimer.Enabled = false;
showTimer.Stop();
//showTimer.Enabled = false;
showTimer.Stop();
AGVManager.server.NodeChanged -= Server_NodeChanged;
AGVManager.server.NodeOnline -= Server_NodeOnline;
}
......@@ -161,24 +170,111 @@ namespace AGVControl
bool InShhow = false;
Dictionary<string, string> destInfoMap = new Dictionary<string, string>();
private void ShowTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
//ShowEmptyTask();
if (InShhow)
return;
InShhow = true;
BoxDestInfo destInfo;
ClientNode node;
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();
//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;
}));
......@@ -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 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Manual));
this.panelInfo = new System.Windows.Forms.Panel();
this.lblInfo = new System.Windows.Forms.Label();
......@@ -42,6 +43,9 @@
this.grpBxMission = new System.Windows.Forms.GroupBox();
this.btnAssignTask = new System.Windows.Forms.Button();
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.grpBxRunMode.SuspendLayout();
this.grpBxOperation.SuspendLayout();
......@@ -72,6 +76,8 @@
//
// grpBxRunMode
//
this.grpBxRunMode.Controls.Add(this.label2);
this.grpBxRunMode.Controls.Add(this.label1);
this.grpBxRunMode.Controls.Add(this.chkBxAuto);
this.grpBxRunMode.Controls.Add(this.btnReSendTask);
this.grpBxRunMode.Dock = System.Windows.Forms.DockStyle.Top;
......@@ -96,7 +102,7 @@
//
// 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.Size = new System.Drawing.Size(75, 53);
this.btnReSendTask.TabIndex = 3;
......@@ -194,6 +200,30 @@
this.cmbBxMission.Size = new System.Drawing.Size(159, 20);
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
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -232,5 +262,8 @@
private System.Windows.Forms.GroupBox grpBxMission;
private System.Windows.Forms.Button btnAssignTask;
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
}
cmbBxMission.SelectedIndex = 0;
isIni = true;
timer1.Enabled = true;
}
private void chkBxAuto_CheckedChanged(object sender, EventArgs e)
......@@ -58,12 +59,14 @@ namespace AGVControl
if (Agv.IsExistShelf)
{
LogUtil.error(string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name));
MessageBox.Show(this,string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name));
chkBxAuto.Checked = false;
return;
}
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;
AGVManager.SetNodeOccupy(Agv.Place, LineState.None);
if (Agv.Place.Equals(SettingString.Standby) || Agv.Place.Equals(SettingString.AutoCharge))
Agv.Place = "";
MiR_API.Del_Mission(Agv);
......@@ -151,5 +154,13 @@ namespace AGVControl
{
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 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</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" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
......
......@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType>
<RootNamespace>SO827_AGV</RootNamespace>
<AssemblyName>SO827-AGV</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
......@@ -37,9 +37,6 @@
<ApplicationIcon>line.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="AsaPL.AgvClient">
<HintPath>..\AgvClient\bin\Debug\AsaPL.AgvClient.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>dll\log4net.dll</HintPath>
</Reference>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!