|
|
|
|
using DevExpress.XtraLayout.Utils;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace ProductionSystem_UserControl.ExtendedControls
|
|
|
|
|
{
|
|
|
|
|
public partial class MyTestResultControl : UserControl
|
|
|
|
|
{
|
|
|
|
|
public MyTestResultControl()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
MaximumSize = new Size(236, 32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 自定义属性
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 参数名称
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Category("自定义属性"), Description("参数名称")]
|
|
|
|
|
public string LblItemText
|
|
|
|
|
{
|
|
|
|
|
get { return lblItemDesc.Text; }
|
|
|
|
|
set { lblItemDesc.Text = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否显示测试结果
|
|
|
|
|
/// </summary>
|
|
|
|
|
private bool _isShowTestResultTextEdit = true;
|
|
|
|
|
[Category("自定义属性"), Description("是否显示测试结果")]
|
|
|
|
|
public bool IsShowTestResultTextEdit
|
|
|
|
|
{
|
|
|
|
|
get { return layoutControlItem_TestResult.Visibility == LayoutVisibility.Always ? true : false; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_isShowTestResultTextEdit = value;
|
|
|
|
|
if (_isShowTestResultTextEdit)
|
|
|
|
|
{
|
|
|
|
|
layoutControlItem_TestResult.Visibility = LayoutVisibility.Always;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
layoutControlItem_TestResult.Visibility = LayoutVisibility.Never;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 测试结果
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string _testResultText = "";
|
|
|
|
|
[Category("自定义属性"), Description("测试结果")]
|
|
|
|
|
public string TestResultText
|
|
|
|
|
{
|
|
|
|
|
get { return txtTestResult.Text; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_testResultText = value;
|
|
|
|
|
txtTestResult.Text = _testResultText;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 测试结果字体颜色
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Category("自定义属性"), Description("测试结果字体颜色")]
|
|
|
|
|
public Color TestResultForeColor
|
|
|
|
|
{
|
|
|
|
|
get { return txtTestResult.ForeColor; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
txtTestResult.ForeColor = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 测试结果背景颜色
|
|
|
|
|
/// </summary>
|
|
|
|
|
private Color _testResultBackColor = Color.Gainsboro;
|
|
|
|
|
[Category("自定义属性"), Description("测试结果背景颜色")]
|
|
|
|
|
public Color TestResultBackColor
|
|
|
|
|
{
|
|
|
|
|
get { return txtTestResult.BackColor; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_testResultBackColor = value;
|
|
|
|
|
txtTestResult.BackColor = _testResultBackColor;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 测试结果PLC点位编码
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Category("自定义属性"), Description("测试结果PLC点位编码")]
|
|
|
|
|
public string TestResultPLCPointCode
|
|
|
|
|
{
|
|
|
|
|
get { return txtTestResult.Tag?.ToString(); }
|
|
|
|
|
set { txtTestResult.Tag = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否显示采集值
|
|
|
|
|
/// </summary>
|
|
|
|
|
private bool _isShowTestValTextEdit = true;
|
|
|
|
|
[Category("自定义属性"), Description("是否显示采集值")]
|
|
|
|
|
public bool IsShowTestValTextEdit
|
|
|
|
|
{
|
|
|
|
|
get { return layoutControlItem_TestVal.Visibility == LayoutVisibility.Always ? true : false; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_isShowTestValTextEdit = value;
|
|
|
|
|
if (_isShowTestValTextEdit)
|
|
|
|
|
{
|
|
|
|
|
layoutControlItem_TestVal.Visibility = LayoutVisibility.Always;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
layoutControlItem_TestVal.Visibility = LayoutVisibility.Never;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 采集值
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string _testValText = "";
|
|
|
|
|
[Category("自定义属性"), Description("采集值")]
|
|
|
|
|
public string TestValText
|
|
|
|
|
{
|
|
|
|
|
get { return txtTestVal.Text; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_testValText = value;
|
|
|
|
|
txtTestVal.Text = _testValText;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 采集值PLC点位编码
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Category("自定义属性"), Description("采集值PLC点位编码")]
|
|
|
|
|
public string TestValPLCPointCode
|
|
|
|
|
{
|
|
|
|
|
get { return txtTestVal.Tag?.ToString(); }
|
|
|
|
|
set { txtTestVal.Tag = value; }
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|