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.
89 lines
2.1 KiB
C#
89 lines
2.1 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Mesnac.Controls.ChemicalWeighing
|
|
{
|
|
/// <summary>
|
|
/// 震动给料器右(大)
|
|
/// </summary>
|
|
[ToolboxBitmap(typeof(RSCREWBIG), "Resources.RSCREW_BIGA.png")]//新添加的代码
|
|
public partial class RSCREWBIG : ChemicalWeighingControl
|
|
{
|
|
|
|
private object _data = new object();
|
|
|
|
public enum Statuses
|
|
{
|
|
ylNormal = 0, ylMove = 1 //, ylAlarm = 2
|
|
}
|
|
Statuses _status;
|
|
string[] sImages;
|
|
public RSCREWBIG()
|
|
: base()
|
|
{
|
|
InitializeComponent();
|
|
Init();
|
|
ReloadStream();
|
|
|
|
}
|
|
|
|
protected override void Init()
|
|
{
|
|
base.Init();
|
|
_imageStream = null;
|
|
|
|
sImages = new string[2];
|
|
sImages[0] = "Mesnac.Controls.ChemicalWeighing.Resources.RSCREW_BIGA.png";
|
|
sImages[1] = "Mesnac.Controls.ChemicalWeighing.Resources.RSCREW_BIGMOVE.gif";
|
|
|
|
_status = Statuses.ylNormal;
|
|
}
|
|
|
|
private void ReloadStream()
|
|
{
|
|
|
|
int nIndex = (int)_status;
|
|
_imageStream = _assembly.GetManifestResourceStream(sImages[nIndex]);
|
|
if (_imageStream != null)
|
|
{
|
|
Image img = Image.FromStream(_imageStream);
|
|
pictureBox1.Image = img;
|
|
pictureBox1.Refresh();
|
|
}
|
|
}
|
|
|
|
public Statuses Status
|
|
{
|
|
get
|
|
{
|
|
return _status;
|
|
}
|
|
set
|
|
{
|
|
|
|
if (_status != value)
|
|
{
|
|
lock (_data)
|
|
{
|
|
_status = value;
|
|
ReloadStream();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void PressureSwitch_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|