Commit bd392c11 张东亮

存储机构-料格水平检测逻辑添加,未启用。关闭到中间待机点拍照动作

1 个父辈 adbbc66c
文件属性发生变化
文件属性发生变化
文件属性发生变化
......@@ -506,6 +506,37 @@ namespace OnlineStore.DeviceLibrary
/// 存储机构自动对位:到下一个抽屉(反向)
/// </summary>
SA_10_Neg_NextDrawer,
#region 存储机构-料格水平检测
/// <summary>
/// 料格水平检测:预检查,检查是否是首尾列(目前忽略)
/// </summary>
SCH_00_PreCheck,
/// <summary>
/// 料格水平检测:回退一段距离
/// </summary>
SCH_01_BackDistance,
/// <summary>
/// 料格水平检测:取像
/// </summary>
SCH_02_AcqImage,
/// <summary>
/// 料格水平检测:检查X轴位置
/// </summary>
SCH_03_CheckXCoord,
/// <summary>
/// 料格水平检测:调整X轴位置
/// </summary>
SCH_04_AdjXPos,
/// <summary>
/// 料格水平检测:X轴到位,确认Y轴是否超过限制
/// </summary>
SCH_05_CheckYDiff,
/// <summary>
/// 料格水平检测:检查结束
/// </summary>
SCH_06_Finish,
#endregion
#endregion
#region 存储机构库位调试 500开始
......
......@@ -312,18 +312,20 @@ namespace OnlineStore.DeviceLibrary
PullAxis_UpdownToHighP3();
break;
case StepEnum.SI_16_LiftTray:
MoveInfo.NextMoveStep(StepEnum.SI_17_PushTray);
LogInfo($"入库 {MoveInfo.SLog}:推到抽屉待机点采集图片,料斗拉取进出轴到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P1();
//MoveInfo.NextMoveStep(StepEnum.SI_17_PushTray);
// LogInfo($"入库 {MoveInfo.SLog}:推到抽屉待机点采集图片,料斗拉取进出轴到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
//PullAxis_Inout_To_P1();
//MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle);
//LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
//PullAxis_Inout_To_P2_P4();
MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle);
LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P2_P4();
MiddleAxis_To_P2();
break;
case StepEnum.SI_17_PushTray:
MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle);
LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4,移栽旋转轴到水平点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P2_P4();
MiddleAxis_To_P2();
SaveSpecifiedImage();
//Bitmap bitmap = AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId));
//bool rtn = MatchAndSaveImg(bitmap, $"{DateTime.Now.ToString("HHmmss")}");
......
......@@ -108,17 +108,17 @@ namespace OnlineStore.DeviceLibrary
PullAxis_UpdownToHighP3();
break;
case StepEnum.SO_10_LiftTray:
MoveInfo.NextMoveStep(StepEnum.SO_11_PushTray);
LogInfo($"出库 {MoveInfo.SLog}:到进出轴待机点拍照,料斗拉取进出轴到料屉待机点P1,移栽旋转轴到取放料水平点P2,移栽X到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P1();
MiddleAxis_To_P2();
XAxis_To_P1();
//MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle);
//LogInfo($"出库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4,移栽旋转轴到取放料水平点P2,移栽X到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
//PullAxis_Inout_To_P2_P4();
//MoveInfo.NextMoveStep(StepEnum.SO_11_PushTray);
//LogInfo($"出库 {MoveInfo.SLog}:到进出轴待机点拍照,料斗拉取进出轴到料屉待机点P1,移栽旋转轴到取放料水平点P2,移栽X到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
//PullAxis_Inout_To_P1();
//MiddleAxis_To_P2();
//XAxis_To_P1();
MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle);
LogInfo($"出库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4,移栽旋转轴到取放料水平点P2,移栽X到P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P2_P4();
MiddleAxis_To_P2();
XAxis_To_P1();
break;
case StepEnum.SO_11_PushTray:
MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle);
......
......@@ -9,6 +9,15 @@ using System.Drawing.Imaging;
namespace eyemLib_Sharp
{
/// <summary>
/// mark点的颜色
/// </summary>
public enum SelectColor
{
Red,
Green,
Blue
}
public unsafe class EyemLibDemo
{
#region 枚举
......@@ -589,12 +598,30 @@ namespace eyemLib_Sharp
public IntPtr hType; // 码类型
public IntPtr hText; // 码内容
}
[StructLayout(LayoutKind.Sequential)]
public struct EyemHSVModel
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public double[] dpRangeL, dpRangeU; // 提取下限,提取上限[H S V]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public double[] dpRangeLExt, dpRangeUExt; // 额外提取下限,额外提取上限(针对处于跨模型颜色的补充,比如红色)[H S V]
}
#endregion
#region 项目
//圆形mark点定位
/// <summary>
/// 圆形Mark点定位
/// </summary>
/// <param name="tpImage">图像</param>
/// <param name="tpHSVModel">HSV阈值范围</param>
/// <param name="tpCircle">结果</param>
/// <param name="tpDstImg">结果图</param>
/// <param name="bHighAccuracy">是否使用高精度</param>
/// <returns>0=FUNC_OK</returns>
[DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
public static extern int eyemMarkerTracing(EyemImage tpImage, double dThreshold, ref EyemOcsFXYR tpCircle,out EyemImage tpDstImg, bool bHighAccuracy = true);
// public static extern int eyemMarkerTracing(EyemImage tpImage, double dThreshold, ref EyemOcsFXYR tpCircle,out EyemImage tpDstImg, bool bHighAccuracy = true);
public static extern int eyemMarkerTracing(EyemImage tpImage, EyemHSVModel tpHSVModel, ref EyemOcsFXYR tpCircle, out EyemImage tpDstImg, bool bHighAccuracy = true);
#endregion
#region 通用
......@@ -604,7 +631,7 @@ namespace eyemLib_Sharp
private static extern byte* memcpy(byte* dst, byte* src, int count);
//读取图像,支持彩色与多深度
[DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
private static extern int eyemImageRead(string filename, int iFalgs, out EyemImage tpImage);
public static extern int eyemImageRead(string filename, int iFalgs, out EyemImage tpImage);
//释放图像资源
[DllImport("eyemLib.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
public static extern void eyemImageFree(ref EyemImage tpImage);
......@@ -626,7 +653,11 @@ namespace eyemLib_Sharp
}
EyemOcsFXYR tpCircle = new EyemOcsFXYR();
flag = eyemMarkerTracing(image, 120, ref tpCircle, out tpDstImg);
////红色分割
EyemHSVModel tpHsvModel = new EyemHSVModel();
tpHsvModel.dpRangeL = new double[] { 0, 43, 46 }; tpHsvModel.dpRangeU = new double[] { 10, 255, 255 };
tpHsvModel.dpRangeLExt = new double[] { 156, 43, 46 }; tpHsvModel.dpRangeUExt = new double[] { 180, 255, 255 };
flag = eyemMarkerTracing(image, tpHsvModel, ref tpCircle, out tpDstImg);
//0 正常 -4未定位到
Bitmap bitmap = eyemCvtToBitmap(tpDstImg);
......
......@@ -31,7 +31,7 @@ namespace OnlineStore.XLRStore
private void btnNext_Click(object sender, EventArgs e)
{
string pwd = txtPwd.Text;
string pwd = txtPwd.Text;
string configPwd = ConfigAppSettings.GetValue(Setting_Init.Config_Pwd);
if (configPwd.Equals(""))
{
......
......@@ -369,54 +369,54 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// 启动AToolStripMenuItem
//
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
//
// 复位RToolStripMenuItem
//
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
//
// 停止TToolStripMenuItem
//
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Visible = false;
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
//
......@@ -436,36 +436,36 @@
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator6.Visible = false;
//
// 二维码学习ToolStripMenuItem
//
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
//
// 托盘初始化ToolStripMenuItem
//
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
//
// toolStripSeparator16
//
this.toolStripSeparator16.Name = "toolStripSeparator16";
this.toolStripSeparator16.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator16.Size = new System.Drawing.Size(177, 6);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(176, 26);
this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem3.Text = "脆盘料号配置";
this.toolStripMenuItem3.Click += new System.EventHandler(this.toolStripMenuItem3_Click);
//
......@@ -484,31 +484,31 @@
// 清空日志ToolStripMenuItem
//
this.清空日志ToolStripMenuItem.Name = "清空日志ToolStripMenuItem";
this.清空日志ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.清空日志ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.清空日志ToolStripMenuItem.Text = "清空日志";
this.清空日志ToolStripMenuItem.Click += new System.EventHandler(this.清空日志ToolStripMenuItem_Click);
//
// toolStripSeparator10
//
this.toolStripSeparator10.Name = "toolStripSeparator10";
this.toolStripSeparator10.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator10.Size = new System.Drawing.Size(177, 6);
//
// 复制日志ToolStripMenuItem
//
this.复制日志ToolStripMenuItem.Name = "复制日志ToolStripMenuItem";
this.复制日志ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.复制日志ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复制日志ToolStripMenuItem.Text = "复制日志";
this.复制日志ToolStripMenuItem.Click += new System.EventHandler(this.复制日志ToolStripMenuItem_Click);
//
// toolStripSeparator11
//
this.toolStripSeparator11.Name = "toolStripSeparator11";
this.toolStripSeparator11.Size = new System.Drawing.Size(141, 6);
this.toolStripSeparator11.Size = new System.Drawing.Size(177, 6);
//
// 版本号ToolStripMenuItem
//
this.版本号ToolStripMenuItem.Name = "版本号ToolStripMenuItem";
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(144, 26);
this.版本号ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.版本号ToolStripMenuItem.Text = "关于软件";
this.版本号ToolStripMenuItem.Click += new System.EventHandler(this.版本号ToolStripMenuItem_Click);
//
......
......@@ -773,5 +773,6 @@ namespace OnlineStore.XLRStore
}
LogUtil.info(Name + " 点击:" + 启用门禁ToolStripMenuItem.Text);
}
}
}
......@@ -65,6 +65,7 @@
this.txtDrawerColumns = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.cmbColor = new System.Windows.Forms.ComboBox();
this.btnPullUpdwnToPos1 = new System.Windows.Forms.Button();
this.btnMoveAxisToPos1 = new System.Windows.Forms.Button();
this.btnUndwnToPos1 = new System.Windows.Forms.Button();
......@@ -112,6 +113,7 @@
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.btnOpenImg = new System.Windows.Forms.Button();
this.tableLayoutPanel1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
......@@ -494,6 +496,8 @@
//
// groupBox6
//
this.groupBox6.Controls.Add(this.btnOpenImg);
this.groupBox6.Controls.Add(this.cmbColor);
this.groupBox6.Controls.Add(this.btnPullUpdwnToPos1);
this.groupBox6.Controls.Add(this.btnMoveAxisToPos1);
this.groupBox6.Controls.Add(this.btnUndwnToPos1);
......@@ -514,6 +518,22 @@
this.groupBox6.TabStop = false;
this.groupBox6.Text = "groupBox6";
//
// cmbColor
//
this.cmbColor.AutoCompleteCustomSource.AddRange(new string[] {
"Red",
"Blue",
"Green"});
this.cmbColor.FormattingEnabled = true;
this.cmbColor.Items.AddRange(new object[] {
"Red",
"Green",
"Blue"});
this.cmbColor.Location = new System.Drawing.Point(288, 171);
this.cmbColor.Name = "cmbColor";
this.cmbColor.Size = new System.Drawing.Size(79, 25);
this.cmbColor.TabIndex = 18;
//
// btnPullUpdwnToPos1
//
this.btnPullUpdwnToPos1.Location = new System.Drawing.Point(156, 213);
......@@ -575,7 +595,7 @@
//
this.btnAcquireImage1.Location = new System.Drawing.Point(273, 22);
this.btnAcquireImage1.Name = "btnAcquireImage1";
this.btnAcquireImage1.Size = new System.Drawing.Size(86, 123);
this.btnAcquireImage1.Size = new System.Drawing.Size(86, 57);
this.btnAcquireImage1.TabIndex = 12;
this.btnAcquireImage1.Text = "取像";
this.btnAcquireImage1.UseVisualStyleBackColor = true;
......@@ -985,6 +1005,16 @@
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// btnOpenImg
//
this.btnOpenImg.Location = new System.Drawing.Point(273, 88);
this.btnOpenImg.Name = "btnOpenImg";
this.btnOpenImg.Size = new System.Drawing.Size(86, 57);
this.btnOpenImg.TabIndex = 19;
this.btnOpenImg.Text = "打开";
this.btnOpenImg.UseVisualStyleBackColor = true;
this.btnOpenImg.Click += new System.EventHandler(this.btnOpenImg_Click);
//
// FrmAutoFindPos
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -1106,5 +1136,7 @@
private System.Windows.Forms.Label lblResult;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.CheckBox chkCloseOutStoreCheck;
private System.Windows.Forms.ComboBox cmbColor;
private System.Windows.Forms.Button btnOpenImg;
}
}
\ No newline at end of file
......@@ -11,6 +11,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using eyemLib_Sharp;
using static CodeLibrary.EyemDecode;
namespace OnlineStore.XLRStore
{
......@@ -23,6 +25,7 @@ namespace OnlineStore.XLRStore
boxEquip = StoreManager.XLRStore.boxEquip;
chkBoxCloseCam.Checked = bool.Parse(Common.ConfigAppSettings.GetValue(Setting_Init.CloseCamDetect));
SetState(false);
cmbColor.SelectedIndex = 0;
}
BoxEquip boxEquip;
string posSide = "AA";
......@@ -143,7 +146,7 @@ namespace OnlineStore.XLRStore
private void button10_Click(object sender, EventArgs e)
{
boxEquip.autoFindPos.SetParam(int.Parse(txtCurRow.Text), int.Parse(txtCurCol.Text), int.Parse(txtStartRow.Text),int.Parse(txtStartCol.Text),float.Parse(txtCoffX.Text), float.Parse(txtCoofY.Text));
boxEquip.autoFindPos.SetParam(int.Parse(txtCurRow.Text), int.Parse(txtCurCol.Text), int.Parse(txtStartRow.Text), int.Parse(txtStartCol.Text), float.Parse(txtCoffX.Text), float.Parse(txtCoofY.Text));
StringBuilder head2 = new StringBuilder(boxEquip.CID + posSide + txtStartRow.Text.PadLeft(2, '0') + txtStartCol.Text.PadLeft(2, '0'));
head2.Append("0101");
LineMoveP lineMoveP = new LineMoveP();
......@@ -192,7 +195,7 @@ namespace OnlineStore.XLRStore
{
listBox1.Items.Add(item);
}
boxEquip.FindPosEnd();
boxEquip.FindPosEnd();
btnPauseVision.Enabled = false;
btnStopVision.Enabled = false;
}
......@@ -215,9 +218,10 @@ namespace OnlineStore.XLRStore
bitmap = boxEquip.AcqImage("box_B");
}
pictureBox1.Image = null;
if (bitmap != null)
{
int res = AutoFindPos.GetMarkInfo(bitmap, boxEquip.CID + posSide + "_Manual", string.Format("{0}", DateTime.Now.ToString("yyyyMMddhhmmss")), out eyemOcsFXYR, out Bitmap bitmap1);
int res = AutoFindPos.GetMarkInfo(bitmap, boxEquip.CID + posSide + "_Manual", string.Format("{0}", DateTime.Now.ToString("yyyyMMddhhmmss")), out eyemOcsFXYR, out Bitmap bitmap1, (SelectColor)cmbColor.SelectedIndex);
if (bitmap1 != null)
pictureBox1.Image = bitmap1;
else
......@@ -404,7 +408,7 @@ namespace OnlineStore.XLRStore
private void button4_Click(object sender, EventArgs e)
{
if(posSide.Equals("AA"))
if (posSide.Equals("AA"))
{
boxEquip.PullAxis_Inout.AbsMove(null, boxEquip.Config.PullAxis_Inout_CamA, boxEquip.Config.PullAxis_Inout_P1_Speed);
}
......@@ -445,5 +449,35 @@ namespace OnlineStore.XLRStore
{
boxEquip.CloseOutStoreCheck = chkCloseOutStoreCheck.Checked;
}
private void btnOpenImg_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
op.Filter = "Image|*.bmp";
if (op.ShowDialog() == DialogResult.OK)
{
EyemLibDemo.eyemImageRead(op.FileName, -1,out EyemLibDemo.EyemImage img);
eyemLib_Sharp.EyemLibDemo.EyemOcsFXYR eyemOcsFXYR;
int res = AutoFindPos.GetMarkInfo(img, boxEquip.CID + posSide + "_Manual", string.Format("{0}", DateTime.Now.ToString("yyyyMMddhhmmss")), out eyemOcsFXYR, out Bitmap bitmap1, (SelectColor)cmbColor.SelectedIndex);
if (bitmap1 != null)
pictureBox1.Image = bitmap1;
else
pictureBox1.Image = Image.FromFile(op.FileName);
if (res == 0)
{
txtMark_X.Text = eyemOcsFXYR.fX.ToString("f2");
txtMark_Y.Text = eyemOcsFXYR.fY.ToString("f2");
lblResult.Text = "获取mark点信息成功";
lblResult.BackColor = Color.Green;
}
else
{
lblResult.Text = "获取mark点信息失败,异常码:" + res;
lblResult.BackColor = Color.Red;
}
}
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!