This commit is contained in:
liyaobang 2025-03-24 15:20:45 +08:00
commit 9973470e55
16 changed files with 332 additions and 216 deletions

View File

@ -2,6 +2,7 @@
using System.ComponentModel;
using System.Drawing.Imaging;
using AntdUI;
using DH.Commons.Enums;
using OpenCvSharp;
namespace DH.Commons.Base
@ -10,24 +11,26 @@ namespace DH.Commons.Base
{
// 私有字段 + 带通知的属性与DetectionLabel风格一致
private bool _isEnabled = false;
private bool _isallPicEnabled = true;//默认全画幅
private bool _isContinueMode = false;
private bool _isSavePicEnabled = false;
private string _imageSaveDirectory;
private EnumCamType _CamType;
private ImageFormat _imageFormat = ImageFormat.Jpeg;
private bool _isHardwareTrigger = false;
private bool _isHardwareTrigger = true;
private string _serialNumber = string.Empty;
private string _cameraName = string.Empty;
private string _cameraIP = string.Empty;
private string _computerIP = string.Empty;
private bool _isDirectHardwareTrigger = false;
private float _gain = -1;
private float _gain =6;
private float _rotateImage = 0;
private float _exposure = 200;
private float _triggerDelay = 0;
private decimal _roiX = 0;
private decimal _roiY = 0;
private decimal _roiW = 0;
private decimal _roiH = 0;
private decimal _roiW = 2448;
private decimal _roiH = 2048;
private int _lineDebouncerTime = 0;
public volatile int SnapshotCount = 0;
@ -56,7 +59,16 @@ namespace DH.Commons.Base
OnPropertyChanged(nameof(IsEnabled));
}
}
public virtual bool IsAllPicEnabled
{
get => _isallPicEnabled;
set
{
if (_isallPicEnabled == value) return;
_isallPicEnabled = value;
OnPropertyChanged(nameof(IsAllPicEnabled));
}
}
public virtual bool IsSavePicEnabled
{
get => _isSavePicEnabled;
@ -95,6 +107,19 @@ namespace DH.Commons.Base
OnPropertyChanged(nameof(ImageFormat));
}
}
[Category("设备配置")]
[DisplayName("相机类型")]
[Description("相机类型")]
public EnumCamType CamType
{
get => _CamType;
set
{
if (_CamType == value) return;
_CamType = value;
OnPropertyChanged(nameof(CamType));
}
}
[Category("采图模式")]
[DisplayName("硬触发")]

View File

@ -932,8 +932,8 @@ namespace DH.Commons.Base
private bool _selected = false;
private string _labelId;
private string _labelName;
private double _maxSource;
private double _minSource;
private double _maxScore;
private double _minScore;
private double _maxArea;
private double _minArea;
private ResultState _resultState = ResultState.ResultTBD;
@ -976,25 +976,25 @@ namespace DH.Commons.Base
}
}
public double MaxSource
public double MaxScore
{
get { return _maxSource; }
get { return _maxScore; }
set
{
if (_maxSource.Equals(value)) return;
_maxSource = value;
OnPropertyChanged(nameof(MaxSource));
if (_maxScore.Equals(value)) return;
_maxScore = value;
OnPropertyChanged(nameof(MaxScore));
}
}
public double MinSource
public double MinScore
{
get { return _minSource; }
get { return _minScore; }
set
{
if (_minSource.Equals(value)) return;
_minSource = value;
OnPropertyChanged(nameof(MinSource));
if (_minScore.Equals(value)) return;
_minScore = value;
OnPropertyChanged(nameof(MinScore));
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DH.Commons.Base
{
internal class GloablConfig
{
}
}

View File

@ -36,7 +36,14 @@ namespace DH.Commons.Enums
infernce
}
public enum EnumCamType
{
[Description("度申相机")]
Do3think = 0,
[Description("海康相机")]
hik ,
}
public enum EnumPLCType
@ -93,7 +100,11 @@ namespace DH.Commons.Enums
=27,
=28,
=29,
=30
=30,
,
,
}

View File

@ -52,15 +52,23 @@
button3 = new AntdUI.Button();
sthPic = new AntdUI.Switch();
label6 = new AntdUI.Label();
label8 = new AntdUI.Label();
label9 = new AntdUI.Label();
label10 = new AntdUI.Label();
label11 = new AntdUI.Label();
sthAllPic = new AntdUI.Switch();
label12 = new AntdUI.Label();
sltCamType = new AntdUI.Select();
label13 = new AntdUI.Label();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
SuspendLayout();
//
// swhEnable
//
swhEnable.CheckedText = "启用";
swhEnable.Location = new Point(84, 13);
swhEnable.Location = new Point(93, 13);
swhEnable.Name = "swhEnable";
swhEnable.Size = new Size(93, 33);
swhEnable.Size = new Size(94, 33);
swhEnable.TabIndex = 13;
swhEnable.UnCheckedText = "关闭";
//
@ -74,123 +82,123 @@
//
// label1
//
label1.Location = new Point(28, 114);
label1.Location = new Point(28, 140);
label1.Name = "label1";
label1.Size = new Size(59, 23);
label1.Size = new Size(59, 36);
label1.TabIndex = 14;
label1.Text = "曝 光";
//
// label2
//
label2.Location = new Point(28, 156);
label2.Location = new Point(28, 183);
label2.Name = "label2";
label2.Size = new Size(59, 23);
label2.Size = new Size(59, 36);
label2.TabIndex = 15;
label2.Text = "增 益";
//
// label3
//
label3.Location = new Point(28, 198);
label3.Location = new Point(28, 226);
label3.Name = "label3";
label3.Size = new Size(59, 23);
label3.Size = new Size(59, 36);
label3.TabIndex = 16;
label3.Text = "旋转角度";
//
// iptExposure
//
iptExposure.Location = new Point(84, 100);
iptExposure.Location = new Point(93, 140);
iptExposure.Name = "iptExposure";
iptExposure.Size = new Size(93, 37);
iptExposure.Size = new Size(94, 36);
iptExposure.TabIndex = 17;
iptExposure.Tag = "";
iptExposure.Text = "0";
//
// iptGain
//
iptGain.Location = new Point(84, 143);
iptGain.Location = new Point(93, 183);
iptGain.Name = "iptGain";
iptGain.Size = new Size(93, 37);
iptGain.Size = new Size(94, 36);
iptGain.TabIndex = 18;
iptGain.Text = "0";
//
// iptRevolve
//
iptRevolve.Location = new Point(84, 186);
iptRevolve.Location = new Point(93, 226);
iptRevolve.Name = "iptRevolve";
iptRevolve.Size = new Size(93, 37);
iptRevolve.Size = new Size(94, 36);
iptRevolve.TabIndex = 19;
iptRevolve.Text = "0";
//
// label4
//
label4.Location = new Point(28, 242);
label4.Location = new Point(28, 269);
label4.Name = "label4";
label4.Size = new Size(59, 23);
label4.Size = new Size(59, 36);
label4.TabIndex = 20;
label4.Text = "采图模式";
//
// sltAcquisitionMode
//
sltAcquisitionMode.List = true;
sltAcquisitionMode.Location = new Point(84, 229);
sltAcquisitionMode.Location = new Point(93, 269);
sltAcquisitionMode.Name = "sltAcquisitionMode";
sltAcquisitionMode.Size = new Size(93, 36);
sltAcquisitionMode.Size = new Size(94, 36);
sltAcquisitionMode.TabIndex = 21;
//
// label5
//
label5.Location = new Point(28, 287);
label5.Location = new Point(28, 314);
label5.Name = "label5";
label5.Size = new Size(59, 23);
label5.Size = new Size(59, 36);
label5.TabIndex = 22;
label5.Text = "触发模式";
//
// sltTriggerMode
//
sltTriggerMode.List = true;
sltTriggerMode.Location = new Point(84, 274);
sltTriggerMode.Location = new Point(93, 314);
sltTriggerMode.Name = "sltTriggerMode";
sltTriggerMode.Size = new Size(93, 36);
sltTriggerMode.Size = new Size(94, 36);
sltTriggerMode.TabIndex = 26;
//
// label7
//
label7.Location = new Point(28, 397);
label7.Location = new Point(19, 476);
label7.Name = "label7";
label7.Size = new Size(59, 23);
label7.Size = new Size(29, 23);
label7.TabIndex = 28;
label7.Text = "ROI范围";
label7.Text = "ROI";
//
// iptROIW
//
iptROIW.Location = new Point(84, 414);
iptROIW.Location = new Point(93, 494);
iptROIW.Name = "iptROIW";
iptROIW.Size = new Size(93, 37);
iptROIW.Size = new Size(94, 37);
iptROIW.TabIndex = 31;
iptROIW.Text = "0";
//
// iptROIY
//
iptROIY.Location = new Point(84, 371);
iptROIY.Location = new Point(93, 451);
iptROIY.Name = "iptROIY";
iptROIY.Size = new Size(93, 37);
iptROIY.Size = new Size(94, 37);
iptROIY.TabIndex = 30;
iptROIY.Text = "0";
//
// iptROIX
//
iptROIX.Location = new Point(84, 328);
iptROIX.Location = new Point(93, 408);
iptROIX.Name = "iptROIX";
iptROIX.Size = new Size(93, 37);
iptROIX.Size = new Size(94, 37);
iptROIX.TabIndex = 29;
iptROIX.Tag = "";
iptROIX.Text = "0";
//
// iptROIH
//
iptROIH.Location = new Point(84, 457);
iptROIH.Location = new Point(93, 537);
iptROIH.Name = "iptROIH";
iptROIH.Size = new Size(93, 37);
iptROIH.Size = new Size(94, 37);
iptROIH.TabIndex = 32;
iptROIH.Text = "0";
//
@ -199,7 +207,7 @@
pictureBox1.BorderStyle = BorderStyle.FixedSingle;
pictureBox1.Location = new Point(219, 23);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new Size(659, 429);
pictureBox1.Size = new Size(659, 489);
pictureBox1.TabIndex = 33;
pictureBox1.TabStop = false;
//
@ -210,7 +218,7 @@
btnSizeAdd.Ghost = true;
btnSizeAdd.IconRatio = 0F;
btnSizeAdd.IconSvg = "";
btnSizeAdd.Location = new Point(280, 458);
btnSizeAdd.Location = new Point(282, 532);
btnSizeAdd.Name = "btnSizeAdd";
btnSizeAdd.Size = new Size(80, 38);
btnSizeAdd.TabIndex = 34;
@ -223,7 +231,7 @@
button1.Ghost = true;
button1.IconRatio = 0F;
button1.IconSvg = "";
button1.Location = new Point(438, 458);
button1.Location = new Point(440, 532);
button1.Name = "button1";
button1.Size = new Size(80, 38);
button1.TabIndex = 35;
@ -236,7 +244,7 @@
button2.Ghost = true;
button2.IconRatio = 0F;
button2.IconSvg = "";
button2.Location = new Point(593, 458);
button2.Location = new Point(595, 532);
button2.Name = "button2";
button2.Size = new Size(80, 38);
button2.TabIndex = 36;
@ -249,7 +257,7 @@
button3.Ghost = true;
button3.IconRatio = 0F;
button3.IconSvg = "";
button3.Location = new Point(741, 458);
button3.Location = new Point(743, 532);
button3.Name = "button3";
button3.Size = new Size(80, 38);
button3.TabIndex = 37;
@ -258,9 +266,9 @@
// sthPic
//
sthPic.CheckedText = "启用";
sthPic.Location = new Point(84, 60);
sthPic.Location = new Point(93, 60);
sthPic.Name = "sthPic";
sthPic.Size = new Size(93, 33);
sthPic.Size = new Size(94, 33);
sthPic.TabIndex = 39;
sthPic.UnCheckedText = "关闭";
//
@ -272,10 +280,83 @@
label6.TabIndex = 38;
label6.Text = "相 机 图";
//
// label8
//
label8.Location = new Point(58, 408);
label8.Name = "label8";
label8.Size = new Size(29, 37);
label8.TabIndex = 40;
label8.Text = "X:";
//
// label9
//
label9.Location = new Point(58, 451);
label9.Name = "label9";
label9.Size = new Size(29, 37);
label9.TabIndex = 41;
label9.Text = "Y:";
//
// label10
//
label10.Location = new Point(43, 494);
label10.Name = "label10";
label10.Size = new Size(44, 37);
label10.TabIndex = 42;
label10.Text = "宽度:";
//
// label11
//
label11.Location = new Point(43, 538);
label11.Name = "label11";
label11.Size = new Size(44, 36);
label11.TabIndex = 43;
label11.Text = "高度:";
//
// sthAllPic
//
sthAllPic.CheckedText = "启用";
sthAllPic.Location = new Point(93, 356);
sthAllPic.Name = "sthAllPic";
sthAllPic.Size = new Size(94, 33);
sthAllPic.TabIndex = 45;
sthAllPic.UnCheckedText = "关闭";
//
// label12
//
label12.Location = new Point(28, 366);
label12.Name = "label12";
label12.Size = new Size(59, 23);
label12.TabIndex = 44;
label12.Text = "全 画 幅";
//
// sltCamType
//
sltCamType.List = true;
sltCamType.Location = new Point(93, 97);
sltCamType.Name = "sltCamType";
sltCamType.Size = new Size(94, 36);
sltCamType.TabIndex = 47;
//
// label13
//
label13.Location = new Point(28, 99);
label13.Name = "label13";
label13.Size = new Size(59, 36);
label13.TabIndex = 46;
label13.Text = "相机类型";
//
// CameraControl
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
Controls.Add(sltCamType);
Controls.Add(label13);
Controls.Add(sthAllPic);
Controls.Add(label12);
Controls.Add(label11);
Controls.Add(label10);
Controls.Add(label9);
Controls.Add(label8);
Controls.Add(sthPic);
Controls.Add(label6);
Controls.Add(button3);
@ -301,7 +382,7 @@
Controls.Add(swhEnable);
Controls.Add(label18);
Name = "CameraControl";
Size = new Size(909, 505);
Size = new Size(909, 601);
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
ResumeLayout(false);
}
@ -332,5 +413,13 @@
private AntdUI.Button button3;
private AntdUI.Switch sthPic;
private AntdUI.Label label6;
private AntdUI.Label label8;
private AntdUI.Label label9;
private AntdUI.Label label10;
private AntdUI.Label label11;
private AntdUI.Switch sthAllPic;
private AntdUI.Label label12;
private AntdUI.Select sltCamType;
private AntdUI.Label label13;
}
}

View File

@ -10,6 +10,8 @@ using System.Windows.Forms;
using AntdUI;
using DH.Commons.Base;
using DH.Commons.Enums;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Window = AntdUI.Window;
namespace DHSoftware.Views
{
@ -17,17 +19,42 @@ namespace DHSoftware.Views
{
Window window;
CameraBase CameraBase;
public CameraControl(Window _window,CameraBase cameraBase)
public CameraControl(Window _window, CameraBase cameraBase)
{
window= _window;
window = _window;
CameraBase = cameraBase;
InitializeComponent();
sltCamType.TextChanged += SltCamTpye_TextChanged;
InitData();
BindData();
}
private void SltCamTpye_TextChanged(object? sender, EventArgs e)
{
if (sender is Select slt && !string.IsNullOrEmpty(slt.Text))
{
// 将文本转换为枚举值
if (Enum.TryParse<EnumCamType>(slt.Text, out var plcType))
{
switch (plcType)
{
case EnumCamType.Do3think:
case EnumCamType.hik:
break;
default:
break;
}
}
else
{
}
}
}
private void SltAcquisitionMode_SelectedIndexChanged(object sender, IntEventArgs e)
@ -40,7 +67,7 @@ namespace DHSoftware.Views
case (int)CameraAcquisitionMode.:
sltTriggerMode.Enabled = true;
break;
default:
default:
break;
}
}
@ -48,10 +75,12 @@ namespace DHSoftware.Views
private void BindData()
{
sthPic.DataBindings.Add(nameof(sthPic.Checked), CameraBase, nameof(CameraBase.IsSavePicEnabled),
sltCamType.DataBindings.Add("Text", CameraBase, "CamType", true, DataSourceUpdateMode.OnPropertyChanged, "");
sthPic.DataBindings.Add(nameof(sthPic.Checked), CameraBase, nameof(CameraBase.IsSavePicEnabled),
true, DataSourceUpdateMode.OnPropertyChanged);
sthAllPic.DataBindings.Add(nameof(sthAllPic.Checked), CameraBase, nameof(CameraBase.IsAllPicEnabled),
true, DataSourceUpdateMode.OnPropertyChanged);
// 启用状态绑定
swhEnable.DataBindings.Add(nameof(swhEnable.Checked), CameraBase, nameof(CameraBase.IsEnabled),
true, DataSourceUpdateMode.OnPropertyChanged);
@ -89,6 +118,12 @@ namespace DHSoftware.Views
private void InitData()
{
// 获取枚举字段名列表(原描述改为字段名)
sltCamType.Items.Clear();
foreach (EnumCamType value in Enum.GetValues(typeof(EnumCamType)))
{
sltCamType.Items.Add(value.ToString());
}
// 初始化下拉框选项
sltAcquisitionMode.Items.AddRange(new[] { "连续模式", "触发模式" });
sltTriggerMode.Items.AddRange(new[] { "软触发", "硬触发" });
@ -97,5 +132,6 @@ namespace DHSoftware.Views
sltAcquisitionMode.SelectedIndex = CameraBase.IsContinueMode ? 0 : 1;
sltTriggerMode.SelectedIndex = CameraBase.IsHardwareTrigger ? 1 : 0;
}
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Microsoft ResX Schema
Version 2.0
@ -48,7 +48,7 @@
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

View File

@ -48,6 +48,8 @@ namespace AntdUIDemo.Views.Table
user.LabelDescription = input_name.Text;
user.ScoreMinValue =(double)input_minScore.Value;
user.ScoreMaxValue = (double)input_maxScore.Value;
user.AreaMinValue = (double)input_minArea.Value;
user.AreaMaxValue = (double)input_maxArea.Value;
submit = true;
this.Dispose();
}
@ -58,8 +60,8 @@ namespace AntdUIDemo.Views.Table
// input_addr.Text = user.Address;
input_minScore.Value =(decimal) user.ScoreMinValue;
input_maxScore.Value =(decimal) user.ScoreMaxValue;
input_minArea.Value =(decimal) user.ScoreMaxValue;
input_maxScore.Value =(decimal) user.ScoreMaxValue;
input_minArea.Value =(decimal) user.AreaMinValue;
input_maxArea.Value =(decimal) user.AreaMaxValue;
}
}
}

View File

@ -74,7 +74,7 @@ namespace DHSoftware.Views
{
InitializeComponent();
InitTableColumns();
InitData();
//InitData();
BindEventHandler();
foreach (var item in MLModelTypes)
{
@ -85,63 +85,6 @@ namespace DHSoftware.Views
}
public bool IsEnabled
{
get => switchEnable.AutoCheck;
set => switchEnable.AutoCheck = value;
}
// 模型路径属性
public string ModelPath
{
get => Detection.ModelPath;
set
{
Detection.ModelPath = value;
tbModelpath.Text = value; // 更新到文本框
}
}
public bool IsPicNGEnable
{
get => sthSaveNGPic.AutoCheck;
set => sthSaveNGPic.AutoCheck = value;
}
public bool IsPicEnable
{
get => sthPic.AutoCheck;
set => sthPic.AutoCheck = value;
}
//public MLModelType LModelType
//{
//}
private string _picTag;
public string picTag
{
get => _picTag;
set
{
_picTag = value;
}
}
private string _afterTag;
public string afterTag
{
get => _afterTag;
set
{
_afterTag = value;
}
}
private void InitTableColumns()
{
table_base.Columns = new ColumnCollection() {

View File

@ -95,7 +95,6 @@
tabs1.Pages.Add(tabPage1);
tabs1.Pages.Add(tabPage2);
tabs1.Pages.Add(tabPage3);
tabs1.SelectedIndex = 2;
tabs1.Size = new Size(915, 609);
tabs1.Style = styleLine1;
tabs1.TabIndex = 1;
@ -116,7 +115,7 @@
tabPage1.Controls.Add(label2);
tabPage1.Controls.Add(iptPrePath);
tabPage1.Controls.Add(label1);
tabPage1.Location = new Point(-909, -575);
tabPage1.Location = new Point(3, 31);
tabPage1.Name = "tabPage1";
tabPage1.Size = new Size(909, 575);
tabPage1.TabIndex = 0;
@ -550,7 +549,7 @@
// tabPage3
//
tabPage3.Controls.Add(tabPage4);
tabPage3.Location = new Point(3, 31);
tabPage3.Location = new Point(-909, -575);
tabPage3.Name = "tabPage3";
tabPage3.Size = new Size(909, 575);
tabPage3.TabIndex = 3;

View File

@ -603,9 +603,9 @@ namespace DHSoftware.Views
lableTable.Columns = new ColumnCollection() {
new ColumnCheck("Selected"){Fixed = true},
new Column("LabelName", "名称", ColumnAlign.Center),
new Column("MinSource", "最小得分",ColumnAlign.Center),
new Column("MaxArea", "最大得分", ColumnAlign.Center),
new Column("MinSource", "最小面积",ColumnAlign.Center),
new Column("MinScore", "最小得分",ColumnAlign.Center),
new Column("MaxScore", "最大得分", ColumnAlign.Center),
new Column("MinArea", "最小面积",ColumnAlign.Center),
new Column("MaxArea", "最大面积", ColumnAlign.Center),
new Column("ResultState", "结果", ColumnAlign.Center),
new Column("CellLinks", "操作", ColumnAlign.Center)

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Microsoft ResX Schema
Version 2.0
@ -48,7 +48,7 @@
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

View File

@ -49,8 +49,8 @@ namespace DHSoftware.Views
return;
}
detectionLable.LabelName = iptName.Text;
detectionLable.MinSource=Convert.ToDouble(iptMinSource.Text);
detectionLable.MaxSource = Convert.ToDouble(iptMaxSource.Text);
detectionLable.MinScore=Convert.ToDouble(iptMinSource.Text);
detectionLable.MaxScore = Convert.ToDouble(iptMaxSource.Text);
detectionLable.MinArea = Convert.ToDouble(iptMinArea.Text);
detectionLable.MaxArea = Convert.ToDouble(iptMaxArea.Text);
ResultState state = EnumHelper.GetEnumFromDescription<ResultState>(sltResultState.Text);
@ -84,8 +84,8 @@ namespace DHSoftware.Views
else
{
iptName.Text = detectionLable.LabelName;
iptMinSource.Text = detectionLable.MinSource.ToString();
iptMaxSource.Text = detectionLable.MaxSource.ToString();
iptMinSource.Text = detectionLable.MinScore.ToString();
iptMaxSource.Text = detectionLable.MaxScore.ToString();
iptMinArea.Text = detectionLable.MinArea.ToString();
iptMaxArea.Text = detectionLable.MaxArea.ToString();
sltResultState.Text= EnumHelper.GetEnumDescription(detectionLable.ResultState);

View File

@ -37,16 +37,10 @@
divider1 = new AntdUI.Divider();
label1 = new AntdUI.Label();
panel1 = new AntdUI.Panel();
sltDataType = new AntdUI.Select();
label3 = new AntdUI.Label();
iptAddress = new AntdUI.Input();
label7 = new AntdUI.Label();
stackPanel3 = new AntdUI.StackPanel();
iptEndIndex = new AntdUI.Input();
sltEnd = new AntdUI.Select();
label6 = new AntdUI.Label();
stackPanel2 = new AntdUI.StackPanel();
iptStartIndex = new AntdUI.Input();
sltStart = new AntdUI.Select();
label5 = new AntdUI.Label();
sltBoolValue = new AntdUI.Select();
@ -54,6 +48,12 @@
sltIntType = new AntdUI.Select();
iptValue = new AntdUI.Input();
label4 = new AntdUI.Label();
iptAddress = new AntdUI.Input();
label7 = new AntdUI.Label();
sltDataType = new AntdUI.Select();
label3 = new AntdUI.Label();
iptStartIndex = new AntdUI.InputNumber();
iptEndIndex = new AntdUI.InputNumber();
stackPanel1.SuspendLayout();
panel1.SuspendLayout();
stackPanel3.SuspendLayout();
@ -168,46 +168,6 @@
panel1.Size = new Size(445, 572);
panel1.TabIndex = 1;
panel1.Text = "panel1";
//
// sltDataType
//
sltDataType.Dock = DockStyle.Top;
sltDataType.List = true;
sltDataType.Location = new Point(18, 196);
sltDataType.Name = "sltDataType";
sltDataType.Size = new Size(409, 38);
sltDataType.TabIndex = 45;
//
// label3
//
label3.Dock = DockStyle.Top;
label3.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
label3.Location = new Point(18, 172);
label3.Name = "label3";
label3.Size = new Size(409, 24);
label3.TabIndex = 44;
label3.Text = "数据类型";
//
// iptAddress
//
iptAddress.Dock = DockStyle.Top;
iptAddress.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
iptAddress.Location = new Point(18, 258);
iptAddress.Name = "iptAddress";
iptAddress.Radius = 3;
iptAddress.Size = new Size(409, 38);
iptAddress.TabIndex = 54;
//
// label7
//
label7.Dock = DockStyle.Top;
label7.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
label7.Location = new Point(18, 234);
label7.Name = "label7";
label7.Size = new Size(409, 24);
label7.TabIndex = 53;
label7.Text = "地址";
//
// stackPanel3
//
@ -221,17 +181,6 @@
stackPanel3.TabIndex = 61;
stackPanel3.Text = "stackPanel3";
//
// iptEndIndex
//
iptEndIndex.Dock = DockStyle.Left;
iptEndIndex.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
iptEndIndex.Location = new Point(277, 3);
iptEndIndex.Name = "iptEndIndex";
iptEndIndex.PlaceholderText = "执行顺序标识(0开始)";
iptEndIndex.Radius = 3;
iptEndIndex.Size = new Size(132, 39);
iptEndIndex.TabIndex = 36;
//
// sltEnd
//
sltEnd.Dock = DockStyle.Left;
@ -264,17 +213,6 @@
stackPanel2.TabIndex = 59;
stackPanel2.Text = "stackPanel2";
//
// iptStartIndex
//
iptStartIndex.Dock = DockStyle.Left;
iptStartIndex.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
iptStartIndex.Location = new Point(277, 3);
iptStartIndex.Name = "iptStartIndex";
iptStartIndex.PlaceholderText = "执行顺序标识(0开始)";
iptStartIndex.Radius = 3;
iptStartIndex.Size = new Size(132, 39);
iptStartIndex.TabIndex = 36;
//
// sltStart
//
sltStart.Dock = DockStyle.Left;
@ -346,6 +284,67 @@
label4.TabIndex = 55;
label4.Text = "值";
//
// iptAddress
//
iptAddress.Dock = DockStyle.Top;
iptAddress.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
iptAddress.Location = new Point(18, 258);
iptAddress.Name = "iptAddress";
iptAddress.Radius = 3;
iptAddress.Size = new Size(409, 38);
iptAddress.TabIndex = 54;
//
// label7
//
label7.Dock = DockStyle.Top;
label7.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
label7.Location = new Point(18, 234);
label7.Name = "label7";
label7.Size = new Size(409, 24);
label7.TabIndex = 53;
label7.Text = "地址";
//
// sltDataType
//
sltDataType.Dock = DockStyle.Top;
sltDataType.List = true;
sltDataType.Location = new Point(18, 196);
sltDataType.Name = "sltDataType";
sltDataType.Size = new Size(409, 38);
sltDataType.TabIndex = 45;
//
// label3
//
label3.Dock = DockStyle.Top;
label3.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
label3.Location = new Point(18, 172);
label3.Name = "label3";
label3.Size = new Size(409, 24);
label3.TabIndex = 44;
label3.Text = "数据类型";
//
// iptStartIndex
//
iptStartIndex.Location = new Point(277, 3);
iptStartIndex.Maximum = new decimal(new int[] { 99999999, 0, 0, 0 });
iptStartIndex.Minimum = new decimal(new int[] { 2, 0, 0, int.MinValue });
iptStartIndex.Name = "iptStartIndex";
iptStartIndex.Size = new Size(129, 39);
iptStartIndex.TabIndex = 37;
iptStartIndex.Text = "-1";
iptStartIndex.Value = new decimal(new int[] { 1, 0, 0, int.MinValue });
//
// iptEndIndex
//
iptEndIndex.Location = new Point(277, 3);
iptEndIndex.Maximum = new decimal(new int[] { 99999999, 0, 0, 0 });
iptEndIndex.Minimum = new decimal(new int[] { 2, 0, 0, int.MinValue });
iptEndIndex.Name = "iptEndIndex";
iptEndIndex.Size = new Size(129, 39);
iptEndIndex.TabIndex = 38;
iptEndIndex.Text = "-1";
iptEndIndex.Value = new decimal(new int[] { 1, 0, 0, int.MinValue });
//
// MotionEdit
//
AutoScaleDimensions = new SizeF(7F, 17F);
@ -374,11 +373,9 @@
private AntdUI.Select sltDataType;
private AntdUI.Label label3;
private AntdUI.StackPanel stackPanel3;
private AntdUI.Input iptEndIndex;
private AntdUI.Select sltEnd;
private AntdUI.Label label6;
private AntdUI.StackPanel stackPanel2;
private AntdUI.Input iptStartIndex;
private AntdUI.Select sltStart;
private AntdUI.Label label5;
private AntdUI.Select sltBoolValue;
@ -388,5 +385,7 @@
private AntdUI.Label label4;
private AntdUI.Input iptAddress;
private AntdUI.Label label7;
private AntdUI.InputNumber iptStartIndex;
private AntdUI.InputNumber iptEndIndex;
}
}

View File

@ -73,9 +73,9 @@ namespace DHSoftware.Views
plcItem.Value = sltDataType.SelectedIndex == 2 ? sltBoolValue.Text : iptValue.Text;
plcItem.NumTpye = sltDataType.SelectedIndex == 2 ? string.Empty : sltIntType.Text;
plcItem.StartExecute = sltStart.Text == "执行" ? true : false;
plcItem.StartIndex = sltStart.Text == "执行" ? Convert.ToInt32(iptStartIndex.Text) : -1;
plcItem.StartIndex = sltStart.Text == "执行" ? Convert.ToInt32(iptStartIndex.Value) : -1;
plcItem.EndExecute = sltEnd.Text == "执行" ? true : false;
plcItem.EndIndex = sltEnd.Text == "执行" ? Convert.ToInt32(iptEndIndex.Text) : -1;
plcItem.EndIndex = sltEnd.Text == "执行" ? Convert.ToInt32(iptEndIndex.Value) : -1;
submit = true;
this.Dispose();
@ -113,8 +113,8 @@ namespace DHSoftware.Views
sltIntType.SelectedValue = sltDataType.SelectedIndex == 2 ? string.Empty : plcItem.NumTpye;
sltStart.SelectedValue = plcItem.StartExecute == true ? "执行" : "取消";
sltEnd.SelectedValue = plcItem.EndExecute == true ? "执行" : "取消";
iptStartIndex.Text = plcItem.StartExecute == true ? plcItem.StartIndex.ToString() : "-1";
iptEndIndex.Text = plcItem.EndExecute == true ? plcItem.EndIndex.ToString() : "-1";
iptStartIndex.Value = plcItem.StartExecute == true ? plcItem.StartIndex : -1;
iptEndIndex.Value = plcItem.EndExecute == true ? plcItem.EndIndex : -1;
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Microsoft ResX Schema
Version 2.0
@ -48,7 +48,7 @@
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