Commit a29760e4 顾剑亮

删除优先级

1 个父辈 bf3a978e
正在显示 38 个修改的文件 包含 533 行增加1509 行删除
......@@ -42,18 +42,35 @@
<add key="E4" value="false"/>
<add key="E5" value="false"/>
<add key="E6" value="false"/>
<add key="E7" value="false"/>
<add key="E8" value="false"/>
<add key="E9" value="false"/>
<add key="E10" value="false"/>
<add key="E11" value="false"/>
<add key="E12" value="false"/>
<add key="E13" value="false"/>
<add key="E14" value="false"/>
<add key="E15" value="false"/>
<add key="E16" value="false"/>
<add key="E21" value="false"/>
<add key="E22" value="false"/>
<!--产线任务状态-->
<add key="nodesMission" value=""/>
<add key="nodesLevel" value=""/>
<add key="G1" value="false"/>
<add key="G2" value="false"/>
<add key="G3" value="false"/>
<add key="G4" value="false"/>
<add key="G5" value="false"/>
<add key="G6" value="false"/>
<add key="G7" value="false"/>
<add key="G8" value="false"/>
<add key="G9" value="false"/>
<add key="G10" value="false"/>
<add key="G11" value="false"/>
<add key="G12" value="false"/>
<add key="G13" value="false"/>
<add key="G14" value="false"/>
<add key="G15" value="false"/>
<add key="G16" value="false"/>
<add key="G21" value="false"/>
<add key="G22" value="false"/>
</appSettings>
</configuration>
\ No newline at end of file
......@@ -240,7 +240,7 @@ namespace BLL
buff[idx++] = (byte)node.RFID[0];
buff[idx++] = Convert.ToByte(node.RFID.Substring(1));
buff[idx++] = (byte)node.Action;
buff[idx++] = (byte)node.Level;
buff[idx++] = 0;
idx += 4; //预留
buff[idx] = 0xDA;
return buff;
......@@ -260,11 +260,11 @@ namespace BLL
string rfid = (char)buff[idx] + buff[idx + 1].ToString();
idx += 2;
ClientAction action = (ClientAction)buff[idx++];
ClientLevel level = (ClientLevel)buff[idx++];
idx += 1;
idx += 4; //预留
if (buff[idx] != 0xDA) return null;
ClientNode node = new ClientNode(name, rfid, action, level);
ClientNode node = new ClientNode(name, rfid, action);
return node;
}
......@@ -284,11 +284,9 @@ namespace BLL
}
if (Common.nodeInfo[idx].Action != node.Action ||
Common.nodeInfo[idx].Level != node.Level ||
Common.nodeInfo[idx].RFID != node.RFID)
{
Common.nodeInfo[idx].Action = node.Action;
Common.nodeInfo[idx].Level = node.Level;
Common.nodeInfo[idx].RFID = node.RFID;
Common.log.Info(node.Name + "更新 " + node.ToText());
NodeChanged?.Invoke(idx);
......
......@@ -19,7 +19,8 @@ namespace AGVControl
/// 小车信息
/// </summary>
public static List<Agv_Info> agvInfo;
public static Dictionary<string,ClientLevel> linePlace;
public static List<string> linePlace;
public static BLL.AgvServer server;
public static BLL.Control control;
......@@ -35,51 +36,39 @@ namespace AGVControl
public static void ReadLinePlace()
{
string s1 = Common.appConfig.AppSettings.Settings["nodesLevel"].Value;
string s2 = Common.appConfig.AppSettings.Settings["nodesMission"].Value;
if (s1.Equals("") || s2.Equals(""))
return;
string[] nodesLevel=s1.Split(',');
string[] nodesMission = s2.Split(',');
if(nodesLevel.Length.Equals(nodesMission.Length) && nodesMission.Length.Equals(0).Equals(false))
{
log.Info("程序上一次关闭时有任务未完成:");
log.Info("节点名称:"+s2+"\n 紧急等级:"+s1);
for (int i = 0; i < nodesMission.Length; i++)
{
linePlace.Add(nodesMission[i], (ClientLevel)Enum.Parse(typeof(ClientLevel), nodesLevel[i]));
}
}
}
public static void AddLinePlace(string nodeName)
{
int idx = Common.nodeInfo.FindIndex(s => s.Name == nodeName);
if(idx>-1)
{
if(Common.linePlace.ContainsKey(nodeName))
{
log.Info("AddLinePlace 节点" + nodeName + "已存在任务队列,无需重复添加");
return;
}
Common.linePlace.Add(nodeName,Common.nodeInfo[idx].Level);
Common.appConfig.AppSettings.Settings["nodesLevel"].Value = string.Join(",",linePlace.Values);
Common.appConfig.AppSettings.Settings["nodesMission"].Value =string.Join(",",linePlace.Keys);
Common.appConfig.Save();
}
else
{
log.Error("AddLinePlace 失败 节点"+ nodeName+"不存在");
}
}
public static void RemoveLinePlace(string nodeName)
{
Common.linePlace.Remove(nodeName);
Common.appConfig.AppSettings.Settings["nodesLevel"].Value = string.Join(",", linePlace.Values);
Common.appConfig.AppSettings.Settings["nodesMission"].Value = string.Join(",", linePlace.Keys);
Common.appConfig.Save();
}
string[] s = System.IO.File.ReadAllLines(CONFIG_PATH + "LinePlace.txt");
linePlace = new List<string>();
linePlace.AddRange(s);
}
//public static void AddLinePlace(string nodeName)
//{
// int idx = Common.nodeInfo.FindIndex(s => s.Name == nodeName);
// if(idx>-1)
// {
// if(Common.linePlace.ContainsKey(nodeName))
// {
// log.Info("AddLinePlace 节点" + nodeName + "已存在任务队列,无需重复添加");
// return;
// }
// Common.linePlace.Add(nodeName,Common.nodeInfo[idx].Level);
// Common.appConfig.AppSettings.Settings["nodesLevel"].Value = string.Join(",",linePlace.Values);
// Common.appConfig.AppSettings.Settings["nodesMission"].Value =string.Join(",",linePlace.Keys);
// Common.appConfig.Save();
// }
// else
// {
// log.Error("AddLinePlace 失败 节点"+ nodeName+"不存在");
// }
//}
//public static void RemoveLinePlace(string nodeName)
//{
// Common.linePlace.Remove(nodeName);
// Common.appConfig.AppSettings.Settings["nodesLevel"].Value = string.Join(",", linePlace.Values);
// Common.appConfig.AppSettings.Settings["nodesMission"].Value = string.Join(",", linePlace.Keys);
// Common.appConfig.Save();
//}
public static void CheckAGVMissionState()
{
......@@ -162,6 +151,10 @@ namespace AGVControl
/// </summary>
public string Name { set; get; }
/// <summary>
/// IP地址
/// </summary>
public string IP { set; get; }
/// <summary>
/// RFID
/// </summary>
public string RFID
......@@ -183,10 +176,6 @@ namespace AGVControl
/// </summary>
public ClientAction Action { set; get; }
/// <summary>
/// 优先级
/// </summary>
public ClientLevel Level { set; get; }
/// <summary>
/// 小车名称
/// </summary>
public string AgvName { set; get; }
......@@ -203,13 +192,14 @@ namespace AGVControl
/// 客户端节点
/// </summary>
/// <param name="name"></param>
/// <param name="ip"></param>
/// <param name="isUse"></param>
public ClientNode(string name, bool isUse)
public ClientNode(string name, string ip, bool isUse)
{
Name = name;
IP = ip;
RFID = rfid;
Action = ClientAction.None;
Level = ClientLevel.Low;
AgvName = "";
Online = false;
IsUse = isUse;
......@@ -222,12 +212,11 @@ namespace AGVControl
/// <param name="rfid"></param>
/// <param name="action"></param>
/// <param name="level"></param>
public ClientNode(string name, string rfid = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low)
public ClientNode(string name, string rfid = "", ClientAction action = ClientAction.None)
{
Name = name;
RFID = rfid;
Action = action;
Level = level;
AgvName = "";
Online = false;
IsUse = false;
......@@ -239,19 +228,19 @@ namespace AGVControl
/// <returns></returns>
public string ToText()
{
string s = string.Format("Name={0}, Action={1}, Level={2}, RFID={3}", Name, Action, Level, RFID);
string s = string.Format("Name={0}, Action={1}, RFID={2}", Name, Action, RFID);
return s;
}
public string[] ToRow()
{
//节点,动作,优先级,RFID,AGV名称,在线,调用,清除AGV
//节点,IP,动作,RFID,AGV名称,在线,调用,清除AGV
string[] s = new string[8];
s[0] = Name;
s[1] = IP;
if (Online)
{
s[1] = Action.ToString();
s[2] = Level.ToString();
s[2] = Action.ToString();
s[3] = RFID;
s[4] = AgvName;
}
......@@ -268,7 +257,6 @@ namespace AGVControl
{
RFID = "00";
Action = ClientAction.None;
Level = ClientLevel.Low;
AgvName = "";
Online = false;
}
......@@ -484,25 +472,6 @@ namespace AGVControl
}
/// <summary>
/// 客户端的优先级
/// </summary>
public enum ClientLevel : byte
{
/// <summary>
/// 低
/// </summary>
Low = 0,
/// <summary>
/// 中等
/// </summary>
Middle = 1,
/// <summary>
/// 高
/// </summary>
High = 2
}
/// <summary>
/// 地点状态
/// </summary>
public enum PlaceState
......
......@@ -187,7 +187,7 @@ namespace BLL
rtn = FindA6Leave(out string nextNode);
if (rtn)
{
rtn = Common.mir.Add_Mission(agv, Common.agvMission["MoveA6"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["MoveA6"]);
if (rtn)
{
agv.NextPlace = nextNode;
......@@ -208,30 +208,30 @@ namespace BLL
return;
}
ClientLevel clientLevel = Common.linePlace.Values.Max<ClientLevel>();
//出空料架
foreach (var item in Common.linePlace)
{
if (!clientLevel.Equals(item.Value))
continue;
string name = item.Key;
index = Common.nodeInfo.FindIndex(s => s.Name.Equals(name) && s.Action == ClientAction.NeedLeave && s.IsUse);
if (index > -1)
{
rtn = Common.mir.Add_Mission(agv, Common.agvMission["Move" + name]);
if (rtn)
{
Common.nodeInfo[index].AgvName = Common.agvInfo[idx].Name;
Common.linePlace.Remove(name);
}
agv.TaskSend = rtn ? "Move" + name : "";
}
Common.log.Info(string.Format("[{0}-{1}] 出空料架.", name, item.Value));
if (Common.linePlace.Count.Equals(0).Equals(false))
Common.log.Info("剩余需要出空料架的节点:" + string.Join(",", Common.linePlace.Keys.ToArray())
+ ";对应紧急程度:" + string.Join(",", Common.linePlace.Values.ToArray()));
if (rtn) break;
}
//ClientLevel clientLevel = Common.linePlace.Values.Max<ClientLevel>();
////出空料架
//foreach (var item in Common.linePlace)
//{
// if (!clientLevel.Equals(item.Value))
// continue;
// string name = item.Key;
// index = Common.nodeInfo.FindIndex(s => s.Name.Equals(name) && s.Action == ClientAction.NeedLeave && s.IsUse);
// if (index > -1)
// {
// rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Move" + name]);
// if (rtn)
// {
// Common.nodeInfo[index].AgvName = Common.agvInfo[idx].Name;
// Common.linePlace.Remove(name);
// }
// agv.TaskSend = rtn ? "Move" + name : "";
// }
// Common.log.Info(string.Format("[{0}-{1}] 出空料架.", name, item.Value));
// if (Common.linePlace.Count.Equals(0).Equals(false))
// Common.log.Info("剩余需要出空料架的节点:" + string.Join(",", Common.linePlace.Keys.ToArray())
// + ";对应紧急程度:" + string.Join(",", Common.linePlace.Values.ToArray()));
// if (rtn) break;
//}
......@@ -241,7 +241,7 @@ namespace BLL
// index = Common.nodeInfo.FindIndex(s => s.Name.Equals(name) && s.Action == ClientAction.NeedLeave && s.IsUse);
// if (index > -1)
// {
// rtn = Common.mir.Add_Mission(agv, Common.agvMission["Move" + name]);
// rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Move" + name]);
// if (rtn)
// {
// Common.nodeInfo[index].AgvName = Common.agvInfo[idx].Name;
......@@ -277,7 +277,7 @@ namespace BLL
if (node.Action == ClientAction.MayEnter)
{
if (agv.TaskSend == "Leave") return;
rtn = Common.mir.Add_Mission(agv, Common.agvMission["Leave"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.log.Info(string.Format("{0}到达{1},可以进入料架", agv.Name, agv.Place));
......@@ -293,7 +293,7 @@ namespace BLL
if (node.Action == ClientAction.MayEnter)
{
if (agv.TaskSend == "Leave") return;
rtn = Common.mir.Add_Mission(agv, Common.agvMission["Leave"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.log.Info(string.Format("{0}到达{1},可以进入料架", agv.Name, agv.Place));
......@@ -301,7 +301,7 @@ namespace BLL
else if (node.Action == ClientAction.MayLeave)
{
if (agv.TaskSend == "Leave") return;
rtn = Common.mir.Add_Mission(agv, Common.agvMission["Leave"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.log.Info(string.Format("{0}到达{1},可以出去料架", agv.Name, agv.Place));
......@@ -339,7 +339,7 @@ namespace BLL
if (node.Action == ClientAction.MayEnter)
{
if (agv.TaskSend == "Leave") return;
rtn = Common.mir.Add_Mission(agv, Common.agvMission["Leave"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.log.Info(string.Format("{0}到达{1},可以进入料架", agv.Name, agv.Place));
......@@ -347,7 +347,7 @@ namespace BLL
else if (node.Action == ClientAction.MayLeave)
{
if (agv.TaskSend == "Leave") return;
rtn = Common.mir.Add_Mission(agv, Common.agvMission["Leave"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.log.Info(string.Format("{0}到达{1},可以出去料架", agv.Name, agv.Place));
......@@ -396,7 +396,7 @@ namespace BLL
if (node.Action == ClientAction.FinishLeave)
{
string nextPlace = agv.NextPlace;
rtn = Common.mir.Add_Mission(agv, Common.agvMission["Move" + nextPlace]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Move" + nextPlace]);
if (rtn)
{
agv.NextPlace = "";
......
......@@ -49,15 +49,11 @@ namespace BLL
//加到任务
int idx = AGVControl.Common.nodeInfo.FindIndex(s => s.Name == value);
if(idx>-1)
{
AGVControl.Common.linePlace.Add(value, AGVControl.Common.nodeInfo[idx].Level);
}
if (idx > -1)
AGVControl.Common.linePlace.Add(value);
else
{
AGVControl.Common.log.Error("CreateEmptyRecycleTask " + value + "不存在");
}
}
else
{
res = new Result() { Succeed = "false", ResultData = "", ErrorMessage = "Not find " + line };
......
......@@ -44,8 +44,8 @@
this.tabPage1 = new System.Windows.Forms.TabPage();
this.DgvNode = new System.Windows.Forms.DataGridView();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
......@@ -58,11 +58,7 @@
this.Column20 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.btnDeletelinePlace = new System.Windows.Forms.Button();
this.btnAddlinePlace = new System.Windows.Forms.Button();
this.BtnAddPlace = new System.Windows.Forms.Button();
this.TxtPlace = new System.Windows.Forms.TextBox();
this.CloseDoor = new System.Windows.Forms.Button();
this.BtnReady = new System.Windows.Forms.Button();
this.BtnArrive = new System.Windows.Forms.Button();
this.BtnClearError = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
......@@ -110,14 +106,13 @@
this.Column19,
this.Column11,
this.Column17});
this.DgvAgv.Location = new System.Drawing.Point(16, 15);
this.DgvAgv.Margin = new System.Windows.Forms.Padding(4);
this.DgvAgv.Location = new System.Drawing.Point(12, 12);
this.DgvAgv.Name = "DgvAgv";
this.DgvAgv.ReadOnly = true;
this.DgvAgv.RowHeadersVisible = false;
this.DgvAgv.RowHeadersWidth = 51;
this.DgvAgv.RowTemplate.Height = 23;
this.DgvAgv.Size = new System.Drawing.Size(1224, 158);
this.DgvAgv.Size = new System.Drawing.Size(918, 126);
this.DgvAgv.TabIndex = 3;
this.DgvAgv.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvAgv_CellClick);
//
......@@ -216,21 +211,19 @@
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(16, 180);
this.tabControl1.Margin = new System.Windows.Forms.Padding(4);
this.tabControl1.Location = new System.Drawing.Point(12, 144);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1224, 579);
this.tabControl1.Size = new System.Drawing.Size(918, 463);
this.tabControl1.TabIndex = 6;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.DgvNode);
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Margin = new System.Windows.Forms.Padding(4);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(4);
this.tabPage1.Size = new System.Drawing.Size(1216, 550);
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(910, 437);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "节点";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -247,21 +240,20 @@
this.DgvNode.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DgvNode.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column6,
this.Column7,
this.Column12,
this.Column7,
this.Column9,
this.Column10,
this.Column5,
this.Column16,
this.Column15});
this.DgvNode.Location = new System.Drawing.Point(8, 8);
this.DgvNode.Margin = new System.Windows.Forms.Padding(4);
this.DgvNode.Location = new System.Drawing.Point(6, 6);
this.DgvNode.Name = "DgvNode";
this.DgvNode.ReadOnly = true;
this.DgvNode.RowHeadersVisible = false;
this.DgvNode.RowHeadersWidth = 50;
this.DgvNode.RowTemplate.Height = 23;
this.DgvNode.Size = new System.Drawing.Size(1197, 531);
this.DgvNode.Size = new System.Drawing.Size(898, 425);
this.DgvNode.TabIndex = 1;
this.DgvNode.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvNode_CellClick);
//
......@@ -274,6 +266,15 @@
this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column6.Width = 70;
//
// Column12
//
this.Column12.HeaderText = "IP";
this.Column12.MinimumWidth = 6;
this.Column12.Name = "Column12";
this.Column12.ReadOnly = true;
this.Column12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column12.Width = 125;
//
// Column7
//
this.Column7.HeaderText = "动作";
......@@ -283,15 +284,6 @@
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column7.Width = 125;
//
// Column12
//
this.Column12.HeaderText = "优先级";
this.Column12.MinimumWidth = 6;
this.Column12.Name = "Column12";
this.Column12.ReadOnly = true;
this.Column12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column12.Width = 125;
//
// Column9
//
this.Column9.HeaderText = "RFID";
......@@ -341,11 +333,7 @@
this.tabPage3.Controls.Add(this.dgvLinePlace);
this.tabPage3.Controls.Add(this.btnDeletelinePlace);
this.tabPage3.Controls.Add(this.btnAddlinePlace);
this.tabPage3.Controls.Add(this.BtnAddPlace);
this.tabPage3.Controls.Add(this.TxtPlace);
this.tabPage3.Controls.Add(this.CloseDoor);
this.tabPage3.Controls.Add(this.BtnReady);
this.tabPage3.Controls.Add(this.BtnArrive);
this.tabPage3.Controls.Add(this.BtnClearError);
this.tabPage3.Controls.Add(this.label2);
this.tabPage3.Controls.Add(this.label1);
......@@ -360,21 +348,19 @@
this.tabPage3.Controls.Add(this.BtnMissionPause);
this.tabPage3.Controls.Add(this.BtnMissionReady);
this.tabPage3.Controls.Add(this.LstAgvPlace);
this.tabPage3.Location = new System.Drawing.Point(4, 25);
this.tabPage3.Margin = new System.Windows.Forms.Padding(4);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(4);
this.tabPage3.Size = new System.Drawing.Size(1216, 550);
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(910, 437);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "任务";
this.tabPage3.UseVisualStyleBackColor = true;
//
// btnReadlinePlace
//
this.btnReadlinePlace.Location = new System.Drawing.Point(555, 298);
this.btnReadlinePlace.Margin = new System.Windows.Forms.Padding(4);
this.btnReadlinePlace.Location = new System.Drawing.Point(416, 238);
this.btnReadlinePlace.Name = "btnReadlinePlace";
this.btnReadlinePlace.Size = new System.Drawing.Size(148, 38);
this.btnReadlinePlace.Size = new System.Drawing.Size(111, 30);
this.btnReadlinePlace.TabIndex = 29;
this.btnReadlinePlace.Text = "读取linePlacce";
this.btnReadlinePlace.UseVisualStyleBackColor = true;
......@@ -387,12 +373,13 @@
this.dgvLinePlace.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column8,
this.Column20});
this.dgvLinePlace.Location = new System.Drawing.Point(216, 264);
this.dgvLinePlace.Location = new System.Drawing.Point(162, 211);
this.dgvLinePlace.Margin = new System.Windows.Forms.Padding(2);
this.dgvLinePlace.Name = "dgvLinePlace";
this.dgvLinePlace.RowHeadersVisible = false;
this.dgvLinePlace.RowHeadersWidth = 51;
this.dgvLinePlace.RowTemplate.Height = 27;
this.dgvLinePlace.Size = new System.Drawing.Size(311, 150);
this.dgvLinePlace.Size = new System.Drawing.Size(233, 120);
this.dgvLinePlace.TabIndex = 28;
//
// Column8
......@@ -411,10 +398,9 @@
//
// btnDeletelinePlace
//
this.btnDeletelinePlace.Location = new System.Drawing.Point(555, 388);
this.btnDeletelinePlace.Margin = new System.Windows.Forms.Padding(4);
this.btnDeletelinePlace.Location = new System.Drawing.Point(416, 310);
this.btnDeletelinePlace.Name = "btnDeletelinePlace";
this.btnDeletelinePlace.Size = new System.Drawing.Size(149, 38);
this.btnDeletelinePlace.Size = new System.Drawing.Size(112, 30);
this.btnDeletelinePlace.TabIndex = 27;
this.btnDeletelinePlace.Text = "删除linePlacce";
this.btnDeletelinePlace.UseVisualStyleBackColor = true;
......@@ -422,69 +408,26 @@
//
// btnAddlinePlace
//
this.btnAddlinePlace.Location = new System.Drawing.Point(555, 342);
this.btnAddlinePlace.Margin = new System.Windows.Forms.Padding(4);
this.btnAddlinePlace.Location = new System.Drawing.Point(416, 274);
this.btnAddlinePlace.Name = "btnAddlinePlace";
this.btnAddlinePlace.Size = new System.Drawing.Size(148, 38);
this.btnAddlinePlace.Size = new System.Drawing.Size(111, 30);
this.btnAddlinePlace.TabIndex = 26;
this.btnAddlinePlace.Text = "添加linePlacce";
this.btnAddlinePlace.UseVisualStyleBackColor = true;
this.btnAddlinePlace.Click += new System.EventHandler(this.btnAddlinePlace_Click);
//
// BtnAddPlace
//
this.BtnAddPlace.Location = new System.Drawing.Point(840, 183);
this.BtnAddPlace.Margin = new System.Windows.Forms.Padding(4);
this.BtnAddPlace.Name = "BtnAddPlace";
this.BtnAddPlace.Size = new System.Drawing.Size(128, 38);
this.BtnAddPlace.TabIndex = 25;
this.BtnAddPlace.Text = "目标地点";
this.BtnAddPlace.UseVisualStyleBackColor = true;
//
// TxtPlace
//
this.TxtPlace.Location = new System.Drawing.Point(556, 265);
this.TxtPlace.Margin = new System.Windows.Forms.Padding(4);
this.TxtPlace.Location = new System.Drawing.Point(417, 212);
this.TxtPlace.Name = "TxtPlace";
this.TxtPlace.Size = new System.Drawing.Size(148, 25);
this.TxtPlace.Size = new System.Drawing.Size(112, 21);
this.TxtPlace.TabIndex = 24;
//
// CloseDoor
//
this.CloseDoor.Location = new System.Drawing.Point(840, 105);
this.CloseDoor.Margin = new System.Windows.Forms.Padding(4);
this.CloseDoor.Name = "CloseDoor";
this.CloseDoor.Size = new System.Drawing.Size(128, 38);
this.CloseDoor.TabIndex = 22;
this.CloseDoor.Text = "CloseDoor";
this.CloseDoor.UseVisualStyleBackColor = true;
//
// BtnReady
//
this.BtnReady.Location = new System.Drawing.Point(840, 59);
this.BtnReady.Margin = new System.Windows.Forms.Padding(4);
this.BtnReady.Name = "BtnReady";
this.BtnReady.Size = new System.Drawing.Size(128, 38);
this.BtnReady.TabIndex = 21;
this.BtnReady.Text = "Ready";
this.BtnReady.UseVisualStyleBackColor = true;
//
// BtnArrive
//
this.BtnArrive.Location = new System.Drawing.Point(840, 15);
this.BtnArrive.Margin = new System.Windows.Forms.Padding(4);
this.BtnArrive.Name = "BtnArrive";
this.BtnArrive.Size = new System.Drawing.Size(128, 38);
this.BtnArrive.TabIndex = 20;
this.BtnArrive.Text = "Arrive";
this.BtnArrive.UseVisualStyleBackColor = true;
//
// BtnClearError
//
this.BtnClearError.Location = new System.Drawing.Point(216, 142);
this.BtnClearError.Margin = new System.Windows.Forms.Padding(4);
this.BtnClearError.Location = new System.Drawing.Point(162, 114);
this.BtnClearError.Name = "BtnClearError";
this.BtnClearError.Size = new System.Drawing.Size(128, 38);
this.BtnClearError.Size = new System.Drawing.Size(96, 30);
this.BtnClearError.TabIndex = 19;
this.BtnClearError.Text = "清除错误";
this.BtnClearError.UseVisualStyleBackColor = true;
......@@ -493,96 +436,86 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(643, 10);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Location = new System.Drawing.Point(482, 8);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(60, 15);
this.label2.Size = new System.Drawing.Size(47, 12);
this.label2.TabIndex = 18;
this.label2.Text = "充电桩2";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(507, 10);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Location = new System.Drawing.Point(380, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 15);
this.label1.Size = new System.Drawing.Size(47, 12);
this.label1.TabIndex = 17;
this.label1.Text = "充电桩1";
//
// BtnWriteCharge2
//
this.BtnWriteCharge2.Location = new System.Drawing.Point(639, 108);
this.BtnWriteCharge2.Margin = new System.Windows.Forms.Padding(4);
this.BtnWriteCharge2.Location = new System.Drawing.Point(479, 86);
this.BtnWriteCharge2.Name = "BtnWriteCharge2";
this.BtnWriteCharge2.Size = new System.Drawing.Size(128, 38);
this.BtnWriteCharge2.Size = new System.Drawing.Size(96, 30);
this.BtnWriteCharge2.TabIndex = 16;
this.BtnWriteCharge2.Text = "写";
this.BtnWriteCharge2.UseVisualStyleBackColor = true;
//
// BtnReadCharge2
//
this.BtnReadCharge2.Location = new System.Drawing.Point(639, 62);
this.BtnReadCharge2.Margin = new System.Windows.Forms.Padding(4);
this.BtnReadCharge2.Location = new System.Drawing.Point(479, 50);
this.BtnReadCharge2.Name = "BtnReadCharge2";
this.BtnReadCharge2.Size = new System.Drawing.Size(128, 38);
this.BtnReadCharge2.Size = new System.Drawing.Size(96, 30);
this.BtnReadCharge2.TabIndex = 15;
this.BtnReadCharge2.Text = "读";
this.BtnReadCharge2.UseVisualStyleBackColor = true;
//
// TxtCharge2
//
this.TxtCharge2.Location = new System.Drawing.Point(639, 29);
this.TxtCharge2.Margin = new System.Windows.Forms.Padding(4);
this.TxtCharge2.Location = new System.Drawing.Point(479, 23);
this.TxtCharge2.Name = "TxtCharge2";
this.TxtCharge2.Size = new System.Drawing.Size(127, 25);
this.TxtCharge2.Size = new System.Drawing.Size(96, 21);
this.TxtCharge2.TabIndex = 14;
//
// BtnWriteCharge1
//
this.BtnWriteCharge1.Location = new System.Drawing.Point(503, 108);
this.BtnWriteCharge1.Margin = new System.Windows.Forms.Padding(4);
this.BtnWriteCharge1.Location = new System.Drawing.Point(377, 86);
this.BtnWriteCharge1.Name = "BtnWriteCharge1";
this.BtnWriteCharge1.Size = new System.Drawing.Size(128, 38);
this.BtnWriteCharge1.Size = new System.Drawing.Size(96, 30);
this.BtnWriteCharge1.TabIndex = 13;
this.BtnWriteCharge1.Text = "写";
this.BtnWriteCharge1.UseVisualStyleBackColor = true;
//
// BtnReadCharge1
//
this.BtnReadCharge1.Location = new System.Drawing.Point(503, 62);
this.BtnReadCharge1.Margin = new System.Windows.Forms.Padding(4);
this.BtnReadCharge1.Location = new System.Drawing.Point(377, 50);
this.BtnReadCharge1.Name = "BtnReadCharge1";
this.BtnReadCharge1.Size = new System.Drawing.Size(128, 38);
this.BtnReadCharge1.Size = new System.Drawing.Size(96, 30);
this.BtnReadCharge1.TabIndex = 12;
this.BtnReadCharge1.Text = "读";
this.BtnReadCharge1.UseVisualStyleBackColor = true;
//
// TxtCharge1
//
this.TxtCharge1.Location = new System.Drawing.Point(503, 29);
this.TxtCharge1.Margin = new System.Windows.Forms.Padding(4);
this.TxtCharge1.Location = new System.Drawing.Point(377, 23);
this.TxtCharge1.Name = "TxtCharge1";
this.TxtCharge1.Size = new System.Drawing.Size(127, 25);
this.TxtCharge1.Size = new System.Drawing.Size(96, 21);
this.TxtCharge1.TabIndex = 11;
//
// ChkAutoCharge
//
this.ChkAutoCharge.AutoSize = true;
this.ChkAutoCharge.Location = new System.Drawing.Point(367, 29);
this.ChkAutoCharge.Margin = new System.Windows.Forms.Padding(4);
this.ChkAutoCharge.Location = new System.Drawing.Point(275, 23);
this.ChkAutoCharge.Name = "ChkAutoCharge";
this.ChkAutoCharge.Size = new System.Drawing.Size(89, 19);
this.ChkAutoCharge.Size = new System.Drawing.Size(72, 16);
this.ChkAutoCharge.TabIndex = 10;
this.ChkAutoCharge.Text = "自动充电";
this.ChkAutoCharge.UseVisualStyleBackColor = true;
//
// BtnMissionAdd
//
this.BtnMissionAdd.Location = new System.Drawing.Point(216, 98);
this.BtnMissionAdd.Margin = new System.Windows.Forms.Padding(4);
this.BtnMissionAdd.Location = new System.Drawing.Point(162, 78);
this.BtnMissionAdd.Name = "BtnMissionAdd";
this.BtnMissionAdd.Size = new System.Drawing.Size(128, 38);
this.BtnMissionAdd.Size = new System.Drawing.Size(96, 30);
this.BtnMissionAdd.TabIndex = 3;
this.BtnMissionAdd.Text = "添加任务";
this.BtnMissionAdd.UseVisualStyleBackColor = true;
......@@ -590,10 +523,9 @@
//
// BtnMissionPause
//
this.BtnMissionPause.Location = new System.Drawing.Point(216, 52);
this.BtnMissionPause.Margin = new System.Windows.Forms.Padding(4);
this.BtnMissionPause.Location = new System.Drawing.Point(162, 42);
this.BtnMissionPause.Name = "BtnMissionPause";
this.BtnMissionPause.Size = new System.Drawing.Size(128, 38);
this.BtnMissionPause.Size = new System.Drawing.Size(96, 30);
this.BtnMissionPause.TabIndex = 2;
this.BtnMissionPause.Text = "暂停";
this.BtnMissionPause.UseVisualStyleBackColor = true;
......@@ -601,10 +533,9 @@
//
// BtnMissionReady
//
this.BtnMissionReady.Location = new System.Drawing.Point(216, 8);
this.BtnMissionReady.Margin = new System.Windows.Forms.Padding(4);
this.BtnMissionReady.Location = new System.Drawing.Point(162, 6);
this.BtnMissionReady.Name = "BtnMissionReady";
this.BtnMissionReady.Size = new System.Drawing.Size(128, 38);
this.BtnMissionReady.Size = new System.Drawing.Size(96, 30);
this.BtnMissionReady.TabIndex = 1;
this.BtnMissionReady.Text = "运行";
this.BtnMissionReady.UseVisualStyleBackColor = true;
......@@ -616,21 +547,19 @@
| System.Windows.Forms.AnchorStyles.Left)));
this.LstAgvPlace.FormattingEnabled = true;
this.LstAgvPlace.IntegralHeight = false;
this.LstAgvPlace.ItemHeight = 15;
this.LstAgvPlace.Location = new System.Drawing.Point(8, 8);
this.LstAgvPlace.Margin = new System.Windows.Forms.Padding(4);
this.LstAgvPlace.ItemHeight = 12;
this.LstAgvPlace.Location = new System.Drawing.Point(6, 6);
this.LstAgvPlace.Name = "LstAgvPlace";
this.LstAgvPlace.Size = new System.Drawing.Size(199, 530);
this.LstAgvPlace.Size = new System.Drawing.Size(150, 425);
this.LstAgvPlace.TabIndex = 0;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.tableLayoutPanel1);
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Margin = new System.Windows.Forms.Padding(4);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(4);
this.tabPage2.Size = new System.Drawing.Size(1216, 550);
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(910, 437);
this.tabPage2.TabIndex = 3;
this.tabPage2.Text = "日志";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -642,12 +571,11 @@
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 64.93936F));
this.tableLayoutPanel1.Controls.Add(this.TxtLog, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 4);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1208, 542);
this.tableLayoutPanel1.Size = new System.Drawing.Size(904, 431);
this.tableLayoutPanel1.TabIndex = 5;
//
// TxtLog
......@@ -655,23 +583,21 @@
this.TxtLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TxtLog.Location = new System.Drawing.Point(4, 4);
this.TxtLog.Margin = new System.Windows.Forms.Padding(4);
this.TxtLog.Location = new System.Drawing.Point(3, 3);
this.TxtLog.Multiline = true;
this.TxtLog.Name = "TxtLog";
this.TxtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.TxtLog.Size = new System.Drawing.Size(415, 534);
this.TxtLog.Size = new System.Drawing.Size(310, 425);
this.TxtLog.TabIndex = 4;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1256, 774);
this.ClientSize = new System.Drawing.Size(942, 619);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.DgvAgv);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "FrmMain";
this.Text = "Form1";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
......@@ -705,20 +631,8 @@
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.DataGridView DgvNode;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
private System.Windows.Forms.DataGridViewTextBoxColumn Column9;
private System.Windows.Forms.DataGridViewTextBoxColumn Column10;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewButtonColumn Column16;
private System.Windows.Forms.DataGridViewButtonColumn Column15;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.Button BtnAddPlace;
private System.Windows.Forms.TextBox TxtPlace;
private System.Windows.Forms.Button CloseDoor;
private System.Windows.Forms.Button BtnReady;
private System.Windows.Forms.Button BtnArrive;
private System.Windows.Forms.Button BtnClearError;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
......@@ -742,6 +656,14 @@
private System.Windows.Forms.Button btnReadlinePlace;
private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
private System.Windows.Forms.DataGridViewTextBoxColumn Column20;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewTextBoxColumn Column12;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
private System.Windows.Forms.DataGridViewTextBoxColumn Column9;
private System.Windows.Forms.DataGridViewTextBoxColumn Column10;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewButtonColumn Column16;
private System.Windows.Forms.DataGridViewButtonColumn Column15;
}
}
......@@ -237,41 +237,41 @@ namespace AGVControl
private void btnAddlinePlace_Click(object sender, EventArgs e)
{
if (TxtPlace.Text == "")
{
MessageBox.Show("请输入节点名");
return;
}
Common.AddLinePlace(TxtPlace.Text.ToUpper());
dgvLinePlace.Rows.Clear();
foreach (var item in Common.linePlace)
{
dgvLinePlace.Rows.Add(item.Key, item.Value);
}
//if (TxtPlace.Text == "")
//{
// MessageBox.Show("请输入节点名");
// return;
//}
//Common.AddLinePlace(TxtPlace.Text.ToUpper());
//dgvLinePlace.Rows.Clear();
//foreach (var item in Common.linePlace)
//{
// dgvLinePlace.Rows.Add(item.Key, item.Value);
//}
}
private void btnDeletelinePlace_Click(object sender, EventArgs e)
{
if (TxtPlace.Text == "")
{
MessageBox.Show("请输入节点名");
return;
}
Common.RemoveLinePlace(TxtPlace.Text.ToUpper());
dgvLinePlace.Rows.Clear();
foreach (var item in Common.linePlace)
{
dgvLinePlace.Rows.Add(item.Key, item.Value);
}
//if (TxtPlace.Text == "")
//{
// MessageBox.Show("请输入节点名");
// return;
//}
//Common.RemoveLinePlace(TxtPlace.Text.ToUpper());
//dgvLinePlace.Rows.Clear();
//foreach (var item in Common.linePlace)
//{
// dgvLinePlace.Rows.Add(item.Key, item.Value);
//}
}
private void btnReadlinePlace_Click(object sender, EventArgs e)
{
dgvLinePlace.Rows.Clear();
foreach (var item in Common.linePlace)
{
dgvLinePlace.Rows.Add(item.Key, item.Value);
}
//dgvLinePlace.Rows.Clear();
//foreach (var item in Common.linePlace)
//{
// dgvLinePlace.Rows.Add(item.Key, item.Value);
//}
}
}
}
......@@ -150,10 +150,10 @@
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="Column12.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column12.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column9.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
......
......@@ -42,9 +42,8 @@ namespace AGVControl
Common.log = log4net.LogManager.GetLogger("AgvServer");
Common.log.Info("=====程序开始=====");
ReadConfig();
Common.linePlace =new Dictionary<string, ClientLevel>();
Common.ReadLinePlace();
Common.mir = new MiR_API();
Common.control = new BLL.Control();
//软件开启时检查小车当前的任务状态
......@@ -93,38 +92,24 @@ namespace AGVControl
Common.agvMission.Add(temp[0], temp[1]);
}
Common.nodeInfo = new List<ClientNode>();
Common.nodeInfo.Add(new ClientNode("A5", "", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["A5"].Value)));
Common.nodeInfo.Add(new ClientNode("A6", "", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["A6"].Value)));
Common.agvProductionLine = new Dictionary<string, string>();
path = Common.CONFIG_PATH + "AgvProductionLine.csv";
line = System.IO.File.ReadAllLines(path);
for (int i = 0; i < line.Length; i++)
{
temp = line[i].Split(',');
if (temp.Length != 2) continue;
if (temp.Length != 3) continue;
Common.agvProductionLine.Add(temp[0], temp[1]);
bool isUse = Convert.ToBoolean(Common.appConfig.AppSettings.Settings[temp[1]].Value);
Common.nodeInfo.Add(new ClientNode(temp[1], temp[2], isUse));
}
Common.itsHttp = Common.appConfig.AppSettings.Settings["ITS"].Value;
Common.nodeInfo = new List<ClientNode>
{
new ClientNode("A5", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["A5"].Value)),
new ClientNode("A6", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["A6"].Value)),
new ClientNode("E1", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E1"].Value)),
new ClientNode("E2", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E2"].Value)),
new ClientNode("E3", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E3"].Value)),
new ClientNode("E4", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E4"].Value)),
new ClientNode("E5", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E5"].Value)),
new ClientNode("E6", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E6"].Value)),
new ClientNode("E8", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E8"].Value)),
new ClientNode("E9", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E9"].Value)),
new ClientNode("E10", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E10"].Value)),
new ClientNode("E11", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E11"].Value)),
new ClientNode("E12", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E12"].Value)),
new ClientNode("E14", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E14"].Value)),
new ClientNode("E15", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E15"].Value)),
new ClientNode("E16", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E16"].Value)),
new ClientNode("E21", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E21"].Value)),
new ClientNode("E22", Convert.ToBoolean(Common.appConfig.AppSettings.Settings["E22"].Value))
};
}
......
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
......@@ -24,31 +24,53 @@
</log4net>
<appSettings>
<add key="ITS" value="http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIGetBoxDestInfo?boxRFID=" />
<add key="WebService" value="http://127.0.0.1/Webservice/AGVService/" />
<add key="FLEET" value="10.85.199.3" />
<add key="MiR_R1763" value="False" />
<add key="MiR_R1764" value="false" />
<add key="MiR_R1767" value="false" />
<add key="MiR_R1768" value="false" />
<add key="A5" value="True" />
<add key="A6" value="True" />
<add key="E1" value="False" />
<add key="E2" value="false" />
<add key="E3" value="false" />
<add key="E4" value="false" />
<add key="E5" value="false" />
<add key="E6" value="false" />
<add key="E8" value="false" />
<add key="E9" value="false" />
<add key="E10" value="false" />
<add key="E11" value="false" />
<add key="E12" value="false" />
<add key="E14" value="false" />
<add key="E15" value="false" />
<add key="E16" value="false" />
<add key="E21" value="false" />
<add key="E22" value="false" />
<add key="nodesMission" value="" />
<add key="nodesLevel" value="" />
<add key="WebService" value="http://127.0.0.1/Webservice/AGVService/"/>
<add key="FLEET" value="10.85.199.3"/>
<!--<add key="LocalIP" value="192.168.103.12"/>
<add key="AutoCharge" value="false"/>
<add key="ChargeWait" value="1"/>
<add key="ChargeThreshold" value="20,70"/>-->
<add key="MiR_R1763" value="false"/>
<add key="MiR_R1764" value="false"/>
<add key="MiR_R1767" value="false"/>
<add key="MiR_R1768" value="false"/>
<add key="A5" value="false"/>
<add key="A6" value="false"/>
<add key="E1" value="false"/>
<add key="E2" value="false"/>
<add key="E3" value="false"/>
<add key="E4" value="false"/>
<add key="E5" value="false"/>
<add key="E6" value="false"/>
<add key="E7" value="false"/>
<add key="E8" value="false"/>
<add key="E9" value="false"/>
<add key="E10" value="false"/>
<add key="E11" value="false"/>
<add key="E12" value="false"/>
<add key="E13" value="false"/>
<add key="E14" value="false"/>
<add key="E15" value="false"/>
<add key="E16" value="false"/>
<add key="E21" value="false"/>
<add key="E22" value="false"/>
<add key="G1" value="false"/>
<add key="G2" value="false"/>
<add key="G3" value="false"/>
<add key="G4" value="false"/>
<add key="G5" value="false"/>
<add key="G6" value="false"/>
<add key="G7" value="false"/>
<add key="G8" value="false"/>
<add key="G9" value="false"/>
<add key="G10" value="false"/>
<add key="G11" value="false"/>
<add key="G12" value="false"/>
<add key="G13" value="false"/>
<add key="G14" value="false"/>
<add key="G15" value="false"/>
<add key="G16" value="false"/>
<add key="G21" value="false"/>
<add key="G22" value="false"/>
</appSettings>
</configuration>
\ No newline at end of file
7,MiR_R1763,192.168.12.20,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
8,MiR_R1764,10.85.199.56,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
9,MiR_R1767,10.85.199.57,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
10,MiR_R1768,10.85.199.58,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
7,MiR_R1763,10.85.199.71,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
8,MiR_R1764,10.85.199.72,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
9,MiR_R1767,10.85.199.73,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
10,MiR_R1768,10.85.199.74,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==
\ No newline at end of file
D1,E1
D2,E2
D3,E3
D4,E4
D5,E5
D6,E6
D7,E7
D8,E8
D9,E9
D10,E10
D11,E11
D12,E12
D13,E13
D14,E14
D15,E15
D16,E16
FeederIn,E21
FeederOut,E22
\ No newline at end of file
D1,E1,192.168.0.1
D2,E2,192.168.0.2
D3,E3,192.168.0.3
D4,E4,192.168.0.4
D5,E5,192.168.0.5
D6,E6,192.168.0.6
D7,E7,192.168.0.7
D8,E8,192.168.0.8
D9,E9,192.168.0.9
D10,E10,192.168.0.10
D11,E11,192.168.0.11
D12,E12,192.168.0.12
D13,E13,192.168.0.13
D14,E14,192.168.0.14
D15,E15,192.168.0.15
D16,E16,192.168.0.16
FeederIn,E21,192.168.0.17
FeederOut,E22,192.168.0.18
C1,G1,192.168.0.19
C2,G2,192.168.0.20
C3,G3,192.168.0.21
C4,G4,192.168.0.22
C5,G5,192.168.0.23
C6,G6,192.168.0.24
C7,G7,192.168.0.25
C8,G8,192.168.0.26
C9,G9,192.168.0.27
C10,G10,192.168.0.28
C11,G11,192.168.0.29
C12,G12,192.168.0.30
C13,G13,192.168.0.31
C14,G14,192.168.0.32
C15,G15,192.168.0.33
C16,G16,192.168.0.34
\ No newline at end of file
......@@ -94,3 +94,227 @@ System.ServiceModel.AddressAccessDeniedException: HTTP 无法注册 URL http://+
[2020-06-29 11:05:30,915][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-29 11:05:32,916][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-29 11:05:34,916][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 14:22:09,041][1]INFO =====程序开始=====
[2020-06-30 14:22:14,478][1]DEBUG HttpGet URL: http://192.168.12.20/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 14:22:14,478][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 14:22:19,557][1]DEBUG HttpGet URL: http://10.85.199.56/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 14:22:19,557][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 14:22:24,651][1]DEBUG HttpGet URL: http://10.85.199.57/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 14:22:24,651][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 14:22:29,744][1]DEBUG HttpGet URL: http://10.85.199.58/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 14:22:29,744][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 14:22:29,744][1]INFO Server Start
[2020-06-30 14:22:30,166][1]ERROR Open
System.ServiceModel.AddressAccessDeniedException: HTTP 无法注册 URL http://+:80/Webservice/AGVService/。进程不具有此命名空间的访问权限(有关详细信息,请参见 http://go.microsoft.com/fwlink/?LinkId=70353)。 ---> System.Net.HttpListenerException: 拒绝访问。
在 System.Net.HttpListener.AddAllPrefixes()
在 System.Net.HttpListener.Start()
在 System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
--- 内部异常堆栈跟踪的结尾 ---
在 System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
在 System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
在 System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
在 System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.HttpChannelListener`1.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open()
在 BLL.WebService.Open(String url) 位置 D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\BLL\WebService.cs:行号 81
[2020-06-30 14:22:32,728][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 14:22:34,713][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 14:22:36,715][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 14:22:38,731][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 14:22:41,731][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 14:22:43,715][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 14:22:45,716][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 14:22:47,716][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 14:22:50,718][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 14:22:52,718][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 14:22:54,719][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 14:22:56,719][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 14:22:59,718][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 14:23:01,718][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 14:23:03,718][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 14:23:05,719][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 14:23:08,719][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 14:23:10,719][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 14:23:12,718][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 14:23:14,718][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 14:23:17,718][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 14:23:19,718][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 14:23:21,718][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 14:23:21,952][9]INFO 服务端关闭连接,退出阻塞Accept
[2020-06-30 14:23:22,000][1]INFO Server Stop
[2020-06-30 14:23:22,015][1]ERROR Close
System.ServiceModel.CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Web.WebServiceHost 无法用于通信,因为其处于“出错”状态。
在 System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Close()
在 BLL.WebService.Close() 位置 D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\BLL\WebService.cs:行号 94
[2020-06-30 14:23:22,015][1]INFO =====程序结束=====
[2020-06-30 14:23:23,718][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 15:04:47,173][1]INFO =====程序开始=====
[2020-06-30 15:04:52,488][1]DEBUG HttpGet URL: http://192.168.12.20/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:04:52,488][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:04:57,566][1]DEBUG HttpGet URL: http://10.85.199.56/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:04:57,566][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:05:02,645][1]DEBUG HttpGet URL: http://10.85.199.57/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:05:02,645][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:05:07,738][1]DEBUG HttpGet URL: http://10.85.199.58/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:05:07,738][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:05:07,738][1]INFO Server Start
[2020-06-30 15:05:07,956][1]ERROR Open
System.ServiceModel.AddressAccessDeniedException: HTTP 无法注册 URL http://+:80/Webservice/AGVService/。进程不具有此命名空间的访问权限(有关详细信息,请参见 http://go.microsoft.com/fwlink/?LinkId=70353)。 ---> System.Net.HttpListenerException: 拒绝访问。
在 System.Net.HttpListener.AddAllPrefixes()
在 System.Net.HttpListener.Start()
在 System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
--- 内部异常堆栈跟踪的结尾 ---
在 System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
在 System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
在 System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
在 System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.HttpChannelListener`1.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open()
在 BLL.WebService.Open(String url) 位置 D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\BLL\WebService.cs:行号 77
[2020-06-30 15:05:10,707][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 15:05:12,707][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 15:05:14,707][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 15:05:16,707][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 15:05:19,707][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 15:05:21,707][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 15:05:23,707][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 15:05:25,707][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 15:05:28,581][9]INFO 服务端关闭连接,退出阻塞Accept
[2020-06-30 15:05:28,644][1]INFO Server Stop
[2020-06-30 15:05:28,644][1]ERROR Close
System.ServiceModel.CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Web.WebServiceHost 无法用于通信,因为其处于“出错”状态。
在 System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Close()
在 BLL.WebService.Close() 位置 D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\BLL\WebService.cs:行号 90
[2020-06-30 15:05:28,644][1]INFO =====程序结束=====
[2020-06-30 15:05:28,706][7]INFO Ping 192.168.12.20 请求没有响应
[2020-06-30 15:05:30,707][7]INFO Ping 10.85.199.56 请求没有响应
[2020-06-30 15:05:32,707][7]INFO Ping 10.85.199.57 请求没有响应
[2020-06-30 15:05:34,707][7]INFO Ping 10.85.199.58 请求没有响应
[2020-06-30 15:18:47,595][1]INFO =====程序开始=====
[2020-06-30 15:18:52,845][1]DEBUG HttpGet URL: http://10.85.199.71/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:18:52,845][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:18:57,940][1]DEBUG HttpGet URL: http://10.85.199.72/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:18:57,940][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:19:03,018][1]DEBUG HttpGet URL: http://10.85.199.73/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:19:03,018][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:19:08,098][1]DEBUG HttpGet URL: http://10.85.199.74/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:19:08,098][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:19:08,098][1]INFO Server Start
[2020-06-30 15:19:08,238][1]ERROR Open
System.ServiceModel.AddressAccessDeniedException: HTTP 无法注册 URL http://+:80/Webservice/AGVService/。进程不具有此命名空间的访问权限(有关详细信息,请参见 http://go.microsoft.com/fwlink/?LinkId=70353)。 ---> System.Net.HttpListenerException: 拒绝访问。
在 System.Net.HttpListener.AddAllPrefixes()
在 System.Net.HttpListener.Start()
在 System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
--- 内部异常堆栈跟踪的结尾 ---
在 System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
在 System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
在 System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
在 System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.HttpChannelListener`1.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open()
在 BLL.WebService.Open(String url) 位置 D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\BLL\WebService.cs:行号 77
[2020-06-30 15:19:10,708][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:19:12,708][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:19:14,723][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:19:16,708][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:19:19,708][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:19:21,708][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:19:23,708][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:19:25,707][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:19:28,708][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:19:30,707][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:19:32,708][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:19:34,708][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:19:37,709][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:19:39,709][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:19:41,710][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:19:43,709][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:19:46,710][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:19:48,710][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:19:50,712][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:19:52,712][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:19:55,712][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:19:57,712][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:19:59,711][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:20:01,712][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:20:02,133][9]INFO 服务端关闭连接,退出阻塞Accept
[2020-06-30 15:20:02,181][1]INFO Server Stop
[2020-06-30 15:20:02,181][1]ERROR Close
System.ServiceModel.CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Web.WebServiceHost 无法用于通信,因为其处于“出错”状态。
在 System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Close()
在 BLL.WebService.Close() 位置 D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\BLL\WebService.cs:行号 90
[2020-06-30 15:20:02,181][1]INFO =====程序结束=====
[2020-06-30 15:20:04,712][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:20:06,712][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:20:08,712][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:20:10,712][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:22:04,646][1]INFO =====程序开始=====
[2020-06-30 15:22:09,851][1]DEBUG HttpGet URL: http://10.85.199.71/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:22:09,851][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:22:14,945][1]DEBUG HttpGet URL: http://10.85.199.72/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:22:14,945][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:22:20,024][1]DEBUG HttpGet URL: http://10.85.199.73/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:22:20,024][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:22:25,102][1]DEBUG HttpGet URL: http://10.85.199.74/api/v2.0.0/registers/20?whitelist=value Return:
[2020-06-30 15:22:25,102][1]ERROR CheckAGVMissionState 获取PLC20失败
[2020-06-30 15:22:25,102][1]INFO Server Start
[2020-06-30 15:22:25,242][1]ERROR Open
System.ServiceModel.AddressAccessDeniedException: HTTP 无法注册 URL http://+:80/Webservice/AGVService/。进程不具有此命名空间的访问权限(有关详细信息,请参见 http://go.microsoft.com/fwlink/?LinkId=70353)。 ---> System.Net.HttpListenerException: 拒绝访问。
在 System.Net.HttpListener.AddAllPrefixes()
在 System.Net.HttpListener.Start()
在 System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
--- 内部异常堆栈跟踪的结尾 ---
在 System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
在 System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
在 System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
在 System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.HttpChannelListener`1.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open()
在 BLL.WebService.Open(String url) 位置 D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\BLL\WebService.cs:行号 77
[2020-06-30 15:22:27,712][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:22:29,727][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:22:31,712][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:22:33,711][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:22:36,730][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:22:38,713][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:22:40,730][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:22:42,730][7]INFO Ping 10.85.199.74 请求没有响应
[2020-06-30 15:22:45,713][7]INFO Ping 10.85.199.71 请求没有响应
[2020-06-30 15:22:47,166][9]INFO 服务端关闭连接,退出阻塞Accept
[2020-06-30 15:22:47,229][1]INFO Server Stop
[2020-06-30 15:22:47,229][1]ERROR Close
System.ServiceModel.CommunicationObjectFaultedException: 通信对象 System.ServiceModel.Web.WebServiceHost 无法用于通信,因为其处于“出错”状态。
在 System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Close()
在 BLL.WebService.Close() 位置 D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\BLL\WebService.cs:行号 90
[2020-06-30 15:22:47,229][1]INFO =====程序结束=====
[2020-06-30 15:22:47,730][7]INFO Ping 10.85.199.72 请求没有响应
[2020-06-30 15:22:49,714][7]INFO Ping 10.85.199.73 请求没有响应
[2020-06-30 15:22:51,715][7]INFO Ping 10.85.199.74 请求没有响应
......@@ -20,7 +20,6 @@ D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.exe
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\AGVControl-ProductionLine.exe.config
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\AGVControl-ProductionLine.exe
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\bin\Debug\AGVControl-ProductionLine.pdb
......
此文件类型无法预览
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace Asa
{
/// <summary>
/// AGV服务端
/// </summary>
public class AgvServer
{
private bool _loop;
private Socket _server; //服务端
private List<Client> _client; //所有客户端
private Thread tListenClient; //监听客户端连接
private readonly log4net.ILog LOG;
private const int PORT = 12001; //端口
/// <summary>
/// 节点改变事件
/// </summary>
/// <param name="nodeIndex"></param>
public delegate void NodeChangedEvent(int nodeIndex);
/// <summary>
/// 节点改变
/// </summary>
public event NodeChangedEvent NodeChanged;
/// <summary>
/// 节点在线
/// </summary>
public event NodeChangedEvent NodeOnline;
/// <summary>
/// AGV服务端
/// </summary>
/// <param name="logName"></param>
public AgvServer(string logName = "AgvServer")
{
LOG = log4net.LogManager.GetLogger(logName);
}
/// <summary>
/// 开启服务
/// </summary>
public void Start()
{
try
{
IPEndPoint localEP = new IPEndPoint(IPAddress.Any, PORT);
_server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_server.Bind(localEP);
_server.Listen(100);
LOG.Info("=====Server Start=====");
_loop = true;
_client = new List<Client>();
Common.nodeInfo = new List<ClientNode>();
tListenClient = new Thread(new ThreadStart(ListenClient));
tListenClient.Start();
}
catch (Exception ex)
{
LOG.Error("Start()", ex);
}
}
/// <summary>
/// 停止服务
/// </summary>
public void Stop()
{
_loop = false;
for (int i = 0; i < _client.Count; i++)
{
_client[i].Loop = false;
_client[i].IsConn = false;
_client[i].Socket.Close();
}
_server.Close();
_client = null;
LOG.Info("=====Server Stop=====");
}
///// <summary>
///// 小车已准备好
///// </summary>
///// <param name="info"></param>
///// <returns></returns>
//public bool Ready(Agv_Info info)
//{
// int idx;
// int n = 0;
// do
// {
// idx = FindClient(info.Place);
// if (idx == -1)
// {
// Common.log.OutInfo("没有找到" + info.Place);
// Thread.Sleep(500);
// n++;
// }
// else
// {
// n = 10;
// }
// } while (n < 4);
// if (idx == -1) return false;
// ClientNode node = new ClientNode(info.Place, info.RFID, ClientAction.Ready);
// Common.log.OutInfo("SendTo " + info.Place + " " + ClientAction.Ready);
// byte[] buff = Encode(node);
// return Send(idx, buff);
//}
///// <summary>
///// 关门
///// </summary>
///// <param name="info"></param>
///// <returns></returns>
//public bool CloseDoor(Agv_Info info)
//{
// int idx;
// int n = 0;
// do
// {
// idx = FindClient(info.Place);
// if (idx == -1)
// {
// Common.log.OutInfo("没有找到" + info.Place);
// Thread.Sleep(500);
// n++;
// }
// else
// {
// n = 10;
// }
// } while (n < 4);
// if (idx == -1) return false;
// ClientNode node = new ClientNode(info.Place, info.RFID, ClientAction.CloseDoor);
// Common.log.OutInfo("SendTo " + info.Place + " " + ClientAction.CloseDoor);
// byte[] buff = Encode(node);
// return Send(idx, buff);
//}
///// <summary>
///// 需要进入料架
///// </summary>
///// <param name="info"></param>
///// <returns></returns>
//public bool EnterShelf(Agv_Info info)
//{
// int idx;
// int n = 0;
// do
// {
// idx = FindClient(info.Place);
// if (idx == -1)
// {
// Common.log.OutInfo("没有找到" + info.Place);
// Thread.Sleep(500);
// n++;
// }
// else
// {
// n = 10;
// }
// } while (n < 4);
// if (idx == -1) return false;
// ClientNode node = new ClientNode(info.Place, info.RFID, ClientAction.EnterShelf);
// Common.log.OutInfo("SendTo " + info.Place + " " + ClientAction.EnterShelf);
// byte[] buff = Encode(node);
// return Send(idx, buff);
//}
/// <summary>
/// 监听客户端
/// </summary>
private void ListenClient()
{
while (_loop)
{
try
{
Socket socket = _server.Accept(); //这边会暂停,不需要sleep
IPEndPoint ep = (IPEndPoint)socket.RemoteEndPoint;
Thread listen = new Thread(new ParameterizedThreadStart(ListenNet));
//string ip = ep.Address.ToString();
//if (ip == System.Configuration.ConfigurationManager.AppSettings["LocalIP"])
// ip += ":" + ep.Port;
//新的客户端
Client client = new Client
{
IP = ep.Address.ToString() + ":" + ep.Port,
Loop = true,
IsConn = true,
Socket = socket,
ListenNet = listen,
nodeName = new List<string>(),
};
//重连后关闭旧连接
//int idx = _client.FindIndex(s => s.IP.Equals(ip));
//if (idx > -1)
//{
// _client[idx].IsConn = false;
// _client[idx].nodeName.Clear();
// _client[idx].Loop = false;
// _client[idx].Socket.Close();
// _client.RemoveAt(idx);
//}
_client.Add(client);
listen.Start(_client.Count - 1);
LOG.Info(string.Format("[{0}] 已连接", client.IP));
}
catch (SocketException)
{
//关闭连接,退出阻塞Accept
LOG.Info("服务端关闭连接,退出阻塞Accept");
}
catch (Exception ex)
{
LOG.Error("ListenClient()", ex);
}
}
}
/// <summary>
/// 客户端数据接收
/// </summary>
/// <param name="obj">索引</param>
private void ListenNet(object obj)
{
int sleep = 50;
Client client = _client[(int)obj];
byte[] temp = new byte[200];
int time = 0;
while (client.Loop)
{
Thread.Sleep(sleep);
try
{
if (!client.Loop) break;
if (client.Socket.Available > 0)
{
time = 0;
int count = client.Socket.Receive(temp);
byte[] buff = new byte[count];
Array.Copy(temp, 0, buff, 0, count);
ClientNode node = Decode(buff);
if (node == null)
{
LOG.Info("解码失败:" + HexBuff(buff));
}
else
{
LOG.Debug("Receive[" + client.IP + "] " + node.ToText());
int idx = client.nodeName.FindIndex(s => s == node.Name);
if (idx == -1) client.nodeName.Add(node.Name);
UpdateNode(node);
}
}
else
{
time += sleep;
if (time > 8000)
{
Offline(client);
LOG.Info("[" + client.IP + "] 超过8s没有收到数据,关闭连接");
}
}
}
catch (Exception ex)
{
LOG.Error("ListenNet()", ex);
}
}
}
/// <summary>
/// 编码
/// </summary>
/// <param name="node"></param>
/// <returns></returns>
private byte[] Encode(ClientNode node)
{
int idx = 0;
byte[] buff = new byte[8];
buff[idx++] = 0xAD;
buff[idx++] = (byte)node.Name[0];
buff[idx++] = Convert.ToByte(node.Name.Substring(1));
buff[idx++] = (byte)node.RFID[0];
buff[idx++] = Convert.ToByte(node.RFID.Substring(1));
buff[idx++] = (byte)node.Action;
buff[idx++] = (byte)node.Level;
idx += 4; //预留
buff[idx] = 0xDA;
return buff;
}
/// <summary>
/// 解码
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
private ClientNode Decode(byte[] buff)
{
int idx = 0;
if (buff[idx++] != 0xAD) return null;
string name = (char)buff[idx] + buff[idx + 1].ToString();
idx += 2;
string rfid = (char)buff[idx] + buff[idx + 1].ToString();
idx += 2;
ClientAction action = (ClientAction)buff[idx++];
ClientLevel level = (ClientLevel)buff[idx++];
idx += 4; //预留
if (buff[idx] != 0xDA) return null;
ClientNode node = new ClientNode(name, rfid, action, level);
return node;
}
private void UpdateNode(ClientNode node)
{
int idx = Common.nodeInfo.FindIndex(s => s.Name == node.Name);
if (idx == -1)
{
LOG.Info("UpdateNode " + node.Name + " 不存在");
return;
}
if (!Common.nodeInfo[idx].Online)
{
Common.nodeInfo[idx].Online = true;
NodeOnline?.Invoke(idx);
}
if (Common.nodeInfo[idx].Action != node.Action ||
Common.nodeInfo[idx].Level != node.Level ||
Common.nodeInfo[idx].RFID != node.RFID)
{
Common.nodeInfo[idx].Action = node.Action;
Common.nodeInfo[idx].Level = node.Level;
Common.nodeInfo[idx].RFID = node.RFID;
LOG.Info(node.Name + "更新 " + node.ToText());
NodeChanged?.Invoke(idx);
}
}
private void Offline(Client client)
{
client.Loop = false;
client.IsConn = false;
client.Socket.Close();
for (int i = 0; i < client.nodeName.Count; i++)
{
int idx = Common.nodeInfo.FindIndex(s => s.Name == client.nodeName[i]);
if (idx == -1) continue;
Common.nodeInfo[idx].Offline();
NodeChanged(idx);
NodeOnline(idx);
}
client.nodeName.Clear();
_client.Remove(client);
}
/// <summary>
/// 16进制
/// </summary>
/// <param name="buff"></param>
/// <returns></returns>
private string HexBuff(byte[] buff)
{
string s = "";
if (buff == null) return s;
for (int i = 0; i < buff.Length; i++)
s += buff[i].ToString("X2") + " ";
return s;
}
///// <summary>
///// 查找客户端
///// </summary>
///// <param name="name">节点名称</param>
///// <returns></returns>
//private int FindClient(string name)
//{
// int index = -1;
// for (int i = 0; i < _client.Count; i++)
// {
// if (_client[i].IsConn)
// {
// int idx = _client[i].nodeName.FindIndex(a => a == name);
// if (idx != -1)
// {
// index = i;
// break;
// }
// }
// }
// return index;
//}
///// <summary>
///// 发送命令
///// </summary>
///// <param name="idx"></param>
///// <param name="buff"></param>
///// <returns></returns>
//private bool Send(int idx, byte[] buff)
//{
// for (int i = 1; i <= 3; i++)
// {
// try
// {
// _client[idx].Socket.Send(buff);
// Common.log.OutInfo("[" + _client[idx].IP + "] " + HexBuff(buff));
// return true;
// }
// catch (Exception ex)
// {
// Common.log.OutInfo("发送失败" + i + "次:" + ex.Message);
// }
// Thread.Sleep(100);
// }
// return false;
//}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9208965E-3C78-408A-AFDB-466881033768}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AgvServer_DL</RootNamespace>
<AssemblyName>AgvServer_DL</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\AgvServer_DL.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\DLL\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AgvServer.cs" />
<Compile Include="Common.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Threading;
namespace Asa
{
/// <summary>
/// 公共参数
/// </summary>
public static class Common
{
/// <summary>
/// 节点信息
/// </summary>
public static List<ClientNode> nodeInfo;
/// <summary>
/// 小车信息
/// </summary>
public static List<AgvInfo> agvInfo;
}
/// <summary>
/// 客户端
/// </summary>
public class Client
{
/// <summary>
/// 循环
/// </summary>
public bool Loop;
/// <summary>
/// IP地址
/// </summary>
public string IP;
/// <summary>
/// 是否连接
/// </summary>
public bool IsConn;
/// <summary>
/// 节点名称
/// </summary>
public List<string> nodeName;
/// <summary>
/// 套接字
/// </summary>
public Socket Socket;
/// <summary>
/// 接收数据线程
/// </summary>
public Thread ListenNet;
}
/// <summary>
/// 客户端的节点
/// </summary>
public class ClientNode
{
private string rfid = "00";
/// <summary>
/// 节点名称
/// </summary>
public string Name { set; get; }
/// <summary>
/// RFID
/// </summary>
public string RFID
{
set
{
if (value.Length < 2)
rfid = value.PadLeft(2, '0');
else
rfid = value;
}
get
{
return rfid;
}
}
/// <summary>
/// 动作
/// </summary>
public ClientAction Action { set; get; }
/// <summary>
/// 优先级
/// </summary>
public ClientLevel Level { set; get; }
/// <summary>
/// 小车名称
/// </summary>
public string AgvName { set; get; }
/// <summary>
/// 在线
/// </summary>
public bool Online { set; get; }
/// <summary>
/// 是否可用
/// </summary>
public bool IsUse { set; get; }
/// <summary>
/// 客户端节点
/// </summary>
/// <param name="name"></param>
/// <param name="isUse"></param>
public ClientNode(string name, bool isUse)
{
Name = name;
RFID = rfid;
Action = ClientAction.None;
Level = ClientLevel.Low;
AgvName = "";
Online = false;
IsUse = isUse;
}
/// <summary>
/// 客户端节点
/// </summary>
/// <param name="name"></param>
/// <param name="rfid"></param>
/// <param name="action"></param>
/// <param name="level"></param>
public ClientNode(string name, string rfid = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low)
{
Name = name;
RFID = rfid;
Action = action;
Level = level;
AgvName = "";
Online = false;
IsUse = false;
}
/// <summary>
/// 所有属性的文本形式
/// </summary>
/// <returns></returns>
public string ToText()
{
string s = string.Format("Name={0}, Action={1}, Level={2}", Name, Action, Level);
return s;
}
/// <summary>
/// 脱机
/// </summary>
public void Offline()
{
RFID = "00";
Action = ClientAction.None;
Level = ClientLevel.Low;
AgvName = "";
Online = false;
}
}
public class AgvInfo
{
/// <summary>
/// 小车名称
/// </summary>
public string Name { set; get; }
/// <summary>
/// 小车在FLEET中的ID号
/// </summary>
public string ID { set; get; }
/// <summary>
/// IP地址
/// </summary>
public string IP { set; get; }
/// <summary>
/// 授权码
/// </summary>
public string Authorization { set; get; }
/// <summary>
/// 当前架子的RFID
/// </summary>
public string RFID { set; get; }
/// <summary>
/// 是否在线
/// </summary>
public bool IsCon { set; get; }
/// <summary>
/// 是否可用
/// </summary>
public bool IsUse { set; get; }
/// <summary>
/// 地点
/// </summary>
public string Place { set; get; }
/// <summary>
/// 小车的状态id
/// </summary>
public int StateID { set; get; }
/// <summary>
/// 小车的状态
/// </summary>
public string StateText { set; get; }
/// <summary>
/// 电量百分比
/// </summary>
public int Battery { set; get; }
/// <summary>
/// 任务文本
/// </summary>
public string Mission_text { set; get; }
/// <summary>
/// 任务的状态
/// </summary>
//public Mission_Status MissionStatus { set; get; }
/// <summary>
/// 下一个任务
/// </summary>
public string NextMission { set; get; }
/// <summary>
/// 关门,用于执行一次
/// </summary>
public bool CloseDoor { set; get; }
/// <summary>
/// 任务发送,用于已调用API,但还没有修改状态
/// </summary>
public bool TaskSend { set; get; }
/// <summary>
/// 闲置等待时间,用于充电
/// </summary>
public int WaitTime { set; get; }
/// <summary>
/// 临时待机位,用于执行一次
/// </summary>
public bool StandbyTemp { set; get; }
public AgvInfo(string id, string name, string ip, string authorization, string ioId, bool isUse)
{
ID = id;
Name = name;
IP = ip;
Authorization = authorization;
RFID = "";
IsCon = false;
IsUse = isUse;
Place = "";
StateText = "";
WaitTime = 0;
}
public string[] ToRow()
{
//AGV名称,IP,AGV状态,任务状态,地点,后续任务,在线,电量,调用,清除缓存
string[] s = new string[10];
s[0] = Name;
s[1] = IP;
if (IsCon)
{
s[2] = StateText;
//s[3] = string.Format("{0}({1})", MissionStatus.ToString(), (int)MissionStatus);
s[4] = Place;
s[5] = NextMission;
}
s[6] = IsCon.ToString();
s[7] = Battery + "%";
s[8] = IsUse.ToString();
s[9] = "Clear";
return s;
}
public string[] ToMission()
{
//AGV名称,IP,AGV状态,任务状态,地点,后续任务,在线,电量,调用,清除缓存
string[] s = new string[2];
s[0] = Name;
s[1] = Mission_text;
return s;
}
/// <summary>
/// 脱机
/// </summary>
public void Offline()
{
IsCon = false;
//Mark = "";
//RFID = "";
//Place = "";
//StateID = -1;
//StateText = "";
//MissionStatus = Mission_Status.None;
//MissionQueue = "";
}
}
/// <summary>
/// 客户端的动作
/// </summary>
public enum ClientAction : byte
{
/// <summary>
/// 没有动作
/// </summary>
None = 0,
/// <summary>
/// 需要7寸D料架
/// </summary>
NeedD = 1,
/// <summary>
/// 需要大尺寸C料架
/// </summary>
NeedC = 2,
/// <summary>
/// 需要进入料架
/// </summary>
NeedEnter = 3,
/// <summary>
/// 需要出去料架
/// </summary>
NeedLeave = 4,
/// <summary>
/// 需要进入离开料架
/// </summary>
NeedEnterLeave = 5,
/// <summary>
/// 准备进入,服务器发送
/// </summary>
ReadyEnter = 6,
/// <summary>
/// 可以进入料架
/// </summary>
MayEnter = 7,
/// <summary>
/// 完成进入料架
/// </summary>
FinishEnter = 8,
/// <summary>
/// 准备离开,服务器发送
/// </summary>
ReadyLeave = 9,
/// <summary>
/// 可以出去料架
/// </summary>
MayLeave = 10,
/// <summary>
/// 完成出去料架
/// </summary>
FinishLeave = 11,
}
/// <summary>
/// 客户端的优先级
/// </summary>
public enum ClientLevel : byte
{
/// <summary>
/// 低
/// </summary>
Low = 0,
/// <summary>
/// 中等
/// </summary>
Middle = 1,
/// <summary>
/// 高
/// </summary>
High = 2
}
}
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AgvServer_DL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AgvServer_DL")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("9208965e-3c78-408a-afdb-466881033768")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0"?>
<doc>
<assembly>
<name>AgvServer_DL</name>
</assembly>
<members>
<member name="T:Asa.AgvServer">
<summary>
AGV服务端
</summary>
</member>
<member name="M:Asa.AgvServer.#ctor(System.String)">
<summary>
AGV服务端
</summary>
<param name="logName"></param>
</member>
<member name="M:Asa.AgvServer.Start">
<summary>
开启服务
</summary>
</member>
<member name="M:Asa.AgvServer.Stop">
<summary>
停止服务
</summary>
</member>
<member name="M:Asa.AgvServer.ListenClient">
<summary>
监听客户端
</summary>
</member>
<member name="M:Asa.AgvServer.ListenNet(System.Object)">
<summary>
客户端数据接收
</summary>
<param name="obj">索引</param>
</member>
<member name="M:Asa.AgvServer.Encode(Asa.AgvServer.ClientNode)">
<summary>
编码
</summary>
<param name="node"></param>
<returns></returns>
</member>
<member name="M:Asa.AgvServer.Decode(System.Byte[])">
<summary>
解码
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="M:Asa.AgvServer.HexBuff(System.Byte[])">
<summary>
16进制
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="T:Asa.AgvServer.ClientNode">
<summary>
客户端的节点
</summary>
</member>
<member name="P:Asa.AgvServer.ClientNode.Name">
<summary>
节点名称
</summary>
</member>
<member name="P:Asa.AgvServer.ClientNode.RFID">
<summary>
RFID
</summary>
</member>
<member name="P:Asa.AgvServer.ClientNode.Action">
<summary>
动作
</summary>
</member>
<member name="P:Asa.AgvServer.ClientNode.Level">
<summary>
优先级
</summary>
</member>
<member name="M:Asa.AgvServer.ClientNode.#ctor(System.String,System.String,Asa.AgvServer.ClientAction,Asa.AgvServer.ClientLevel)">
<summary>
客户端节点
</summary>
<param name="name"></param>
<param name="rfid"></param>
<param name="action"></param>
<param name="level"></param>
</member>
<member name="M:Asa.AgvServer.ClientNode.ToText">
<summary>
所有属性的文本形式
</summary>
<returns></returns>
</member>
<member name="T:Asa.AgvServer.ClientAction">
<summary>
客户端的动作
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.None">
<summary>
没有动作
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.NeedD">
<summary>
需要7寸D料架
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.NeedC">
<summary>
需要大尺寸C料架
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.NeedEnter">
<summary>
需要进入料架
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.NeedLeave">
<summary>
需要出去料架
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.NeedEnterLeave">
<summary>
需要进入离开料架
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.ReadyEnter">
<summary>
准备进入,服务器发送
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.MayEnter">
<summary>
可以进入料架
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.FinishEnter">
<summary>
完成进入料架
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.ReadyLeave">
<summary>
准备离开,服务器发送
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.MayLeave">
<summary>
可以出去料架
</summary>
</member>
<member name="F:Asa.AgvServer.ClientAction.FinishLeave">
<summary>
完成出去料架
</summary>
</member>
<member name="T:Asa.AgvServer.ClientLevel">
<summary>
客户端的优先级
</summary>
</member>
<member name="F:Asa.AgvServer.ClientLevel.Low">
<summary>
</summary>
</member>
<member name="F:Asa.AgvServer.ClientLevel.Middle">
<summary>
中等
</summary>
</member>
<member name="F:Asa.AgvServer.ClientLevel.High">
<summary>
</summary>
</member>
</members>
</doc>
此文件类型无法预览
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer_DL\bin\Debug\AgvServer_DL.xml
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer_DL\bin\Debug\AgvServer_DL.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer_DL\bin\Debug\AgvServer_DL.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer_DL\obj\Debug\AgvServer.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer_DL\obj\Debug\AgvServer_DL.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer_DL\obj\Debug\AgvServer_DL.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\bin\Debug\AgvServer_DL.xml
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\bin\Debug\AgvServer_DL.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\bin\Debug\AgvServer_DL.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\bin\Debug\log4net.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\obj\Debug\AgvServer.csproj.CoreCompileInputs.cache
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\obj\Debug\AgvServer.csproj.CopyComplete
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\obj\Debug\AgvServer_DL.dll
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\obj\Debug\AgvServer_DL.pdb
D:\OneDrive - 上海挚锦科技有限公司\SMD\AGVControl-Qisda-ProductionLine\AgvServer\obj\Debug\AgvServer.csprojAssemblyReference.cache
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!