From 948bdaf7c461190fab1a94fc03f5b8371cd4782e Mon Sep 17 00:00:00 2001 From: wangsr Date: Fri, 11 Aug 2023 08:53:00 +0800 Subject: [PATCH] =?UTF-8?q?add=20-=20=E6=B9=BF=E6=B7=B7=E6=9C=BA=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=20-=20=E5=8A=9F=E8=83=BD=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/Report/Report_WetMixer.cs | 4 +- .../FinishBatch/FinishBatchService.cs | 1 + .../SaveHelper/ReportSaveHelper.cs | 228 +--------------- .../SaveHelper/ReportWetMixerSaveHelper.cs | 253 ++++++++++++++++++ .../Mesnac.Action.ChemicalWeighing.csproj | 5 + .../Report/WetMixer/ExportAction.cs | 158 +++++++++++ .../Report/WetMixer/InitFormAction.cs | 38 +++ .../Report/WetMixer/SelectAction.cs | 81 ++++++ .../Report/WetMixer/SelectRowAction.cs | 94 +++++++ .../EventConfig/小料称量/业务测试.xml | 57 ---- .../EventConfig/小料称量/我叫锄头.xml | 29 ++ .../榄菊报表.湿混机报表.xml | 52 ++++ Main/MCEdit/Data/MCProject/nodeDevice.xml | 2 +- .../MCProject/nodeForm/湿混机报表.xml | 49 ++-- Main/MCEdit/MCEdit.csproj | 4 + 15 files changed, 749 insertions(+), 306 deletions(-) create mode 100644 Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/ReportWetMixerSaveHelper.cs create mode 100644 Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/ExportAction.cs create mode 100644 Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/InitFormAction.cs create mode 100644 Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs create mode 100644 Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectRowAction.cs create mode 100644 Main/MCEdit/Data/EventConfig/小料称量/我叫锄头.xml create mode 100644 Main/MCEdit/Data/EventConfig/小料称量/榄菊报表.湿混机报表.xml diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Entity/Report/Report_WetMixer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Entity/Report/Report_WetMixer.cs index 6302610..03fde63 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Entity/Report/Report_WetMixer.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Entity/Report/Report_WetMixer.cs @@ -28,7 +28,7 @@ namespace Mesnac.Action.ChemicalWeighing.Entity.Report /// /// Dos /// - public List wetmixer { get; set; } + public WetMixerDevice wetmixer { get; set; } /// /// Mix @@ -36,7 +36,7 @@ namespace Mesnac.Action.ChemicalWeighing.Entity.Report public List mix { get; set; } } - public class WetMixer + public class WetMixerDevice { /// /// 设备编号 diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/FinishBatchService.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/FinishBatchService.cs index ae55319..428f58f 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/FinishBatchService.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/FinishBatchService.cs @@ -160,6 +160,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch //FinishBatchHelper.SaveGHData(); ReportDryMixerSaveHelper.Instance.Save(); + ReportWetMixerSaveHelper.Instance.SaveWetMixerReport(); #endregion #region 8、更新物料名称 diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/ReportSaveHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/ReportSaveHelper.cs index 967be66..e12f99d 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/ReportSaveHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/ReportSaveHelper.cs @@ -63,29 +63,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper } } - /// - /// 湿混机报表数据保存 - /// - public void SaveWetMixerReport() - { - try - { - ICSharpCode.Core.LoggingService.Debug("湿混机报表数据保存开始!!!"); - - - //准备信号读取 - - - Report_WetMixer WetMixer_dos0 = readWetMixer("A"); //读取报表数据 - SaveReportDb(WetMixer_dos0); //保存报表数据 - - - } - catch (Exception ex) - { - ICSharpCode.Core.LoggingService.Error(String.Format("湿混机报表数据保存异常:{0}", ex.Message), ex); - } - } + /// /// 通过PLC读取干混机报表数据 @@ -109,27 +87,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper return _dryMixer; } - /// - /// 通过PLC读取湿混机报表数据 - /// - /// 湿混机A、湿混机B - /// - private Report_WetMixer readWetMixer(string machineType) - { - Report_WetMixer _wetMixer = null; - try - { - _wetMixer = new Report_WetMixer(); - _wetMixer.wetmixer = readWetMixers(machineType, 4); - _wetMixer.mix = readWetMixerMix(machineType, 10); - } - catch (Exception ex) - { - ICSharpCode.Core.LoggingService.Error(String.Format("通过PLC读取湿混机报表数读取异常:{0}", ex.Message), ex); - } - return _wetMixer; - } - + /// /// 读取干混机Dos数据 @@ -207,71 +165,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper return dryMixerMixes; } - /// - /// 读取湿混机数据 - /// - /// - /// - /// - private List readWetMixers(string machineType, int amount) - { - List wetMixers = new List(); - for (int mixer = 0; mixer < 10; mixer++) - { - - #region 实例化参数 - BasePlcHelper.Instance.dryer_eqNo = new Entity.DataKeyValue($"wetMixing{machineType}_{mixer}_eqNo"); - - #endregion - - WetMixer wetMixer = new WetMixer() - { - eqNo = BasePlcHelper.Instance.dryer_eqNo.NowValue.ToInt(), - recordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") - }; - wetMixers.Add(wetMixer); - } - - return wetMixers; - } - - /// - /// 读取湿混机Mix数据 - /// - /// - /// - /// - private List readWetMixerMix(string machineType, int amount) - { - List wetMixerMixes = new List(); - for (int mix = 0; mix < 10; mix++) - { - #region 实例化参数 - BasePlcHelper.Instance.dryer_mixBatch = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixBatch"); - BasePlcHelper.Instance.dryer_mixStep = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixStep"); - BasePlcHelper.Instance.dryer_actCode = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_actCode"); - BasePlcHelper.Instance.dryer_mixTime = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixTime"); - BasePlcHelper.Instance.dryer_mixTemp = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixTemp"); - BasePlcHelper.Instance.dryer_mixSpeed = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixSpeed"); - #endregion - - WetMixerMix wetMixerMix = new WetMixerMix() - { - eqNo = BasePlcHelper.Instance.dryer_eqNo.NowValue.ToInt(), - mixBatch = BasePlcHelper.Instance.dryer_mixBatch.NowValue.ToInt(), - mixStep = BasePlcHelper.Instance.dryer_matCode.NowValue.ToInt(), - actCode = BasePlcHelper.Instance.dryer_actCode.NowValue.ToInt(), - mixTime = BasePlcHelper.Instance.dryer_mixTime.NowValue.ToInt(), - mixTemp = BasePlcHelper.Instance.dryer_mixTemp.NowValue.ToDouble(), - mixSpeed = BasePlcHelper.Instance.dryer_mixSpeed.NowValue.ToDouble(), - mix = mix, - recordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") - }; - wetMixerMixes.Add(wetMixerMix); - } - - return wetMixerMixes; - } + /// /// 保存干混机报表数据至数据库 @@ -303,36 +197,7 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper } } - /// - /// 保存湿混机报表数据至数据库 - /// - /// - private void SaveReportDb(Report_WetMixer _wetMixer) - { - JavaScriptSerializer serializer = new JavaScriptSerializer(); - try - { - string str = serializer.Serialize(_wetMixer); - if (_wetMixer != null) - { - if (_wetMixer.wetmixer != null) - { - InsertReportWetMixer(_wetMixer.report_Id, _wetMixer.wetmixer); - } - else if (_wetMixer.mix != null) - { - InsertReportWetMixerDetail(_wetMixer.report_Id, _wetMixer.mix); - } - } - - - ICSharpCode.Core.LoggingService.Warn($"报表数据打印:{str}"); - } - catch (Exception ex) - { - ICSharpCode.Core.LoggingService.Error(String.Format("保存报表数据至数据库异常:{0}", ex.Message), ex); - } - } + /// /// 保存干混机报表数据 @@ -427,89 +292,6 @@ namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper } } - /// - /// 保存湿混机报表数据 - /// - /// - /// - private void InsertReportWetMixer(Guid reportId, List wetMixers) - { - try - { - - Task.Run(() => - { - DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); - if (dbHelper == null) - { - throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError); - } - string sqlStr = @"insert into Report_WetMixer - (reportId, eqNo) - values - (@reportId, @eqNo)"; - - foreach (WetMixer _wetMixer in wetMixers) - { - dbHelper.ClearParameter(); - dbHelper.CommandType = CommandType.Text; - dbHelper.CommandText = sqlStr; - dbHelper.AddParameter("@eqNo", _wetMixer.eqNo); - dbHelper.AddParameter("@reportId", reportId); - dbHelper.ExecuteNonQuery(); - } - }); - } - catch (Exception ex) - { - ICSharpCode.Core.LoggingService.Error(String.Format("保存湿混机报表数据异常:{0}", ex.Message), ex); - } - } - - /// - /// 保存湿混机报表明细数据 - /// - /// - /// - private void InsertReportWetMixerDetail(Guid reportId, List wetMixers) - { - try - { - Task.Run(() => - { - DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); - if (dbHelper == null) - { - throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError); - } - string sqlStr = @"insert into Report_WetMixer_Detail - (reportId, eqNo, mixBatch, mixStep, actCode, mixTime, mixTemp, mixSpeed, mix) - values - (@reportId, @eqNo, @mixBatch, @mixStep, @actCode, @mixTime, @mixTemp, @mixSpeed, @mix)"; - foreach (WetMixerMix _wetMixerMix in wetMixers) - { - if (_wetMixerMix.actCode == 0) continue; - - dbHelper.ClearParameter(); - dbHelper.CommandType = CommandType.Text; - dbHelper.CommandText = sqlStr; - dbHelper.AddParameter("@reportId", reportId); - dbHelper.AddParameter("@eqNo", _wetMixerMix.eqNo); - dbHelper.AddParameter("@mixBatch", _wetMixerMix.mixBatch); - dbHelper.AddParameter("@mixStep", _wetMixerMix.mixStep); - dbHelper.AddParameter("@actCode", _wetMixerMix.actCode); - dbHelper.AddParameter("@mixTime", _wetMixerMix.mixTime); - dbHelper.AddParameter("@mixTemp", _wetMixerMix.mixTemp); - dbHelper.AddParameter("@mixSpeed", _wetMixerMix.mixSpeed); - dbHelper.AddParameter("@mix", _wetMixerMix.mix); - dbHelper.ExecuteNonQuery(); - } - }); - } - catch (Exception ex) - { - ICSharpCode.Core.LoggingService.Error(String.Format("保存湿混机报表明细数据异常:{0}", ex.Message), ex); - } - } + } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/ReportWetMixerSaveHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/ReportWetMixerSaveHelper.cs new file mode 100644 index 0000000..e7be5e1 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FinishBatch/SaveHelper/ReportWetMixerSaveHelper.cs @@ -0,0 +1,253 @@ +using Mesnac.Action.ChemicalWeighing.Entity.Report; +using Mesnac.Codd.Session; +using System; +using System.Collections.Generic; +using System.Data; +using System.Threading.Tasks; +using System.Web.Script.Serialization; + +namespace Mesnac.Action.ChemicalWeighing.FinishBatch.SaveHelper +{ + public sealed class ReportWetMixerSaveHelper + { + + private static readonly Lazy lazy = new Lazy(() => new ReportWetMixerSaveHelper()); + public static ReportWetMixerSaveHelper Instance + { + get + { + return lazy.Value; + } + } + + private ReportWetMixerSaveHelper() { } + + + /// + /// 湿混机报表数据保存 + /// + public void SaveWetMixerReport() + { + try + { + ICSharpCode.Core.LoggingService.Debug("湿混机报表数据保存开始!!!"); + + + //准备信号读取 + + + Report_WetMixer WetMixer_dos0 = readWetMixer("A"); //读取报表数据 + SaveReportDb(WetMixer_dos0); //保存报表数据 + + + } + catch (Exception ex) + { + ICSharpCode.Core.LoggingService.Error(String.Format("湿混机报表数据保存异常:{0}", ex.Message), ex); + } + } + + + /// + /// 通过PLC读取湿混机报表数据 + /// + /// 湿混机A、湿混机B + /// + private Report_WetMixer readWetMixer(string machineType) + { + Report_WetMixer _wetMixer = null; + try + { + _wetMixer = new Report_WetMixer(); + _wetMixer.wetmixer = readWetMixers(machineType); + _wetMixer.mix = readWetMixerMix(machineType, 10); + } + catch (Exception ex) + { + ICSharpCode.Core.LoggingService.Error(String.Format("通过PLC读取湿混机报表数读取异常:{0}", ex.Message), ex); + } + return _wetMixer; + } + + + + /// + /// 读取湿混机数据 + /// + /// + /// + /// + private WetMixerDevice readWetMixers(string machineType) + { + var eqNo = new Entity.DataKeyValue($"wetMixing{machineType}_1_eqNo"); + + WetMixerDevice wetMixer = new WetMixerDevice() + { + eqNo = eqNo.NowValue.ToInt(), + recordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + }; + + return wetMixer; + } + + /// + /// 读取湿混机Mix数据 + /// + /// + /// + /// + private List readWetMixerMix(string machineType, int amount) + { + List wetMixerMixes = new List(); + for (int mix = 0; mix < 10; mix++) + { + #region 实例化参数 + var eqNo = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_eqNo"); + var mixBatch = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixBatch"); + var mixStep = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixStep"); + var actCode = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_actCode"); + var mixTime = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixTime"); + var mixTemp = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixTemp"); + var mixSpeed = new Entity.DataKeyValue($"wetMixing{machineType}_{mix}_mixSpeed"); + #endregion + + WetMixerMix wetMixerMix = new WetMixerMix() + { + eqNo = eqNo.NowValue.ToInt(), + mixBatch = mixBatch.NowValue.ToInt(), + mixStep = mixStep.NowValue.ToInt(), + actCode = actCode.NowValue.ToInt(), + mixTime = mixTime.NowValue.ToInt(), + mixTemp = mixTemp.NowValue.ToDouble(), + mixSpeed = mixSpeed.NowValue.ToDouble(), + mix = mix, + recordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + }; + wetMixerMixes.Add(wetMixerMix); + } + + return wetMixerMixes; + } + + + + /// + /// 保存湿混机报表数据至数据库 + /// + /// + private void SaveReportDb(Report_WetMixer _wetMixer) + { + JavaScriptSerializer serializer = new JavaScriptSerializer(); + try + { + string str = serializer.Serialize(_wetMixer); + if (_wetMixer != null) + { + if (_wetMixer.wetmixer != null) + { + InsertReportWetMixer(_wetMixer.report_Id, _wetMixer.wetmixer); + } + if (_wetMixer.mix != null) + { + InsertReportWetMixerDetail(_wetMixer.report_Id, _wetMixer.mix); + } + } + + + ICSharpCode.Core.LoggingService.Warn($"报表数据打印:{str}"); + } + catch (Exception ex) + { + ICSharpCode.Core.LoggingService.Error(String.Format("保存报表数据至数据库异常:{0}", ex.Message), ex); + } + } + + + + + /// + /// 保存湿混机报表数据 + /// + /// + /// + private void InsertReportWetMixer(Guid reportId, WetMixerDevice wetMixer) + { + try + { + + Task.Run(() => + { + DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); + if (dbHelper == null) + { + throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError); + } + string sqlStr = @"insert into Report_WetMixer + (reportId, eqName) + values + (@reportId, @eqName)"; + + + dbHelper.ClearParameter(); + dbHelper.CommandType = CommandType.Text; + dbHelper.CommandText = sqlStr; + dbHelper.AddParameter("@eqName", wetMixer.eqNo); + dbHelper.AddParameter("@reportId", reportId); + dbHelper.ExecuteNonQuery(); + + }); + } + catch (Exception ex) + { + ICSharpCode.Core.LoggingService.Error(String.Format("保存湿混机报表数据异常:{0}", ex.Message), ex); + } + } + + /// + /// 保存湿混机报表明细数据 + /// + /// + /// + private void InsertReportWetMixerDetail(Guid reportId, List wetMixerMix) + { + try + { + Task.Run(() => + { + DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); + if (dbHelper == null) + { + throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError); + } + string sqlStr = @"insert into Report_WetMixer_Detail + (reportId, eqNo, mixBatch, mixStep, actCode, mixTime, mixTemp, mixSpeed, mix) + values + (@reportId, @eqNo, @mixBatch, @mixStep, @actCode, @mixTime, @mixTemp, @mixSpeed, @mix)"; + foreach (WetMixerMix _wetMixerMix in wetMixerMix) + { + if (_wetMixerMix.actCode == 0) continue; + + dbHelper.ClearParameter(); + dbHelper.CommandType = CommandType.Text; + dbHelper.CommandText = sqlStr; + dbHelper.AddParameter("@reportId", reportId); + dbHelper.AddParameter("@eqNo", _wetMixerMix.eqNo); + dbHelper.AddParameter("@mixBatch", _wetMixerMix.mixBatch); + dbHelper.AddParameter("@mixStep", _wetMixerMix.mixStep); + dbHelper.AddParameter("@actCode", _wetMixerMix.actCode); + dbHelper.AddParameter("@mixTime", _wetMixerMix.mixTime); + dbHelper.AddParameter("@mixTemp", _wetMixerMix.mixTemp); + dbHelper.AddParameter("@mixSpeed", _wetMixerMix.mixSpeed); + dbHelper.AddParameter("@mix", _wetMixerMix.mix); + dbHelper.ExecuteNonQuery(); + } + }); + } + catch (Exception ex) + { + ICSharpCode.Core.LoggingService.Error(String.Format("保存湿混机报表明细数据异常:{0}", ex.Message), ex); + } + } + + } +} \ No newline at end of file diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj index 652dc5b..d1d233f 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj @@ -220,6 +220,7 @@ + @@ -471,6 +472,10 @@ + + + + Form diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/ExportAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/ExportAction.cs new file mode 100644 index 0000000..8edf2c3 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/ExportAction.cs @@ -0,0 +1,158 @@ +using DevExpress.Utils.Drawing.Helpers; +using ICSharpCode.Core; +using Mesnac.Action.Base; +using Mesnac.Action.ChemicalWeighing.Entity.Report; +using Mesnac.Action.ChemicalWeighing.Report.ProductionReport; +using Microsoft.Office.Interop.Excel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer +{ + /// + /// 湿混机报表导出事件 + /// + public class ExportAction : ChemicalWeighingAction, Base.IAction + { + private Control _clientGridControl = null; //报表明细DGV + private DbMCControl _dgvWetMixer = null; //报表数据DGV + + public void Run(RuntimeParameter runtime) + { + base.RunIni(runtime); //必须要调用的 + ICSharpCode.Core.LoggingService.Debug("湿混机报表-导出..."); + + this._dgvWetMixer = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Report_WetMixer").FirstOrDefault(); + DataGridView _WetMixerGridView = this._dgvWetMixer.BaseControl as DataGridView; + + if (_WetMixerGridView != null) + { + WetMixerDevice wetMixerDevice = new WetMixerDevice(); + wetMixerDevice.eqNo = ParseToInt(_WetMixerGridView.SelectedRows[0].Cells["eqNo"].Value.ToString()); + wetMixerDevice.recordTime = _WetMixerGridView.SelectedRows[0].Cells["recordTime"].Value.ToString(); + + SaveFileDialog sfd = new SaveFileDialog(); + sfd.Filter = "xls files(*.xls)|*.xls"; + sfd.FileName = String.Format("湿混机报表_{0:yyyyMMdd}", DateTime.Now); + sfd.AddExtension = true; + DialogResult result = sfd.ShowDialog(); + + if (result == DialogResult.OK) + { + this._clientGridControl = GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv")).FirstOrDefault(); + + if (_clientGridControl == null) + { + ICSharpCode.Core.LoggingService.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件..."); + runtime.IsReturn = false; + return; + } + + Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientGridControl as Mesnac.Controls.Default.MultiColHeaderDgv); + System.Data.DataTable dt = clientGrid.DataSource as System.Data.DataTable; + + string fileName = sfd.FileName; + if (!String.IsNullOrEmpty(fileName)) + { + try + { + //写入Excle + DataTabletoExcel(fileName, dt, wetMixerDevice); + string msg1 = "湿混机报表导出成功"; //导出生产报表数据至Excel成功! + ICSharpCode.Core.LoggingService.Info(msg1); + MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + string msg1 = $"湿混机报表导出异常:{ex.Message}"; + ICSharpCode.Core.LoggingService.Error(msg1); + MessageBox.Show(msg1, Mesnac.Basic.LanguageHelper.WarnCaption, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } + } + } + + } + + /// + /// 写入到Excel文件 + /// + /// + /// + /// + public void DataTabletoExcel(string strFileName, System.Data.DataTable tmpDataTable, WetMixerDevice wetMixerDevice) + { + ///先得到datatable的行数 + int rowNum = tmpDataTable.Rows.Count; + ///列数 + int columnNum = tmpDataTable.Columns.Count; + ///声明一个应用程序类实例 + Microsoft.Office.Interop.Excel.Application xlApp = new ApplicationClass(); + + //创建一个新工作簿 + Workbook xlBook = xlApp.Workbooks.Add(); + ///在工作簿中得到sheet。 + _Worksheet oSheet = (_Worksheet)xlBook.Worksheets[1]; + + #region 绘制列 + + //绘制配方名和开始时间 + oSheet.Cells[1, 1] = "设备"; + oSheet.Cells[1, 2] = "记录时间"; + oSheet.Cells[2, 1] = wetMixerDevice.eqNo; + oSheet.Cells[2, 2] = wetMixerDevice.recordTime; + + + + //自定义方法,绘制合并表头 + oSheet.Cells[3, 1] = "设备"; + oSheet.Cells[3, 2] = "Mix"; + oSheet.Cells[3, 3] = "批次"; + oSheet.Cells[3, 4] = "步号"; + oSheet.Cells[3, 5] = "动作"; + oSheet.Cells[3, 6] = "时间"; + oSheet.Cells[3, 7] = "温度"; + oSheet.Cells[3, 8] = "速度"; + oSheet.Cells[3, 9] = "记录时间"; + + #endregion + + //将DataTable中的数据导入Excel中 + for (int i = 0; i < rowNum; i++) + { + for (int j = 0; j < columnNum; j++) + { + ///excel中的列是从1开始的 + xlApp.Cells[i + 4, j + 1] = tmpDataTable.Rows[i][j].ToString(); + } + } + oSheet.SaveAs(strFileName); + } + + /// + /// 字符串转Int + /// + /// + /// + private int ParseToInt(string str) + { + int returnInt = 0; + if (str == null || str.Trim().Length < 1) + { + return returnInt; + } + if (int.TryParse(str, out returnInt)) + { + return returnInt; + } + else + { + return 0; + } + } + } +} diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/InitFormAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/InitFormAction.cs new file mode 100644 index 0000000..ee963d3 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/InitFormAction.cs @@ -0,0 +1,38 @@ +using Mesnac.Action.Base; +using Mesnac.Controls.Base; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer +{ + /// + /// 湿混机报表窗体初始化事件 + /// + public class InitFormAction : ChemicalWeighingAction, IAction + { + public void Run(RuntimeParameter runtime) + { + base.RunIni(runtime); //必须要调用的 + ICSharpCode.Core.LoggingService.Debug("湿混机报表-窗体初始化..."); + + #region 获取界面控件 + + DbMCControl clientGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Report_WetMixer").FirstOrDefault(); //获取本机台计划网格控件 + + if (clientGridControl == null) + { + ICSharpCode.Core.LoggingService.Error("{湿混机报表-窗体加载} 缺少日志网格控件..."); + return; + } + + #endregion + + List mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件 + IBaseControl startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl; + startdate.MCValue = DateTime.Now.AddDays(-7); + } + } +} diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs new file mode 100644 index 0000000..9ae1519 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectAction.cs @@ -0,0 +1,81 @@ +using Mesnac.Action.Base; +using Mesnac.Codd.Session; +using Mesnac.Controls.Base; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer +{ + /// + /// 湿混机报表查询事件 + /// + public class SelectAction : ChemicalWeighingAction, IAction + { + public void Run(RuntimeParameter runtime) + { + + base.RunIni(runtime); //必须要调用的 + + ICSharpCode.Core.LoggingService.Debug("湿混机报表-查询..."); + + DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); + if (dbHelper == null) + { + ICSharpCode.Core.LoggingService.Error("获取本地数据连接失败..."); + return; + } + dbHelper.ClearParameter(); + + StringBuilder sbSql = new StringBuilder(@"select t1.objId,t1.reportId,t2.Name as eqNo,t1.recordTime + from Report_WetMixer t1 + left join Device t2 on t1.eqNo = t2.Id + where 1=1 "); + List mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件 + + IBaseControl startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl; + IBaseControl starttime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "starttime").FirstOrDefault().BaseControl; + if (startdate != null && starttime != null) + { + //Append + sbSql.AppendLine(@"AND t1.recordTime>='" + Convert.ToDateTime(startdate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(starttime.MCValue).ToShortTimeString() + "' "); + } + else + { + ICSharpCode.Core.LoggingService.Debug("{湿混机报表-查询} 缺少key值为startdate或者starttime的时间查询条件..."); + return; + } + + IBaseControl enddate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "enddate").FirstOrDefault().BaseControl; + IBaseControl endtime = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "endtime").FirstOrDefault().BaseControl; + if (enddate != null && endtime != null) + { + sbSql.AppendLine(@"AND t1.recordTime<='" + Convert.ToDateTime(enddate.MCValue).ToString("yyyy-MM-dd") + " " + Convert.ToDateTime(endtime.MCValue).ToShortTimeString() + "' "); + } + else + { + ICSharpCode.Core.LoggingService.Debug("{湿混机报表-查询} 缺少key值为enddate或者enddate的时间查询条件..."); + return; + } + sbSql.Append(" ORDER BY t1.recordTime desc"); + + dbHelper.CommandText = sbSql.ToString(); + dbHelper.CommandType = System.Data.CommandType.Text; + DataTable table = dbHelper.ToDataTable(); + + //刷新DataGridView数据 + DbMCControl _dgvWetMixer = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Report_WetMixer").FirstOrDefault(); + if (_dgvWetMixer == null || !(_dgvWetMixer.BaseControl is DataGridView)) + { + ICSharpCode.Core.LoggingService.Warn("{湿混机报表-查询} 缺少系统日志DataGridView控件..."); + runtime.IsReturn = false; + return; + } + _dgvWetMixer.BaseControl.BindDataSource = table; + } + } +} diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectRowAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectRowAction.cs new file mode 100644 index 0000000..64ef2e1 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/WetMixer/SelectRowAction.cs @@ -0,0 +1,94 @@ +using Mesnac.Action.Base; +using Mesnac.Action.ChemicalWeighing.Report.ProductionReport; +using Mesnac.Codd.Session; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Mesnac.Action.ChemicalWeighing.Report.WetMixer +{ + /// + /// 湿混机报表明细查询事件 + /// + public class SelectRowAction : ChemicalWeighingAction, IAction + { + private Control _clientGridControl = null; //多维表控件 + + public void Run(RuntimeParameter runtime) + { + base.RunIni(runtime); //必须要调用的 + + ICSharpCode.Core.LoggingService.Debug("湿混机报表-明细查询..."); + + //获取报表数据 + DbMCControl _dgvWetMixer = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "Report_WetMixer").FirstOrDefault(); + if (_dgvWetMixer == null || !(_dgvWetMixer.BaseControl is DataGridView)) + { + ICSharpCode.Core.LoggingService.Warn("{生产报表} 缺少湿混机报表DataGridView控件..."); + runtime.IsReturn = false; + return; + } + + DataGridView _WetMixerGridView = _dgvWetMixer.BaseControl as DataGridView; + + this._clientGridControl = GetAllControls().Where(x => x.Name.Contains("MultiColHeaderDgv")).FirstOrDefault(); + + if (_clientGridControl == null) + { + ICSharpCode.Core.LoggingService.Warn("{生产报表} 缺少缺少称量名细MultiColHeaderDgv控件..."); + runtime.IsReturn = false; + return; + } + + Mesnac.Controls.Default.MultiColHeaderDgv clientGrid = (this._clientGridControl as Mesnac.Controls.Default.MultiColHeaderDgv); + + #region 明细控件格式化 + + clientGrid.myColHeaderTreeView = null; + clientGrid.DataSource = null; + clientGrid.iNodeLevels = 0; + clientGrid.ColLists.Clear(); + clientGrid.ColumnHeadersHeight = 23; + clientGrid.ScrollBars = ScrollBars.Both; + clientGrid.AllowUserToAddRows = false; + clientGrid.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + clientGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + clientGrid.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 12); + clientGrid.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 10); + clientGrid.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + #endregion + + //获取选中行的ReportId,关联获取明细数据并赋值给明细控件 + if (_WetMixerGridView.SelectedRows.Count == 1) + { + string lR_planID = _WetMixerGridView.SelectedRows[0].Cells["reportId"].Value as string; + + //获取数据链接 + DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); + if (dbHelper == null) + { + ICSharpCode.Core.LoggingService.Error("获取本地数据连接失败..."); + return; + } + dbHelper.ClearParameter(); + + //获取明细数据 + StringBuilder sqlStr = new StringBuilder(@"select t2.Name as 设备编号,t1.mix as Mix,t1. mixBatch as 批次,t1.mixStep as 步号,t1.actCode as 动作, + t1.mixTime as 时间,t1.mixTemp as 温度,t1.mixSpeed as 速度,t1.recordTime as 记录时间 + from Report_WetMixer_Detail t1 + left join Device t2 on t1.eqNo = t2.Id + where t1.reportId = @reportId"); + dbHelper.CommandText = sqlStr.ToString(); + dbHelper.CommandType = System.Data.CommandType.Text; + dbHelper.AddParameter("@reportId", lR_planID); + DataTable table = dbHelper.ToDataTable(); + + clientGrid.DataSource = table; + } + } + } +} diff --git a/Main/MCEdit/Data/EventConfig/小料称量/业务测试.xml b/Main/MCEdit/Data/EventConfig/小料称量/业务测试.xml index a84451e..e69de29 100644 --- a/Main/MCEdit/Data/EventConfig/小料称量/业务测试.xml +++ b/Main/MCEdit/Data/EventConfig/小料称量/业务测试.xml @@ -1,57 +0,0 @@ - - - - - - 业务测试3 - 业务测试3 - - - 生产计划测试 - 生产计划测试 - - - 小料Action测试 - 小料Action测试 - - - 触发保存报警测试 - 触发保存报警测试 - - - 写物料名称 - 写物料名称 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Main/MCEdit/Data/EventConfig/小料称量/我叫锄头.xml b/Main/MCEdit/Data/EventConfig/小料称量/我叫锄头.xml new file mode 100644 index 0000000..d05a28a --- /dev/null +++ b/Main/MCEdit/Data/EventConfig/小料称量/我叫锄头.xml @@ -0,0 +1,29 @@ + + + + + + 窗体初始化 + 窗体初始化 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Main/MCEdit/Data/EventConfig/小料称量/榄菊报表.湿混机报表.xml b/Main/MCEdit/Data/EventConfig/小料称量/榄菊报表.湿混机报表.xml new file mode 100644 index 0000000..d9fb4fa --- /dev/null +++ b/Main/MCEdit/Data/EventConfig/小料称量/榄菊报表.湿混机报表.xml @@ -0,0 +1,52 @@ + + + + + + 窗体初始化 + 窗体初始化 + + + 查询 + 查询湿混机报表 + + + 报表明细 + 报表明细 + + + + 导出 + 导出湿混机报表 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Main/MCEdit/Data/MCProject/nodeDevice.xml b/Main/MCEdit/Data/MCProject/nodeDevice.xml index b558563..f2388e1 100644 --- a/Main/MCEdit/Data/MCProject/nodeDevice.xml +++ b/Main/MCEdit/Data/MCProject/nodeDevice.xml @@ -2610,7 +2610,7 @@ - + diff --git a/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml b/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml index 10d2dc5..8a975bf 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/湿混机报表.xml @@ -1,5 +1,21 @@ + + + Fill + 3, 22 + MultiColHeaderDgv1 + 1262, 325 + + False + 报表明细 + Fill + 宋体, 12pt, style=Bold + 0, 424 + GroupBox3 + 1268, 350 + 8 + False @@ -10,15 +26,15 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL - AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNv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AAEAAAARAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIGI5MTA1NzY3MGFkYjRjOTI5NGI0NDJjNGM4YTA4NTNkBgYAAAAM5oql6KGo5piO57uGBgcAAAAM5oql6KGo5piO57uGCw== AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAADAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAANBAs= - [DataSource1].[Report_DryMixer] + [DataSource1].[Report_WetMixer] MCDataSource1 True - select t1.objId,t1.reportId,t2.Name as eqNo,t1.batch,t1.matCode,t1.setValue,t1.setToler,t1.actValue,t1.actToLer,t1.dos,t1.recordTime from Report_DryMixer t1 left join Device t2 on t1.eqNo = t2.Id + select t1.objId,t1.reportId,t2.Name as eqNo,t1.batch,t1.mat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AIABPGRpZmZncjpkaWZmZ3JhbSB4bWxuczptc2RhdGE9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206eG1sLW1zZGF0YSIgeG1sbnM6ZGlmZmdyPSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOnhtbC1kaWZmZ3JhbS12MSIgLz4EAwAAAA5TeXN0ZW0uVmVyc2lvbgQAAAAGX01ham9yBl9NaW5vcgZfQnVpbGQJX1JldmlzaW9uAAAAAAgICAgCAAAAAAAAAP//////////Cw== @@ -26,6 +42,7 @@ Query True True + False 25 False Fill @@ -43,22 +60,6 @@ 1268, 360 7 - - - Fill - 3, 22 - MultiColHeaderDgv1 - 1262, 685 - - False - 报表明细 - Fill - 宋体, 12pt, style=Bold - 0, 64 - GroupBox3 - 1268, 710 - 8 - True @@ -76,7 +77,9 @@ False select * from Device where Name LIKE '干混%' - + + AAEAAAD/////AQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAABVTeXN0ZW0uRGF0YS5EYXRhVGFibGUDAAAAGURhdGFUYWJsZS5SZW1vdGluZ1ZlcnNpb24JWG1sU2NoZW1hC1htbERpZmZHcmFtAwEBDlN5c3RlbS5WZXJzaW9uAgAAAAkDAAAABgQAAAD1Azw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9InV0Zi0xNiI/Pg0KPHhzOnNjaGVtYSB4bWxucz0iIiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOm1zZGF0YT0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp4bWwtbXNkYXRhIj4NCiAgPHhzOmVsZW1lbnQgbmFtZT0iVGFibGUxIj4NCiAgICA8eHM6Y29tcGxleFR5cGU+DQogICAgPC94czpjb21wbGV4VHlwZT4NCi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GAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL diff --git a/Main/MCEdit/MCEdit.csproj b/Main/MCEdit/MCEdit.csproj index f90624e..8ed444a 100644 --- a/Main/MCEdit/MCEdit.csproj +++ b/Main/MCEdit/MCEdit.csproj @@ -219,6 +219,10 @@ Designer PreserveNewest + + + Always + Designer PreserveNewest