Commit 3c66cc7b 张东亮

修改产线名前缀为MP

1 个父辈 3803ecbd
......@@ -44,8 +44,8 @@
<Reference Include="Agv.Server">
<HintPath>dll\Agv.Server.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>dll\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......
......@@ -31,15 +31,15 @@ namespace AGVControl
/// 限制区域有小车
/// </summary>
/// <param name="ip"></param>
private void LimitArea_ScopeLimitStateChangedEvent(string ip,bool state)
private void LimitArea_ScopeLimitStateChangedEvent(string ip, bool state)
{
Invoke(new Action(()=>
Invoke(new Action(() =>
{
if (DeviceLibrary.Context.control.limitArea.Available)
lblLimit.Text = "限制区域车辆:";
else
{
lblLimit.Text = "限制区域车辆:"+ ip;
lblLimit.Text = "限制区域车辆:" + ip;
}
}
));
......@@ -53,16 +53,16 @@ namespace AGVControl
if (input != null && input.Length == 4)
DeviceLibrary.Context.agvInfo[i].IsExistShelf = input[3];
flowPanelKanBan.Controls.Add(DeviceLibrary.Context.agvInfo[i].StateKanban);
AddForm(DeviceLibrary.Context.agvInfo[i].Name,new Manual(DeviceLibrary.Context.agvInfo[i]));
AddForm(DeviceLibrary.Context.agvInfo[i].Name, new Manual(DeviceLibrary.Context.agvInfo[i]));
DeviceLibrary.Context.agvInfo[i].StateKanban.Init();
}
for (int i = 0; i < DeviceLibrary.Context.nodeInfo.Count; i++)
{
Agv.ClientNode node = DeviceLibrary.Context.nodeInfo[i];
if (node.Name.StartsWith("S"))
if (node.Name.StartsWith("MP"))
continue;
n = DgvNode.Rows.Add(node.AliceName, node.Action, node.Shelf, node.RFID, node.Online, node.IsUse);
n = DgvNode.Rows.Add(node.LineName, node.Action, node.Shelf, node.RFID, node.Online, node.IsUse);
DgvNode.Rows[n].HeaderCell.Value = (n + 1).ToString();
if (i % 2 == 0)
DgvNode.Rows[n].DefaultCellStyle.BackColor = Color.LightBlue;
......@@ -118,21 +118,20 @@ namespace AGVControl
string ip = AppConfigHelper.GetValue(SettingString.AGVServerIp);
int port = AppConfigHelper.GetIntValue(SettingString.AGVServerPort);
DeviceLibrary.Context.server.Start(ip, port);
LogUtil.logBox= richTextBox1;
LogUtil.logBox = richTextBox1;
}
private void Server_NodeOnline(string nodeName, bool online)
{
this.Invoke(new Action(()=>
this.Invoke(new Action(() =>
{
int idx = DeviceLibrary.Context.nodeInfo.FindIndex(s=> s.Name.Equals(nodeName));
int idx = DeviceLibrary.Context.nodeInfo.FindIndex(s => s.Name.Equals(nodeName));
if (idx > -1)
{
DeviceLibrary.Context.nodeInfo[idx].Online = online;
if (!online)
DeviceLibrary.Context.nodeInfo[idx].Action = Agv.ClientAction.None;
DeviceLibrary.Context.nodeInfo[idx].IsUse = online;
DgvNode.Rows[idx].DefaultCellStyle.ForeColor = online ? Color.Black : Color.Red;
DgvNode.Rows[idx].SetValues(DeviceLibrary.Context.nodeInfo[idx].AliceName, DeviceLibrary.Context.nodeInfo[idx].Action, DeviceLibrary.Context.nodeInfo[idx].Shelf, DeviceLibrary.Context.nodeInfo[idx].RFID, DeviceLibrary.Context.nodeInfo[idx].Online, DeviceLibrary.Context.nodeInfo[idx].IsUse);
DgvNode.Rows[idx].SetValues(DeviceLibrary.Context.nodeInfo[idx].LineName, DeviceLibrary.Context.nodeInfo[idx].Action, DeviceLibrary.Context.nodeInfo[idx].Shelf, DeviceLibrary.Context.nodeInfo[idx].RFID, DeviceLibrary.Context.nodeInfo[idx].Online, DeviceLibrary.Context.nodeInfo[idx].IsUse);
}
}
));
......@@ -146,8 +145,8 @@ namespace AGVControl
DeviceLibrary.Context.nodeInfo[idx].Action = clientNode.Action;
DeviceLibrary.Context.nodeInfo[idx].Shelf = clientNode.Shelf;
DeviceLibrary.Context.nodeInfo[idx].RFID = clientNode.RFID;
DgvNode.Rows[idx].SetValues(DeviceLibrary.Context.nodeInfo[idx].AliceName, DeviceLibrary.Context.nodeInfo[idx].Action, DeviceLibrary.Context.nodeInfo[idx].Shelf, DeviceLibrary.Context.nodeInfo[idx].RFID, DeviceLibrary.Context.nodeInfo[idx].Online, DeviceLibrary.Context.nodeInfo[idx].IsUse);
}
DgvNode.Rows[idx].SetValues(DeviceLibrary.Context.nodeInfo[idx].LineName, DeviceLibrary.Context.nodeInfo[idx].Action, DeviceLibrary.Context.nodeInfo[idx].Shelf, DeviceLibrary.Context.nodeInfo[idx].RFID, DeviceLibrary.Context.nodeInfo[idx].Online, DeviceLibrary.Context.nodeInfo[idx].IsUse);
}
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
......@@ -179,7 +178,7 @@ namespace AGVControl
DgvNode.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = DeviceLibrary.Context.nodeInfo[e.RowIndex].IsUse.ToString();
DeviceLibrary.Context.WriteIni(DeviceLibrary.Context.nodeInfo[e.RowIndex].Name, SettingString.IsUse, DeviceLibrary.Context.nodeInfo[e.RowIndex].IsUse.ToString());
Agv.ClientNode node = DeviceLibrary.Context.nodeInfo[e.RowIndex];
DgvNode.Rows[e.RowIndex].SetValues(node.AliceName, node.Action, node.Shelf, node.RFID, node.Online, node.IsUse);
DgvNode.Rows[e.RowIndex].SetValues(node.LineName, node.Action, node.Shelf, node.RFID, node.Online, node.IsUse);
}
}
......@@ -286,9 +285,9 @@ namespace AGVControl
label3.Text = "";
if (textBox1.Text.Equals(""))
return;
if(RequestManager.AgvRemoveRfid(textBox1.Text.ToUpper()))
if (RequestManager.AgvRemoveRfid(textBox1.Text.ToUpper()))
{
LogUtil.info("手动清理料架缓存:"+ textBox1.Text.ToUpper());
LogUtil.info("手动清理料架缓存:" + textBox1.Text.ToUpper());
label3.Text = "清理料架缓存成功:" + textBox1.Text.ToUpper();
label3.BackColor = Color.Green;
}
......
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
......@@ -8,7 +8,7 @@
</startup>
<log4net>
<appender name="AGVDispatch" type="log4net.Appender.RollingFileAppender">
<file value="logs/AGVDispatch.log"/>
<file value="logs/AGVDispatch/AGVDispatch.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
......@@ -18,7 +18,7 @@
</layout>
</appender>
<appender name="MiR_API" type="log4net.Appender.RollingFileAppender">
<file value="logs/MiR_API.log"/>
<file value="logs/MiR_API/MiR_API.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/>
......@@ -39,6 +39,21 @@
<conversionPattern value="[%date][%t][%c:%L]%-5p %m%n"/>
</layout>
</appender>
<appender name="Agv" type="log4net.Appender.RollingFileAppender">
<file value="logs/Agv/Agv.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t][%c:%L]%-5p %m%n"/>
</layout>
</appender>
<logger name="Agv">
<level value="Info"/>
<appender-ref ref="Agv"/>
</logger>
<logger name="MiR_API">
<level value="Error"/>
<appender-ref ref="MiR_API"/>
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net472" />
<package id="RestSharp" version="106.11.4" targetFramework="net461" />
</packages>
\ No newline at end of file
......@@ -31,8 +31,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>.\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......@@ -67,5 +67,8 @@
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net472" />
</packages>
\ No newline at end of file
......@@ -37,13 +37,14 @@
<Reference Include="Agv.Server">
<HintPath>..\AGVDispatch\dll\Agv.Server.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>.\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath>.\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
......@@ -100,6 +101,7 @@
<None Include="Config\AgvProductionLine.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
......@@ -173,7 +173,7 @@ namespace DeviceLibrary
{
if (Context.CheckEnterOrLeaveFinished(agv, SettingString.Enter, CurTaskState))
{
Context.server.CloseDoor(TargetPlace);
//Context.server.CloseDoor(TargetPlace);
if (recyMark)
{
......
......@@ -160,7 +160,7 @@ namespace DeviceLibrary
{
if (Context.CheckEnterOrLeaveFinished(agv, SettingString.Enter, CurTaskState))
{
Context.server.CloseDoor(TargetPlace);
//Context.server.CloseDoor(TargetPlace);
if (FindShelfTarget(agv, out string tarNodeName))
{
runInfo = "料串进入小车完成,任务结束";
......
......@@ -171,7 +171,7 @@ namespace DeviceLibrary
{
if (Context.CheckEnterOrLeaveFinished(agv, SettingString.Enter, CurTaskState))
{
Context.server.CloseDoor(TargetPlace);
//Context.server.CloseDoor(TargetPlace);
if (FindRecycleStation(agv))
{
curJobStep.ToNextStep(EXECUTE_STEP.R5_WAIT_REACH_RECYCLE_STATION);
......
......@@ -127,7 +127,7 @@ namespace DeviceLibrary
{
if (Context.CheckEnterOrLeaveFinished(agv, SettingString.Leave, CurTaskState))
{
Context.server.CloseDoor(TargetPlace);
//Context.server.CloseDoor(TargetPlace);
curJobStep.ToNextStep(EXECUTE_STEP.P5_END);
runInfo = "料架进入" + TargetPlace + "完成";
msg += runInfo;
......
using Agv;
using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
public class NodeManager
{
/// <summary>
/// 节点信息
/// </summary>
public List<Agv.ClientNode> nodeInfo;
public NodeManager()
{
InitNodes();
}
/// <summary>
/// 初始化节点
/// </summary>
public void InitNodes()
{
nodeInfo = new List<Agv.ClientNode>();
string path = DeviceLibrary.Context.CONFIG_PATH + SettingString.FileName_AgvProductionLine;
string[] line = System.IO.File.ReadAllLines(path, Encoding.GetEncoding("gb2312"));
string[] temp;
for (int i = 1; i < line.Length; i++)
{
temp = line[i].Split(',');
if (temp.Length != 3) continue;
bool.TryParse(DeviceLibrary.Context.ReadIni(temp[0], SettingString.IsUse), out bool isUse);
nodeInfo.Add(new Agv.ClientNode(temp[0], temp[1], temp[2], isUse));
}
}
/// <summary>
/// 根据alicename获取节点名
/// </summary>
/// <param name="aliceName"></param>
/// <param name="nodeName"></param>
/// <returns></returns>
public bool GetNodeNameByAliceName(string aliceName, out string nodeName)
{
nodeName = "";
int id = nodeInfo.FindIndex(s => s.AliceName.Equals(aliceName));
if (id > -1)
{
nodeName = nodeInfo[id].Name;
return true;
}
else
{
return false;
}
}
/// <summary>
/// 根据节点名获取alicename
/// </summary>
/// <param name="nodeName"></param>
/// <param name="lineName"></param>
/// <returns></returns>
public bool GetLineNameByNodeName(string nodeName, out string lineName)
{
lineName = "";
int id = nodeInfo.FindIndex(s => s.Name.Equals(nodeName));
if (id > -1)
{
lineName = nodeInfo[id].LineName;
return true;
}
else
{
return false;
}
}
/// <summary>
/// 查找节点是否存在以及是否调用
/// </summary>
/// <param name="nodeName">节点名称</param>
/// <returns></returns>
public bool FindNodeByName(string nodeName,out Agv.ClientNode node)
{
node = nodeInfo.Find(s => s.Name.Equals(nodeName) && s.IsUse);
if (node == null)
return false;
else
return true;
}
/// <summary>
/// 查找节点是否存在以及是否调用
/// </summary>
/// <param name="nodeName">节点名称</param>
/// <returns></returns>
public bool FindNodeByName(string nodeName)
{
Agv.ClientNode node = nodeInfo.Find(s => s.Name.Equals(nodeName) && s.IsUse);
if (node == null)
return false;
else
return true;
}
public bool CheckNodeLevel(string nodeName,Agv.ClientLevel level)
{
ClientNode node;
bool find=FindNodeByName(nodeName,out node);
if(find)
{
if (node.Level.Equals(level))
return true;
}
return false;
}
}
}
......@@ -75,7 +75,7 @@ namespace DeviceLibrary
string resultStr = HttpHelper.Get(server);
log.Debug("清理料架的缓存信息【" + server + "】【" + resultStr + "】");
RfidData rfidData = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
AgvRemoveData rfidData = JsonHelper.DeserializeJsonToObject<AgvRemoveData>(resultStr);
if (rfidData == null)
{
......@@ -206,4 +206,13 @@ namespace DeviceLibrary
public Dictionary<string, string> data { get; set; }
}
public class AgvRemoveData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public string data { get; set; }
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.12" targetFramework="net472" />
</packages>
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!