Commit e4d29273 顾剑亮

debug

1 个父辈 b91dc470
......@@ -58,12 +58,17 @@ namespace BLL
if (info.StateID == (int)StateID.Pause)
Common.mir.State_Ready(info.IP, info.Authorization);
position[i] = new PointF(Common.agvInfos[i].Position.X, Common.agvInfos[i].Position.Y);
if (info.CurrentJob == null)
{
//软件刚打开时,防止有任务在运行
Common.mir.Del_Mission(info.IP, info.Authorization);
info.CurrentJob = new StandbyJob();
}
else
{
info.CurrentJob = info.CurrentJob.Execute(info);
}
}
catch (Exception ex)
{
......@@ -131,32 +136,47 @@ namespace BLL
{
for (int i = 0; i < Common.agvInfos.Count; i++)
{
if (Common.agvInfos[i].CurrentJob == null
|| Common.agvInfos[i].CurrentJob is ChargeJob
|| Common.agvInfos[i].CurrentJob is StandbyJob)
if (Common.agvInfos[i].CurrentJob == null)
{
timeout[i] = DateTime.Now;
continue;
}
if (Math.Abs(Common.agvInfos[i].Position.X - position[i].X) < 2
&& Math.Abs(Common.agvInfos[i].Position.Y - position[i].Y) < 2)
string name = "";
if (Common.agvInfos[i].Name.IndexOf("11") >= 0)
name = "11号车";
else if (Common.agvInfos[i].Name.IndexOf("13") >= 0)
name = "13号车";
if (Math.Abs(Common.agvInfos[i].Position.X - position[i].X) < 2 && Math.Abs(Common.agvInfos[i].Position.Y - position[i].Y) < 2)
{
TimeSpan span = DateTime.Now - timeout[i];
if (span.TotalMinutes >= 2)
if (span.TotalMinutes >= Common.BoardTimeout)
{
string name = "";
if (Common.agvInfos[i].Name.IndexOf("11") >= 0)
name = "11号车";
else if (Common.agvInfos[i].Name.IndexOf("13") >= 0)
name = "13号车";
string value = string.Format("{0}在{1}停留超时2分钟以上", name, Common.agvInfos[i].Place);
DisplayBoard.Add(name, "lineAgv." + name + ".StandTimeOut", value);
if (Common.agvInfos[i].CurrentJob is ChargeJob)
{
DisplayBoard.Add(name, "lineAgv." + name + ".Place", "AutoCharge", 1);
}
else if (Common.agvInfos[i].CurrentJob is StandbyJob)
{
DisplayBoard.Add(name, "lineAgv." + name + ".Place", "Standby", 1);
}
else
{
string value = string.Format("在{0}停留超时{1:F}分钟", Common.agvInfos[i].Place, span.TotalMinutes);
DisplayBoard.Add(name, "lineAgv." + name + ".StandTimeOut", value, 0);
}
}
else
{
DisplayBoard.Add(name, "lineAgv." + name + ".Msg", Common.agvInfos[i].CurrentJob.Msg, 1);
}
}
else
{
DisplayBoard.Add(name, "lineAgv." + name + ".Msg", Common.agvInfos[i].CurrentJob.Msg, 1);
timeout[i] = DateTime.Now;
position[i] = new PointF(Common.agvInfos[i].Position.X, Common.agvInfos[i].Position.Y);
}
}
......
......@@ -20,11 +20,20 @@ namespace BLL
public bool IsEnd { get; private set; }
public string Msg
{
get
{
return chargeStep.Msg;
}
}
public IJob Execute(AgvInfo info)
{
_info = info;
if (chargeStep.Equals(ChargeStep.None))
{
_info.From = "";
currBattery = _info.Battery;
if (_info.IsWorkspace())
MoveCharge();
......@@ -77,17 +86,17 @@ 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()
{
mission = Common.MISSION_PASS_DOOR_INTO + _info.Workshop;
_info.Place = mission;
_info.Place = "Pass Door";
move = new MoveJob(mission);
move.Execute(_info);
chargeStep.NextStep(ChargeStep.PassDoor);
chargeStep.Msg = _info.Name + " 发送任务 " + mission;
chargeStep.Msg = _info.Name + " 发送充电任务 " + mission;
}
private void MoveStation()
......
......@@ -20,6 +20,14 @@ namespace BLL
public bool IsEnd { get; private set; }
public string Msg
{
get
{
return moveStep.Msg;
}
}
public IJob Execute(AgvInfo info)
{
_info = info;
......
......@@ -19,11 +19,20 @@ namespace BLL
public bool IsEnd { get; private set; }
public string Msg
{
get
{
return sendNewStep.Msg;
}
}
public IJob Execute(AgvInfo info)
{
_info = info;
if (sendNewStep.Equals(SendNewStep.None))
{
_info.From = "";
if (_info.IsWorkspace())
sendNewStep.NextStep(SendNewStep.FindLine);
else
......@@ -83,7 +92,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()
......@@ -94,11 +103,11 @@ namespace BLL
private void PassDoor()
{
mission = Common.MISSION_PASS_DOOR_INTO + _info.Workshop;
_info.Place = mission;
_info.Place = "Pass Door";
move = new MoveJob(mission);
move.Execute(_info);
sendNewStep.NextStep(SendNewStep.PassDoor);
sendNewStep.Msg = _info.Name + " 发送任务 " + mission;
sendNewStep.Msg = _info.Name + " 发送过门任务 " + mission;
}
private enum SendNewStep
......
......@@ -8,7 +8,7 @@ namespace BLL
private AgvInfo _info;
private MoveJob move;
private string mission;
private DateTime _getTime;
//private DateTime _getTime;
private JobStep<StandbyStep> standbyStep;
public StandbyJob()
......@@ -19,11 +19,20 @@ namespace BLL
public bool IsEnd { get; private set; }
public string Msg
{
get
{
return standbyStep.Msg;
}
}
public IJob Execute(AgvInfo info)
{
_info = info;
if (standbyStep.Equals(StandbyStep.None))
{
_info.From = "";
if (_info.IsWorkspace())
MoveStandby();
else
......@@ -42,7 +51,6 @@ namespace BLL
{
standbyStep.NextStep(StandbyStep.End);
standbyStep.Msg = _info.Name + " 到达待机位";
_getTime = DateTime.Now;
}
}
else if (standbyStep.Equals(StandbyStep.End))
......@@ -54,10 +62,9 @@ namespace BLL
}
else
{
TimeSpan span = DateTime.Now - _getTime;
if (span.TotalMinutes >= 2)
if (_info.Battery <= 80)
{
standbyStep.Msg = _info.Name + " 在待机位停留超过2分钟,执行充电任务";
standbyStep.Msg = _info.Name + " 电量小于80%,执行充电任务";
return new ChargeJob();
}
else
......@@ -78,17 +85,17 @@ 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()
{
mission = Common.MISSION_PASS_DOOR_INTO + _info.Workshop;
_info.Place = mission;
_info.Place = "Pass Door";
move = new MoveJob(mission);
move.Execute(_info);
standbyStep.NextStep(StandbyStep.PassDoor);
standbyStep.Msg = _info.Name + " 发送任务 " + mission;
standbyStep.Msg = _info.Name + " 发送过门任务 " + mission;
}
private enum StandbyStep
......
......@@ -20,11 +20,20 @@ namespace BLL
public bool IsEnd { get; private set; }
public string Msg
{
get
{
return storageStep.Msg;
}
}
public IJob Execute(AgvInfo info)
{
_info = info;
if (storageStep.Equals(StorageStep.None))
{
_info.From = "";
if (_info.Is4DWorkshop())
MoveStorage();
else
......@@ -151,7 +160,7 @@ namespace BLL
private void PassDoor4C()
{
mission = Common.MISSION_PASS_DOOR_4C;
_info.Place = mission;
_info.Place = "Pass Door";
move = new MoveJob(mission);
move.Execute(_info);
storageStep.NextStep(StorageStep.BackDoor);
......@@ -161,7 +170,7 @@ namespace BLL
private void PassDoor4D()
{
mission = Common.MISSION_PASS_DOOR_4D;
_info.Place = mission;
_info.Place = "Pass Door";
move = new MoveJob(mission);
move.Execute(_info);
storageStep.NextStep(StorageStep.PassDoor);
......
......@@ -15,15 +15,25 @@ namespace BLL
{
takeOldStep = new JobStep<TakeOldStep>(TakeOldStep.None);
Common.log.Debug("加载TakeOldJob");
SteelManage.OldSteelWorkDel();
}
public bool IsEnd { get; private set; }
public string Msg
{
get
{
return takeOldStep.Msg;
}
}
public IJob Execute(AgvInfo info)
{
_info = info;
if (takeOldStep.Equals(TakeOldStep.None))
{
_info.From = "";
info.OldSteel = 0;
takeOldStep.Msg = info.Name + " 查找回收钢板任务";
takeOldStep.NextStep(TakeOldStep.FindLine);
......@@ -53,12 +63,20 @@ namespace BLL
}
else if (takeOldStep.Equals(TakeOldStep.GoWashPoint))
{
mission = Common.MISSION_MOVE_WASH + _info.Workshop;
_info.Place = mission;
move = new MoveJob(mission);
move.Execute(_info);
takeOldStep.NextStep(TakeOldStep.WaitWashPoint);
takeOldStep.Msg = _info.Name + " 发送任务 " + mission;
if (info.OldSteel == 0)
{
takeOldStep.NextStep(TakeOldStep.End);
takeOldStep.Msg = _info.Name + " 回收钢板数量为0,结束任务";
}
else
{
mission = Common.MISSION_MOVE_WASH + _info.Workshop;
_info.Place = mission;
move = new MoveJob(mission);
move.Execute(_info);
takeOldStep.NextStep(TakeOldStep.WaitWashPoint);
takeOldStep.Msg = _info.Name + " 发送回收钢板任务 " + mission;
}
}
else if (takeOldStep.Equals(TakeOldStep.WaitWashPoint))
{
......@@ -92,7 +110,7 @@ namespace BLL
move = new MoveJob(mission);
move.Execute(_info);
takeOldStep.NextStep(TakeOldStep.MoveLine);
takeOldStep.Msg = _info.Name + " 发送任务 " + mission;
takeOldStep.Msg = _info.Name + " 发送回收钢板任务 " + mission;
}
else
{
......
......@@ -18,11 +18,20 @@ namespace BLL
public bool IsEnd { get; private set; }
public string Msg
{
get
{
return washPointStep.Msg;
}
}
public IJob Execute(AgvInfo info)
{
_info = info;
if (washPointStep.Equals(WashPointStep.None))
{
_info.From = "";
if (_info.IsWorkspace())
MoveWash();
else
......@@ -46,6 +55,7 @@ namespace BLL
}
else if (washPointStep.Equals(WashPointStep.End))
{
_info.Place = "";
IJob job = SteelManage.GetNewSteelJob(info);
if (job == null)
{
......@@ -78,7 +88,7 @@ namespace BLL
private void PassDoor()
{
mission = Common.MISSION_PASS_DOOR_INTO + _info.Workshop;
_info.Place = mission;
_info.Place = "Pass Door";
move = new MoveJob(mission);
move.Execute(_info);
washPointStep.NextStep(WashPointStep.PassDoor);
......
......@@ -44,6 +44,53 @@ namespace BLL
}
}
public static void OldSteelWorkDel()
{
if (!Common.WorkTimeoutDel) return;
int index = 0;
bool remove = false;
while (index < oldSteelWork.Count)
{
TimeSpan span = DateTime.Now - oldSteelWork[index].DateTime;
if (span.TotalMinutes >= Common.WorkTimeout)
{
oldSteelWork.RemoveAt(index);
remove = true;
}
else
{
index++;
}
}
if (remove)
{
SaveOldSteelWork();
Common.log.Info("删除超时" + Common.WorkTimeout + "分钟之前的所有回收钢板任务");
}
}
public static void OldSteelWorkDelAll(string workshop)
{
int lineIdx = Common.agvLines.FindIndex(s => s.Workshop == workshop);
if (lineIdx == -1) return;
int index = 0;
while (index < oldSteelWork.Count)
{
int idx = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == oldSteelWork[index].Place);
if (idx > -1)
oldSteelWork.RemoveAt(index);
else
index++;
}
SaveOldSteelWork();
Common.log.Info("删除" + workshop + "所有回收钢板任务");
}
public static void OldSteelWorkDelAll()
{
oldSteelWork.Clear();
......@@ -148,8 +195,51 @@ namespace BLL
}
else
{
Common.log.Info("没有找到(" + place + ")送新钢板任务");
Common.log.Info("没有找到(" + from + "," + place + ")送新钢板任务");
}
}
public static void NewSteelWorkDel()
{
if (!Common.WorkTimeoutDel) return;
int index = 0;
bool remove = false;
while (index < newSteelWork.Count)
{
TimeSpan span = DateTime.Now - newSteelWork[index].DateTime;
if (span.TotalMinutes >= Common.WorkTimeout)
{
newSteelWork.RemoveAt(index);
remove = true;
}
else
{
index++;
}
}
if (remove)
{
SaveNewSteelWork();
Common.log.Info("删除超时" + Common.WorkTimeout + "分钟之前的所有送新钢板任务");
}
}
public static void NewSteelWorkDelAll(string workshop)
{
int index = 0;
while (index < newSteelWork.Count)
{
int idx = newSteelWork.FindIndex(sw => sw.From == workshop + "WASH");
if (idx > -1)
newSteelWork.RemoveAt(index);
else
index++;
}
SaveNewSteelWork();
Common.log.Info("删除" + workshop + "wash所有送新钢板任务");
}
public static void NewSteelWorkDelAll()
......@@ -181,24 +271,50 @@ namespace BLL
public static bool FindNewSteelWork(AgvInfo info, out string place)
{
place = "";
string name = "";
bool find = false;
int lineIdx = Common.agvLines.FindIndex(s => s.Workshop == info.Workshop);
if (lineIdx == -1) return false;
for (int i = 0; i < Common.agvLines[lineIdx].Lines.Length; i++)
bool find = false;
for (int i = 0; i < newSteelWork.Count; i++)
{
name = Common.agvLines[lineIdx].Lines[i];
int idx = newSteelWork.FindIndex(s => s.Place == name);
if (idx > -1)
if (newSteelWork[i].Place == "STORAGE")
{
place = newSteelWork[i].Place;
info.From = newSteelWork[i].From;
find = true;
break;
}
else
{
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == newSteelWork[i].Place);
if (index > -1)
{
place = newSteelWork[i].Place;
info.From = newSteelWork[i].From;
find = true;
break;
}
}
}
place = name;
//for (int i = 0; i < Common.agvLines[lineIdx].Lines.Length; i++)
//{
// name = Common.agvLines[lineIdx].Lines[i];
// int idx = newSteelWork.FindIndex(s => s.Place == name);
// if (idx > -1)
// {
// info.From = newSteelWork[idx].From;
// find = true;
// break;
// }
//}
//place = name;
return find;
}
......@@ -245,6 +361,27 @@ namespace BLL
}
}
public static void StorageWorkDelAll(string workshop)
{
int lineIdx = Common.agvLines.FindIndex(s => s.Workshop == workshop);
if (lineIdx == -1) return;
int index = 0;
while (index < storageWork.Count)
{
int idx = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == storageWork[index].Place);
if (idx > -1)
storageWork.RemoveAt(index);
else
index++;
}
index = storageWork.FindIndex(sw => sw.Place == workshop + "_ENTER");
if (index > -1) storageWork.RemoveAt(index);
SaveStorageWork();
Common.log.Info("删除" + workshop + "仓库钢板任务");
}
public static void StorageWorkDelAll()
{
storageWork.Clear();
......@@ -348,12 +485,12 @@ namespace BLL
rtn = GetWash(info);
if (rtn)
{
Common.log.Info(info.Workshop + "清洗点呼叫");
Common.log.Info(info.Name + " " + info.Workshop + "清洗点呼叫");
return new WashPointJob();
}
else
{
Common.log.Debug("没有找到" + info.Workshop + "清洗点呼叫");
Common.log.Debug(info.Name + " 没有找到" + info.Workshop + "清洗点呼叫");
}
#endregion
......@@ -361,12 +498,12 @@ namespace BLL
rtn = GetStorage(info);
if (rtn)
{
Common.log.Info("4D仓库呼叫");
Common.log.Info(info.Name + " 4D仓库呼叫");
return new StorageJob();
}
else
{
Common.log.Debug("没有找到4D仓库呼叫");
Common.log.Debug(info.Name + " 没有找到4D仓库呼叫");
}
#endregion
......@@ -374,12 +511,12 @@ namespace BLL
rtn = GetOldSteel(info);
if (rtn)
{
Common.log.Info(info.Workshop + "回收钢板");
Common.log.Info(info.Name + " " + info.Workshop + "回收钢板");
return new TakeOldJob();
}
else
{
Common.log.Debug("没有找到" + info.Workshop + "回收钢板任务");
Common.log.Debug(info.Name + " 没有找到" + info.Workshop + "回收钢板任务");
}
#endregion
......@@ -393,12 +530,12 @@ namespace BLL
bool rtn = GetNewSteel(info);
if (rtn)
{
Common.log.Info(info.Workshop + "送新钢板呼叫");
Common.log.Info(info.Name + " " + info.Workshop + "送新钢板呼叫");
return new SendNewJob();
}
else
{
Common.log.Debug("没有找到" + info.Workshop + "送新钢板呼叫");
Common.log.Debug(info.Name + " 没有找到" + info.Workshop + "送新钢板呼叫");
return null;
}
......@@ -461,12 +598,20 @@ namespace BLL
{
if (newSteelWork[i].From == info.From)
{
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == newSteelWork[i].Place);
if (index > -1)
if (newSteelWork[i].Place.ToUpper() == "STORAGE")
{
find = true;
break;
}
else
{
int index = Array.FindIndex(Common.agvLines[lineIdx].Lines, s => s == newSteelWork[i].Place);
if (index > -1)
{
find = true;
break;
}
}
}
}
return find;
......
......@@ -80,7 +80,7 @@ namespace BLL
}
else
{
res = new Result { Code = -2, Msg = "Not Find" };
res = new Result { Code = -2, Msg = "Not Find " + place };
Common.log.Info("没有找到" + place);
}
}
......@@ -110,7 +110,7 @@ namespace BLL
}
else
{
res = new Result { Code = -2, Msg = "Not Find" };
res = new Result { Code = -2, Msg = "Not Find (" + from + "," + place + ")" };
Common.log.Info("没有找到" + place);
}
}
......@@ -158,7 +158,7 @@ namespace BLL
}
else
{
res = new Result { Code = -2, Msg = "Not Find" };
res = new Result { Code = -2, Msg = "Not Find " + place };
Common.log.Info("没有找到" + place);
}
}
......@@ -185,20 +185,29 @@ namespace BLL
private bool FindLine(string from, string[] place)
{
bool rtn = false;
for (int i = 0; i < Common.agvLines.Count; i++)
{
rtn = Common.agvLines[i].FindLine(from);
if (rtn)
if (from == "STORAGE")
rtn = true;
else
rtn = Common.agvLines[i].FindLine(from);
if (!rtn) continue;
for (int j = 0; j < place.Length; j++)
{
for (int j = 0; j < place.Length; j++)
if (place[j].ToUpper() == "STORAGE")
{
rtn = true;
}
else
{
rtn = Common.agvLines[i].FindLine(place[j]);
if (!rtn) return rtn;
if (!rtn) break;
}
return true;
}
if (rtn) break;
}
return false;
return rtn;
}
private string FindAgv()
......
......@@ -22,6 +22,10 @@ namespace Model
//public static string[] PLACE_NAME;
public static bool FLEET_SEND;
public static string BoardURL;
public static int BoardTimeout;
public static bool WorkTimeoutDel = false;
public static bool WorkAutoDel = false;
public static int WorkTimeout;
public static bool StorageDockFinish = false; //停靠完成
public static bool StorageDockAlway = false; //指定停靠状态,一直不改变
......
......@@ -6,6 +6,8 @@ namespace Model
{
public bool IsEnd { get; }
public string Msg { get; }
public IJob Execute(AgvInfo info);
}
......
......@@ -17,8 +17,8 @@ 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.csprojAssemblyReference.cache
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
......@@ -9,8 +9,12 @@
<add key="WebService" value="http://10.85.196.40:8089/"/>
<!--<add key="WebService" value="http://127.0.0.1:8089/"/>-->
<add key="Board" value="http://10.85.199.25/myproject/rest/api/qisda/device/updateDeviceAlarmMsg"/>
<add key="BoardTimeout" value="3"/>
<add key="AGV_BATTERY_MAX" value="100"/>
<add key="AGV_BATTERY_MIN" value="40"/>
<add key="WorkTimeout" value="10"/>
<add key="WorkTimeoutDel" value="false"/>
<add key="WorkAutoDel" value="false"/>
<add key="11号_4C" value="false"/>
<add key="13号_4D" value="false"/>
</appSettings>
......
......@@ -40,6 +40,13 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
this.DgvName = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewButtonColumn();
this.Column8 = new System.Windows.Forms.DataGridViewButtonColumn();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.BtnClearLog = new System.Windows.Forms.Button();
......@@ -73,18 +80,13 @@
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.ChkWorkTimeoutDel = new System.Windows.Forms.CheckBox();
this.ChkWorkAutoDel = new System.Windows.Forms.CheckBox();
this.BtnMissionPause = new System.Windows.Forms.Button();
this.BtnMissionRun = new System.Windows.Forms.Button();
this.BtnMissionClear = new System.Windows.Forms.Button();
this.BtnMissionAdd = new System.Windows.Forms.Button();
this.LstMission = new System.Windows.Forms.ListBox();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewButtonColumn();
this.Column8 = new System.Windows.Forms.DataGridViewButtonColumn();
((System.ComponentModel.ISupportInitialize)(this.DgvName)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
......@@ -145,6 +147,79 @@
this.DgvName.TabIndex = 0;
this.DgvName.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvName_CellContentClick);
//
// Column1
//
this.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column1.DefaultCellStyle = dataGridViewCellStyle2;
this.Column1.HeaderText = "名称";
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column2
//
this.Column2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column2.DefaultCellStyle = dataGridViewCellStyle3;
this.Column2.HeaderText = "地点";
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column2.Width = 150;
//
// Column5
//
this.Column5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column5.DefaultCellStyle = dataGridViewCellStyle4;
this.Column5.HeaderText = "小车状态";
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column3
//
this.Column3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column3.DefaultCellStyle = dataGridViewCellStyle5;
this.Column3.HeaderText = "电量";
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column3.Width = 80;
//
// Column7
//
this.Column7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column7.DefaultCellStyle = dataGridViewCellStyle6;
this.Column7.HeaderText = "在线";
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column7.Width = 80;
//
// Column4
//
this.Column4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column4.DefaultCellStyle = dataGridViewCellStyle7;
this.Column4.HeaderText = "自动";
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.Width = 80;
//
// Column8
//
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column8.DefaultCellStyle = dataGridViewCellStyle8;
this.Column8.HeaderText = "任务";
this.Column8.Name = "Column8";
this.Column8.ReadOnly = true;
//
// tabControl1
//
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
......@@ -596,6 +671,8 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.ChkWorkTimeoutDel);
this.tabPage1.Controls.Add(this.ChkWorkAutoDel);
this.tabPage1.Controls.Add(this.BtnMissionPause);
this.tabPage1.Controls.Add(this.BtnMissionRun);
this.tabPage1.Controls.Add(this.BtnMissionClear);
......@@ -609,6 +686,28 @@
this.tabPage1.Text = "小车任务";
this.tabPage1.UseVisualStyleBackColor = true;
//
// ChkWorkTimeoutDel
//
this.ChkWorkTimeoutDel.AutoSize = true;
this.ChkWorkTimeoutDel.Location = new System.Drawing.Point(402, 72);
this.ChkWorkTimeoutDel.Name = "ChkWorkTimeoutDel";
this.ChkWorkTimeoutDel.Size = new System.Drawing.Size(155, 20);
this.ChkWorkTimeoutDel.TabIndex = 18;
this.ChkWorkTimeoutDel.Text = "删除1min前的任务";
this.ChkWorkTimeoutDel.UseVisualStyleBackColor = true;
this.ChkWorkTimeoutDel.CheckedChanged += new System.EventHandler(this.ChkWorkTimeoutDel_CheckedChanged);
//
// ChkWorkAutoDel
//
this.ChkWorkAutoDel.AutoSize = true;
this.ChkWorkAutoDel.Location = new System.Drawing.Point(402, 27);
this.ChkWorkAutoDel.Name = "ChkWorkAutoDel";
this.ChkWorkAutoDel.Size = new System.Drawing.Size(331, 20);
this.ChkWorkAutoDel.TabIndex = 17;
this.ChkWorkAutoDel.Text = "当小车从手动切换为自动时,删除所有任务";
this.ChkWorkAutoDel.UseVisualStyleBackColor = true;
this.ChkWorkAutoDel.CheckedChanged += new System.EventHandler(this.ChkWorkAutoDel_CheckedChanged);
//
// BtnMissionPause
//
this.BtnMissionPause.Font = new System.Drawing.Font("宋体", 12F);
......@@ -666,79 +765,6 @@
this.LstMission.Size = new System.Drawing.Size(220, 510);
this.LstMission.TabIndex = 12;
//
// Column1
//
this.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column1.DefaultCellStyle = dataGridViewCellStyle2;
this.Column1.HeaderText = "名称";
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column2
//
this.Column2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column2.DefaultCellStyle = dataGridViewCellStyle3;
this.Column2.HeaderText = "地点";
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column2.Width = 150;
//
// Column5
//
this.Column5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column5.DefaultCellStyle = dataGridViewCellStyle4;
this.Column5.HeaderText = "小车状态";
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column3
//
this.Column3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column3.DefaultCellStyle = dataGridViewCellStyle5;
this.Column3.HeaderText = "电量";
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column3.Width = 80;
//
// Column7
//
this.Column7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column7.DefaultCellStyle = dataGridViewCellStyle6;
this.Column7.HeaderText = "在线";
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column7.Width = 80;
//
// Column4
//
this.Column4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column4.DefaultCellStyle = dataGridViewCellStyle7;
this.Column4.HeaderText = "自动";
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.Width = 80;
//
// Column8
//
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Column8.DefaultCellStyle = dataGridViewCellStyle8;
this.Column8.HeaderText = "任务";
this.Column8.Name = "Column8";
this.Column8.ReadOnly = true;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -764,6 +790,7 @@
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel4.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.ResumeLayout(false);
}
......@@ -816,6 +843,8 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
private System.Windows.Forms.DataGridViewButtonColumn Column4;
private System.Windows.Forms.DataGridViewButtonColumn Column8;
private System.Windows.Forms.CheckBox ChkWorkTimeoutDel;
private System.Windows.Forms.CheckBox ChkWorkAutoDel;
}
}
......@@ -13,7 +13,7 @@ namespace AGVControl_Steel
{
public partial class FrmMain : Form
{
//private Webs.WebService webService;
private bool checkedChange;
private BLL.Control control;
public FrmMain()
......@@ -43,6 +43,12 @@ namespace AGVControl_Steel
private void FrmMain_Load(object sender, EventArgs e)
{
checkedChange = true;
ChkWorkTimeoutDel.Text = "回收钢板时删除" + Common.WorkTimeout + "min前的任务";
ChkWorkTimeoutDel.Checked = Common.WorkTimeoutDel;
ChkWorkAutoDel.Checked = Common.WorkAutoDel;
checkedChange = false;
Common.log.LogBox = TxtLog;
Common.lstOldSteel = LstOldSteel;
Common.lstNewSteel = LstNewSteel;
......@@ -101,6 +107,13 @@ namespace AGVControl_Steel
Common.appConfig.Save();
System.Configuration.ConfigurationManager.RefreshSection("appSettings");
Common.log.Info("手动修改 " + info.Name + " IsUse=" + info.IsAuto);
if (info.IsAuto && Common.WorkAutoDel)
{
BLL.SteelManage.OldSteelWorkDelAll(info.Workshop);
BLL.SteelManage.NewSteelWorkDelAll(info.Workshop);
BLL.SteelManage.StorageWorkDelAll(info.Workshop);
}
}
else if (e.ColumnIndex == DgvName.Columns.Count - 1) //最后一列,清除任务
{
......@@ -302,5 +315,25 @@ namespace AGVControl_Steel
{
TxtLog.Text = "";
}
private void ChkWorkAutoDel_CheckedChanged(object sender, EventArgs e)
{
if (checkedChange) return;
Common.WorkAutoDel = ChkWorkAutoDel.Checked;
Common.appConfig.AppSettings.Settings["WorkAutoDel"].Value = Common.WorkAutoDel.ToString();
Common.appConfig.Save();
System.Configuration.ConfigurationManager.RefreshSection("appSettings");
Common.log.Info("修改WorkAutoDel=" + Common.WorkAutoDel.ToString());
}
private void ChkWorkTimeoutDel_CheckedChanged(object sender, EventArgs e)
{
if (checkedChange) return;
Common.WorkTimeoutDel = ChkWorkTimeoutDel.Checked;
Common.appConfig.AppSettings.Settings["WorkTimeoutDel"].Value = Common.WorkTimeoutDel.ToString();
Common.appConfig.Save();
System.Configuration.ConfigurationManager.RefreshSection("appSettings");
Common.log.Info("修改WorkTimeoutDel=" + Common.WorkTimeoutDel.ToString());
}
}
}
......@@ -19,7 +19,7 @@ namespace AGVControl_Steel
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (!RunMode()) return;
//if (!RunMode()) return;
Common.log = new Log("AGVControl_Steel");
Common.log.Info("=====程序开始=====");
ReadConfig();
......@@ -45,6 +45,10 @@ 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.BoardURL = Common.appConfig.AppSettings.Settings["Board"].Value;
Common.BoardTimeout = Convert.ToInt32(Common.appConfig.AppSettings.Settings["BoardTimeout"].Value);
Common.WorkTimeout = Convert.ToInt32(Common.appConfig.AppSettings.Settings["WorkTimeout"].Value);
Common.WorkTimeoutDel = Convert.ToBoolean(Common.appConfig.AppSettings.Settings["WorkTimeoutDel"].Value);
Common.WorkAutoDel = Convert.ToBoolean(Common.appConfig.AppSettings.Settings["WorkAutoDel"].Value);
Common.mir = new MiR_API { FleetIP = Common.appConfig.AppSettings.Settings["FLEET_IP"].Value }; //asa
ReadAgvInfo();
ReadAgvMission();
......
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
<appSettings>
<add key="FLEET_IP" value="10.85.199.3"/>
<add key="FLEET_Send" value="true"/>
<add key="WebService" value="http://10.85.196.40:8089/"/>
<!--<add key="WebService" value="http://127.0.0.1:8089/"/>-->
<add key="Board" value="http://10.85.199.25/myproject/rest/api/qisda/device/updateDeviceAlarmMsg"/>
<add key="AGV_BATTERY_MAX" value="100"/>
<add key="AGV_BATTERY_MIN" value="40"/>
<add key="11号_4C" value="false"/>
<add key="13号_4D" value="false"/>
</appSettings>
<add key="FLEET_IP" value="10.85.199.3" />
<add key="FLEET_Send" value="true" />
<add key="WebService" value="http://10.85.196.40:8089/" />
<add key="Board" value="http://10.85.199.25/myproject/rest/api/qisda/device/updateDeviceAlarmMsg" />
<add key="BoardTimeout" value="3" />
<add key="AGV_BATTERY_MAX" value="100" />
<add key="AGV_BATTERY_MIN" value="40" />
<add key="WorkTimeout" value="10" />
<add key="WorkTimeoutDel" value="False" />
<add key="WorkAutoDel" value="False" />
<add key="11号_4C" value="false" />
<add key="13号_4D" value="false" />
</appSettings>
</configuration>
\ No newline at end of file
此文件类型无法预览
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!