Commit 88aa209c 刘韬

1

1 个父辈 ffe060f2
......@@ -329,8 +329,8 @@ namespace DeviceLibrary
public enum StringStateE
{
None=0,
Empty,
HasReel,
OutStore,
InStore,
Full
}
public enum StringTypeE
......
......@@ -71,9 +71,10 @@ namespace DeviceLibrary
}
}
//判断有没有出库任务, 需要入库空闲, 出口空闲
else if (IsPutReelReady && boxTransport.IsComplateOrFree)
else if (OutStoreJobList.Count>0 && boxTransport.IsComplateOrFree)
{
if (OutStoreJobList.Dequeue(out JobInfo jobInfo))
TurnToOut();
if (IsPutReelReady && OutStoreJobList.Dequeue(out JobInfo jobInfo))
{
StoreMoveInfo.NewMove(MoveStep.StoreOut10);
StoreMoveInfo.MoveParam.PosID = jobInfo.PosId;
......
......@@ -59,9 +59,17 @@ namespace DeviceLibrary
/// <summary>
/// 强制转换料串为出库模式
/// </summary>
void TurnToOut() {
StringState = StringStateE.Empty;
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_06);
public bool TurnToOut() {
if (StringState == StringStateE.OutStore && StringMoveInfo.MoveStep==MoveStep.StringOut_Released)
{
StringMoveInfo.log($"升起待机料串");
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_03);
CylinderMove(StringMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.HIGH);
return true;
}
return false;
}
StringStateE LastStringState { get => ConfigHelper.Config.Get("Status_LastStringState", StringStateE.None); set => ConfigHelper.Config.Set("Status_LastStringState", value); }
......@@ -83,7 +91,7 @@ namespace DeviceLibrary
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_01);
StringMoveInfo.log($"检测到有料串");
CylinderMove(StringMoveInfo, IO_Type.StringFix_Bottom, IO_Type.StringFix_Top, IO_VALUE.LOW);
StringState = StringStateE.Empty;
StringState = StringStateE.OutStore;
}
else if (IOValue(IO_Type.StringBack_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.StringFront_Check).Equals(IO_VALUE.LOW)){
Msg.add(crc.GetString(L.no_string, "当前没有料串"), MsgLevel.info);
......@@ -146,21 +154,24 @@ namespace DeviceLibrary
break;
case MoveStep.StringLoad_04:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04a);
if (LastStringState == StringStateE.Empty)
if (LastStringState == StringStateE.OutStore)
{
StringMoveInfo.log($"恢复上次料串信息为出库料串");
StringState = StringStateE.Empty;
StringState = StringStateE.OutStore;
}
else if (Batch_Axis.IsInPosition(Config.Batch_P2) && IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.LOW))
{
StringMoveInfo.log($"料串检测为空");
StringState = StringStateE.Empty;
//LastStringState = StringState;
StringState = StringStateE.OutStore;
if (OutStoreJobList.Count == 0) {
StringMoveInfo.log($"当钱空料串, 并且没有出库任务, 料串下降待机");
StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
}
}
else
{
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04a);
StringState = StringStateE.HasReel;
StringState = StringStateE.InStore;
}
if (!newreel)
SetReelHeight(GetHeight(StringMoveInfo));
......@@ -176,7 +187,7 @@ namespace DeviceLibrary
{
tpos2 = 0;
}
if (StringState == StringStateE.Empty && tpos2 - Config.Batch_PoToMM * 30 < 0)
if (StringState == StringStateE.OutStore && tpos2 - Config.Batch_PoToMM * 30 < 0)
{
StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
StringState = StringStateE.Full;
......@@ -191,7 +202,7 @@ namespace DeviceLibrary
CylinderMove(StringMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.LOW);
break;
case MoveStep.StringLoad_06:
if (StringState == StringStateE.HasReel)
if (StringState == StringStateE.InStore)
{
StringMoveInfo.NextMoveStep(MoveStep.StringReadyGet);
StringMoveInfo.log($"料串有盘上升5mm");
......@@ -201,7 +212,7 @@ namespace DeviceLibrary
//OpenFlipDoor(StringMoveInfo);
StringType = StringTypeE.In;
}
else if (StringState == StringStateE.Empty)
else if (StringState == StringStateE.OutStore)
{
StringMoveInfo.NextMoveStep(MoveStep.StringReadyPut);
StringMoveInfo.log($"料串出库模式,下降5cm");
......@@ -236,7 +247,7 @@ namespace DeviceLibrary
StringMoveInfo.log($"料串放料准备就绪");
break;
case MoveStep.StringReelPut:
LastStringState = StringStateE.Empty;
LastStringState = StringStateE.OutStore;
var tpos = Batch_Axis.GetAclPosition() - Config.Batch_PoToMM * (StringMoveInfo.MoveParam.PlateH+Config.Batch_OutPlateDownMM);
if (tpos < 0)
tpos = 0;
......@@ -352,14 +363,14 @@ namespace DeviceLibrary
string StringProcessState() {
string state = "";
if (StringState == StringStateE.Empty)
if (StringState == StringStateE.OutStore)
state = crc.GetString(L.empty_reel, "空料串");
else if (StringState == StringStateE.Full)
{
state = crc.GetString(L.full_reel, "满料串");
}
else if (StringState == StringStateE.HasReel)
else if (StringState == StringStateE.InStore)
state = crc.GetString(L.instore_reel, "入库料串");
else if (StringState == StringStateE.None)
state = crc.GetString(L.no_string, "无料串");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!