修改界面
This commit is contained in:
parent
b8c83e459d
commit
a9d02a5a9d
@ -66,7 +66,7 @@ namespace DH.Devices.Camera
|
||||
dvpCameraInfo camerainfo = new dvpCameraInfo();
|
||||
nRet = DVPCamera.dvpGetCameraInfo(m_handle, ref camerainfo);
|
||||
|
||||
SerialNumber= camerainfo.SerialNumber;
|
||||
SerialNumber = camerainfo.SerialNumber;
|
||||
// ch:注册异常回调函数 | en:Register Exception Callback
|
||||
//nRet = DVPCamera.dvpRegisterEventCallback(m_handle, pCallBackFunc, dvpEvent.EVENT_DISCONNECTED, IntPtr.Zero);
|
||||
//if (nRet != dvpStatus.DVP_STATUS_OK)
|
||||
@ -309,7 +309,14 @@ namespace DH.Devices.Camera
|
||||
public int ImageCallbackFunc(uint handle, dvpStreamEvent _event, IntPtr pContext, ref dvpFrame refFrame, IntPtr pBuffer)
|
||||
{
|
||||
Mat cvImage = new Mat();
|
||||
|
||||
if (this.CameraName.Equals("Cam1"))
|
||||
{
|
||||
Console.WriteLine( );
|
||||
}
|
||||
if (this.CameraName.Equals("Cam2"))
|
||||
{
|
||||
Console.WriteLine();
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
@ -336,7 +343,8 @@ namespace DH.Devices.Camera
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotSupportedException($"Unsupported format: {refFrame.format}");
|
||||
cvImage = Mat.FromPixelData(nHeight, nWidth, MatType.CV_8UC1, pBuffer);
|
||||
break;
|
||||
}
|
||||
Mat smat = cvImage.Clone();
|
||||
OnHImageOutput?.Invoke(DateTime.Now, this, smat);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
||||
using DH.Commons.Enums;
|
||||
using DH.Devices.Motion;
|
||||
using MCDLL_NET;
|
||||
using OpenCvSharp;
|
||||
using System.Diagnostics;
|
||||
using static System.Collections.Specialized.BitVector32;
|
||||
|
||||
@ -287,53 +288,56 @@ namespace DH.Devices.Motion
|
||||
for (ushort station = 0; station < BoardCount; station++)
|
||||
{
|
||||
// 关闭调试测试后的位置比较
|
||||
//关闭调试测试后的位置比较
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
rtn = CMCDLL_NET.MCF_Set_Compare_Config_Net((ushort)i, 0, 0, station);
|
||||
Console.WriteLine($"MCF_Set_Compare_Config_Net {i}::{rtn}");
|
||||
}
|
||||
|
||||
// 2.配置物件设置
|
||||
rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Piece_Size_Net(PieceMaxSize, PieceMinSize, station);
|
||||
//2.配置物件设置
|
||||
rtn = CMCDLL_NET.MCF_Sorting_Set_Piece_Size_Net(PieceMaxSize, PieceMinSize, station);
|
||||
Console.WriteLine($"MCF_Sorting_Set_Piece_Size_Net::{rtn}");
|
||||
|
||||
|
||||
rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Piece_Place_Net(MinDistance, MinTimeInterval, station);
|
||||
rtn = CMCDLL_NET.MCF_Sorting_Set_Piece_Place_Net(MinDistance, MinTimeInterval, station);
|
||||
Console.WriteLine($"MCF_Sorting_Set_Piece_Place_Net::{rtn}");
|
||||
}
|
||||
|
||||
if (BoardCount < 2)
|
||||
{
|
||||
//if (BoardCount < 2)
|
||||
//{
|
||||
// // rtn = CMCDLL_NET_Sorting.MCF_Sorting_Camera_Blow_Config_Net(10, 6, 0);
|
||||
// // 3.配置相机设置
|
||||
// rtn = CMCDLL_NET_Sorting.MCF_Sorting_Camera_Blow_Config_Net(10, 6, 0);
|
||||
// 3.配置相机设置
|
||||
rtn = CMCDLL_NET_Sorting.MCF_Sorting_Camera_Blow_Config_Net(10, 6, 0);
|
||||
//设置来料使能 0 是默认 1是开始
|
||||
//
|
||||
rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Enable_Net((ushort)SortingInputSetting.BitInputNumber, 1);
|
||||
//设置物件检测有效电平 0是低电平 1是高电平
|
||||
rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Logic_Net((ushort)SortingInputSetting.BitInputNumber, 0);
|
||||
//设置来料检测编码器 双转盘要设置两个轴
|
||||
/*Bit_Input_Number:设置位号。
|
||||
取值: Bit_Input_0, Bit_Input_1。
|
||||
Axis: 轴号。
|
||||
Source:跟随方式
|
||||
取值:0:命令
|
||||
1:编码器(默认)
|
||||
StationNumber: 站点号;*/
|
||||
// rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Source_Net((ushort)IIConfig.SortingInputSetting.BitInputNumber, 0, 1);
|
||||
rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Source_Net((ushort)SortingInputSetting.BitInputNumber, 1, 1);
|
||||
// //设置来料使能 0 是默认 1是开始
|
||||
// //
|
||||
// rtn = CMCDLL_NET.MCF_Sorting_Set_Input_Enable_Net((ushort)SortingInputSetting.BitInputNumber, 1);
|
||||
// //设置物件检测有效电平 0是低电平 1是高电平
|
||||
// rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Logic_Net((ushort)SortingInputSetting.BitInputNumber, 0);
|
||||
// //设置来料检测编码器 双转盘要设置两个轴
|
||||
// /*Bit_Input_Number:设置位号。
|
||||
// 取值: Bit_Input_0, Bit_Input_1。
|
||||
// Axis: 轴号。
|
||||
// Source:跟随方式
|
||||
// 取值:0:命令
|
||||
// 1:编码器(默认)
|
||||
// StationNumber: 站点号;*/
|
||||
// // rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Source_Net((ushort)IIConfig.SortingInputSetting.BitInputNumber, 0, 1);
|
||||
// rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Source_Net((ushort)SortingInputSetting.BitInputNumber, 1, 1);
|
||||
|
||||
|
||||
//rtn = CMCDLL_NET_Sorting.MCF_Sorting_Camera_Blow_Config_Net(
|
||||
// (ushort)IIConfig.SnapshotSettings.Count,
|
||||
// (ushort)IIConfig.BlowSettings.Count,
|
||||
// 0);
|
||||
// rtn = CMCDLL_NET_Sorting.MCF_Set_Config_Camera_Net();
|
||||
//为防止转盘第二个盘不触发拍照 设置一键取反功能
|
||||
}
|
||||
// //rtn = CMCDLL_NET_Sorting.MCF_Sorting_Camera_Blow_Config_Net(
|
||||
// // (ushort)IIConfig.SnapshotSettings.Count,
|
||||
// // (ushort)IIConfig.BlowSettings.Count,
|
||||
// // 0);
|
||||
// // rtn = CMCDLL_NET_Sorting.MCF_Set_Config_Camera_Net();
|
||||
// //为防止转盘第二个盘不触发拍照 设置一键取反功能
|
||||
//}
|
||||
// 3.配置相机设置
|
||||
|
||||
ConfigCamera();
|
||||
|
||||
// 4.配置气阀
|
||||
ConfigBlow();
|
||||
// ConfigBlow();
|
||||
|
||||
|
||||
|
||||
@ -345,54 +349,33 @@ namespace DH.Devices.Motion
|
||||
|
||||
for (ushort card = 0; card < cardCount; card++)
|
||||
{
|
||||
//IIConfig.SortingInputSettings.ForEach(sortingInputSetting =>
|
||||
//5.开启筛选
|
||||
rtn = CMCDLL_NET.MCF_Sorting_Start_Net(0, card);
|
||||
if (rtn != (short)0)
|
||||
{
|
||||
// LogAsync(DateTime.Now, LogLevel.Warning, $"卡{station}开启筛选异常,ret:{rtn}");
|
||||
}
|
||||
//if (cardCount < 2)
|
||||
//{
|
||||
// var camStart = 0;
|
||||
// if (sortingInputSetting.EnableBindCamera)
|
||||
// {
|
||||
// camStart = sortingInputSetting.CameraStartNumber;
|
||||
// }
|
||||
|
||||
// var blowStart = 0;
|
||||
// if (sortingInputSetting.EnableBindBlow)
|
||||
// {
|
||||
// blowStart = sortingInputSetting.BlowStartNumber;
|
||||
// }
|
||||
|
||||
// var b = (ushort)sortingInputSetting.BitInputNumber;
|
||||
// //var ret = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Bind_Net(b,
|
||||
// // (ushort)camStart,
|
||||
// // (ushort)blowStart,
|
||||
// // card);
|
||||
|
||||
// var ret = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Bind_Net(1,
|
||||
// 1,
|
||||
// 2,
|
||||
// // 最小值 1 2 2
|
||||
// var ret = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Bind_Net(
|
||||
// (ushort)SortingInputSetting.BitInputNumber, // 1
|
||||
// SortingInputSetting.CameraStartNumber, // 7,
|
||||
// SortingInputSetting.BlowStartNumber, // 2,
|
||||
// card);
|
||||
|
||||
//});
|
||||
// CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Source_Net();
|
||||
if (cardCount < 2)
|
||||
{
|
||||
// 最小值 1 2 2
|
||||
var ret = CMCDLL_NET_Sorting.MCF_Sorting_Set_Input_Bind_Net(
|
||||
(ushort)SortingInputSetting.BitInputNumber, // 1
|
||||
SortingInputSetting.CameraStartNumber, // 7,
|
||||
SortingInputSetting.BlowStartNumber, // 2,
|
||||
card);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
for (ushort station = 0; station < cardCount; station++)
|
||||
{
|
||||
// 5.开启筛选
|
||||
//开启自动筛选功能
|
||||
rtn = CMCDLL_NET_Sorting.MCF_Sorting_Start_Net(0, station);
|
||||
if (rtn != (short)FuncRet.Function_Success)
|
||||
{
|
||||
//LogAsync(DateTime.Now, LogLevel.Warning, $"卡{card}开启筛选异常,ret:{rtn}");
|
||||
}
|
||||
}
|
||||
//for (ushort station = 0; station < cardCount; station++)
|
||||
//{
|
||||
// // 5.开启筛选
|
||||
// //开启自动筛选功能
|
||||
// rtn = CMCDLL_NET_Sorting.MCF_Sorting_Start_Net(0, station);
|
||||
// if (rtn != (short)FuncRet.Function_Success)
|
||||
// {
|
||||
// //LogAsync(DateTime.Now, LogLevel.Warning, $"卡{card}开启筛选异常,ret:{rtn}");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@ -419,6 +402,7 @@ namespace DH.Devices.Motion
|
||||
|
||||
public override void Stop()
|
||||
{
|
||||
isconnected = false;
|
||||
//base.Stop();
|
||||
AxisStop();
|
||||
int ret = CMCDLL_NET.MCF_Set_Servo_Enable_Net(0, (ushort)ServoLogic.Servo_Open, 0);
|
||||
@ -636,7 +620,7 @@ namespace DH.Devices.Motion
|
||||
// 初始化
|
||||
for (ushort station = 0; station < BoardCount; station++)
|
||||
{
|
||||
ret = CMCDLL_NET_Sorting.MCF_Sorting_Init_Net(station);
|
||||
ret = CMCDLL_NET.MCF_Sorting_Init_Net(station);
|
||||
stations.Add(station);
|
||||
cardTypes.Add(2);
|
||||
}
|
||||
@ -658,8 +642,8 @@ namespace DH.Devices.Motion
|
||||
{
|
||||
|
||||
}
|
||||
MCF_Screen_Set_Trigger1();
|
||||
MCF_Screen_Set_Trigger1(1);
|
||||
//MCF_Screen_Set_Trigger1();
|
||||
// MCF_Screen_Set_Trigger1(1);
|
||||
|
||||
}
|
||||
|
||||
@ -1859,7 +1843,7 @@ namespace DH.Devices.Motion
|
||||
continue;
|
||||
}
|
||||
|
||||
var rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Trig_Camera_Delay_Count_Net(i,
|
||||
var rtn = CMCDLL_NET.MCF_Sorting_Set_Trig_Camera_Delay_Count_Net(i,
|
||||
camSetting.CameraDelayCountMS, camSetting.StationNumber);
|
||||
|
||||
|
||||
@ -1894,7 +1878,7 @@ namespace DH.Devices.Motion
|
||||
}
|
||||
else
|
||||
{
|
||||
rtn = CMCDLL_NET_Sorting.MCF_Sorting_Set_Camera_Net(
|
||||
rtn = CMCDLL_NET.MCF_Sorting_Set_Camera_Net(
|
||||
i, // CCD0
|
||||
CameraPositionReal,
|
||||
RotationDirectionReal,
|
||||
@ -2004,23 +1988,31 @@ namespace DH.Devices.Motion
|
||||
switch (blowSetting.BlowType)
|
||||
{
|
||||
case BlowType.OK:
|
||||
CMCDLL_NET_Sorting.MCF_Sorting_Set_Blow_OK_Net(CameraPositionReal, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)ioIndex, blowSetting.StationNumber);
|
||||
CMCDLL_NET.MCF_Sorting_Set_Blow_OK_Net(CameraPositionReal, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)ioIndex, blowSetting.StationNumber);
|
||||
break;
|
||||
case BlowType.NG:
|
||||
CMCDLL_NET_Sorting.MCF_Sorting_Set_Blow_NG_Net(CameraPositionReal, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)ioIndex, blowSetting.StationNumber);
|
||||
CMCDLL_NET.MCF_Sorting_Set_Blow_NG_Net(CameraPositionReal, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)ioIndex, blowSetting.StationNumber);
|
||||
break;
|
||||
case BlowType.Blow1:
|
||||
CMCDLL_NET_Sorting.MCF_Sorting_Set_Blow_Net(1, CameraPositionReal, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)ioIndex, blowSetting.StationNumber);
|
||||
CMCDLL_NET.MCF_Sorting_Set_Blow_1_Net(blowSetting.BlowPosition, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)blowSetting.BlowIO.IOIndex, blowSetting.StationNumber);
|
||||
break;
|
||||
///第一路绑定OK NG 吹起口1
|
||||
case BlowType.Blow2:
|
||||
CMCDLL_NET_Sorting.MCF_Sorting_Set_Blow_Net(2, CameraPositionReal, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)ioIndex, blowSetting.StationNumber);
|
||||
CMCDLL_NET.MCF_Sorting_Set_Blow_2_Net(blowSetting.BlowPosition, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)blowSetting.BlowIO.IOIndex, blowSetting.StationNumber);
|
||||
break;
|
||||
case BlowType.Blow3:
|
||||
CMCDLL_NET_Sorting.MCF_Sorting_Set_Blow_Net(3, CameraPositionReal, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)ioIndex, blowSetting.StationNumber);
|
||||
CMCDLL_NET.MCF_Sorting_Set_Blow_3_Net(blowSetting.BlowPosition, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)blowSetting.BlowIO.IOIndex, blowSetting.StationNumber);
|
||||
break;
|
||||
case BlowType.Blow4:
|
||||
CMCDLL_NET_Sorting.MCF_Sorting_Set_Blow_Net(4, CameraPositionReal, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)ioIndex, blowSetting.StationNumber);
|
||||
CMCDLL_NET.MCF_Sorting_Set_Blow_4_Net(blowSetting.BlowPosition, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)blowSetting.BlowIO.IOIndex, blowSetting.StationNumber);
|
||||
break;
|
||||
case BlowType.Blow5:
|
||||
CMCDLL_NET.MCF_Sorting_Set_Blow_5_Net(blowSetting.BlowPosition, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)blowSetting.BlowIO.IOIndex, blowSetting.StationNumber);
|
||||
break;
|
||||
case BlowType.Blow6:
|
||||
CMCDLL_NET.MCF_Sorting_Set_Blow_6_Net(blowSetting.BlowPosition, (ushort)rotationDirectionEnum, (ushort)blowSetting.ActionMode, (ushort)blowSetting.BlowIO.IOIndex, blowSetting.StationNumber);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
//case BlowType.OK:
|
||||
// CMCDLL_NET_Sorting.MCF_Sorting_Set_Blow_OK_Net(setting.BlowPosition, (ushort)IIConfig.MotionDir, (ushort)setting.ActionMode, (ushort)setting.BlowIO.IOIndex, setting.StationNumber);
|
||||
@ -2047,8 +2039,7 @@ namespace DH.Devices.Motion
|
||||
//case BlowType.Blow6:
|
||||
// CMCDLL_NET_Sorting.MCF_Sorting_Set_Blow_6_Net(setting.BlowPosition, (ushort)IIConfig.MotionDir, (ushort)setting.ActionMode, (ushort)setting.BlowIO.IOIndex, setting.StationNumber);
|
||||
// break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,18 @@
|
||||
<OutputType>WinExe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Views\CamConfigFrm.cs" />
|
||||
<Compile Include="Views\CamConfigFrm.Designer.cs" />
|
||||
<Compile Include="Views\UserConfigFrm.cs" />
|
||||
<Compile Include="Views\UserConfigFrm.Designer.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Views\CamConfigFrm.resx" />
|
||||
<EmbeddedResource Include="Views\UserConfigFrm.resx" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AntdUI" Version="1.8.9" />
|
||||
<PackageReference Include="System.IO.Ports" Version="9.0.2" />
|
||||
|
39
DHSoftware/MainWindow.Designer.cs
generated
39
DHSoftware/MainWindow.Designer.cs
generated
@ -41,6 +41,7 @@
|
||||
button_color = new AntdUI.Button();
|
||||
buttonSZ = new AntdUI.Button();
|
||||
pageHeader1 = new AntdUI.PageHeader();
|
||||
label1 = new Label();
|
||||
divider2 = new AntdUI.Divider();
|
||||
panelmain = new AntdUI.Panel();
|
||||
panel2 = new AntdUI.Panel();
|
||||
@ -56,11 +57,9 @@
|
||||
panel3 = new AntdUI.Panel();
|
||||
tabs2 = new AntdUI.Tabs();
|
||||
tabPage2 = new AntdUI.TabPage();
|
||||
pictureBox1 = new PictureBox();
|
||||
divider1 = new AntdUI.Divider();
|
||||
panel1 = new AntdUI.Panel();
|
||||
segmented1 = new AntdUI.Segmented();
|
||||
label1 = new Label();
|
||||
titlebar.SuspendLayout();
|
||||
pageHeader1.SuspendLayout();
|
||||
panelmain.SuspendLayout();
|
||||
@ -73,8 +72,6 @@
|
||||
tabPage3.SuspendLayout();
|
||||
panel3.SuspendLayout();
|
||||
tabs2.SuspendLayout();
|
||||
tabPage2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
||||
panel1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
@ -139,6 +136,15 @@
|
||||
pageHeader1.TabIndex = 7;
|
||||
pageHeader1.Text = "UPH";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(61, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(64, 21);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "100000";
|
||||
//
|
||||
// divider2
|
||||
//
|
||||
divider2.Dock = DockStyle.Top;
|
||||
@ -285,22 +291,11 @@
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
tabPage2.Controls.Add(pictureBox1);
|
||||
tabPage2.Location = new Point(3, 28);
|
||||
tabPage2.Name = "tabPage2";
|
||||
tabPage2.Size = new Size(347, 469);
|
||||
tabPage2.TabIndex = 0;
|
||||
tabPage2.Text = "统计";
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
pictureBox1.Dock = DockStyle.Fill;
|
||||
pictureBox1.Location = new Point(0, 0);
|
||||
pictureBox1.Name = "pictureBox1";
|
||||
pictureBox1.Size = new Size(347, 469);
|
||||
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
pictureBox1.TabIndex = 0;
|
||||
pictureBox1.TabStop = false;
|
||||
tabPage2.Text = "配置";
|
||||
//
|
||||
// divider1
|
||||
//
|
||||
@ -401,15 +396,6 @@
|
||||
segmented1.Text = "segmented1";
|
||||
segmented1.SelectIndexChanged += segmented1_SelectIndexChanged;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(61, 10);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(64, 21);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "100000";
|
||||
//
|
||||
// MainWindow
|
||||
//
|
||||
ClientSize = new Size(1024, 648);
|
||||
@ -438,8 +424,6 @@
|
||||
tabPage3.ResumeLayout(false);
|
||||
panel3.ResumeLayout(false);
|
||||
tabs2.ResumeLayout(false);
|
||||
tabPage2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
||||
panel1.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
@ -468,7 +452,6 @@
|
||||
private AntdUI.TabPage tabPage2;
|
||||
private AntdUI.Divider divider1;
|
||||
private RichTextBox richTextBox1;
|
||||
private PictureBox pictureBox1;
|
||||
private Label label1;
|
||||
}
|
||||
}
|
@ -282,11 +282,11 @@ namespace DHSoftware
|
||||
//[Description("定义检测标签的集合,例如:Seg/Detection模式:断裂、油污、划伤...;Class模式:ok、ng、上面、下面、套环、正常...")]
|
||||
//[TypeConverter(typeof(CollectionCountConvert))]
|
||||
//[Editor(typeof(ComplexCollectionEditor<RecongnitionLabel>), typeof(UITypeEditor))]
|
||||
RecongnitionLabel recongnition=new RecongnitionLabel
|
||||
RecongnitionLabel recongnition = new RecongnitionLabel
|
||||
{
|
||||
LabelName="youwu",
|
||||
LabelDescription="油污",
|
||||
LabelCategory="A_NG"
|
||||
LabelName = "youwu",
|
||||
LabelDescription = "油污",
|
||||
LabelCategory = "A_NG"
|
||||
};
|
||||
RecongnitionLabel recongnition2 = new RecongnitionLabel
|
||||
{
|
||||
@ -314,7 +314,7 @@ namespace DHSoftware
|
||||
var det6 = new DetectionConfig("相机6", MLModelType.ObjectDetection, @"D:\PROJECTS\X015\Vision\Cam6.onnx", false, "Cam6");
|
||||
var det7 = new DetectionConfig("相机7", MLModelType.ObjectDetection, @"D:\PROJECTS\X015\Vision\Cam7.onnx", false, "Cam7");
|
||||
var det8 = new DetectionConfig("相机8", MLModelType.ObjectDetection, @"D:\PROJECTS\X015\Vision\Cam8.onnx", false, "Cam8");
|
||||
List<RelatedCamera> CameraCollects=new List<RelatedCamera>();
|
||||
List<RelatedCamera> CameraCollects = new List<RelatedCamera>();
|
||||
CameraCollects.Add(new RelatedCamera("Cam1"));
|
||||
List<RelatedCamera> CameraCollects2 = new List<RelatedCamera>();
|
||||
CameraCollects2.Add(new RelatedCamera("Cam2"));
|
||||
@ -420,22 +420,30 @@ namespace DHSoftware
|
||||
|
||||
}
|
||||
#else
|
||||
Do3ThinkCamera do3ThinkCamera1 = new Do3ThinkCamera();
|
||||
//Do3ThinkCamera do3ThinkCamera1 = new Do3ThinkCamera();
|
||||
|
||||
do3ThinkCamera1.dvpStreamFormat = dvpStreamFormat.S_RAW8;
|
||||
do3ThinkCamera1.CameraName = "Cam1";
|
||||
do3ThinkCamera1.CameraConnect();
|
||||
do3ThinkCamera1.OnHImageOutput += OnCameraHImageOutput;
|
||||
Cameras.Add(do3ThinkCamera1);
|
||||
for (int i=2;i<=8;i++)
|
||||
//do3ThinkCamera1.dvpStreamFormat = dvpStreamFormat.S_RAW8;
|
||||
//do3ThinkCamera1.CameraName = "Cam1";
|
||||
//do3ThinkCamera1.CameraConnect();
|
||||
//do3ThinkCamera1.OnHImageOutput += OnCameraHImageOutput;
|
||||
// Cameras.Add(do3ThinkCamera1);
|
||||
for (int i = 1; i <= 8; i++)
|
||||
{
|
||||
|
||||
Do3ThinkCamera do3ThinkCamera2 = new Do3ThinkCamera();
|
||||
do3ThinkCamera2.dvpStreamFormat = dvpStreamFormat.S_RGB24;
|
||||
do3ThinkCamera2.CameraName = $"Cam{i}";
|
||||
Cameras.Add(do3ThinkCamera2);
|
||||
do3ThinkCamera2.CameraConnect();
|
||||
do3ThinkCamera2.OnHImageOutput += OnCameraHImageOutput;
|
||||
Do3ThinkCamera cam = new Do3ThinkCamera();
|
||||
if (i == 1)
|
||||
{
|
||||
cam.dvpStreamFormat = dvpStreamFormat.S_RAW8;
|
||||
}
|
||||
else
|
||||
{
|
||||
cam.dvpStreamFormat = dvpStreamFormat.S_RGB24;
|
||||
}
|
||||
|
||||
cam.CameraName = $"Cam{i}";
|
||||
Cameras.Add(cam);
|
||||
cam.CameraConnect();
|
||||
cam.OnHImageOutput += OnCameraHImageOutput;
|
||||
}
|
||||
|
||||
|
||||
@ -476,7 +484,7 @@ namespace DHSoftware
|
||||
InitialHalconTools();
|
||||
|
||||
//深度学习模型加载
|
||||
bool resultOK =InitialSimboMLEnginesAsync();
|
||||
bool resultOK = InitialSimboMLEnginesAsync();
|
||||
if (resultOK)
|
||||
{
|
||||
//初始化失败
|
||||
@ -485,20 +493,28 @@ namespace DHSoftware
|
||||
//位置比较卡
|
||||
|
||||
sLDMotion.AxisSettings = new List<AxisSetting>();
|
||||
AxisSetting axis1=new AxisSetting();
|
||||
AxisSetting axis1 = new AxisSetting();
|
||||
axis1.AxisIndex = 0;
|
||||
axis1.AxisName = "转盘1";
|
||||
axis1.IsAxisEnabled = true;
|
||||
//axis1.AlarmLogic = AxisDirection.Positive;
|
||||
sLDMotion.IODefinitionCollection=new List<IODefinition>();
|
||||
sLDMotion.IODefinitionCollection = new List<IODefinition>();
|
||||
Motion(sLDMotion.IODefinitionCollection);
|
||||
|
||||
|
||||
|
||||
sLDMotion.SnapshotSettings = new List<SnapshotSetting>();
|
||||
int[] cameraPositions = { 7613, 24161, 33608, 39702, 45701 };
|
||||
int[] cameraPositions = { 24161, 33608, 39702, 45701 };
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
|
||||
sLDMotion.SnapshotSettings.Add(new SnapshotSetting
|
||||
{
|
||||
IsEnabled = true,
|
||||
CameraIO = sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == 13),
|
||||
CameraPosition = 7613,
|
||||
StationNumber = 0
|
||||
});
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
sLDMotion.SnapshotSettings.Add(new SnapshotSetting
|
||||
{
|
||||
@ -513,17 +529,20 @@ namespace DHSoftware
|
||||
|
||||
sLDMotion.BlowSettings = new List<BlowSetting>();
|
||||
int[] BlowPositions = { 61353, 68566 };
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
sLDMotion.BlowSettings.Add(new BlowSetting
|
||||
{
|
||||
IsEnabled = true,
|
||||
BlowIO = sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == i),
|
||||
BlowPosition = BlowPositions[i],
|
||||
BlowIO = sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == 5),
|
||||
BlowPosition = BlowPositions[0],
|
||||
StationNumber = 0
|
||||
});
|
||||
sLDMotion.BlowSettings.Add(new BlowSetting
|
||||
{
|
||||
IsEnabled = true,
|
||||
BlowIO = sLDMotion.IODefinitionCollection.FirstOrDefault(t => t.IOType == IOType.OUTPUT && t.IOIndex == 6),
|
||||
BlowPosition = BlowPositions[1],
|
||||
StationNumber = 0
|
||||
});
|
||||
}
|
||||
|
||||
//SnapshotSetting sna1 = new SnapshotSetting();
|
||||
//sna1.IsEnabled = true;
|
||||
@ -536,6 +555,8 @@ namespace DHSoftware
|
||||
// sLDMotion.SnapshotSettings.Add(sna1);
|
||||
sLDMotion.AxisSettings.Add(axis1);
|
||||
sLDMotion.Init();
|
||||
sLDMotion.OnNewPieces -= MainMotion_NewPieces;
|
||||
sLDMotion.OnNewPieces += MainMotion_NewPieces;
|
||||
// sLDMotion.Start();
|
||||
|
||||
//PLC.IP = "192.168.6.6";
|
||||
@ -543,16 +564,17 @@ namespace DHSoftware
|
||||
//PLC.PLCConnect();
|
||||
//PLC.OnNewPieces -= MainMotion_NewPieces;
|
||||
//PLC.OnNewPieces += MainMotion_NewPieces;
|
||||
ProductBaseCount = 2;
|
||||
ProductBaseCount = 8;
|
||||
for (int i = 0; i < ProductBaseCount * ProductListMulti; i++)
|
||||
{
|
||||
ConcurrentDictionary<uint, ProductData> products = new ConcurrentDictionary<uint, ProductData>();
|
||||
_productLists.Add(products);
|
||||
}
|
||||
sLDMotion.AxisStop();
|
||||
bool e=sLDMotion.CArdReset();
|
||||
sLDMotion.JOGRun(10000, 100000);
|
||||
startTime =DateTime.Now;
|
||||
bool e = sLDMotion.CArdReset();
|
||||
//转盘速度
|
||||
sLDMotion.JOGRun(14000, 100000);
|
||||
startTime = DateTime.Now;
|
||||
}
|
||||
public void Motion(List<IODefinition> iODefinitions)
|
||||
{
|
||||
@ -608,7 +630,8 @@ namespace DHSoftware
|
||||
_productLists[index][pieceNumber] = pData;
|
||||
}
|
||||
string logStr = $"时间:{DateTime.Now} 轴{axisIndex}新产品{pieceNumber}加入队列{index}----入料计数{PieceCount}\n";
|
||||
Task.Run(() => {
|
||||
Task.Run(() =>
|
||||
{
|
||||
this.BeginInvoke(new MethodInvoker(delegate () { richTextBox1.AppendText(logStr); }));
|
||||
|
||||
});
|
||||
@ -681,7 +704,7 @@ namespace DHSoftware
|
||||
else
|
||||
{
|
||||
//for (int i = 0; i < IConfig.CPUNums; i++)
|
||||
for (int i = 0; i <1; i++)
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
//var engine = SingleMLLoadModel(dc, false, i);
|
||||
var engine = SingleMLLoadModel(dc, false, i);
|
||||
@ -785,7 +808,7 @@ namespace DHSoftware
|
||||
if (!c.IsEnabled)
|
||||
return;
|
||||
|
||||
if(c.HalconAlgorithemPath_Pre!=null)
|
||||
if (c.HalconAlgorithemPath_Pre != null)
|
||||
LoadHalconTool(c.HalconAlgorithemPath_Pre);
|
||||
|
||||
});
|
||||
@ -817,7 +840,7 @@ namespace DHSoftware
|
||||
/// </summary>
|
||||
/// <param name="detectConfig"></param>
|
||||
/// <param name="detectResult"></param>
|
||||
public void PreTreated(DetectionConfig detectConfig, DetectStationResult detectResult,Mat MhImage)
|
||||
public void PreTreated(DetectionConfig detectConfig, DetectStationResult detectResult, Mat MhImage)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -923,6 +946,16 @@ namespace DHSoftware
|
||||
/// <param name="imageSet"></param>
|
||||
private void OnCameraHImageOutput(DateTime dt, CameraBase camera, Mat imageSet)
|
||||
{
|
||||
|
||||
//if (camera.CameraName.Equals("cam1", StringComparison.OrdinalIgnoreCase))
|
||||
//{
|
||||
// Console.WriteLine();
|
||||
//}
|
||||
//if (camera.CameraName.Equals("cam2", StringComparison.OrdinalIgnoreCase))
|
||||
//{
|
||||
// Console.WriteLine();
|
||||
//}
|
||||
|
||||
// 获取该相机的拍照计数
|
||||
uint productNumber = (uint)camera.SnapshotCount;
|
||||
|
||||
@ -950,7 +983,8 @@ namespace DHSoftware
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(20);
|
||||
// Thread.Sleep(20);
|
||||
await Task.Delay(20);
|
||||
}
|
||||
retryTimes--;
|
||||
}
|
||||
@ -967,6 +1001,23 @@ namespace DHSoftware
|
||||
|
||||
//LogAsync(DateTime.Now, LogLevel.Error, $"{camera.Name} 未找到产品,编号:{productNumber},队列{index}数量:{tmpDic.Count},列表:{pnStr}");
|
||||
localImageSet.Dispose();
|
||||
this.BeginInvoke(new MethodInvoker(delegate ()
|
||||
{
|
||||
|
||||
int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y;
|
||||
|
||||
richTextBox1.AppendText(productNumber + "提前推出" + camera.CameraName);
|
||||
|
||||
// 设置回原来的滚动位置
|
||||
richTextBox1.SelectionStart = richTextBox1.TextLength;
|
||||
richTextBox1.ScrollToCaret();
|
||||
}));
|
||||
//重新生成实例 销毁之前的实例
|
||||
|
||||
using (StreamWriter sw = new StreamWriter("D://123log.txt", true, Encoding.UTF8))
|
||||
{
|
||||
sw.WriteLine(productNumber + "提前推出" + camera.CameraName);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -976,6 +1027,23 @@ namespace DHSoftware
|
||||
{
|
||||
|
||||
localImageSet.Dispose();
|
||||
this.BeginInvoke(new MethodInvoker(delegate ()
|
||||
{
|
||||
|
||||
int currentScrollPosition = richTextBox1.GetPositionFromCharIndex(richTextBox1.TextLength).Y;
|
||||
|
||||
richTextBox1.AppendText(productNumber+"提前推出" + camera.CameraName);
|
||||
|
||||
// 设置回原来的滚动位置
|
||||
richTextBox1.SelectionStart = richTextBox1.TextLength;
|
||||
richTextBox1.ScrollToCaret();
|
||||
}));
|
||||
//重新生成实例 销毁之前的实例
|
||||
|
||||
using (StreamWriter sw = new StreamWriter("D://123log.txt", true, Encoding.UTF8))
|
||||
{
|
||||
sw.WriteLine(productNumber+"提前推出" + camera.CameraName);
|
||||
}
|
||||
// LogAsync(DateTime.Now, LogLevel.Warning, $"{camera.Name} 找到产品{productNumber},但是没有推理1");
|
||||
|
||||
return;
|
||||
@ -1062,14 +1130,14 @@ namespace DHSoftware
|
||||
req.ResizeHeight = (int)detectConfig.ModelHeight;
|
||||
// req.LabelNames = detectConfig.GetLabelNames();
|
||||
// req.Score = IIConfig.Score;
|
||||
|
||||
req.mImage = inferenceImage.Clone();
|
||||
|
||||
req.in_lable_path = detectConfig.in_lable_path;
|
||||
|
||||
req.confThreshold = detectConfig.ModelconfThreshold;
|
||||
req.iouThreshold = 0.3f;
|
||||
req.segmentWidth = 320;
|
||||
|
||||
req.out_node_name = "output0";
|
||||
switch (detectConfig.ModelType)
|
||||
{
|
||||
case MLModelType.ImageClassification:
|
||||
@ -1122,9 +1190,9 @@ namespace DHSoftware
|
||||
{
|
||||
pictureBox1.Image?.Dispose(); // 释放旧图像
|
||||
pictureBox1.Image = result.ResultMap;
|
||||
richTextBox1.AppendText($"推理成功 {productNumber}, {result.IsSuccess} 耗时 {mlWatch.ElapsedMilliseconds}ms\n");
|
||||
richTextBox1.AppendText($"推理成功 {productNumber}, {result.IsSuccess}相机名字{camera.CameraName} 耗时 {mlWatch.ElapsedMilliseconds}ms\n");
|
||||
}));
|
||||
req.mImage.Dispose();
|
||||
req.mImage?.Dispose();
|
||||
|
||||
|
||||
|
||||
@ -1247,13 +1315,7 @@ namespace DHSoftware
|
||||
|
||||
}
|
||||
|
||||
product.InferenceOne(() =>
|
||||
{
|
||||
;
|
||||
}, () =>
|
||||
{
|
||||
;
|
||||
});
|
||||
product.InferenceOne();
|
||||
|
||||
// LogAsync(DateTime.Now, LogLevel.Information, $"{camera.Name} 推理完成,产品{productNumber}");
|
||||
|
||||
@ -1397,18 +1459,19 @@ namespace DHSoftware
|
||||
Cameras.Clear();
|
||||
Dectection.Clear();
|
||||
// Add the code for the "停止" button click here
|
||||
PLC.TurntableStop();
|
||||
// PLC.TurntableStop();
|
||||
CurrentMachine = true;
|
||||
sLDMotion.Stop();
|
||||
}
|
||||
public int UPH=0;
|
||||
public int UPH = 0;
|
||||
public void CalculateOEE()
|
||||
{
|
||||
TimeSpan timeSpan = DateTime.Now - startTime;
|
||||
|
||||
UPH = (int)(ProductNum_Total / timeSpan.TotalHours) + 100;
|
||||
//UPM = (int)UPH / 60;
|
||||
this.BeginInvoke(new MethodInvoker(delegate () {
|
||||
this.BeginInvoke(new MethodInvoker(delegate ()
|
||||
{
|
||||
label1.Text = UPH.ToString();
|
||||
}));
|
||||
|
||||
|
44
DHSoftware/Views/CamConfigFrm.Designer.cs
generated
Normal file
44
DHSoftware/Views/CamConfigFrm.Designer.cs
generated
Normal file
@ -0,0 +1,44 @@
|
||||
namespace DHSoftware.Views
|
||||
{
|
||||
partial class CamConfigFrm
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
SuspendLayout();
|
||||
//
|
||||
// CamConfigFrm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Name = "CamConfigFrm";
|
||||
Size = new Size(869, 521);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
20
DHSoftware/Views/CamConfigFrm.cs
Normal file
20
DHSoftware/Views/CamConfigFrm.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DHSoftware.Views
|
||||
{
|
||||
public partial class CamConfigFrm : UserControl
|
||||
{
|
||||
public CamConfigFrm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
120
DHSoftware/Views/CamConfigFrm.resx
Normal file
120
DHSoftware/Views/CamConfigFrm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
44
DHSoftware/Views/UserConfigFrm.Designer.cs
generated
Normal file
44
DHSoftware/Views/UserConfigFrm.Designer.cs
generated
Normal file
@ -0,0 +1,44 @@
|
||||
namespace DHSoftware.Views
|
||||
{
|
||||
partial class UserConfigFrm
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
SuspendLayout();
|
||||
//
|
||||
// UserConfigFrm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 17F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
Name = "UserConfigFrm";
|
||||
Size = new Size(749, 536);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
20
DHSoftware/Views/UserConfigFrm.cs
Normal file
20
DHSoftware/Views/UserConfigFrm.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DHSoftware.Views
|
||||
{
|
||||
public partial class UserConfigFrm : UserControl
|
||||
{
|
||||
public UserConfigFrm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
120
DHSoftware/Views/UserConfigFrm.resx
Normal file
120
DHSoftware/Views/UserConfigFrm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -78,16 +78,16 @@ namespace DHSoftware
|
||||
}
|
||||
|
||||
|
||||
public void InferenceOne(Action preAction = null, Action postAction = null)
|
||||
public void InferenceOne()
|
||||
{
|
||||
//lock (_inferenceLock)
|
||||
//{
|
||||
// Interlocked.Decrement(ref InferenceLeft);
|
||||
//}
|
||||
|
||||
preAction?.Invoke();
|
||||
|
||||
_countdownEvent.Signal();
|
||||
postAction?.Invoke();
|
||||
|
||||
}
|
||||
|
||||
public bool InferenceFinished()
|
||||
|
Loading…
x
Reference in New Issue
Block a user