diff --git a/ButcherFactory.AutoUpdate/ButcherFactory.AutoUpdate.csproj b/ButcherFactory.AutoUpdate/ButcherFactory.AutoUpdate.csproj
index 2823ace..9839642 100644
--- a/ButcherFactory.AutoUpdate/ButcherFactory.AutoUpdate.csproj
+++ b/ButcherFactory.AutoUpdate/ButcherFactory.AutoUpdate.csproj
@@ -9,8 +9,9 @@
Properties
ButcherFactory.AutoUpdate
ButcherFactory.AutoUpdate
- v4.0
+ v4.8
512
+
AnyCPU
@@ -21,15 +22,17 @@
DEBUG;TRACE
prompt
4
+ false
- AnyCPU
+ x86
pdbonly
true
bin\Release\
TRACE
prompt
4
+ false
@@ -64,7 +67,9 @@
True
Resources.resx
+ True
+
SettingsSingleFileGenerator
Settings.Designer.cs
diff --git a/ButcherFactory.AutoUpdate/Properties/Resources.Designer.cs b/ButcherFactory.AutoUpdate/Properties/Resources.Designer.cs
index a955ccf..4a04ac2 100644
--- a/ButcherFactory.AutoUpdate/Properties/Resources.Designer.cs
+++ b/ButcherFactory.AutoUpdate/Properties/Resources.Designer.cs
@@ -1,71 +1,63 @@
//------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 4.0.30319.42000
+// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
-// 重新生成代码,这些更改将丢失。
+// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
-namespace ButcherFactory.AutoUpdate.Properties
-{
-
-
- ///
- /// 一个强类型的资源类,用于查找本地化的字符串等。
- ///
- // 此类是由 StronglyTypedResourceBuilder
- // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
- // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
- // (以 /str 作为命令选项),或重新生成 VS 项目。
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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()
- {
- }
-
+namespace ButcherFactory.AutoUpdate.Properties {
+ using System;
+
+
///
- /// 返回此类使用的、缓存的 ResourceManager 实例。
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ButcherFactory.AutoUpdate.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
+ // 此类是由 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("ButcherFactory.AutoUpdate.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;
+ }
}
- 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;
- }
}
- }
}
diff --git a/ButcherFactory.AutoUpdate/Properties/Settings.Designer.cs b/ButcherFactory.AutoUpdate/Properties/Settings.Designer.cs
index 6645aee..f023ab2 100644
--- a/ButcherFactory.AutoUpdate/Properties/Settings.Designer.cs
+++ b/ButcherFactory.AutoUpdate/Properties/Settings.Designer.cs
@@ -1,30 +1,26 @@
//------------------------------------------------------------------------------
//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
-namespace ButcherFactory.AutoUpdate.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
+namespace ButcherFactory.AutoUpdate.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
}
- }
}
diff --git a/ButcherFactory.AutoUpdate/app.config b/ButcherFactory.AutoUpdate/app.config
new file mode 100644
index 0000000..3e0e37c
--- /dev/null
+++ b/ButcherFactory.AutoUpdate/app.config
@@ -0,0 +1,3 @@
+
+
+
diff --git a/ButcherFactory.BO/ButcherFactory.BO.csproj b/ButcherFactory.BO/ButcherFactory.BO.csproj
index 65f1797..b6fb522 100644
--- a/ButcherFactory.BO/ButcherFactory.BO.csproj
+++ b/ButcherFactory.BO/ButcherFactory.BO.csproj
@@ -9,8 +9,9 @@
Properties
ButcherFactory.BO
ButcherFactory.BO
- v4.5
+ v4.8
512
+
true
@@ -28,6 +29,7 @@
TRACE
prompt
4
+ x86
diff --git a/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs b/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs
index 0d8e64d..5ac9146 100644
--- a/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs
+++ b/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs
@@ -25,7 +25,7 @@ namespace ButcherFactory.BO.LocalBL
var entity = new CarcassInStore();
entity.WorkUnit_ID = workUnitID;
entity.ProductBatch_ID = batchID;
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
entity.Weight = weight;
entity.RowIndex = GenerateRowIndex(session, batchID);
session.Insert(entity);
diff --git a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs
index 858ceed..56b2f24 100644
--- a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs
+++ b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs
@@ -297,7 +297,7 @@ namespace ButcherFactory.BO.LocalBL
type.GetProperty(p.Name).SetValue(delete, p.GetValue(tag));
}
delete.DeleteTime = DateTime.Now;
- delete.Deleter = AppContext.Worker.Name;
+ delete.Deleter = BO.Utils.AppContext.Worker.Name;
session.Insert(delete);
}
diff --git a/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs
index 30f17f3..dfd7205 100644
--- a/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs
+++ b/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs
@@ -33,7 +33,7 @@ namespace ButcherFactory.BO.LocalBL
}
entity.Number = 1;
entity.Store_ID = storeID;
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
entity.BarCode = barCode;
entity.RowIndex = GenerateRowIndex(session);
session.Insert(entity);
diff --git a/ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs b/ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs
index 5c0c6e9..2dcb858 100644
--- a/ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs
+++ b/ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs
@@ -117,7 +117,7 @@ namespace ButcherFactory.BO.LocalBL
{
if (!ExistSet(detailID, session))
{
- var entity = new WorkerGoodsSetProfile { Worker_ID = AppContext.Worker.ID, ClientGoodsSet_Detail_ID = detailID };
+ var entity = new WorkerGoodsSetProfile { Worker_ID = BO.Utils.AppContext.Worker.ID, ClientGoodsSet_Detail_ID = detailID };
session.Insert(entity);
session.Commit();
}
@@ -128,14 +128,14 @@ namespace ButcherFactory.BO.LocalBL
{
var query = new DQueryDom(new JoinAlias(typeof(WorkerGoodsSetProfile)));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c"));
- query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Worker_ID", AppContext.Worker.ID), DQCondition.EQ("ClientGoodsSet_Detail_ID", detailID)));
+ query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Worker_ID", BO.Utils.AppContext.Worker.ID), DQCondition.EQ("ClientGoodsSet_Detail_ID", detailID)));
return query.EExecuteScalar(session) != null;
}
public static void DeleteWorkGoodsSet(long detailID)
{
var delete = new DQDeleteDom(typeof(WorkerGoodsSetProfile));
- delete.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Worker_ID", AppContext.Worker.ID), DQCondition.EQ("ClientGoodsSet_Detail_ID", detailID)));
+ delete.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Worker_ID", BO.Utils.AppContext.Worker.ID), DQCondition.EQ("ClientGoodsSet_Detail_ID", detailID)));
delete.EExecute();
}
}
@@ -148,7 +148,7 @@ namespace ButcherFactory.BO.LocalBL
{
var query = new DQueryDom(new JoinAlias(typeof(WorkerGoodsSetProfile)));
query.Columns.Add(DQSelectColumn.Field("ClientGoodsSet_Detail_ID"));
- query.Where.Conditions.Add(DQCondition.EQ("Worker_ID", AppContext.Worker.ID));
+ query.Where.Conditions.Add(DQCondition.EQ("Worker_ID", BO.Utils.AppContext.Worker.ID));
return query;
}
}
diff --git a/ButcherFactory.BO/LocalBL/SegmentPickUpBL.cs b/ButcherFactory.BO/LocalBL/SegmentPickUpBL.cs
index 5723328..dec7c30 100644
--- a/ButcherFactory.BO/LocalBL/SegmentPickUpBL.cs
+++ b/ButcherFactory.BO/LocalBL/SegmentPickUpBL.cs
@@ -60,7 +60,7 @@ namespace ButcherFactory.BO.LocalBL
using (var session = DmoSession.New())
{
entity.Number = 1;
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
session.Insert(entity);
session.Commit();
}
diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
index b6281ca..48bf0ea 100644
--- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
+++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
@@ -96,12 +96,12 @@ namespace ButcherFactory.BO.LocalBL
if (tuple == null)
{
entity = new TotalCode();
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
entity.GoodsType = 1;
entity.NoTotalCode = true;
entity.RowIndex = 1;
// 年月日+2位机器号
- entity.BarCode = string.Format("{0:yyyyMMdd}{1}", date, AppContext.ConnectInfo.ClientCode);
+ entity.BarCode = string.Format("{0:yyyyMMdd}{1}", date, BO.Utils.AppContext.ConnectInfo.ClientCode);
session.Insert(entity);
session.Commit();
}
@@ -206,11 +206,11 @@ namespace ButcherFactory.BO.LocalBL
var entity = new SegmentProduction();
entity.Goods_ID = goodsID;
entity.Weight = weight;
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
entity.WorkUnit_ID = workUnitID;
entity.ProductBatch_ID = productBatchID;
entity.RowIndex = GenerateRowIndex(productBatchID, session);
- entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate, AppContext.ConnectInfo.ClientCode, entity.RowIndex);
+ entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate, BO.Utils.AppContext.ConnectInfo.ClientCode, entity.RowIndex);
session.Insert(entity);
FillMsgID(session, entity);
session.Commit();
@@ -222,7 +222,7 @@ namespace ButcherFactory.BO.LocalBL
{
var update = new DQUpdateDom(typeof(SegmentProduction));
update.Where.Conditions.Add(DQCondition.EQ("ID", item.ID));
- update.Columns.Add(new DQUpdateColumn("MsgID", string.Format("{0}_{1}", AppContext.ConnectInfo.ClientCode, item.ID)));
+ update.Columns.Add(new DQUpdateColumn("MsgID", string.Format("{0}_{1}", BO.Utils.AppContext.ConnectInfo.ClientCode, item.ID)));
session.ExecuteNonQuery(update);
}
@@ -230,9 +230,9 @@ namespace ButcherFactory.BO.LocalBL
{
using (var session = DmoSession.New())
{
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
entity.RowIndex = GenerateRowIndex(entity.ProductBatch_ID, session);
- entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate, AppContext.ConnectInfo.ClientCode, entity.RowIndex);
+ entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", batchDate, BO.Utils.AppContext.ConnectInfo.ClientCode, entity.RowIndex);
entity.Submited = true;
session.Insert(entity);
FillGroupIDAsID(session, entity.ID);
@@ -250,11 +250,11 @@ namespace ButcherFactory.BO.LocalBL
{
using (var session = DmoSession.New())
{
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
entity.RowIndex = TotalCodeRowIndex(date, session);
// 年月日+2位机器号+4位顺序号
- entity.BarCode = string.Format("{0:yyyyMMdd}{1}{2:0000}", date, AppContext.ConnectInfo.ClientCode, entity.RowIndex);
+ entity.BarCode = string.Format("{0:yyyyMMdd}{1}{2:0000}", date, BO.Utils.AppContext.ConnectInfo.ClientCode, entity.RowIndex);
session.Insert(entity);
session.Commit();
@@ -272,11 +272,11 @@ namespace ButcherFactory.BO.LocalBL
if (tuple == null)
{
entity = new TotalCode();
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
entity.GoodsType = 0;
entity.RowIndex = 1;
// 年月日+2位机器号
- entity.BarCode = string.Format("{0:yyyyMMdd}{1}", date, AppContext.ConnectInfo.ClientCode);
+ entity.BarCode = string.Format("{0:yyyyMMdd}{1}", date, BO.Utils.AppContext.ConnectInfo.ClientCode);
session.Insert(entity);
session.Commit();
}
@@ -316,7 +316,7 @@ namespace ButcherFactory.BO.LocalBL
{
var update = new DQUpdateDom(typeof(SegmentProduction));
update.Where.Conditions.Add(DQCondition.EQ("ID", id));
- update.Columns.Add(new DQUpdateColumn("MsgID", string.Format("{0}_{1}", AppContext.ConnectInfo.ClientCode, id)));
+ update.Columns.Add(new DQUpdateColumn("MsgID", string.Format("{0}_{1}", BO.Utils.AppContext.ConnectInfo.ClientCode, id)));
update.Columns.Add(new DQUpdateColumn("GroupID", id));
session.ExecuteNonQuery(update);
}
diff --git a/ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs b/ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs
index 878770c..26e46e7 100644
--- a/ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs
+++ b/ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs
@@ -64,7 +64,7 @@ namespace ButcherFactory.BO.LocalBL
using (var session = DmoSession.New())
{
entity.Number = 1;
- entity.UserID = AppContext.Worker.ID;
+ entity.UserID = BO.Utils.AppContext.Worker.ID;
CreateBarCode(session, entity);
session.Insert(entity);
session.Commit();
@@ -76,7 +76,7 @@ namespace ButcherFactory.BO.LocalBL
var query = new DQueryDom(new JoinAlias(typeof(WeightCountEntity)));
query.Where.Conditions.Add(DQCondition.Between("CreateTime", entity.CreateTime.Date, entity.CreateTime.Date + new TimeSpan(23, 59, 59)));
query.Columns.Add(DQSelectColumn.Count());
- entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", entity.CreateTime, AppContext.ConnectInfo.ClientCode, query.EExecuteScalar(session));
+ entity.BarCode = string.Format("260912011{0:yyyyMMdd}{1}{2:00000}", entity.CreateTime, BO.Utils.AppContext.ConnectInfo.ClientCode, query.EExecuteScalar(session));
}
public static void UpdateNumber(long id, int number)
diff --git a/ButcherFactory.BO/Utils/Extensions.cs b/ButcherFactory.BO/Utils/Extensions.cs
index 0547504..10cde78 100644
--- a/ButcherFactory.BO/Utils/Extensions.cs
+++ b/ButcherFactory.BO/Utils/Extensions.cs
@@ -15,7 +15,7 @@ namespace ButcherFactory.BO
{
public static IDmoSessionWithTransaction New()
{
- return Dmo.NewSession(AppContext.ConnectInfo.SqlConnection);
+ return Dmo.NewSession(BO.Utils.AppContext.ConnectInfo.SqlConnection);
}
}
diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj
index 2b667ee..8afbf03 100644
--- a/ButcherFactory.Form/ButcherFactory.Form.csproj
+++ b/ButcherFactory.Form/ButcherFactory.Form.csproj
@@ -9,8 +9,9 @@
Properties
ButcherFactory
ButcherFactory.Form
- v4.5
+ v4.8
512
+
true
@@ -28,6 +29,7 @@
TRACE
prompt
4
+ x86
@@ -210,6 +212,7 @@
SegmentPickUpForm.cs
+
Form
@@ -228,6 +231,7 @@
IdentifySelectionDialog.cs
+
Form
@@ -253,6 +257,7 @@
ViewTaskForm.cs
+
Form
@@ -422,6 +427,7 @@
+
diff --git a/ButcherFactory.Form/Controls/WeightControl.Designer.cs b/ButcherFactory.Form/Controls/WeightControl.Designer.cs
index 6de3a7b..2015bec 100644
--- a/ButcherFactory.Form/Controls/WeightControl.Designer.cs
+++ b/ButcherFactory.Form/Controls/WeightControl.Designer.cs
@@ -97,6 +97,7 @@
this.roundPanel2.Name = "roundPanel2";
this.roundPanel2.Size = new System.Drawing.Size(164, 74);
this.roundPanel2.TabIndex = 0;
+ this.roundPanel2.Paint += new System.Windows.Forms.PaintEventHandler(this.roundPanel2_Paint);
//
// lblChengZhong
//
diff --git a/ButcherFactory.Form/Controls/WeightControl.cs b/ButcherFactory.Form/Controls/WeightControl.cs
index 3af8fae..ac235de 100644
--- a/ButcherFactory.Form/Controls/WeightControl.cs
+++ b/ButcherFactory.Form/Controls/WeightControl.cs
@@ -309,6 +309,11 @@ namespace ButcherFactory.Controls
}
if (weightPort.IsOpen)
weightPort.Close();
- }
+ }
+
+ private void roundPanel2_Paint(object sender, PaintEventArgs e)
+ {
+
+ }
}
}
diff --git a/ButcherFactory.Form/Dialogs/AddWeightRecord.cs b/ButcherFactory.Form/Dialogs/AddWeightRecord.cs
index 278b440..f1597ad 100644
--- a/ButcherFactory.Form/Dialogs/AddWeightRecord.cs
+++ b/ButcherFactory.Form/Dialogs/AddWeightRecord.cs
@@ -49,7 +49,7 @@ namespace ButcherFactory.Dialogs
record.Goods_Name = mDetail.Goods_Name;
record.Number = number;
record.Weight = weight;
- record.Operator = AppContext.Worker.Name;
+ record.Operator = BO.Utils.AppContext.Worker.Name;
var flag = mDetail.Goods_ID == 7318 ? -1 : 0; //套猪袋
CarcassSaleOutBL.AddAndUpdate(record, flag, mProductTime);
DialogResult = DialogResult.OK;
diff --git a/ButcherFactory.Form/Properties/Resources.Designer.cs b/ButcherFactory.Form/Properties/Resources.Designer.cs
index 689a32f..c9557f1 100644
--- a/ButcherFactory.Form/Properties/Resources.Designer.cs
+++ b/ButcherFactory.Form/Properties/Resources.Designer.cs
@@ -19,7 +19,7 @@ namespace ButcherFactory.Properties {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [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 {
@@ -47,8 +47,8 @@ namespace ButcherFactory.Properties {
}
///
- /// 使用此强类型资源类,为所有资源查找
- /// 重写当前线程的 CurrentUICulture 属性。
+ /// 重写当前线程的 CurrentUICulture 属性,对
+ /// 使用此强类型资源类的所有资源查找执行重写。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
diff --git a/ButcherFactory.Form/SegmentProductionAuto_/CallLibrary.cs b/ButcherFactory.Form/SegmentProductionAuto_/CallLibrary.cs
new file mode 100644
index 0000000..bd789b3
--- /dev/null
+++ b/ButcherFactory.Form/SegmentProductionAuto_/CallLibrary.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ButcherFactory.SegmentProductionAuto_
+{
+ static class CallLibrary
+ {
+ #region 调用 scale DLL
+ public delegate void pFunCallback(IntPtr data, int length, IntPtr net);
+
+ [DllImport("ScaleLibrary.dll", EntryPoint = "SendZero", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
+ public static extern int SendZero();//归零
+
+ [DllImport("ScaleLibrary.dll", EntryPoint = "sendPort", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
+ public static extern int sendPort(int Port, int Buadrate);//设置端口
+
+ [DllImport("ScaleLibrary.dll", EntryPoint = "isZero", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
+ public static extern int isZero();//是否是零点
+
+ [DllImport("ScaleLibrary.dll", EntryPoint = "isStable", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
+ public static extern int isStable(); //是否稳定
+
+ [DllImport("ScaleLibrary.dll", EntryPoint = "isTare", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
+ public static extern int isTare(); //是否扣重
+
+ [DllImport("ScaleLibrary.dll", EntryPoint = "getStringNet", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
+ public static extern IntPtr getStringNet(); //获取解析好的重量
+
+ [DllImport("ScaleLibrary.dll", EntryPoint = "unbindScale", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
+ public static extern int unbindScale(); //释放接口
+ #endregion
+
+ }
+}
diff --git a/ButcherFactory.Form/SegmentProductionAuto_/ScaleLibrary.dll b/ButcherFactory.Form/SegmentProductionAuto_/ScaleLibrary.dll
new file mode 100644
index 0000000..8e472b1
Binary files /dev/null and b/ButcherFactory.Form/SegmentProductionAuto_/ScaleLibrary.dll differ
diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs
index 6cd589c..14d5187 100644
--- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs
+++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs
@@ -28,12 +28,13 @@
///
private void InitializeComponent()
{
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
+ this.components = new System.ComponentModel.Container();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
this.uLabel3 = new WinFormControl.ULabel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.taskDataGrid = new WinFormControl.UDataGridView();
@@ -49,10 +50,7 @@
this.label2 = new System.Windows.Forms.Label();
this.statisticNumberBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
- this.logBtn = new ButcherFactory.Controls.ColorButton();
this.msglbl = new System.Windows.Forms.Label();
- this.closeBtn = new ButcherFactory.Controls.ColorButton();
- this.uWeightControl1 = new ButcherFactory.Controls.WeightControl();
this.barPrintCheck = new System.Windows.Forms.CheckBox();
this.uTimerLabel1 = new WinFormControl.UTimerLabel();
this.productBatchSelect = new System.Windows.Forms.ComboBox();
@@ -61,17 +59,27 @@
this.uLabel2 = new WinFormControl.ULabel();
this.netStateWatch1 = new WinFormControl.NetStateWatch();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
- this.goodsSetBtn = new ButcherFactory.Controls.ColorButton();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel();
+ this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
+ this.timer1 = new System.Windows.Forms.Timer(this.components);
+ this.serialPort1 = new System.IO.Ports.SerialPort(this.components);
+ this.weightSwitch = new ButcherFactory.Controls.ColorButton();
+ this.zeroBtn = new ButcherFactory.Controls.ColorButton();
+ this.roundPanel2 = new ButcherFactory.Controls.RoundPanel(this.components);
+ this.labelStable = new System.Windows.Forms.Label();
+ this.labelZero = new System.Windows.Forms.Label();
+ this.lblChengZhong = new System.Windows.Forms.Label();
+ this.logBtn = new ButcherFactory.Controls.ColorButton();
+ this.closeBtn = new ButcherFactory.Controls.ColorButton();
+ this.goodsSetBtn = new ButcherFactory.Controls.ColorButton();
this.colorButton2 = new ButcherFactory.Controls.ColorButton();
this.viewTaskBtn = new ButcherFactory.Controls.ColorButton();
this.colorButton1 = new ButcherFactory.Controls.ColorButton();
this.deleteBtn = new ButcherFactory.Controls.ColorButton();
this.rePrintBtn = new ButcherFactory.Controls.ColorButton();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel();
- this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.taskDataGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@@ -83,6 +91,7 @@
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.groupBox1.SuspendLayout();
+ this.roundPanel2.SuspendLayout();
this.SuspendLayout();
//
// uLabel3
@@ -92,7 +101,7 @@
this.uLabel3.Font = new System.Drawing.Font("宋体", 12F);
this.uLabel3.Location = new System.Drawing.Point(8, 0);
this.uLabel3.Name = "uLabel3";
- this.uLabel3.Size = new System.Drawing.Size(72, 16);
+ this.uLabel3.Size = new System.Drawing.Size(71, 16);
this.uLabel3.TabIndex = 1;
this.uLabel3.Text = "生产历史";
//
@@ -112,15 +121,15 @@
this.taskDataGrid.AllowUserToDeleteRows = false;
this.taskDataGrid.AllowUserToResizeColumns = false;
this.taskDataGrid.AllowUserToResizeRows = false;
- dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
- this.taskDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7;
+ dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
+ this.taskDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.taskDataGrid.BackgroundColor = System.Drawing.Color.White;
this.taskDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None;
- dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F);
- dataGridViewCellStyle8.ForeColor = System.Drawing.Color.White;
- dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.taskDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8;
+ dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+ dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F);
+ dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
+ dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.taskDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.taskDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.taskDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.T_Item,
@@ -133,9 +142,9 @@
this.taskDataGrid.Name = "taskDataGrid";
this.taskDataGrid.ReadOnly = true;
this.taskDataGrid.RowHeadersVisible = false;
- dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
- this.taskDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle12;
+ dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
+ this.taskDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.taskDataGrid.RowTemplate.Height = 23;
this.taskDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.taskDataGrid.Size = new System.Drawing.Size(442, 96);
@@ -152,8 +161,8 @@
//
this.T_Need.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.T_Need.DataPropertyName = "Need";
- dataGridViewCellStyle9.Format = "#0.######";
- this.T_Need.DefaultCellStyle = dataGridViewCellStyle9;
+ dataGridViewCellStyle3.Format = "#0.######";
+ this.T_Need.DefaultCellStyle = dataGridViewCellStyle3;
this.T_Need.HeaderText = "订货";
this.T_Need.Name = "T_Need";
this.T_Need.ReadOnly = true;
@@ -162,8 +171,8 @@
//
this.T_Done.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.T_Done.DataPropertyName = "Done";
- dataGridViewCellStyle10.Format = "#0.######";
- this.T_Done.DefaultCellStyle = dataGridViewCellStyle10;
+ dataGridViewCellStyle4.Format = "#0.######";
+ this.T_Done.DefaultCellStyle = dataGridViewCellStyle4;
this.T_Done.HeaderText = "完工";
this.T_Done.Name = "T_Done";
this.T_Done.ReadOnly = true;
@@ -172,8 +181,8 @@
//
this.T_Last.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.T_Last.DataPropertyName = "Last";
- dataGridViewCellStyle11.Format = "#0.######";
- this.T_Last.DefaultCellStyle = dataGridViewCellStyle11;
+ dataGridViewCellStyle5.Format = "#0.######";
+ this.T_Last.DefaultCellStyle = dataGridViewCellStyle5;
this.T_Last.HeaderText = "剩余";
this.T_Last.Name = "T_Last";
this.T_Last.ReadOnly = true;
@@ -186,7 +195,7 @@
this.GoodsLabel.ForeColor = System.Drawing.Color.Blue;
this.GoodsLabel.Location = new System.Drawing.Point(144, 178);
this.GoodsLabel.Name = "GoodsLabel";
- this.GoodsLabel.Size = new System.Drawing.Size(72, 16);
+ this.GoodsLabel.Size = new System.Drawing.Size(71, 16);
this.GoodsLabel.TabIndex = 1;
this.GoodsLabel.Text = "存货名称";
//
@@ -202,6 +211,9 @@
//
// splitContainer1.Panel1
//
+ this.splitContainer1.Panel1.Controls.Add(this.weightSwitch);
+ this.splitContainer1.Panel1.Controls.Add(this.zeroBtn);
+ this.splitContainer1.Panel1.Controls.Add(this.roundPanel2);
this.splitContainer1.Panel1.Controls.Add(this.butcherDateBox);
this.splitContainer1.Panel1.Controls.Add(this.label3);
this.splitContainer1.Panel1.Controls.Add(this.numberInput);
@@ -211,7 +223,6 @@
this.splitContainer1.Panel1.Controls.Add(this.logBtn);
this.splitContainer1.Panel1.Controls.Add(this.msglbl);
this.splitContainer1.Panel1.Controls.Add(this.closeBtn);
- this.splitContainer1.Panel1.Controls.Add(this.uWeightControl1);
this.splitContainer1.Panel1.Controls.Add(this.barPrintCheck);
this.splitContainer1.Panel1.Controls.Add(this.uTimerLabel1);
this.splitContainer1.Panel1.Controls.Add(this.productBatchSelect);
@@ -288,21 +299,6 @@
this.label1.TabIndex = 26;
this.label1.Text = "统计数量:";
//
- // logBtn
- //
- this.logBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.logBtn.BackColor = System.Drawing.Color.CadetBlue;
- this.logBtn.Font = new System.Drawing.Font("宋体", 15F);
- this.logBtn.ForeColor = System.Drawing.Color.White;
- this.logBtn.Location = new System.Drawing.Point(680, 4);
- this.logBtn.Name = "logBtn";
- this.logBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
- this.logBtn.Size = new System.Drawing.Size(101, 41);
- this.logBtn.TabIndex = 25;
- this.logBtn.Text = "日志";
- this.logBtn.UseVisualStyleBackColor = false;
- this.logBtn.Click += new System.EventHandler(this.logBtn_Click);
- //
// msglbl
//
this.msglbl.AutoSize = true;
@@ -313,30 +309,6 @@
this.msglbl.TabIndex = 24;
this.msglbl.Text = "正在获取基础信息";
//
- // closeBtn
- //
- this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.closeBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25)))));
- this.closeBtn.Font = new System.Drawing.Font("宋体", 15F);
- this.closeBtn.ForeColor = System.Drawing.Color.White;
- this.closeBtn.Location = new System.Drawing.Point(1109, 7);
- this.closeBtn.Name = "closeBtn";
- this.closeBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
- this.closeBtn.Size = new System.Drawing.Size(111, 41);
- this.closeBtn.TabIndex = 18;
- this.closeBtn.Text = "关闭";
- this.closeBtn.UseVisualStyleBackColor = false;
- this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click);
- //
- // uWeightControl1
- //
- this.uWeightControl1.BackColor = System.Drawing.Color.Transparent;
- this.uWeightControl1.Location = new System.Drawing.Point(12, 7);
- this.uWeightControl1.Name = "uWeightControl1";
- this.uWeightControl1.Size = new System.Drawing.Size(262, 74);
- this.uWeightControl1.TabIndex = 17;
- this.uWeightControl1.WeightFalg = null;
- //
// barPrintCheck
//
this.barPrintCheck.AutoSize = true;
@@ -357,7 +329,7 @@
this.uTimerLabel1.Format = "M月d日 H:mm:ss";
this.uTimerLabel1.Location = new System.Drawing.Point(1084, 53);
this.uTimerLabel1.Name = "uTimerLabel1";
- this.uTimerLabel1.Size = new System.Drawing.Size(136, 16);
+ this.uTimerLabel1.Size = new System.Drawing.Size(135, 16);
this.uTimerLabel1.TabIndex = 14;
this.uTimerLabel1.Text = "4月21日 16:32:19";
//
@@ -441,21 +413,6 @@
this.splitContainer2.SplitterDistance = 761;
this.splitContainer2.TabIndex = 0;
//
- // goodsSetBtn
- //
- this.goodsSetBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.goodsSetBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
- this.goodsSetBtn.Font = new System.Drawing.Font("宋体", 15F);
- this.goodsSetBtn.ForeColor = System.Drawing.Color.White;
- this.goodsSetBtn.Location = new System.Drawing.Point(645, 3);
- this.goodsSetBtn.Name = "goodsSetBtn";
- this.goodsSetBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
- this.goodsSetBtn.Size = new System.Drawing.Size(111, 62);
- this.goodsSetBtn.TabIndex = 19;
- this.goodsSetBtn.Text = "产品设置";
- this.goodsSetBtn.UseVisualStyleBackColor = false;
- this.goodsSetBtn.Click += new System.EventHandler(this.goodsSetBtn_Click);
- //
// flowLayoutPanel2
//
this.flowLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -478,6 +435,179 @@
this.flowLayoutPanel1.Size = new System.Drawing.Size(640, 70);
this.flowLayoutPanel1.TabIndex = 22;
//
+ // groupBox1
+ //
+ this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)));
+ this.groupBox1.Controls.Add(this.flowLayoutPanel4);
+ this.groupBox1.Controls.Add(this.flowLayoutPanel3);
+ this.groupBox1.Controls.Add(this.uLabel3);
+ this.groupBox1.Location = new System.Drawing.Point(8, 222);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Padding = new System.Windows.Forms.Padding(5);
+ this.groupBox1.Size = new System.Drawing.Size(447, 381);
+ this.groupBox1.TabIndex = 5;
+ this.groupBox1.TabStop = false;
+ //
+ // flowLayoutPanel4
+ //
+ this.flowLayoutPanel4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.flowLayoutPanel4.AutoScroll = true;
+ this.flowLayoutPanel4.Location = new System.Drawing.Point(5, 90);
+ this.flowLayoutPanel4.Name = "flowLayoutPanel4";
+ this.flowLayoutPanel4.Size = new System.Drawing.Size(437, 286);
+ this.flowLayoutPanel4.TabIndex = 5;
+ //
+ // flowLayoutPanel3
+ //
+ this.flowLayoutPanel3.AutoScroll = true;
+ this.flowLayoutPanel3.BackColor = System.Drawing.Color.White;
+ this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Top;
+ this.flowLayoutPanel3.Location = new System.Drawing.Point(5, 19);
+ this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(0);
+ this.flowLayoutPanel3.Name = "flowLayoutPanel3";
+ this.flowLayoutPanel3.Size = new System.Drawing.Size(437, 68);
+ this.flowLayoutPanel3.TabIndex = 4;
+ this.flowLayoutPanel3.WrapContents = false;
+ //
+ // timer1
+ //
+ this.timer1.Interval = 50;
+ this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+ //
+ // serialPort1
+ //
+ this.serialPort1.PortName = "COM3";
+ //
+ // weightSwitch
+ //
+ this.weightSwitch.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
+ this.weightSwitch.Font = new System.Drawing.Font("宋体", 10F);
+ this.weightSwitch.ForeColor = System.Drawing.Color.White;
+ this.weightSwitch.Location = new System.Drawing.Point(173, 43);
+ this.weightSwitch.Name = "weightSwitch";
+ this.weightSwitch.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
+ this.weightSwitch.Size = new System.Drawing.Size(90, 32);
+ this.weightSwitch.StateHold = true;
+ this.weightSwitch.TabIndex = 38;
+ this.weightSwitch.Text = "启用称重";
+ this.weightSwitch.UseVisualStyleBackColor = false;
+ this.weightSwitch.Click += new System.EventHandler(this.weightSwitch_Click);
+ //
+ // zeroBtn
+ //
+ this.zeroBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222)))));
+ this.zeroBtn.Font = new System.Drawing.Font("宋体", 10F);
+ this.zeroBtn.ForeColor = System.Drawing.Color.White;
+ this.zeroBtn.Location = new System.Drawing.Point(173, 4);
+ this.zeroBtn.Name = "zeroBtn";
+ this.zeroBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
+ this.zeroBtn.Size = new System.Drawing.Size(90, 32);
+ this.zeroBtn.TabIndex = 37;
+ this.zeroBtn.Text = "归零";
+ this.zeroBtn.UseVisualStyleBackColor = false;
+ this.zeroBtn.Click += new System.EventHandler(this.zeroBtn_Click);
+ //
+ // roundPanel2
+ //
+ this.roundPanel2._setRoundRadius = 15;
+ this.roundPanel2.BackColor = System.Drawing.Color.Black;
+ this.roundPanel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.roundPanel2.Controls.Add(this.labelStable);
+ this.roundPanel2.Controls.Add(this.labelZero);
+ this.roundPanel2.Controls.Add(this.lblChengZhong);
+ this.roundPanel2.Location = new System.Drawing.Point(6, 3);
+ this.roundPanel2.Margin = new System.Windows.Forms.Padding(0);
+ this.roundPanel2.Name = "roundPanel2";
+ this.roundPanel2.Size = new System.Drawing.Size(162, 74);
+ this.roundPanel2.TabIndex = 36;
+ //
+ // labelStable
+ //
+ this.labelStable.AutoSize = true;
+ this.labelStable.BackColor = System.Drawing.Color.White;
+ this.labelStable.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.labelStable.Font = new System.Drawing.Font("微软雅黑", 9F);
+ this.labelStable.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+ this.labelStable.Location = new System.Drawing.Point(119, 1);
+ this.labelStable.Name = "labelStable";
+ this.labelStable.Size = new System.Drawing.Size(17, 19);
+ this.labelStable.TabIndex = 13;
+ this.labelStable.Text = "S";
+ this.labelStable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // labelZero
+ //
+ this.labelZero.AutoSize = true;
+ this.labelZero.BackColor = System.Drawing.Color.White;
+ this.labelZero.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.labelZero.Font = new System.Drawing.Font("微软雅黑", 9F);
+ this.labelZero.Location = new System.Drawing.Point(138, 1);
+ this.labelZero.Name = "labelZero";
+ this.labelZero.Size = new System.Drawing.Size(17, 19);
+ this.labelZero.TabIndex = 12;
+ this.labelZero.Text = "0";
+ this.labelZero.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // lblChengZhong
+ //
+ this.lblChengZhong.AutoSize = true;
+ this.lblChengZhong.Font = new System.Drawing.Font("宋体", 25F);
+ this.lblChengZhong.ForeColor = System.Drawing.Color.Red;
+ this.lblChengZhong.Location = new System.Drawing.Point(5, 19);
+ this.lblChengZhong.Margin = new System.Windows.Forms.Padding(0);
+ this.lblChengZhong.Name = "lblChengZhong";
+ this.lblChengZhong.Size = new System.Drawing.Size(83, 34);
+ this.lblChengZhong.TabIndex = 0;
+ this.lblChengZhong.Text = "0.00";
+ //
+ // logBtn
+ //
+ this.logBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.logBtn.BackColor = System.Drawing.Color.CadetBlue;
+ this.logBtn.Font = new System.Drawing.Font("宋体", 15F);
+ this.logBtn.ForeColor = System.Drawing.Color.White;
+ this.logBtn.Location = new System.Drawing.Point(680, 4);
+ this.logBtn.Name = "logBtn";
+ this.logBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
+ this.logBtn.Size = new System.Drawing.Size(101, 41);
+ this.logBtn.TabIndex = 25;
+ this.logBtn.Text = "日志";
+ this.logBtn.UseVisualStyleBackColor = false;
+ this.logBtn.Click += new System.EventHandler(this.logBtn_Click);
+ //
+ // closeBtn
+ //
+ this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.closeBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25)))));
+ this.closeBtn.Font = new System.Drawing.Font("宋体", 15F);
+ this.closeBtn.ForeColor = System.Drawing.Color.White;
+ this.closeBtn.Location = new System.Drawing.Point(1109, 7);
+ this.closeBtn.Name = "closeBtn";
+ this.closeBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
+ this.closeBtn.Size = new System.Drawing.Size(111, 41);
+ this.closeBtn.TabIndex = 18;
+ this.closeBtn.Text = "关闭";
+ this.closeBtn.UseVisualStyleBackColor = false;
+ this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click);
+ //
+ // goodsSetBtn
+ //
+ this.goodsSetBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.goodsSetBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245)))));
+ this.goodsSetBtn.Font = new System.Drawing.Font("宋体", 15F);
+ this.goodsSetBtn.ForeColor = System.Drawing.Color.White;
+ this.goodsSetBtn.Location = new System.Drawing.Point(645, 3);
+ this.goodsSetBtn.Name = "goodsSetBtn";
+ this.goodsSetBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
+ this.goodsSetBtn.Size = new System.Drawing.Size(111, 62);
+ this.goodsSetBtn.TabIndex = 19;
+ this.goodsSetBtn.Text = "产品设置";
+ this.goodsSetBtn.UseVisualStyleBackColor = false;
+ this.goodsSetBtn.Click += new System.EventHandler(this.goodsSetBtn_Click);
+ //
// colorButton2
//
this.colorButton2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
@@ -552,43 +682,6 @@
this.rePrintBtn.Visible = false;
this.rePrintBtn.Click += new System.EventHandler(this.rePrintBtn_Click);
//
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox1.Controls.Add(this.flowLayoutPanel4);
- this.groupBox1.Controls.Add(this.flowLayoutPanel3);
- this.groupBox1.Controls.Add(this.uLabel3);
- this.groupBox1.Location = new System.Drawing.Point(8, 222);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Padding = new System.Windows.Forms.Padding(5);
- this.groupBox1.Size = new System.Drawing.Size(447, 381);
- this.groupBox1.TabIndex = 5;
- this.groupBox1.TabStop = false;
- //
- // flowLayoutPanel4
- //
- this.flowLayoutPanel4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.flowLayoutPanel4.AutoScroll = true;
- this.flowLayoutPanel4.Location = new System.Drawing.Point(5, 90);
- this.flowLayoutPanel4.Name = "flowLayoutPanel4";
- this.flowLayoutPanel4.Size = new System.Drawing.Size(437, 286);
- this.flowLayoutPanel4.TabIndex = 5;
- //
- // flowLayoutPanel3
- //
- this.flowLayoutPanel3.AutoScroll = true;
- this.flowLayoutPanel3.BackColor = System.Drawing.Color.White;
- this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Top;
- this.flowLayoutPanel3.Location = new System.Drawing.Point(5, 19);
- this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(0);
- this.flowLayoutPanel3.Name = "flowLayoutPanel3";
- this.flowLayoutPanel3.Size = new System.Drawing.Size(437, 68);
- this.flowLayoutPanel3.TabIndex = 4;
- this.flowLayoutPanel3.WrapContents = false;
- //
// SegmentProductionAutoForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -599,6 +692,7 @@
this.Name = "SegmentProductionAutoForm";
this.Text = "分割品车间称重计数";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+ this.Load += new System.EventHandler(this.SegmentProductionAutoForm_Load);
this.groupBox2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.taskDataGrid)).EndInit();
this.splitContainer1.Panel1.ResumeLayout(false);
@@ -613,6 +707,8 @@
this.splitContainer2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
+ this.roundPanel2.ResumeLayout(false);
+ this.roundPanel2.PerformLayout();
this.ResumeLayout(false);
}
@@ -638,7 +734,6 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
- private Controls.WeightControl uWeightControl1;
private Controls.ColorButton rePrintBtn;
private Controls.ColorButton closeBtn;
private Controls.ColorButton goodsSetBtn;
@@ -657,5 +752,13 @@
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4;
private System.Windows.Forms.Label label3;
private WinFormControl.ULabel butcherDateBox;
+ private Controls.ColorButton weightSwitch;
+ private Controls.ColorButton zeroBtn;
+ private Controls.RoundPanel roundPanel2;
+ private System.Windows.Forms.Label lblChengZhong;
+ private System.Windows.Forms.Timer timer1;
+ private System.IO.Ports.SerialPort serialPort1;
+ private System.Windows.Forms.Label labelStable;
+ private System.Windows.Forms.Label labelZero;
}
}
\ No newline at end of file
diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs
index 2d10d82..c8e2d7d 100644
--- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs
+++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs
@@ -17,7 +17,8 @@ using WinFormControl;
using ButcherFactory.Utils;
using NotAuto = ButcherFactory.SegmentProduction_;
using ButcherFactory.Controls;
-
+using System.Runtime.InteropServices;
+
namespace ButcherFactory.SegmentProductionAuto_
{
public partial class SegmentProductionAutoForm : Form, IWithRoleForm
@@ -84,6 +85,8 @@ namespace ButcherFactory.SegmentProductionAuto_
uploadData.Abort();
if (checkInStoreState != null && checkInStoreState.IsAlive)
checkInStoreState.Abort();
+ if (Utils.mPortOpened)
+ closePort();
}
public WeightDetails mCache;
@@ -125,6 +128,7 @@ namespace ButcherFactory.SegmentProductionAuto_
_freshTotalCode = SegmentProductionBL.InitFreshTotalCode();
_stayTotalCode = SegmentProductionBL.InitStayTotalCode();
identityList = SegmentProductionBL.GetGoodsIdentify();
+
}
void LoadBind()
@@ -233,7 +237,16 @@ namespace ButcherFactory.SegmentProductionAuto_
return;
}
}
- var weight = uWeightControl1.Weight;
+ if (!status.StableStatus)
+ {
+ MessageBox.Show("称重稳定后再操作!");
+ return;
+ }
+ decimal weight = 0;
+ if (!decimal.TryParse(lblChengZhong.Text, out weight)) {
+ MessageBox.Show("重量错误,是否未归零!");
+ return;
+ }
//#if DEBUG
// if (weight == 0)
// weight = (g.StandardWeightLow ?? 4.0m) + 0.1m;
@@ -332,13 +345,23 @@ namespace ButcherFactory.SegmentProductionAuto_
if (batchID == null)
throw new Exception("请先选择批次");
var btn = sender as ColorButton;
- var detail = btn.Tag as ClientGoodsSet_Detail;
- var weight = uWeightControl1.Weight;
-//#if DEBUG
- // if (weight == 0)
- // weight = (detail.StandardWeightLow ?? 4.0m) + 0.1m;
-//#endif
- if (weight <= 0)
+ var detail = btn.Tag as ClientGoodsSet_Detail;
+ if (!status.StableStatus)
+ {
+ MessageBox.Show("称重稳定后再操作!");
+ return;
+ }
+ decimal weight = 0;
+ if (!decimal.TryParse(lblChengZhong.Text, out weight))
+ {
+ MessageBox.Show("重量错误,是否未归零!");
+ return;
+ }
+ //#if DEBUG
+ // if (weight == 0)
+ // weight = (detail.StandardWeightLow ?? 4.0m) + 0.1m;
+ //#endif
+ if (weight <= 0)
throw new Exception("重量必须大于0");
if (detail.StandardWeight.HasValue)
@@ -1084,5 +1107,188 @@ namespace ButcherFactory.SegmentProductionAuto_
butcherDateBox.Text = butcherDate.ToString("yyyy-MM-dd");
}
}
+
+ WeightStatus status = new WeightStatus();
+ #region 称相关
+ private void init()
+ {
+ zeroBtn.Enabled = false;
+ // weightSwitch.Enabled = false;
+ System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;//忽略程序跨越线程运行导致的错误.没有此句将会产生错误
+ }
+
+ private void weightSwitch_Click(object sender, EventArgs e)
+ {
+ this.lblChengZhong.Text = "0.00";
+ if (Utils.mPortOpened)//关闭动作
+ {
+ if (CallLibrary.unbindScale() == 1)
+ {
+ Utils.mPortOpened = false; //串口打开标记
+ closePort();
+ }
+ }
+ else
+ {
+ if (!Utils.mPortOpened)
+ {
+ openPort();
+ }
+ }
+ weightSwitch.Text = Utils.mPortOpened ? "停止称重" : "启用称重";
+ }
+
+ #region 打开 关闭 串口
+ private void openPort()
+ {
+ try
+ {
+ int port = 3;
+ int baudrate = 9600;
+ if (CallLibrary.sendPort(port, baudrate) == 1)
+ {
+ Utils.mPortOpened = true; //串口打开标记
+ timer1.Enabled = true;
+ zeroBtn.Enabled = true;
+ //this.labelStatus.Text = Utils.rm.GetString("comOpen");
+
+ //Console.WriteLine("Open port Complete.");
+ }
+ else
+ {
+ Utils.mPortOpened = false; //串口打开标记
+ timer1.Enabled = false;
+ MessageBox.Show("串口打开失败");
+ // this.labelStatus.Text = Utils.rm.GetString("comFail");
+ // Console.WriteLine("Open port fail .");
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("" + ex);
+ }
+ }
+
+ private void closePort()
+ {
+ timer1.Enabled = false;
+ Utils.mPortOpened = false;
+ // this.labelStatus.Text = Utils.rm.GetString("comClose");
+ this.zeroBtn.Enabled = false;
+
+ this.labelZero.BackColor = Color.White;
+ this.labelZero.ForeColor = Color.Black;
+ this.labelStable.BackColor = Color.White;
+ this.labelStable.ForeColor = Color.Black;
+ status.TareStatus = false;
+ }
+ #endregion
+
+ private void zeroBtn_Click(object sender, EventArgs e)
+ {
+ if (CallLibrary.SendZero() == 1)
+ {
+ //MessageBox.Show("Zero is successful");
+ // MessageBox.Show(Utils.rm.GetString("zeroIsOk"));
+ }
+ else
+ {
+ MessageBox.Show(Utils.rm.GetString("zeroisFail"));
+ }
+ }
+ #endregion
+
+ private void SegmentProductionAutoForm_Load(object sender, EventArgs e)
+ {
+ init();
+ }
+
+ #region 重量处理
+ string netWeight = string.Empty;
+ private void timer1_Tick(object sender, EventArgs e)
+ {
+ try
+ {
+ timer1.Interval = 100;
+ if (Utils.mPortOpened)
+ {
+ IntPtr stringNet = CallLibrary.getStringNet();
+
+ netWeight = Marshal.PtrToStringAnsi(stringNet); //重量
+
+ Console.WriteLine("weight data:" + netWeight);
+
+ weightNet(netWeight);
+ if (CallLibrary.isZero() != 1)
+ {
+ this.labelZero.BackColor = Color.White;
+ this.labelZero.ForeColor = Color.Black;
+ status.ZeroStatus = false;
+ }
+ else
+ {
+ this.labelZero.BackColor = Color.Green;
+ this.labelZero.ForeColor = Color.White;
+ status.ZeroStatus = true;
+ }
+ //稳定
+ if (CallLibrary.isStable() != 1)
+ {
+ this.labelStable.BackColor = Color.White;
+ this.labelStable.ForeColor = Color.Black;
+ status.StableStatus = false;
+ }
+ else
+ {
+ this.labelStable.BackColor = Color.Green;
+ this.labelStable.ForeColor = Color.White;
+ status.StableStatus = true;
+ }
+ if (CallLibrary.isTare() != 1)
+ {
+ status.TareStatus = false;
+ }
+ else
+ {
+ status.TareStatus = true;
+ }
+ }
+ else
+ {
+ this.lblChengZhong.Text = "0.00";
+ this.labelZero.BackColor = Color.White;
+ //this.labelStatus.BackColor = Color.White;
+ //this.labelStatus.ForeColor = Color.Black;
+ }
+ }
+ catch //(Exception ex)
+ {
+ //Console.WriteLine(ex);
+ }
+ }
+
+ private void weightNet(string netWeight)
+ {
+ if (netWeight != null)
+ {
+ if (!netWeight.Contains("--UL--") && !netWeight.Contains("--OL--"))
+ {
+ this.lblChengZhong.Text = double.Parse(netWeight).ToString("0.00");
+ }
+ else
+ {
+ if (netWeight.Contains("--UL--"))
+ {
+ this.lblChengZhong.Text = "--UL--";
+ }
+ else if (netWeight.Contains("--OL--"))
+ {
+ this.lblChengZhong.Text = "--OL--";
+ }
+ }
+ }
+ }
+
+ #endregion
}
}
diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.resx b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.resx
index 08a9e5f..e4198b0 100644
--- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.resx
+++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.resx
@@ -120,4 +120,10 @@
True
+
+ 216, 16
+
+
+ 306, 16
+
\ No newline at end of file
diff --git a/ButcherFactory.Form/SegmentProductionAuto_/Utils.cs b/ButcherFactory.Form/SegmentProductionAuto_/Utils.cs
new file mode 100644
index 0000000..7afdb49
--- /dev/null
+++ b/ButcherFactory.Form/SegmentProductionAuto_/Utils.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Resources;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ButcherFactory.SegmentProductionAuto_
+{
+ internal class Utils
+ {
+ public static bool mPortOpened = false; //串口状态
+
+ public static bool WFlag = true; //w1 & w2 状态显示
+
+ //配置文件位置
+ public static ResourceManager rm = new ResourceManager(typeof(SegmentProductionAutoForm)); //资源文件
+ }
+}
diff --git a/ButcherFactory.Form/SegmentProductionAuto_/WeightStatus.cs b/ButcherFactory.Form/SegmentProductionAuto_/WeightStatus.cs
new file mode 100644
index 0000000..ead656f
--- /dev/null
+++ b/ButcherFactory.Form/SegmentProductionAuto_/WeightStatus.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ButcherFactory.SegmentProductionAuto_
+{
+ internal class WeightStatus
+ {
+ private bool isZero;
+ ///
+ /// 零点状态
+ ///
+ public bool ZeroStatus
+ {
+ get { return isZero; }
+ set { isZero = value; }
+ }
+ private bool isTare;
+
+ ///
+ /// 扣重状态
+ ///
+ public bool TareStatus
+ {
+ get { return isTare; }
+ set { isTare = value; }
+ }
+ private bool isStable;
+
+ ///
+ /// 稳定状态
+ ///
+ public bool StableStatus
+ {
+ get { return isStable; }
+ set { isStable = value; }
+ }
+ }
+}
diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs
index 940d09f..97270b0 100644
--- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs
+++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs
@@ -19,7 +19,7 @@ namespace ButcherFactory.SegmentProduction_
static string CustomerDefine = "GB/T9959.2-2008";
public static void Print(SegmentProduction entity, DateTime? dt, string template)
{
- if (AppContext.ConnectInfo.TraceBackUrl == "default")
+ if (BO.Utils.AppContext.ConnectInfo.TraceBackUrl == "default")
throw new Exception("请先配置追溯服务器地址");
if (dt == null)
dt = DateTime.Today;
@@ -42,7 +42,7 @@ namespace ButcherFactory.SegmentProduction_
code = code.Substring(17);
dic.Add("$Code", code);
var imgUrl = string.Format(IMGFILE, id);
- var url = string.Format(AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode);
+ var url = string.Format(BO.Utils.AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode);
BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 120);
dic.Add("$ImageUrl", imgUrl);
dic.Add("$Identity", entity.Identify);
diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentSumCodePrint.cs b/ButcherFactory.Form/SegmentProduction_/SegmentSumCodePrint.cs
index d40f586..db31160 100644
--- a/ButcherFactory.Form/SegmentProduction_/SegmentSumCodePrint.cs
+++ b/ButcherFactory.Form/SegmentProduction_/SegmentSumCodePrint.cs
@@ -18,7 +18,7 @@ namespace ButcherFactory.SegmentProduction_
const string IMGFILE = @"TempImg\_sum_img{0}.png";
public static void Print(SegmentProduction[] entitys, string template)
{
- if (AppContext.ConnectInfo.TraceBackUrl == "default")
+ if (BO.Utils.AppContext.ConnectInfo.TraceBackUrl == "default")
throw new Exception("请先配置追溯服务器地址");
var dic = new Dictionary();
diff --git a/ButcherFactory.Form/WeightCount_/WeightCountPrint.cs b/ButcherFactory.Form/WeightCount_/WeightCountPrint.cs
index 07ac8ff..5250142 100644
--- a/ButcherFactory.Form/WeightCount_/WeightCountPrint.cs
+++ b/ButcherFactory.Form/WeightCount_/WeightCountPrint.cs
@@ -26,7 +26,7 @@ namespace ButcherFactory.WeightCount_
code = code.Substring(17);
dic.Add("$Code", code);
var imgUrl = string.Format(IMGFILE, id);
- var url = string.Format(AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode);
+ var url = string.Format(BO.Utils.AppContext.ConnectInfo.TraceBackUrl + "?code={0}", entity.BarCode);
BwpClientPrint.BwpClientWebPrint.Create2DPic(url, imgUrl, 120);
dic.Add("$ImageUrl", imgUrl);
diff --git a/ButcherFactory.Login/App.xaml.cs b/ButcherFactory.Login/App.xaml.cs
index a0e0cf0..b2e0930 100644
--- a/ButcherFactory.Login/App.xaml.cs
+++ b/ButcherFactory.Login/App.xaml.cs
@@ -100,9 +100,9 @@ namespace ButcherFactory.Login
{
try
{
- if (!string.IsNullOrEmpty(AppContext.ConnectInfo.SqlConnection))
+ if (!string.IsNullOrEmpty(BO.Utils.AppContext.ConnectInfo.SqlConnection))
{
- DbUtil.UpdateDatabase(AppContext.ConnectInfo.SqlConnection);
+ DbUtil.UpdateDatabase(BO.Utils.AppContext.ConnectInfo.SqlConnection);
}
}
catch
diff --git a/ButcherFactory.Login/ButcherFactory.Login.csproj b/ButcherFactory.Login/ButcherFactory.Login.csproj
index cb68adc..9f9dd42 100644
--- a/ButcherFactory.Login/ButcherFactory.Login.csproj
+++ b/ButcherFactory.Login/ButcherFactory.Login.csproj
@@ -9,7 +9,7 @@
Properties
ButcherFactory.Login
ButcherFactory.Login
- v4.5
+ v4.8
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
4
@@ -27,7 +27,7 @@
false
- AnyCPU
+ x86
pdbonly
true
bin\Release\
@@ -103,6 +103,9 @@
+
+
+