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.
|
|
|
|
using System;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Controls.ChemicalWeighing
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><EFBFBD><F0B6AFB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ң<EFBFBD><D2A3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ToolboxBitmap(typeof(RSCREWBIG), "Resources.RSCREW_BIGA.png")]//<2F><><EFBFBD><EFBFBD><EFBFBD>ӵĴ<D3B5><C4B4><EFBFBD>
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|