Commit 9a540f5e 顾剑亮

修改bug

1 个父辈 8fd8c936
正在显示 85 个修改的文件 包含 527 行增加105 行删除
......@@ -58,7 +58,7 @@ namespace Model
Common.mir.Add_Mission_Fleet(info.FleetID, info.Authorization, mission, out id);
else
Common.mir.Add_Mission(info.IP, info.Authorization, mission, out id);
sendNewStep.Msg = info.FullName + "发送任务" + mission;
sendNewStep.Msg = info.FullName + " 发送任务 " + mission;
sendNewStep.NextStep(SendNewStep.MoveLine);
}
else
......@@ -76,7 +76,7 @@ namespace Model
Common.mir.Add_Mission_Fleet(info.FleetID, info.Authorization, mission, out id);
else
Common.mir.Add_Mission(info.IP, info.Authorization, mission, out id);
sendNewStep.Msg = info.FullName + "发送任务" + mission;
sendNewStep.Msg = info.FullName + " 发送任务 " + mission;
sendNewStep.NextStep(SendNewStep.MoveLine);
info.SteelCountAdd();
}
......
......@@ -122,7 +122,7 @@ namespace Model
Common.mir.Add_Mission_Fleet(info.FleetID, info.Authorization, mission, out id);
else
Common.mir.Add_Mission(info.IP, info.Authorization, mission, out id);
takeOldStep.Msg = info.FullName + "发送任务," + mission;
takeOldStep.Msg = info.FullName + " 发送任务 " + mission;
takeOldStep.NextStep(TakeOldStep.MoveLine);
info.SteelCountAdd();
}
......
......@@ -43,11 +43,11 @@ namespace BLL
}
else if (chargeStep.Equals(ChargeStep.Charging))
{
Common.log.Debug(_info.Name + "当前电量" + _info.Battery);
Common.log.Debug(_info.Name + " 当前电量" + _info.Battery);
if (_info.Battery == _info.BatteryMax)
{
chargeStep.Msg = _info.Name + "电量达到" + _info.BatteryMax;
chargeStep.Msg = _info.Name + " 电量达到" + _info.BatteryMax;
chargeStep.NextStep(ChargeStep.End);
}
else if (_info.Battery > _info.BatteryMin)
......@@ -63,7 +63,7 @@ namespace BLL
else if (chargeStep.Equals(ChargeStep.End))
{
Common.mir.Del_Mission(_info.IP, _info.Authorization);
chargeStep.Msg = _info.Name + "充电工作结束,回待机位";
chargeStep.Msg = _info.Name + " 充电工作结束,回待机位";
return new StandbyJob();
}
......@@ -77,7 +77,7 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
chargeStep.NextStep(ChargeStep.MoveStation);
chargeStep.Msg = _info.Name + "发送任务" + mission;
chargeStep.Msg = _info.Name + " 发送任务 " + mission;
}
private void PassDoor()
......@@ -87,14 +87,14 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
chargeStep.NextStep(ChargeStep.PassDoor);
chargeStep.Msg = _info.Name + "发送任务" + mission;
chargeStep.Msg = _info.Name + " 发送任务 " + mission;
}
private void MoveStation()
{
if (_info.Battery > currBattery)
{
chargeStep.Msg = _info.Name + "到达充电位,准备充电";
chargeStep.Msg = _info.Name + " 到达充电位,准备充电";
chargeStep.NextStep(ChargeStep.Charging);
}
}
......
......@@ -33,21 +33,25 @@ namespace BLL
{
move.Execute(_info);
if (move.IsEnd)
{
sendNewStep.Msg = _info.Name + " 完成过门";
sendNewStep.NextStep(SendNewStep.FindLine);
}
}
else if (sendNewStep.Equals(SendNewStep.FindLine))
{
bool rtn = SteelManage.FindNewSteelWork(_info, out string place);
if (rtn)
{
if (place.ToLower() == "storage")
if (place == "STORAGE")
return new StorageJob();
else
FindLine(place);
}
else
{
sendNewStep.Msg = info.Name + "没有后续新钢板任务";
_info.Place = "";
sendNewStep.Msg = info.Name + " 没有后续新钢板任务";
sendNewStep.NextStep(SendNewStep.End);
}
}
......@@ -55,8 +59,12 @@ namespace BLL
{
move.Execute(_info);
if (move.IsEnd)
{
SteelManage.NewSteelWorkDel(_info.From, _info.Place);
sendNewStep.Msg = _info.Name + " 到达 " + _info.Place;
sendNewStep.NextStep(SendNewStep.FindLine);
}
}
else if (sendNewStep.Equals(SendNewStep.End))
{
IJob job = SteelManage.GetSteelJob(info);
......@@ -75,7 +83,7 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
sendNewStep.NextStep(SendNewStep.MoveLine);
sendNewStep.Msg = _info.Name + "发送任务" + mission;
sendNewStep.Msg = _info.Name + " 发送任务 " + mission;
}
private void MoveLine()
......@@ -90,7 +98,7 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
sendNewStep.NextStep(SendNewStep.PassDoor);
sendNewStep.Msg = _info.Name + "发送任务" + mission;
sendNewStep.Msg = _info.Name + " 发送任务 " + mission;
}
private enum SendNewStep
......
......@@ -41,7 +41,7 @@ namespace BLL
if (move.IsEnd)
{
standbyStep.NextStep(StandbyStep.End);
standbyStep.Msg = _info.Name + "到达待机位";
standbyStep.Msg = _info.Name + " 到达待机位";
_getTime = DateTime.Now;
}
}
......@@ -49,7 +49,7 @@ namespace BLL
{
if (_info.Battery <= _info.BatteryMin)
{
standbyStep.Msg = _info.Name + "电量小于" + _info.BatteryMin + ",执行充电任务";
standbyStep.Msg = _info.Name + " 电量小于" + _info.BatteryMin + ",执行充电任务";
return new ChargeJob();
}
else
......@@ -57,7 +57,7 @@ namespace BLL
TimeSpan span = DateTime.Now - _getTime;
if (span.TotalMinutes >= 2)
{
standbyStep.Msg = _info.Name + "在待机位停留超过2分钟,执行充电任务";
standbyStep.Msg = _info.Name + " 在待机位停留超过2分钟,执行充电任务";
return new ChargeJob();
}
else
......@@ -78,7 +78,7 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
standbyStep.NextStep(StandbyStep.MoveStandby);
standbyStep.Msg = _info.Name + ",发送任务," + mission;
standbyStep.Msg = _info.Name + " 发送任务 " + mission;
}
private void PassDoor()
......@@ -88,7 +88,7 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
standbyStep.NextStep(StandbyStep.PassDoor);
standbyStep.Msg = _info.Name + "发送任务" + mission;
standbyStep.Msg = _info.Name + " 发送任务 " + mission;
}
private enum StandbyStep
......
......@@ -10,7 +10,6 @@ namespace BLL
private AgvInfo _info;
private MoveJob move;
private string mission;
//private DateTime _getTime;
private JobStep<StorageStep> storageStep;
public StorageJob()
......@@ -29,7 +28,7 @@ namespace BLL
if (_info.Is4DWorkshop())
MoveStorage();
else
PassDoor();
PassDoor4D();
}
else if (storageStep.Equals(StorageStep.PassDoor))
{
......@@ -42,18 +41,19 @@ namespace BLL
move.Execute(_info);
if (move.IsEnd)
{
storageStep.Msg = info.Name + " 已到位,等待对接信号";
storageStep.NextStep(StorageStep.GetSingle);
storageStep.Msg = info.Name + "已到位,等待离开信号";
delayGetSignal = 0;
dockTime = 0;
}
}
else if (storageStep.Equals(StorageStep.GetSingle))
{
if (Common.StorageDockFinish)
if (Common.StorageDockAlway || Common.StorageDockFinish)
{
SteelManage.StorageWorkDel(info.Place);
storageStep.Msg = info.Name + "已到位,等待离开信号";
SteelManage.StorageWorkDel(_info.Place);
storageStep.Msg = info.Name + " 等待离开信号";
storageStep.NextStep(StorageStep.WaitStorageLeave);
}
else
......@@ -62,7 +62,7 @@ namespace BLL
{
if (dockTime >= 3)
{
storageStep.Msg = info.Name + "对接仓库连续3次信号没有到位";
storageStep.Msg = info.Name + " 对接仓库连续3次信号没有到位";
storageStep.NextStep(StorageStep.Error);
dockTime = 0;
//小车报警任务
......@@ -70,6 +70,7 @@ namespace BLL
else
{
dockTime++;
storageStep.Msg = info.Name + " 没有收到对接信号,重新发送";
MoveStorage();
}
}
......@@ -81,12 +82,50 @@ namespace BLL
if (SteelManage.FindStorageWorkLeave())
{
SteelManage.StorageWorkDelLeave();
storageStep.Msg = info.Name + "收到离开信号";
storageStep.Msg = info.Name + " 收到离开信号";
if (SteelManage.FindStorageWork(info))
{
if (_info.IsWorkspace())
{
storageStep.NextStep(StorageStep.FindLine);
}
else
{
PassDoor4C();
}
}
else
return new StandbyJob();
}
}
else if (storageStep.Equals(StorageStep.BackDoor))
{
move.Execute(_info);
if (move.IsEnd)
storageStep.NextStep(StorageStep.FindLine);
}
else if (storageStep.Equals(StorageStep.FindLine))
{
bool rtn = SteelManage.FindStorageWork(_info, out string place);
if (rtn)
{
FindLine(place);
}
else
{
storageStep.Msg = info.Name + " 没有后续新钢板任务";
return new StandbyJob();
}
else if (SteelManage.FindNewSteelWork(info))
}
else if (storageStep.Equals(StorageStep.MoveLine))
{
move.Execute(_info);
if (move.IsEnd)
{
return new SendNewJob();
SteelManage.StorageWorkDel(_info.Place);
storageStep.Msg = _info.Name + " 到达 " + _info.Place;
storageStep.NextStep(StorageStep.FindLine);
}
}
else if (storageStep.Equals(StorageStep.Error))
......@@ -102,21 +141,41 @@ namespace BLL
private void MoveStorage()
{
mission = Common.MISSION_MOVE_STORAGE;
_info.Place = mission;
_info.Place = _info.Workshop + "_ENTER";
move = new MoveJob(mission);
move.Execute(_info);
storageStep.NextStep(StorageStep.MoveStorage);
storageStep.Msg = _info.Name + "发送任务" + mission;
storageStep.Msg = _info.Name + " 发送任务 " + mission;
}
private void PassDoor()
private void PassDoor4C()
{
mission = Common.MISSION_PASS_DOOR_INTO + _info.Workshop;
mission = Common.MISSION_PASS_DOOR_4C;
_info.Place = mission;
move = new MoveJob(mission);
move.Execute(_info);
storageStep.NextStep(StorageStep.BackDoor);
storageStep.Msg = _info.Name + " 发送任务 " + mission;
}
private void PassDoor4D()
{
mission = Common.MISSION_PASS_DOOR_4D;
_info.Place = mission;
move = new MoveJob(mission);
move.Execute(_info);
storageStep.NextStep(StorageStep.PassDoor);
storageStep.Msg = _info.Name + "发送任务" + mission;
storageStep.Msg = _info.Name + " 发送任务 " + mission;
}
private void FindLine(string place)
{
mission = Common.MISSION_MOVE_STEEL + place;
_info.Place = place;
move = new MoveJob(mission);
move.Execute(_info);
storageStep.NextStep(StorageStep.MoveLine);
storageStep.Msg = _info.Name + " 发送任务 " + mission;
}
private enum StorageStep
......@@ -124,10 +183,14 @@ namespace BLL
None,
End,
PassDoor,
BackDoor,
BackDoorFinish,
MoveStorage,
WaitStorage,
GetSingle,
WaitStorageLeave,
FindLine,
MoveLine,
Error
}
}
......
......@@ -25,13 +25,14 @@ namespace BLL
if (takeOldStep.Equals(TakeOldStep.None))
{
info.OldSteel = 0;
takeOldStep.Msg = info.Name + " 查找回收钢板任务";
takeOldStep.NextStep(TakeOldStep.FindLine);
}
else if (takeOldStep.Equals(TakeOldStep.FindLine))
{
if (info.OldSteel == 5)
{
takeOldStep.Msg = info.Name + "钢板已满";
takeOldStep.Msg = info.Name + " 回收钢板已满";
takeOldStep.NextStep(TakeOldStep.GoWashPoint);
}
else
......@@ -45,8 +46,9 @@ namespace BLL
if (move.IsEnd)
{
info.OldSteel++;
SteelManage.OldSteelWorkDel(info.Place);
takeOldStep.NextStep(TakeOldStep.FindLine);
takeOldStep.Msg = _info.Name + "到达" + _info.Place;
takeOldStep.Msg = _info.Name + " 到达" + _info.Place;
}
}
else if (takeOldStep.Equals(TakeOldStep.GoWashPoint))
......@@ -56,7 +58,7 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
takeOldStep.NextStep(TakeOldStep.WaitWashPoint);
takeOldStep.Msg = _info.Name + "发送任务" + mission;
takeOldStep.Msg = _info.Name + " 发送任务 " + mission;
}
else if (takeOldStep.Equals(TakeOldStep.WaitWashPoint))
{
......@@ -64,7 +66,7 @@ namespace BLL
if (move.IsEnd)
{
takeOldStep.NextStep(TakeOldStep.End);
takeOldStep.Msg = _info.Name + "到达" + _info.Workshop + "清洗点";
takeOldStep.Msg = _info.Name + " 到达" + _info.Workshop + "清洗点";
}
}
else if (takeOldStep.Equals(TakeOldStep.End))
......@@ -90,12 +92,12 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
takeOldStep.NextStep(TakeOldStep.MoveLine);
takeOldStep.Msg = _info.Name + "发送任务" + mission;
takeOldStep.Msg = _info.Name + " 发送任务 " + mission;
}
else
{
takeOldStep.NextStep(TakeOldStep.GoWashPoint);
takeOldStep.Msg = info.Name + "没有后续旧钢板任务";
takeOldStep.Msg = info.Name + " 没有后续旧钢板任务";
}
}
......
......@@ -39,18 +39,27 @@ namespace BLL
move.Execute(_info);
if (move.IsEnd)
{
SteelManage.NewSteelWorkDel(_info.From, _info.Place);
washPointStep.NextStep(WashPointStep.End);
washPointStep.Msg = _info.Name + "到达清洗点";
washPointStep.Msg = _info.Name + " 到达清洗点";
}
}
else if (washPointStep.Equals(WashPointStep.End))
{
IJob job = SteelManage.GetSteelJob(info);
IJob job = SteelManage.GetNewSteelJob(info);
if (job == null)
{
job = SteelManage.GetSteelJob(info);
if (job == null)
return new StandbyJob();
else
return job;
}
else
{
return job;
}
}
return this;
}
......@@ -58,11 +67,12 @@ namespace BLL
private void MoveWash()
{
mission = Common.MISSION_MOVE_WASH + _info.Workshop;
_info.Place = mission;
_info.From = _info.Workshop + "WASH";
_info.Place = _info.Workshop + "WASH";
move = new MoveJob(mission);
move.Execute(_info);
washPointStep.NextStep(WashPointStep.MoveWash);
washPointStep.Msg = _info.Name + "发送任务" + mission;
washPointStep.Msg = _info.Name + " 发送任务 " + mission;
}
private void PassDoor()
......@@ -72,7 +82,7 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
washPointStep.NextStep(WashPointStep.PassDoor);
washPointStep.Msg = _info.Name + "发送任务" + mission;
washPointStep.Msg = _info.Name + " 发送任务 " + mission;
}
......
......@@ -49,7 +49,7 @@ namespace BLL
_msg = value;
string s = string.Format("{0} (step={1})", _msg, _step.ToString());
Model.Common.log.Info(s);
Model.Common.log.UI_Display(s);
Model.Common.log.UI_Display(_msg);
}
}
......
......@@ -14,6 +14,7 @@ namespace BLL
#region OldSteelWork
public static void OldSteelWorkAdd(string place)
{
place = place.ToUpper();
int index = oldSteelWork.FindIndex(sw => sw.Place == place);
if (index == -1)
{
......@@ -77,7 +78,7 @@ namespace BLL
int lineIdx = Common.agvLines.FindIndex(s => s.Workshop == info.Workshop);
if (lineIdx == -1) return false;
int placeIdx = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == info.Place);
if (placeIdx == -1) return false;
if (placeIdx == -1) placeIdx = 0;
for (int i = placeIdx; i < Common.agvLines[lineIdx].Lines.Length; i++)
{
......@@ -98,7 +99,10 @@ namespace BLL
#region NewSteelWork
public static void NewSteelWorkAdd(string from, string place)
{
from = from.ToUpper();
place = place.ToUpper();
int index = newSteelWork.FindIndex(sw => sw.From == from && sw.Place == place);
if (index == -1)
{
SteelWork sw = new SteelWork() { From = from, Place = place };
......@@ -114,8 +118,10 @@ namespace BLL
public static void NewSteelWorkAdd(string from, string[] place)
{
from = from.ToUpper();
for (int i = 0; i < place.Length; i++)
{
place[i] = place[i].ToUpper();
int index = newSteelWork.FindIndex(sw => sw.From == from && sw.Place == place[i]);
if (index == -1)
{
......@@ -209,6 +215,7 @@ namespace BLL
#region StorageWork
public static void StorageWorkAdd(string place)
{
place = place.ToUpper();
int index = storageWork.FindIndex(sw => sw.Place == place);
if (index == -1)
{
......@@ -266,19 +273,40 @@ namespace BLL
public static bool FindStorageWork(AgvInfo info, out string place)
{
place = "";
int lineIdx = Common.agvLines.FindIndex(s => s.Workshop == info.Workshop);
if (lineIdx == -1) return false;
int index = storageWork.FindIndex(sw => sw.Place.StartsWith(info.Workshop));
if (index == -1)
bool find = false;
for (int i = 0; i < storageWork.Count; i++)
{
place = "";
return false;
}
else
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == storageWork[i].Place);
if (index > -1)
{
place = storageWork[index].Place;
return true;
place = storageWork[i].Place;
find = true;
break;
}
}
return find;
}
public static bool FindStorageWork(AgvInfo info)
{
int lineIdx = Common.agvLines.FindIndex(s => s.Workshop == info.Workshop);
if (lineIdx == -1) return false;
bool find = false;
for (int i = 0; i < storageWork.Count; i++)
{
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == storageWork[i].Place);
if (index > -1)
{
find = true;
break;
}
}
return find;
}
public static bool FindStorageWorkLeave()
......@@ -306,11 +334,6 @@ namespace BLL
#endregion
//public static bool FindWork(AgvInfo info)
//{
//}
public static IJob GetSteelJob(AgvInfo info)
{
if (info.Battery < info.BatteryMin)
......@@ -325,7 +348,6 @@ namespace BLL
rtn = GetWash(info);
if (rtn)
{
//info.SteelFrom = newSteelWork[newSteelIndex].From;
Common.log.Info(info.Workshop + "清洗点呼叫");
return new WashPointJob();
}
......@@ -339,7 +361,6 @@ namespace BLL
rtn = GetStorage(info);
if (rtn)
{
//info.SteelFrom = "storage";
Common.log.Info("4D仓库呼叫");
return new StorageJob();
}
......@@ -367,6 +388,28 @@ namespace BLL
return null;
}
public static IJob GetNewSteelJob(AgvInfo info)
{
bool rtn = GetNewSteel(info);
if (rtn)
{
Common.log.Info(info.Workshop + "送新钢板呼叫");
return new SendNewJob();
}
else
{
Common.log.Debug("没有找到" + info.Workshop + "送新钢板呼叫");
return null;
}
}
private static bool GetWash(AgvInfo info)
......@@ -379,7 +422,7 @@ namespace BLL
{
if (newSteelWork[i].From == newSteelWork[i].Place)
{
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == oldSteelWork[i].Place);
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == newSteelWork[i].Place);
if (index > -1)
{
find = true;
......@@ -408,27 +451,43 @@ namespace BLL
return find;
}
private static bool GetStorage(AgvInfo info)
private static bool GetNewSteel(AgvInfo info)
{
int lineIdx = Common.agvLines.FindIndex(s => s.Workshop == info.Workshop);
if (lineIdx == -1) return false;
bool find = false;
for (int i = 0; i < storageWork.Count; i++)
for (int i = 0; i < newSteelWork.Count; i++)
{
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == storageWork[i].Place);
if (newSteelWork[i].From == info.From)
{
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == newSteelWork[i].Place);
if (index > -1)
{
find = true;
break;
}
}
}
return find;
}
private static bool GetStorage(AgvInfo info)
{
int lineIdx = Common.agvLines.FindIndex(s => s.Workshop == info.Workshop);
if (lineIdx == -1) return false;
bool find = false;
for (int i = 0; i < storageWork.Count; i++)
{
if (storageWork[i].Place == info.Workshop + "_ENTER")
{
find = true;
break;
}
}
return find;
}
private static void SaveOldSteelWork()
{
......@@ -437,8 +496,11 @@ namespace BLL
content[i] = oldSteelWork[i].Place + "," + oldSteelWork[i].DateTime.ToString();
if (Common.lstOldSteel != null)
{
Common.lstOldSteel.Invoke(new Action(() =>
{
Common.lstOldSteel.Items.Clear();
Common.lstOldSteel.Items.AddRange(content);
}));
}
System.IO.File.WriteAllLines(Common.PATH_OLD_STEEL_WORK, content, System.Text.Encoding.UTF8);
}
......@@ -450,8 +512,11 @@ namespace BLL
content[i] = newSteelWork[i].From + "," + newSteelWork[i].Place + "," + newSteelWork[i].DateTime.ToString();
if (Common.lstNewSteel != null)
{
Common.lstNewSteel.Invoke(new Action(() =>
{
Common.lstNewSteel.Items.Clear();
Common.lstNewSteel.Items.AddRange(content);
}));
}
System.IO.File.WriteAllLines(Common.PATH_NEW_STEEL_WORK, content, System.Text.Encoding.UTF8);
}
......@@ -463,8 +528,11 @@ namespace BLL
content[i] = storageWork[i].Place + "," + storageWork[i].DateTime.ToString();
if (Common.lstStorage != null)
{
Common.lstStorage.Invoke(new Action(() =>
{
Common.lstStorage.Items.Clear();
Common.lstStorage.Items.AddRange(content);
}));
}
System.IO.File.WriteAllLines(Common.PATH_STORAGE_WORK, content, System.Text.Encoding.UTF8);
}
......
7064026118c881cf53f37963fb3a012bf156bc71
3b6cfc6b8015e6bae558763a064e06e7f6d7d448
......@@ -12,3 +12,17 @@ D:\Neotel_Beta\AGVControl_Steel\BLL\obj\Debug\BLL.csproj.CopyComplete
D:\Neotel_Beta\AGVControl_Steel\BLL\obj\Debug\BLL.dll
D:\Neotel_Beta\AGVControl_Steel\BLL\obj\Debug\BLL.pdb
D:\Neotel_Beta\AGVControl_Steel\BLL\bin\Debug\log4net.config
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\log4net.config
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\BLL.dll
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\BLL.pdb
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\Model.dll
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\log4net.dll
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\RestSharp.dll
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\Model.pdb
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\log4net.xml
D:\Neotel\AGVControl_Steel\BLL\bin\Debug\RestSharp.xml
D:\Neotel\AGVControl_Steel\BLL\obj\Debug\BLL.csprojAssemblyReference.cache
D:\Neotel\AGVControl_Steel\BLL\obj\Debug\BLL.csproj.CoreCompileInputs.cache
D:\Neotel\AGVControl_Steel\BLL\obj\Debug\BLL.csproj.CopyComplete
D:\Neotel\AGVControl_Steel\BLL\obj\Debug\BLL.dll
D:\Neotel\AGVControl_Steel\BLL\obj\Debug\BLL.pdb
......@@ -73,6 +73,8 @@ namespace Model
/// </summary>
public IJob CurrentJob { set; get; } = null;
public string From { set; get; } = "";
public string Place { set; get; } = "";
public int OldSteel { set; get; } = 0;
......
......@@ -5,7 +5,7 @@ namespace Model
{
public static class Common
{
public static MiR_API mir;
public static MiR_API mir; //asa
public static Log log;
public static List<AgvInfo> agvInfos;
......@@ -25,15 +25,17 @@ namespace Model
public static bool StorageDockAlway = false; //指定停靠状态,一直不改变
public const string STORAGE_ENTER_4C = "4C_enter";
public const string STORAGE_ENTER_4D = "4D_enter";
public const string STORAGE_LEAVE = "leave";
public const string STORAGE_ENTER_4C = "4C_ENTER";
public const string STORAGE_ENTER_4D = "4D_ENTER";
public const string STORAGE_LEAVE = "LEAVE";
public const string STORAGE_IO_ON = "di_on";
public const string STORAGE_IO_OFF = "di_off";
public const string MISSION_TAKE_OFF_SHELF = "Placeqisdashelf";
public const string MISSION_TAKE_ON_SHELF = "Pickupqisdashelf";
public const string MISSION_PASS_DOOR_INTO = "PassDoorInto";
public const string MISSION_PASS_DOOR_4D = "PassDoorInto4D";
public const string MISSION_PASS_DOOR_4C = "PassDoorInto4C";
public const string MISSION_CHARGE = "AutoCharge";
public const string MISSION_STANDBY = "MoveStandby";
public const string MISSION_MOVE_WASH = "MoveWash";
......
......@@ -37,9 +37,14 @@ namespace Model
{
if (LogBox == null) return;
string time = string.Format("[{0:HH:mm:ss}] ", DateTime.Now);
LogBox.Invoke(new Action(() =>
{
LogBox.AppendText(time + s + "\r\n");
//LogBox.SelectionStart = LogBox.Text.Length;
LogBox.ScrollToCaret();
}));
}
}
......
......@@ -315,7 +315,12 @@ namespace Model
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
if (dic == null) return false;
id = dic["id"].ToString();
if (dic.TryGetValue("id", out object value))
id = value.ToString();
else
return false;
string missionId = dic["mission_id"].ToString();
if (missionId == MissionList[missionName])
return true;
......
using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
using RestSharp;
namespace Model
{
/// <summary>
/// MiR小车API
/// </summary>
public class MiR_API_Test
{
private int count;
/// <summary>
/// Fleet的IP地址
/// </summary>
public string FleetIP { set; get; }
/// <summary>
/// 任务列表
/// </summary>
public Dictionary<string, string> MissionList { set; get; }
/// <summary>
/// MiR小车API
/// </summary>
public MiR_API_Test()
{
}
/// <summary>
/// 获取IO模块guid列表
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <param name="guid"></param>
/// <returns></returns>
public bool Get_IO_Modules(string ip, string authorization, out string[] guid)
{
guid = new string[] { "1234", "5678" };
return true;
}
/// <summary>
/// 获取IO模块的状态
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <param name="guid"></param>
/// <param name="input"></param>
/// <param name="output"></param>
/// <returns></returns>
public bool Get_IO_Status(string ip, string authorization, string guid, out bool[] input, out bool[] output)
{
input = new bool[] { true, true, true, true };
output = new bool[] { true, true, true, true };
return true;
}
/// <summary>
/// 获取任务状态
/// </summary>
/// <param name="authorization"></param>
/// <param name="id"></param>
/// <param name="state"></param>
/// <returns></returns>
public bool Get_MissionState_Fleet(string authorization, string id, out string state)
{
if (count == 1)
state = "Done";
else
{
state = "Executing";
count++;
}
return true;
}
/// <summary>
/// 获取任务状态
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <param name="id"></param>
/// <param name="state"></param>
/// <returns></returns>
public bool Get_MissionState(string ip, string authorization, string id, out string state)
{
state = "";
return true;
}
/// <summary>
/// 获取PLC寄存器的内容
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <param name="reg"></param>
/// <param name="regValue"></param>
/// <returns></returns>
public bool Get_Register(string ip, string authorization, int reg, out int regValue)
{
regValue = 1;
return true;
}
/// <summary>
/// 设置PLC寄存器的内容
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <param name="reg"></param>
/// <param name="regValue"></param>
/// <returns></returns>
public bool Set_Register(string ip, string authorization, int reg, int regValue)
{
return true;
}
/// <summary>
/// 添加任务到小车自身任务队列
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <param name="missionName"></param>
/// <param name="id"></param>
/// <returns></returns>
public bool Add_Mission(string ip, string authorization, string missionName, out string id)
{
id = "123";
return true;
}
/// <summary>
/// 添加任务到Fleet任务队列
/// </summary>
/// <param name="fleetID"></param>
/// <param name="authorization"></param>
/// <param name="missionName"></param>
/// <param name="id"></param>
/// <returns></returns>
public bool Add_Mission_Fleet(string fleetID, string authorization, string missionName, out string id)
{
id = "123";
count = 0;
return true;
}
/// <summary>
/// 删除小车所有任务
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
public void Del_Mission(string ip, string authorization)
{
}
/// <summary>
/// 删除Fleet尽快中指定id的任务,已运行的无法删除
/// </summary>
/// <param name="authorization"></param>
/// <param name="id"></param>
public void Del_Mission_Fleet(string authorization, string id)
{
}
/// <summary>
/// 获取当前小车状态
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <param name="stateID"></param>
/// <param name="stateText"></param>
/// <param name="battery"></param>
/// <param name="missionText"></param>
/// <param name="position"></param>
/// <returns></returns>
public bool Get_State(string ip, string authorization, out int stateID, out string stateText, out int battery, out string missionText, out System.Drawing.PointF position)
{
stateID = -1;
stateText = "123";
battery = 90;
missionText = "fgfg";
if (ip == "10.85.199.82")
position = new System.Drawing.PointF(0, 65);
else if (ip == "10.85.199.84")
position = new System.Drawing.PointF(0, 50);
else
position = new System.Drawing.PointF();
return true;
}
/// <summary>
/// 小车状态改为Ready
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <returns></returns>
public bool State_Ready(string ip, string authorization)
{
return true;
}
/// <summary>
/// 小车状态改为Pause
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <returns></returns>
public bool State_Pause(string ip, string authorization)
{
return true;
}
/// <summary>
/// 清除错误
/// </summary>
/// <param name="ip"></param>
/// <param name="authorization"></param>
/// <returns></returns>
public bool Clear_Error(string ip, string authorization)
{
return true;
}
public bool CheckIP(string ip)
{
return true;
}
}
}
......@@ -60,6 +60,7 @@
<Compile Include="IJob.cs" />
<Compile Include="Log.cs" />
<Compile Include="MiR_API.cs" />
<Compile Include="MiR_API_Test.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SteelWork.cs" />
<Compile Include="WorkshopLine.cs" />
......
d480f537fc8054565c9d1586e5e41d9a7a213025
067396c83b7f2774c2cefca8b57e624dd8067a35
......@@ -10,3 +10,15 @@ D:\Neotel_Beta\AGVControl_Steel\Model\obj\Debug\Model.dll
D:\Neotel_Beta\AGVControl_Steel\Model\obj\Debug\Model.pdb
D:\Neotel_Beta\AGVControl_Steel\Model\bin\Debug\log4net.config
D:\Neotel_Beta\AGVControl_Steel\Model\obj\Debug\Model.csprojAssemblyReference.cache
D:\Neotel\AGVControl_Steel\Model\bin\Debug\log4net.config
D:\Neotel\AGVControl_Steel\Model\bin\Debug\Model.dll
D:\Neotel\AGVControl_Steel\Model\bin\Debug\Model.pdb
D:\Neotel\AGVControl_Steel\Model\bin\Debug\log4net.dll
D:\Neotel\AGVControl_Steel\Model\bin\Debug\RestSharp.dll
D:\Neotel\AGVControl_Steel\Model\bin\Debug\log4net.xml
D:\Neotel\AGVControl_Steel\Model\bin\Debug\RestSharp.xml
D:\Neotel\AGVControl_Steel\Model\obj\Debug\Model.csproj.CoreCompileInputs.cache
D:\Neotel\AGVControl_Steel\Model\obj\Debug\Model.csproj.CopyComplete
D:\Neotel\AGVControl_Steel\Model\obj\Debug\Model.dll
D:\Neotel\AGVControl_Steel\Model\obj\Debug\Model.pdb
D:\Neotel\AGVControl_Steel\Model\obj\Debug\Model.csprojAssemblyReference.cache
......@@ -189,7 +189,7 @@ namespace AGVControl_Steel
{
if (LstOldSteel.SelectedIndex == -1) return;
string[] arr = LstOldSteel.Text.Split(',');
string text = "手动删除【" + arr[0] + "】回收钢板任务";
string text = "手动删除回收钢板任务 " + arr[0];
DialogResult dr = MessageBox.Show(text, "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (dr == DialogResult.Yes)
{
......
......@@ -44,7 +44,7 @@ namespace AGVControl_Steel
{
Common.appConfig = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None);
Common.FLEET_SEND = Convert.ToBoolean(Common.appConfig.AppSettings.Settings["FLEET_Send"].Value);
Common.mir = new MiR_API { FleetIP = Common.appConfig.AppSettings.Settings["FLEET_IP"].Value };
Common.mir = new MiR_API { FleetIP = Common.appConfig.AppSettings.Settings["FLEET_IP"].Value }; //asa
ReadAgvInfo();
ReadAgvMission();
ReadAgvLine();
......
此文件类型无法预览
此文件类型无法预览
4D,D1,D2,D3,D4,D5,D6,D8,D9,D10,D11,D12,D14,D15,D16,4Dwash,storage
4C,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,4Cwash
\ No newline at end of file
4D,D1,D2,D3,D4,D5,D6,D8,D9,D10,D11,D12,D14,D15,D16,4DWASH,STORAGE
4C,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,4CWASH
\ No newline at end of file
32,11号_4C,10.85.199.82,4C,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
25,13号_4D,10.85.199.84,4D,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
\ No newline at end of file
11,11号_4C,10.85.199.82,4C,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
12,13号_4D,10.85.199.84,4D,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
\ No newline at end of file

\ No newline at end of file
[2020-10-21 10:04:07,085][1][AGVControl_Steel:18]INFO =====程序开始=====
[2020-10-21 10:04:07,149][1][AGVControl_Steel:18]INFO 读取配置文件 D:\Neotel\AGVControl_Steel\UI\bin\Debug\Config\AgvName.csv
[2020-10-21 10:04:07,151][1][AGVControl_Steel:18]INFO 读取配置文件 D:\Neotel\AGVControl_Steel\UI\bin\Debug\Config\AgvMission.csv
[2020-10-21 10:04:07,153][1][AGVControl_Steel:18]INFO 读取配置文件 D:\Neotel\AGVControl_Steel\UI\bin\Debug\Config\AgvLine.txt
[2020-10-21 10:04:07,266][1][AGVControl_Steel:18]INFO 加载回收钢板任务
[2020-10-21 10:04:07,281][1][AGVControl_Steel:18]INFO 加载送新钢板任务
[2020-10-21 10:04:07,282][1][AGVControl_Steel:18]INFO 加载仓库钢板任务
[2020-10-21 10:04:08,511][1][AGVControl_Steel:18]INFO Web服务已开启
[2020-10-21 10:04:10,134][8][AGVControl_Steel:23]DEBUG 11号_4C[10.85.199.82] 脱机
[2020-10-21 10:04:12,132][8][AGVControl_Steel:23]DEBUG 13号_4D[10.85.199.84] 脱机
[2020-10-21 10:04:12,132][9][AGVControl_Steel:23]DEBUG 11号_4C[10.85.199.82] 脱机
[2020-10-21 10:04:14,141][9][AGVControl_Steel:23]DEBUG 13号_4D[10.85.199.84] 脱机
[2020-10-21 10:04:14,142][8][AGVControl_Steel:23]DEBUG 11号_4C[10.85.199.82] 脱机
[2020-10-21 10:04:16,018][1][AGVControl_Steel:18]INFO Web服务已关闭
[2020-10-21 10:04:16,041][1][AGVControl_Steel:18]INFO =====程序结束=====
此文件的差异太大,无法显示。
[2020-10-21 10:04:10,132][8][MiR_API:614]INFO Ping 10.85.199.82 请求没有响应
[2020-10-21 10:04:12,131][8][MiR_API:614]INFO Ping 10.85.199.84 请求没有响应
[2020-10-21 10:04:12,132][9][MiR_API:614]INFO Ping 10.85.199.82 请求没有响应
[2020-10-21 10:04:14,141][9][MiR_API:614]INFO Ping 10.85.199.84 请求没有响应
[2020-10-21 10:04:14,141][8][MiR_API:614]INFO Ping 10.85.199.82 请求没有响应
此文件的差异太大,无法显示。
f653881c86976e85b8a19161c143cb745ecc0339
2858df09001d9a0041d7edb18b50efb3e8fd2b88
......@@ -18,3 +18,23 @@ D:\Neotel_Beta\AGVControl_Steel\UI\obj\Debug\UI.csproj.CopyComplete
D:\Neotel_Beta\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.exe
D:\Neotel_Beta\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.pdb
D:\Neotel_Beta\AGVControl_Steel\UI\bin\Debug\log4net.config
D:\Neotel\AGVControl_Steel\UI\bin\Debug\log4net.config
D:\Neotel\AGVControl_Steel\UI\bin\Debug\AGVControl_Steel.exe.config
D:\Neotel\AGVControl_Steel\UI\bin\Debug\AGVControl_Steel.exe
D:\Neotel\AGVControl_Steel\UI\bin\Debug\AGVControl_Steel.pdb
D:\Neotel\AGVControl_Steel\UI\bin\Debug\BLL.dll
D:\Neotel\AGVControl_Steel\UI\bin\Debug\Model.dll
D:\Neotel\AGVControl_Steel\UI\bin\Debug\log4net.dll
D:\Neotel\AGVControl_Steel\UI\bin\Debug\RestSharp.dll
D:\Neotel\AGVControl_Steel\UI\bin\Debug\BLL.pdb
D:\Neotel\AGVControl_Steel\UI\bin\Debug\Model.pdb
D:\Neotel\AGVControl_Steel\UI\bin\Debug\log4net.xml
D:\Neotel\AGVControl_Steel\UI\bin\Debug\RestSharp.xml
D:\Neotel\AGVControl_Steel\UI\obj\Debug\UI.csprojAssemblyReference.cache
D:\Neotel\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.FrmMain.resources
D:\Neotel\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.Properties.Resources.resources
D:\Neotel\AGVControl_Steel\UI\obj\Debug\UI.csproj.GenerateResource.cache
D:\Neotel\AGVControl_Steel\UI\obj\Debug\UI.csproj.CoreCompileInputs.cache
D:\Neotel\AGVControl_Steel\UI\obj\Debug\UI.csproj.CopyComplete
D:\Neotel\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.exe
D:\Neotel\AGVControl_Steel\UI\obj\Debug\AGVControl_Steel.pdb
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件类型无法预览
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!