diff --git a/CleanMachineHMI/FrmUserControl/frmDayReport.cs b/CleanMachineHMI/FrmUserControl/frmDayReport.cs index e2686a8..c92a3d5 100644 --- a/CleanMachineHMI/FrmUserControl/frmDayReport.cs +++ b/CleanMachineHMI/FrmUserControl/frmDayReport.cs @@ -27,8 +27,8 @@ namespace CleanMachineHMI.FrmUserControl InitializeComponent(); this.SetFormControlText(); this.kryptonDataGridView1.AutoGenerateColumns = false; - this.kdtp_CreateEndTime.Value = DateTime.Today; - this.kdtp_CreateStartTime.Value = DateTime.Today; + this.kdtp_CreateEndTime.Value = DateTime.Today.EndOfTheWeek(); + this.kdtp_CreateStartTime.Value = DateTime.Today.StartOfTheWeek(); } diff --git a/CleanMachineHMI/FrmUserControl/frmOperatorReport.Designer.cs b/CleanMachineHMI/FrmUserControl/frmOperatorReport.Designer.cs index ddab197..6075456 100644 --- a/CleanMachineHMI/FrmUserControl/frmOperatorReport.Designer.cs +++ b/CleanMachineHMI/FrmUserControl/frmOperatorReport.Designer.cs @@ -224,6 +224,7 @@ namespace CleanMachineHMI.FrmUserControl 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; + this.tableLayoutPanel2.Paint += new System.Windows.Forms.PaintEventHandler(this.tableLayoutPanel2_Paint); // // kryptonButton1 // diff --git a/CleanMachineHMI/FrmUserControl/frmOperatorReport.cs b/CleanMachineHMI/FrmUserControl/frmOperatorReport.cs index 3adc789..44cc3c7 100644 --- a/CleanMachineHMI/FrmUserControl/frmOperatorReport.cs +++ b/CleanMachineHMI/FrmUserControl/frmOperatorReport.cs @@ -27,8 +27,9 @@ namespace CleanMachineHMI.FrmUserControl InitializeComponent(); this.SetFormControlText(); this.kryptonDataGridView1.AutoGenerateColumns = false; - this.kdtp_CreateEndTime.Value = DateTime.Today; - this.kdtp_CreateStartTime.Value = DateTime.Today; + + this.kdtp_CreateEndTime.Value =DateTime.Today.EndOfTheWeek() ; + this.kdtp_CreateStartTime.Value = DateTime.Today.StartOfTheWeek(); } @@ -116,7 +117,7 @@ namespace CleanMachineHMI.FrmUserControl FastReport.Report report = new FastReport.Report(); report.Load("ReportMd\\operatorReport.frx"); report.RegisterData(list, "datas"); - //report.Design(); + // report.Design(); report.PrintSettings.ShowDialog = false; report.Prepare(); report.Print(); @@ -127,6 +128,11 @@ namespace CleanMachineHMI.FrmUserControl } + } + + private void tableLayoutPanel2_Paint(object sender, PaintEventArgs e) + { + } } } diff --git a/CleanMachineHMI/ReportMd/CleanMac_IRMsg_PrintMd.frx b/CleanMachineHMI/ReportMd/CleanMac_IRMsg_PrintMd.frx index 7eadfc9..193b34b 100644 --- a/CleanMachineHMI/ReportMd/CleanMac_IRMsg_PrintMd.frx +++ b/CleanMachineHMI/ReportMd/CleanMac_IRMsg_PrintMd.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -246,33 +246,33 @@ namespace FastReport - + - - + + - - - - - + + + + + - - + + - + - - - - + + + + - + @@ -354,11 +354,11 @@ namespace FastReport - - - - - + + + + + diff --git a/CleanMachineHMI/ReportMd/dayReport.frx b/CleanMachineHMI/ReportMd/dayReport.frx index e84e008..bdebddc 100644 --- a/CleanMachineHMI/ReportMd/dayReport.frx +++ b/CleanMachineHMI/ReportMd/dayReport.frx @@ -1,9 +1,8 @@  - + - + - @@ -12,40 +11,36 @@ - + - + - - - - + + + - + - - - - + + + - + - - diff --git a/CleanMachineHMI/ReportMd/operatorReport.frx b/CleanMachineHMI/ReportMd/operatorReport.frx index 21d363a..2f027a4 100644 --- a/CleanMachineHMI/ReportMd/operatorReport.frx +++ b/CleanMachineHMI/ReportMd/operatorReport.frx @@ -1,7 +1,7 @@  - + - + @@ -12,40 +12,38 @@ - + - - - - - - - - - + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - - + + - - diff --git a/CleanMachineHMI/Utils/DateEx.cs b/CleanMachineHMI/Utils/DateEx.cs new file mode 100644 index 0000000..6e480f6 --- /dev/null +++ b/CleanMachineHMI/Utils/DateEx.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace System +{ + public static class DateEx + { + public static DateTime StartOfTheWeek(this DateTime date) + { + + return date.Date.AddDays(-(int)date.DayOfWeek); + + + + } + + + public static DateTime EndOfTheWeek(this DateTime date) + { + + return date.Date.AddDays(7 - (int)date.DayOfWeek); + } + + + } +} + diff --git a/CleanMachineHMI/Utils/PlcOperationHelper.cs b/CleanMachineHMI/Utils/PlcOperationHelper.cs index 9778ac7..5511cd2 100644 --- a/CleanMachineHMI/Utils/PlcOperationHelper.cs +++ b/CleanMachineHMI/Utils/PlcOperationHelper.cs @@ -2,13 +2,13 @@ #if DEBUG -//#define USE_LOCAL_TCP_DEBUG +#define USE_LOCAL_TCP_DEBUG #endif //启用心跳检查 -//#if RELEASE +#if !USE_LOCAL_TCP_DEBUG #define UseHeartbeat -//#endif +#endif using CleanMachine.Model; using CleanMachine.Model.BAS; using CleanMachine.Model.CM; @@ -1195,7 +1195,7 @@ namespace CleanMachineHMI try { #endif - // if (!this.IsConn) return false; + // if (!this.IsConn) return false; switch (itemType) { case PlcItemTypeDesc.M: