diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DownToDatabase.cs
similarity index 84%
rename from Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/TestAction.cs
rename to Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DownToDatabase.cs
index 4f270dd..d62a0fc 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/TestAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DownToDatabase.cs
@@ -10,22 +10,15 @@ using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{
- public class TestAction: ChemicalWeighingAction, IAction
+ public class DownToDatabase
{
- public static event EventHandler OnAdd;
- private DbMCControl _materialGridControl = null; //物料列表控件
- private RuntimeParameter _runtime;
- public void Run(RuntimeParameter runtime)
- {
- base.RunIni(runtime); //必须调用
- this._runtime = runtime;
-
- DbMCControl materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "lj_planning").FirstOrDefault();
- this._materialGridControl = materialGridControl;
+ public DownToDatabase() { }
-
- DataGridView clientGridView = this._materialGridControl.BaseControl as DataGridView;
+ public DownToDatabase(DbMCControl _materialGridControl)
+ {
+
+ DataGridView clientGridView = _materialGridControl.BaseControl as DataGridView;
//验证是否选中某物料
if (clientGridView.SelectedRows.Count != 1)
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DownloadAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DownloadAction.cs
index 8c909bd..137dce6 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DownloadAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/DownloadAction.cs
@@ -28,10 +28,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{
base.RunIni(runtime); //必须调用
this._runtime = runtime;
- DbMCControl materialGridControl =
- this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "lj_planning")
- .FirstOrDefault(); //获取物料数据控件
- this._materialGridControl = materialGridControl;
+ _materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "lj_planning").FirstOrDefault(); //获取物料数据控件
+
+ DownToDatabase downToDatabase = new DownToDatabase(_materialGridControl);
DataGridView clientGridView = this._materialGridControl.BaseControl as DataGridView;
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/InItDbAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/InItDbAction.cs
index d8e117c..e504634 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/InItDbAction.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPlanning/InItDbAction.cs
@@ -21,7 +21,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
AddAction.OnAdd -= Process_Event;
- AddAction.OnAdd += Process_Event;
+ AddAction.OnAdd += Process_Event;
UpdateAction.OnUpdate -= Process_Event;
UpdateAction.OnUpdate += Process_Event;
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.Designer.cs
index b9fdf03..4b0f9ce 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.Designer.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.Designer.cs
@@ -1,65 +1,82 @@
-using System.ComponentModel;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace Mesnac.Action.ChemicalWeighing
+namespace Mesnac.Action.ChemicalWeighing
{
partial class Loading
{
///
- /// Required designer variable.
+ /// 必需的设计器变量。
///
- private IContainer components = null;
+ private System.ComponentModel.IContainer components = null;
///
- /// Clean up any resources being used.
+ /// 清理所有正在使用的资源。
///
- /// true if managed resources should be disposed; otherwise, false.
+ /// 如果应释放托管资源,为 true;否则为 false。
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
-
base.Dispose(disposing);
}
- #region Windows Form Designer generated code
+ #region Windows 窗体设计器生成的代码
///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
+ /// 设计器支持所需的方法 - 不要修改
+ /// 使用代码编辑器修改此方法的内容。
///
private void InitializeComponent()
{
- this.label2 = new System.Windows.Forms.Label();
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.label1 = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
- // label2
+ // pictureBox1
+ //
+ this.pictureBox1.Image = global::Mesnac.Action.ChemicalWeighing.Properties.Resources.loading;
+ this.pictureBox1.Location = new System.Drawing.Point(12, 12);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(129, 125);
+ this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+ this.pictureBox1.TabIndex = 0;
+ this.pictureBox1.TabStop = false;
//
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(85, 30);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(65, 12);
- this.label2.TabIndex = 0;
- this.label2.Text = "数据加载中";
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Bold);
+ this.label1.Location = new System.Drawing.Point(7, 140);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(110, 27);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "加载中……";
//
// Loading
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(299, 72);
- this.Controls.Add(this.label2);
+ this.ClientSize = new System.Drawing.Size(153, 175);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.pictureBox1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Loading";
- this.Text = "Loading";
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Form1";
+ this.TopMost = true;
+ this.TransparencyKey = System.Drawing.SystemColors.Control;
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
+
}
#endregion
- private Label label1;
- private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.PictureBox pictureBox1;
+ private System.Windows.Forms.Label label1;
}
-}
\ No newline at end of file
+}
+
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.cs
index f8fabd0..f1fae0a 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.cs
@@ -1,6 +1,12 @@
using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
using System.Windows.Forms;
-using DevExpress.Pdf.ContentGeneration;
namespace Mesnac.Action.ChemicalWeighing
{
@@ -9,24 +15,12 @@ namespace Mesnac.Action.ChemicalWeighing
public Loading()
{
InitializeComponent();
- this.ControlBox = true ;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- FormBorderStyle = FormBorderStyle.FixedSingle;
- // orm有个FormBorderStyle属性,设为FixedSingle即可
- }
-
- private void loading_Load(object sender, EventArgs e)
- {
-
- this.Opacity = 1;
-
}
///
/// 关闭命令
///
- public void CloseOrder()
+ public void closeOrder()
{
if (this.InvokeRequired)
{
@@ -37,7 +31,8 @@ namespace Mesnac.Action.ChemicalWeighing
{
;
}
-
+ if (this.IsDisposed)
+ return;
if (!this.IsDisposed)
{
this.Dispose();
@@ -57,7 +52,7 @@ namespace Mesnac.Action.ChemicalWeighing
}
}
- private void loading_FormClosing(object sender, FormClosingEventArgs e)
+ private void LoaderForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (!this.IsDisposed)
{
@@ -66,9 +61,10 @@ namespace Mesnac.Action.ChemicalWeighing
}
}
-
class CONSTANTDEFINE
{
public delegate void SetUISomeInfo();
}
+
+
}
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LoadingHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LoadingHelper.cs
index fb79032..a566d06 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LoadingHelper.cs
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LoadingHelper.cs
@@ -4,76 +4,84 @@ using System.Threading;
namespace Mesnac.Action.ChemicalWeighing
{
- public class LoadingHelper
+ public class LoadingHelper
{
#region 相关变量定义
///
/// 定义委托进行窗口关闭
///
private delegate void CloseDelegate();
- private static Loading loadingForm;
+ private static Loading loading;
private static readonly Object syncLock = new Object(); //加锁使用
-
+
#endregion
-
-
-
+
+ //private LoadingHelper()
+ //{
+
+ //}
+
///
/// 显示loading框
///
public static void ShowLoadingScreen()
{
// Make sure it is only launched once.
- if (loadingForm != null)
+ if (loading != null)
return;
Thread thread = new Thread(new ThreadStart(LoadingHelper.ShowForm));
thread.IsBackground = true;
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
-
+
}
+
///
/// 显示窗口
///
private static void ShowForm()
{
- if (loadingForm != null)
+ if (loading != null)
{
- loadingForm.CloseOrder();
- loadingForm = null;
+ loading.closeOrder();
+ loading = null;
}
- loadingForm = new Loading();
- loadingForm.TopMost = true;
- loadingForm.ShowDialog();
+ loading = new Loading();
+ loading.TopMost = true;
+ loading.ShowDialog();
}
+
///
/// 关闭窗口
///
public static void CloseForm()
{
Thread.Sleep(50); //可能到这里线程还未起来,所以进行延时,可以确保线程起来,彻底关闭窗口
- if (loadingForm != null)
+ if (loading != null)
{
lock (syncLock)
{
Thread.Sleep(50);
- if (loadingForm != null)
+ if (loading != null)
{
Thread.Sleep(50); //通过三次延时,确保可以彻底关闭窗口
- loadingForm.Invoke(new CloseDelegate(LoadingHelper.CloseFormInternal));
-
+ loading.Invoke(new CloseDelegate(LoadingHelper.CloseFormInternal));
}
}
}
}
+
///
/// 关闭窗口,委托中使用
///
private static void CloseFormInternal()
{
- loadingForm.CloseOrder();
- loadingForm = null;
+
+ loading.closeOrder();
+ loading = null;
+
}
+
}
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj
index 1f6383c..f4ba69f 100644
--- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj
@@ -446,7 +446,7 @@
-
+
@@ -636,6 +636,11 @@
+
+ True
+ True
+ Resources.resx
+
@@ -911,6 +916,10 @@
FrmSpeedProjectDebug.cs
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
FrmRole.cs
@@ -937,6 +946,7 @@
+
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Properties/Resources.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..a3e03dc
--- /dev/null
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Properties/Resources.Designer.cs
@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace Mesnac.Action.ChemicalWeighing.Properties {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// 返回此类使用的缓存的 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Mesnac.Action.ChemicalWeighing.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 重写当前线程的 CurrentUICulture 属性,对
+ /// 使用此强类型资源类的所有资源查找执行重写。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap loading {
+ get {
+ object obj = ResourceManager.GetObject("loading", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Properties/Resources.resx b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Properties/Resources.resx
new file mode 100644
index 0000000..57f16af
--- /dev/null
+++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Properties/Resources.resx
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\loading.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Resources/loading.gif b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Resources/loading.gif
new file mode 100644
index 0000000..0ce9e38
Binary files /dev/null and b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Resources/loading.gif differ
diff --git a/Main/MCEdit/Data/MCProject/nodeForm/FormPlan.xml b/Main/MCEdit/Data/MCProject/nodeForm/FormPlan.xml
index 710afed..81231d6 100644
--- a/Main/MCEdit/Data/MCProject/nodeForm/FormPlan.xml
+++ b/Main/MCEdit/Data/MCProject/nodeForm/FormPlan.xml
@@ -36,31 +36,6 @@