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/CombinedDailyTank.cs

298 lines
8.4 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(CombinedDailyTank), "ICONS.DailyTank.bmp")]
public partial class CombinedDailyTank : 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.spiralFeeder1.AlarmActionList = value;
this.onoffValve1.AlarmActionList = value;
}
}
#endregion
#region 字段定义
#endregion
public CombinedDailyTank()
{
InitializeComponent();
this.spiralFeeder1.OnAlarm += new EventHandler(_OnAlarm);
this.onoffValve1.OnAlarm += new EventHandler(_OnAlarm);
}
private void _OnAlarm(object sender, EventArgs e)
{
//触发事件
if (OnAlarm != null)
{
OnAlarm(sender, System.EventArgs.Empty);
}
}
private void CombinedDailyTank_Resize(object sender, EventArgs e)
{
this.Width = 60;
this.Height = 175;
}
#region 共有属性
/// <summary>
/// 压力开关的可见性
/// </summary>
public bool PressureSwitchVisible
{
get
{
return this.pressureSwitch1.Visible;
}
set
{
this.pressureSwitch1.Visible = value;
}
}
/// <summary>
/// 螺旋给料类型
/// </summary>
[Description("螺旋给料类型"), Category("状态")]
public SpiralFeeder.Types SpiralFeederType
{
get
{
return this.spiralFeeder1.Type;
}
set
{
this.spiralFeeder1.Type = value;
if (value == SpiralFeeder.Types.ttleft)
{
this.pressureSwitch1.Location = new Point(3, 11);
this.straightTubeV2.Location = new Point(27, 0);
this.dedust1.Location = new Point(24, 12);
this.dailyTank1.Location = new Point(0, 36);
this.spiralFeeder1.Location = new Point(6, 132);
this.straightTubeV1.Location = new Point(40, 144);
this.onoffValve1.Location = new Point(38, 154);
}
else
{
this.pressureSwitch1.Location = new Point(13, 11);
this.straightTubeV2.Location = new Point(37, 0);
this.dedust1.Location = new Point(34, 12);
this.dailyTank1.Location = new Point(10, 36);
this.spiralFeeder1.Location = new Point(1, 132);
this.straightTubeV1.Location = new Point(9, 144);
this.onoffValve1.Location = new Point(7, 154);
}
this.Refresh();
}
}
/// <summary>
/// 压力开关动画属性
/// </summary>
public string PressureSwitchStatusName
{
get
{
return this.pressureSwitch1.StatusName;
}
set
{
this.pressureSwitch1.StatusName = value;
}
}
/// <summary>
/// 压力开关状态
/// </summary>
[Description("压力开关状态"), Category("状态")]
public PressureSwitch.Statuses PressureSwitchStatus
{
get
{
return this.pressureSwitch1.Status;
}
set
{
this.pressureSwitch1.Status = value;
}
}
/// <summary>
/// 顶端管的动画属性
/// </summary>
public string TopTubeStatusName
{
get { return this.straightTubeV2.StatusName; }
set { this.straightTubeV2.StatusName = value; }
}
/// <summary>
/// 顶端管的状态
/// </summary>
[Description("顶端管的状态"), Category("状态")]
public StraightTubeV.Statuses TopTubeStatus
{
get { return this.straightTubeV2.Status; }
set { this.straightTubeV2.Status = value; }
}
/// <summary>
/// 除尘动画属性
/// </summary>
public string DedustStatusName
{
get { return this.dedust1.StatusName; }
set { this.dedust1.StatusName = value; }
}
/// <summary>
/// 除尘的状态
/// </summary>
[Description("除尘的状态"), Category("状态")]
public Dedust.Statuses DedustStatus
{
get { return this.dedust1.Status; }
set { this.dedust1.Status = value; }
}
/// <summary>
/// 日罐动画属性
/// </summary>
public string DailyTankStatusName
{
get { return this.dailyTank1.StatusName; }
set { this.dailyTank1.StatusName = value; }
}
/// <summary>
/// 日罐的状态
/// </summary>
[Description("日罐的状态"), Category("状态")]
public DailyTank.Statuses DailyTankStatus
{
get { return this.dailyTank1.Status; }
set { this.dailyTank1.Status = value; }
}
/// <summary>
/// 螺旋给料动画属性
/// </summary>
public string SpiralFeederStatusName
{
get { return this.spiralFeeder1.StatusName; }
set { this.spiralFeeder1.StatusName = value; }
}
/// <summary>
/// 螺旋给料的状态
/// </summary>
[Description("螺旋给料的状态"), Category("状态")]
public SpiralFeeder.Statuses SpiralFeederStatus
{
get { return this.spiralFeeder1.Status; }
set { this.spiralFeeder1.Status = value; }
}
/// <summary>
/// 底部管的动画属性
/// </summary>
public string BottomTubeStatusName
{
get { return this.straightTubeV1.StatusName; }
set { this.straightTubeV1.StatusName = value; }
}
/// <summary>
/// 底部管的状态
/// </summary>
[Description("底部管的状态"), Category("状态")]
public StraightTubeV.Statuses BottomTubeStatus
{
get { return this.straightTubeV1.Status; }
set { this.straightTubeV1.Status = value; }
}
/// <summary>
/// 通断阀的动画属性
/// </summary>
public string OnoffValveStatusName
{
get { return this.onoffValve1.StatusName; }
set { this.onoffValve1.StatusName = value; }
}
/// <summary>
/// 通断阀的状态
/// </summary>
[Description("通断阀的状态"), Category("状态")]
public OnoffValve.Statuses OnoffValueStatus
{
get { return this.onoffValve1.Status; }
set { this.onoffValve1.Status = value; }
}
#endregion
#region 报警信息属性定义
/// <summary>
/// 螺旋给料报警信息
/// </summary>
[Description("螺旋给料报警信息"), Category("报警")]
public string SpiralFeederAlarmValue
{
get { return this.spiralFeeder1.AlarmValue; }
set { this.spiralFeeder1.AlarmValue = value; }
}
/// <summary>
/// 通断阀报警信息
/// </summary>
[Description("通断阀报警信息"), Category("报警")]
public string OnoffValueAlarmValue
{
get { return this.onoffValve1.AlarmValue; }
set { this.onoffValve1.AlarmValue = value; }
}
#endregion
}
}