Commit 5243dba7 张东亮

料串状态上报smf

1 个父辈 efb8006c
......@@ -13,7 +13,7 @@ namespace DeviceLibrary
{
partial class MainMachine
{
bool LeftShelfNoTray = false;
public bool LeftShelfNoTray = false;
int LeftCount = 0;
public bool SafeReleaseLeftShelf = false;
......@@ -93,6 +93,7 @@ namespace DeviceLibrary
case MoveStep.L01:
LeftCount = 0;
LeftShelfNoTray = false;
LeftMoveInfo.CurShelfType = "";
LeftMoveInfo.NextMoveStep(MoveStep.L02);
CylinderMove(null, IO_Type.LeftStopDown, IO_Type.LeftStopUP);
LeftBatchAxisToP2(Config.Left_Batch_P2, Config.Left_Batch_P1_speed, IO_VALUE.HIGH);
......@@ -111,7 +112,7 @@ namespace DeviceLibrary
int currpoint = Left_Batch_Axis.GetAclPosition();
int countPleHight = PlwHight / Config.Right_Batch_ChangeValue * Config.Left_Batch_ChangeValue;
targetP1 = currpoint - countPleHight + 5000;
LeftMoveInfo.log($"出料提升机构,获取到料盘高度脉冲{PlwHight},当前位置{currpoint},计算盘高{countPleHight/ Config.Left_Batch_ChangeValue}");
LeftMoveInfo.log($"出料提升机构,获取到料盘高度脉冲{PlwHight},当前位置{currpoint},计算盘高{countPleHight / Config.Left_Batch_ChangeValue}");
}
int targetSpeed = Config.Left_Batch_P1_speed;
if (targetP1 <= 0)
......@@ -154,6 +155,18 @@ namespace DeviceLibrary
LabelMoveInfo.MoveParam = LeftMoveInfo.MoveParam.clone();
LeftMoveInfo.log($"左侧料盘已放入,批量轴下降固定值");
}
if (LeftMoveInfo.MoveParam.PlateW == 7)
{
LeftMoveInfo.CurShelfType = ShelfType.smallReel.ToString();
}
else if (LeftMoveInfo.MoveParam.PlateW == 13)
{
LeftMoveInfo.CurShelfType = ShelfType.bigReel.ToString();
}
else if (LeftMoveInfo.MoveParam.PlateW == 15)
{
LeftMoveInfo.CurShelfType = ShelfType.bigReel.ToString();
}
//else
//{
// LeftMoveInfo.NextMoveStep(MoveStep.L11_ReelPutted);
......@@ -344,7 +357,9 @@ namespace DeviceLibrary
{
state += string.Format(crc.GetString("Res0069", "有料串,已放置{0}张料盘"), LeftCount);
if (LeftShelfNoTray)
{
state += "," + crc.GetString("Res0043", "料串已满");
}
else
state += ".";
state += crc.GetString("Res0045", "当前ReelID:") + LeftMoveInfo.MoveParam.WareCode;
......
......@@ -37,10 +37,12 @@ namespace DeviceLibrary
delegate string StateDelegate();
StateDelegate stateDelegate;
public void SetStateDelegate(Func<string> target) {
public void SetStateDelegate(Func<string> target)
{
stateDelegate = new StateDelegate(target);
}
public String GetStateStr() {
public String GetStateStr()
{
if (stateDelegate != null)
return stateDelegate.Invoke();
......@@ -50,7 +52,10 @@ namespace DeviceLibrary
{
get { return moveStep; }
}
/// <summary>
/// 当前料串类型
/// </summary>
public string CurShelfType { get; set; } = "";
public void NewMove(MoveStep step)
{
this.MoveParam = new LabelParam();
......@@ -106,10 +111,11 @@ namespace DeviceLibrary
return span;
}
public string lastmsg = "";
public void log(string msg) {
public void log(string msg)
{
msg = $"[{Name}][{moveStep}][{MoveParam.WareCode}]{msg}";
if (String.Compare(lastmsg,msg, StringComparison.Ordinal)!=0)
if (String.Compare(lastmsg, msg, StringComparison.Ordinal) != 0)
{
lastmsg = msg;
LogUtil.info(msg);
......@@ -201,7 +207,7 @@ namespace DeviceLibrary
wait.IsHomeMove = false;
return wait;
}
public static WaitResultInfo WaitAction(Func<WaitResultInfo, bool> a,string msg)
public static WaitResultInfo WaitAction(Func<WaitResultInfo, bool> a, string msg)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = WaitEnum.W013_Action;
......@@ -245,11 +251,11 @@ namespace DeviceLibrary
}
else if (WaitType.Equals(WaitEnum.W008_BatchAxis))
{
return crc.GetString("Res0124.84e7c741","批量轴上升到上料点");
return crc.GetString("Res0124.84e7c741", "批量轴上升到上料点");
}
else if (WaitType.Equals(WaitEnum.W009_ScanCode))
{
return crc.GetString("Res0125.ed4de1c6","扫码完成");
return crc.GetString("Res0125.ed4de1c6", "扫码完成");
}
else if (WaitType.Equals(WaitEnum.W013_Action))
{
......
......@@ -494,16 +494,21 @@ namespace DeviceLibrary
//msg.msgParams = new string[] { addressValue.GetStateStr() };
msg.msg = addressValue.GetStateStr();
equipMsgs.Add(msg);
if(RobotManage.mainMachine.runStatus == RunStatus.Running)
if (RobotManage.mainMachine.runStatus == RunStatus.Running)
{
if (addressValue.Name == crc.GetString("Res0039", "右侧取料"))
{
dic.Add("inShelfType", ShelfType.smallReel.ToString());
dic.Add("inShelfType", $"{ShelfType.smallReel.ToString()},{ShelfType.bigReel.ToString()}");
dic.Add("inShelfStatus", ShelfStatus(true, Convert.ToInt32(addressValue.MoveStep)));
}
if (addressValue.Name == crc.GetString("Res0051", "左侧放料"))
{
dic.Add("outShelfType", ShelfType.smallReel.ToString());
if (RobotManage.mainMachine.LeftShelfNoTray)
dic.Add("outShelfType", addressValue.CurShelfType);
else
{
dic.Add("outShelfType", "");
}
dic.Add("outShelfStatus", ShelfStatus(false, Convert.ToInt32(addressValue.MoveStep)));
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!