diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/Mesnac.Controls.ChemicalWeighing.csproj b/Controls/Mesnac.Controls.ChemicalWeighing/Mesnac.Controls.ChemicalWeighing.csproj
index a4fe048..e581090 100644
--- a/Controls/Mesnac.Controls.ChemicalWeighing/Mesnac.Controls.ChemicalWeighing.csproj
+++ b/Controls/Mesnac.Controls.ChemicalWeighing/Mesnac.Controls.ChemicalWeighing.csproj
@@ -373,6 +373,7 @@
BeiLiaoTong.cs
+ Designer
DistributionBox.cs
@@ -623,6 +624,8 @@
+
+
diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/PControl.Designer.cs b/Controls/Mesnac.Controls.ChemicalWeighing/PControl.Designer.cs
index c6c657e..150153e 100644
--- a/Controls/Mesnac.Controls.ChemicalWeighing/PControl.Designer.cs
+++ b/Controls/Mesnac.Controls.ChemicalWeighing/PControl.Designer.cs
@@ -28,7 +28,6 @@
///
private void InitializeComponent()
{
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PControl));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
@@ -36,7 +35,7 @@
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
+ this.pictureBox1.ErrorImage = null;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(26, 39);
@@ -51,6 +50,7 @@
this.Controls.Add(this.pictureBox1);
this.Name = "PControl";
this.Size = new System.Drawing.Size(26, 39);
+ this.Load += new System.EventHandler(this.PControl_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/PControl.cs b/Controls/Mesnac.Controls.ChemicalWeighing/PControl.cs
index f1a206c..f68937f 100644
--- a/Controls/Mesnac.Controls.ChemicalWeighing/PControl.cs
+++ b/Controls/Mesnac.Controls.ChemicalWeighing/PControl.cs
@@ -12,11 +12,131 @@ namespace Mesnac.Controls.ChemicalWeighing
{
[ToolboxBitmap(typeof(PControl), "Resources.p.png")]
- public partial class PControl : UserControl
+ public partial class PControl : ChemicalWeighingControl
{
- public PControl()
+ public enum Statuses
+ {
+ TurnOff = 0,
+ TurnOn = 1
+ }
+ private bool bNewPic = false;
+ private string _statusName;
+ //private object _textName = string.Empty;
+ private Statuses _status;
+ private string[] sImages;
+
+ public PControl() : base()
{
InitializeComponent();
+
+ Init();
+
+ ReloadStream();
+ this.Reload();
+ }
+
+ protected override void Init()
+ {
+ base.Init();
+ _imageStream = null;
+ sImages = new string[2];
+ sImages[0] = "Mesnac.Controls.ChemicalWeighing.Resources.p0.png";//zsTurnOff
+ sImages[1] = "Mesnac.Controls.ChemicalWeighing.Resources.p1.png";//zsTurnOn
+ _status = Statuses.TurnOff;
+ }
+
+ private void ReloadStream()
+ {
+ int nIndex = (int)_status;
+ _imageStream = _assembly.GetManifestResourceStream(sImages[nIndex]);
+ }
+
+ public string StatusName
+ {
+ get
+ {
+ return _statusName;
+ }
+ set
+ {
+ _statusName = value;
+ }
}
+
+ public Statuses Status
+ {
+ get
+ {
+ return _status;
+ }
+ set
+ {
+ if (bFirstCreated == true)
+ {
+ bFirstCreated = false;
+ }
+ bool flag = false;
+ //if (_status != value &&(this.Size.Width != 150 || this.Size.Height != 150) )
+ if (_status != value)
+ {
+ flag = true;
+ if (this.DesignMode == true)
+ {
+ bNewPic = true;
+ }
+ }
+
+ if ((int)value < 0)
+ {
+ _status = (Statuses)0;
+ }
+ else if ((int)value > 1)
+ {
+ _status = (Statuses)1;
+ }
+ else
+ {
+ _status = value;
+ }
+ if (flag)
+ {
+ ReloadStream();
+ Reload();
+ this.Refresh();
+ }
+ }
+ }
+
+ private void Reload()
+ {
+ if (_imageStream != null)
+ {
+ Image img = Image.FromStream(_imageStream);
+ Size size = new Size();
+ size.Width = 29;
+ size.Height = 24;
+ this.Size = size;
+ if (bNewPic == true)
+ {
+ this.Size = size;
+ bNewPic = false;
+ }
+ pictureBox1.Image = img;
+ pictureBox1.Refresh();
+ }
+ }
+
+ private void PControl_Load(object sender, EventArgs e)
+ {
+ if (bFirstCreated == true && this.DesignMode == true)
+ {
+ bNewPic = true;
+ bFirstCreated = false;
+ Reload();
+ }
+ }
+
+
+
}
}
diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/PControl.resx b/Controls/Mesnac.Controls.ChemicalWeighing/PControl.resx
index 45b61e9..1af7de1 100644
--- a/Controls/Mesnac.Controls.ChemicalWeighing/PControl.resx
+++ b/Controls/Mesnac.Controls.ChemicalWeighing/PControl.resx
@@ -117,26 +117,4 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAACIAAABNCAYAAADD5bZNAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAN7SURBVGhD7Zi7ThtBFED5CkhK4B8iCI8ooac3VSCWEpCokaI8cCoUQKINTVzaNCjhUYEpkEAC
- /iQ0SZoQEk3uWWas9eXaXq8NaaY40npm7r2H3Xns0nd2dpaZRyOj/cJz4bNwLnwTrjxc00YfYx5YOTTO
- uQSzUyNJJ4Qd4VpwGfkjEDNh5QxkEpEkQ8KukCQfHRt3cy+K7uPqqqtWt9zh4aE7OTlJ4Jo2+hjD2BDn
- cwxZNdqKSGBB+E6iJ0+fuffLJVer1Zz0ZQIxYoglh881I30NdVqKSMA7H+xezs+7g4MDs1gWiCVHyEdu
- aa/XaioiA18TMPJ4zK2tr5vJ80AucnqZN9LWXEQG8DiSgE+bm2bCbiBnSqYgbbdFpGNQ+MGg1bXe3QkN
- ub0ItQYtkWR18DzTgXfBq/mFILPbICIN43Qww7uZmFlhRaVW00Ra5CuNy6WSGahZWVlxi4uLDdC2sbHh
- tre3zRgNtbzIl0RELti2r9mAsu4TFJ6ammpKsVh0x8fHZmyAWn7TY7fuR4RzIdkNrQCLIJL+67nd5XLZ
- FQqFpI8x6RgLalIbB0Q4pGQ2r5mDLSyRAELhzug+DTW9SBkRTkxXqVTMwRatRCCItJsvlWo1iJwjwvHd
- 0TnSSoS5EUSyzBMvconIL36cnp6agy2aiVB4aWkp6csyR6jpRa4Q4aUmlwirg+tAuBPT09Nuf3/fjE2j
- RS75kefRaFgx7CdMWCtOox/NzWSViWMNtggi7SZjO1KT9QKRMj96tXw7IXUAJsu3JxtaHlIb2iwiA0Ku
- Lb4bEWqltviBcOjxtp350OuFyHLpQ7gbO+nTl8+F5GjOMuM5Uzhps64ODXHmawBIw/94MdpDQovwDXPf
- r4pDt0RAOmYYdE8vz8k3jikCMuBtkLnDz4n6t01TEWCgD3CvFha6eo9lYpIj5CO3tNdrtRQBCeAx/SSY
- Gc5yqx0dmcUsGEtManWQq7NPzoAEDguNH+Fy4nIcVLduPsI5QYFr2uhjjN+sAnvCsFUjk0hAkkwKbHr8
- qyFdoBV/BWImrZyBjkQCkpQ3/lmBg/JC4O3ut4dr2uibEx5aOTS5RCykYHIHrL4s1EXCRV6CiG7vFLOx
- E6KIJopooogmimiiiCaKaKKIJopooogmimiiiCaKaKKIJopooogmimiiiCaKaKKIJopoeiPi+v4BcqDZ
- eZrfye0AAAAASUVORK5CYII=
-
-
\ No newline at end of file
diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/Resources/Thumbs.db b/Controls/Mesnac.Controls.ChemicalWeighing/Resources/Thumbs.db
index f66ef14..1e2d738 100644
Binary files a/Controls/Mesnac.Controls.ChemicalWeighing/Resources/Thumbs.db and b/Controls/Mesnac.Controls.ChemicalWeighing/Resources/Thumbs.db differ
diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/Resources/p0.png b/Controls/Mesnac.Controls.ChemicalWeighing/Resources/p0.png
new file mode 100644
index 0000000..092835f
Binary files /dev/null and b/Controls/Mesnac.Controls.ChemicalWeighing/Resources/p0.png differ
diff --git a/Controls/Mesnac.Controls.ChemicalWeighing/Resources/p1.png b/Controls/Mesnac.Controls.ChemicalWeighing/Resources/p1.png
new file mode 100644
index 0000000..959cd34
Binary files /dev/null and b/Controls/Mesnac.Controls.ChemicalWeighing/Resources/p1.png differ
diff --git a/Main/MCEdit/Data/ComponentAction 2.xml b/Main/MCEdit/Data/ComponentAction 2.xml
new file mode 100644
index 0000000..3714948
--- /dev/null
+++ b/Main/MCEdit/Data/ComponentAction 2.xml
@@ -0,0 +1,444 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Main/MCEdit/Data/ComponentAction.en-US.xml b/Main/MCEdit/Data/ComponentAction.en-US.xml
index 5cc4347..f1d5809 100644
--- a/Main/MCEdit/Data/ComponentAction.en-US.xml
+++ b/Main/MCEdit/Data/ComponentAction.en-US.xml
@@ -402,4 +402,11 @@
+
+
+
+
+
+
+
diff --git a/Main/MCEdit/Data/ComponentAction.xml b/Main/MCEdit/Data/ComponentAction.xml
index 3714948..f43b3d2 100644
--- a/Main/MCEdit/Data/ComponentAction.xml
+++ b/Main/MCEdit/Data/ComponentAction.xml
@@ -402,6 +402,12 @@
+
+
+
+
+
+
diff --git a/Main/MCEdit/Data/MCProject/nodeForm/FormDeviceDetail2.xml b/Main/MCEdit/Data/MCProject/nodeForm/FormDeviceDetail2.xml
index 495abb8..01ff7e6 100644
--- a/Main/MCEdit/Data/MCProject/nodeForm/FormDeviceDetail2.xml
+++ b/Main/MCEdit/Data/MCProject/nodeForm/FormDeviceDetail2.xml
@@ -1,6 +1,124 @@