From a1c25d64b28fcba99d6df7c4143c2b17d3783de6 Mon Sep 17 00:00:00 2001 From: wangsr Date: Fri, 15 Dec 2023 13:26:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?change=20-=20=E6=9B=B4=E6=94=B9MCRun?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Main/MCRun/Data/SysConfig/MenuConfig.dat | Bin 21622 -> 20814 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Main/MCRun/Data/SysConfig/MenuConfig.dat b/Main/MCRun/Data/SysConfig/MenuConfig.dat index d5bd986206624439a3e2837586f2126bba9dac0e..d06053f78950923db23948329bd87079f2826f6e 100644 GIT binary patch literal 20814 zcmeHPd2k!m8MnZ@coijpxeEj+CJm7F=stiHf*l7#3?X(B3Z!DSS~&t)GCFd=P{I)s zn?eXj!Z|dBKsXY@QF1sWOgrriOkvtT+AFrPZe(!rv?|ttZnjB3{O<&U={)<1?K?I9>SLE{AK>MO(I-XgUYwyZr2XZq` zUZ`br$xM2tzuk?0GfwU(r1FKVHZ!di@>wM{Prs7ZoXI<(4_8M#}ZAwMvFVU z2b6xTI~~`Sw=k2wu(el9X=+}JPkeURK2_Al*|8*Aa-E%xY=3VR;P8Ygj(R z@*7sbu!4paGOVy+MV!^|@VF;T&xGlnFntrIf5HqL2h9_X=CJeaUaVu)$ZEWU5gZPy6>tQB z>qvr*9xazv)b{h0TvDA_I6RFm9O*(TCE&&CyD;A2e{!*CS&-ARol0JD>^p=1zvk^! z^C-5@FQhv%=|r->M@tvF>E{6h4JQ+iB5;=0uO1zFdHS@j)0vNn$6#!_k|~Y-yzJ|D z%-gWiOWy+=4>$pEB48?kfF|_^AO84X8vL5W`)!SFqpF`o{dbN%w`FYe%IVYQR8&8O zDklx33v-ope}R4^Ylx2_lTHP+0Ztcr#BSWJ~n;YqKatkRC%<%SVVi2 zWEv|(RNp*W$>^p>BoB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WSRgskB7TLg!^R;4#`z>DSifxHGf{~<5sqdhr5i2bJ5DaQG-LW(1b(oP+?7`33vBl z9_~UO4uR#=m1!ri^e!@VKGA&AT15d1aa5DQjVlW79n z1P}LX5e|V!28Zya35RH=!kSDI;9lq9ek#HtlE>f>{4?PY3shK>X#(7jdAJ{maEM1S zI7G5cI0Uv7)?}Ih_bLzfiU^0G4ufMcAY95qLJDglIK;k!TiKU+xbKK?h=njXgiy@8 zLqtVkO{NKVcbtbC7vT^>U~q^$m~aS0D6Gje0q%Jo?l}<-M_~qs^Ro$uOcUU~ z!NYxBgu^kC!Qt#_!r>^YuqM+4xUceXPl#|hf-yLp+e|nd;}q6pngF+lhkI0n8>qqI rsAIz6QB#{`8nnI^#9!^3S8;5z;RO0dLH From 435d1ea98a388622e9705eba90cbdf8ae1f87aa9 Mon Sep 17 00:00:00 2001 From: wangsr Date: Fri, 15 Dec 2023 14:11:34 +0800 Subject: [PATCH 2/4] =?UTF-8?q?debug=20-=20=E6=97=A5=E5=BF=97=E6=8F=92?= =?UTF-8?q?=E5=85=A5=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs index baba701..8afdfbf 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoControl.cs @@ -289,7 +289,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl if (b) { int i = ControlsHelper.SingleSelect(RadioE); - LjLogControl.ManualLogControl("手动下黑粉料向" + i, 3, Convert.ToInt32(TextE.ManualWeight.MCValue.ToString()), i, 2); + LjLogControl.ManualLogControl("手动下黑粉料向" + i, Convert.ToInt32(TextE.ManualWeight.MCValue.ToString()), 3, i, 2); MessageBox.Show("数据下传成功!"); } From 5dba184ec8cf7e9917007f17611c9231a08abaf8 Mon Sep 17 00:00:00 2001 From: wangsr Date: Fri, 15 Dec 2023 14:30:48 +0800 Subject: [PATCH 3/4] =?UTF-8?q?add=20-=20=E6=B9=BF=E6=B7=B7=E6=9C=BA?= =?UTF-8?q?=E7=AD=89=E5=BE=85=E6=97=B6=E9=97=B4=E7=BB=9F=E8=AE=A1=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=95=B0=E5=80=BC=E6=BA=A2=E5=87=BA=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8D=95=E6=8D=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LjReport/WetWaitTime/ExportToPc.cs | 33 ++++++++++++------- .../LjReport/WetWaitTime/WetTimeCounting.cs | 32 +++++++++++------- .../MCProject/nodeForm/WeterTimeCount.xml | 3 +- 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/WetWaitTime/ExportToPc.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/WetWaitTime/ExportToPc.cs index ec15a59..0bc0ee5 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/WetWaitTime/ExportToPc.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/WetWaitTime/ExportToPc.cs @@ -149,18 +149,27 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.WetWaitTime dt.Rows.Add(dr); } - var edr = dt.NewRow(); - edr[0] = "湿混等待时间总和"; - edr[1] = TimeConvert(list.Sum(x => x.MixWaitTime)); - dt.Rows.Add(edr); - var edr1 = dt.NewRow(); - edr1[0] = "RGV等待时间总和"; - edr1[1] = TimeConvert(list.Sum(x => x.RgvWaitTime)); - dt.Rows.Add(edr1); - var edr2 = dt.NewRow(); - edr2[0] = "总等待时间总和"; - edr2[1] = TimeConvert(list.Sum(x => x.MixWaitTime + x.RgvWaitTime)); - dt.Rows.Add(edr2); + + try + { + var edr = dt.NewRow(); + edr[0] = "湿混等待时间总和"; + edr[1] = TimeConvert(list.Sum(x => x.MixWaitTime)); + dt.Rows.Add(edr); + var edr1 = dt.NewRow(); + edr1[0] = "RGV等待时间总和"; + edr1[1] = TimeConvert(list.Sum(x => x.RgvWaitTime)); + dt.Rows.Add(edr1); + var edr2 = dt.NewRow(); + edr2[0] = "总等待时间总和"; + edr2[1] = TimeConvert(list.Sum(x => x.MixWaitTime + x.RgvWaitTime)); + dt.Rows.Add(edr2); + } + catch (OverflowException ex) + { + MessageBox.Show("算术值溢出!请检查数据是否有误"); + } + } /// diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/WetWaitTime/WetTimeCounting.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/WetWaitTime/WetTimeCounting.cs index cc33ec4..21ac4a0 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/WetWaitTime/WetTimeCounting.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/WetWaitTime/WetTimeCounting.cs @@ -10,6 +10,7 @@ using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; namespace Mesnac.Action.ChemicalWeighing.LjReport.WetWaitTime { @@ -225,18 +226,25 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.WetWaitTime dt.Rows.Add(dr); } - var edr = dt.NewRow(); - edr[0] = "湿混等待时间总和"; - edr[1] = TimeConvert(list.Sum(x => x.MixWaitTime)); - dt.Rows.Add(edr); - var edr1 = dt.NewRow(); - edr1[0] = "RGV等待时间总和"; - edr1[1] = TimeConvert(list.Sum(x => x.RgvWaitTime)); - dt.Rows.Add(edr1); - var edr2 = dt.NewRow(); - edr2[0] = "总等待时间总和"; - edr2[1] = TimeConvert(list.Sum(x => x.MixWaitTime + x.RgvWaitTime)); - dt.Rows.Add(edr2); + try + { + var edr = dt.NewRow(); + edr[0] = "湿混等待时间总和"; + edr[1] = TimeConvert(list.Sum(x => x.MixWaitTime)); + dt.Rows.Add(edr); + var edr1 = dt.NewRow(); + edr1[0] = "RGV等待时间总和"; + edr1[1] = TimeConvert(list.Sum(x => x.RgvWaitTime)); + dt.Rows.Add(edr1); + var edr2 = dt.NewRow(); + edr2[0] = "总等待时间总和"; + edr2[1] = TimeConvert(list.Sum(x => x.MixWaitTime + x.RgvWaitTime)); + dt.Rows.Add(edr2); + } + catch (OverflowException ex) + { + MessageBox.Show("算术值溢出!请检查数据是否有误"); + } } private string TimeConvert(int t) diff --git a/Main/MCEdit/Data/MCProject/nodeForm/WeterTimeCount.xml b/Main/MCEdit/Data/MCProject/nodeForm/WeterTimeCount.xml index 15eb5e6..402bf55 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/WeterTimeCount.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/WeterTimeCount.xml @@ -25,12 +25,11 @@ None True True - False False 348, 12 MoreData 530, 622 - 7 + 9 From ad2b494b103f61238d4dd16019189d7d137eca10 Mon Sep 17 00:00:00 2001 From: wangsr Date: Fri, 15 Dec 2023 15:54:32 +0800 Subject: [PATCH 4/4] =?UTF-8?q?add=20-=20=E6=B7=BB=E5=8A=A0=E5=88=87?= =?UTF-8?q?=E5=89=B2=E6=97=A5=E5=BF=97=E5=8A=9F=E8=83=BD=20=E6=8C=89?= =?UTF-8?q?=E5=B9=B4=E5=88=86=E5=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LjMaterial/DBHelp.cs | 15 +++-- .../Report/LjLogControl.cs | 15 +++++ .../Report/LjLogReport.cs | 63 +++--------------- .../Data/MCProject/nodeForm/LjLogForm.xml | 65 +++++++++++++++++++ 4 files changed, 98 insertions(+), 60 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMaterial/DBHelp.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMaterial/DBHelp.cs index 5450c51..1342e8a 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMaterial/DBHelp.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjMaterial/DBHelp.cs @@ -13,7 +13,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjMaterial { return new Dictionary(); } - + public static DataTable GetTable(string sql) { DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); @@ -59,7 +59,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjMaterial dbHelper.CommandText = insertUserSql; foreach (var keyValuePair in dic) { - dbHelper.AddParameter(keyValuePair.Key,keyValuePair.Value); + dbHelper.AddParameter(keyValuePair.Key, keyValuePair.Value); } DataTable table = dbHelper.ToDataTable(); return table; @@ -67,8 +67,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjMaterial public static void ExecuteNonQuery(string sql) { - ExecuteNonQuery(sql,new Dictionary()); + ExecuteNonQuery(sql, new Dictionary()); } + public static void ExecuteNonQuery(string sql, IDictionary dic) { DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); @@ -83,11 +84,11 @@ namespace Mesnac.Action.ChemicalWeighing.LjMaterial dbHelper.CommandText = insertUserSql; foreach (var keyValuePair in dic) { - dbHelper.AddParameter(keyValuePair.Key,keyValuePair.Value); + dbHelper.AddParameter(keyValuePair.Key, keyValuePair.Value); } - + dbHelper.ExecuteNonQuery(); - } - + } + } } \ No newline at end of file diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogControl.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogControl.cs index 2bf4839..db56437 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogControl.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogControl.cs @@ -62,6 +62,21 @@ namespace Mesnac.Action.ChemicalWeighing.Report return DBHelp.GetTable(sql); } + /// + /// 去年数据的转移 + /// + public static void LastYearDataCut() + { + int nowYear = DateTime.Now.Year; + string sql = $"insert into Manual_Log_{nowYear - 1} " + + $"select logtext, logtime, userid, value, valuekind, deviceno, devicekind, createdate " + + $"from Manual_Log where logtime < '{nowYear}-01-01 00:00:00'"; + DBHelp.ExecuteNonQuery(sql); + sql = $"delete from Manual_Log where logtime < '{nowYear}-01-01 00:00:00'"; + DBHelp.ExecuteNonQuery(sql); + + } + private static string BaseSelect(string sql) { string s = "select top 500 id, logtext, logtime, value, deviceno from Manual_Log " + sql + diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs index da9f1a0..27169b9 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/LjLogReport.cs @@ -32,6 +32,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report MCButton ManualControl; MCButton Refresh; MCButton SelectByText; + MCButton LastYearDataMove; //HslSwitch HslSwitch1; //HslSwitch HslSwitch2; @@ -63,6 +64,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report ManualControl = control.FirstOrDefault(x => x != null && x.Name == "ManualControl") as MCButton; Refresh = control.FirstOrDefault(x => x != null && x.Name == "Refresh") as MCButton; SelectByText = control.FirstOrDefault(x => x != null && x.Name == "SelectByText") as MCButton; + LastYearDataMove = control.FirstOrDefault(x => x != null && x.Name == "LastYearDataMove") as MCButton; StartDate = control.FirstOrDefault(x => x != null && x.Name == "StartDate") as MCDateTimePicker; EndDate = control.FirstOrDefault(x => x != null && x.Name == "EndDate") as MCDateTimePicker; LogForm = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ManualLogGridView1").FirstOrDefault(); @@ -109,66 +111,21 @@ namespace Mesnac.Action.ChemicalWeighing.Report ManualControl.Click += ManualControlSelect; Refresh.Click += RefreshAction; SelectByText.Click += SelectByTextAction; + LastYearDataMove.Click += DataMoveAction; } /// - /// 下发送料请求按钮点击 + /// 转移去年的数据 /// /// /// - private void RequestDownloadClick(object sender, EventArgs e) + private void DataMoveAction(object sender, EventArgs e) { - bool mixok1 = PlcConnect.Instance.ReadBool("DB3000.0.0").Content; - Time(1, mixok1 ? 1 : 0); - bool mixok2 = PlcConnect.Instance.ReadBool("DB3000.0.1").Content; - Time(2, mixok2 ? 1 : 0); - bool mixok3 = PlcConnect.Instance.ReadBool("DB3000.0.2").Content; - Time(3, mixok3 ? 1 : 0); - bool mixok4 = PlcConnect.Instance.ReadBool("DB3000.0.3").Content; - Time(4, mixok4 ? 1 : 0); - bool mixok5 = PlcConnect.Instance.ReadBool("DB3000.0.4").Content; - Time(5, mixok5 ? 1 : 0); - bool mixok6 = PlcConnect.Instance.ReadBool("DB3000.0.5").Content; - Time(6, mixok6 ? 1 : 0); - bool mixok7 = PlcConnect.Instance.ReadBool("DB3000.0.6").Content; - Trace.WriteLine("7号信号:" + mixok7); - Time(7, mixok7 ? 1 : 0); - bool mixok8 = PlcConnect.Instance.ReadBool("DB3000.0.7").Content; - Trace.WriteLine("8号信号:" + mixok8); - Time(8, mixok8 ? 1 : 0); - } - - /// - /// 下发接料请求 - /// - /// - /// - private void Time(int deviceNo, int statu) - { - TankIsDischargedSyncEntity tankIsDischargedSyncEntity = new TankIsDischargedSyncEntity() - { - reqCode = System.Guid.NewGuid().ToString(), - reqTime = DateTime.Now, - deviceNo = deviceNo.ToString(), - state = statu.ToString(), - }; - //即使网络不同 也不会影响上位机的使用 - ThreadPool.QueueUserWorkItem(delegate - { - HttpResponse httpResponse = new HttpResponse(); - string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity); - MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}返回数据" + returnTest); - }); - } - - /// - /// 消除报警按钮点击 - /// - /// - /// - private void EliAlarmsClick(object sender, EventArgs e) - { - + if (MessageBox.Show("确认要切割数据?", "三次提醒 3/1", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } + if (MessageBox.Show("确认要切割数据?", "三次提醒 3/2", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } + if (MessageBox.Show("确认要切割数据?", "三次提醒 3/3", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } + LjLogControl.LastYearDataCut(); + MessageBox.Show("数据切割成功"); } /// diff --git a/Main/MCEdit/Data/MCProject/nodeForm/LjLogForm.xml b/Main/MCEdit/Data/MCProject/nodeForm/LjLogForm.xml index adf0591..bf27a87 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/LjLogForm.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/LjLogForm.xml @@ -1,5 +1,70 @@ + + + + + Red + DarkGray + + + False + + + + None + True + True + 每年年初点击 + 121, 816 + MCLabel2 + 77, 12 + + + + + + Red + DarkGray + + + False + + + + None + True + True + 切割今年以前的日志数据,防止日志数据库过大 + 12, 792 + MCLabel1 + 251, 12 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL + + + + False + + + + None + True + True + False + + + + Red + DarkGray + 日志数据切割 + 12, 807 + LastYearDataMove + 103, 31 + 14 + False