diff --git a/DB/DB.csproj b/DB/DB.csproj index ddce222..f2b613f 100644 --- a/DB/DB.csproj +++ b/DB/DB.csproj @@ -32,13 +32,13 @@ - 5.38.0 + 5.40.0 - 5.38.0 + 5.40.0 - 5.38.0 + 5.40.0 8.0.0 @@ -112,6 +112,7 @@ + diff --git a/DB/Service/PointService.cs b/DB/Service/PointService.cs index 7da44f6..7be8ecf 100644 --- a/DB/Service/PointService.cs +++ b/DB/Service/PointService.cs @@ -1,7 +1,36 @@ -namespace DB.Service +using System; +using System.Collections.Generic; +using DB.Entity; +using NewLife.Caching; + +namespace DB.Service { public class PointService { + + + public List GetList() + { + using (var dbContext = DbFactory.GetContext) + { + return dbContext.Query().ToList(); + } + } + + ICache _cache=Cache.Default; + private readonly string key = "PRINT"; + public List GetCacheList() + { + if (_cache.ContainsKey(key)) + { + return _cache.Get>(key); + } + + var ls = GetList(); + _cache.Set(key, ls, TimeSpan.FromHours(1)); + return ls; + } + } } \ No newline at end of file diff --git a/RfidWeb/Frm/FormPar.Designer.cs b/RfidWeb/Frm/FormPar.Designer.cs index 7f8f3ac..ca1c800 100644 --- a/RfidWeb/Frm/FormPar.Designer.cs +++ b/RfidWeb/Frm/FormPar.Designer.cs @@ -133,7 +133,7 @@ this.textBoxEx1.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx1.PromptText = ""; this.textBoxEx1.RegexPattern = ""; - this.textBoxEx1.Size = new System.Drawing.Size(124, 53); + this.textBoxEx1.Size = new System.Drawing.Size(124, 38); this.textBoxEx1.TabIndex = 26; this.textBoxEx1.Text = "0"; this.textBoxEx1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -162,7 +162,7 @@ this.textBoxEx2.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx2.PromptText = ""; this.textBoxEx2.RegexPattern = ""; - this.textBoxEx2.Size = new System.Drawing.Size(124, 53); + this.textBoxEx2.Size = new System.Drawing.Size(124, 38); this.textBoxEx2.TabIndex = 25; this.textBoxEx2.Text = "0"; this.textBoxEx2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -191,7 +191,7 @@ this.textBoxEx3.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx3.PromptText = ""; this.textBoxEx3.RegexPattern = ""; - this.textBoxEx3.Size = new System.Drawing.Size(124, 53); + this.textBoxEx3.Size = new System.Drawing.Size(124, 38); this.textBoxEx3.TabIndex = 24; this.textBoxEx3.Text = "0"; this.textBoxEx3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -202,7 +202,7 @@ this.label15.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label15.Location = new System.Drawing.Point(974, 108); this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(31, 33); + this.label15.Size = new System.Drawing.Size(21, 22); this.label15.TabIndex = 11; this.label15.Text = "0"; this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -213,7 +213,7 @@ this.label10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label10.Location = new System.Drawing.Point(586, 26); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(262, 24); + this.label10.Size = new System.Drawing.Size(175, 16); this.label10.TabIndex = 4; this.label10.Text = "柜内风扇温度设定(°C)"; this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -224,7 +224,7 @@ this.label6.Font = new System.Drawing.Font("宋体", 12F); this.label6.Location = new System.Drawing.Point(294, 26); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(226, 24); + this.label6.Size = new System.Drawing.Size(151, 16); this.label6.TabIndex = 2; this.label6.Text = "层合电机速度(mm/s)"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -235,7 +235,7 @@ this.label8.Font = new System.Drawing.Font("宋体", 12F); this.label8.Location = new System.Drawing.Point(10, 26); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(226, 24); + this.label8.Size = new System.Drawing.Size(151, 16); this.label8.TabIndex = 0; this.label8.Text = "供料电机速度(mm/s)"; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -281,7 +281,7 @@ this.textBoxEx6.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx6.PromptText = ""; this.textBoxEx6.RegexPattern = ""; - this.textBoxEx6.Size = new System.Drawing.Size(124, 53); + this.textBoxEx6.Size = new System.Drawing.Size(124, 38); this.textBoxEx6.TabIndex = 29; this.textBoxEx6.Text = "0"; this.textBoxEx6.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -310,7 +310,7 @@ this.textBoxEx5.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx5.PromptText = ""; this.textBoxEx5.RegexPattern = ""; - this.textBoxEx5.Size = new System.Drawing.Size(124, 53); + this.textBoxEx5.Size = new System.Drawing.Size(124, 38); this.textBoxEx5.TabIndex = 28; this.textBoxEx5.Text = "0"; this.textBoxEx5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -339,7 +339,7 @@ this.textBoxEx4.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx4.PromptText = ""; this.textBoxEx4.RegexPattern = ""; - this.textBoxEx4.Size = new System.Drawing.Size(124, 53); + this.textBoxEx4.Size = new System.Drawing.Size(124, 38); this.textBoxEx4.TabIndex = 27; this.textBoxEx4.Text = "0"; this.textBoxEx4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -350,7 +350,7 @@ this.label1.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Location = new System.Drawing.Point(974, 108); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(31, 33); + this.label1.Size = new System.Drawing.Size(21, 22); this.label1.TabIndex = 11; this.label1.Text = "0"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -361,7 +361,7 @@ this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label2.Location = new System.Drawing.Point(610, 26); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(238, 24); + this.label2.Size = new System.Drawing.Size(159, 16); this.label2.TabIndex = 4; this.label2.Text = "收料2电机速度(mm/s)"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -372,7 +372,7 @@ this.label3.Font = new System.Drawing.Font("宋体", 12F); this.label3.Location = new System.Drawing.Point(313, 26); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(238, 24); + this.label3.Size = new System.Drawing.Size(159, 16); this.label3.TabIndex = 2; this.label3.Text = "收料1电机速度(mm/s)"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -383,7 +383,7 @@ this.label4.Font = new System.Drawing.Font("宋体", 12F); this.label4.Location = new System.Drawing.Point(10, 26); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(250, 24); + this.label4.Size = new System.Drawing.Size(167, 16); this.label4.TabIndex = 0; this.label4.Text = "毛毡带电机速度(mm/s)"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -449,7 +449,7 @@ this.label5.Font = new System.Drawing.Font("宋体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label5.Location = new System.Drawing.Point(974, 108); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(31, 33); + this.label5.Size = new System.Drawing.Size(21, 22); this.label5.TabIndex = 11; this.label5.Text = "0"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -597,7 +597,7 @@ this.textBoxEx26.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx26.PromptText = ""; this.textBoxEx26.RegexPattern = ""; - this.textBoxEx26.Size = new System.Drawing.Size(212, 53); + this.textBoxEx26.Size = new System.Drawing.Size(212, 38); this.textBoxEx26.TabIndex = 53; this.textBoxEx26.Text = "0"; this.textBoxEx26.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -627,7 +627,7 @@ this.textBoxEx25.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx25.PromptText = ""; this.textBoxEx25.RegexPattern = ""; - this.textBoxEx25.Size = new System.Drawing.Size(174, 53); + this.textBoxEx25.Size = new System.Drawing.Size(174, 38); this.textBoxEx25.TabIndex = 52; this.textBoxEx25.Text = "0"; this.textBoxEx25.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -657,7 +657,7 @@ this.textBoxEx24.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx24.PromptText = ""; this.textBoxEx24.RegexPattern = ""; - this.textBoxEx24.Size = new System.Drawing.Size(211, 53); + this.textBoxEx24.Size = new System.Drawing.Size(211, 38); this.textBoxEx24.TabIndex = 51; this.textBoxEx24.Text = "0"; this.textBoxEx24.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -687,7 +687,7 @@ this.textBoxEx23.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx23.PromptText = ""; this.textBoxEx23.RegexPattern = ""; - this.textBoxEx23.Size = new System.Drawing.Size(177, 53); + this.textBoxEx23.Size = new System.Drawing.Size(177, 38); this.textBoxEx23.TabIndex = 50; this.textBoxEx23.Text = "0"; this.textBoxEx23.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -717,7 +717,7 @@ this.textBoxEx21.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx21.PromptText = ""; this.textBoxEx21.RegexPattern = ""; - this.textBoxEx21.Size = new System.Drawing.Size(212, 53); + this.textBoxEx21.Size = new System.Drawing.Size(212, 38); this.textBoxEx21.TabIndex = 48; this.textBoxEx21.Text = "0"; this.textBoxEx21.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -747,7 +747,7 @@ this.textBoxEx20.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx20.PromptText = ""; this.textBoxEx20.RegexPattern = ""; - this.textBoxEx20.Size = new System.Drawing.Size(174, 53); + this.textBoxEx20.Size = new System.Drawing.Size(174, 38); this.textBoxEx20.TabIndex = 47; this.textBoxEx20.Text = "0"; this.textBoxEx20.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -777,7 +777,7 @@ this.textBoxEx19.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx19.PromptText = ""; this.textBoxEx19.RegexPattern = ""; - this.textBoxEx19.Size = new System.Drawing.Size(211, 53); + this.textBoxEx19.Size = new System.Drawing.Size(211, 38); this.textBoxEx19.TabIndex = 46; this.textBoxEx19.Text = "0"; this.textBoxEx19.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -807,7 +807,7 @@ this.textBoxEx16.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx16.PromptText = ""; this.textBoxEx16.RegexPattern = ""; - this.textBoxEx16.Size = new System.Drawing.Size(212, 53); + this.textBoxEx16.Size = new System.Drawing.Size(212, 38); this.textBoxEx16.TabIndex = 44; this.textBoxEx16.Text = "0"; this.textBoxEx16.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -837,7 +837,7 @@ this.textBoxEx15.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx15.PromptText = ""; this.textBoxEx15.RegexPattern = ""; - this.textBoxEx15.Size = new System.Drawing.Size(174, 53); + this.textBoxEx15.Size = new System.Drawing.Size(174, 38); this.textBoxEx15.TabIndex = 43; this.textBoxEx15.Text = "0"; this.textBoxEx15.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -867,7 +867,7 @@ this.textBoxEx14.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx14.PromptText = ""; this.textBoxEx14.RegexPattern = ""; - this.textBoxEx14.Size = new System.Drawing.Size(211, 53); + this.textBoxEx14.Size = new System.Drawing.Size(211, 38); this.textBoxEx14.TabIndex = 42; this.textBoxEx14.Text = "0"; this.textBoxEx14.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -897,7 +897,7 @@ this.textBoxEx13.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx13.PromptText = ""; this.textBoxEx13.RegexPattern = ""; - this.textBoxEx13.Size = new System.Drawing.Size(177, 53); + this.textBoxEx13.Size = new System.Drawing.Size(177, 38); this.textBoxEx13.TabIndex = 41; this.textBoxEx13.Text = "0"; this.textBoxEx13.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -927,7 +927,7 @@ this.textBoxEx11.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx11.PromptText = ""; this.textBoxEx11.RegexPattern = ""; - this.textBoxEx11.Size = new System.Drawing.Size(212, 53); + this.textBoxEx11.Size = new System.Drawing.Size(212, 38); this.textBoxEx11.TabIndex = 39; this.textBoxEx11.Text = "0"; this.textBoxEx11.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -957,7 +957,7 @@ this.textBoxEx10.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx10.PromptText = ""; this.textBoxEx10.RegexPattern = ""; - this.textBoxEx10.Size = new System.Drawing.Size(174, 53); + this.textBoxEx10.Size = new System.Drawing.Size(174, 38); this.textBoxEx10.TabIndex = 38; this.textBoxEx10.Text = "0"; this.textBoxEx10.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -987,7 +987,7 @@ this.textBoxEx9.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx9.PromptText = ""; this.textBoxEx9.RegexPattern = ""; - this.textBoxEx9.Size = new System.Drawing.Size(211, 53); + this.textBoxEx9.Size = new System.Drawing.Size(211, 38); this.textBoxEx9.TabIndex = 37; this.textBoxEx9.Text = "0"; this.textBoxEx9.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -1017,7 +1017,7 @@ this.textBoxEx8.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx8.PromptText = ""; this.textBoxEx8.RegexPattern = ""; - this.textBoxEx8.Size = new System.Drawing.Size(177, 53); + this.textBoxEx8.Size = new System.Drawing.Size(177, 38); this.textBoxEx8.TabIndex = 36; this.textBoxEx8.Text = "0"; this.textBoxEx8.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -1047,7 +1047,7 @@ this.textBoxEx18.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.textBoxEx18.PromptText = ""; this.textBoxEx18.RegexPattern = ""; - this.textBoxEx18.Size = new System.Drawing.Size(177, 53); + this.textBoxEx18.Size = new System.Drawing.Size(177, 38); this.textBoxEx18.TabIndex = 34; this.textBoxEx18.Text = "0"; this.textBoxEx18.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; diff --git a/RfidWeb/FromSQl.cs b/RfidWeb/FromSQl.cs index cbc0eb5..b0b1204 100644 --- a/RfidWeb/FromSQl.cs +++ b/RfidWeb/FromSQl.cs @@ -1,10 +1,11 @@ -using Chloe.PostgreSQL.DDL; -using Chloe.RDBMS.DDL; + using DB.Entity; using DB; using System; using System.Collections.Generic; using System.Windows.Forms; +using Chloe.PostgreSQL.DDL; +using Chloe.RDBMS.DDL; using Tool; namespace RfidWeb @@ -14,14 +15,7 @@ namespace RfidWeb public FromSQl() { InitializeComponent(); - ucHorizontalList1.DataSource = new List>() - { - new KeyValuePair("a", "a"), - new KeyValuePair("ab", "ab"), - new KeyValuePair("ac", "ac"), - new KeyValuePair("ad", "ad"), - new KeyValuePair("ae", "ae"), - }; + } @@ -153,7 +147,51 @@ namespace RfidWeb private void ucBtnExt2_BtnClick(object sender, EventArgs e) { var dbContext = DbFactory.GetContext; - + var dic = new Dictionary(); + dic["HMI_button_LP_ON[0].0"] = "右料盘横移电缸"; + + + for (int i = 1; i < 31; i++) + { + string key = "HMI_button_LP_ON[0]." + i; + dic[key] = ""; + } + + for (int i = 0; i < 31; i++) + { + string key = "HMI_button_LP_ON[1]." + i; + dic[key] = ""; + } + + + + foreach (var eti in dic) + { + + Point p = new Point() + { + ID = GetId, + + FromType = "料盘页手动界面", + DataType = "bool", + CreateDate = DateTime.Now, + LastModifyDate = DateTime.Now, + CreateUserId = "", + CreateUserName = "", + LastModifyUserId = "", + LastModifyUserName = "", + PointName = eti.Value, + PointAddress = eti.Key + }; + + dbContext.Insert(p); + + + } + + + + } } } diff --git a/RfidWeb/RfidWeb.csproj b/RfidWeb/RfidWeb.csproj index ca78bb3..e00c872 100644 --- a/RfidWeb/RfidWeb.csproj +++ b/RfidWeb/RfidWeb.csproj @@ -34,13 +34,13 @@ - 5.38.0 + 5.40.0 - 5.38.0 + 5.40.0 - 5.38.0 + 5.40.0 False diff --git a/Tool/Tool.csproj b/Tool/Tool.csproj index 33213f4..538014d 100644 --- a/Tool/Tool.csproj +++ b/Tool/Tool.csproj @@ -37,7 +37,7 @@ - 11.0.2024.1001 + 11.0.2024.1101 13.0.3