Commit 89128c67 顾剑亮

修改bug

1 个父辈 112cb683
...@@ -9,6 +9,7 @@ namespace BLL ...@@ -9,6 +9,7 @@ namespace BLL
private MoveJob move; private MoveJob move;
private string mission; private string mission;
private JobStep<ChargeStep> chargeStep; private JobStep<ChargeStep> chargeStep;
private IJob job;
private const int CHARGE_PLC = 20; private const int CHARGE_PLC = 20;
public ChargeJob() public ChargeJob()
...@@ -53,7 +54,6 @@ namespace BLL ...@@ -53,7 +54,6 @@ namespace BLL
} }
else if (chargeStep.Equals(ChargeStep.WaitWashPoint)) else if (chargeStep.Equals(ChargeStep.WaitWashPoint))
{ {
move.Execute(_info); move.Execute(_info);
if (move.IsEnd) if (move.IsEnd)
{ {
...@@ -63,14 +63,12 @@ namespace BLL ...@@ -63,14 +63,12 @@ namespace BLL
} }
else if (chargeStep.Equals(ChargeStep.MoveStation)) else if (chargeStep.Equals(ChargeStep.MoveStation))
{ {
move.Execute(_info); move.Execute(_info);
MoveStation(); MoveStation();
} }
else if (chargeStep.Equals(ChargeStep.Charging)) else if (chargeStep.Equals(ChargeStep.Charging))
{ {
//_info.LogJson.SetMissionStep("正在充电中", ChargeStep.Charging.ToString()); Common.log.Info(string.Format("{0} 充电中 当前{1} 最小{2} 最大{3}", _info.Name, _info.Battery, _info.BatteryMin, _info.BatteryMax));
Common.log.Info(string.Format("充电中 当前{0} 最小{1} 最大{2}", _info.Battery, _info.BatteryMin, _info.BatteryMax));
move.Execute(_info); move.Execute(_info);
if (_info.Battery == _info.BatteryMax) if (_info.Battery == _info.BatteryMax)
...@@ -81,15 +79,23 @@ namespace BLL ...@@ -81,15 +79,23 @@ namespace BLL
} }
else if (_info.Battery > _info.BatteryMin) else if (_info.Battery > _info.BatteryMin)
{ {
IJob job = SteelManage.GetSteelJob(_info); job = SteelManage.GetSteelJob(_info);
if (job != null) if (job != null)
{ {
_info.LogJson.SetMissionStep("结束充电", ChargeStep.Charging.ToString()); _info.LogJson.SetMissionStep("结束充电", ChargeStep.Charging.ToString());
Common.mir.Del_Mission(_info.IP, _info.Authorization); Common.log.Info(_info.Name + " 结束充电,接收到任务" + job.ToString());
Common.log.Info("结束充电,接收到任务" + job.ToString()); move.DeleteTask(_info);
return job; chargeStep.NextStep(ChargeStep.DeleteTask);
}
} }
} }
else if (chargeStep.Equals(ChargeStep.DeleteTask))
{
move.Execute(_info);
if (move.IsEnd)
return job;
else
move.DeleteTask(_info); //没有成功删除时继续发删除
} }
else if (chargeStep.Equals(ChargeStep.End)) else if (chargeStep.Equals(ChargeStep.End))
{ {
...@@ -162,7 +168,8 @@ namespace BLL ...@@ -162,7 +168,8 @@ namespace BLL
MoveStation, MoveStation,
GoWashPoint, GoWashPoint,
WaitWashPoint, WaitWashPoint,
Charging Charging,
DeleteTask
} }
} }
......
...@@ -38,14 +38,18 @@ namespace BLL ...@@ -38,14 +38,18 @@ namespace BLL
else if (moveStep.Equals(MoveStep.Error)) else if (moveStep.Equals(MoveStep.Error))
Error(); Error();
else if (moveStep.Equals(MoveStep.End)) else if (moveStep.Equals(MoveStep.End))
{
IsEnd = true; IsEnd = true;
//_info.LogJson.SetTaskOver(); else if (moveStep.Equals(MoveStep.Delete))
} Delete();
return this; return this;
} }
public void DeleteTask(AgvInfo info)
{
Common.mir.Del_Mission(info.IP, info.Authorization);
moveStep.NextStep(MoveStep.Delete);
}
...@@ -74,8 +78,6 @@ namespace BLL ...@@ -74,8 +78,6 @@ namespace BLL
private void Working() private void Working()
{ {
//_info.LogJson.SetTaskInfo(_info.MissionText);
bool rtn; bool rtn;
string state; string state;
if (Common.FLEET_SEND) if (Common.FLEET_SEND)
...@@ -100,21 +102,46 @@ namespace BLL ...@@ -100,21 +102,46 @@ namespace BLL
private void Error() private void Error()
{ {
//_info.LogJson.SetTaskOver();
Common.log.Debug("MoveJob To:" + _info.Name + ", " + _mission + " 重新发送"); Common.log.Debug("MoveJob To:" + _info.Name + ", " + _mission + " 重新发送");
Common.mir.Clear_Error(_info.IP, _info.Authorization); Common.mir.Clear_Error(_info.IP, _info.Authorization);
System.Threading.Thread.Sleep(100); System.Threading.Thread.Sleep(200);
Common.mir.Del_Mission(_info.IP, _info.Authorization); Common.mir.Del_Mission(_info.IP, _info.Authorization);
moveStep.NextStep(MoveStep.Send); moveStep.NextStep(MoveStep.Send);
} }
private void Delete()
{
bool rtn;
string state;
if (Common.FLEET_SEND)
rtn = Common.mir.Get_MissionState_Fleet(_info.Authorization, _id, out state);
else
rtn = Common.mir.Get_MissionState(_info.IP, _info.Authorization, _id, out state);
if (rtn)
{
Common.log.Debug("MoveJob To:" + _info.Name + ", " + _mission + ", " + state.ToString());
if (state == MissionState.Aborted.ToString() || state == MissionState.Done.ToString())
{
IsEnd = true;
moveStep.NextStep(MoveStep.End);
}
}
else
{
Common.log.Warn("MoveJob To:" + _info.Name + ", " + _mission + " 获取状态失败");
//IsEnd = true;
//moveStep.NextStep(MoveStep.End);
}
}
private enum MoveStep private enum MoveStep
{ {
Send, Send,
Working, Working,
Error, Error,
End End,
Delete
} }
private enum MissionState private enum MissionState
......
...@@ -533,7 +533,8 @@ namespace BLL ...@@ -533,7 +533,8 @@ namespace BLL
public static bool IsAirLines(string place) public static bool IsAirLines(string place)
{ {
if (place == "C8" || place == "C9" || place == "C10") //4C风淋门里面的产线,C8,C9
if (place == "C8" || place == "C9")
return true; return true;
else else
return false; return false;
......
...@@ -35,8 +35,8 @@ C:\Neotel\Program\AGVControl_Steel\BLL\bin\Debug\RestSharp.dll ...@@ -35,8 +35,8 @@ C:\Neotel\Program\AGVControl_Steel\BLL\bin\Debug\RestSharp.dll
C:\Neotel\Program\AGVControl_Steel\BLL\bin\Debug\Model.pdb C:\Neotel\Program\AGVControl_Steel\BLL\bin\Debug\Model.pdb
C:\Neotel\Program\AGVControl_Steel\BLL\bin\Debug\log4net.xml C:\Neotel\Program\AGVControl_Steel\BLL\bin\Debug\log4net.xml
C:\Neotel\Program\AGVControl_Steel\BLL\bin\Debug\RestSharp.xml C:\Neotel\Program\AGVControl_Steel\BLL\bin\Debug\RestSharp.xml
C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.csprojAssemblyReference.cache
C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.csproj.CoreCompileInputs.cache C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.csproj.CoreCompileInputs.cache
C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.csproj.CopyComplete C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.csproj.CopyComplete
C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.dll C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.dll
C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.pdb C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.pdb
C:\Neotel\Program\AGVControl_Steel\BLL\obj\Debug\BLL.csproj.AssemblyReference.cache
...@@ -68,6 +68,7 @@ namespace Model ...@@ -68,6 +68,7 @@ namespace Model
/// 是否正在被调用 /// 是否正在被调用
/// </summary> /// </summary>
public bool IsCall { set; get; } = false; public bool IsCall { set; get; } = false;
/// <summary> /// <summary>
/// 当前的工作 /// 当前的工作
/// </summary> /// </summary>
......
...@@ -432,6 +432,7 @@ namespace Model ...@@ -432,6 +432,7 @@ namespace Model
{ {
string url = "http://" + ip + "/api/v2.0.0/mission_queue"; string url = "http://" + ip + "/api/v2.0.0/mission_queue";
HttpDel(url, ip, authorization); HttpDel(url, ip, authorization);
System.Threading.Thread.Sleep(1000);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
此文件类型无法预览
此文件类型无法预览
...@@ -50,7 +50,6 @@ C:\Neotel\Program\AGVControl_Steel\UI\bin\Debug\BLL.pdb ...@@ -50,7 +50,6 @@ C:\Neotel\Program\AGVControl_Steel\UI\bin\Debug\BLL.pdb
C:\Neotel\Program\AGVControl_Steel\UI\bin\Debug\Model.pdb C:\Neotel\Program\AGVControl_Steel\UI\bin\Debug\Model.pdb
C:\Neotel\Program\AGVControl_Steel\UI\bin\Debug\log4net.xml C:\Neotel\Program\AGVControl_Steel\UI\bin\Debug\log4net.xml
C:\Neotel\Program\AGVControl_Steel\UI\bin\Debug\RestSharp.xml C:\Neotel\Program\AGVControl_Steel\UI\bin\Debug\RestSharp.xml
C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\UI.csprojAssemblyReference.cache
C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.FrmMain.resources C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.FrmMain.resources
C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.Properties.Resources.resources C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.Properties.Resources.resources
C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\UI.csproj.GenerateResource.cache C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\UI.csproj.GenerateResource.cache
...@@ -58,3 +57,4 @@ C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\UI.csproj.CoreCompileInputs.cach ...@@ -58,3 +57,4 @@ C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\UI.csproj.CoreCompileInputs.cach
C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\UI.csproj.CopyComplete C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\UI.csproj.CopyComplete
C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.exe C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.exe
C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.pdb C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.pdb
C:\Neotel\Program\AGVControl_Steel\UI\obj\Debug\UI.csproj.AssemblyReference.cache
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!