Commit 4984321d LN

agv更新。盘高计算修改

1 个父辈 11602259
此文件类型无法预览
...@@ -14,7 +14,7 @@ namespace OnlineStore.AssemblyLine ...@@ -14,7 +14,7 @@ namespace OnlineStore.AssemblyLine
{ {
public partial class FrmAgvTest : Form public partial class FrmAgvTest : Form
{ {
private Asa.Client2 client; private Asa.AgvClient client;
private string[] node = new string[] { "A1", "A2", "A3", "A4", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8" }; private string[] node = new string[] { "A1", "A2", "A3", "A4", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8" };
public FrmAgvTest() public FrmAgvTest()
...@@ -25,7 +25,7 @@ namespace OnlineStore.AssemblyLine ...@@ -25,7 +25,7 @@ namespace OnlineStore.AssemblyLine
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
{ {
label2.Text = "IP:" + ServerIp; label2.Text = "IP:" + ServerIp;
client = new Asa.Client2(ServerIp); client = new Asa.AgvClient (ServerIp);
client.Log += Client_Log; client.Log += Client_Log;
client.Arrive += AgvClient_Arrive; client.Arrive += AgvClient_Arrive;
// agvClient.CanEnter += AgvClient_CanEnter; // agvClient.CanEnter += AgvClient_CanEnter;
...@@ -33,16 +33,16 @@ namespace OnlineStore.AssemblyLine ...@@ -33,16 +33,16 @@ namespace OnlineStore.AssemblyLine
// client.GetRFID += AgvClient_GetRFID; // client.GetRFID += AgvClient_GetRFID;
} }
private void AgvClient_Ready(string name, byte[] content) private void AgvClient_Ready(string name, string rfid)
{ {
RFIDData data = new RFIDData(content); //RFIDData data = new RFIDData(content);
LogUtil.info("FrmAgvTest 收到 AgvClient_Ready [" + name + "] [" + data.ToData() + "] "); LogUtil.info("FrmAgvTest 收到 AgvClient_Ready [" + name + "] [" + rfid + "] ");
} }
private void AgvClient_Arrive(string name, byte[] content) private void AgvClient_Arrive(string name, string rfid)
{ {
RFIDData data = new RFIDData(content); // RFIDData data = new RFIDData(content);
LogUtil.info("FrmAgvTest 收到 AgvClient_Arrive [" + name + "] [" + data.ToData() + "] "); LogUtil.info("FrmAgvTest 收到 AgvClient_Arrive [" + name + "] [" + rfid + "] ");
} }
//private static void AgvClient_GetRFID(string name, byte[] content) //private static void AgvClient_GetRFID(string name, byte[] content)
......
20200403 
20200408 盘高计算修改:如果检测出<=15,都按照8计算
agv更新
20200403
紧急出料不放太慢。 紧急出料不放太慢。
rfid不需要格式化。 rfid不需要格式化。
上料模块批量轴上升时,如果不是第一次上升,最多上升100mm 上料模块批量轴上升时,如果不是第一次上升,最多上升100mm
...@@ -45,8 +51,6 @@ http发送去掉ping。 ...@@ -45,8 +51,6 @@ http发送去掉ping。
在阳光电源流水线的基础上新建佳世达流水线料项目 在阳光电源流水线的基础上新建佳世达流水线料项目
流水线SubType:1000 流水线SubType:1000
移栽出入仓模块:1-18 移栽出入仓模块:1-18
......
...@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
{ {
public static bool CurrCancelState = true; public static bool CurrCancelState = true;
private static string ServerIp = ConfigAppSettings.GetValue(Setting_Init.AgvServerIp); private static string ServerIp = ConfigAppSettings.GetValue(Setting_Init.AgvServerIp);
private static Asa.Client2 agvClient; private static Asa.AgvClient agvClient;
public static Dictionary<string, Asa.ClientAction> actionMap = new Dictionary<string, Asa.ClientAction>(); public static Dictionary<string, Asa.ClientAction> actionMap = new Dictionary<string, Asa.ClientAction>();
public static List<string> NodeList = new List<string>(); public static List<string> NodeList = new List<string>();
private static bool isInit = false; private static bool isInit = false;
...@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary
if (!isInit) if (!isInit)
{ {
isInit = true; isInit = true;
agvClient = new Asa.Client2(ServerIp); agvClient = new Asa.AgvClient(ServerIp);
agvClient.CancelState = true; agvClient.CancelState = true;
agvClient.Log += AgvClient_Log; agvClient.Log += AgvClient_Log;
agvClient.Arrive += AgvClient_Arrive; agvClient.Arrive += AgvClient_Arrive;
...@@ -81,38 +81,38 @@ namespace OnlineStore.DeviceLibrary ...@@ -81,38 +81,38 @@ namespace OnlineStore.DeviceLibrary
agvClient.SetStatus(id, "", shelfId, action, level); agvClient.SetStatus(id, "", shelfId, action, level);
UpdateAction(id, action); UpdateAction(id, action);
} }
private static void AgvClient_CloseDoor(string id, byte[] content) private static void AgvClient_CloseDoor(string id, string rfid)
{ {
RFIDData data = new RFIDData(content); // RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_CloseDoor [" + id + "] [" + data.NumStr() + "] "); LogUtil.info("收到 AgvClient_CloseDoor [" + id + "] [" + rfid + "] ");
} }
private static void AgvClient_Ready(string id, byte[] content) private static void AgvClient_Ready(string id, string rfid)
{ {
UpdateAction(id, ClientAction.Ready); UpdateAction(id, ClientAction.Ready);
RFIDData data = new RFIDData(content); // RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] "); LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + rfid + "] ");
FeedingEquip equip = getFeedEquip(id); FeedingEquip equip = getFeedEquip(id);
if (equip == null) if (equip == null)
{ {
LogUtil.error("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] 未找到对应的设备 ,暂不处理"); LogUtil.error("收到 AgvClient_Ready [" + id + "] [" + rfid + "] 未找到对应的设备 ,暂不处理");
return; return;
} }
equip.AgvReady(id, data); equip.AgvReady(id, rfid);
} }
private static void AgvClient_Arrive(string id, byte[] content) private static void AgvClient_Arrive(string id, string rfid)
{ {
UpdateAction(id, ClientAction.Arrive); UpdateAction(id, ClientAction.Arrive);
RFIDData data = new RFIDData(content); // RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_Arrive [" + id + "] [" + data.ToData() + "] "); LogUtil.info("收到 AgvClient_Arrive [" + id + "] [" + rfid + "] ");
FeedingEquip equip = getFeedEquip(id); FeedingEquip equip = getFeedEquip(id);
if (equip == null) if (equip == null)
{ {
LogUtil.error("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] 未找到对应的设备 ,暂不处理 "); LogUtil.error("收到 AgvClient_Ready [" + id + "] [" + rfid + "] 未找到对应的设备 ,暂不处理 ");
return; return;
} }
equip.AgvArrive(id, data); equip.AgvArrive(id, rfid);
} }
private static FeedingEquip getFeedEquip(string nodeId) private static FeedingEquip getFeedEquip(string nodeId)
......
...@@ -642,9 +642,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -642,9 +642,9 @@ namespace OnlineStore.DeviceLibrary
return usable; return usable;
} }
internal void AgvArrive(string nodeId, RFIDData data) internal void AgvArrive(string nodeId, string rfid)
{ {
string logN = Name + "收到 AgvArrive 事件 [" + nodeId + "] [" + data.ToData() + "] "; string logN = Name + "收到 AgvArrive 事件 [" + nodeId + "] [" + rfid + "] ";
if (nodeId.Equals(Config.AgvInName)) if (nodeId.Equals(Config.AgvInName))
{ {
} }
...@@ -654,9 +654,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -654,9 +654,9 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(logN + ":" + "暂无处理"); LogUtil.info(logN + ":" + "暂无处理");
} }
internal void AgvReady(string nodeId, RFIDData data) internal void AgvReady(string nodeId, string rfid)
{ {
string logN = Name + "收到 AgvReady 事件 [" + nodeId + "] [" + data.NumStr() + "] "; string logN = Name + "收到 AgvReady 事件 [" + nodeId + "] [" + rfid + "] ";
if (nodeId.Equals(Config.AgvInName)) if (nodeId.Equals(Config.AgvInName))
{ {
......
...@@ -1211,17 +1211,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -1211,17 +1211,26 @@ namespace OnlineStore.DeviceLibrary
buchongStr = "(最后一盘料已补充5)"; buchongStr = "(最后一盘料已补充5)";
height += 5; height += 5;
} }
List<int> heightList = LineManager.GetTrayList();
heightList = (from m in heightList orderby m descending select m).ToList<int>(); //如果检测出<=15,都按照8计算
float minCha = height; if (height <= 15)
foreach (int h in heightList) {
{ LastHeight = 8;
//取差值最小的接近值 }
float cha = Math.Abs(h - (height - 4)); else
if (cha < minCha) {
List<int> heightList = LineManager.GetTrayList();
heightList = (from m in heightList orderby m descending select m).ToList<int>();
float minCha = height;
foreach (int h in heightList)
{ {
LastHeight = h; //取差值最小的接近值
minCha = cha; float cha = Math.Abs(h - (height - 4));
if (cha < minCha)
{
LastHeight = h;
minCha = cha;
}
} }
} }
if (LastHeight <= 8) { LastHeight = 8; } if (LastHeight <= 8) { LastHeight = 8; }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!