Commit 2e45d045 张东亮

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

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