From 17a51e5d929849bc4c68f7774399fda98fffdb48 Mon Sep 17 00:00:00 2001 From: "nodyang@aliyun.com" Date: Sat, 16 Nov 2024 11:10:28 +0800 Subject: [PATCH] 16 --- DB/Service/PointService.cs | 32 +++- DB/Service/UpdateLogService.cs | 32 ++++ RfidWeb/FormMain.Designer.cs | 20 +- RfidWeb/FormMain.cs | 21 ++- RfidWeb/Frm/FromUploadLog.Designer.cs | 253 ++++++++++++++++++++++++++ RfidWeb/Frm/FromUploadLog.cs | 59 ++++++ RfidWeb/Frm/FromUploadLog.resx | 147 +++++++++++++++ RfidWeb/FromSQl.cs | 146 +++------------ RfidWeb/Program.cs | 4 +- RfidWeb/RfidWeb.csproj | 9 + Tool/Model/HmiPoint.cs | 2 +- 11 files changed, 595 insertions(+), 130 deletions(-) create mode 100644 RfidWeb/Frm/FromUploadLog.Designer.cs create mode 100644 RfidWeb/Frm/FromUploadLog.cs create mode 100644 RfidWeb/Frm/FromUploadLog.resx diff --git a/DB/Service/PointService.cs b/DB/Service/PointService.cs index eebfdab..78e6496 100644 --- a/DB/Service/PointService.cs +++ b/DB/Service/PointService.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using DB.Entity; using NewLife.Caching; @@ -17,8 +18,35 @@ namespace DB.Service } } - - + + public string GetAddressName(string address) + { + using (var dbContext = DbFactory.GetContext) + { + var entity= dbContext.Query() + .Where(x => x.PointAddress == address) + .Select(x => x.PointName).FirstOrDefault(); + return string.IsNullOrEmpty(entity) ? "" : entity; + } + } + + public Dictionary GetValueName() + { + using (var dbContext = DbFactory.GetContext) + { + var entity = dbContext.Query() + .Select(x=>new Point() + { + PointAddress = x.PointAddress, + PointName = x.PointName + }) + .ToList(); + + Dictionary dic = + entity.ToDictionary(x => x.PointAddress, x => x.PointName); + return dic; + } + } } } \ No newline at end of file diff --git a/DB/Service/UpdateLogService.cs b/DB/Service/UpdateLogService.cs index 99b7531..dfeb421 100644 --- a/DB/Service/UpdateLogService.cs +++ b/DB/Service/UpdateLogService.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text.RegularExpressions; using System.Windows.Forms.VisualStyles; +using Chloe; using DB.Dto; using DB.Entity; @@ -9,6 +10,10 @@ using Tool; namespace DB.Service { + + /// + /// 参数修改日志 + /// public class UpdateLogService { public bool AddOrUpdateLog(UserDto user,string address,uint value) @@ -54,5 +59,32 @@ namespace DB.Service } + + + public PagedList GetPagedList(int pageIndex, int pageSize, string key) + { + + + PagingResult pagePagingResult; + using (var dbContext = DbFactory.GetContext) + { + pagePagingResult = dbContext.Query() + .WhereIf(!string.IsNullOrEmpty(key),x=>x.PointName.Contains(key)) + .OrderByDesc(x => x.ID) + .Paging(pageIndex, pageSize); + + + } + + + + PagedList paged = new PagedList(pagePagingResult.DataList, + pagePagingResult.Totals.ToInt(), pageIndex, pageSize); + + return paged; + + } + + } } \ No newline at end of file diff --git a/RfidWeb/FormMain.Designer.cs b/RfidWeb/FormMain.Designer.cs index 7288997..71a3870 100644 --- a/RfidWeb/FormMain.Designer.cs +++ b/RfidWeb/FormMain.Designer.cs @@ -50,6 +50,7 @@ this.labTime = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); + this.buttonUpdateLog = new System.Windows.Forms.Button(); this.panel1.SuspendLayout(); this.panel6.SuspendLayout(); this.panel7.SuspendLayout(); @@ -111,6 +112,7 @@ // panel8 // this.panel8.BackColor = System.Drawing.Color.Transparent; + this.panel8.Controls.Add(this.buttonUpdateLog); this.panel8.Controls.Add(this.hslLanternSimplePlc); this.panel8.Controls.Add(this.button2); this.panel8.Controls.Add(this.button1); @@ -130,7 +132,7 @@ // // hslLanternSimplePlc // - this.hslLanternSimplePlc.Location = new System.Drawing.Point(22, 536); + this.hslLanternSimplePlc.Location = new System.Drawing.Point(22, 641); this.hslLanternSimplePlc.Name = "hslLanternSimplePlc"; this.hslLanternSimplePlc.Size = new System.Drawing.Size(78, 94); this.hslLanternSimplePlc.TabIndex = 10; @@ -336,6 +338,21 @@ this.label1.TabIndex = 0; this.label1.Text = "佳通RFID层合裁切设备"; // + // buttonUpdateLog + // + this.buttonUpdateLog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173))))); + this.buttonUpdateLog.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.buttonUpdateLog.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.buttonUpdateLog.ForeColor = System.Drawing.SystemColors.Window; + this.buttonUpdateLog.Location = new System.Drawing.Point(22, 522); + this.buttonUpdateLog.Margin = new System.Windows.Forms.Padding(4); + this.buttonUpdateLog.Name = "buttonUpdateLog"; + this.buttonUpdateLog.Size = new System.Drawing.Size(300, 65); + this.buttonUpdateLog.TabIndex = 11; + this.buttonUpdateLog.Text = "参数修改记录"; + this.buttonUpdateLog.UseVisualStyleBackColor = false; + this.buttonUpdateLog.Click += new System.EventHandler(this.buttonUpdateLog_Click); + // // FormMain // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -376,5 +393,6 @@ private System.Windows.Forms.Label labTime; private System.Windows.Forms.Label labUser; private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button buttonUpdateLog; } } \ No newline at end of file diff --git a/RfidWeb/FormMain.cs b/RfidWeb/FormMain.cs index 95dc91b..169ea85 100644 --- a/RfidWeb/FormMain.cs +++ b/RfidWeb/FormMain.cs @@ -105,27 +105,27 @@ namespace RfidWeb } private UpdateLogService updateLogService = new UpdateLogService(); - + private PointService pointService = new PointService(); private void UpdateLog() { if (UserManager.IsExit()) { - + var dic = pointService.GetValueName(); + if (cache.ContainsKey(CacheKeyManager.UpdateLog)) return; cache.Set(CacheKeyManager.UpdateLog, DateTime.Now, TimeSpan.FromSeconds(5)); var plc = PlcConnect.Instance; - var userDto = TestFactory.TestUser(); - - var strings = HmiPoint.GetValue(); - + var userDto = UserManager.GetUser(); + var strings = dic.Keys; foreach (var se in strings) { var res = plc.ReadUInt32(se); if (res.IsSuccess) { - updateLogService.AddOrUpdateLog(userDto, se, res.Content); + string name = dic[se]; + updateLogService.AddOrUpdateLog(userDto, name, res.Content); } } cache.Remove(CacheKeyManager.UpdateLog); @@ -246,5 +246,12 @@ namespace RfidWeb } } } + + private void buttonUpdateLog_Click(object sender, EventArgs e) + { + panContent.Controls.Clear(); + panContent.Controls.Add(new FromUploadLog()); + CheckButton(buttonUpdateLog); + } } } diff --git a/RfidWeb/Frm/FromUploadLog.Designer.cs b/RfidWeb/Frm/FromUploadLog.Designer.cs new file mode 100644 index 0000000..cbcbaf9 --- /dev/null +++ b/RfidWeb/Frm/FromUploadLog.Designer.cs @@ -0,0 +1,253 @@ +namespace RfidWeb.Frm +{ + partial class FromUploadLog + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FromUploadLog)); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + this.panelTop = new System.Windows.Forms.Panel(); + this.ucBtnSelect = new HZH_Controls.Controls.UCBtnExt(); + this.textBoxSel = new HZH_Controls.Controls.TextBoxEx(); + this.ucPagerControl21 = new HZH_Controls.Controls.UCPagerControl2(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Alarm = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.UserName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.RoleName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.CreateUserName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.CreateDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.panelTop.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // panelTop + // + this.panelTop.Controls.Add(this.ucBtnSelect); + this.panelTop.Controls.Add(this.textBoxSel); + this.panelTop.Dock = System.Windows.Forms.DockStyle.Top; + this.panelTop.Location = new System.Drawing.Point(0, 0); + this.panelTop.Name = "panelTop"; + this.panelTop.Size = new System.Drawing.Size(910, 80); + this.panelTop.TabIndex = 2; + // + // ucBtnSelect + // + this.ucBtnSelect.BackColor = System.Drawing.Color.White; + this.ucBtnSelect.BtnBackColor = System.Drawing.Color.White; + this.ucBtnSelect.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.ucBtnSelect.BtnForeColor = System.Drawing.Color.White; + this.ucBtnSelect.BtnText = "查询"; + this.ucBtnSelect.ConerRadius = 5; + this.ucBtnSelect.Cursor = System.Windows.Forms.Cursors.Hand; + this.ucBtnSelect.EnabledMouseEffect = false; + this.ucBtnSelect.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204))))); + this.ucBtnSelect.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); + this.ucBtnSelect.IsRadius = true; + this.ucBtnSelect.IsShowRect = true; + this.ucBtnSelect.IsShowTips = false; + this.ucBtnSelect.Location = new System.Drawing.Point(226, 18); + this.ucBtnSelect.Margin = new System.Windows.Forms.Padding(0); + this.ucBtnSelect.Name = "ucBtnSelect"; + this.ucBtnSelect.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(83)))), ((int)(((byte)(171))))); + this.ucBtnSelect.RectWidth = 1; + this.ucBtnSelect.Size = new System.Drawing.Size(121, 35); + this.ucBtnSelect.TabIndex = 2; + this.ucBtnSelect.TabStop = false; + this.ucBtnSelect.TipsColor = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(101)))), ((int)(((byte)(204))))); + this.ucBtnSelect.TipsText = ""; + this.ucBtnSelect.BtnClick += new System.EventHandler(this.ucBtnSelect_BtnClick_1); + // + // textBoxSel + // + this.textBoxSel.DecLength = 2; + this.textBoxSel.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.textBoxSel.InputType = HZH_Controls.TextInputType.NotControl; + this.textBoxSel.Location = new System.Drawing.Point(32, 18); + this.textBoxSel.MaxValue = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.textBoxSel.MinValue = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.textBoxSel.MyRectangle = new System.Drawing.Rectangle(0, 0, 0, 0); + this.textBoxSel.Name = "textBoxSel"; + this.textBoxSel.OldText = null; + this.textBoxSel.PromptColor = System.Drawing.Color.Gray; + this.textBoxSel.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); + this.textBoxSel.PromptText = ""; + this.textBoxSel.RegexPattern = ""; + this.textBoxSel.Size = new System.Drawing.Size(158, 30); + this.textBoxSel.TabIndex = 0; + // + // ucPagerControl21 + // + this.ucPagerControl21.BackColor = System.Drawing.Color.White; + this.ucPagerControl21.DataSource = ((System.Collections.Generic.List)(resources.GetObject("ucPagerControl21.DataSource"))); + this.ucPagerControl21.Dock = System.Windows.Forms.DockStyle.Bottom; + this.ucPagerControl21.Location = new System.Drawing.Point(0, 894); + this.ucPagerControl21.Name = "ucPagerControl21"; + this.ucPagerControl21.PageCount = 0; + this.ucPagerControl21.PageIndex = 1; + this.ucPagerControl21.PageModel = HZH_Controls.Controls.PageModel.Soure; + this.ucPagerControl21.PageSize = 10; + this.ucPagerControl21.Size = new System.Drawing.Size(910, 41); + this.ucPagerControl21.StartIndex = 1; + this.ucPagerControl21.TabIndex = 3; + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AllowUserToDeleteRows = false; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.ID, + this.Alarm, + this.UserName, + this.RoleName, + this.CreateUserName, + this.CreateDate}); + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle7; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.Location = new System.Drawing.Point(0, 80); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle8; + this.dataGridView1.RowTemplate.Height = 23; + this.dataGridView1.Size = new System.Drawing.Size(910, 814); + this.dataGridView1.TabIndex = 4; + // + // ID + // + this.ID.DataPropertyName = "ID"; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.ID.DefaultCellStyle = dataGridViewCellStyle6; + this.ID.HeaderText = "ID"; + this.ID.Name = "ID"; + this.ID.ReadOnly = true; + this.ID.Visible = false; + // + // Alarm + // + this.Alarm.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Alarm.DataPropertyName = "PointName"; + this.Alarm.HeaderText = "点位名称"; + this.Alarm.Name = "Alarm"; + this.Alarm.ReadOnly = true; + // + // UserName + // + this.UserName.DataPropertyName = "OldValue"; + this.UserName.HeaderText = "修改前数据"; + this.UserName.Name = "UserName"; + this.UserName.ReadOnly = true; + this.UserName.Width = 180; + // + // RoleName + // + this.RoleName.DataPropertyName = "NewValue"; + this.RoleName.HeaderText = "当前数据"; + this.RoleName.Name = "RoleName"; + this.RoleName.ReadOnly = true; + this.RoleName.Width = 180; + // + // CreateUserName + // + this.CreateUserName.DataPropertyName = "CreateUserName"; + this.CreateUserName.HeaderText = "修改人"; + this.CreateUserName.Name = "CreateUserName"; + this.CreateUserName.ReadOnly = true; + this.CreateUserName.Width = 180; + // + // CreateDate + // + this.CreateDate.DataPropertyName = "CreateDate"; + this.CreateDate.HeaderText = "修改时间"; + this.CreateDate.Name = "CreateDate"; + this.CreateDate.ReadOnly = true; + this.CreateDate.Width = 180; + // + // FromUploadLog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.dataGridView1); + this.Controls.Add(this.ucPagerControl21); + this.Controls.Add(this.panelTop); + this.Name = "FromUploadLog"; + this.Size = new System.Drawing.Size(910, 935); + this.panelTop.ResumeLayout(false); + this.panelTop.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panelTop; + private HZH_Controls.Controls.UCBtnExt ucBtnSelect; + private HZH_Controls.Controls.TextBoxEx textBoxSel; + private HZH_Controls.Controls.UCPagerControl2 ucPagerControl21; + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.DataGridViewTextBoxColumn ID; + private System.Windows.Forms.DataGridViewTextBoxColumn Alarm; + private System.Windows.Forms.DataGridViewTextBoxColumn UserName; + private System.Windows.Forms.DataGridViewTextBoxColumn RoleName; + private System.Windows.Forms.DataGridViewTextBoxColumn CreateUserName; + private System.Windows.Forms.DataGridViewTextBoxColumn CreateDate; + } +} diff --git a/RfidWeb/Frm/FromUploadLog.cs b/RfidWeb/Frm/FromUploadLog.cs new file mode 100644 index 0000000..12b5aaa --- /dev/null +++ b/RfidWeb/Frm/FromUploadLog.cs @@ -0,0 +1,59 @@ +using HZH_Controls.Controls; + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using DB.Service; + +namespace RfidWeb.Frm +{ + public partial class FromUploadLog : UserControl + { + public FromUploadLog() + { + InitializeComponent(); + Init(); + } + UpdateLogService updateLogService=new UpdateLogService(); + private void Init() + { + + this.dataGridView1.AutoGenerateColumns = false; + + ucPagerControl21.PageModel = PageModel.PageCount; + ucPagerControl21.PageIndex = 1; + ucPagerControl21.PageSize = 20; + + } + + private void Replace() + { + ucPagerControl21.PageIndex = 1; + ucPagerControl21_ShowSourceChanged(new object()); + + } + + private void ucPagerControl21_ShowSourceChanged(object currentSource) + { + string key = textBoxSel.Text; + int index = ucPagerControl21.PageIndex; + var page = updateLogService.GetPagedList(ucPagerControl21.PageSize, + ucPagerControl21.PageSize,key); + ucPagerControl21.PageCount = page.TotalPages; + this.dataGridView1.DataSource = page.Items; + } + + + private void ucBtnSelect_BtnClick_1(object sender, EventArgs e) + { + Replace(); + + } + } +} diff --git a/RfidWeb/Frm/FromUploadLog.resx b/RfidWeb/Frm/FromUploadLog.resx new file mode 100644 index 0000000..9a743fd --- /dev/null +++ b/RfidWeb/Frm/FromUploadLog.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u + ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u + PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB + AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLk9iamVjdAMAAAAGX2l0 + ZW1zBV9zaXplCF92ZXJzaW9uBQAACAgCAAAACQMAAAAAAAAAAAAAABADAAAAAAAAAAs= + + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/RfidWeb/FromSQl.cs b/RfidWeb/FromSQl.cs index 5005cdb..15914fb 100644 --- a/RfidWeb/FromSQl.cs +++ b/RfidWeb/FromSQl.cs @@ -28,125 +28,35 @@ namespace RfidWeb var rfidSetting = RfidSetting.Current; var dbContext = DbFactory.GetContext; - new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists); - - - + // new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists); + + + Dictionary dic = new Dictionary(); + dic["feeding_motor_speed"] = "供料电机速度"; + dic["Laminated_motor_speed"] = "层合电机速度"; + dic["Felt_belt_motor_speed"] = "毛毡带电机速度"; + dic["Receiving_Electric_motor_speed"] = "收料电机1&2速度"; + + dic["Product_counter2"] = "层合生产数量"; + dic["CQ_Chip1_counter"] = "裁切1生产数量"; + dic["CQ_Chip2_counter"] = "裁切2生产数量"; + + dic["QDWD1SS"] = "裁刀1温度"; + dic["QDWD2SS"] = "裁刀2温度"; + + dic["QDWD2SS"] = "裁刀2温度"; + + foreach (var ee in dic) + { + Point point = new Point(); + point.DataType = "Uint32"; + point.FromType = "参数"; + point.PointAddress = ee.Key; + point.PointName=ee.Value; + point.ID = GetId; + dbContext.Insert(point); + } - - - - //dbContext.Insert(new Role() - //{ - // ID = SnowflakeFactory.NewId, - // RoleName = "管理层", - // RoleLevel = 1 - //}); - //dbContext.Insert(new Role() - //{ - // ID = SnowflakeFactory.NewId, - // RoleName = "设备层", - // RoleLevel = 2 - //}); - //dbContext.Insert(new Role() - //{ - // ID = SnowflakeFactory.NewId, - // RoleName = "使用层", - // RoleLevel = 3 - //}); - - - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842295074816, - // UserName = "管理员1", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842295074816, - // UserName = "管理员2", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842295074816, - // UserName = "管理员2", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - - - - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842987134976, - // UserName = "设备层1", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842987134976, - // UserName = "设备层2", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842987134976, - // UserName = "设备层2", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - - - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842999717888, - // UserName = "使用层1", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842999717888, - // UserName = "使用层2", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - //dbContext.Insert(new UserInfo() - //{ - // ID = SnowflakeFactory.NewId, - // RoleId = - // 7254091842999717888, - // UserName = "使用层2", - // Pwd = "E10ADC3949BA59ABBE56E057F20F883E", - - //}); - - - - - // new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateNew); } diff --git a/RfidWeb/Program.cs b/RfidWeb/Program.cs index 113c7ec..ebf97b4 100644 --- a/RfidWeb/Program.cs +++ b/RfidWeb/Program.cs @@ -16,7 +16,9 @@ namespace RfidWeb Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new FormMain()); + Application.Run(new FormMain()); + + //Application.Run(new FromSQl()); } } } diff --git a/RfidWeb/RfidWeb.csproj b/RfidWeb/RfidWeb.csproj index 54dc947..4365234 100644 --- a/RfidWeb/RfidWeb.csproj +++ b/RfidWeb/RfidWeb.csproj @@ -172,6 +172,12 @@ FromAlarmLog.cs + + UserControl + + + FromUploadLog.cs + UserControl @@ -215,6 +221,9 @@ FromAlarmLog.cs + + FromUploadLog.cs + UserAlarmShow.cs Designer diff --git a/Tool/Model/HmiPoint.cs b/Tool/Model/HmiPoint.cs index 5db076f..19192ec 100644 --- a/Tool/Model/HmiPoint.cs +++ b/Tool/Model/HmiPoint.cs @@ -103,7 +103,7 @@ namespace Tool.Model Laminated_motor_speed, Felt_belt_motor_speed, Receiving_Electric_motor_speed, - + }; return ls.ToArray();