mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-25 01:06:36 +08:00
1、添加手眼标定工具,可选择4点或者9点标定,输出标定矩阵
2、修正Halcon引擎运行工具 3、添加相机SDK工具,但需完善 4、HalconTool取图工具增加选择文件夹功能 5、实现Job窗体可添加多个流程
This commit is contained in:
62
HDevEngineTool/HDevEngineCode.cs
Normal file
62
HDevEngineTool/HDevEngineCode.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CommonMethods;
|
||||
using ToolBase;
|
||||
using ViewROI;
|
||||
using HalconDotNet;
|
||||
using System.IO;
|
||||
using Logger;
|
||||
|
||||
namespace HDevEngineTool
|
||||
{
|
||||
[Serializable]
|
||||
public class HDevEngineCode : IToolBase
|
||||
{
|
||||
public string uniqueName { get; set; } = Guid.NewGuid().ToString();
|
||||
public string toolName { get; set; } = string.Empty;
|
||||
[NonSerialized]
|
||||
public HDevProgramCall ProgramCall;
|
||||
[NonSerialized]
|
||||
public HDevEngine MyEngine = new HDevEngine();
|
||||
[NonSerialized]
|
||||
public HDevProgram MyProgram = new HDevProgram();
|
||||
public string CodeText { get; set; } = string.Empty;
|
||||
public string CodeFilePath { get; set; } = string.Empty;
|
||||
public override void DispImage()
|
||||
{
|
||||
// throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void DispMainWindow(HWindowTool_Smart window)
|
||||
{
|
||||
// throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Run(SoftwareRunState softwareRunState)
|
||||
{
|
||||
if (File.Exists(CodeFilePath))
|
||||
{
|
||||
if(MyProgram != null)
|
||||
{
|
||||
if(MyProgram.IsLoaded())
|
||||
{
|
||||
LoggerClass.WriteLog("程序已加载,准备运行!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FileInfo myFileInfo = new FileInfo(CodeFilePath);
|
||||
MyEngine.SetProcedurePath(myFileInfo.DirectoryName);
|
||||
|
||||
MyProgram.LoadProgram(CodeFilePath);
|
||||
ProgramCall = new HDevProgramCall(MyProgram);
|
||||
MyEngine.SetHDevOperators(new HDevOpMultiWindowImpl(FormHDevEngineTool.Instance.myHwindow.SmartWindow.HalconWindow));
|
||||
}
|
||||
ProgramCall.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user