From e120927df2e97c91679f5f6467179a34cd60598c Mon Sep 17 00:00:00 2001 From: gongxh Date: Mon, 16 May 2022 13:54:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CleanMachine.BLL/ZBK/DayReportBLL.cs | 17 + CleanMachine.DAL/ZBK/DayReportDAL.cs | 40 ++ CleanMachine.Model/EnumFormType.cs | 3 +- CleanMachine.Model/ZBK/DayReport.cs | 25 ++ CleanMachineHMI/CleanMachineHMI.csproj | 1 + .../FrmUserControl/frmDayReport.Designer.cs | 356 ++++++++++++++++++ .../FrmUserControl/frmDayReport.cs | 106 ++++++ .../FrmUserControl/frmDayReport.resx | 123 ++++++ .../frmMainDetailNew.Designer.cs | 8 +- .../FrmUserControl/frmMainDetailNew.cs | 5 +- CleanMachineHMI/Utils/PlcOperationHelper.cs | 8 +- 11 files changed, 683 insertions(+), 9 deletions(-) create mode 100644 CleanMachine.BLL/ZBK/DayReportBLL.cs create mode 100644 CleanMachine.DAL/ZBK/DayReportDAL.cs create mode 100644 CleanMachine.Model/ZBK/DayReport.cs create mode 100644 CleanMachineHMI/FrmUserControl/frmDayReport.Designer.cs create mode 100644 CleanMachineHMI/FrmUserControl/frmDayReport.cs create mode 100644 CleanMachineHMI/FrmUserControl/frmDayReport.resx diff --git a/CleanMachine.BLL/ZBK/DayReportBLL.cs b/CleanMachine.BLL/ZBK/DayReportBLL.cs new file mode 100644 index 0000000..a688f59 --- /dev/null +++ b/CleanMachine.BLL/ZBK/DayReportBLL.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CleanMachine.BLL.ZBK +{ + public class DayReportBLL + { + + public IEnumerable GetReport(string strWhere, object Params = null) + { + return new CleanMachine.DAL.ZBK.DayReportDAL().GetReport(strWhere, Params); + } + + + } +} diff --git a/CleanMachine.DAL/ZBK/DayReportDAL.cs b/CleanMachine.DAL/ZBK/DayReportDAL.cs new file mode 100644 index 0000000..86525a6 --- /dev/null +++ b/CleanMachine.DAL/ZBK/DayReportDAL.cs @@ -0,0 +1,40 @@ +using LeadDataBaseUtility; +using System; +using System.Collections.Generic; +using System.Text; + +namespace CleanMachine.DAL.ZBK +{ + public class DayReportDAL + + { + + + public IEnumerable GetReport(string strWhere,object Params=null) + { + + + string strSql = $@" + select * from (SELECT a.*,b.Scrap,c.StartValue,c.EndValue,c.StartTime,c.EndTime from + (SELECT date(INPUT_TIME) as date,SUM(CURRENT_NUMBER) as cleaned from VW_WORKING_PALLET_MSG WHERE CLEAN_MODE_CODE='SortedCleaned' + GROUP BY date(INPUT_TIME)) as a + LEFT JOIN + ( + SELECT date(INPUT_TIME) as date,SUM(CURRENT_NUMBER) as scrap from VW_WORKING_PALLET_MSG WHERE CLEAN_MODE_CODE<>'SortedCleaned' + GROUP BY date(INPUT_TIME) + ) as b on a.date=b.date + LEFT JOIN CM_DayWorkTime as c on a.date=date(c.date) + ) as tbl + "; + if (strWhere.Trim() != "") + { + strSql += $" WHERE {strWhere}"; + } + return LeadDbHelperSQLite.Query(strSql, Params); + + + } + + + } +} diff --git a/CleanMachine.Model/EnumFormType.cs b/CleanMachine.Model/EnumFormType.cs index 677ec66..c79c888 100644 --- a/CleanMachine.Model/EnumFormType.cs +++ b/CleanMachine.Model/EnumFormType.cs @@ -34,6 +34,7 @@ namespace CleanMachineHMI.Domain.Enums DataSearch, WarningLog, Maintenance, - ShiftCountRecord + ShiftCountRecord, + DayReport } } diff --git a/CleanMachine.Model/ZBK/DayReport.cs b/CleanMachine.Model/ZBK/DayReport.cs new file mode 100644 index 0000000..4b45299 --- /dev/null +++ b/CleanMachine.Model/ZBK/DayReport.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CleanMachine.Model.ZBK +{ + public class DayReport + { + + public DateTime Date { get; set; } + public int Cleaned { get; set; } + public int Scrap { get; set; } + public int StartValue { get; set; } + public int EndValue { get; set; } + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } + + + public DayOfWeek DayOfWeek { get => Date.DayOfWeek; } + + public float MachineHours { get=>(EndValue-StartValue)/3600f; } + + + } +} diff --git a/CleanMachineHMI/CleanMachineHMI.csproj b/CleanMachineHMI/CleanMachineHMI.csproj index ec57d65..1b060eb 100644 --- a/CleanMachineHMI/CleanMachineHMI.csproj +++ b/CleanMachineHMI/CleanMachineHMI.csproj @@ -60,6 +60,7 @@ UserControl + UserControl diff --git a/CleanMachineHMI/FrmUserControl/frmDayReport.Designer.cs b/CleanMachineHMI/FrmUserControl/frmDayReport.Designer.cs new file mode 100644 index 0000000..10e3a7d --- /dev/null +++ b/CleanMachineHMI/FrmUserControl/frmDayReport.Designer.cs @@ -0,0 +1,356 @@ + +namespace CleanMachineHMI.FrmUserControl +{ + partial class frmDayReport + { + /// + /// 必需的设计器变量。 + /// + 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() + { + this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); + this.kryptonGroupBox3 = new Krypton.Toolkit.KryptonGroupBox(); + this.kryptonDataGridView1 = new Krypton.Toolkit.KryptonDataGridView(); + this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.kbt_Reset = new Krypton.Toolkit.KryptonButton(); + this.kbt_Query = new Krypton.Toolkit.KryptonButton(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); + this.kdtp_CreateStartTime = new Krypton.Toolkit.KryptonDateTimePicker(); + this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel(); + this.kdtp_CreateEndTime = new Krypton.Toolkit.KryptonDateTimePicker(); + this.colDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColDayOfWeek = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColCleaned = new Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn(); + this.ColScrap = new Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn(); + this.ColMachineHours = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColStartTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColEndTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); + this.kryptonPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3.Panel)).BeginInit(); + this.kryptonGroupBox3.Panel.SuspendLayout(); + this.kryptonGroupBox3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonDataGridView1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4.Panel)).BeginInit(); + this.kryptonGroupBox4.Panel.SuspendLayout(); + this.kryptonGroupBox4.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // kryptonPanel2 + // + this.kryptonPanel2.Controls.Add(this.kryptonGroupBox3); + this.kryptonPanel2.Controls.Add(this.kryptonGroupBox4); + this.kryptonPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.kryptonPanel2.Location = new System.Drawing.Point(0, 0); + this.kryptonPanel2.Name = "kryptonPanel2"; + this.kryptonPanel2.Size = new System.Drawing.Size(1024, 672); + this.kryptonPanel2.TabIndex = 5; + // + // kryptonGroupBox3 + // + this.kryptonGroupBox3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly; + this.kryptonGroupBox3.CaptionOverlap = 0D; + this.kryptonGroupBox3.CaptionStyle = Krypton.Toolkit.LabelStyle.NormalControl; + this.kryptonGroupBox3.Dock = System.Windows.Forms.DockStyle.Fill; + this.kryptonGroupBox3.Location = new System.Drawing.Point(0, 150); + this.kryptonGroupBox3.Name = "kryptonGroupBox3"; + // + // kryptonGroupBox3.Panel + // + this.kryptonGroupBox3.Panel.Controls.Add(this.kryptonDataGridView1); + this.kryptonGroupBox3.Size = new System.Drawing.Size(1024, 522); + this.kryptonGroupBox3.TabIndex = 6; + this.kryptonGroupBox3.Values.Heading = "数据区:"; + // + // kryptonDataGridView1 + // + this.kryptonDataGridView1.AllowUserToAddRows = false; + this.kryptonDataGridView1.AllowUserToDeleteRows = false; + this.kryptonDataGridView1.AllowUserToResizeRows = false; + this.kryptonDataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; + this.kryptonDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.colDate, + this.ColDayOfWeek, + this.ColCleaned, + this.ColScrap, + this.ColMachineHours, + this.ColStartTime, + this.ColEndTime}); + this.kryptonDataGridView1.DataMember = "TestData"; + this.kryptonDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.kryptonDataGridView1.GridStyles.Style = Krypton.Toolkit.DataGridViewStyle.Mixed; + this.kryptonDataGridView1.Location = new System.Drawing.Point(0, 0); + this.kryptonDataGridView1.MultiSelect = false; + this.kryptonDataGridView1.Name = "kryptonDataGridView1"; + this.kryptonDataGridView1.ReadOnly = true; + this.kryptonDataGridView1.RowHeadersVisible = false; + this.kryptonDataGridView1.RowHeadersWidth = 100; + this.kryptonDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.kryptonDataGridView1.Size = new System.Drawing.Size(1020, 500); + this.kryptonDataGridView1.TabIndex = 3; + // + // kryptonGroupBox4 + // + this.kryptonGroupBox4.CaptionOverlap = 0D; + this.kryptonGroupBox4.Dock = System.Windows.Forms.DockStyle.Top; + this.kryptonGroupBox4.Location = new System.Drawing.Point(0, 0); + this.kryptonGroupBox4.Name = "kryptonGroupBox4"; + // + // kryptonGroupBox4.Panel + // + this.kryptonGroupBox4.Panel.Controls.Add(this.tableLayoutPanel2); + this.kryptonGroupBox4.Panel.Controls.Add(this.tableLayoutPanel1); + this.kryptonGroupBox4.Size = new System.Drawing.Size(1024, 150); + this.kryptonGroupBox4.TabIndex = 0; + this.kryptonGroupBox4.Values.Heading = "查询操作:"; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent; + this.tableLayoutPanel2.ColumnCount = 3; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33444F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33444F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33112F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel2.Controls.Add(this.kbt_Reset, 2, 0); + this.tableLayoutPanel2.Controls.Add(this.kbt_Query, 1, 0); + this.tableLayoutPanel2.Location = new System.Drawing.Point(727, 48); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(292, 41); + this.tableLayoutPanel2.TabIndex = 6; + // + // kbt_Reset + // + this.kbt_Reset.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.kbt_Reset.Location = new System.Drawing.Point(197, 3); + this.kbt_Reset.Name = "kbt_Reset"; + this.kbt_Reset.Size = new System.Drawing.Size(92, 35); + this.kbt_Reset.TabIndex = 0; + this.kbt_Reset.Tag = "show"; + this.kbt_Reset.Values.Text = "重置条件"; + this.kbt_Reset.Click += new System.EventHandler(this.kbt_Reset_Click); + // + // kbt_Query + // + this.kbt_Query.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.kbt_Query.Location = new System.Drawing.Point(100, 3); + this.kbt_Query.Name = "kbt_Query"; + this.kbt_Query.Size = new System.Drawing.Size(91, 35); + this.kbt_Query.TabIndex = 0; + this.kbt_Query.Tag = "show"; + this.kbt_Query.Values.Text = "查询"; + this.kbt_Query.Click += new System.EventHandler(this.kbt_Query_Click); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent; + this.tableLayoutPanel1.ColumnCount = 4; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.Controls.Add(this.kryptonLabel2, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.kdtp_CreateStartTime, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.kryptonLabel5, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.kdtp_CreateEndTime, 3, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 1; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1020, 42); + this.tableLayoutPanel1.TabIndex = 5; + // + // kryptonLabel2 + // + this.kryptonLabel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.kryptonLabel2.Location = new System.Drawing.Point(3, 3); + this.kryptonLabel2.Name = "kryptonLabel2"; + this.kryptonLabel2.Size = new System.Drawing.Size(114, 36); + this.kryptonLabel2.TabIndex = 4; + this.kryptonLabel2.Values.Text = "重置时间"; + // + // kdtp_CreateStartTime + // + this.kdtp_CreateStartTime.Anchor = System.Windows.Forms.AnchorStyles.None; + this.kdtp_CreateStartTime.CustomFormat = "yyyy-MM-dd HH:mm:ss"; + this.kdtp_CreateStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.kdtp_CreateStartTime.Location = new System.Drawing.Point(192, 10); + this.kdtp_CreateStartTime.Name = "kdtp_CreateStartTime"; + this.kdtp_CreateStartTime.ShowCheckBox = true; + this.kdtp_CreateStartTime.Size = new System.Drawing.Size(246, 21); + this.kdtp_CreateStartTime.TabIndex = 7; + // + // kryptonLabel5 + // + this.kryptonLabel5.Anchor = System.Windows.Forms.AnchorStyles.None; + this.kryptonLabel5.Location = new System.Drawing.Point(558, 11); + this.kryptonLabel5.Name = "kryptonLabel5"; + this.kryptonLabel5.Size = new System.Drawing.Size(23, 20); + this.kryptonLabel5.TabIndex = 4; + this.kryptonLabel5.Values.Text = "至"; + // + // kdtp_CreateEndTime + // + this.kdtp_CreateEndTime.Anchor = System.Windows.Forms.AnchorStyles.None; + this.kdtp_CreateEndTime.CustomFormat = "yyyy-MM-dd HH:mm:ss"; + this.kdtp_CreateEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.kdtp_CreateEndTime.Location = new System.Drawing.Point(702, 10); + this.kdtp_CreateEndTime.Name = "kdtp_CreateEndTime"; + this.kdtp_CreateEndTime.ShowCheckBox = true; + this.kdtp_CreateEndTime.Size = new System.Drawing.Size(246, 21); + this.kdtp_CreateEndTime.TabIndex = 7; + // + // colDate + // + this.colDate.DataPropertyName = "Date"; + this.colDate.HeaderText = "Date"; + this.colDate.Name = "colDate"; + this.colDate.ReadOnly = true; + this.colDate.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colDate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.colDate.Width = 41; + // + // ColDayOfWeek + // + this.ColDayOfWeek.DataPropertyName = "DayOfWeek"; + this.ColDayOfWeek.HeaderText = "DayOfWeek"; + this.ColDayOfWeek.Name = "ColDayOfWeek"; + this.ColDayOfWeek.ReadOnly = true; + this.ColDayOfWeek.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.ColDayOfWeek.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.ColDayOfWeek.Width = 79; + // + // ColCleaned + // + this.ColCleaned.AllowDecimals = false; + this.ColCleaned.DataPropertyName = "Cleaned"; + this.ColCleaned.HeaderText = "Cleaned"; + this.ColCleaned.Name = "ColCleaned"; + this.ColCleaned.ReadOnly = true; + this.ColCleaned.Width = 60; + // + // ColScrap + // + this.ColScrap.AllowDecimals = false; + this.ColScrap.DataPropertyName = "Scrap"; + this.ColScrap.HeaderText = "Scrap"; + this.ColScrap.Name = "ColScrap"; + this.ColScrap.ReadOnly = true; + this.ColScrap.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.ColScrap.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.ColScrap.Width = 65; + // + // ColMachineHours + // + this.ColMachineHours.DataPropertyName = "MachineHours"; + this.ColMachineHours.HeaderText = "MachineHours"; + this.ColMachineHours.Name = "ColMachineHours"; + this.ColMachineHours.ReadOnly = true; + this.ColMachineHours.Width = 114; + // + // ColStartTime + // + this.ColStartTime.DataPropertyName = "StartTime"; + this.ColStartTime.HeaderText = "StartTime"; + this.ColStartTime.Name = "ColStartTime"; + this.ColStartTime.ReadOnly = true; + this.ColStartTime.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.ColStartTime.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.ColStartTime.Width = 67; + // + // ColEndTime + // + this.ColEndTime.DataPropertyName = "EndTime"; + this.ColEndTime.HeaderText = "EndTime"; + this.ColEndTime.Name = "ColEndTime"; + this.ColEndTime.ReadOnly = true; + this.ColEndTime.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.ColEndTime.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.ColEndTime.Width = 63; + // + // frmDayReport + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.kryptonPanel2); + this.Name = "frmDayReport"; + this.Size = new System.Drawing.Size(1024, 672); + this.Load += new System.EventHandler(this.frmParamater_Load); + this.Click += new System.EventHandler(this.frmParamater_Load); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit(); + this.kryptonPanel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3.Panel)).EndInit(); + this.kryptonGroupBox3.Panel.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).EndInit(); + this.kryptonGroupBox3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kryptonDataGridView1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4.Panel)).EndInit(); + this.kryptonGroupBox4.Panel.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox4)).EndInit(); + this.kryptonGroupBox4.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private Krypton.Toolkit.KryptonPanel kryptonPanel2; + private Krypton.Toolkit.KryptonGroupBox kryptonGroupBox3; + private Krypton.Toolkit.KryptonDataGridView kryptonDataGridView1; + private Krypton.Toolkit.KryptonGroupBox kryptonGroupBox4; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private Krypton.Toolkit.KryptonButton kbt_Reset; + private Krypton.Toolkit.KryptonButton kbt_Query; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private Krypton.Toolkit.KryptonDateTimePicker kdtp_CreateEndTime; + private Krypton.Toolkit.KryptonDateTimePicker kdtp_CreateStartTime; + private Krypton.Toolkit.KryptonLabel kryptonLabel2; + private Krypton.Toolkit.KryptonLabel kryptonLabel5; + private System.Windows.Forms.DataGridViewTextBoxColumn colDate; + private System.Windows.Forms.DataGridViewTextBoxColumn ColDayOfWeek; + private Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn ColCleaned; + private Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn ColScrap; + private System.Windows.Forms.DataGridViewTextBoxColumn ColMachineHours; + private System.Windows.Forms.DataGridViewTextBoxColumn ColStartTime; + private System.Windows.Forms.DataGridViewTextBoxColumn ColEndTime; + } +} diff --git a/CleanMachineHMI/FrmUserControl/frmDayReport.cs b/CleanMachineHMI/FrmUserControl/frmDayReport.cs new file mode 100644 index 0000000..dc64938 --- /dev/null +++ b/CleanMachineHMI/FrmUserControl/frmDayReport.cs @@ -0,0 +1,106 @@ +using CleanMachineHMI.Domain.Enums; +using CleanMachineHMI.frmChild; +using CleanMachineHMI.Utils; +using Krypton.Toolkit; +using LeadDataBaseUtility; +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; + +namespace CleanMachineHMI.FrmUserControl +{ + [FormType(EnumFormType.DayReport)] + public partial class frmDayReport : UserControl + { + private DataTable _InfoLanguageTextList; + public delegate void dlgRefreshFrmHost(); + public static dlgRefreshFrmHost RefreshFrmHost; + + public frmDayReport() + { + InitializeComponent(); + this.kryptonDataGridView1.AutoGenerateColumns = false; + } + + + public void Init() + { + //var sql = $@"select PARAMETER_ID 序号,PARAMETER_CODE 参数编码,PARAMETER_NAME 参数名称,PARAMETER_VALUE 参数值,CREATE_TIME 创建时间 from SYS_PARAMETER where USED_FLAG=1 and DEL_FLAG=0 "; + + //if (kdtp_CreateStartTime.Checked) + //{ + // sql += $" AND CREATE_TIME >= '{kdtp_CreateStartTime.Value.ToString("yyyy-MM-dd HH:mm:ss")}'"; + //} + //if (kdtp_CreateEndTime.Checked) + //{ + // sql += $" AND CREATE_TIME <= '{kdtp_CreateEndTime.Value.ToString("yyyy-MM-dd HH:mm:ss")}'"; + //} + + //DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0]; + + //kryptonDataGridView1.Columns.Clear(); + //kryptonDataGridView1.DataSource = dt; + //kryptonDataGridView1.SetDataViewColumnText(this.Name); + + + } + private void txt_GotFocus(object sender, EventArgs e) + { + KeyboardAutoPopUp.ShowInputPanel(); + } + private void txt_LostFocus(object sender, EventArgs e) + { + KeyboardAutoPopUp.HideInputPanel(); + } + private void InitControlEvent() + { + + } + + private void frmParamater_Load(object sender, EventArgs e) + { + try + { + var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetReport(""); + this.kryptonDataGridView1.DataSource = list; + + + } + catch (Exception ex) + { + // KryptonMessageBox.Show(this.T("加载系统参数界面发生异常", "LoadSysParamaterExp") + $":【{ex.Message}】!"); + + } + } + + private void kbt_Query_Click(object sender, EventArgs e) + { + try + { + Init(); + } + catch (Exception ex) + { + KryptonMessageBox.Show(this.T("查询系统参数数据发生异常", "QuerySysParamaterData") + $":【{ex.Message}】!"); + } + } + + private void kbt_Reset_Click(object sender, EventArgs e) + { + + + kdtp_CreateStartTime.Checked = false; + kdtp_CreateEndTime.Checked = false; + } + + + + + } +} diff --git a/CleanMachineHMI/FrmUserControl/frmDayReport.resx b/CleanMachineHMI/FrmUserControl/frmDayReport.resx new file mode 100644 index 0000000..17cc83a --- /dev/null +++ b/CleanMachineHMI/FrmUserControl/frmDayReport.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + \ No newline at end of file diff --git a/CleanMachineHMI/FrmUserControl/frmMainDetailNew.Designer.cs b/CleanMachineHMI/FrmUserControl/frmMainDetailNew.Designer.cs index ec39a75..fb910e1 100644 --- a/CleanMachineHMI/FrmUserControl/frmMainDetailNew.Designer.cs +++ b/CleanMachineHMI/FrmUserControl/frmMainDetailNew.Designer.cs @@ -2331,11 +2331,11 @@ namespace CleanMachineHMI.FrmUserControl // this.btnShiftCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnShiftCount.AutoSize = true; - this.btnShiftCount.Location = new System.Drawing.Point(818, 6); + this.btnShiftCount.Location = new System.Drawing.Point(775, 6); this.btnShiftCount.Name = "btnShiftCount"; this.btnShiftCount.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnShiftCount.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; - this.btnShiftCount.Size = new System.Drawing.Size(102, 47); + this.btnShiftCount.Size = new System.Drawing.Size(80, 47); this.btnShiftCount.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnShiftCount.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnShiftCount.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2526,7 +2526,7 @@ namespace CleanMachineHMI.FrmUserControl // this.btnPrinter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnPrinter.AutoSize = true; - this.btnPrinter.Location = new System.Drawing.Point(710, 6); + this.btnPrinter.Location = new System.Drawing.Point(671, 6); this.btnPrinter.Name = "btnPrinter"; this.btnPrinter.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnPrinter.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; @@ -2569,7 +2569,7 @@ namespace CleanMachineHMI.FrmUserControl this.btnIR.Name = "btnIR"; this.btnIR.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnIR.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; - this.btnIR.Size = new System.Drawing.Size(105, 47); + this.btnIR.Size = new System.Drawing.Size(61, 47); this.btnIR.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnIR.StateNormal.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnIR.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; diff --git a/CleanMachineHMI/FrmUserControl/frmMainDetailNew.cs b/CleanMachineHMI/FrmUserControl/frmMainDetailNew.cs index bf4d20e..7f0a671 100644 --- a/CleanMachineHMI/FrmUserControl/frmMainDetailNew.cs +++ b/CleanMachineHMI/FrmUserControl/frmMainDetailNew.cs @@ -1591,7 +1591,7 @@ namespace CleanMachineHMI.FrmUserControl && !Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("ManualOrAuto", PlcItemTypeDesc.M))) { - var modelResult = KryptonMessageBox.Show("是否在下次满料时停止?\n Yes:下次满料自动停止 \n No:直接停止 \n Cancel:不停止继续运行", "是否在下次满料时停止", MessageBoxButtons.YesNoCancel); + var modelResult = KryptonMessageBox.Show("是否在下次满料时停止? Yes:下次满料自动停止 No:直接停止 Cancel:不停止继续运行", "是否在下次满料时停止", MessageBoxButtons.YesNoCancel); if (modelResult == DialogResult.Yes) @@ -2846,7 +2846,8 @@ namespace CleanMachineHMI.FrmUserControl private void btnShiftCount_Click(object sender, EventArgs e) { - frmMainNew.SwitchFrmMenu(EnumFormType.ShiftCountRecord, false); + //frmMainNew.SwitchFrmMenu(EnumFormType.ShiftCountRecord, false); + frmMainNew.SwitchFrmMenu(EnumFormType.DayReport, false); } private void cbt_StopTran_Click(object sender, EventArgs e) diff --git a/CleanMachineHMI/Utils/PlcOperationHelper.cs b/CleanMachineHMI/Utils/PlcOperationHelper.cs index 4155029..11160ad 100644 --- a/CleanMachineHMI/Utils/PlcOperationHelper.cs +++ b/CleanMachineHMI/Utils/PlcOperationHelper.cs @@ -182,7 +182,8 @@ namespace CleanMachineHMI stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - LogHelper.WriteLog($"读取PLC时间:{ts.Milliseconds}", LogTypeEum.Run); + Console.WriteLine($"读取PLC时间:{ts.Milliseconds}", LogTypeEum.Run); + if (haschange) { if (_synchronization != null) @@ -446,7 +447,10 @@ namespace CleanMachineHMI { if (item.PlcItemValue != value) { - haschange = true; + if (item.PlcItemCode != "PlcHeartbeatWriteData") + { + haschange = true; + } item.PlcItemValue = value; }