From 5f3c8fefcbc9a9d824e25a9b48502c28a2c1526a Mon Sep 17 00:00:00 2001 From: "liulb@mesnac.com" Date: Wed, 1 Nov 2023 17:13:11 +0800 Subject: [PATCH] =?UTF-8?q?2.=E5=AE=89=E5=85=A8=E5=BA=93=E5=AD=98=E8=BE=93?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BinManage/BinHelper.cs | 99 ++++++++++- .../BinManage/FrmBin.cs | 2 +- .../BinManage/InitBinFormAction.cs | 2 +- .../BinManage/ModifyBinAction.cs | 2 +- .../BinManage/RefreshBinAction.cs | 5 +- .../BinManage/SyncAction.cs | 7 +- .../BinManage/UpLoadAction.cs | 18 +- .../Entity/PptPlan/Pmt_Bin.cs | 35 ++++ .../FinishBatch/SaveHelper/AlarmSaveHelper.cs | 2 +- .../Mesnac.Action.ChemicalWeighing.csproj | 16 +- .../Product/XlPlan/PlanHelper.cs | 3 +- .../ProductionAnalysisReport/ExportAction.cs | 4 +- .../Report/XlDbHelper.cs | 7 +- .../Technical/XlRecipe/FrmRecipeMaterial.cs | 4 +- .../Technical/XlRecipe/TechnicalHelper.cs | 1 - .../XlPlcHelper/PlcPlanHelper.cs | 165 ++++++++++-------- .../MCEdit/Data/MCProject/nodeForm/FrmBin.xml | 8 +- .../Data/MCProject/nodeForm/小料监控.xml | 2 +- 18 files changed, 249 insertions(+), 133 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/BinHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/BinHelper.cs index c8cb042..b6106dd 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/BinHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/BinHelper.cs @@ -19,7 +19,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage /// 查询料仓信息 /// /// 料仓信息表 - public static DataTable getBin() + public static DataTable GetBin() { DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); if (dbHelper == null) @@ -28,7 +28,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage } dbHelper.ClearParameter(); dbHelper.CommandType = CommandType.Text; - string strSql = "SELECT Bin_Serial,Bin_Name,Bin_Code,Material_ID, Material_name,Station_Weight_Medium,Station_Weight_Low,Station_Weight_Advance,Station_Speed_Hight,Station_Speed_Medium,Station_Speed_Low FROM Pmt_Bin LEFT JOIN xl_material ON Pmt_Bin.Material_ID=xl_material.ID ORDER BY Bin_Serial"; + string strSql = "SELECT Bin_Serial,Bin_Name,Bin_Code,Material_ID, Material_name,Station_Weight_Medium,Station_Weight_Low,Station_Weight_Advance,Station_Speed_Hight,Station_Speed_Medium,Station_Speed_Low,BinWeight,LimitWeight FROM Pmt_Bin LEFT JOIN xl_material ON Pmt_Bin.Material_ID=xl_material.ID ORDER BY Bin_Serial"; dbHelper.CommandText = strSql; DataTable table = dbHelper.ToDataTable(); if (table != null && table.Rows.Count > 0) @@ -84,8 +84,6 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage } #endregion - - #region 获取物料名与ID对象集合 /// /// 获取所有物料对象集合 @@ -117,7 +115,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage #endregion #region 根据料仓号修改对应物料 - public static void updateBin(Pmt_Bin bin) + public static void UpdateBin(Pmt_Bin bin) { try { @@ -150,9 +148,9 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage #endregion #region 获取bin对象集合 - public static List getBinList() + public static List GetBinList() { - DataTable userTable = getBin(); + DataTable userTable = GetBin(); List lst = new List(); foreach (DataRow row in userTable.Rows) @@ -176,8 +174,6 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage } #endregion - - #region 获取bin对象集合 public static List GetBinMaterialList() { @@ -205,5 +201,90 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage return lst; } #endregion + + #region 根据ID获取料仓 + /// + /// 获取所有物料对象集合 + /// + /// + public static Pmt_Bin GetFristBinInfo(int Id) + { + DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); + if (dbHelper == null) + { + throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError); + } + dbHelper.ClearParameter(); + dbHelper.CommandType = CommandType.Text; + string sqlstr = "SELECT top 1 * FROM Pmt_Bin where Bin_Serial=@Bin_Serial"; + dbHelper.CommandText = sqlstr; + dbHelper.AddParameter("@Bin_Serial", Id); + DataTable dt = dbHelper.ToDataTable(); + Pmt_Bin bin = null; + if (dt != null && dt.Rows.Count > 0) + { + bin = ConvertDataToBin(dt.Rows[0]); + } + return bin; + } + #endregion + + + #region 根据料仓号实时更新料仓物料重量 + public static void UpdateBinWeight(Pmt_Bin bin) + { + try + { + DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); + if (dbHelper == null) + { + throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError); + } + dbHelper.ClearParameter(); + dbHelper.CommandType = CommandType.Text; + string strSql = "UPDATE Pmt_Bin SET BinWeight=@BinWeight WHERE Bin_Serial=@BinSerial"; + dbHelper.CommandText = strSql; + dbHelper.AddParameter("@BinSerial", bin.Bin_Serial); + dbHelper.AddParameter("@BinWeight", bin.BinWeight); + dbHelper.ExecuteNonQuery(); + } + catch (Exception ex) + { + ICSharpCode.Core.LoggingService.Error("修改料仓信息异常:" + ex.Message, ex); + } + } + #endregion + + /// + /// 把数据行对象转换为下校秤配方数据实体对象 + /// + /// 要转换的数据行 + /// 返回转换后的实体对象 + public static Pmt_Bin ConvertDataToBin(DataRow row) + { + if (row != null) + { + Pmt_Bin bin = new Pmt_Bin(); + bin.Bin_Serial = Mesnac.Basic.DataProcessor.RowValue(row, "Bin_Serial", 0); + bin.Bin_Name = Mesnac.Basic.DataProcessor.RowValue(row, "Bin_Name", String.Empty); + bin.Bin_Code = Mesnac.Basic.DataProcessor.RowValue(row, "Bin_Code", String.Empty); + bin.Material_ID = Mesnac.Basic.DataProcessor.RowValue(row, "Material_ID", String.Empty); + bin.BinWeight = Convert.ToDecimal(Mesnac.Basic.DataProcessor.RowValue(row, "BinWeight", String.Empty)); + bin.LimitWeight = Convert.ToDecimal(Mesnac.Basic.DataProcessor.RowValue(row, "LimitWeight", String.Empty)); + bin.Station_Weight_Medium = Convert.ToDecimal(Mesnac.Basic.DataProcessor.RowValue(row, "Station_Weight_Medium", String.Empty)); + bin.Station_Weight_Low = Convert.ToDecimal(Mesnac.Basic.DataProcessor.RowValue(row, "Station_Weight_Low", String.Empty)); + bin.Station_Weight_Advance = Convert.ToDecimal(Mesnac.Basic.DataProcessor.RowValue(row, "Station_Weight_Advance", String.Empty)); + bin.Station_Speed_Hight = Convert.ToDecimal(Mesnac.Basic.DataProcessor.RowValue(row, "Station_Speed_Hight", String.Empty)); + bin.Station_Speed_Medium = Convert.ToDecimal(Mesnac.Basic.DataProcessor.RowValue(row, "Station_Speed_Medium", String.Empty)); + bin.Station_Speed_Low = Convert.ToDecimal(Mesnac.Basic.DataProcessor.RowValue(row, "Station_Speed_Low", String.Empty)); + + return bin; + } + else + { + return null; + } + } + } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/FrmBin.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/FrmBin.cs index 318d2d3..f8ac3bb 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/FrmBin.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/FrmBin.cs @@ -96,7 +96,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage private void btnOK_Click(object sender, EventArgs e) { //获取包含所有料仓对象的集合 - List list = BinHelper.getBinList(); + List list = BinHelper.GetBinList(); if (string.IsNullOrEmpty(txtQRCode.Text)) { diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/InitBinFormAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/InitBinFormAction.cs index 1aca496..340ca1e 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/InitBinFormAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/InitBinFormAction.cs @@ -56,7 +56,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage protected void requestBinInfo() { //获取料仓信息表 - DataTable binTable = BinHelper.getBin(); + DataTable binTable = BinHelper.GetBin(); lock (String.Empty) { diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/ModifyBinAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/ModifyBinAction.cs index b1d8be9..ffaa732 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/ModifyBinAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/ModifyBinAction.cs @@ -81,7 +81,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage if (MessageBox.Show(msg2, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //更新数据库中的用户信息 - BinHelper.updateBin(newBin); + BinHelper.UpdateBin(newBin); #region 触发刷新料仓列表事件 diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/RefreshBinAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/RefreshBinAction.cs index a4c2d37..c7a948f 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/RefreshBinAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/RefreshBinAction.cs @@ -42,9 +42,6 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage if (true) { - - - IsFirstRun = false; } @@ -74,7 +71,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage #region 业务实现 string equipCode = base.CurrEquipCode; //当前机台 - DataTable table = BinHelper.getBin(); + DataTable table = BinHelper.GetBin(); lock (String.Empty) { diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/SyncAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/SyncAction.cs index ef59cd7..ca42b13 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/SyncAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/SyncAction.cs @@ -11,6 +11,9 @@ using System.Windows.Forms; namespace Mesnac.Action.ChemicalWeighing.BinManage { + /// + /// 读取设备参数 + /// class SyncAction : ChemicalWeighingAction, IAction { #region 字段定义 @@ -49,9 +52,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage try { - // if (BasePlcHelper.Instance.plt_plc_State.NowValue.ToInt()!=1) { MessageBox.Show("PLC连接失败,请检查相关设备!"); return; } - var list = BinHelper.getBinList(); - + var list = BinHelper.GetBinList(); foreach (var item in list) { PlcPlanHelper.ReadBinParam(item);//更新数据库 diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/UpLoadAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/UpLoadAction.cs index 947f9b6..dba8b1d 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/UpLoadAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BinManage/UpLoadAction.cs @@ -11,11 +11,14 @@ using System.Windows.Forms; namespace Mesnac.Action.ChemicalWeighing.BinManage { - class UpLoadAction : ChemicalWeighingAction, IAction - { + /// + /// 上传设备参数 + /// + public class UpLoadAction : ChemicalWeighingAction, IAction + { /// - /// 刷新 - /// + /// 刷新 + /// public static event EventHandler OnRefresh; #region 字段定义 @@ -53,10 +56,7 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage try { - //if (BasePlcHelper.Instance.plt_plc_State.NowValue.ToInt() != 1) { MessageBox.Show("PLC连接失败,请检查相关设备!"); return; } - - var list = BinHelper.getBinList(); - + var list = BinHelper.GetBinList(); foreach (var item in list) { PlcPlanHelper.WriteBinParam(item);//更新PLC @@ -71,7 +71,5 @@ namespace Mesnac.Action.ChemicalWeighing.BinManage MessageBox.Show("设备设置参数失败!" + ex.Message); } } - - } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Entity/PptPlan/Pmt_Bin.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Entity/PptPlan/Pmt_Bin.cs index 0f60441..ed41da2 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Entity/PptPlan/Pmt_Bin.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Entity/PptPlan/Pmt_Bin.cs @@ -13,23 +13,58 @@ namespace Mesnac.Action.ChemicalWeighing.Entity public class Pmt_Bin { public string Equip_Code { get; set; } + /// + /// 主键 + /// public int Bin_Serial { get; set; } + /// + /// 料仓名称 + /// public string Bin_Name { get; set; } /// /// 条码 /// public string Bin_Code { get; set; } public int Dosing_ID { get; set; } + /// + /// 物料编码 + /// public string Material_ID { get; set; } public int Bin_Capacity { get; set; } public int Bin_Baseline { get; set; } public int Bin_Residua { get; set; } public int Bin_UseFlag { get; set; } + /// + /// 料仓实时重量 + /// + public decimal BinWeight { get; set; } + /// + /// 料仓设定重量 + /// + public decimal LimitWeight { get; set; } + /// + /// 中速重量 + /// public decimal Station_Weight_Medium { get; set; } + /// + /// 低速重量 + /// public decimal Station_Weight_Low { get; set; } + /// + /// 提前量 + /// public decimal Station_Weight_Advance { get; set; } + /// + /// 高速速度 + /// public decimal Station_Speed_Hight { get; set; } + /// + /// 中速速度 + /// public decimal Station_Speed_Medium { get; set; } + /// + /// 低速速度 + /// public decimal Station_Speed_Low { get; set; } public int IF_FLAG { get; set; } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/AlarmSaveHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/AlarmSaveHelper.cs index 2b89d96..989f102 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/AlarmSaveHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/AlarmSaveHelper.cs @@ -27,7 +27,6 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper { #region 读取PLC的报警数据 - #region 保存报警数据 var list = Alarm.AlarmHelper.GetPmtAlarmInfoList(); if (list == null) return; @@ -89,6 +88,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper #endregion #endregion 保存报警数据 + #endregion 保存报警数据 } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj index 362f508..78a37d2 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj @@ -146,6 +146,11 @@ False ..\..\..\PlugInPlatform\Mesnac.PlugIn.dll + + False + True + ..\..\..\dll\Microsoft.Office.Interop.Excel.dll + @@ -749,17 +754,6 @@ - - - {00020813-0000-0000-C000-000000000046} - 1 - 8 - 0 - primary - False - False - - {18BCAA9F-D601-43B6-B443-E6B126ADF540} diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Product/XlPlan/PlanHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Product/XlPlan/PlanHelper.cs index 45933ca..d2567f5 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Product/XlPlan/PlanHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Product/XlPlan/PlanHelper.cs @@ -10,6 +10,7 @@ using Mesnac.Action.ChemicalWeighing.Entity; using Mesnac.Action.ChemicalWeighing.Entity.material; using Mesnac.Action.ChemicalWeighing.Entity.PptPlan; using DevExpress.DataProcessing.InMemoryDataProcessor.Executors; +using Mesnac.Action.ChemicalWeighing.BinManage; namespace Mesnac.Action.ChemicalWeighing.Product.XlPlan { @@ -2657,7 +2658,6 @@ namespace Mesnac.Action.ChemicalWeighing.Product.XlPlan } #endregion - #region 获取下一个计划任务 /// /// 获取下一个计划任务 @@ -2843,6 +2843,7 @@ namespace Mesnac.Action.ChemicalWeighing.Product.XlPlan } dbHelper.CommandType = CommandType.Text; string strSql = string.Empty; + //处理任务取消,但是当前任务会在执行完当前物料称量结束后才能 if (GetPlanInfo().Count()>0) { strSql = @"select p.Dosing_Id,p.Plan_Id,p.Plan_Serial,p.Recipe_ID,p.Recipe_Name,p.Version,p.Plan_Num,p.Real_Num,p.Shift_Id,p.Shift_Class,p.Plan_State,p.Plan_StateText,p.Plan_TotalWeight,p.Plan_TotalError, diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ProductionAnalysisReport/ExportAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ProductionAnalysisReport/ExportAction.cs index b73c915..22c68b5 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ProductionAnalysisReport/ExportAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ProductionAnalysisReport/ExportAction.cs @@ -103,7 +103,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.ProductionAnalysisReport { List lR_Recipes = ReportHelper.GetLR_recipeList(lR_planID); - DataTabletoExcel(dt, fileName, lR_Recipes, lR_reName); + //DataTabletoExcel(dt, fileName, lR_Recipes, lR_reName); string msg1 = StringParser.Parse(ResourceService.GetString("Mesnac_Action_ChemicalWeighing_Report_ProductionAnalysisReport_ExportAction_msg1")); //导出生产分析报表数据至Excel成功! ICSharpCode.Core.LoggingService.Info(msg1); @@ -144,7 +144,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report.ProductionAnalysisReport ///列数 int columnNum = tmpDataTable.Columns.Count; ///声明一个应用程序类实例 - Microsoft.Office.Interop.Excel.Application xlApp = new ApplicationClass(); + Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); //创建一个新工作簿 Workbook xlBook = xlApp.Workbooks.Add(); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/XlDbHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/XlDbHelper.cs index 3b684fa..16feb30 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/XlDbHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/XlDbHelper.cs @@ -58,7 +58,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report /// 返回符合条件List public static LR_plan GetLrPlan(string planID, int realNum) { - LR_plan entity =new LR_plan(); + LR_plan entity=null; DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); if (dbHelper == null) @@ -74,10 +74,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report DataTable table = dbHelper.ToDataTable(); if (table != null && table.Rows.Count > 0) { - foreach (DataRow dr in table.Rows) - { - entity= ConvertDataRowToLR_Plan(dr); - } + entity = ConvertDataRowToLR_Plan(table.Rows[0]); } return entity; } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Technical/XlRecipe/FrmRecipeMaterial.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Technical/XlRecipe/FrmRecipeMaterial.cs index 97fe146..d4eb1ed 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Technical/XlRecipe/FrmRecipeMaterial.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Technical/XlRecipe/FrmRecipeMaterial.cs @@ -187,7 +187,7 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.XlRecipe string combobox1_index = this.cmbMaterial.SelectedValue.ToString(); ;//仓库ID binId =Convert.ToInt32(combobox1_index); - var list = BinHelper.getBinList(); + var list = BinHelper.GetBinList(); if (list != null) { @@ -235,7 +235,7 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.XlRecipe { max= weigh.Max(d=>d.Weight_Id)+1; } - var list=BinHelper.getBinList(); + var list=BinHelper.GetBinList(); var bin=list.FirstOrDefault(d=>d.Bin_Serial==binId); //var max= pmt_Weighs.Max(d=>d.Weight_Id)+1; InsertWeigh(recipeId, binId, max, bin.Material_ID,Convert.ToDecimal(this.txtWeight.Text), Convert.ToDecimal(this.txtError.Text)); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Technical/XlRecipe/TechnicalHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Technical/XlRecipe/TechnicalHelper.cs index 0d74bad..ebf9d26 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Technical/XlRecipe/TechnicalHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Technical/XlRecipe/TechnicalHelper.cs @@ -479,7 +479,6 @@ namespace Mesnac.Action.ChemicalWeighing.Technical.XlRecipe #endregion - #region 检索 改配方下是否存在此物料-小料 /// diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/XlPlcHelper/PlcPlanHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/XlPlcHelper/PlcPlanHelper.cs index 9a4eedd..8ce76b0 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/XlPlcHelper/PlcPlanHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/XlPlcHelper/PlcPlanHelper.cs @@ -74,6 +74,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper #endregion + #region 更新任务状态 /// /// 更新任务状态 /// @@ -100,13 +101,10 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper } finally { result = true; } } - #endregion - } - - + #endregion #region 小料 @@ -1106,15 +1104,16 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper } } - #endregion + #endregion + #region 设定设备参数 /// /// 设定设备参数 /// /// public static void WriteDeviceParam(xl_station_sub item) { - int set_station_Weight_Medium = Convert.ToInt32(item.Station_Weight_Medium)*100; + int set_station_Weight_Medium = Convert.ToInt32(item.Station_Weight_Medium) * 100; int set_station_Weight_Low = Convert.ToInt32(item.Station_Weight_Low) * 100; int set_station_Weight_Advance = Convert.ToInt32(item.Station_Weight_Advance) * 100; @@ -1130,7 +1129,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station1_Weight_Advance1, new object[] { set_station_Weight_Advance }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station1_Speed_Hight1, new object[] { set_station_speed_hight }); - BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station1_Speed_Medium1,new object[] { set_station_speed_medium }); + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station1_Speed_Medium1, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station1_Speed_Low1, new object[] { set_station_speed_low }); break; case "2": @@ -1146,7 +1145,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Weight_Medium3, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Weight_Low3, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Weight_Advance3, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Speed_Hight3, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Speed_Medium3, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Speed_Low3, new object[] { set_station_speed_low }); @@ -1155,7 +1154,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Weight_Medium4, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Weight_Low4, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Weight_Advance4, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Speed_Hight4, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Speed_Medium4, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station2_Speed_Low4, new object[] { set_station_speed_low }); @@ -1164,7 +1163,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Weight_Medium5, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Weight_Low5, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Weight_Advance5, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Speed_Hight5, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Speed_Medium5, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Speed_Low5, new object[] { set_station_speed_low }); @@ -1174,7 +1173,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Weight_Medium6, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Weight_Low6, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Weight_Advance6, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Speed_Hight6, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Speed_Medium6, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station3_Speed_Low6, new object[] { set_station_speed_low }); @@ -1184,7 +1183,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Weight_Medium7, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Weight_Low7, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Weight_Advance7, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Speed_Hight7, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Speed_Medium7, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Speed_Low7, new object[] { set_station_speed_low }); @@ -1193,7 +1192,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Weight_Medium8, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Weight_Low8, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Weight_Advance8, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Speed_Hight8, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Speed_Medium8, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station4_Speed_Low8, new object[] { set_station_speed_low }); @@ -1202,7 +1201,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Weight_Medium9, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Weight_Low9, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Weight_Advance9, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Speed_Hight9, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Speed_Medium9, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Speed_Low9, new object[] { set_station_speed_low }); @@ -1211,7 +1210,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Weight_Medium10, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Weight_Low10, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Weight_Advance10, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Speed_Hight10, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Speed_Medium10, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station5_Speed_Low10, new object[] { set_station_speed_low }); @@ -1220,7 +1219,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Weight_Medium11, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Weight_Low11, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Weight_Advance11, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Speed_Hight11, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Speed_Medium11, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Speed_Low11, new object[] { set_station_speed_low }); @@ -1229,7 +1228,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Weight_Medium12, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Weight_Low12, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Weight_Advance12, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Speed_Hight12, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Speed_Medium12, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station6_Speed_Low12, new object[] { set_station_speed_low }); @@ -1238,7 +1237,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Weight_Medium13, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Weight_Low13, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Weight_Advance13, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Speed_Hight13, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Speed_Medium13, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Speed_Low13, new object[] { set_station_speed_low }); @@ -1247,7 +1246,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Weight_Medium14, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Weight_Low14, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Weight_Advance14, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Speed_Hight14, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Speed_Medium14, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station7_Speed_Low14, new object[] { set_station_speed_low }); @@ -1256,7 +1255,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Weight_Medium15, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Weight_Low15, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Weight_Advance15, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Speed_Hight16, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Speed_Medium16, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Speed_Low16, new object[] { set_station_speed_low }); @@ -1265,7 +1264,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Weight_Medium16, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Weight_Low16, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Weight_Advance16, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Speed_Hight16, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Speed_Medium16, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station8_Speed_Low16, new object[] { set_station_speed_low }); @@ -1274,16 +1273,16 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Weight_Medium17, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Weight_Low17, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Weight_Advance17, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Speed_Hight17, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Speed_Medium17, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Speed_Low17, new object[] { set_station_speed_low }); - break; - case "18": + break; + case "18": BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Weight_Medium18, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Weight_Low18, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Weight_Advance18, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Speed_Hight18, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Speed_Medium18, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station9_Speed_Low18, new object[] { set_station_speed_low }); @@ -1346,7 +1345,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Weight_Medium25, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Weight_Low25, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Weight_Advance25, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Speed_Hight25, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Speed_Medium25, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Speed_Low25, new object[] { set_station_speed_low }); @@ -1355,7 +1354,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Weight_Medium26, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Weight_Low26, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Weight_Advance26, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Speed_Hight26, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Speed_Medium26, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station13_Speed_Low26, new object[] { set_station_speed_low }); @@ -1364,7 +1363,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Weight_Medium27, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Weight_Low27, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Weight_Advance27, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Speed_Hight27, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Speed_Medium27, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Speed_Low27, new object[] { set_station_speed_low }); @@ -1373,7 +1372,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Weight_Medium28, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Weight_Low28, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Weight_Advance28, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Speed_Hight28, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Speed_Medium28, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station14_Speed_Low28, new object[] { set_station_speed_low }); @@ -1382,7 +1381,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Weight_Medium29, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Weight_Low29, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Weight_Advance29, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Speed_Hight29, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Speed_Medium29, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Speed_Low29, new object[] { set_station_speed_low }); @@ -1391,7 +1390,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Weight_Medium30, new object[] { set_station_Weight_Medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Weight_Low30, new object[] { set_station_Weight_Low }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Weight_Advance30, new object[] { set_station_Weight_Advance }); - + BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Speed_Hight30, new object[] { set_station_speed_hight }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Speed_Medium30, new object[] { set_station_speed_medium }); BasePlcHelper.Instance.PlcWriteByDataKey(BasePlcHelper.Instance.plt_Set_Station15_Speed_Low30, new object[] { set_station_speed_low }); @@ -1403,6 +1402,9 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper #endregion + #endregion + + #region 设定设备参数 /// /// 设定设备参数 /// @@ -1413,11 +1415,11 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper int set_station_Weight_Low = 0; int set_station_Weight_Advance = 0; - set_station_Weight_Medium =Convert.ToInt32(Convert.ToDecimal(item.Station_Weight_Medium) * 100); - set_station_Weight_Low = Convert.ToInt32(Convert.ToDecimal(item.Station_Weight_Low )* 100); - set_station_Weight_Advance = Convert.ToInt32(Convert.ToDecimal(item.Station_Weight_Advance) * 100); + set_station_Weight_Medium = Convert.ToInt32(Convert.ToDecimal(item.Station_Weight_Medium) * 100); + set_station_Weight_Low = Convert.ToInt32(Convert.ToDecimal(item.Station_Weight_Low) * 100); + set_station_Weight_Advance = Convert.ToInt32(Convert.ToDecimal(item.Station_Weight_Advance) * 100); - int set_station_speed_hight =Convert.ToInt32( Convert.ToDecimal(item.Station_Speed_Hight)*10); + int set_station_speed_hight = Convert.ToInt32(Convert.ToDecimal(item.Station_Speed_Hight) * 10); int set_station_speed_medium = Convert.ToInt32(Convert.ToDecimal(item.Station_Speed_Medium) * 10); int set_station_speed_low = Convert.ToInt32(Convert.ToDecimal(item.Station_Speed_Low) * 10); int i = 0; @@ -1732,6 +1734,9 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper if (i > 0) return true; return false; } + #endregion + + #region 读取设备参数 /// /// 读取设备参数 /// @@ -1739,14 +1744,14 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper public static bool ReadBinParam(Pmt_Bin item) { decimal weight_Medium = 0.000M; - decimal weight_Low = 0.000M; + decimal weight_Low = 0.000M; decimal weight_Advance = 0.000M; int i = 0; switch (item.Bin_Serial) { case 1: - + if (BasePlcHelper.Instance.plt_Set_Station1_Weight_Medium1.NowValue.ToInt() > 0) weight_Medium = Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station1_Weight_Medium1.NowValue.ToInt()) / 100; if (BasePlcHelper.Instance.plt_Set_Station1_Weight_Low1.NowValue.ToInt() > 0) @@ -1754,17 +1759,17 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper if (BasePlcHelper.Instance.plt_Set_Station1_Weight_Advance1.NowValue.ToInt() > 0) weight_Advance = Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station1_Weight_Advance1.NowValue.ToInt()) / 100; - var speed1_Hight = Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station1_Speed_Hight1.NowValue.ToString())/10; + var speed1_Hight = Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station1_Speed_Hight1.NowValue.ToString()) / 10; var speed1_Medium = Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station1_Speed_Medium1.NowValue.ToString()) / 10; var speed1_Low = Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station1_Speed_Low1.NowValue.ToString()) / 10; - item.Station_Weight_Medium =decimal.Parse(weight_Medium.ToString()); + item.Station_Weight_Medium = decimal.Parse(weight_Medium.ToString()); item.Station_Weight_Low = decimal.Parse(weight_Low.ToString()); item.Station_Weight_Advance = decimal.Parse(weight_Advance.ToString()); item.Station_Speed_Hight = decimal.Parse(speed1_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed1_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed1_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 2: @@ -1786,7 +1791,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed2_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed2_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed2_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 3: @@ -1807,7 +1812,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed3_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed3_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed3_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 4: @@ -1828,7 +1833,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed4_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed4_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed4_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 5: @@ -1849,7 +1854,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed5_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed5_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed5_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 6: @@ -1871,7 +1876,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed6_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed6_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed6_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 7: @@ -1893,12 +1898,12 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed7_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed7_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed7_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 8: - var t =Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station4_Weight_Advance8.NowValue.ToInt() ) / 100; - + var t = Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station4_Weight_Advance8.NowValue.ToInt()) / 100; + if (BasePlcHelper.Instance.plt_Set_Station4_Weight_Medium8.NowValue.ToInt() > 0) weight_Medium = Convert.ToDecimal(BasePlcHelper.Instance.plt_Set_Station4_Weight_Medium8.NowValue.ToInt() / 100); if (BasePlcHelper.Instance.plt_Set_Station4_Weight_Low8.NowValue.ToInt() > 0) @@ -1916,7 +1921,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed8_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed8_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed8_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 9: @@ -1937,7 +1942,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed9_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed9_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed9_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 10: @@ -1958,7 +1963,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed10_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed10_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed10_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 11: @@ -1979,7 +1984,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed11_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed11_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed11_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 12: @@ -2000,7 +2005,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed12_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed12_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed12_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 13: @@ -2021,7 +2026,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed13_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed13_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed13_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 14: @@ -2042,7 +2047,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed14_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed14_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed14_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 15: @@ -2063,7 +2068,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed15_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed15_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed15_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 16: @@ -2084,7 +2089,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed16_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed16_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed16_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 17: @@ -2105,7 +2110,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed17_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed17_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed17_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 18: @@ -2126,7 +2131,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed18_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed18_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed18_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 19: @@ -2147,7 +2152,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed19_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed19_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed19_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 20: @@ -2168,7 +2173,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed20_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed20_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed20_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 21: @@ -2189,7 +2194,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed21_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed21_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed21_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 22: @@ -2210,7 +2215,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed22_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed22_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed22_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 23: @@ -2231,7 +2236,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed23_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed23_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed23_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 24: @@ -2252,7 +2257,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed24_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed24_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed24_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 25: @@ -2273,7 +2278,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed25_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed25_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed25_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 26: @@ -2294,7 +2299,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed26_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed26_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed26_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 27: @@ -2315,7 +2320,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed27_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed27_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed27_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; case 28: @@ -2336,7 +2341,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper item.Station_Speed_Hight = decimal.Parse(speed28_Hight.ToString()); item.Station_Speed_Medium = decimal.Parse(speed28_Medium.ToString()); item.Station_Speed_Low = decimal.Parse(speed28_Low.ToString()); - BinHelper.updateBin(item); + BinHelper.UpdateBin(item); i++; break; @@ -2348,7 +2353,10 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper return false; } - public static bool SaveToData(Xl_DowLoadPlan item,int batch, decimal real_Weight) + #endregion + + #region 存盘数据 + public static bool SaveToData(Xl_DowLoadPlan item, int batch, decimal real_Weight) { try { @@ -2360,7 +2368,7 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper if (lrPlan.Plan_Id != null) { decimal totalWeight = lrPlan.Total_Weight + real_Weight; - decimal totalError = lrPlan.Total_Error+error; + decimal totalError = lrPlan.Total_Error + error; //保存物料 LR_weigh weigh = new LR_weigh(); @@ -2411,16 +2419,20 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper weigh.Plan_ID = item.Plan_Id; weigh.Recipe_ID = item.Recipe_ID; weigh.Bin_Serial = item.Station; - + weigh.Material_ID = item.MaterialID; weigh.Material_Name = item.Material_name; weigh.Set_Weight = item.Set_Weight; weigh.Set_Error = item.Set_Error; - weigh.Real_Weight = real_Weight; + weigh.Real_Weight = real_Weight; weigh.Real_Error = error; - addPlan = XlDbHelper.LRAddPlan(plan); - addWeigh = XlDbHelper.LRAddWeigh(weigh); + addPlan = XlDbHelper.LRAddPlan(plan);//报表主表 + addWeigh = XlDbHelper.LRAddWeigh(weigh);//报表物料详细表 + //更新料仓数据 + var binInfo = BinHelper.GetFristBinInfo(item.Station); + binInfo.BinWeight = binInfo.BinWeight - real_Weight; + BinHelper.UpdateBinWeight(binInfo); if (addPlan && addWeigh) { return true; @@ -2433,11 +2445,12 @@ namespace Mesnac.Action.ChemicalWeighing.XlPlcHelper } catch (Exception) { - return false; } } + #endregion + #region 设置配方 PLC点位信息 /// /// 设置配方 PLC点位信息 diff --git a/Main/MCEdit/Data/MCProject/nodeForm/FrmBin.xml b/Main/MCEdit/Data/MCProject/nodeForm/FrmBin.xml index ba882b9..6b2c19a 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/FrmBin.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/FrmBin.xml @@ -3,7 +3,7 @@ False - AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJoBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EYXRhR3JpZFZpZXdDb2x1bW5zLCBNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGxdXQMAAAAGX2l0ZW1zBV9zaXplCF92ZXJzaW9uBAAAKk1lc25hYy5Db250cm9scy5CYXNlLkRhdGFHcmlkVmlld0NvbHVtbnNbXQIAAAAICAkDAAAACgAAAGwAAAAHAwAAAAABAAAAEAAAAAQoTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGF0YUdyaWRWaWV3Q29sdW1ucwIAAAAJBAAAAAkFAAAACQYAAAAJBwAAAAkIAAAACQkAAAAJCgAAAA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jExMjFEN0E3NUY5RjY2BgYAAAAM5Yi35paw5paZ5LuTBgcAAAAM5Yi35paw5paZ5LuTCw== False False diff --git a/Main/MCEdit/Data/MCProject/nodeForm/小料监控.xml b/Main/MCEdit/Data/MCProject/nodeForm/小料监控.xml index 86c29ac..9531846 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/小料监控.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/小料监控.xml @@ -574,7 +574,7 @@ 报警信息 黑体, 12pt, style=Bold White - 57, 16 + 61, 16 MCLabel138 76, 16