Commit 2e45d045 张东亮

添加回收入库等待超时时间

1 个父辈 fd896a82
...@@ -17,6 +17,8 @@ namespace Common ...@@ -17,6 +17,8 @@ namespace Common
public const string DoorAirIn = "DoorAirIn"; public const string DoorAirIn = "DoorAirIn";
public const string DoorAirOut = "DoorAirOut"; public const string DoorAirOut = "DoorAirOut";
public const string AutoCharge = "AutoCharge"; public const string AutoCharge = "AutoCharge";
public const string PlaySound = "PlaySound";
public const string StopSound = "StopSound";
public const string Leave = "Leave"; public const string Leave = "Leave";
public const string Enter = "Enter"; public const string Enter = "Enter";
public const string Init = "Init"; public const string Init = "Init";
...@@ -36,13 +38,14 @@ namespace Common ...@@ -36,13 +38,14 @@ namespace Common
public const string FileName_Missions = "Missions.json"; public const string FileName_Missions = "Missions.json";
public const string IsUse = "IsUse"; public const string IsUse = "IsUse";
public const string RFID = "RFID"; public const string RFID = "RFID";
public const string Warehouse = "storage"; public const string Warehouse = "JIGStorage";
public const string Cancel = "Cancel"; public const string Cancel = "Cancel";
public const string C4_STANDBY1 = "C4_STANDBY1"; public const string C4_STANDBY1 = "C4_STANDBY1";
public const string C4_STANDBY2 = "C4_STANDBY2"; public const string C4_STANDBY2 = "C4_STANDBY2";
public const string ChargeThreshold = "ChargeThreshold"; public const string ChargeThreshold = "ChargeThreshold";
public const string WaitTimeout = "WaitTimeout";
public const string StandTimeout = "StandTimeout";
#region 配置名 #region 配置名
public const string ITS = "ITS"; public const string ITS = "ITS";
public const string httpServer ="http.server"; public const string httpServer ="http.server";
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<fixed>true</fixed> <fixed>true</fixed>
<!--固定充电桩为true,取第一个;false则判断所有agv.填写AGV编号--> <!--固定充电桩为true,取第一个;false则判断所有agv.填写AGV编号-->
<agvs> <agvs>
<agv>12</agv> <agv>49</agv>
</agvs> </agvs>
</pile> </pile>
</piles> </piles>
......
...@@ -227,7 +227,7 @@ namespace DeviceLibrary ...@@ -227,7 +227,7 @@ namespace DeviceLibrary
public List<string> RunInfos; public List<string> RunInfos;
DateTime IoStartTime = DateTime.MaxValue; DateTime IoStartTime = DateTime.MaxValue;
int IoLastTime = 5000; int IoLastTime = 5000;
int StandLastTimeMinute = 5; int StandLastTimeMinute = AppConfigHelper.GetIntValue(SettingString.StandTimeout);
public DateTime StandStartTime = DateTime.MaxValue; public DateTime StandStartTime = DateTime.MaxValue;
public bool SetState(eAGVState stateID, int battery, string missionText, MirPosition position) public bool SetState(eAGVState stateID, int battery, string missionText, MirPosition position)
{ {
...@@ -402,31 +402,40 @@ namespace DeviceLibrary ...@@ -402,31 +402,40 @@ namespace DeviceLibrary
/// <returns></returns> /// <returns></returns>
private void CheckStandTimeOut(MirPosition position) private void CheckStandTimeOut(MirPosition position)
{ {
if (IsUse && CurJob != null && (!this.Place.Type.Equals(NodeType.AutoCharge) || !this.Place.Type.Equals(NodeType.Standby))) if (this.Place.Type.Equals(NodeType.AutoCharge) || this.Place.Type.Equals(NodeType.Standby))
{ {
if (Math.Abs(position.Point.X - Position.Point.X) < 1 && Math.Abs(position.Point.Y - Position.Point.Y) < 1) StandTimeOut = false;
StandStartTime = DateTime.Now;
}
else
{
if (IsUse && CurJob != null)
{ {
//满足条件,计算持续时间 if (Math.Abs(position.Point.X - Position.Point.X) < 0.5 && Math.Abs(position.Point.Y - Position.Point.Y) < 0.5)
if (StandStartTime == DateTime.MaxValue)
{ {
//满足条件,计算持续时间
if (StandStartTime == DateTime.MaxValue)
{
StandStartTime = DateTime.Now;
}
TimeSpan lastTimeSpan = DateTime.Now - StandStartTime;
StandTimeOut = (lastTimeSpan.TotalMinutes >= StandLastTimeMinute);
}
else
{
//重新计时
StandStartTime = DateTime.Now; StandStartTime = DateTime.Now;
StandTimeOut = false;
} }
TimeSpan lastTimeSpan = DateTime.Now - StandStartTime;
StandTimeOut = (lastTimeSpan.TotalMinutes >= StandLastTimeMinute);
} }
else else
{ {
//重新计时
StandStartTime = DateTime.Now;
StandTimeOut = false; StandTimeOut = false;
StandStartTime = DateTime.Now;
} }
} }
else
{
StandTimeOut = false;
StandStartTime = DateTime.Now;
}
Position = position; Position = position;
} }
private void UpdateDisplayBoard() private void UpdateDisplayBoard()
...@@ -469,17 +478,13 @@ namespace DeviceLibrary ...@@ -469,17 +478,13 @@ namespace DeviceLibrary
AGVManager.ErrorLogRecord(new ErrorInfo(this)); AGVManager.ErrorLogRecord(new ErrorInfo(this));
ClearErrorMsg(); ClearErrorMsg();
} }
if (!Msg.Equals("")) if ((Place.Type.Equals(NodeType.Standby) || Place.Type.Equals(NodeType.AutoCharge)))
{ {
msglist.Add(new AlarmMsg(Name, "lineAgv." + Name + ".Msg", Msg, 1)); msglist.Add(new AlarmMsg(Name, "lineAgv." + Name + ".Place", Place.Type.ToString(), 1));
} }
else else
{ {
if ((Place.Type.Equals(NodeType.Standby) || Place.Type.Equals(NodeType.AutoCharge))) msglist.Add(new AlarmMsg(Name, "lineAgv." + Name + ".Msg", Msg, 1));
{
msglist.Add(new AlarmMsg(Name, "lineAgv." + Name + ".Place", Place.Type.ToString(), 1));
}
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -93,7 +93,7 @@ namespace DeviceLibrary.bean ...@@ -93,7 +93,7 @@ namespace DeviceLibrary.bean
{ {
if (Fixed) if (Fixed)
{ {
if (agv.Equals(Agvs[0])) if (agv.ID.Equals(Agvs[0]))
return true; return true;
else else
return false; return false;
......
...@@ -29,12 +29,12 @@ namespace DeviceLibrary.bean ...@@ -29,12 +29,12 @@ namespace DeviceLibrary.bean
/// </summary> /// </summary>
public Shelf Shelf { get; set; } public Shelf Shelf { get; set; }
public OpType OpType { get; set; } = OpType.ComToLine; public OpType OpType { get; set; } = OpType.ComToLine;
public JobParam(Node srcplace, Node tarplace =null,Shelf shelf=null) public JobParam(Node srcplace, Node tarplace =null,Shelf shelf=null, manager.MissionInfo FixMissionInfo =null)
{ {
SrcNode = srcplace; SrcNode = srcplace;
TargetNode = tarplace; TargetNode = tarplace;
Shelf = shelf; Shelf = shelf;
this.FixMissionInfo = FixMissionInfo;
} }
} }
/// <summary> /// <summary>
......
...@@ -54,11 +54,11 @@ namespace DeviceLibrary ...@@ -54,11 +54,11 @@ namespace DeviceLibrary
/// </summary> /// </summary>
/// <param name="timeOutMilliseconds"></param> /// <param name="timeOutMilliseconds"></param>
/// <returns></returns> /// <returns></returns>
public bool IsTimeOut(int timeOutMilliseconds,out TimeSpan timeOutValue) public bool IsTimeOut(int timeOutSeconds,out TimeSpan timeOutValue)
{ {
TimeSpan span = DateTime.Now - startTime; TimeSpan span = DateTime.Now - startTime;
timeOutValue = span; timeOutValue = span;
if (span.TotalMilliseconds > timeOutMilliseconds) if (span.TotalSeconds > timeOutSeconds)
{ {
return true; return true;
} }
......
...@@ -19,7 +19,7 @@ namespace DeviceLibrary ...@@ -19,7 +19,7 @@ namespace DeviceLibrary
/// <summary> /// <summary>
/// 空车返回任务 /// 空车返回任务
/// </summary> /// </summary>
public EmptyAGVBackJob(JobParam jobParam):base(jobParam) public EmptyAGVBackJob(JobParam jobParam) : base(jobParam)
{ {
JobName = "空车返回任务"; JobName = "空车返回任务";
} }
...@@ -33,15 +33,17 @@ namespace DeviceLibrary ...@@ -33,15 +33,17 @@ namespace DeviceLibrary
StartJobTime = JobRunStep.startTime; StartJobTime = JobRunStep.startTime;
if (JobRunStep.IsStep(RunStep.NONE)) if (JobRunStep.IsStep(RunStep.NONE))
{ {
return null; JobRunStep.ToNextStep(RunStep.END);
//{ AllocateTask(agv, SettingString.StopSound);
// JobRunStep.ToNextStep(RunStep.END);
//}
} }
else if(JobRunStep.IsStep(RunStep.END)) else if (JobRunStep.IsStep(RunStep.END))
{ {
JobRunStep.EndJob(); if (agv.TaskRunState.CheckTaskFinished(agv.Name))
return null; {
JobRunStep.EndJob();
return null;
}
} }
return this; return this;
} }
......
...@@ -105,7 +105,7 @@ namespace DeviceLibrary ...@@ -105,7 +105,7 @@ namespace DeviceLibrary
} }
} }
else if (JobRunStep.IsTimeOut(15000, out TimeSpan timeOutValue)) else if (JobRunStep.IsTimeOut(15, out TimeSpan timeOutValue))
{ {
tryTimes++; tryTimes++;
if (tryTimes < 3) if (tryTimes < 3)
...@@ -131,11 +131,11 @@ namespace DeviceLibrary ...@@ -131,11 +131,11 @@ namespace DeviceLibrary
AllocateTask(agv, SettingString.Init); AllocateTask(agv, SettingString.Init);
WarehouseSigManager.StopEnter = false; WarehouseSigManager.StopEnter = false;
} }
else if (JobRunStep.IsTimeOut(60000, out TimeSpan timeOutValue1)) else if (JobRunStep.IsTimeOut(120, out TimeSpan timeOutValue1))
{ {
runInfo = "治具在[" + JobParam.TargetNode + "]离开小车超时"; runInfo = "治具在[" + JobParam.TargetNode + "]离开小车超时";
agv.HasError = true; agv.HasError = true;
agv.SetErrorMsg("治具在[" + JobParam.TargetNode + "]进入小车超时", timeOutValue1.TotalMinutes.ToString("f2")); agv.SetErrorMsg("治具在[" + JobParam.TargetNode + "]离开小车超时", timeOutValue1.TotalMinutes.ToString("f2"));
} }
} }
...@@ -145,7 +145,7 @@ namespace DeviceLibrary ...@@ -145,7 +145,7 @@ namespace DeviceLibrary
{ {
//调宽 //调宽
JobRunStep.ToNextStep(RunStep.ADJUST_WIDTH); JobRunStep.ToNextStep(RunStep.ADJUST_WIDTH);
runInfo = JobParam.TargetNode + " 有出库任务,开始调宽"; runInfo = JobParam.TargetNode + " 有出库任务,开始调宽:"+ WarehouseSigManager.OutStore.Type;
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
AdjustWidth(agv, WarehouseSigManager.OutStore.Type); AdjustWidth(agv, WarehouseSigManager.OutStore.Type);
} }
...@@ -163,7 +163,7 @@ namespace DeviceLibrary ...@@ -163,7 +163,7 @@ namespace DeviceLibrary
if (agv.TaskRunState.CheckTaskFinished(agv.Name)) if (agv.TaskRunState.CheckTaskFinished(agv.Name))
{ {
JobRunStep.ToNextStep(RunStep.RECY_BACK_WAIT_RESPONSE); JobRunStep.ToNextStep(RunStep.RECY_BACK_WAIT_RESPONSE);
runInfo = $"调宽完成"; runInfo = $"{WarehouseSigManager.OutStore.Type}调宽完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
} }
} }
...@@ -186,7 +186,7 @@ namespace DeviceLibrary ...@@ -186,7 +186,7 @@ namespace DeviceLibrary
runInfo ="治具进入AGV完成"; runInfo ="治具进入AGV完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
} }
else if (JobRunStep.IsTimeOut(60000, out TimeSpan timeOutValue)) else if (JobRunStep.IsTimeOut(120, out TimeSpan timeOutValue))
{ {
//链条停止 //链条停止
runInfo = "治具在[" + JobParam.TargetNode.Name + "]进入小车超时"; runInfo = "治具在[" + JobParam.TargetNode.Name + "]进入小车超时";
......
...@@ -17,7 +17,7 @@ namespace DeviceLibrary ...@@ -17,7 +17,7 @@ namespace DeviceLibrary
{ {
JobName = "治具回收任务"; JobName = "治具回收任务";
} }
int WaitTimeOut = AppConfigHelper.GetIntValue(SettingString.WaitTimeout);
/// <summary> /// <summary>
/// 料架回收任务 /// 料架回收任务
/// </summary> /// </summary>
...@@ -252,13 +252,16 @@ namespace DeviceLibrary ...@@ -252,13 +252,16 @@ namespace DeviceLibrary
if (agv.TaskRunState.CheckAllocateOk()) if (agv.TaskRunState.CheckAllocateOk())
{ {
JobRunStep.ToNextStep(RunStep.RECY_TO_WAIT_REACH_PLACE); JobRunStep.ToNextStep(RunStep.RECY_TO_WAIT_REACH_PLACE);
WarehouseSigManager.TargetWithFix.CurPlace = JobParam.TargetNode.Name;
} }
} }
else if (JobRunStep.IsStep(RunStep.RECY_TO_WAIT_REACH_PLACE)) else if (JobRunStep.IsStep(RunStep.RECY_TO_WAIT_REACH_PLACE))
{ {
if (agv.TaskRunState.CheckTaskFinished(agv.Name)) if (agv.TaskRunState.CheckTaskFinished(agv.Name))
{ {
WarehouseSigManager.TargetWithFix.CurPlace = JobParam.TargetNode.Name; //设置音效类型并播放
SetPlcWithToInstore(agv);
AllocateTask(agv, SettingString.PlaySound);
if (JobParam.OpType.Equals(OpType.ComToLine)) if (JobParam.OpType.Equals(OpType.ComToLine))
{ {
JobRunStep.ToNextStep(RunStep.RECY_TO_WAIT_LINE_RESPONSE); JobRunStep.ToNextStep(RunStep.RECY_TO_WAIT_LINE_RESPONSE);
...@@ -290,7 +293,7 @@ namespace DeviceLibrary ...@@ -290,7 +293,7 @@ namespace DeviceLibrary
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; runInfo = "人员在" + JobParam.TargetNode + "操作完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy())); return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy(),JobParam.FixMissionInfo));
} }
} }
else if (JobParam.OpType.Equals(OpType.RequestAPI)) else if (JobParam.OpType.Equals(OpType.RequestAPI))
...@@ -302,16 +305,34 @@ namespace DeviceLibrary ...@@ -302,16 +305,34 @@ namespace DeviceLibrary
JobRunStep.ToNextStep(RunStep.END); JobRunStep.ToNextStep(RunStep.END);
runInfo = "到达" + JobParam.TargetNode + ",该任务被取消"; runInfo = "到达" + JobParam.TargetNode + ",该任务被取消";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
//关闭音效
CloseSound(agv);
AllocateTask(agv, SettingString.StopSound);
System.Threading.Thread.Sleep(5000);
} }
else else
{ {
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; runInfo = "人员在" + JobParam.TargetNode + "操作完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, NodeManager.GetNodeByName(target), JobParam.Shelf==null?null:JobParam.Shelf.ToCopy())); //关闭音效
CloseSound(agv);
AllocateTask(agv, SettingString.StopSound);
System.Threading.Thread.Sleep(5000);
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, NodeManager.GetNodeByName(target), JobParam.Shelf==null?null:JobParam.Shelf.ToCopy(), JobParam.FixMissionInfo));
} }
} }
else if(JobRunStep.IsTimeOut(WaitTimeOut*60,out TimeSpan timeSpan) && !agv.IsExistShelf)
{
JobRunStep.ToNextStep(RunStep.END);
runInfo = "到达" + JobParam.TargetNode + $",该任务超时{WaitTimeOut}分钟,自动取消";
JobRunStep.Msg = runInfo;
//关闭音效
CloseSound(agv);
AllocateTask(agv, SettingString.StopSound);
System.Threading.Thread.Sleep(5000);
}
} }
else if (JobParam.OpType.Equals(OpType.MaulAndAPI)) else if (JobParam.OpType.Equals(OpType.MaulAndAPI))
{ {
...@@ -320,7 +341,7 @@ namespace DeviceLibrary ...@@ -320,7 +341,7 @@ namespace DeviceLibrary
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; runInfo = "人员在" + JobParam.TargetNode + "操作完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy())); return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy(), JobParam.FixMissionInfo));
} }
} }
} }
...@@ -341,7 +362,7 @@ namespace DeviceLibrary ...@@ -341,7 +362,7 @@ namespace DeviceLibrary
AllocateTask(agv, SettingString.Enter); AllocateTask(agv, SettingString.Enter);
} }
else if (JobRunStep.IsTimeOut(15000, out TimeSpan timeOutValue)) else if (JobRunStep.IsTimeOut(15, out TimeSpan timeOutValue))
{ {
agv.HasError = true; agv.HasError = true;
agv.SetErrorMsg($"线体{JobParam.TargetNode}对出料请求无响应", timeOutValue.TotalMinutes.ToString("f2")); agv.SetErrorMsg($"线体{JobParam.TargetNode}对出料请求无响应", timeOutValue.TotalMinutes.ToString("f2"));
...@@ -356,7 +377,7 @@ namespace DeviceLibrary ...@@ -356,7 +377,7 @@ namespace DeviceLibrary
return new FixToInStoreJob(new JobParam(JobParam.TargetNode.ToCopy())); return new FixToInStoreJob(new JobParam(JobParam.TargetNode.ToCopy()));
} }
else if (JobRunStep.IsTimeOut(60000, out TimeSpan timeOutValue)) else if (JobRunStep.IsTimeOut(120, out TimeSpan timeOutValue))
{ {
//链条停止 //链条停止
runInfo = "空料架在[" + JobParam.TargetNode + "]进入小车超时"; runInfo = "空料架在[" + JobParam.TargetNode + "]进入小车超时";
......
...@@ -29,7 +29,7 @@ namespace DeviceLibrary ...@@ -29,7 +29,7 @@ namespace DeviceLibrary
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
AdjustWidth(agv, JobParam.FixMissionInfo.Type); AdjustWidth(agv, JobParam.FixMissionInfo.Type);
} }
else if(JobRunStep.IsStep(RunStep.ADJUST_WIDTH)) else if (JobRunStep.IsStep(RunStep.ADJUST_WIDTH))
{ {
if (agv.TaskRunState.CheckTaskFinished(agv.Name)) if (agv.TaskRunState.CheckTaskFinished(agv.Name))
{ {
...@@ -121,13 +121,6 @@ namespace DeviceLibrary ...@@ -121,13 +121,6 @@ namespace DeviceLibrary
} }
else if (JobRunStep.IsStep(RunStep.WAIT_DOUBLE_LINE_RESPONSE)) else if (JobRunStep.IsStep(RunStep.WAIT_DOUBLE_LINE_RESPONSE))
{ {
//Node node = NodeManager.GetNodeByName(JobParam.TargetNode.Name);
//if (node == null)
//{
// runInfo = "未找到节点:" + JobParam.TargetNode.Name;
// JobRunStep.Msg = runInfo;
// return this;
//}
if (WarehouseSigManager.MayLeave) if (WarehouseSigManager.MayLeave)
{ {
agv.HasError = false; agv.HasError = false;
...@@ -136,9 +129,19 @@ namespace DeviceLibrary ...@@ -136,9 +129,19 @@ namespace DeviceLibrary
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
AllocateTask(agv, SettingString.Enter); AllocateTask(agv, SettingString.Enter);
WarehouseSigManager.MayLeave = false; WarehouseSigManager.MayLeave = false;
} }
else if (JobRunStep.IsTimeOut(15000, out TimeSpan timeOutValue)) else if (OpManager.Info.GetTransfer(out string target))
{
if (target.Equals(SettingString.Cancel))
{
agv.HasError = false;
runInfo = $"收到离开信号,出库任务取消";
JobRunStep.Msg = runInfo;
JobRunStep.EndJob();
return null;
}
}
else if (JobRunStep.IsTimeOut(15, out TimeSpan timeOutValue))
{ {
//JobRunStep.ToNextStep(RunStep.WAIT_AGV_REACH_A6); //JobRunStep.ToNextStep(RunStep.WAIT_AGV_REACH_A6);
agv.HasError = true; agv.HasError = true;
...@@ -152,13 +155,13 @@ namespace DeviceLibrary ...@@ -152,13 +155,13 @@ namespace DeviceLibrary
if (agv.TaskRunState.CheckTaskFinished(agv.Name)) if (agv.TaskRunState.CheckTaskFinished(agv.Name))
{ {
agv.HasError = false; agv.HasError = false;
//GoFullShelfStationStep.ToNextStep(RunStep.END); JobRunStep.ToNextStep(RunStep.WAIT_LEAVE_SIG);
runInfo = JobParam.TargetNode.Name + "治具进入小车完成"; runInfo = JobParam.TargetNode.Name + "治具进入小车完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); //JobRunStep.EndJob();
return new SendFixToLineJob(new JobParam(JobParam.TargetNode.ToCopy()),true); // return new SendFixToLineJob(new JobParam(JobParam.TargetNode.ToCopy()),true);
} }
else if (JobRunStep.IsTimeOut(60000, out TimeSpan timeOutValue)) else if (JobRunStep.IsTimeOut(120, out TimeSpan timeOutValue))
{ {
//链条停止 //链条停止
runInfo = "治具在[" + JobParam.TargetNode.Name + "]进入小车超时"; runInfo = "治具在[" + JobParam.TargetNode.Name + "]进入小车超时";
...@@ -169,15 +172,16 @@ namespace DeviceLibrary ...@@ -169,15 +172,16 @@ namespace DeviceLibrary
} }
} }
else if(JobRunStep.IsStep(RunStep.WAIT_LEAVE_SIG)) else if (JobRunStep.IsStep(RunStep.WAIT_LEAVE_SIG))
{ {
if (OpManager.Info.GetTransfer(out string target)) if (OpManager.Info.GetTransfer(out string target))
{ {
if (!target.Equals(SettingString.Cancel)) if (!target.Equals(SettingString.Cancel))
{ {
agv.HasError = false; agv.HasError = false;
runInfo = $"收到离开信号,开始运送出库治具"; runInfo = $"收到离开信号,开始运送出库治具到" + target;
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob();
return new SendFixToLineJob(new JobParam(JobParam.TargetNode, NodeManager.GetNodeByName(target)), true); return new SendFixToLineJob(new JobParam(JobParam.TargetNode, NodeManager.GetNodeByName(target)), true);
} }
else else
...@@ -187,7 +191,7 @@ namespace DeviceLibrary ...@@ -187,7 +191,7 @@ namespace DeviceLibrary
} }
} }
} }
else if(JobRunStep.IsStep(RunStep.END)) else if (JobRunStep.IsStep(RunStep.END))
{ {
JobRunStep.EndJob(); JobRunStep.EndJob();
return null; return null;
......
...@@ -75,6 +75,42 @@ namespace DeviceLibrary ...@@ -75,6 +75,42 @@ namespace DeviceLibrary
AllocateTask(agv, SettingString.Adjust); AllocateTask(agv, SettingString.Adjust);
} }
/// <summary> /// <summary>
/// 设置PLC值
/// </summary>
/// <param name="agv"></param>
/// <param name="port"></param>
/// <param name="val"></param>
protected void SetPlc(Agv_Info agv,int port,int val)
{
int times = 0;
while (!MiR_API.Set_Register(agv, port, val))
{
if (times > 5)
break;
}
}
/// <summary>
/// 入库类型-1
/// </summary>
/// <param name="agv"></param>
protected void SetPlcWithToInstore(Agv_Info agv)
{
SetPlc(agv, 51, 1);
}
/// <summary>
/// 出库类型-2
/// </summary>
/// <param name="agv"></param>
protected void SetPlcWithToOutstore(Agv_Info agv)
{
SetPlc(agv, 51, 2);
}
protected void CloseSound(Agv_Info agv)
{
SetPlc(agv, 51, 0);
}
/// <summary>
/// 任务重发 /// 任务重发
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
......
...@@ -37,7 +37,7 @@ namespace DeviceLibrary ...@@ -37,7 +37,7 @@ namespace DeviceLibrary
else else
{ {
JobRunStep.ToNextStep(RunStep.SF_WAIT_AGV_REACH_LINE); JobRunStep.ToNextStep(RunStep.SF_WAIT_AGV_REACH_LINE);
runInfo = string.Format("前往{0},先过门", JobParam.TargetNode); runInfo = string.Format("前往{0}", JobParam.TargetNode);
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
AllocateTask(agv, JobParam.TargetNode.Name); AllocateTask(agv, JobParam.TargetNode.Name);
} }
...@@ -59,14 +59,14 @@ namespace DeviceLibrary ...@@ -59,14 +59,14 @@ namespace DeviceLibrary
if (JobParam.TargetNode.Area.Equals(Area.C) || JobParam.TargetNode.Area.Equals(Area.Air_C)) if (JobParam.TargetNode.Area.Equals(Area.C) || JobParam.TargetNode.Area.Equals(Area.Air_C))
{ {
JobRunStep.ToNextStep(RunStep.WAIT_IN_ROOM_C); JobRunStep.ToNextStep(RunStep.WAIT_IN_ROOM_C);
runInfo = string.Format("前往{0},先过门", JobParam.TargetNode); runInfo = string.Format("前往{0}", JobParam.TargetNode);
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
AllocateTask(agv, SettingString.DoorDToC); AllocateTask(agv, SettingString.DoorDToC);
} }
else else
{ {
JobRunStep.ToNextStep(RunStep.SF_WAIT_AGV_REACH_LINE); JobRunStep.ToNextStep(RunStep.SF_WAIT_AGV_REACH_LINE);
runInfo = string.Format("前往{0},先过门", JobParam.TargetNode); runInfo = string.Format("前往{0}", JobParam.TargetNode);
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
AllocateTask(agv, JobParam.TargetNode.Name); AllocateTask(agv, JobParam.TargetNode.Name);
} }
...@@ -141,7 +141,9 @@ namespace DeviceLibrary ...@@ -141,7 +141,9 @@ namespace DeviceLibrary
{ {
if (agv.TaskRunState.CheckTaskFinished(agv.Name)) if (agv.TaskRunState.CheckTaskFinished(agv.Name))
{ {
//设置音效类型
SetPlcWithToOutstore(agv);
AllocateTask(agv,SettingString.PlaySound);
if (JobParam.OpType.Equals(OpType.ComToLine)) if (JobParam.OpType.Equals(OpType.ComToLine))
{ {
JobRunStep.ToNextStep(RunStep.SF_WAIT_LINE_RESPONSE); JobRunStep.ToNextStep(RunStep.SF_WAIT_LINE_RESPONSE);
...@@ -167,6 +169,9 @@ namespace DeviceLibrary ...@@ -167,6 +169,9 @@ namespace DeviceLibrary
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; runInfo = "人员在" + JobParam.TargetNode + "操作完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
//关闭音效
CloseSound(agv);
AllocateTask(agv, SettingString.StopSound);
return new EmptyAGVBackJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy())); return new EmptyAGVBackJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy()));
} }
} }
...@@ -177,6 +182,9 @@ namespace DeviceLibrary ...@@ -177,6 +182,9 @@ namespace DeviceLibrary
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; runInfo = "人员在" + JobParam.TargetNode + "操作完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
//关闭音效
CloseSound(agv);
AllocateTask(agv, SettingString.StopSound);
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy())); return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy()));
} }
} }
...@@ -187,6 +195,9 @@ namespace DeviceLibrary ...@@ -187,6 +195,9 @@ namespace DeviceLibrary
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; runInfo = "人员在" + JobParam.TargetNode + "操作完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
//关闭音效
CloseSound(agv);
AllocateTask(agv, SettingString.StopSound);
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf.ToCopy())); return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf.ToCopy()));
} }
} }
...@@ -203,7 +214,7 @@ namespace DeviceLibrary ...@@ -203,7 +214,7 @@ namespace DeviceLibrary
AllocateTask(agv, SettingString.Leave); AllocateTask(agv, SettingString.Leave);
} }
else if (JobRunStep.IsTimeOut(15000, out TimeSpan timeOutValue)) else if (JobRunStep.IsTimeOut(15, out TimeSpan timeOutValue))
{ {
JobRunStep.ToNextStep(RunStep.SF_WAIT_AGV_REACH_LINE); JobRunStep.ToNextStep(RunStep.SF_WAIT_AGV_REACH_LINE);
runInfo = "到达" + JobParam.TargetNode + ",15秒后重新向线体发送入料架请求"; runInfo = "到达" + JobParam.TargetNode + ",15秒后重新向线体发送入料架请求";
...@@ -223,7 +234,7 @@ namespace DeviceLibrary ...@@ -223,7 +234,7 @@ namespace DeviceLibrary
JobRunStep.EndJob(); JobRunStep.EndJob();
return new EmptyAGVBackJob(new JobParam(JobParam.TargetNode.ToCopy())); return new EmptyAGVBackJob(new JobParam(JobParam.TargetNode.ToCopy()));
} }
else if (JobRunStep.IsTimeOut(60000, out TimeSpan timeOutValue)) else if (JobRunStep.IsTimeOut(120, out TimeSpan timeOutValue))
{ {
//链条停止 //链条停止
runInfo = "料架在" + JobParam.TargetNode + "离开小车超时"; runInfo = "料架在" + JobParam.TargetNode + "离开小车超时";
......
...@@ -89,7 +89,7 @@ namespace DeviceLibrary ...@@ -89,7 +89,7 @@ namespace DeviceLibrary
if (job != null && !(job is StandyJob)) if (job != null && !(job is StandyJob))
{ {
if (job is ChargeJob && agv.Battery > BatteryMid) if (job is ChargeJob && agv.Battery > BatteryMid)
return null; return this;
runInfo = "在待机位检测到任务,执行任务"; runInfo = "在待机位检测到任务,执行任务";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
......
...@@ -22,9 +22,9 @@ namespace DeviceLibrary ...@@ -22,9 +22,9 @@ namespace DeviceLibrary
{ {
if (!agv.IsIdle()) if (!agv.IsIdle())
return null; return null;
if (FixMissionManager.HasNext()) if (FixMissionManager.HasNext(MissionType.Line))
{ {
MissionInfo fixMissionInfo= manager.FixMissionManager.ExecuteMission(); MissionInfo fixMissionInfo = manager.FixMissionManager.ExecuteMission(MissionType.Line);
JobParam jobParam = new JobParam(agv.Place); JobParam jobParam = new JobParam(agv.Place);
jobParam.FixMissionInfo = fixMissionInfo; jobParam.FixMissionInfo = fixMissionInfo;
jobParam.SrcNode = agv.Place; jobParam.SrcNode = agv.Place;
...@@ -34,7 +34,15 @@ namespace DeviceLibrary ...@@ -34,7 +34,15 @@ namespace DeviceLibrary
jobParam.OpType = OpType.RequestAPI; jobParam.OpType = OpType.RequestAPI;
return new GoLineForRecyJob(jobParam); return new GoLineForRecyJob(jobParam);
} }
else if(fixMissionInfo.MissionType.Equals(MissionType.Warehouse)) }
else if (FixMissionManager.HasNext(MissionType.Warehouse))
{
MissionInfo fixMissionInfo = manager.FixMissionManager.ExecuteMission(MissionType.Warehouse);
JobParam jobParam = new JobParam(agv.Place);
jobParam.FixMissionInfo = fixMissionInfo;
jobParam.SrcNode = agv.Place;
jobParam.TargetNode = NodeManager.GetNodeByName(fixMissionInfo.Target);
if (fixMissionInfo.MissionType.Equals(MissionType.Warehouse))
{ {
return new GoWarehouseForOutStoreJob(jobParam); return new GoWarehouseForOutStoreJob(jobParam);
} }
......
...@@ -73,9 +73,10 @@ namespace DeviceLibrary.manager ...@@ -73,9 +73,10 @@ namespace DeviceLibrary.manager
{ {
web.Close(); web.Close();
} }
public static bool HasNext() public static bool HasNext(MissionType missionType)
{ {
if (fixMissionInfos.Count > 0) List<MissionInfo> has = fixMissionInfos.FindAll(s=>s.MissionType.Equals(missionType));
if (has!=null && has.Count > 0)
return true; return true;
return false; return false;
} }
...@@ -112,15 +113,16 @@ namespace DeviceLibrary.manager ...@@ -112,15 +113,16 @@ namespace DeviceLibrary.manager
WriteMission(); WriteMission();
MissionChangedEvent?.Invoke(); MissionChangedEvent?.Invoke();
} }
public static MissionInfo ExecuteMission() public static MissionInfo ExecuteMission(MissionType missionType)
{ {
MissionInfo missionInfo=null; MissionInfo missionInfo=null;
try try
{ {
if (Monitor.TryEnter(lockObj, 1000)) if (Monitor.TryEnter(lockObj, 1000))
{ {
missionInfo = fixMissionInfos[0];
fixMissionInfos.RemoveAt(0); missionInfo = fixMissionInfos.Find(s=>s.MissionType.Equals(missionType));
fixMissionInfos.Remove(missionInfo);
} }
} }
catch (Exception e) catch (Exception e)
......
...@@ -40,7 +40,7 @@ namespace DeviceLibrary ...@@ -40,7 +40,7 @@ namespace DeviceLibrary
{ {
public static void RemoveRfidBufInfo(string rfid) public static void RemoveRfidBufInfo(string rfid)
{ {
HttpManager.AgvRemoveRfid(rfid); //HttpManager.AgvRemoveRfid(rfid);
} }
} }
......
...@@ -14,58 +14,58 @@ namespace DeviceLibrary ...@@ -14,58 +14,58 @@ namespace DeviceLibrary
internal interface IFixtureService internal interface IFixtureService
{ {
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "call", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "call", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string CallByPost(Stream stream); Result CallByPost(Stream stream);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "call?target={target}&type={type}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "call?target={target}&type={type}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string CallByGet(string target, int type); Result CallByGet(string target, int type);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "transfer", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "transfer", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string TransferByPost(Stream stream); Result TransferByPost(Stream stream);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "transfer?name={name}&target={target}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "transfer?name={name}&target={target}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string TransferByGet(string name, string target); Result TransferByGet(string name, string target);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "getType", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "getType", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string GetTypeByPost(); FixInfo GetTypeByPost();
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "getType", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "getType", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string GetTypeByGet(); FixInfo GetTypeByGet();
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "mayEnter", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "mayEnter", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string MayEnterByPost(Stream stream); Result MayEnterByPost(Stream stream);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "mayEnter?allow={allow}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "mayEnter?allow={allow}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string MayEnterByGet(bool allow); Result MayEnterByGet(bool allow);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "stopEnter", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "stopEnter", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string StopEnterByPost(Stream stream); Result StopEnterByPost(Stream stream);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "stopEnter?allow={allow}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "stopEnter?allow={allow}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string StopEnterByGet(bool allow); Result StopEnterByGet(bool allow);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "outStore", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "outStore", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string OutStoreByPost(Stream stream); Result OutStoreByPost(Stream stream);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "outStore?has={has}&type={type}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "outStore?has={has}&type={type}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string OutStoreByGet(bool has, int type); Result OutStoreByGet(bool has, int type);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "mayLeave", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "mayLeave", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string MayLeaveByPost(Stream stream); Result MayLeaveByPost(Stream stream);
[OperationContract] [OperationContract]
[WebInvoke(UriTemplate = "mayLeave?allow={allow}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)] [WebInvoke(UriTemplate = "mayLeave?allow={allow}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
string MayLeaveByGet(bool allow); Result MayLeaveByGet(bool allow);
} }
[DataContract] [DataContract]
internal class Result1 internal class Result
{ {
/// <summary> /// <summary>
/// 呼叫成功;false:呼叫失败 /// 呼叫成功;false:呼叫失败
...@@ -86,25 +86,14 @@ namespace DeviceLibrary ...@@ -86,25 +86,14 @@ namespace DeviceLibrary
} }
[DataContract] [DataContract]
internal class Result2
{
[DataMember]
public bool Succeed { get; set; }
[DataMember]
public int Type { get; set; }
[DataMember]
public bool HasLoad { get; set; }
}
[DataContract]
internal class FixInfo internal class FixInfo
{ {
[DataMember] [DataMember]
public bool Succeed { get; set; } public string Succeed { get; set; }
[DataMember] [DataMember]
public FixType Type { get; set; } public string Type { get; set; }
[DataMember] [DataMember]
public bool HasLoad { get; set; } public string HasLoad { get; set; }
} }
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single, IncludeExceptionDetailInFaults = true)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single, IncludeExceptionDetailInFaults = true)]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
...@@ -112,13 +101,35 @@ namespace DeviceLibrary ...@@ -112,13 +101,35 @@ namespace DeviceLibrary
{ {
static log4net.ILog Log = log4net.LogManager.GetLogger("FixtureServices"); static log4net.ILog Log = log4net.LogManager.GetLogger("FixtureServices");
#region 呼叫 #region 呼叫
public string CallByGet(string target, int type) public Result CallByGet(string target, int type)
{ {
Result1 res; Result res;
MissionInfo missionInfo; MissionInfo missionInfo;
if (SettingString.Warehouse.Equals(target)) if (SettingString.Warehouse.Equals(target))
{ {
missionInfo = new MissionInfo(target, (FixType)type, MissionType.Warehouse); missionInfo = new MissionInfo(target, (FixType)type, MissionType.Warehouse);
if (!FixMissionManager.Contains(missionInfo))
{
if (AGVManager.agvInfo[0].CurJob is StandyJob || AGVManager.agvInfo[0].CurJob is ChargeJob)
{
if (FixMissionManager.HasNext(MissionType.Line))
{
res = new Result() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"AGV has Line Misssion,{target} is not allowed to call." };
FixMissionManager.Add(missionInfo);
Log.Error("立库呼叫失败[GET](AGV正在执行任务):" + missionInfo.ToString());
return res;
}
}
else
{
res = new Result() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"AGV is doing Misssion,{target} is not allowed to call." };
FixMissionManager.Add(missionInfo);
Log.Error("立库呼叫失败[GET](AGV正在执行任务):" + missionInfo.ToString());
return res;
}
}
} }
else else
{ {
...@@ -126,7 +137,7 @@ namespace DeviceLibrary ...@@ -126,7 +137,7 @@ namespace DeviceLibrary
} }
if (!NodeManager.HasNode(target)) if (!NodeManager.HasNode(target))
{ {
res = new Result1() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"节点名{target}不存在" }; res = new Result() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"节点名{target}不存在" };
Log.Error("呼叫失败[GET](节点不存在):" + missionInfo.ToString()); Log.Error("呼叫失败[GET](节点不存在):" + missionInfo.ToString());
} }
...@@ -135,22 +146,22 @@ namespace DeviceLibrary ...@@ -135,22 +146,22 @@ namespace DeviceLibrary
if (!FixMissionManager.Contains(missionInfo)) if (!FixMissionManager.Contains(missionInfo))
{ {
FixMissionManager.Add(missionInfo); FixMissionManager.Add(missionInfo);
res = new Result1() { Succeed = true, Data = $"target:{target},type:{type}", Msg = "" }; res = new Result() { Succeed = true, Data = $"target:{target},type:{type}", Msg = "" };
Log.Info("呼叫成功[GET]:" + missionInfo.ToString()); Log.Info("呼叫成功[GET]:" + missionInfo.ToString());
} }
else else
{ {
res = new Result1() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"目的地{target}任务已存在,无法添加重复任务" }; res = new Result() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"目的地{target}任务已存在,无法添加重复任务" };
Log.Error("呼叫失败[GET](已存在相同任务):" + missionInfo.ToString()); Log.Error("呼叫失败[GET](已存在相同任务):" + missionInfo.ToString());
} }
} }
return JsonHelper.SerializeObject(res); return res;
} }
public string CallByPost(Stream stream) public Result CallByPost(Stream stream)
{ {
Result1 res; Result res;
StreamReader sr = new StreamReader(stream); StreamReader sr = new StreamReader(stream);
string s = sr.ReadToEnd(); string s = sr.ReadToEnd();
System.Collections.Specialized.NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s); System.Collections.Specialized.NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
...@@ -160,6 +171,28 @@ namespace DeviceLibrary ...@@ -160,6 +171,28 @@ namespace DeviceLibrary
if (SettingString.Warehouse.Equals(target)) if (SettingString.Warehouse.Equals(target))
{ {
missionInfo = new MissionInfo(target, (FixType)type, MissionType.Warehouse); missionInfo = new MissionInfo(target, (FixType)type, MissionType.Warehouse);
if (!FixMissionManager.Contains(missionInfo))
{
if (AGVManager.agvInfo[0].CurJob is StandyJob || AGVManager.agvInfo[0].CurJob is ChargeJob)
{
if (FixMissionManager.HasNext(MissionType.Line))
{
res = new Result() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"AGV has Line Misssion,{target} is not allowed to call." };
FixMissionManager.Add(missionInfo);
Log.Error("立库呼叫失败[POST](AGV正在执行任务):" + missionInfo.ToString());
return res;
}
}
else
{
res = new Result() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"AGV is doing Misssion,{target} is not allowed to call." };
FixMissionManager.Add(missionInfo);
Log.Error("立库呼叫失败[POST](AGV正在执行任务):" + missionInfo.ToString());
return res;
}
}
} }
else else
{ {
...@@ -167,7 +200,7 @@ namespace DeviceLibrary ...@@ -167,7 +200,7 @@ namespace DeviceLibrary
} }
if (!NodeManager.HasNode(target)) if (!NodeManager.HasNode(target))
{ {
res = new Result1() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"节点名{target}不存在" }; res = new Result() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"节点名{target}不存在" };
Log.Error("呼叫失败[POST](节点不存在):" + missionInfo.ToString()); Log.Error("呼叫失败[POST](节点不存在):" + missionInfo.ToString());
} }
...@@ -176,74 +209,74 @@ namespace DeviceLibrary ...@@ -176,74 +209,74 @@ namespace DeviceLibrary
if (!FixMissionManager.Contains(missionInfo)) if (!FixMissionManager.Contains(missionInfo))
{ {
FixMissionManager.Add(missionInfo); FixMissionManager.Add(missionInfo);
res = new Result1() { Succeed = true, Data = $"target:{target},type:{type}", Msg = "" }; res = new Result() { Succeed = true, Data = $"target:{target},type:{type}", Msg = "" };
Log.Info("呼叫成功[POST]:" + missionInfo.ToString()); Log.Info("呼叫成功[POST]:" + missionInfo.ToString());
} }
else else
{ {
res = new Result1() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"目的地{target}任务已存在,无法添加重复任务" }; res = new Result() { Succeed = false, Data = $"target:{target},type:{type}", Msg = $"目的地{target}任务已存在,无法添加重复任务" };
Log.Error("呼叫失败[POST](已存在相同任务):" + missionInfo.ToString()); Log.Error("呼叫失败[POST](已存在相同任务):" + missionInfo.ToString());
} }
} }
return JsonHelper.SerializeObject(res); return res;
} }
#endregion #endregion
#region 获取治具类型 #region 获取治具类型
public string GetTypeByGet() public FixInfo GetTypeByGet()
{ {
FixInfo fixInfo; FixInfo fixInfo;
if (AGVManager.agvInfo[0].CurJob == null) if (AGVManager.agvInfo[0].CurJob == null)
{ {
fixInfo = new FixInfo() { Succeed = true, HasLoad = AGVManager.agvInfo[0].IsExistShelf, Type = FixType.None }; fixInfo = new FixInfo() { Succeed = true.ToString(), HasLoad = AGVManager.agvInfo[0].IsExistShelf.ToString(), Type = ((int)FixType.None).ToString() };
Log.Info($"GetTypeByGet : 当前无任务,治具类型为空"); Log.Info($"GetTypeByGet : 当前无任务,治具类型为空");
} }
else if (AGVManager.agvInfo[0].CurJob.JobParam != null && AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo != null) else if (AGVManager.agvInfo[0].CurJob.JobParam != null && AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo != null)
{ {
fixInfo = new FixInfo() { Succeed = true, HasLoad = AGVManager.agvInfo[0].IsExistShelf, Type = AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo.Type }; fixInfo = new FixInfo() { Succeed = true.ToString(), HasLoad = AGVManager.agvInfo[0].IsExistShelf.ToString(), Type = ((int)AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo.Type).ToString() };
Log.Info($"GetTypeByGet : {AGVManager.agvInfo[0].IsExistShelf},{AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo.Type.ToString()}"); Log.Info($"GetTypeByGet : {AGVManager.agvInfo[0].IsExistShelf},{AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo.Type.ToString()}");
} }
else else
{ {
fixInfo = new FixInfo() { Succeed = false, HasLoad = AGVManager.agvInfo[0].IsExistShelf, Type = FixType.None }; fixInfo = new FixInfo() { Succeed = false.ToString(), HasLoad = AGVManager.agvInfo[0].IsExistShelf.ToString(), Type = ((int)FixType.None).ToString() };
Log.Info($"GetTypeByGet : 当前无任务,查询失败"); Log.Info($"GetTypeByGet : 当前无任务,查询失败");
} }
return JsonHelper.SerializeObject(fixInfo); return fixInfo;
} }
public string GetTypeByPost() public FixInfo GetTypeByPost()
{ {
FixInfo fixInfo; FixInfo fixInfo;
if (AGVManager.agvInfo[0].CurJob == null) if (AGVManager.agvInfo[0].CurJob == null)
{ {
fixInfo = new FixInfo() { Succeed = true, HasLoad = AGVManager.agvInfo[0].IsExistShelf, Type = FixType.None }; fixInfo = new FixInfo() { Succeed = true.ToString(), HasLoad = AGVManager.agvInfo[0].IsExistShelf.ToString(), Type = ((int)FixType.None).ToString() };
Log.Info($"GetTypeByPost : 当前无任务,治具类型为空"); Log.Info($"GetTypeByPost : 当前无任务,治具类型为空");
} }
else if (AGVManager.agvInfo[0].CurJob.JobParam != null && AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo != null) else if (AGVManager.agvInfo[0].CurJob.JobParam != null && AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo != null)
{ {
fixInfo = new FixInfo() { Succeed = true, HasLoad = AGVManager.agvInfo[0].IsExistShelf, Type = AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo.Type }; fixInfo = new FixInfo() { Succeed = true.ToString(), HasLoad = AGVManager.agvInfo[0].IsExistShelf.ToString(), Type = ((int)AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo.Type).ToString() };
Log.Info($"GetTypeByPost : {AGVManager.agvInfo[0].IsExistShelf},{AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo.Type.ToString()}"); Log.Info($"GetTypeByPost : {AGVManager.agvInfo[0].IsExistShelf},{AGVManager.agvInfo[0].CurJob.JobParam.FixMissionInfo.Type.ToString()}");
} }
else else
{ {
fixInfo = new FixInfo() { Succeed = false, HasLoad = AGVManager.agvInfo[0].IsExistShelf, Type = FixType.None }; fixInfo = new FixInfo() { Succeed = false.ToString(), HasLoad = AGVManager.agvInfo[0].IsExistShelf.ToString(), Type = ((int)FixType.None).ToString() };
Log.Info($"GetTypeByPost : 当前无任务,查询失败"); Log.Info($"GetTypeByPost : 当前无任务,查询失败");
} }
return JsonHelper.SerializeObject(fixInfo); return fixInfo;
} }
#endregion #endregion
public string MayEnterByGet(bool allow) public Result MayEnterByGet(bool allow)
{ {
WarehouseSigManager.MayEnter = allow; WarehouseSigManager.MayEnter = allow;
Log.Info($"Get: 收到MayEnter={allow}信号"); Log.Info($"Get: 收到MayEnter={allow}信号");
return JsonHelper.SerializeObject(new Result1() { Succeed = true, Data = $"MayEnter={allow}", Msg = "" }); return new Result() { Succeed = true, Data = $"MayEnter={allow}", Msg = "" };
} }
public string MayEnterByPost(Stream stream) public Result MayEnterByPost(Stream stream)
{ {
StreamReader sr = new StreamReader(stream); StreamReader sr = new StreamReader(stream);
string s = sr.ReadToEnd(); string s = sr.ReadToEnd();
...@@ -251,57 +284,57 @@ namespace DeviceLibrary ...@@ -251,57 +284,57 @@ namespace DeviceLibrary
bool allow = bool.Parse(nvc["allow"]); bool allow = bool.Parse(nvc["allow"]);
WarehouseSigManager.MayEnter = allow; WarehouseSigManager.MayEnter = allow;
Log.Info($"Post: 收到MayEnter={allow}信号"); Log.Info($"Post: 收到MayEnter={allow}信号");
return JsonHelper.SerializeObject(new Result1() { Succeed = true, Data = $"MayEnter={allow}", Msg = "" }); return new Result() { Succeed = true, Data = $"MayEnter={allow}", Msg = "" };
} }
public string MayLeaveByGet(bool allow) public Result MayLeaveByGet(bool allow)
{ {
Result1 result1; Result result1;
if (AGVManager.agvInfo[0].StateID.Equals(eAGVState.Executing)) //if (AGVManager.agvInfo[0].StateID.Equals(eAGVState.Executing))
{ //{
result1 = new Result1() { Succeed = false, Data = $"MayLeave={allow}", Msg = "AGV正在运行,无法进料" }; // result1 = new Result() { Succeed = false, Data = $"MayLeave={allow}", Msg = "AGV正在运行,无法进料" };
Log.Info($"Get: 收到MayLeave={allow}信号,AGV正在运行,无法进料"); // Log.Info($"Get: 收到MayLeave={allow}信号,AGV正在运行,无法进料");
} //}
else //else
{ {
WarehouseSigManager.MayLeave = allow; WarehouseSigManager.MayLeave = allow;
result1 = new Result1() { Succeed = true, Data = $"MayLeave={allow}", Msg = "" }; result1 = new Result() { Succeed = true, Data = $"MayLeave={allow}", Msg = "" };
Log.Info($"Get: 收到MayLeave={allow}信号"); Log.Info($"Get: 收到MayLeave={allow}信号");
} }
return JsonHelper.SerializeObject(result1); return result1;
} }
public string MayLeaveByPost(Stream stream) public Result MayLeaveByPost(Stream stream)
{ {
StreamReader sr = new StreamReader(stream); StreamReader sr = new StreamReader(stream);
string s = sr.ReadToEnd(); string s = sr.ReadToEnd();
System.Collections.Specialized.NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s); System.Collections.Specialized.NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
bool allow = bool.Parse(nvc["allow"]); bool allow = bool.Parse(nvc["allow"]);
Result1 result1; Result result1;
if (AGVManager.agvInfo[0].StateID.Equals(eAGVState.Executing)) //if (AGVManager.agvInfo[0].StateID.Equals(eAGVState.Executing))
{ //{
result1 = new Result1() { Succeed = false, Data = $"MayLeave={allow}", Msg = "AGV正在运行,无法进料" }; // result1 = new Result() { Succeed = false, Data = $"MayLeave={allow}", Msg = "AGV正在运行,无法进料" };
Log.Info($"Post: 收到MayLeave={allow}信号,AGV正在运行,无法进料"); // Log.Info($"Post: 收到MayLeave={allow}信号,AGV正在运行,无法进料");
} //}
else //else
{ {
WarehouseSigManager.MayLeave = allow; WarehouseSigManager.MayLeave = allow;
result1 = new Result1() { Succeed = true, Data = $"MayLeave={allow}", Msg = "" }; result1 = new Result() { Succeed = true, Data = $"MayLeave={allow}", Msg = "" };
Log.Info($"Post: 收到MayLeave={allow}信号"); Log.Info($"Post: 收到MayLeave={allow}信号");
} }
return JsonHelper.SerializeObject(result1); return result1;
} }
public string OutStoreByGet(bool has, int type) public Result OutStoreByGet(bool has, int type)
{ {
WarehouseSigManager.OutStore.Set(has, (FixType)type); WarehouseSigManager.OutStore.Set(has, (FixType)type);
Log.Info($"Get: 收到出库信息:{has.ToString()} {type}"); Log.Info($"Get: 收到出库信息:{has.ToString()} {type}");
return JsonHelper.SerializeObject(new Result1() { Succeed = true, Data = $"OutStore:{has},{type}", Msg = "" }); return new Result() { Succeed = true, Data = $"OutStore:{has},{type}", Msg = "" };
} }
public string OutStoreByPost(Stream stream) public Result OutStoreByPost(Stream stream)
{ {
StreamReader sr = new StreamReader(stream); StreamReader sr = new StreamReader(stream);
string s = sr.ReadToEnd(); string s = sr.ReadToEnd();
...@@ -310,17 +343,17 @@ namespace DeviceLibrary ...@@ -310,17 +343,17 @@ namespace DeviceLibrary
int type = int.Parse(nvc["type"]); int type = int.Parse(nvc["type"]);
WarehouseSigManager.OutStore.Set(has, (FixType)type); WarehouseSigManager.OutStore.Set(has, (FixType)type);
Log.Info($"Post: 收到出库信息:{has.ToString()} {type}"); Log.Info($"Post: 收到出库信息:{has.ToString()} {type}");
return JsonHelper.SerializeObject(new Result1() { Succeed = true, Data = $"OutStore:{has},{type}", Msg = "" }); return new Result() { Succeed = true, Data = $"OutStore:{has},{type}", Msg = "" };
} }
public string StopEnterByGet(bool allow) public Result StopEnterByGet(bool allow)
{ {
WarehouseSigManager.StopEnter = allow; WarehouseSigManager.StopEnter = allow;
Log.Info($"Get: 收到StopEnter={allow}信号"); Log.Info($"Get: 收到StopEnter={allow}信号");
return JsonHelper.SerializeObject(new Result1() { Succeed = true, Data = $"StopEnter={allow}", Msg = "" }); return new Result() { Succeed = true, Data = $"StopEnter={allow}", Msg = "" };
} }
public string StopEnterByPost(Stream stream) public Result StopEnterByPost(Stream stream)
{ {
StreamReader sr = new StreamReader(stream); StreamReader sr = new StreamReader(stream);
string s = sr.ReadToEnd(); string s = sr.ReadToEnd();
...@@ -328,45 +361,45 @@ namespace DeviceLibrary ...@@ -328,45 +361,45 @@ namespace DeviceLibrary
bool allow = bool.Parse(nvc["allow"]); bool allow = bool.Parse(nvc["allow"]);
WarehouseSigManager.StopEnter = allow; WarehouseSigManager.StopEnter = allow;
Log.Info($"Post: 收到StopEnter={allow}信号"); Log.Info($"Post: 收到StopEnter={allow}信号");
return JsonHelper.SerializeObject(new Result1() { Succeed = true, Data = $"StopEnter={allow}", Msg = "" }); return new Result() { Succeed = true, Data = $"StopEnter={allow}", Msg = "" };
} }
public string TransferByGet(string name, string target) public Result TransferByGet(string name, string target)
{ {
Result1 result1; Result result1;
if (!NodeManager.HasNode(name)) if (!NodeManager.HasNode(name))
{ {
result1 = new Result1() { Succeed = false, Data = "", Msg = $"name {name} do not exist" }; result1 = new Result() { Succeed = false, Data = "", Msg = $"name {name} do not exist" };
Log.Info($"运送接口调用失败[GET]: : 呼叫地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}"); Log.Info($"运送接口调用失败[GET]: : 呼叫地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}");
} }
else if (WarehouseSigManager.TargetWithFix.CurPlace.Equals(name) && NodeManager.HasNode(target)) else if (WarehouseSigManager.TargetWithFix.CurPlace.Equals(name) && NodeManager.HasNode(target))
{ {
result1 = new Result1() { Succeed = true, Data = $"name={name},target={target}", Msg = "" }; result1 = new Result() { Succeed = true, Data = $"name={name},target={target}", Msg = "" };
WarehouseSigManager.TargetWithFix.Set(name, target); WarehouseSigManager.TargetWithFix.Set(name, target);
Log.Info($"运送接口调用成功[GET]: name={name},target={target}"); Log.Info($"运送接口调用成功[GET]: name={name},target={target}");
} }
else if (WarehouseSigManager.TargetWithFix.CurPlace.Equals(name) && SettingString.Cancel.Equals(target)) else if (WarehouseSigManager.TargetWithFix.CurPlace.Equals(name) && SettingString.Cancel.Equals(target))
{ {
result1 = new Result1() { Succeed = true, Data = $"name={name},target={target}", Msg = "" }; result1 = new Result() { Succeed = true, Data = $"name={name},target={target}", Msg = "" };
WarehouseSigManager.TargetWithFix.Set(name, target); WarehouseSigManager.TargetWithFix.Set(name, target);
Log.Info($"运送接口调用成功[GET]: name={name},target={target}"); Log.Info($"运送接口调用成功[GET]: name={name},target={target}");
} }
else if(!NodeManager.HasNode(target)) else if (!NodeManager.HasNode(target))
{ {
result1 = new Result1() { Succeed = false, Data = "", Msg = $"target={target} do not exist" }; result1 = new Result() { Succeed = false, Data = "", Msg = $"target={target} do not exist" };
Log.Info($"运送接口调用失败[GET]: : 目的地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}"); Log.Info($"运送接口调用失败[GET]: : 目的地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}");
} }
else else
{ {
result1 = new Result1() { Succeed = false, Data = "", Msg = $" AGV is in {WarehouseSigManager.TargetWithFix.CurPlace}, line {name} is not allowed to call this interface TransferByGet at this time." }; result1 = new Result() { Succeed = false, Data = "", Msg = $" AGV is in {WarehouseSigManager.TargetWithFix.CurPlace}, line {name} is not allowed to call this interface TransferByGet at this time." };
Log.Info($"运送接口调用失败[GET]: : name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}"); Log.Info($"运送接口调用失败[GET]: : name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}");
} }
return JsonHelper.SerializeObject(result1); return result1;
} }
public string TransferByPost(Stream stream) public Result TransferByPost(Stream stream)
{ {
Result1 result1; Result result1;
StreamReader sr = new StreamReader(stream); StreamReader sr = new StreamReader(stream);
string s = sr.ReadToEnd(); string s = sr.ReadToEnd();
System.Collections.Specialized.NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s); System.Collections.Specialized.NameValueCollection nvc = System.Web.HttpUtility.ParseQueryString(s);
...@@ -374,32 +407,32 @@ namespace DeviceLibrary ...@@ -374,32 +407,32 @@ namespace DeviceLibrary
string target = nvc["target"]; string target = nvc["target"];
if (!NodeManager.HasNode(name)) if (!NodeManager.HasNode(name))
{ {
result1 = new Result1() { Succeed = false, Data = "", Msg = $"name {name} do not exist" }; result1 = new Result() { Succeed = false, Data = "", Msg = $"name {name} do not exist" };
Log.Info($"运送接口调用失败[POST]: : 呼叫地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}"); Log.Info($"运送接口调用失败[POST]: : 呼叫地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}");
} }
else if (WarehouseSigManager.TargetWithFix.CurPlace.Equals(name) && NodeManager.HasNode(target)) else if (WarehouseSigManager.TargetWithFix.CurPlace.Equals(name) && NodeManager.HasNode(target))
{ {
result1 = new Result1() { Succeed = true, Data = $"name={name},target={target}", Msg = "" }; result1 = new Result() { Succeed = true, Data = $"name={name},target={target}", Msg = "" };
WarehouseSigManager.TargetWithFix.Set(name, target); WarehouseSigManager.TargetWithFix.Set(name, target);
Log.Info($"运送接口调用成功[POST]: name={name},target={target}"); Log.Info($"运送接口调用成功[POST]: name={name},target={target}");
} }
else if (WarehouseSigManager.TargetWithFix.CurPlace.Equals(name) && SettingString.Cancel.Equals(target)) else if (WarehouseSigManager.TargetWithFix.CurPlace.Equals(name) && SettingString.Cancel.Equals(target))
{ {
result1 = new Result1() { Succeed = true, Data = $"name={name},target={target}", Msg = "" }; result1 = new Result() { Succeed = true, Data = $"name={name},target={target}", Msg = "" };
WarehouseSigManager.TargetWithFix.Set(name, target); WarehouseSigManager.TargetWithFix.Set(name, target);
Log.Info($"运送接口调用成功[GET]: name={name},target={target}"); Log.Info($"运送接口调用成功[GET]: name={name},target={target}");
} }
else if (!NodeManager.HasNode(target)) else if (!NodeManager.HasNode(target))
{ {
result1 = new Result1() { Succeed = false, Data = "", Msg = $"target={target} do not exist" }; result1 = new Result() { Succeed = false, Data = "", Msg = $"target={target} do not exist" };
Log.Info($"运送接口调用失败[POST]: : 目的地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}"); Log.Info($"运送接口调用失败[POST]: : 目的地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}");
} }
else else
{ {
result1 = new Result1() { Succeed = false, Data = "", Msg = $" AGV is in {WarehouseSigManager.TargetWithFix.CurPlace}, line {name} is not allowed to call this interface TransferByGet at this time." }; result1 = new Result() { Succeed = false, Data = "", Msg = $" AGV is in {WarehouseSigManager.TargetWithFix.CurPlace}, line {name} is not allowed to call this interface TransferByGet at this time." };
Log.Info($"运送接口调用失败[POST]: : name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}"); Log.Info($"运送接口调用失败[POST]: : name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}");
} }
return JsonHelper.SerializeObject(result1); return result1;
} }
} }
......
...@@ -6,13 +6,17 @@ ...@@ -6,13 +6,17 @@
<appSettings> <appSettings>
<add key="ITS" value="10.85.17.233"/> <add key="ITS" value="10.85.17.233"/>
<add key="WebService" value="http://127.0.0.1:8888/service/agv/"/> <add key="WebService" value="http://10.85.196.40/service/agv/"/>
<add key="http.server" value="http://10.85.162.124/myproject/"/> <add key="http.server" value="http://10.85.199.25/myproject/"/>
<add key="FLEET" value="10.85.19.3"/> <add key="FLEET" value="10.85.19.3"/>
<add key="log4net_configname" value="log4net.config"/> <add key="log4net_configname" value="log4net.config"/>
<add key="File_AgvInfo" value="agvinfos.xml"/> <add key="File_AgvInfo" value="agvinfos.xml"/>
<add key="File_AgvTaskInfo" value="taskinfos.xml"/> <add key="File_AgvTaskInfo" value="taskinfos.xml"/>
<add key="File_NodeInfo" value="nodeinfos.xml"/> <add key="File_NodeInfo" value="nodeinfos.xml"/>
<add key="ChargeThreshold" value="20,90"/> <add key="ChargeThreshold" value="20,90"/>
<!--等待人员操作超时时间(分钟)-->
<add key="WaitTimeout" value="5"/>
<!--停留超时异常上报时间(分钟)-->
<add key="StandTimeout" value="6"/>
</appSettings> </appSettings>
</configuration> </configuration>
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!