Commit ce8bf8c3 张东亮

取出出库料盘优化

1 个父辈 d727492d
...@@ -3,12 +3,14 @@ using OnlineStore.Common; ...@@ -3,12 +3,14 @@ using OnlineStore.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.Layout; using System.Windows.Forms.Layout;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
namespace OnlineStore namespace OnlineStore
{ {
...@@ -285,12 +287,6 @@ namespace OnlineStore ...@@ -285,12 +287,6 @@ namespace OnlineStore
private static void PreControlLanaguage(Control partentControl, string className) private static void PreControlLanaguage(Control partentControl, string className)
{ {
string newStr = ""; string newStr = "";
//Con_GetTxt(partentControl, out string title);
//string newStr = GetString(GetTextIdStr(className, partentControl.Name), title);
//if (!newStr.Equals(""))
//{
//Con_SetTxt(partentControl, newStr.Replace("\\n", "\n"));
//}
foreach (Control con in partentControl.Controls) foreach (Control con in partentControl.Controls)
{ {
string txt = ""; string txt = "";
......
...@@ -63,12 +63,14 @@ namespace DeviceLibrary ...@@ -63,12 +63,14 @@ namespace DeviceLibrary
/// <summary> /// <summary>
/// 强制转换料串为出库模式 /// 强制转换料串为出库模式
/// </summary> /// </summary>
public bool TurnToOut() { public bool TurnToOut()
{
if (!IsBatchDoorClosed) { if (!IsBatchDoorClosed)
{
return false; return false;
} }
if (StringState>= StringStateE.Full) if (StringState >= StringStateE.Full)
{ {
return false; return false;
} }
...@@ -77,7 +79,7 @@ namespace DeviceLibrary ...@@ -77,7 +79,7 @@ namespace DeviceLibrary
StringMoveInfo.log($"升起待机料串1"); StringMoveInfo.log($"升起待机料串1");
StringState = StringStateE.OutStore; StringState = StringStateE.OutStore;
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04); StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04);
BatchAxisToP2(StringMoveInfo,true); BatchAxisToP2(StringMoveInfo, true);
StringMoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("料串正在上升", MsgLevel.warning)); StringMoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("料串正在上升", MsgLevel.warning));
newreel = true; newreel = true;
return true; return true;
...@@ -146,11 +148,11 @@ namespace DeviceLibrary ...@@ -146,11 +148,11 @@ namespace DeviceLibrary
Batch_Axis.AbsMove(StringMoveInfo, Config.Batch_P1, Config.Batch_P1_speed); Batch_Axis.AbsMove(StringMoveInfo, Config.Batch_P1, Config.Batch_P1_speed);
break; break;
case MoveStep.StringLoad_01: case MoveStep.StringLoad_01:
if(StringState== StringStateE.OutStore) if (StringState == StringStateE.OutStore)
{ {
ServerCM.storeStatus = StoreStatus.OutStoreExecute; ServerCM.storeStatus = StoreStatus.OutStoreExecute;
} }
else if(StringState== StringStateE.InStore) else if (StringState == StringStateE.InStore)
{ {
ServerCM.storeStatus = StoreStatus.InStoreExecute; ServerCM.storeStatus = StoreStatus.InStoreExecute;
} }
...@@ -180,7 +182,7 @@ namespace DeviceLibrary ...@@ -180,7 +182,7 @@ namespace DeviceLibrary
if (tpos1 < 0) if (tpos1 < 0)
tpos1 = 0; tpos1 = 0;
Batch_Axis.AbsMove(StringMoveInfo, tpos1, Config.Batch_P1_speed); Batch_Axis.AbsMove(StringMoveInfo, tpos1, Config.Batch_P1_speed);
StringMoveInfo.log($"批量轴下降1cm: {Batch_Axis.GetAclPosition()}-{Config.Batch_PoToMM}*10="+ tpos1); StringMoveInfo.log($"批量轴下降1cm: {Batch_Axis.GetAclPosition()}-{Config.Batch_PoToMM}*10=" + tpos1);
break; break;
case MoveStep.StringLoad_03: case MoveStep.StringLoad_03:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04); StringMoveInfo.NextMoveStep(MoveStep.StringLoad_04);
...@@ -190,10 +192,11 @@ namespace DeviceLibrary ...@@ -190,10 +192,11 @@ namespace DeviceLibrary
BatchAxisToP2(StringMoveInfo); BatchAxisToP2(StringMoveInfo);
TestHeightTask = null; TestHeightTask = null;
} }
else { else
{
TestHeightTask = TestReelHeight(); TestHeightTask = TestReelHeight();
} }
StringMoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("料串正在上升",MsgLevel.warning)); StringMoveInfo.WaitList.Add(WaitResultInfo.WaitMsg("料串正在上升", MsgLevel.warning));
break; break;
case MoveStep.StringLoad_04: case MoveStep.StringLoad_04:
if (oldtestheight) if (oldtestheight)
...@@ -217,7 +220,8 @@ namespace DeviceLibrary ...@@ -217,7 +220,8 @@ namespace DeviceLibrary
SetReelHeight(GetHeight(StringMoveInfo)); SetReelHeight(GetHeight(StringMoveInfo));
newreel = false; newreel = false;
} }
else if (TestHeightTask.IsCompleted){ else if (TestHeightTask.IsCompleted)
{
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_05); StringMoveInfo.NextMoveStep(MoveStep.StringLoad_05);
} }
break; break;
...@@ -229,7 +233,8 @@ namespace DeviceLibrary ...@@ -229,7 +233,8 @@ namespace DeviceLibrary
{ {
if (ClampMoveInfo.MoveStep == MoveStep.Wait && (!Middle_Axis.IsInPosition(Config.Middle_P2) || InOut_Axis.IsInPosition(Config.InOut_P1))) if (ClampMoveInfo.MoveStep == MoveStep.Wait && (!Middle_Axis.IsInPosition(Config.Middle_P2) || InOut_Axis.IsInPosition(Config.InOut_P1)))
{ {
if (RobotManage.InoutDebugMode) { if (RobotManage.InoutDebugMode)
{
StringMoveInfo.NextMoveStep(MoveStep.StringReadyGet); StringMoveInfo.NextMoveStep(MoveStep.StringReadyGet);
StringMoveInfo.log($"出入库测试模式跳过拍照扫码"); StringMoveInfo.log($"出入库测试模式跳过拍照扫码");
} }
...@@ -333,13 +338,13 @@ namespace DeviceLibrary ...@@ -333,13 +338,13 @@ namespace DeviceLibrary
StringMoveInfo.log($"当前服务器反馈没有出库任务, 料串下降待机"); StringMoveInfo.log($"当前服务器反馈没有出库任务, 料串下降待机");
StringMoveInfo.NextMoveStep(MoveStep.StringOut_01); StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
} }
else if(RequestTakeOutReel) else if (RequestTakeOutReel && StoreMoveInfo.IsStep(MoveStep.Wait))
{ {
StringMoveInfo.log($"请求取出出库料盘,料串下降"); StringMoveInfo.log($"请求取出出库料盘,料串下降");
RobotManage.mainMachine.StringMoveInfo.NextMoveStep(MoveStep.StringOut_01); RobotManage.mainMachine.StringMoveInfo.NextMoveStep(MoveStep.StringOut_01);
StringState = StringStateE.ManualOut; StringState = StringStateE.ManualOut;
} }
else if(ServerCM.queueTaskCount != 0) else if (ServerCM.queueTaskCount != 0)
{ {
StringMoveInfo.log($"当前服务器反馈有出库任务:{ServerCM.queueTaskCount}"); StringMoveInfo.log($"当前服务器反馈有出库任务:{ServerCM.queueTaskCount}");
} }
...@@ -349,13 +354,14 @@ namespace DeviceLibrary ...@@ -349,13 +354,14 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.StringReelPut: case MoveStep.StringReelPut:
if (Setting_Init.Device_OutStoreStringReelCheck) { if (Setting_Init.Device_OutStoreStringReelCheck)
{
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_03); StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_03);
BatchAxisToP2(StringMoveInfo,true); BatchAxisToP2(StringMoveInfo, true);
return; return;
} }
var tpos = Batch_Axis.GetAclPosition() - Config.Batch_PoToMM * (StringMoveInfo.MoveParam.PlateH+Config.Batch_OutPlateDownMM); var tpos = Batch_Axis.GetAclPosition() - Config.Batch_PoToMM * (StringMoveInfo.MoveParam.PlateH + Config.Batch_OutPlateDownMM);
//if (tpos < 0) //if (tpos < 0)
// tpos = 0; // tpos = 0;
if (tpos < Config.Batch_P2 * 0.3 && !downCheck1) if (tpos < Config.Batch_P2 * 0.3 && !downCheck1)
...@@ -396,13 +402,14 @@ namespace DeviceLibrary ...@@ -396,13 +402,14 @@ namespace DeviceLibrary
case MoveStep.StringReelPut_02: case MoveStep.StringReelPut_02:
StringMoveInfo.NextMoveStep(MoveStep.StringLoad_05); StringMoveInfo.NextMoveStep(MoveStep.StringLoad_05);
StringMoveInfo.log($"批量轴到顶部检测点"); StringMoveInfo.log($"批量轴到顶部检测点");
BatchAxisToP2(StringMoveInfo,true); BatchAxisToP2(StringMoveInfo, true);
break; break;
case MoveStep.StringReelPut_03: case MoveStep.StringReelPut_03:
StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_04); StringMoveInfo.NextMoveStep(MoveStep.StringReelPut_04);
var heightcheck = (LastOutDownPosition - Batch_Axis.GetAclPosition()) / Config.Batch_PoToMM; var heightcheck = (LastOutDownPosition - Batch_Axis.GetAclPosition()) / Config.Batch_PoToMM;
StringMoveInfo.log($"LastOutDownPosition={LastOutDownPosition},CurrentPosition={Batch_Axis.GetAclPosition()},heightcheck={heightcheck}"); StringMoveInfo.log($"LastOutDownPosition={LastOutDownPosition},CurrentPosition={Batch_Axis.GetAclPosition()},heightcheck={heightcheck}");
if (heightcheck <= 5) { if (heightcheck <= 5)
{
Msg.add("出库时料盘未成功放入料串,请检查", MsgLevel.alarm); Msg.add("出库时料盘未成功放入料串,请检查", MsgLevel.alarm);
RobotManage.UserPause("出库时料盘未成功放入料串,请检查"); RobotManage.UserPause("出库时料盘未成功放入料串,请检查");
} }
...@@ -454,7 +461,8 @@ namespace DeviceLibrary ...@@ -454,7 +461,8 @@ namespace DeviceLibrary
} }
} }
string StringProcessState() { string StringProcessState()
{
string state = ""; string state = "";
if (StringState == StringStateE.OutStore) if (StringState == StringStateE.OutStore)
...@@ -498,7 +506,7 @@ namespace DeviceLibrary ...@@ -498,7 +506,7 @@ namespace DeviceLibrary
{ {
targetSpeed = Config.Batch_P1_speed; targetSpeed = Config.Batch_P1_speed;
} }
moveInfo.log("BatchAxisToP2 目标P2: " + targetP2+",speed:"+targetSpeed); moveInfo.log("BatchAxisToP2 目标P2: " + targetP2 + ",speed:" + targetSpeed);
moveInfo.TimeOutSeconds = 200; moveInfo.TimeOutSeconds = 200;
moveInfo.CanWhileCount = 0; moveInfo.CanWhileCount = 0;
// 需要增加定时器,获取验证信号并停止伺服 // 需要增加定时器,获取验证信号并停止伺服
...@@ -509,11 +517,14 @@ namespace DeviceLibrary ...@@ -509,11 +517,14 @@ namespace DeviceLibrary
//开始检测信号 //开始检测信号
Batch_Axis.BatchAxisStartCheck(IO_Type.TrayCheck, IO_VALUE.HIGH); Batch_Axis.BatchAxisStartCheck(IO_Type.TrayCheck, IO_VALUE.HIGH);
} }
Task TestReelHeight() { Task TestReelHeight()
return Task.Run(()=> { {
return Task.Run(() =>
{
int upmm = 0; int upmm = 0;
for (int i = 0; i < 56 / 2; i++) { for (int i = 0; i < 56 / 2; i++)
{
upmm += 2; upmm += 2;
LogUtil.info($"上升:{2}mm,累计:{upmm}mm"); LogUtil.info($"上升:{2}mm,累计:{upmm}mm");
var r = TestUp(2); var r = TestUp(2);
...@@ -531,7 +542,8 @@ namespace DeviceLibrary ...@@ -531,7 +542,8 @@ namespace DeviceLibrary
} }
}); });
} }
int TestUp(int mm) { int TestUp(int mm)
{
int currPosition = Batch_Axis.GetAclPosition(); int currPosition = Batch_Axis.GetAclPosition();
if (currPosition + Config.Batch_PoToMM * mm >= Config.Batch_P2) if (currPosition + Config.Batch_PoToMM * mm >= Config.Batch_P2)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!