修改一点界面

This commit is contained in:
xhm\HP 2025-03-22 16:16:34 +08:00
parent f0f88624ae
commit 8aec9ba7fa
8 changed files with 247 additions and 119 deletions

View File

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

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

View File

@ -56,6 +56,10 @@
label9 = new AntdUI.Label(); label9 = new AntdUI.Label();
label10 = new AntdUI.Label(); label10 = new AntdUI.Label();
label11 = 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(); ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
SuspendLayout(); SuspendLayout();
// //
@ -78,88 +82,88 @@
// //
// label1 // label1
// //
label1.Location = new Point(28, 114); label1.Location = new Point(28, 140);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new Size(59, 23); label1.Size = new Size(59, 36);
label1.TabIndex = 14; label1.TabIndex = 14;
label1.Text = "曝 光"; label1.Text = "曝 光";
// //
// label2 // label2
// //
label2.Location = new Point(28, 156); label2.Location = new Point(28, 183);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new Size(59, 23); label2.Size = new Size(59, 36);
label2.TabIndex = 15; label2.TabIndex = 15;
label2.Text = "增 益"; label2.Text = "增 益";
// //
// label3 // label3
// //
label3.Location = new Point(28, 198); label3.Location = new Point(28, 226);
label3.Name = "label3"; label3.Name = "label3";
label3.Size = new Size(59, 23); label3.Size = new Size(59, 36);
label3.TabIndex = 16; label3.TabIndex = 16;
label3.Text = "旋转角度"; label3.Text = "旋转角度";
// //
// iptExposure // iptExposure
// //
iptExposure.Location = new Point(93, 100); iptExposure.Location = new Point(93, 140);
iptExposure.Name = "iptExposure"; iptExposure.Name = "iptExposure";
iptExposure.Size = new Size(94, 37); iptExposure.Size = new Size(94, 36);
iptExposure.TabIndex = 17; iptExposure.TabIndex = 17;
iptExposure.Tag = ""; iptExposure.Tag = "";
iptExposure.Text = "0"; iptExposure.Text = "0";
// //
// iptGain // iptGain
// //
iptGain.Location = new Point(93, 143); iptGain.Location = new Point(93, 183);
iptGain.Name = "iptGain"; iptGain.Name = "iptGain";
iptGain.Size = new Size(94, 37); iptGain.Size = new Size(94, 36);
iptGain.TabIndex = 18; iptGain.TabIndex = 18;
iptGain.Text = "0"; iptGain.Text = "0";
// //
// iptRevolve // iptRevolve
// //
iptRevolve.Location = new Point(93, 186); iptRevolve.Location = new Point(93, 226);
iptRevolve.Name = "iptRevolve"; iptRevolve.Name = "iptRevolve";
iptRevolve.Size = new Size(94, 37); iptRevolve.Size = new Size(94, 36);
iptRevolve.TabIndex = 19; iptRevolve.TabIndex = 19;
iptRevolve.Text = "0"; iptRevolve.Text = "0";
// //
// label4 // label4
// //
label4.Location = new Point(28, 242); label4.Location = new Point(28, 269);
label4.Name = "label4"; label4.Name = "label4";
label4.Size = new Size(59, 23); label4.Size = new Size(59, 36);
label4.TabIndex = 20; label4.TabIndex = 20;
label4.Text = "采图模式"; label4.Text = "采图模式";
// //
// sltAcquisitionMode // sltAcquisitionMode
// //
sltAcquisitionMode.List = true; sltAcquisitionMode.List = true;
sltAcquisitionMode.Location = new Point(93, 229); sltAcquisitionMode.Location = new Point(93, 269);
sltAcquisitionMode.Name = "sltAcquisitionMode"; sltAcquisitionMode.Name = "sltAcquisitionMode";
sltAcquisitionMode.Size = new Size(94, 36); sltAcquisitionMode.Size = new Size(94, 36);
sltAcquisitionMode.TabIndex = 21; sltAcquisitionMode.TabIndex = 21;
// //
// label5 // label5
// //
label5.Location = new Point(28, 287); label5.Location = new Point(28, 314);
label5.Name = "label5"; label5.Name = "label5";
label5.Size = new Size(59, 23); label5.Size = new Size(59, 36);
label5.TabIndex = 22; label5.TabIndex = 22;
label5.Text = "触发模式"; label5.Text = "触发模式";
// //
// sltTriggerMode // sltTriggerMode
// //
sltTriggerMode.List = true; sltTriggerMode.List = true;
sltTriggerMode.Location = new Point(93, 274); sltTriggerMode.Location = new Point(93, 314);
sltTriggerMode.Name = "sltTriggerMode"; sltTriggerMode.Name = "sltTriggerMode";
sltTriggerMode.Size = new Size(94, 36); sltTriggerMode.Size = new Size(94, 36);
sltTriggerMode.TabIndex = 26; sltTriggerMode.TabIndex = 26;
// //
// label7 // label7
// //
label7.Location = new Point(19, 396); label7.Location = new Point(19, 476);
label7.Name = "label7"; label7.Name = "label7";
label7.Size = new Size(29, 23); label7.Size = new Size(29, 23);
label7.TabIndex = 28; label7.TabIndex = 28;
@ -167,7 +171,7 @@
// //
// iptROIW // iptROIW
// //
iptROIW.Location = new Point(93, 414); iptROIW.Location = new Point(93, 494);
iptROIW.Name = "iptROIW"; iptROIW.Name = "iptROIW";
iptROIW.Size = new Size(94, 37); iptROIW.Size = new Size(94, 37);
iptROIW.TabIndex = 31; iptROIW.TabIndex = 31;
@ -175,7 +179,7 @@
// //
// iptROIY // iptROIY
// //
iptROIY.Location = new Point(93, 371); iptROIY.Location = new Point(93, 451);
iptROIY.Name = "iptROIY"; iptROIY.Name = "iptROIY";
iptROIY.Size = new Size(94, 37); iptROIY.Size = new Size(94, 37);
iptROIY.TabIndex = 30; iptROIY.TabIndex = 30;
@ -183,7 +187,7 @@
// //
// iptROIX // iptROIX
// //
iptROIX.Location = new Point(93, 328); iptROIX.Location = new Point(93, 408);
iptROIX.Name = "iptROIX"; iptROIX.Name = "iptROIX";
iptROIX.Size = new Size(94, 37); iptROIX.Size = new Size(94, 37);
iptROIX.TabIndex = 29; iptROIX.TabIndex = 29;
@ -192,7 +196,7 @@
// //
// iptROIH // iptROIH
// //
iptROIH.Location = new Point(93, 457); iptROIH.Location = new Point(93, 537);
iptROIH.Name = "iptROIH"; iptROIH.Name = "iptROIH";
iptROIH.Size = new Size(94, 37); iptROIH.Size = new Size(94, 37);
iptROIH.TabIndex = 32; iptROIH.TabIndex = 32;
@ -203,7 +207,7 @@
pictureBox1.BorderStyle = BorderStyle.FixedSingle; pictureBox1.BorderStyle = BorderStyle.FixedSingle;
pictureBox1.Location = new Point(219, 23); pictureBox1.Location = new Point(219, 23);
pictureBox1.Name = "pictureBox1"; pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new Size(659, 429); pictureBox1.Size = new Size(659, 489);
pictureBox1.TabIndex = 33; pictureBox1.TabIndex = 33;
pictureBox1.TabStop = false; pictureBox1.TabStop = false;
// //
@ -214,7 +218,7 @@
btnSizeAdd.Ghost = true; btnSizeAdd.Ghost = true;
btnSizeAdd.IconRatio = 0F; btnSizeAdd.IconRatio = 0F;
btnSizeAdd.IconSvg = ""; btnSizeAdd.IconSvg = "";
btnSizeAdd.Location = new Point(280, 458); btnSizeAdd.Location = new Point(282, 532);
btnSizeAdd.Name = "btnSizeAdd"; btnSizeAdd.Name = "btnSizeAdd";
btnSizeAdd.Size = new Size(80, 38); btnSizeAdd.Size = new Size(80, 38);
btnSizeAdd.TabIndex = 34; btnSizeAdd.TabIndex = 34;
@ -227,7 +231,7 @@
button1.Ghost = true; button1.Ghost = true;
button1.IconRatio = 0F; button1.IconRatio = 0F;
button1.IconSvg = ""; button1.IconSvg = "";
button1.Location = new Point(438, 458); button1.Location = new Point(440, 532);
button1.Name = "button1"; button1.Name = "button1";
button1.Size = new Size(80, 38); button1.Size = new Size(80, 38);
button1.TabIndex = 35; button1.TabIndex = 35;
@ -240,7 +244,7 @@
button2.Ghost = true; button2.Ghost = true;
button2.IconRatio = 0F; button2.IconRatio = 0F;
button2.IconSvg = ""; button2.IconSvg = "";
button2.Location = new Point(593, 458); button2.Location = new Point(595, 532);
button2.Name = "button2"; button2.Name = "button2";
button2.Size = new Size(80, 38); button2.Size = new Size(80, 38);
button2.TabIndex = 36; button2.TabIndex = 36;
@ -253,7 +257,7 @@
button3.Ghost = true; button3.Ghost = true;
button3.IconRatio = 0F; button3.IconRatio = 0F;
button3.IconSvg = ""; button3.IconSvg = "";
button3.Location = new Point(741, 458); button3.Location = new Point(743, 532);
button3.Name = "button3"; button3.Name = "button3";
button3.Size = new Size(80, 38); button3.Size = new Size(80, 38);
button3.TabIndex = 37; button3.TabIndex = 37;
@ -278,7 +282,7 @@
// //
// label8 // label8
// //
label8.Location = new Point(58, 328); label8.Location = new Point(58, 408);
label8.Name = "label8"; label8.Name = "label8";
label8.Size = new Size(29, 37); label8.Size = new Size(29, 37);
label8.TabIndex = 40; label8.TabIndex = 40;
@ -286,7 +290,7 @@
// //
// label9 // label9
// //
label9.Location = new Point(58, 371); label9.Location = new Point(58, 451);
label9.Name = "label9"; label9.Name = "label9";
label9.Size = new Size(29, 37); label9.Size = new Size(29, 37);
label9.TabIndex = 41; label9.TabIndex = 41;
@ -294,7 +298,7 @@
// //
// label10 // label10
// //
label10.Location = new Point(43, 414); label10.Location = new Point(43, 494);
label10.Name = "label10"; label10.Name = "label10";
label10.Size = new Size(44, 37); label10.Size = new Size(44, 37);
label10.TabIndex = 42; label10.TabIndex = 42;
@ -302,16 +306,53 @@
// //
// label11 // label11
// //
label11.Location = new Point(43, 458); label11.Location = new Point(43, 538);
label11.Name = "label11"; label11.Name = "label11";
label11.Size = new Size(44, 36); label11.Size = new Size(44, 36);
label11.TabIndex = 43; label11.TabIndex = 43;
label11.Text = "高度:"; 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 // CameraControl
// //
AutoScaleDimensions = new SizeF(7F, 17F); AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
Controls.Add(sltCamType);
Controls.Add(label13);
Controls.Add(sthAllPic);
Controls.Add(label12);
Controls.Add(label11); Controls.Add(label11);
Controls.Add(label10); Controls.Add(label10);
Controls.Add(label9); Controls.Add(label9);
@ -341,7 +382,7 @@
Controls.Add(swhEnable); Controls.Add(swhEnable);
Controls.Add(label18); Controls.Add(label18);
Name = "CameraControl"; Name = "CameraControl";
Size = new Size(909, 505); Size = new Size(909, 601);
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
ResumeLayout(false); ResumeLayout(false);
} }
@ -376,5 +417,9 @@
private AntdUI.Label label9; private AntdUI.Label label9;
private AntdUI.Label label10; private AntdUI.Label label10;
private AntdUI.Label label11; 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 AntdUI;
using DH.Commons.Base; using DH.Commons.Base;
using DH.Commons.Enums; using DH.Commons.Enums;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Window = AntdUI.Window;
namespace DHSoftware.Views namespace DHSoftware.Views
{ {
@ -23,11 +25,36 @@ namespace DHSoftware.Views
CameraBase = cameraBase; CameraBase = cameraBase;
InitializeComponent(); InitializeComponent();
sltCamType.TextChanged += SltCamTpye_TextChanged;
InitData(); InitData();
BindData(); 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) private void SltAcquisitionMode_SelectedIndexChanged(object sender, IntEventArgs e)
@ -49,9 +76,11 @@ namespace DHSoftware.Views
private void BindData() private void BindData()
{ {
sltCamType.DataBindings.Add("Text", CameraBase, "CamType", true, DataSourceUpdateMode.OnPropertyChanged, "");
sthPic.DataBindings.Add(nameof(sthPic.Checked), CameraBase, nameof(CameraBase.IsSavePicEnabled), sthPic.DataBindings.Add(nameof(sthPic.Checked), CameraBase, nameof(CameraBase.IsSavePicEnabled),
true, DataSourceUpdateMode.OnPropertyChanged); 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), swhEnable.DataBindings.Add(nameof(swhEnable.Checked), CameraBase, nameof(CameraBase.IsEnabled),
true, DataSourceUpdateMode.OnPropertyChanged); true, DataSourceUpdateMode.OnPropertyChanged);
@ -89,6 +118,12 @@ namespace DHSoftware.Views
private void InitData() private void InitData()
{ {
// 获取枚举字段名列表(原描述改为字段名)
sltCamType.Items.Clear();
foreach (EnumCamType value in Enum.GetValues(typeof(EnumCamType)))
{
sltCamType.Items.Add(value.ToString());
}
// 初始化下拉框选项 // 初始化下拉框选项
sltAcquisitionMode.Items.AddRange(new[] { "连续模式", "触发模式" }); sltAcquisitionMode.Items.AddRange(new[] { "连续模式", "触发模式" });
sltTriggerMode.Items.AddRange(new[] { "软触发", "硬触发" }); sltTriggerMode.Items.AddRange(new[] { "软触发", "硬触发" });
@ -97,5 +132,6 @@ namespace DHSoftware.Views
sltAcquisitionMode.SelectedIndex = CameraBase.IsContinueMode ? 0 : 1; sltAcquisitionMode.SelectedIndex = CameraBase.IsContinueMode ? 0 : 1;
sltTriggerMode.SelectedIndex = CameraBase.IsHardwareTrigger ? 1 : 0; sltTriggerMode.SelectedIndex = CameraBase.IsHardwareTrigger ? 1 : 0;
} }
} }
} }

View File

@ -37,16 +37,10 @@
divider1 = new AntdUI.Divider(); divider1 = new AntdUI.Divider();
label1 = new AntdUI.Label(); label1 = new AntdUI.Label();
panel1 = new AntdUI.Panel(); panel1 = new AntdUI.Panel();
sltDataType = new AntdUI.Select();
label3 = new AntdUI.Label();
iptAddress = new AntdUI.Input();
label7 = new AntdUI.Label();
stackPanel3 = new AntdUI.StackPanel(); stackPanel3 = new AntdUI.StackPanel();
iptEndIndex = new AntdUI.Input();
sltEnd = new AntdUI.Select(); sltEnd = new AntdUI.Select();
label6 = new AntdUI.Label(); label6 = new AntdUI.Label();
stackPanel2 = new AntdUI.StackPanel(); stackPanel2 = new AntdUI.StackPanel();
iptStartIndex = new AntdUI.Input();
sltStart = new AntdUI.Select(); sltStart = new AntdUI.Select();
label5 = new AntdUI.Label(); label5 = new AntdUI.Label();
sltBoolValue = new AntdUI.Select(); sltBoolValue = new AntdUI.Select();
@ -54,6 +48,12 @@
sltIntType = new AntdUI.Select(); sltIntType = new AntdUI.Select();
iptValue = new AntdUI.Input(); iptValue = new AntdUI.Input();
label4 = new AntdUI.Label(); 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(); stackPanel1.SuspendLayout();
panel1.SuspendLayout(); panel1.SuspendLayout();
stackPanel3.SuspendLayout(); stackPanel3.SuspendLayout();
@ -168,46 +168,6 @@
panel1.Size = new Size(445, 572); panel1.Size = new Size(445, 572);
panel1.TabIndex = 1; panel1.TabIndex = 1;
panel1.Text = "panel1"; 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 // stackPanel3
// //
@ -221,17 +181,6 @@
stackPanel3.TabIndex = 61; stackPanel3.TabIndex = 61;
stackPanel3.Text = "stackPanel3"; 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
// //
sltEnd.Dock = DockStyle.Left; sltEnd.Dock = DockStyle.Left;
@ -264,17 +213,6 @@
stackPanel2.TabIndex = 59; stackPanel2.TabIndex = 59;
stackPanel2.Text = "stackPanel2"; 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
// //
sltStart.Dock = DockStyle.Left; sltStart.Dock = DockStyle.Left;
@ -346,6 +284,67 @@
label4.TabIndex = 55; label4.TabIndex = 55;
label4.Text = "值"; 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 // MotionEdit
// //
AutoScaleDimensions = new SizeF(7F, 17F); AutoScaleDimensions = new SizeF(7F, 17F);
@ -374,11 +373,9 @@
private AntdUI.Select sltDataType; private AntdUI.Select sltDataType;
private AntdUI.Label label3; private AntdUI.Label label3;
private AntdUI.StackPanel stackPanel3; private AntdUI.StackPanel stackPanel3;
private AntdUI.Input iptEndIndex;
private AntdUI.Select sltEnd; private AntdUI.Select sltEnd;
private AntdUI.Label label6; private AntdUI.Label label6;
private AntdUI.StackPanel stackPanel2; private AntdUI.StackPanel stackPanel2;
private AntdUI.Input iptStartIndex;
private AntdUI.Select sltStart; private AntdUI.Select sltStart;
private AntdUI.Label label5; private AntdUI.Label label5;
private AntdUI.Select sltBoolValue; private AntdUI.Select sltBoolValue;
@ -388,5 +385,7 @@
private AntdUI.Label label4; private AntdUI.Label label4;
private AntdUI.Input iptAddress; private AntdUI.Input iptAddress;
private AntdUI.Label label7; 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.Value = sltDataType.SelectedIndex == 2 ? sltBoolValue.Text : iptValue.Text;
plcItem.NumTpye = sltDataType.SelectedIndex == 2 ? string.Empty : sltIntType.Text; plcItem.NumTpye = sltDataType.SelectedIndex == 2 ? string.Empty : sltIntType.Text;
plcItem.StartExecute = sltStart.Text == "执行" ? true : false; 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.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; submit = true;
this.Dispose(); this.Dispose();
@ -113,8 +113,8 @@ namespace DHSoftware.Views
sltIntType.SelectedValue = sltDataType.SelectedIndex == 2 ? string.Empty : plcItem.NumTpye; sltIntType.SelectedValue = sltDataType.SelectedIndex == 2 ? string.Empty : plcItem.NumTpye;
sltStart.SelectedValue = plcItem.StartExecute == true ? "执行" : "取消"; sltStart.SelectedValue = plcItem.StartExecute == true ? "执行" : "取消";
sltEnd.SelectedValue = plcItem.EndExecute == true ? "执行" : "取消"; sltEnd.SelectedValue = plcItem.EndExecute == true ? "执行" : "取消";
iptStartIndex.Text = plcItem.StartExecute == true ? plcItem.StartIndex.ToString() : "-1"; iptStartIndex.Value = plcItem.StartExecute == true ? plcItem.StartIndex : -1;
iptEndIndex.Text = plcItem.EndExecute == true ? plcItem.EndIndex.ToString() : "-1"; iptEndIndex.Value = plcItem.EndExecute == true ? plcItem.EndIndex : -1;
} }