You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
183 lines
5.2 KiB
C#
183 lines
5.2 KiB
C#
using DevExpress.XtraLayout.Utils;
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace ProductionSystem_UserControl.ExtendedControls
|
|
{
|
|
public partial class MyParaControl : UserControl
|
|
{
|
|
public MyParaControl()
|
|
{
|
|
InitializeComponent();
|
|
MaximumSize = new Size(480, 50);
|
|
}
|
|
|
|
#region 自定义属性
|
|
|
|
/// <summary>
|
|
/// 参数编码
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("参数编码")]
|
|
public string LblItemCode
|
|
{
|
|
get { return lblItemDesc.Tag?.ToString(); }
|
|
set { lblItemDesc.Tag = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 参数名称
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("参数名称")]
|
|
public string LblItemText
|
|
{
|
|
get { return lblItemDesc.Text; }
|
|
set { lblItemDesc.Text = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 目标值
|
|
/// </summary>
|
|
private string _targetText = "";
|
|
[Category("自定义属性"), Description("目标值")]
|
|
public string TargetText
|
|
{
|
|
get { return txtTargetVal.Text; }
|
|
set
|
|
{
|
|
_targetText = value;
|
|
txtTargetVal.Text = _targetText;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 目标值PLC地址#目标值数据类型
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("目标值PLC地址#目标值数据类型")]
|
|
public string TargetPlcAddressTag
|
|
{
|
|
get { return txtTargetVal.Tag?.ToString(); }
|
|
set { txtTargetVal.Tag = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 目标值是否只读
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("目标值是否只读")]
|
|
public bool TargetValReadOnly
|
|
{
|
|
get { return txtTargetVal.ReadOnly; }
|
|
set { txtTargetVal.ReadOnly = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 上限值
|
|
/// </summary>
|
|
private string _maxText = "";
|
|
[Category("自定义属性"), Description("上限值")]
|
|
public string MaxText
|
|
{
|
|
get { return txtMaxVal.Text; }
|
|
set
|
|
{
|
|
_maxText = value;
|
|
txtMaxVal.Text = _maxText;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 下限值
|
|
/// </summary>
|
|
private string _minText = "";
|
|
[Category("自定义属性"), Description("下限值")]
|
|
public string MinText
|
|
{
|
|
get { return txtMinVal.Text; }
|
|
set
|
|
{
|
|
_minText = value;
|
|
txtMinVal.Text = _minText;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 上限PLC地址#上限数据类型
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("上限PLC地址#上限数据类型")]
|
|
public string MaxPlcAddressTag
|
|
{
|
|
get { return txtMaxVal.Tag?.ToString(); }
|
|
set { txtMaxVal.Tag = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 上限是否只读
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("上限是否只读")]
|
|
public bool MaxValReaOnly
|
|
{
|
|
get { return txtMaxVal.ReadOnly; }
|
|
set { txtMaxVal.ReadOnly = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 下限PLC地址#下限数据类型
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("下限PLC地址#下限数据类型")]
|
|
public string MinPlcAddressTag
|
|
{
|
|
get { return txtMinVal.Tag?.ToString(); }
|
|
set { txtMinVal.Tag = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 下限是否只读
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("下限是否只读")]
|
|
public bool MinValReadOnly
|
|
{
|
|
get { return txtMinVal.ReadOnly; }
|
|
set { txtMinVal.ReadOnly = value; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 是否显示复选框
|
|
/// </summary>
|
|
private bool _checkEditVisible = true;
|
|
[Category("自定义属性"), Description("是否显示复选框")]
|
|
public bool CheckEditVisible
|
|
{
|
|
get { return layoutControlItemCheck.Visibility == LayoutVisibility.Always ? true : false; }
|
|
set
|
|
{
|
|
_checkEditVisible = value;
|
|
if (_checkEditVisible)
|
|
{
|
|
layoutControlItemCheck.Visibility = LayoutVisibility.Always;
|
|
}
|
|
else
|
|
{
|
|
layoutControlItemCheck.Visibility = LayoutVisibility.Never;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 复选框选中状态
|
|
/// </summary>
|
|
[Category("自定义属性"), Description("复选框选中状态")]
|
|
private bool _ckIsActiveChecked = false;
|
|
public bool CkIsActiveChecked
|
|
{
|
|
get { return ckIsActive.Checked; }
|
|
set
|
|
{
|
|
_ckIsActiveChecked = value;
|
|
ckIsActive.Checked = _ckIsActiveChecked;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|