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";
......
任务名称,任务别名,任务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;
......
......@@ -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"/>
......
......@@ -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!