添加日报

This commit is contained in:
gongxh
2022-05-16 13:54:26 +08:00
parent 9dfb90f683
commit e120927df2
11 changed files with 683 additions and 9 deletions

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CleanMachine.BLL.ZBK
{
public class DayReportBLL
{
public IEnumerable<Model.ZBK.DayReport> GetReport(string strWhere, object Params = null)
{
return new CleanMachine.DAL.ZBK.DayReportDAL().GetReport(strWhere, Params);
}
}
}

View File

@@ -0,0 +1,40 @@
using LeadDataBaseUtility;
using System;
using System.Collections.Generic;
using System.Text;
namespace CleanMachine.DAL.ZBK
{
public class DayReportDAL
{
public IEnumerable<Model.ZBK.DayReport> 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<Model.ZBK.DayReport>(strSql, Params);
}
}
}

View File

@@ -34,6 +34,7 @@ namespace CleanMachineHMI.Domain.Enums
DataSearch, DataSearch,
WarningLog, WarningLog,
Maintenance, Maintenance,
ShiftCountRecord ShiftCountRecord,
DayReport
} }
} }

View File

@@ -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; }
}
}

View File

@@ -60,6 +60,7 @@
<Compile Update="FrmUserControl\frmMainDetailNew.cs"> <Compile Update="FrmUserControl\frmMainDetailNew.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Update="FrmUserControl\frmDayReport.cs" />
<Compile Update="FrmUserControl\frmShiftCountRecord.cs"> <Compile Update="FrmUserControl\frmShiftCountRecord.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>

View File

@@ -0,0 +1,356 @@
namespace CleanMachineHMI.FrmUserControl
{
partial class frmDayReport
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
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;
}
}

View File

@@ -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;
}
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ColMachineHours.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnShiftCount.AutoSize = true; 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.Name = "btnShiftCount";
this.btnShiftCount.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnShiftCount.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke;
this.btnShiftCount.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; 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.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.Color1 = System.Drawing.Color.WhiteSmoke;
this.btnShiftCount.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; 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.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnPrinter.AutoSize = true; 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.Name = "btnPrinter";
this.btnPrinter.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnPrinter.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke;
this.btnPrinter.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnPrinter.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue;
@@ -2569,7 +2569,7 @@ namespace CleanMachineHMI.FrmUserControl
this.btnIR.Name = "btnIR"; this.btnIR.Name = "btnIR";
this.btnIR.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke; this.btnIR.OverrideDefault.Back.Color1 = System.Drawing.Color.WhiteSmoke;
this.btnIR.OverrideDefault.Back.Color2 = System.Drawing.Color.LightSteelBlue; 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.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.Color1 = System.Drawing.Color.WhiteSmoke;
this.btnIR.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue; this.btnIR.StateNormal.Back.Color2 = System.Drawing.Color.LightSteelBlue;

View File

@@ -1591,7 +1591,7 @@ namespace CleanMachineHMI.FrmUserControl
&& !Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("ManualOrAuto", PlcItemTypeDesc.M))) && !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) if (modelResult == DialogResult.Yes)
@@ -2846,7 +2846,8 @@ namespace CleanMachineHMI.FrmUserControl
private void btnShiftCount_Click(object sender, EventArgs e) 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) private void cbt_StopTran_Click(object sender, EventArgs e)

View File

@@ -182,7 +182,8 @@ namespace CleanMachineHMI
stopWatch.Stop(); stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed; TimeSpan ts = stopWatch.Elapsed;
LogHelper.WriteLog($"读取PLC时间:{ts.Milliseconds}", LogTypeEum.Run); Console.WriteLine($"读取PLC时间:{ts.Milliseconds}", LogTypeEum.Run);
if (haschange) if (haschange)
{ {
if (_synchronization != null) if (_synchronization != null)
@@ -446,7 +447,10 @@ namespace CleanMachineHMI
{ {
if (item.PlcItemValue != value) if (item.PlcItemValue != value)
{ {
haschange = true; if (item.PlcItemCode != "PlcHeartbeatWriteData")
{
haschange = true;
}
item.PlcItemValue = value; item.PlcItemValue = value;
} }