Commit aa4ad179 刘韬

1

1 个父辈 d14bfd22
......@@ -61,6 +61,10 @@
<Reference Include="AccImageBox">
<HintPath>..\..\dll\AccImageBox.dll</HintPath>
</Reference>
<Reference Include="Asa.CarerayImage, Version=1.1.2.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\CarerayImage\CarerayImage\bin\Debug\Asa.CarerayImage.dll</HintPath>
</Reference>
<Reference Include="Asa.PrintLabel">
<HintPath>..\..\dll\label\Asa.PrintLabel.dll</HintPath>
</Reference>
......
......@@ -11,7 +11,7 @@ using System.Windows.Forms;
namespace OnlineStore.AutoCountClient
{
internal partial class FrmBase : Form
public partial class FrmBase : Form
{
internal static string GetVersion(bool IsShow=false)
{
......@@ -51,7 +51,7 @@ namespace OnlineStore.AutoCountClient
result = AcSerialBean.ByteToString(byteArray);
return result;
}
internal FrmBase()
public FrmBase()
{
InitializeComponent();
}
......
......@@ -133,6 +133,7 @@
this.txtUP2_L = new System.Windows.Forms.TextBox();
this.btnLBSave = new System.Windows.Forms.Button();
this.axisMoveControl1 = new OnlineStore.AutoCountClient.AxisMoveControl();
this.checkBox_t15 = new System.Windows.Forms.CheckBox();
this.panel1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage3.SuspendLayout();
......@@ -289,6 +290,7 @@
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox6.Controls.Add(this.checkBox_t15);
this.groupBox6.Controls.Add(this.btnReturn);
this.groupBox6.Controls.Add(this.label2);
this.groupBox6.Controls.Add(this.txtPN);
......@@ -1797,6 +1799,17 @@
this.axisMoveControl1.TabIndex = 219;
this.axisMoveControl1.Load += new System.EventHandler(this.axisMoveControl1_Load);
//
// checkBox_t15
//
this.checkBox_t15.AutoSize = true;
this.checkBox_t15.Location = new System.Drawing.Point(790, 25);
this.checkBox_t15.Name = "checkBox_t15";
this.checkBox_t15.Size = new System.Drawing.Size(77, 21);
this.checkBox_t15.TabIndex = 307;
this.checkBox_t15.Text = "15寸点料";
this.checkBox_t15.UseVisualStyleBackColor = true;
this.checkBox_t15.CheckedChanged += new System.EventHandler(this.checkBox_t15_CheckedChanged);
//
// FrmInputEquip
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -1956,6 +1969,7 @@
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtReelId;
private System.Windows.Forms.Button btnReturn;
private System.Windows.Forms.CheckBox checkBox_t15;
}
}
......@@ -766,6 +766,15 @@ namespace OnlineStore.AutoCountClient
string msg = SServerManager.Return_Material("测试按钮", pn + ";" + reelId, qty,out _);
}
private void checkBox_t15_CheckedChanged(object sender, EventArgs e)
{
if (checkBox_t15.Checked) {
RobotManager.robot.inputEquip.Config.UpdownAxis_P1 = 120000;
} else {
RobotManager.robot.inputEquip.Config.UpdownAxis_P1 = 80000;
}
}
}
}
......
......@@ -55,6 +55,7 @@
this.lblFeng = new System.Windows.Forms.Label();
this.lblDes = new System.Windows.Forms.Label();
this.lblProName = new System.Windows.Forms.Label();
this.buttonT = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numWSize)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numTh)).BeginInit();
......@@ -227,6 +228,7 @@
//
this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox4.Controls.Add(this.label_coutresult);
this.groupBox4.Controls.Add(this.buttonT);
this.groupBox4.Controls.Add(this.buttonE);
this.groupBox4.Controls.Add(this.buttonD);
this.groupBox4.Controls.Add(this.buttonC);
......@@ -258,9 +260,9 @@
this.buttonE.BackColor = System.Drawing.Color.White;
this.buttonE.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonE.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonE.Location = new System.Drawing.Point(80, 310);
this.buttonE.Location = new System.Drawing.Point(80, 251);
this.buttonE.Name = "buttonE";
this.buttonE.Size = new System.Drawing.Size(133, 50);
this.buttonE.Size = new System.Drawing.Size(133, 39);
this.buttonE.TabIndex = 303;
this.buttonE.Text = "算法E";
this.buttonE.UseVisualStyleBackColor = false;
......@@ -272,9 +274,9 @@
this.buttonD.BackColor = System.Drawing.Color.White;
this.buttonD.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonD.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonD.Location = new System.Drawing.Point(80, 253);
this.buttonD.Location = new System.Drawing.Point(80, 206);
this.buttonD.Name = "buttonD";
this.buttonD.Size = new System.Drawing.Size(133, 50);
this.buttonD.Size = new System.Drawing.Size(133, 39);
this.buttonD.TabIndex = 302;
this.buttonD.Text = "算法D";
this.buttonD.UseVisualStyleBackColor = false;
......@@ -286,9 +288,9 @@
this.buttonC.BackColor = System.Drawing.Color.White;
this.buttonC.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonC.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonC.Location = new System.Drawing.Point(80, 196);
this.buttonC.Location = new System.Drawing.Point(80, 161);
this.buttonC.Name = "buttonC";
this.buttonC.Size = new System.Drawing.Size(133, 50);
this.buttonC.Size = new System.Drawing.Size(133, 39);
this.buttonC.TabIndex = 301;
this.buttonC.Text = "算法C";
this.buttonC.UseVisualStyleBackColor = false;
......@@ -299,9 +301,9 @@
this.buttonB.BackColor = System.Drawing.Color.White;
this.buttonB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonB.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonB.Location = new System.Drawing.Point(80, 139);
this.buttonB.Location = new System.Drawing.Point(80, 116);
this.buttonB.Name = "buttonB";
this.buttonB.Size = new System.Drawing.Size(133, 50);
this.buttonB.Size = new System.Drawing.Size(133, 39);
this.buttonB.TabIndex = 300;
this.buttonB.Text = "算法B";
this.buttonB.UseVisualStyleBackColor = false;
......@@ -314,7 +316,7 @@
this.buttonAuto.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonAuto.Location = new System.Drawing.Point(80, 26);
this.buttonAuto.Name = "buttonAuto";
this.buttonAuto.Size = new System.Drawing.Size(133, 50);
this.buttonAuto.Size = new System.Drawing.Size(133, 39);
this.buttonAuto.TabIndex = 299;
this.buttonAuto.Text = "默认算法";
this.buttonAuto.UseVisualStyleBackColor = false;
......@@ -325,9 +327,9 @@
this.buttonA.BackColor = System.Drawing.Color.White;
this.buttonA.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonA.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonA.Location = new System.Drawing.Point(80, 82);
this.buttonA.Location = new System.Drawing.Point(80, 71);
this.buttonA.Name = "buttonA";
this.buttonA.Size = new System.Drawing.Size(133, 50);
this.buttonA.Size = new System.Drawing.Size(133, 39);
this.buttonA.TabIndex = 299;
this.buttonA.Text = "算法A";
this.buttonA.UseVisualStyleBackColor = false;
......@@ -386,6 +388,19 @@
this.lblProName.Text = "产品:";
this.lblProName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// buttonT
//
this.buttonT.BackColor = System.Drawing.Color.White;
this.buttonT.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonT.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonT.Location = new System.Drawing.Point(80, 315);
this.buttonT.Name = "buttonT";
this.buttonT.Size = new System.Drawing.Size(133, 39);
this.buttonT.TabIndex = 303;
this.buttonT.Text = "模版";
this.buttonT.UseVisualStyleBackColor = false;
this.buttonT.Click += new System.EventHandler(this.buttonT_Click);
//
// FrmLearning
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
......@@ -444,5 +459,6 @@
private System.Windows.Forms.Label lblProName;
private System.Windows.Forms.Button buttonAuto;
private System.Windows.Forms.Label label_coutresult;
private System.Windows.Forms.Button buttonT;
}
}
\ No newline at end of file
using Acc.ImageBox;
using Asa;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
......@@ -6,6 +7,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
......@@ -41,12 +43,14 @@ namespace OnlineStore.AutoCountClient
SelBtnList.Add(buttonC);
SelBtnList.Add(buttonD);
SelBtnList.Add(buttonE);
SelBtnList.Add(buttonT);
buttonAuto.Tag = 99;
buttonA.Tag = 0;
buttonB.Tag = 1;
buttonC.Tag = 2;
buttonD.Tag = 3;
buttonE.Tag = 4;
buttonT.Tag = 50;
LoadImgList();
}
......@@ -92,14 +96,14 @@ namespace OnlineStore.AutoCountClient
ShowNextImg();
timer1_Tick(null, null);
}
public void ShowNextImg()
{
currIndex++;
if (currIndex >= ImageList.Count)
{
btnNext.Enabled = false;
MessageBox.Show("已经是最后一张图片");
MessageBox.Show("已经是最后一张图片");
return;
}
string fullFName = ImageList[currIndex];
......@@ -138,8 +142,32 @@ namespace OnlineStore.AutoCountClient
{
btnNext.Enabled = false;
}
CurrType = (SignType.AUTO);
btnTest_Click(buttonAuto);
//CurrType = (SignType.AUTO);
Button button;
switch (CurrType) {
case SignType.IP_SMALL_PARTS:
button = buttonA;
break;
case SignType.IP_LARGE_PARTS:
button = buttonB;
break;
case SignType.IP_LONG_PARTS:
button = buttonC;
break;
case SignType.IP_SQUARE_PARTS:
button = buttonD;
break;
case SignType.IP_GEN_PARTS:
button = buttonE;
break;
case SignType.IP_Template_PARTS:
button = buttonT;
break;
default:
button = buttonAuto;
break;
}
btnTest_Click(button);
if (LoadCSVLibrary.CSVBomManager.allComMap.ContainsKey(CurrPN))
{
......@@ -189,7 +217,7 @@ namespace OnlineStore.AutoCountClient
int wsize = (int)numWSize.Value;
//Asa.API.EyemImage tpDstImg;
string resfile;
CountParam param = new CountParam("", th, wsize, CurrType);
CountParam param = new CountParam(CurrPN, th, wsize, CurrType);
int outCount = RobotManager.robot.XrayBean.GetCountResult(CurrFullFileName, param, out resfile);
if (System.IO.File.Exists(resfile))
......@@ -451,5 +479,21 @@ namespace OnlineStore.AutoCountClient
stream.Close();
}
}
private void buttonT_Click(object sender, EventArgs e)
{
CurrType = (SignType.IP_Template_PARTS);
Process p = new Process();
p.StartInfo = new ProcessStartInfo("AlgoMatch\\AlgoMatch.exe");
p.StartInfo.Arguments = "IP_Template_PARTS," + CurrPN + " " + CurrFullFileName;
p.StartInfo.WorkingDirectory = Application.StartupPath;
p.Start();
p.WaitForExit();
var tpl = Path.Combine("CountTemplate", CurrPN+".tpl");
var flag = XrayImage.ReloadTpl();
LogUtil.info( "ReloadTpl:" + flag);
if (File.Exists(tpl))
btnTest_Click(sender);
}
}
}
......@@ -453,6 +453,7 @@ namespace OnlineStore.AutoCountClient
txtResult.Text = "点料中...";
int th = (int)numTh.Value;
int wsize = (int)numWSize.Value;
CountParam param = new CountParam("", th, wsize, DeviceType);
int outCount = equipBean.GetCountResult(filePath, param, out _);
txtResult.Text = outCount.ToString();
......
......@@ -190,14 +190,7 @@ namespace OnlineStore.DeviceLibrary
NeedAlarm = false;
getretry = 0;
MoveInfo.NextMoveStep(StepEnum.IW11_GetTargetPosition);
if (MoveInfo.MoveParam.InPosType.Equals(1))
{
MoveInfo.MoveParam.PlateH=LeftBatchMove.GetTrayOK();
}
else
{
MoveInfo.MoveParam.PlateH=RightBatchMove.GetTrayOK();
}
}
else if (MoveInfo.IsStep(StepEnum.IW09_InoutToP1))
......@@ -266,9 +259,25 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.IW21_MiddleToP3);
WorkLog(" 开始放料到XRay入口,旋转轴到P3", 1);
MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P3, Config.MiddleAxis_P3Speed);
if (MoveInfo.MoveParam.InPosType.Equals(1))
{
MoveInfo.MoveParam.PlateH = LeftBatchMove.GetTrayOK();
}
else
{
MoveInfo.MoveParam.PlateH = RightBatchMove.GetTrayOK();
}
}
else
{
if (MoveInfo.MoveParam.InPosType.Equals(1))
{
MoveInfo.MoveParam.PlateH = LeftBatchMove.GetTrayOK();
}
else
{
MoveInfo.MoveParam.PlateH = RightBatchMove.GetTrayOK();
}
//ClearTimeoutAlarm("验证是否测值");
MoveInfo.NextMoveStep(StepEnum.IW31_MIddleToP4);
WorkLog(" 开始放料到测值工位,旋转轴到P4", 1);
......
......@@ -134,15 +134,16 @@ namespace OnlineStore.DeviceLibrary
return true;
}
if (!RobotManager.UseLabel)
if (!RobotManager.UseLabel || MoveInfo.MoveParam.PlateW >= 13)
{
WorkLog("取料: 贴标功能未启用,不需要启动贴标,设置IsStartLabel=true");
IsStartLabel = true;
return true;
}
bool NoPaper = IOValue(IO_Type.PasteCode_OK).Equals(IO_VALUE.HIGH);
//TODO 记录信息,判断贴标模块当前空闲,此时可以打印标签(取码气缸前进,打印标签,取码气缸后退)
if (SecMoveInfo.MoveType.Equals(RobotMoveType.None))
if (SecMoveInfo.MoveType.Equals(RobotMoveType.None) && !NoPaper)
{
ClearTimeoutAlarm("等待贴标模块空闲");
WorkLog("取料: 贴标模块开始打印标签");
......@@ -153,6 +154,12 @@ namespace OnlineStore.DeviceLibrary
IsStartLabel = true;
return true;
}
}else if (NoPaper)
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "][" + SecMoveInfo.MoveType.ToString() + "]打印机缺纸,请处理 超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, MoveInfo.ErrorLogType, MoveInfo.logSeconds());
Alarm(AlarmType.IoSingleTimeOut);
}
else if (needAlarm && MoveInfo.IsTimeOut(120))
{
......@@ -425,7 +432,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(StepEnum.OT11_WaitShelfOk))
{
bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_20_ShelfReady);
bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && (ShelfMoveInfo.IsStep(StepEnum.OS_20_ShelfReady) || ShelfMoveInfo.IsStep(StepEnum.OS_22_WaitTray));
bool debugOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveParam.IsTest;
......@@ -445,10 +452,10 @@ namespace OnlineStore.DeviceLibrary
MoveXAxis.AbsMove(MoveInfo, Config.MoveX_P3, Config.MoveX_P3Speed);
ClearTimeoutAlarm("等待出料料串准备完成");
if (shelfOk)
ShelfMoveInfo.NextMoveStep(StepEnum.OS_21_BatchDownH);
if (!BatchPreDown)
{
int trayHeight = MoveInfo.MoveParam.PlateH;
ShelfMoveInfo.NextMoveStep(StepEnum.OS_21_BatchDownH);
int trayHeight = MoveInfo.MoveParam.PlateH;
int currP = BatchAxis.GetAclPosition();
int targetP = currP - (trayHeight + 20) * Config.Height_ChangeValue;
......@@ -461,6 +468,7 @@ namespace OnlineStore.DeviceLibrary
BatchAxis.SuddenStop();
BatchAxis.AbsMove(ShelfMoveInfo, targetP, Config.BatchAxis_P2Speed);
}
BatchPreDown = false;
}
else if (MoveInfo.IsTimeOut(120))
{
......@@ -478,6 +486,7 @@ namespace OnlineStore.DeviceLibrary
{
ShelfMoveInfo.NextMoveStep(StepEnum.OS_20_ShelfReady);
MoveInfo.NextMoveStep(StepEnum.OT11_WaitShelfOk);
BatchPreDown = false;
WorkLog("放料:料串下降不到位,重新下降 ", 1);
}
else
......@@ -492,6 +501,11 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(StepEnum.OT13_MoveZToP3))
{
if (ShelfMoveInfo.IsStep(StepEnum.OS_20_ShelfReady)) {
MoveInfo.NextMoveStep(StepEnum.OT11_WaitShelfOk);
BatchPreDown = false;
return;
}
bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_22_WaitTray);
bool debugOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveParam.IsTest;
if (shelfOk || debugOk)
......@@ -632,6 +646,7 @@ namespace OnlineStore.DeviceLibrary
return true;
}
bool BatchPreDown = false;
private Task printTask = null;
private bool NeedPrint = ConfigAppSettings.GetIntValue(Setting_Init.NeedPrintLabel).Equals(1);
private bool StickingPosJudgment = ConfigAppSettings.GetIntValue(Setting_Init.StickingPosJudgment).Equals(1);
......@@ -685,7 +700,7 @@ namespace OnlineStore.DeviceLibrary
bool isTimeOut = SecMoveInfo.IsTimeOut(40);
if (printTask == null || printTask.IsCompleted)
{
if ((isPrintOk || isTimeOut || (!NeedPrint))&& printerr<=5)
if ((isPrintOk || isTimeOut || (!NeedPrint)) && printerr <= 5)
{
if (isTimeOut)
printerr++;
......@@ -712,13 +727,15 @@ namespace OnlineStore.DeviceLibrary
{
// WarnMsg = SecMoveInfo.Name + "[" + SecMoveInfo.MoveStep + "]" + "等待 打印标签状态完成(OL03_PrintLabel) 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
WarnMsg = SecMoveInfo.Name + $"打印标签状态错误:{printerr}次,可能需要更换标签 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
//WarnMsg = SecMoveInfo.Name + $"打印标签状态错误:{printerr}次,可能需要更换标签 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
WarnMsg = SecMoveInfo.Name + $"可能需要更换标签 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType, SecMoveInfo.logSeconds());
//Alarm(AlarmType.IoSingleTimeOut);
//NeedAlarm = true;
}
else {
else
{
WarnMsg = SecMoveInfo.Name + "[" + SecMoveInfo.MoveStep + "]" + "等待 打印标签状态完成(OL03_PrintLabel) 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType, SecMoveInfo.logSeconds());
}
......@@ -743,7 +760,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecMoveInfo.IsStep(StepEnum.OL06_ZToP2))
{
SecMoveInfo.NextMoveStep(StepEnum.OL07_Nozzle_Work);
SecWorkLog("贴标: 标签吸盘取码,等待吸盘信号到位 1.5s");
......@@ -832,7 +849,7 @@ namespace OnlineStore.DeviceLibrary
{
LabelYAxis.AbsMove(SecMoveInfo, Config.LabelY_P3, Config.LabelY_P3Speed);
}
SecWorkLog("贴标: R轴到P3点 X;" + SecMoveInfo.MoveParam.codePointer.X.ToString() + ",Y:" + SecMoveInfo.MoveParam.codePointer.Y.ToString() + ",leftpos:" + posL.ToString() + ",PlateW:" + SecMoveInfo.MoveParam.PlateW.ToString()+ ",OutReelCenter7:" + OutReelCenter7+ ",OutReelCenter13:" + OutReelCenter13+ ",OutReelCenter15:" + OutReelCenter15, 1);
SecWorkLog("贴标: R轴到P3点 X;" + SecMoveInfo.MoveParam.codePointer.X.ToString() + ",Y:" + SecMoveInfo.MoveParam.codePointer.Y.ToString() + ",leftpos:" + posL.ToString() + ",PlateW:" + SecMoveInfo.MoveParam.PlateW.ToString() + ",OutReelCenter7:" + OutReelCenter7 + ",OutReelCenter13:" + OutReelCenter13 + ",OutReelCenter15:" + OutReelCenter15, 1);
}
else
{
......@@ -915,14 +932,32 @@ namespace OnlineStore.DeviceLibrary
{
SecMoveInfo.NextMoveStep(StepEnum.OL18_LableBack);
SecWorkLog("贴标: 贴标气缸后退,X轴R轴返回待机点P2,Y轴返回待机点P1, ");
LabelZAxis.AbsMove(SecMoveInfo, Config.LabelZ_P1, Config.LabelZ_P1Speed);
if (!SecMoveInfo.MoveParam.PlateW.Equals(7))
if (!SecMoveInfo.MoveParam.PlateW.Equals(7))
CylinderMove(SecMoveInfo, IO_Type.LablePaste_Forward, IO_Type.PasteCode_Back);
LabelXAxis.AbsMove(SecMoveInfo, Config.LabelX_P2, Config.LabelX_P2Speed);
LabelYAxis.AbsMove(SecMoveInfo, Config.LabelY_P1, Config.LabelY_P1Speed);
LabelRAxis.AbsMove(SecMoveInfo, Config.LabelR_P2, Config.LabelR_P2Speed);
BatchPreDown = true;
int trayHeight = MoveInfo.MoveParam.PlateH;
//ShelfMoveInfo.NextMoveStep(StepEnum.OS_21_BatchDownH);
int currP = BatchAxis.GetAclPosition();
int targetP = currP - (trayHeight + 20) * Config.Height_ChangeValue;
if (targetP < Config.BatchAxisP2)
{
targetP = Config.BatchAxisP2;
}
ShelfWorkLog("贴标后预下降料串: 提升轴下降指定高度 :" + MoveInfo.MoveParam.WareCode + " 盘高【" + trayHeight + "】实时位置【" + currP + "】目标位置【" + targetP + "】");
//ShelfMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
BatchAxis.SuddenStop();
BatchAxis.AbsMove(ShelfMoveInfo, targetP, Config.BatchAxis_P2Speed);
}
else if (SecMoveInfo.IsStep(StepEnum.OL18_LableBack))
{
......
......@@ -230,6 +230,8 @@ namespace OnlineStore.DeviceLibrary
}
ShelfMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
ShelfWorkLog("料串准备完成");
BatchPreDown = false;
CheckNeedSendShelf();
}
else if (ShelfMoveInfo.IsStep(StepEnum.OS_20_ShelfReady))
{
......@@ -242,7 +244,9 @@ namespace OnlineStore.DeviceLibrary
}
else
{
ShelfMoveInfo.NextMoveStep(StepEnum.OS_20_ShelfReady);
ShelfMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
}
......@@ -257,6 +261,14 @@ namespace OnlineStore.DeviceLibrary
{
ShelfMoveInfo.NextMoveStep(StepEnum.OS_22_WaitTray);
ShelfWorkLog("等待料盘放入料串,O_WLine_TrayCheck=" + IOValue(IO_Type.O_WLine_TrayCheck).ToString());
if (IOValue(IO_Type.O_WLine_TrayCheck).Equals(IO_VALUE.HIGH)) {
if (BatchAxis.GetAclPosition() <= Config.BatchAxisP2)
{
ShelfMoveInfo.NextMoveStep(StepEnum.OS_31_ShendShelfOut);
ShelfWorkLog("放料时料串已满,开始送出料串");
}
}
}
else if (ShelfMoveInfo.IsStep(StepEnum.OS_23_TrayOK))
{
......@@ -289,7 +301,7 @@ namespace OnlineStore.DeviceLibrary
ShelfWorkLog("批量提升运动过度");
return;
}
if (RobotManager.UseLabel)
if (RobotManager.UseLabel && MoveInfo.MoveParam.PlateW < 13)
{
ShelfMoveInfo.NextMoveStep(StepEnum.OS_25_WaitLabel);
ShelfMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
......
......@@ -56,7 +56,7 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer.Elapsed += IoCheckTimerProcess;
MoveInfo = new RobotMoveInfo(Name);
SecMoveInfo = new RobotMoveInfo(Name.Trim() + "-SMove");
XrayImage.setProcessLevel(2);
XrayImage.setProcessLevel(4);
Task.Factory.StartNew(delegate
{
XRayLoad();
......
......@@ -145,7 +145,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.XW07_InLineStop);
WorkLog("料盘处理:停止入口皮带线,中间皮带线");
IOMove(IO_Type.X_InLine_Run, IO_VALUE.LOW);
IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH, 550);//皮带延时,控制料盘位置
IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH, 650);//皮带延时,控制料盘位置
}
else if (MoveInfo.IsTimeOut(20))
{
......@@ -829,13 +829,24 @@ namespace OnlineStore.DeviceLibrary
int result = 0;
CountParam.SignType type = param.Sign;
int threshold = param.Threshold;
int windowsize = param.WindowSize; ;
int windowsize = param.WindowSize;
XrayImage.setProcessLevel(4);
if (param.Sign == CountParam.SignType.AUTO)
{
LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + 100 + "】");
result = XrayImage.GetLocalCount(fileP, 100, out countStr, out dst);
LogUtil.info("GetCountResult " + type + " 调用 GetLocalCount 【" + fileP + "】【" + 100 + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】");
}
else if (param.Sign == CountParam.SignType.IP_Template_PARTS)
{
XrayImage.setProcessLevel(2);
XrayImage.ReloadTpl();
var tpl = Path.Combine("CountTemplate", param.PN + ".tpl");
LogUtil.info("GetLocalCountTemplate " + tpl + " 【" + fileP + "】【" + 100 + "】"+File.Exists(tpl));
result = XrayImage.GetLocalCountTemplate(fileP, 100, tpl, out countStr, out dst);
LogUtil.info("GetLocalCountTemplate " + tpl + " 【" + fileP + "】【" + 100 + "】,返回【" + result + "】,结果【" + string.Join(",", countStr) + "】");
}
else {
LogUtil.info("GetLocalCountIrregular " + type + " 【" + fileP + "】【" + 100 + "】");
result = XrayImage.GetLocalCountIrregular(fileP, 100, type.ToString(), out countStr, out dst);
......
......@@ -320,6 +320,7 @@ namespace OnlineStore.DeviceLibrary
IP_LONG_PARTS = 2,
IP_SQUARE_PARTS = 3,
IP_GEN_PARTS = 4,
IP_Template_PARTS=50,
AUTO = 99,
}
internal static string GetCSVTitle()
......
......@@ -219,7 +219,7 @@ namespace OnlineStore.DeviceLibrary
{
mainTimer = new System.Timers.Timer();
mainTimer.Enabled = false;
mainTimer.Interval = 300;
mainTimer.Interval = 200;
mainTimer.Elapsed += mainTimer_Elapsed;
mainTimer.AutoReset = true;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!