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 { /// /// 组合油秤 /// [ToolboxBitmap(typeof(CombinedOilWeight), "ICONS.OilWeight.bmp")]//新添加的代码 public partial class CombinedOilWeight : FeedingControl { #region 事件定义 /// /// 报警事件 /// public event EventHandler OnAlarm; #endregion #region 事件属性 private List _alarmActionList = new List(); public List AlarmActionList { get { return this._alarmActionList; } set { this._alarmActionList = value; this.onoffValve1.AlarmActionList = value; this.onoffValve2.AlarmActionList = value; } } #endregion public CombinedOilWeight() { InitializeComponent(); //订阅事件 this.onoffValve1.OnAlarm += new EventHandler(_OnAlarm); this.onoffValve2.OnAlarm += new EventHandler(_OnAlarm); } private void _OnAlarm(object sender, EventArgs e) { //触发事件 if (OnAlarm != null) { OnAlarm(sender, System.EventArgs.Empty); } } private void CombinedOilWeight_Resize(object sender, EventArgs e) { this.Width = 100; this.Height = 140; } /// /// 油称状态 /// [Description("油称状态"), Category("状态")] public OilWeight.Statuses OilWeightStatus { get { return this.oilWeight1.Status; } set { this.oilWeight1.Status = value; } } /// /// 油称卸料状态动画属性 /// public string OilWeightActOutStatusName { get { return this.oilWeight1.ActOutStatusName; } set { this.oilWeight1.ActOutStatusName = value; } } /// /// 油称卸料状态 /// [Description("油称卸料状态"), Category("状态")] public OnOffStatuses OilWeightActOutStatus { get { return this.oilWeight1.ActOutStatus; } set { this.oilWeight1.ActOutStatus = value; } } /// /// 油称设定值动画属性 /// public string OilWeightSetValueName { get { return this.oilWeight1.SetValueName; } set { this.oilWeight1.SetValueName = value; } } /// /// 油称设定值 /// [Description("油称设定值"), Category("值")] public double OilWeightSetValue { get { return this.oilWeight1.SetValue; } set { this.oilWeight1.SetValue = value; } } /// /// 油称称量值动画属性 /// public string OilWeightWeightValueName { get { return this.oilWeight1.WeightValueName; } set { this.oilWeight1.WeightValueName = value; } } /// /// 油称称量值 /// [Description("油称称量值"), Category("值")] public double OilWeightWeightValue { get { return this.oilWeight1.WeightValue; } set { this.oilWeight1.WeightValue = value; } } /// /// 上通断阀动画属性 /// public string UpOnoffStatusName { get { return this.onoffValve1.StatusName; } set { this.onoffValve1.StatusName = value; } } /// /// 上通断阀状态 /// [Description("上通断阀状态"), Category("状态")] public OnoffValve.Statuses UpOnoffStatus { get { return this.onoffValve1.Status; } set { this.onoffValve1.Status = value; } } /// /// 上竖管动画属性 /// public string UpTubeStatusName { get { return this.straightTubeV1.StatusName; } set { this.straightTubeV1.StatusName = value; } } /// /// 上竖管状态 /// [Description("上竖管状态"), Category("状态")] public StraightTubeV.Statuses UpTubeStatus { get { return this.straightTubeV1.Status; } set { this.straightTubeV1.Status = value; } } /// /// 油斗动画属性 /// public string OilHopperStatusName { get { return this.oilHopper1.StatusName; } set { this.oilHopper1.StatusName = value; } } /// /// 油斗状态 /// [Description("油斗状态"), Category("状态")] public OilHopper.Statuses OilHopperStatus { get { return this.oilHopper1.Status; } set { this.oilHopper1.Status = value; } } /// /// 下竖管动画属性 /// public string DownTubeStatusName { get { return this.straightTubeV2.StatusName; } set { this.straightTubeV2.StatusName = value; } } /// /// 下竖管状态 /// [Description("下竖管状态"), Category("状态")] public StraightTubeV.Statuses DownTubeStatus { get { return this.straightTubeV2.Status; } set { this.straightTubeV2.Status = value; } } /// /// 下通断阀动画属性 /// public string DownOnoffStatusName { get { return this.onoffValve2.StatusName; } set { this.onoffValve2.StatusName = value; } } /// /// 下通断阀状态 /// [Description("下通断阀状态"), Category("状态")] public OnoffValve.Statuses DownOnoffStatus { get { return this.onoffValve2.Status; } set { this.onoffValve2.Status = value; } } /// /// 下横管动画属性 /// public string DownHTubeStatusName { get { return this.straightTubeH1.StatusName; } set { this.straightTubeH1.StatusName = value; } } /// /// 下横管状态 /// [Description("下横管状态"), Category("状态")] public StraightTubeH.Statuses DownHTubeStatus { get { return this.straightTubeH1.Status; } set { this.straightTubeH1.Status = value; } } #region 报警信息 /// /// 上通断阀报警信息 /// [Description("上通断阀报警信息"), Category("报警")] public string UpOnoffAlarmValue { get { return this.onoffValve1.AlarmValue; } set { this.onoffValve1.AlarmValue = value; } } /// /// 下通断阀报警信息 /// [Description("下通断阀报警信息"), Category("报警")] public string DownOnoffAlarmValue { get { return this.onoffValve2.AlarmValue; } set { this.onoffValve2.AlarmValue = value; } } #endregion } }