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.
lj_plc/Controls/Mesnac.Controls.Feeding/CombinedCbWeight.cs

323 lines
10 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Mesnac.Controls.Base;
namespace Mesnac.Controls.Feeding
{
/// <summary>
/// 组合炭黑秤
/// </summary>
[ToolboxBitmap(typeof(CombinedCbWeight), "ICONS.CBIMWeight.bmp")]//新添加的代码
public partial class CombinedCbWeight : FeedingControl
{
#region 事件定义
/// <summary>
/// 报警事件
/// </summary>
public event EventHandler OnAlarm;
#endregion
#region 事件属性
private List<DesignAction> _alarmActionList = new List<DesignAction>();
public List<DesignAction> AlarmActionList
{
get { return this._alarmActionList; }
set
{
this._alarmActionList = value;
this.onoffValve1.AlarmActionList = value;
this.onoffValve2.AlarmActionList = value;
this.onoffValve3.AlarmActionList = value;
this.onoffValve4.AlarmActionList = value;
this.onoffValve5.AlarmActionList = value;
}
}
#endregion
public CombinedCbWeight()
{
InitializeComponent();
//订阅事件
this.onoffValve1.OnAlarm += new EventHandler(_OnAlarm);
this.onoffValve2.OnAlarm += new EventHandler(_OnAlarm);
this.onoffValve3.OnAlarm += new EventHandler(_OnAlarm);
this.onoffValve4.OnAlarm += new EventHandler(_OnAlarm);
this.onoffValve5.OnAlarm += new EventHandler(_OnAlarm);
}
private void _OnAlarm(object sender, EventArgs e)
{
//触发事件
if (OnAlarm != null)
{
OnAlarm(sender, System.EventArgs.Empty);
}
}
private void CombinedCbWeight_Resize(object sender, EventArgs e)
{
this.Width = 98;
this.Height = 159;
}
/// <summary>
/// 炭黑称状态
/// </summary>
[Description("炭黑称状态"), Category("状态")]
public CBWeight.Statuses CBWeightStatus
{
get { return this.cbWeight1.Status; }
set { this.cbWeight1.Status = value; }
}
/// <summary>
/// 炭黑称卸料动画属性
/// </summary>
public string CBWeightActOutStatusName
{
get { return this.cbWeight1.ActOutStatusName; }
set { this.cbWeight1.ActOutStatusName = value; }
}
/// <summary>
/// 炭黑称卸料状态
/// </summary>
[Description("炭黑称卸料状态"), Category("状态")]
public OnOffStatuses CBWeightActOutStatus
{
get { return this.cbWeight1.ActOutStatus; }
set { this.cbWeight1.ActOutStatus = value; }
}
/// <summary>
/// 炭黑称设定值动画属性
/// </summary>
public string CBWeightSetValueName
{
get { return this.cbWeight1.SetValueName; }
set { this.cbWeight1.SetValueName = value; }
}
/// <summary>
/// 炭黑称称量值动画属性
/// </summary>
public string CBWeightWeightValueName
{
get { return this.cbWeight1.WeightValueName; }
set { this.cbWeight1.WeightValueName = value; }
}
/// <summary>
/// 炭黑称设定值
/// </summary>
[Description("炭黑称设定值"), Category("值")]
public double CBWeightSetValue
{
get { return this.cbWeight1.SetValue; }
set { this.cbWeight1.SetValue = value; }
}
/// <summary>
/// 炭黑称称量值
/// </summary>
[Description("炭黑称称量值"), Category("值")]
public double CBWeightWeightValue
{
get { return this.cbWeight1.WeightValue; }
set { this.cbWeight1.WeightValue = value; }
}
/// <summary>
/// 上1通断阀动画属性
/// </summary>
public string UpOnoff1StatusName
{
get { return this.onoffValve1.StatusName; }
set { this.onoffValve1.StatusName = value; }
}
/// <summary>
/// 上1通断阀状态
/// </summary>
[Description("上1通断阀状态"), Category("状态")]
public OnoffValve.Statuses UpOnoff1Status
{
get { return this.onoffValve1.Status; }
set { this.onoffValve1.Status = value; }
}
/// <summary>
/// 上2通断阀动画属性
/// </summary>
public string UpOnoff2StatusName
{
get { return this.onoffValve2.StatusName; }
set { this.onoffValve2.StatusName = value; }
}
/// <summary>
/// 上2通断阀状态
/// </summary>
[Description("上2通断阀状态"), Category("状态")]
public OnoffValve.Statuses UpOnoff2Status
{
get { return this.onoffValve2.Status; }
set { this.onoffValve2.Status = value; }
}
/// <summary>
/// 管动画属性
/// </summary>
public string TubeStatusName
{
get { return this.straightTubeV1.StatusName; }
set { this.straightTubeV1.StatusName = value; }
}
/// <summary>
/// 管状态
/// </summary>
[Description("管状态"), Category("状态")]
public StraightTubeV.Statuses TubeStatus
{
get { return this.straightTubeV1.Status; }
set { this.straightTubeV1.Status = value; }
}
/// <summary>
/// 炭黑检料称动画属性
/// </summary>
public string CBIMWeightStatusName
{
get { return this.cbimWeight1.StatusName; }
set { this.cbimWeight1.StatusName = value; }
}
/// <summary>
/// 炭黑检料称状态
/// </summary>
[Description("炭黑检料称状态"), Category("状态")]
public CBIMWeight.Statuses CBIMWeightStatus
{
get { return this.cbimWeight1.Status; }
set { this.cbimWeight1.Status = value; }
}
/// <summary>
/// 下1通断阀动画属性
/// </summary>
public string DownOnoff1StatusName
{
get { return this.onoffValve3.StatusName; }
set { this.onoffValve3.StatusName = value; }
}
/// <summary>
/// 下1通断阀状态
/// </summary>
[Description("下1通断阀状态"), Category("状态")]
public OnoffValve.Statuses DownOnoff1Status
{
get { return this.onoffValve3.Status; }
set { this.onoffValve3.Status = value; }
}
/// <summary>
/// 下2通断阀动画属性
/// </summary>
public string DownOnoff2StatusName
{
get { return this.onoffValve4.StatusName; }
set { this.onoffValve4.StatusName = value; }
}
/// <summary>
/// 下2通断阀状态
/// </summary>
[Description("下2通断阀状态"), Category("状态")]
public OnoffValve.Statuses DownOnoff2Status
{
get { return this.onoffValve4.Status; }
set { this.onoffValve4.Status = value; }
}
/// <summary>
/// 下3通断阀动画属性
/// </summary>
public string DownOnoff3StatusName
{
get { return this.onoffValve5.StatusName; }
set { this.onoffValve5.StatusName = value; }
}
/// <summary>
/// 下3通断阀状态
/// </summary>
[Description("下3通断阀状态"), Category("状态")]
public OnoffValve.Statuses DownOnoff3Status
{
get { return this.onoffValve5.Status; }
set { this.onoffValve5.Status = value; }
}
/// <summary>
/// 下横管动画属性
/// </summary>
public string DownTubeStatusName
{
get { return this.straightTubeH1.StatusName; }
set { this.straightTubeH1.StatusName = value; }
}
/// <summary>
/// 下横管状态
/// </summary>
[Description("下横管状态"), Category("状态")]
public StraightTubeH.Statuses DownTubeStatus
{
get { return this.straightTubeH1.Status; }
set { this.straightTubeH1.Status = value; }
}
#region 报警信息
/// <summary>
/// 上1通断阀报警信息
/// </summary>
[Description("上1通断阀报警信息"), Category("报警")]
public string UpOnoff1AlarmValue
{
get { return this.onoffValve1.AlarmValue; }
set { this.onoffValve1.AlarmValue = value; }
}
/// <summary>
/// 上2通断阀报警信息
/// </summary>
[Description("上2通断阀报警信息"), Category("报警")]
public string UpOnoff2AlarmValue
{
get { return this.onoffValve2.AlarmValue; }
set { this.onoffValve2.AlarmValue = value; }
}
/// <summary>
/// 下1通断阀报警信息
/// </summary>
[Description("下1通断阀报警信息"), Category("报警")]
public string DownOnoff1AlarmValue
{
get { return this.onoffValve3.AlarmValue; }
set { this.onoffValve3.AlarmValue = value; }
}
/// <summary>
/// 下2通断阀报警信息
/// </summary>
[Description("下2通断阀报警信息"), Category("报警")]
public string DownOnoff2AlarmValue
{
get { return this.onoffValve4.AlarmValue; }
set { this.onoffValve4.AlarmValue = value; }
}
/// <summary>
/// 下3通断阀报警信息
/// </summary>
[Description("下3通断阀报警信息"), Category("报警")]
public string DownOnoff3AlarmValue
{
get { return this.onoffValve5.AlarmValue; }
set { this.onoffValve5.AlarmValue = value; }
}
#endregion
}
}