Commit d9775306 LN

点料修改:根据大小料调用不同的方法

1 个父辈 eaf73262
......@@ -761,11 +761,13 @@ namespace OnlineStore.AutoCountClient
{
return;
}
if (!chbPrint.Checked.Equals(equipBean.AutoSendShelfOut))
bool isCheck = chbPrint.Checked;
string v = (isCheck ? 1 : 0).ToString();
if (ConfigAppSettings.GetValue(Setting_Init.NeedPrintLabel).Equals(v).Equals(false))
{
bool isCheck = chbPrint.Checked;
ConfigAppSettings.SaveValue(Setting_Init.NeedPrintLabel,( isCheck ? 1 : 0));
LogUtil.info(equipBean.Name + "用户切换 启用标签打印 =" + isCheck);
ConfigAppSettings.SaveValue(Setting_Init.NeedPrintLabel, v);
LogUtil.info(equipBean.Name + "用户切换 启用标签打印 =" + v);
}
}
......
......@@ -55,6 +55,8 @@
this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.btnSelImage = new System.Windows.Forms.Button();
this.txtImage = new System.Windows.Forms.TextBox();
this.numWSize = new System.Windows.Forms.NumericUpDown();
......@@ -81,8 +83,6 @@
this.lblThisSta = new System.Windows.Forms.Label();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.fileSystemWatcher1 = new System.IO.FileSystemWatcher();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.panel1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -606,6 +606,28 @@
this.groupBox8.TabStop = false;
this.groupBox8.Text = "点料测试";
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(108, 134);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(50, 21);
this.radioButton2.TabIndex = 298;
this.radioButton2.Text = "大料";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(26, 134);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(50, 21);
this.radioButton1.TabIndex = 297;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "小料";
this.radioButton1.UseVisualStyleBackColor = true;
//
// btnSelImage
//
this.btnSelImage.BackColor = System.Drawing.Color.White;
......@@ -898,27 +920,6 @@
this.fileSystemWatcher1.EnableRaisingEvents = true;
this.fileSystemWatcher1.SynchronizingObject = this;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(26, 134);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(62, 21);
this.radioButton1.TabIndex = 297;
this.radioButton1.Text = "小料盘";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(108, 134);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(62, 21);
this.radioButton2.TabIndex = 298;
this.radioButton2.Text = "大料盘";
this.radioButton2.UseVisualStyleBackColor = true;
//
// FrmXRay
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......
......@@ -15,11 +15,11 @@ namespace StoreServer
public ProjectInstaller()
{
InitializeComponent();
string cid = ConfigAppSettings.GetValue(Setting_Init.Line_CID);
if (!cid.Equals(""))
{
this.AutoCountClientSystem.Description = "流水线系统[" +cid +"]";
}
//string cid = ConfigAppSettings.GetValue(Setting_Init.Line_CID);
//if (!cid.Equals(""))
//{
// this.AutoCountClientSystem.Description = "流水线系统[" +cid +"]";
//}
}
}
}
类型,阈值,窗口大小
6D5S1,2,3
6C1D1,2,5
6D551,2,7
7H5S1,2,3
type,sign,value,threshold,windowSize
6H10B,1,5,0,0
7H5S1,0,0,0,0
6H106,1,0,0,0
6H10W,1,0,0,0
6H20J,1,0,0,0
6H100,1,0,0,0
6H105,1,0,0,0
6C1D1,0,0,0,0
6C1H1,0,0,0,0
6CEH1,0,0,0,0
6C1D1,0,0,0,0
6D551,0,0,0,0
7H1F1,0,0,0,0
7H2F1,0,0,0,0
7H5B1,0,0,0,0
7H5F1,0,0,0,0
6H0R2,0,0,0,0
6H10C,1,0,0,0
6H20N,0,0,0,0
6H103,1,0,0,0
7H2S1,0,0,0,0
7H5C1,0,0,0,0
8CA3F,2,0,0,0
8CA8H,0,0,0,0
8CF3F,0,0,0,0
8CG3F,0,0,0,0
8CH8F,0,0,0,0
6J091,0,0,0,0
6J121,0,0,0,0
6J161,0,0,0,0
6J181,0,0,0,0
......@@ -407,36 +407,40 @@ namespace OnlineStore.DeviceLibrary
}
public class CountParam
{
public CountParam(string pn, int th, string area)
{
this.PN = pn;
this.Threshold = th;
this.AreaValue = area;
}
public CountParam(string pn, int th, int size)
{
public CountParam(string pn="", int th=0, int size=0,int sign=0,int value=0)
{
this.PN = pn;
this.Threshold = th;
this.WindowSize = size;
this.Sign = sign;
this.Value = value;
}
public string PN = "";
public int Threshold = 0;
public int WindowSize = 0;
public string AreaValue = "";
public int Sign = 0;
public int Value = 0;
public string ToStr()
{
return "【PN=" + PN + ",sign=" + Sign + ",value=" + Value + ",th=" + Threshold + ",wsize=" + WindowSize+"】";
}
internal static CountParam NewParam(string line)
{
try
{
string[] array = line.Split(',');
if (array.Length >= 3)
if (array.Length >= 5)
{
string pn = array[0].Trim();
int th = Convert.ToInt32(array[1].Trim());
int size = Convert.ToInt32(array[2].Trim());
return new CountParam(pn, th, size);
int sign = Convert.ToInt32(array[1].Trim());
int value = Convert.ToInt32(array[2].Trim());
int th = Convert.ToInt32(array[3].Trim());
int size = Convert.ToInt32(array[4].Trim());
return new CountParam(pn, th, size,sign,value);
}
}
catch (Exception ex)
......
......@@ -18,9 +18,9 @@ namespace OnlineStore.DeviceLibrary
partial class X_RAY_Equip
{
public delegate void GetImage(Bitmap bitmap);
public delegate void GetImage(Bitmap bitmap);
public event GetImage GetImageEvent;
#region Label
public override bool StartLabelling(WorkParam param)
{
......@@ -42,7 +42,7 @@ namespace OnlineStore.DeviceLibrary
{
if (!MoveInfo.MoveType.Equals(RobotMoveType.None))
{
return false ;
return false;
}
//出口有料
if (IOValue(IO_Type.X_ReelCheck).Equals(IO_VALUE.HIGH))
......@@ -54,26 +54,27 @@ namespace OnlineStore.DeviceLibrary
if (Work_ReelInfo.WareCount <= 0)
{
MoveInfo.NextMoveStep(StepEnum.XW06_WaitTime);
WorkLog("扫描区有料["+Work_ReelInfo.ToStr()+"],还未进行点料,开始处理");
WorkLog("扫描区有料[" + Work_ReelInfo.ToStr() + "],还未进行点料,开始处理");
//IOMove(IO_Type.X_InLine_Run, IO_VALUE.HIGH);
IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_ReelCheck, IO_VALUE.HIGH));
}
else
{
{
MoveInfo.NextMoveStep(StepEnum.XW21_WaitOutNoReel);
WorkLog("扫描区有料[" + Work_ReelInfo.ToStr() + "],点料已完成,准备放出料盘");
WorkLog("扫描区有料[" + Work_ReelInfo.ToStr() + "],点料已完成,准备放出料盘");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Out_TrayCheck, IO_VALUE.LOW));
}
}else if (IOValue(IO_Type.X_InLine_Check).Equals(IO_VALUE.HIGH))
}
else if (IOValue(IO_Type.X_InLine_Check).Equals(IO_VALUE.HIGH))
{
runStatus = RobotRunStatus.Busy;
MoveInfo.NewMove(RobotMoveType.Working);
MoveInfo.MoveParam.SetReelInfo(In_ReelInfo);
MoveInfo.NextMoveStep(StepEnum.XW01_WaitInReel);
WorkLog("入口皮带线有料[" + In_ReelInfo.ToStr() + "],开始处理");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_InLine_Check,IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_InLine_Check, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_ReelCheck, IO_VALUE.LOW));
}
......@@ -294,8 +295,8 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.EndMove();
runStatus = RobotRunStatus.Runing;
}
}
}
private void XW12_XRayStart()
......@@ -325,8 +326,9 @@ namespace OnlineStore.DeviceLibrary
#region 点料处理
private string lastFileName = "";
private int lastTh = 0;
private int lastWSize = 0;
//private int lastTh = 0;
//private int lastWSize = 0;
private CountParam lastParam = new CountParam();
private void XW15_GetResult()
{
if (IOValue(IO_Type.X_Lock_On).Equals(IO_VALUE.LOW))
......@@ -347,18 +349,18 @@ namespace OnlineStore.DeviceLibrary
string fileP = path1_tif + @"\" + lastFileName;
int n = 0;
if (Work_ReelInfo.PlateW.Equals(7))
if (lastParam.Sign.Equals(0))
{
WorkLog("点料:开始调用 carerayImage.GetLocalCount ");
n = carerayImage.GetLocalCount(fileP, lastTh, lastWSize, out count, out Asa.API.EyemImage tpDstImg);
n = carerayImage.GetLocalCount(fileP, lastParam.Threshold, lastParam.WindowSize, out count, out Asa.API.EyemImage tpDstImg);
}
else
{
WorkLog("点料:开始调用 carerayImage.GetLocalCountHuge ");
n = carerayImage.GetLocalCountHuge(fileP, lastTh, lastWSize, out count, out Asa.API.EyemImage tpDstImg);
n = carerayImage.GetLocalCountHuge(fileP, lastParam.Threshold, lastParam.WindowSize, out count, out Asa.API.EyemImage tpDstImg);
}
WorkLog("点料:获取点料结果 【" + count + "】【" + lastTh + "】【" + lastWSize + "】,n =" + n + ",保存并上传结果");
WorkLog("点料:获取点料结果 【" + count + "】 " + lastParam.ToStr() + ",n =" + n + ",保存并上传结果");
if (Work_ReelInfo.WareCount <= 0)
{
......@@ -485,8 +487,9 @@ namespace OnlineStore.DeviceLibrary
private void UpdateArea(string codeStr)
{
lastTh = ThresholdValue;
lastWSize = 3;
lastParam = new CountParam("", ThresholdValue, 3);
//lastTh = ThresholdValue;
//lastWSize = 3;
string[] codeArray = codeStr.Split(';');
string fileValue = "";
string area = "";
......@@ -499,14 +502,17 @@ namespace OnlineStore.DeviceLibrary
{
area = countParamMap[pn].AreaValue;
fileValue = lastFileName + " " + area;
lastTh = countParamMap[pn].Threshold;
}else if (countParamMap.ContainsKey(type))
// lastTh = countParamMap[pn].Threshold;
lastParam = countParamMap[pn];
}
else if (countParamMap.ContainsKey(type))
{
lastTh = countParamMap[type].Threshold;
lastWSize = countParamMap[type].WindowSize;
lastParam = countParamMap[type];
//lastTh = countParamMap[type].Threshold;
//lastWSize = countParamMap[type].WindowSize;
}
}
LogUtil.info("【" + codeStr + "】使用参数【" + lastTh + "】【" + lastWSize + "】 ");
LogUtil.info("【" + codeStr + "】使用参数 " + lastParam.ToStr() + " ");
//LogUtil.info("【" + codeStr + "】使用参数【" + lastTh + "】【" + area + "】,文件名【" + lastFileName + "】内容【" + fileValue + "】");
File.WriteAllText(path3_area, fileValue);
}
......@@ -536,8 +542,5 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
}
}
\ No newline at end of file
......@@ -820,7 +820,7 @@ namespace OnlineStore.DeviceLibrary
/// 出料料串:料串准备完成,
/// </summary>
OS_18_ShelfReady,
/// <summary>
/// 放料:批量轴下降指定高度,
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!