mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-31 05:46:35 +08:00
1、优化LOG显示与引用
2、添加PMA工具,工具内容待完善 3、修复流程树显示 4、添加开源项目,优化UI空间 5、其他BUG更改
This commit is contained in:
@@ -22,10 +22,6 @@ namespace FindLineTool
|
||||
/// </summary>
|
||||
public PosXYU templatePose = new PosXYU();
|
||||
/// <summary>
|
||||
/// 期望线起点行坐标
|
||||
/// </summary>
|
||||
public HTuple expectLineStartRow = 200;
|
||||
/// <summary>
|
||||
/// 卡尺
|
||||
/// </summary>
|
||||
public HObject contoursDisp = null;
|
||||
@@ -38,6 +34,10 @@ namespace FindLineTool
|
||||
/// </summary>
|
||||
public HObject crossDisp = null;
|
||||
/// <summary>
|
||||
/// 期望线起点行坐标
|
||||
/// </summary>
|
||||
public HTuple expectLineStartRow = 200;
|
||||
/// <summary>
|
||||
/// 期望线起点列坐标
|
||||
/// </summary>
|
||||
public HTuple expectLineStartCol = 200;
|
||||
@@ -50,6 +50,21 @@ namespace FindLineTool
|
||||
/// </summary>
|
||||
public HTuple expectLineEndCol = 600;
|
||||
/// <summary>
|
||||
/// 新的跟随姿态变化后的预期线信息
|
||||
/// </summary>
|
||||
HTuple newExpectLineStartRow = new HTuple(200), newExpectLineStartCol = new HTuple(200), newExpectLineEndRow = new HTuple(200), newExpectLineEndCol = new HTuple(600);
|
||||
///// <summary>
|
||||
///// 区域中心行坐标
|
||||
///// </summary>
|
||||
//public HTuple recCenterRow = 200;
|
||||
///// <summary>
|
||||
///// 区域中心列坐标
|
||||
///// </summary>
|
||||
//public HTuple recCenterCol = 200;
|
||||
//public HTuple recAngle = 0;
|
||||
//public HTuple recWidth = 100;
|
||||
//public HTuple recLength = 200;
|
||||
/// <summary>
|
||||
/// 找边极性,从明到暗或从暗到明
|
||||
/// </summary>
|
||||
public string polarity = "negative";
|
||||
@@ -89,14 +104,6 @@ namespace FindLineTool
|
||||
/// 交点显示
|
||||
/// </summary>
|
||||
public bool dispCross = true;
|
||||
/// <summary>
|
||||
/// 运行过程信息
|
||||
/// </summary>
|
||||
public string runMessage { get; set; }
|
||||
/// <summary>
|
||||
/// 工具运行时间
|
||||
/// </summary>
|
||||
public string runTime { get; set; } = string.Empty;
|
||||
public double minScore
|
||||
{
|
||||
get
|
||||
@@ -130,7 +137,7 @@ namespace FindLineTool
|
||||
/// <summary>
|
||||
/// 新的跟随姿态变化后的预期线信息
|
||||
/// </summary>
|
||||
HTuple newExpectLineStartRow = new HTuple(200), newExpectLineStartCol = new HTuple(200), newExpectLineEndRow = new HTuple(200), newExpectLineEndCol = new HTuple(600);
|
||||
HTuple newExpectCenterRow = new HTuple(200), newExpectCenterCol = new HTuple(200), newExpectAngle = new HTuple(0);
|
||||
/// <summary>
|
||||
/// 查找到的线的起点行坐标
|
||||
/// </summary>
|
||||
@@ -196,34 +203,22 @@ namespace FindLineTool
|
||||
}
|
||||
set { _angle = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 输入图像
|
||||
/// </summary>
|
||||
public HObject inputImage { get; set; } = null;
|
||||
/// <summary>
|
||||
/// 工具运行结果
|
||||
/// </summary>
|
||||
public ToolRunStatu toolRunStatu { get; set; } = ToolRunStatu.Not_Run;
|
||||
/// <summary>
|
||||
/// 软件运行状态
|
||||
/// </summary>
|
||||
public SoftwareRunState softwareRunState { get; set; } = SoftwareRunState.Debug;
|
||||
public void DispImage()
|
||||
public override void DispImage()
|
||||
{
|
||||
if(inputImage != null)
|
||||
{
|
||||
FormFindLine.Instance.myHwindow.HobjectToHimage(inputImage);
|
||||
FormFindLine.Instance.myHwindow.DispHWindow.DispImage(new HImage(inputImage));
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateImage()
|
||||
{
|
||||
FormFindLine.Instance.myHwindow.ClearWindow();
|
||||
FormFindLine.Instance.myHwindow.DispHWindow.ClearWindow();
|
||||
DispImage();
|
||||
}
|
||||
|
||||
|
||||
public void Run(SoftwareRunState softwareRunState)
|
||||
public override void Run(SoftwareRunState softwareRunState)
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Restart();
|
||||
@@ -238,7 +233,10 @@ namespace FindLineTool
|
||||
}
|
||||
try
|
||||
{
|
||||
UpdateImage();
|
||||
if(softwareRunState == SoftwareRunState.Debug)
|
||||
{
|
||||
UpdateImage();
|
||||
}
|
||||
if (inputPose != null)
|
||||
{
|
||||
HTuple Row = inputPose.X - templatePose.X;
|
||||
@@ -284,7 +282,7 @@ namespace FindLineTool
|
||||
//显示所有卡尺
|
||||
HTuple pointRow, pointCol;
|
||||
HOperatorSet.GetMetrologyObjectMeasures(out contoursDisp, handleID, new HTuple("all"), new HTuple("all"), out pointRow, out pointCol);
|
||||
|
||||
|
||||
|
||||
//显示指示找线方向的箭头
|
||||
|
||||
@@ -293,9 +291,9 @@ namespace FindLineTool
|
||||
HOperatorSet.GenRegionLine(out drawLine, newExpectLineStartRow, newExpectLineStartCol, newExpectLineEndRow, newExpectLineEndCol);
|
||||
HOperatorSet.ReduceDomain(inputImage, drawLine, out imageReducedLine);
|
||||
HOperatorSet.GetRegionPoints(imageReducedLine, out arrowRow, out arrowColumn);
|
||||
if(arrowRow.Length < 200)
|
||||
if (arrowRow.Length < 200)
|
||||
{
|
||||
CommonMethods.CommonMethods.gen_arrow_contour_xld(out arrow, arrowRow[0], arrowColumn[0], arrowRow[arrowRow.Length-1], arrowColumn[arrowRow.Length - 1], 20, 20);
|
||||
CommonMethods.CommonMethods.gen_arrow_contour_xld(out arrow, arrowRow[0], arrowColumn[0], arrowRow[arrowRow.Length - 1], arrowColumn[arrowRow.Length - 1], 20, 20);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -326,7 +324,7 @@ namespace FindLineTool
|
||||
HOperatorSet.AngleLx(ResultLineStartRow, ResultLineStartCol, ResultLineEndRow, ResultLineEndCol, out _angle);
|
||||
if (softwareRunState == SoftwareRunState.Debug)
|
||||
{
|
||||
DispMainWindow(FormFindLine.Instance.myHwindow);
|
||||
DispMainWindow(FormFindLine.Instance.myHwindow.DispHWindow);
|
||||
FormFindLine.Instance.tbx_resultStartRow.Text = ResultLineStartRow.ToString();
|
||||
FormFindLine.Instance.tbx_resultStartCol.Text = ResultLineEndCol.ToString();
|
||||
FormFindLine.Instance.tbx_resultEndRow.Text = ResultLineEndRow.ToString();
|
||||
@@ -351,18 +349,18 @@ namespace FindLineTool
|
||||
}
|
||||
}
|
||||
|
||||
internal void DrawExpectLine(HWindow_Final myHwindow)
|
||||
internal void DrawExpectLine(HWindow myHwindow)
|
||||
{
|
||||
|
||||
/*
|
||||
if(inputImage != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
myHwindow.DrawModel = true;
|
||||
myHwindow.Focus();
|
||||
HOperatorSet.SetColor(myHwindow.hWindowControl.HalconWindow, new HTuple("green"));
|
||||
HOperatorSet.SetColor(myHwindow, new HTuple("green"));
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Restart();
|
||||
HOperatorSet.DrawLineMod(myHwindow.hWindowControl.HalconWindow, newExpectLineStartRow, newExpectLineStartCol, newExpectLineEndRow, newExpectLineEndCol, out expectLineStartRow, out expectLineStartCol, out expectLineEndRow, out expectLineEndCol);
|
||||
HOperatorSet.DrawLineMod(myHwindow, newExpectLineStartRow, newExpectLineStartCol, newExpectLineEndRow, newExpectLineEndCol, out expectLineStartRow, out expectLineStartCol, out expectLineEndRow, out expectLineEndCol);
|
||||
|
||||
if (inputPose != null)
|
||||
{
|
||||
@@ -375,7 +373,6 @@ namespace FindLineTool
|
||||
FormFindLine.Instance.tbx_expectLineStartCol.Text = expectLineStartCol.TupleString("10.3f");
|
||||
FormFindLine.Instance.tbx_expectLineEndRow.Text = expectLineEndRow.TupleString("10.3f");
|
||||
FormFindLine.Instance.tbx_expectLineEndCol.Text = expectLineEndCol.TupleString("10.3f");
|
||||
myHwindow.DrawModel = false;
|
||||
|
||||
Run(SoftwareRunState.Debug);
|
||||
}
|
||||
@@ -388,7 +385,7 @@ namespace FindLineTool
|
||||
{
|
||||
FormFindLine.Instance.SetToolStatus("输入图像为空!", ToolRunStatu.Not_Input_Image);
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -404,21 +401,23 @@ namespace FindLineTool
|
||||
FormFindLine.Instance.myToolInfo.toolOutput.Add(new ToolIO("EndPoint.Column", ResultLineEndCol, DataType.IntValue));
|
||||
}
|
||||
|
||||
public void DispMainWindow(HWindow_Final window)
|
||||
public override void DispMainWindow(HWindow window)
|
||||
{
|
||||
// 显示矩形
|
||||
if (dispRec)
|
||||
{
|
||||
window.DispObj(contoursDisp, "blue");
|
||||
window.SetColor("blue");
|
||||
window.DispObj(contoursDisp);
|
||||
}
|
||||
// 显示交点
|
||||
if (dispCross)
|
||||
{
|
||||
window.DispObj(arrowDisp, "red");
|
||||
window.DispObj(crossDisp, "orange");
|
||||
window.SetColor("orange");
|
||||
window.DispObj(crossDisp);
|
||||
}
|
||||
//显示找到的线
|
||||
window.DispObj(LineDisp, "green");
|
||||
window.SetColor("green");
|
||||
window.DispObj(LineDisp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -81,12 +81,8 @@
|
||||
<Project>{7CD50B44-BF56-4E8E-8FA1-05F6968C1835}</Project>
|
||||
<Name>ToolBase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ToolLib.Log\LogForm\LogForm.csproj">
|
||||
<Project>{6b38d68f-e77b-4761-bde5-a261ea8925dd}</Project>
|
||||
<Name>LogForm</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ToolLib.Log\Logger\Logger.csproj">
|
||||
<Project>{d4e052b9-e541-4b67-a1f9-273073ef1d4b}</Project>
|
||||
<Project>{D4E052B9-E541-4B67-A1F9-273073EF1D4B}</Project>
|
||||
<Name>Logger</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ToolLib.VisionJob\ToolLib.VisionJob.csproj">
|
||||
|
||||
@@ -15,6 +15,7 @@ using CommonMethods;
|
||||
using CommonMethods.Interface;
|
||||
using FormLib;
|
||||
using HalconDotNet;
|
||||
using Logger;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
@@ -38,29 +39,29 @@ namespace FindLineTool
|
||||
if (L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value == null)
|
||||
{
|
||||
selectNode.ForeColor = Color.Red;
|
||||
Logger.LoggerClass.WriteLog(L_toolList[toolIndex].toolName + " 无输入图像", Logger.MsgLevel.Exception);
|
||||
LoggerClass.WriteLog(L_toolList[toolIndex].toolName + " 无输入图像", MsgLevel.Exception);
|
||||
}
|
||||
else
|
||||
{
|
||||
string sourceFrom = L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value.ToString();
|
||||
if (L_toolList[toolIndex].toolInput[j].IOName == "InputImage")
|
||||
{
|
||||
string sourceToolName = Regex.Split(sourceFrom, " . ")[0];
|
||||
sourceToolName = sourceToolName.Substring(3, Regex.Split(sourceFrom, " . ")[0].Length - 3);
|
||||
string toolItem = Regex.Split(sourceFrom, " . ")[1];
|
||||
string sourceToolName = Regex.Split(sourceFrom, "->")[0];
|
||||
sourceToolName = sourceToolName.Substring(3, Regex.Split(sourceFrom, "->")[0].Length - 3);
|
||||
string toolItem = Regex.Split(sourceFrom, "->")[1];
|
||||
myFindLine.inputImage = myJob.GetToolInfoByToolName(sourceToolName).GetOutput(toolItem).value as HObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
myFindLine.Run(SoftwareRunState.Release);
|
||||
if (myFindLine.toolRunStatu == ToolRunStatu.Succeed)
|
||||
if (myFindLine.toolRunStatu != ToolRunStatu.Succeed)
|
||||
{
|
||||
myFindLine.DispMainWindow(FormImageWindow.Instance.myHWindow);
|
||||
myJob.FormLogDisp(L_toolList[toolIndex].toolName + " 运行成功", Color.Green, selectNode);
|
||||
myJob.FormLogDisp($"{L_toolList[toolIndex].toolName} 运行失败,失败原因:{myFindLine.runMessage}", Color.Red, selectNode, Logger.MsgLevel.Exception);
|
||||
}
|
||||
else
|
||||
{
|
||||
myJob.FormLogDisp(L_toolList[toolIndex].toolName + " 运行失败", Color.Red, selectNode, Logger.MsgLevel.Exception);
|
||||
myJob.FormLogDisp($"{L_toolList[toolIndex].toolName} 运行成功,{myFindLine.runTime}", Color.Green, selectNode);
|
||||
myFindLine.DispMainWindow(FormImageWindow.Instance.myHWindow.DispHWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
864
FindLine/FormFindLine.Designer.cs
generated
864
FindLine/FormFindLine.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,36 @@
|
||||
using System;
|
||||
using CommonMethods;
|
||||
using HalconDotNet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using CommonMethods;
|
||||
using HalconDotNet;
|
||||
using ChoiceTech.Halcon.Control;
|
||||
using ViewROI;
|
||||
|
||||
namespace FindLineTool
|
||||
{
|
||||
public partial class FormFindLine : Form
|
||||
{
|
||||
public FindLine myFindLine = null;
|
||||
public IToolInfo myToolInfo = null;
|
||||
public HWindow_Final myHwindow = new HWindow_Final();
|
||||
public IToolInfo myToolInfo = new IToolInfo();
|
||||
public HWindowTool_Smart myHwindow = new HWindowTool_Smart();
|
||||
public HDrawingObject selected_drawing_object = new HDrawingObject();
|
||||
|
||||
public FormFindLine(ref object findLine)
|
||||
{
|
||||
InitializeComponent();
|
||||
_instance = this;
|
||||
if (findLine.GetType().FullName != "System.Object")
|
||||
{
|
||||
myToolInfo = (IToolInfo)findLine;
|
||||
myFindLine = (FindLine)myToolInfo.tool;
|
||||
myFindLine.DispImage();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗体对象实例
|
||||
/// </summary>
|
||||
@@ -27,7 +39,7 @@ namespace FindLineTool
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_instance != null)
|
||||
if (_instance != null)
|
||||
{
|
||||
lock (_instance)
|
||||
{
|
||||
@@ -45,69 +57,23 @@ namespace FindLineTool
|
||||
_instance = new FormFindLine(ref line);
|
||||
return _instance;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public FormFindLine(ref object findLine)
|
||||
{
|
||||
InitializeComponent();
|
||||
_instance = this;
|
||||
if(findLine.GetType().FullName != "System.Object")
|
||||
{
|
||||
myToolInfo = (IToolInfo)findLine;
|
||||
myFindLine = (FindLine)myToolInfo.tool;
|
||||
//myFindLine.inputImage = ComGlobalParams.inputImageGlobal; // 暂时直接将图像传递给该工具
|
||||
myFindLine.DispImage();
|
||||
}
|
||||
}
|
||||
|
||||
private void FormFindLine_Load(object sender, EventArgs e)
|
||||
private void FormFindLine2_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.panel1.Controls.Add(myHwindow);
|
||||
myHwindow.Dock = DockStyle.Fill;
|
||||
InitTool();
|
||||
}
|
||||
|
||||
private void btn_moveCliperRegion_Click(object sender, EventArgs e)
|
||||
{
|
||||
myFindLine.UpdateImage();
|
||||
myFindLine.DrawExpectLine(myHwindow);
|
||||
}
|
||||
|
||||
private void btn_runFindLineTool_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 更改界面中参数,实时更新类中参数
|
||||
myFindLine.expectLineStartRow = Convert.ToDouble(tbx_expectLineStartRow.Text.Trim());
|
||||
myFindLine.expectLineStartCol = Convert.ToDouble(tbx_expectLineStartCol.Text.Trim());
|
||||
myFindLine.expectLineEndRow = Convert.ToDouble(tbx_expectLineEndRow.Text.Trim());
|
||||
myFindLine.expectLineEndCol = Convert.ToDouble(tbx_expectLineEndCol.Text.Trim());
|
||||
// 运行参数
|
||||
myFindLine.minScore = Convert.ToDouble(tbx_minScore.Text.Trim());
|
||||
myFindLine.cliperNum = Convert.ToInt16(tbx_caliperNum.Text.Trim());
|
||||
myFindLine.threshold = Convert.ToInt16(tbx_threshold.Text.Trim());
|
||||
myFindLine.length = Convert.ToInt16(tbx_caliperLength.Text.Trim());
|
||||
myFindLine.weidth = Convert.ToInt16(tbx_caliperLength2.Text.Trim());
|
||||
myFindLine.polarity = cbx_polarity.SelectedItem.ToString() == "从明到暗" ? "negative":"positive";
|
||||
myFindLine.edgeSelect = cbx_edgeSelect.SelectedItem.ToString();
|
||||
myFindLine.sigma = Convert.ToDouble(tbx_Sigma.Text.Trim());
|
||||
// Run
|
||||
myFindLine.Run(SoftwareRunState.Debug);
|
||||
}
|
||||
|
||||
public void InitTool()
|
||||
private void InitTool()
|
||||
{
|
||||
this.Text = myToolInfo.toolName;
|
||||
btn_runFindLineTool.Focus();
|
||||
Application.DoEvents();
|
||||
|
||||
//myFindLine.Run(); //运行一下,使卡尺显示出来
|
||||
// myFindLine.Run(); //运行一下,使卡尺显示出来
|
||||
|
||||
tbx_expectLineStartRow.Text = myFindLine.expectLineStartRow.ToString();
|
||||
tbx_expectLineStartCol.Text = myFindLine.expectLineStartCol.ToString();
|
||||
tbx_expectLineEndRow.Text = myFindLine.expectLineEndRow.ToString();
|
||||
tbx_expectLineEndCol.Text = myFindLine.expectLineEndCol.ToString();
|
||||
cbx_edgeSelect.Text = myFindLine.edgeSelect;
|
||||
tbx_minScore.Text = myFindLine.minScore.ToString();
|
||||
cbx_polarity.Text = myFindLine.polarity == "positive" ? "从暗到明" : "从明到暗";
|
||||
@@ -118,6 +84,41 @@ namespace FindLineTool
|
||||
tbx_caliperLength2.Text = myFindLine.weidth.ToString();
|
||||
chBDispRec.Checked = myFindLine.dispRec;
|
||||
chBDispCross.Checked = myFindLine.dispCross;
|
||||
// 将要编辑的线显示
|
||||
selected_drawing_object = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.LINE, new HTuple[] { myFindLine.expectLineStartRow, myFindLine.expectLineStartCol, myFindLine.expectLineEndRow, myFindLine.expectLineEndCol });
|
||||
GC.KeepAlive(selected_drawing_object);
|
||||
selected_drawing_object.OnSelect(OnSelectDrawingObject);
|
||||
selected_drawing_object.OnAttach(OnSelectDrawingObject);
|
||||
selected_drawing_object.OnResize(OnSelectDrawingObject);
|
||||
selected_drawing_object.OnDrag(OnSelectDrawingObject);
|
||||
myHwindow.DispHWindow.AttachDrawingObjectToWindow(selected_drawing_object);
|
||||
}
|
||||
/// <summary>
|
||||
/// 参数回调
|
||||
/// </summary>
|
||||
/// <param name="dobj"></param>
|
||||
/// <param name="hwin"></param>
|
||||
/// <param name="type"></param>
|
||||
private void OnSelectDrawingObject(HDrawingObject dobj, HWindow hwin, string type)
|
||||
{
|
||||
myFindLine.expectLineStartRow = dobj.GetDrawingObjectParams("row1");
|
||||
myFindLine.expectLineStartCol = dobj.GetDrawingObjectParams("column1");
|
||||
myFindLine.expectLineEndRow = dobj.GetDrawingObjectParams("row2");
|
||||
myFindLine.expectLineEndCol = dobj.GetDrawingObjectParams("column2");
|
||||
}
|
||||
private void tsbtRunTool_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 运行参数
|
||||
myFindLine.minScore = Convert.ToDouble(tbx_minScore.Text.Trim());
|
||||
myFindLine.cliperNum = Convert.ToInt16(tbx_caliperNum.Text.Trim());
|
||||
myFindLine.threshold = Convert.ToInt16(tbx_threshold.Text.Trim());
|
||||
myFindLine.length = Convert.ToInt16(tbx_caliperLength.Text.Trim());
|
||||
myFindLine.weidth = Convert.ToInt16(tbx_caliperLength2.Text.Trim());
|
||||
myFindLine.polarity = cbx_polarity.SelectedItem.ToString() == "从明到暗" ? "negative" : "positive";
|
||||
myFindLine.edgeSelect = cbx_edgeSelect.SelectedItem.ToString();
|
||||
myFindLine.sigma = Convert.ToDouble(tbx_Sigma.Text.Trim());
|
||||
// Run
|
||||
myFindLine.Run(SoftwareRunState.Debug);
|
||||
}
|
||||
/// <summary>
|
||||
/// 设定工具运行状态
|
||||
@@ -126,7 +127,7 @@ namespace FindLineTool
|
||||
/// <param name="status">运行状态</param>
|
||||
public void SetToolStatus(string msg, ToolRunStatu status)
|
||||
{
|
||||
if(myFindLine!=null)
|
||||
if (myFindLine != null)
|
||||
{
|
||||
myFindLine.runMessage = msg;
|
||||
myFindLine.toolRunStatu = status;
|
||||
@@ -143,92 +144,18 @@ namespace FindLineTool
|
||||
}
|
||||
}
|
||||
|
||||
#region 输入检查
|
||||
private void tbx_expectLineStartRow_TextChanged(object sender, EventArgs e)
|
||||
private void DispSetCheck(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
myFindLine.expectLineStartRow = Convert.ToDouble(tbx_expectLineStartRow.Text.Trim());
|
||||
}
|
||||
catch
|
||||
{
|
||||
SetToolStatus("输入了非法字符,已自动替换为默认值:200", ToolRunStatu.Input_Value_Type_Error);
|
||||
tbx_expectLineStartRow.Text = "200";
|
||||
}
|
||||
myFindLine.dispRec = chBDispRec.Checked ? true : false;
|
||||
myFindLine.dispCross = chBDispCross.Checked ? true : false;
|
||||
}
|
||||
|
||||
private void tbx_expectLineStartCol_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
myFindLine.expectLineStartCol = Convert.ToDouble(tbx_expectLineStartCol.Text.Trim());
|
||||
}
|
||||
catch
|
||||
{
|
||||
SetToolStatus("输入了非法字符,已自动替换为默认值:200", ToolRunStatu.Input_Value_Type_Error);
|
||||
tbx_expectLineStartCol.Text = "200";
|
||||
}
|
||||
}
|
||||
|
||||
private void tbx_expectLineEndRow_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
myFindLine.expectLineEndRow = Convert.ToDouble(tbx_expectLineEndRow.Text.Trim());
|
||||
}
|
||||
catch
|
||||
{
|
||||
SetToolStatus("输入了非法字符,已自动替换为默认值:200", ToolRunStatu.Input_Value_Type_Error);
|
||||
tbx_expectLineEndRow.Text = "200";
|
||||
}
|
||||
}
|
||||
|
||||
private void tbx_expectLineEndCol_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
myFindLine.expectLineEndCol = Convert.ToDouble(tbx_expectLineEndCol.Text.Trim());
|
||||
}
|
||||
catch
|
||||
{
|
||||
SetToolStatus("输入了非法字符,已自动替换为默认值:600", ToolRunStatu.Input_Value_Type_Error);
|
||||
tbx_expectLineEndCol.Text = "600";
|
||||
}
|
||||
}
|
||||
|
||||
private void chBDispRec_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(chBDispRec.Checked)
|
||||
{
|
||||
myFindLine.dispRec = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
myFindLine.dispRec = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void chBDispCross_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(chBDispCross.Checked)
|
||||
{
|
||||
myFindLine.dispCross = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
myFindLine.dispCross = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void FormFindLine_FormClosing(object sender, FormClosingEventArgs e)
|
||||
private void FormFindLine2_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
myHwindow.Dispose();
|
||||
this.Dispose();
|
||||
this.Dispose();
|
||||
GC.Collect();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@@ -32,6 +32,9 @@ G:\VisionEdit\VisionEdit\FindLine\obj\Debug\FindLineTool.FormFindLine.resources
|
||||
G:\VisionEdit\VisionEdit\FindLine\obj\Debug\FindLineTool.csproj.GenerateResource.Cache
|
||||
G:\VisionEdit\VisionEdit\FindLine\obj\Debug\FindLineTool.dll
|
||||
G:\VisionEdit\VisionEdit\FindLine\obj\Debug\FindLineTool.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\obj\Debug\FindLineTool.csprojResolveAssemblyReference.cache
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\obj\Debug\FindLineTool.FormFindLine.resources
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\obj\Debug\FindLineTool.csproj.GenerateResource.Cache
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\log4net.config
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\FindLineTool.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\FindLineTool.pdb
|
||||
@@ -40,7 +43,6 @@ F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\DataStruct.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\FormLib.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\halcondotnet.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\HWindow_Tool.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\LogForm.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\Logger.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\ToolBase.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\ToolLib.VisionJob.dll
|
||||
@@ -52,15 +54,11 @@ F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\CommonMethods.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\DataStruct.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\FormLib.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\ToolBase.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\LogForm.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\Logger.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\ToolLib.VisionJob.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\HWindow_Tool.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\halcondotnet.xml
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\WeifenLuo.WinFormsUI.Docking.pdb
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\Newtonsoft.Json.xml
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\bin\Debug\DevComponents.DotNetBar2.xml
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\obj\Debug\FindLineTool.csprojResolveAssemblyReference.cache
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\obj\Debug\FindLineTool.FormFindLine.resources
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\obj\Debug\FindLineTool.csproj.GenerateResource.Cache
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\obj\Debug\FindLineTool.dll
|
||||
F:\GitHubClone\最新克隆\VisionEdit\FindLine\obj\Debug\FindLineTool.pdb
|
||||
|
||||
Reference in New Issue
Block a user