26 Commits

Author SHA1 Message Date
gongxh
de8fd63d02 添加使用EXCEL的功能 2022-06-10 09:42:29 +08:00
gongxh
163b60d144 添加语言包 2022-06-10 08:57:53 +08:00
gongxh
0475822618 1 2022-06-09 10:46:45 +08:00
gongxh
69b8f96e73 Merge branch 'dev_plus' of http://10.20.88.94/nx.wms/CleanMachine into dev_plus 2022-06-02 16:53:13 +08:00
gongxh
7a49390c02 修复bug 2022-06-02 16:50:34 +08:00
kang
496bb60a79 es-MX 2022-06-02 15:56:40 +08:00
gongxh
5bcc89c0b5 1 2022-06-01 15:40:01 +08:00
gongxh
60222dbf9b 1 2022-06-01 14:40:27 +08:00
gongxh
bd39e5110f 1 2022-06-01 14:35:28 +08:00
gongxh
a7afd29d82 1 2022-06-01 14:33:10 +08:00
gongxh
ae42a43f15 1 2022-05-31 16:26:38 +08:00
gongxh
507bde6bed 1 2022-05-30 10:39:14 +08:00
gongxh
2a334e7d75 11 2022-05-30 09:27:46 +08:00
gongxh
847dffd9f1 修改语言 2022-05-28 14:29:19 +08:00
gongxh
3be258e671 修改 2022-05-27 15:47:18 +08:00
dev
5194300402 Merge branch 'dev_plus' of http://10.0.0.94:10080/nx.wms/CleanMachine into dev_plus 2022-05-24 09:58:15 +08:00
dev
ab6f8874c5 自动添加新控件的翻译 2022-05-24 09:58:10 +08:00
gongxh
c4027d7220 修复错误 2022-05-23 12:48:51 +08:00
gongxh
8a875860e9 修改主界面 2022-05-21 13:48:03 +08:00
dev
80b9aab619 1 2022-05-21 10:37:08 +08:00
gongxh
2a03e1dba9 修改 2022-05-19 15:56:08 +08:00
gongxh
f5190d70ce 11 2022-05-19 13:16:37 +08:00
gongxh
972124f446 1 2022-05-19 13:03:37 +08:00
gongxh
53d459641e 修改 2022-05-19 13:02:36 +08:00
gongxh
4c33e874b0 1 2022-05-19 12:57:52 +08:00
gongxh
7240b17c1e 修改 2022-05-18 10:15:49 +08:00
44 changed files with 12067 additions and 3558 deletions

View File

@@ -11,13 +11,20 @@ namespace CleanMachine.BLL.ZBK
{ {
return new CleanMachine.DAL.ZBK.DayReportDAL().GetReport(strWhere, Params); return new CleanMachine.DAL.ZBK.DayReportDAL().GetReport(strWhere, Params);
} }
public IEnumerable<Model.ZBK.DayReport> GetReport(DateTime BeginDate, DateTime EndDate)
{
return new CleanMachine.DAL.ZBK.DayReportDAL().GetReport("date >=@BeginDate and Date<=@EndDate ", new { BeginDate, EndDate });
}
public IEnumerable<Model.ZBK.OperatorReport> GetOPReport(string strWhere, object Params = null) public IEnumerable<Model.ZBK.OperatorReport> GetOPReport(string strWhere, object Params = null)
{ {
return new CleanMachine.DAL.ZBK.DayReportDAL().GetOPReport(strWhere, Params); return new CleanMachine.DAL.ZBK.DayReportDAL().GetOPReport(strWhere, Params);
} }
public IEnumerable<Model.ZBK.OperatorReport> GetOPReport(DateTime BeginDate, DateTime EndDate)
{
return new CleanMachine.DAL.ZBK.DayReportDAL().GetOPReport("date >=@BeginDate and Date<=@EndDate ", new { BeginDate, EndDate });
}
} }
} }

View File

@@ -8,7 +8,7 @@
<!--<add key="GlobalPaletteMode" value="Professionaloffice2003"/>--> <!--<add key="GlobalPaletteMode" value="Professionaloffice2003"/>-->
<add key="LanguageCode" value="zh-CN"/> <add key="LanguageCode" value="es-MX"/>
<!--SQLite数据库连接字符串--> <!--SQLite数据库连接字符串-->
<!--<add key="LeadSQLite" value="Data Source=|DataDirectory|\\clearMac.db;Pooling=true;FailIfMissing=false"/>--> <!--<add key="LeadSQLite" value="Data Source=|DataDirectory|\\clearMac.db;Pooling=true;FailIfMissing=false"/>-->
<add key="LeadSQLite" value="Data Source=DataBase/clearMac.db"/> <add key="LeadSQLite" value="Data Source=DataBase/clearMac.db"/>

View File

@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<StartupObject></StartupObject>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -25,6 +27,10 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NModbus" Version="3.0.72" /> <PackageReference Include="NModbus" Version="3.0.72" />
<PackageReference Include="NModbus.Serial" Version="3.0.72" /> <PackageReference Include="NModbus.Serial" Version="3.0.72" />
<PackageReference Include="NPOI" Version="2.5.6" />
<PackageReference Include="Osklib.WinForms" Version="1.6.0" />
<PackageReference Include="Scriban" Version="5.4.6" />
<PackageReference Include="Snail.Utils.Office" Version="1.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -54,7 +60,7 @@
<Compile Update="FrmUserControl\frmIOMonitorAuto.cs"> <Compile Update="FrmUserControl\frmIOMonitorAuto.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Update="FrmUserControl\frmMainDetailNew.cs"> <Compile Update="FrmUserControl\frmMainDetail.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Update="FrmUserControl\frmDayReport.cs" /> <Compile Update="FrmUserControl\frmDayReport.cs" />
@@ -75,9 +81,21 @@
<None Update="Lang\en-US.json"> <None Update="Lang\en-US.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="Lang\en-US.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Lang\es-MX.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Lang\es-MX.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Lang\zh-CN.json"> <None Update="Lang\zh-CN.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="Lang\zh-CN.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Properties\Settings.settings"> <None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -88,6 +106,9 @@
<None Update="ReportMd\CleanMac_IRMsg_PrintMd.frx"> <None Update="ReportMd\CleanMac_IRMsg_PrintMd.frx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="ReportMd\dayReport.frx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="ReportMd\operatorReport.frx"> <None Update="ReportMd\operatorReport.frx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>

Binary file not shown.

View File

@@ -32,6 +32,14 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel(); this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel();
this.kryptonGroupBox3 = new Krypton.Toolkit.KryptonGroupBox(); this.kryptonGroupBox3 = new Krypton.Toolkit.KryptonGroupBox();
this.kryptonDataGridView1 = new Krypton.Toolkit.KryptonDataGridView(); this.kryptonDataGridView1 = new Krypton.Toolkit.KryptonDataGridView();
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();
this.colOperators = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox(); this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.kbt_Reset = new Krypton.Toolkit.KryptonButton(); this.kbt_Reset = new Krypton.Toolkit.KryptonButton();
@@ -41,14 +49,7 @@ namespace CleanMachineHMI.FrmUserControl
this.kdtp_CreateStartTime = new Krypton.Toolkit.KryptonDateTimePicker(); this.kdtp_CreateStartTime = new Krypton.Toolkit.KryptonDateTimePicker();
this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel(); this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel();
this.kdtp_CreateEndTime = new Krypton.Toolkit.KryptonDateTimePicker(); this.kdtp_CreateEndTime = new Krypton.Toolkit.KryptonDateTimePicker();
this.colDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.kryptonButton1 = new Krypton.Toolkit.KryptonButton();
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();
this.colOperators = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
this.kryptonPanel2.SuspendLayout(); this.kryptonPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit();
@@ -118,6 +119,82 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonDataGridView1.Size = new System.Drawing.Size(1020, 500); this.kryptonDataGridView1.Size = new System.Drawing.Size(1020, 500);
this.kryptonDataGridView1.TabIndex = 3; this.kryptonDataGridView1.TabIndex = 3;
// //
// 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 = "MachineRunHours";
this.ColMachineHours.Name = "ColMachineHours";
this.ColMachineHours.ReadOnly = true;
this.ColMachineHours.Width = 135;
//
// 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;
//
// colOperators
//
this.colOperators.DataPropertyName = "Operators";
this.colOperators.HeaderText = "Operators";
this.colOperators.Name = "colOperators";
this.colOperators.ReadOnly = true;
this.colOperators.Width = 88;
//
// kryptonGroupBox4 // kryptonGroupBox4
// //
this.kryptonGroupBox4.CaptionOverlap = 0D; this.kryptonGroupBox4.CaptionOverlap = 0D;
@@ -142,6 +219,7 @@ namespace CleanMachineHMI.FrmUserControl
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.Percent, 33.33112F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.Controls.Add(this.kryptonButton1, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.kbt_Reset, 2, 0); this.tableLayoutPanel2.Controls.Add(this.kbt_Reset, 2, 0);
this.tableLayoutPanel2.Controls.Add(this.kbt_Query, 1, 0); this.tableLayoutPanel2.Controls.Add(this.kbt_Query, 1, 0);
this.tableLayoutPanel2.Location = new System.Drawing.Point(727, 48); this.tableLayoutPanel2.Location = new System.Drawing.Point(727, 48);
@@ -210,7 +288,7 @@ namespace CleanMachineHMI.FrmUserControl
// kdtp_CreateStartTime // kdtp_CreateStartTime
// //
this.kdtp_CreateStartTime.Anchor = System.Windows.Forms.AnchorStyles.None; this.kdtp_CreateStartTime.Anchor = System.Windows.Forms.AnchorStyles.None;
this.kdtp_CreateStartTime.CustomFormat = "yyyy-MM-dd HH:mm:ss"; this.kdtp_CreateStartTime.CustomFormat = "yyyy-MM-dd";
this.kdtp_CreateStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.kdtp_CreateStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.kdtp_CreateStartTime.Location = new System.Drawing.Point(192, 10); this.kdtp_CreateStartTime.Location = new System.Drawing.Point(192, 10);
this.kdtp_CreateStartTime.Name = "kdtp_CreateStartTime"; this.kdtp_CreateStartTime.Name = "kdtp_CreateStartTime";
@@ -230,7 +308,7 @@ namespace CleanMachineHMI.FrmUserControl
// kdtp_CreateEndTime // kdtp_CreateEndTime
// //
this.kdtp_CreateEndTime.Anchor = System.Windows.Forms.AnchorStyles.None; this.kdtp_CreateEndTime.Anchor = System.Windows.Forms.AnchorStyles.None;
this.kdtp_CreateEndTime.CustomFormat = "yyyy-MM-dd HH:mm:ss"; this.kdtp_CreateEndTime.CustomFormat = "yyyy-MM-dd";
this.kdtp_CreateEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.kdtp_CreateEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.kdtp_CreateEndTime.Location = new System.Drawing.Point(702, 10); this.kdtp_CreateEndTime.Location = new System.Drawing.Point(702, 10);
this.kdtp_CreateEndTime.Name = "kdtp_CreateEndTime"; this.kdtp_CreateEndTime.Name = "kdtp_CreateEndTime";
@@ -238,81 +316,18 @@ namespace CleanMachineHMI.FrmUserControl
this.kdtp_CreateEndTime.Size = new System.Drawing.Size(246, 21); this.kdtp_CreateEndTime.Size = new System.Drawing.Size(246, 21);
this.kdtp_CreateEndTime.TabIndex = 7; this.kdtp_CreateEndTime.TabIndex = 7;
// //
// colDate // kryptonButton1
// //
this.colDate.DataPropertyName = "Date"; this.kryptonButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.colDate.HeaderText = "Date"; | System.Windows.Forms.AnchorStyles.Left)
this.colDate.Name = "colDate"; | System.Windows.Forms.AnchorStyles.Right)));
this.colDate.ReadOnly = true; this.kryptonButton1.Location = new System.Drawing.Point(3, 3);
this.colDate.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.kryptonButton1.Name = "kryptonButton1";
this.colDate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; this.kryptonButton1.Size = new System.Drawing.Size(91, 35);
this.colDate.Width = 41; this.kryptonButton1.TabIndex = 2;
// this.kryptonButton1.Tag = "show";
// ColDayOfWeek this.kryptonButton1.Values.Text = "打印";
// this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
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;
//
// colOperators
//
this.colOperators.DataPropertyName = "Operators";
this.colOperators.HeaderText = "Operators";
this.colOperators.Name = "colOperators";
this.colOperators.ReadOnly = true;
this.colOperators.Width = 88;
// //
// frmDayReport // frmDayReport
// //
@@ -363,5 +378,6 @@ namespace CleanMachineHMI.FrmUserControl
private System.Windows.Forms.DataGridViewTextBoxColumn ColStartTime; private System.Windows.Forms.DataGridViewTextBoxColumn ColStartTime;
private System.Windows.Forms.DataGridViewTextBoxColumn ColEndTime; private System.Windows.Forms.DataGridViewTextBoxColumn ColEndTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colOperators; private System.Windows.Forms.DataGridViewTextBoxColumn colOperators;
private Krypton.Toolkit.KryptonButton kryptonButton1;
} }
} }

View File

@@ -25,12 +25,21 @@ namespace CleanMachineHMI.FrmUserControl
public frmDayReport() public frmDayReport()
{ {
InitializeComponent(); InitializeComponent();
this.SetFormControlText();
this.kryptonDataGridView1.AutoGenerateColumns = false; this.kryptonDataGridView1.AutoGenerateColumns = false;
this.kdtp_CreateEndTime.Value = DateTime.Today.EndOfTheWeek();
this.kdtp_CreateStartTime.Value = DateTime.Today.StartOfTheWeek();
} }
public void Init() public void Init()
{ {
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetReport(this.kdtp_CreateEndTime.Value, this.kdtp_CreateStartTime.Value);
this.kryptonDataGridView1.DataSource = list;
//var sql = $@"select PARAMETER_ID 序号,PARAMETER_CODE 参数编码,PARAMETER_NAME 参数名称,PARAMETER_VALUE 参数值,CREATE_TIME 创建时间 from SYS_PARAMETER where USED_FLAG=1 and DEL_FLAG=0 "; //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) //if (kdtp_CreateStartTime.Checked)
@@ -67,8 +76,7 @@ namespace CleanMachineHMI.FrmUserControl
{ {
try try
{ {
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetReport(""); this.Init();
this.kryptonDataGridView1.DataSource = list;
} }
@@ -99,8 +107,25 @@ namespace CleanMachineHMI.FrmUserControl
kdtp_CreateEndTime.Checked = false; kdtp_CreateEndTime.Checked = false;
} }
private void kryptonButton1_Click(object sender, EventArgs e)
{
var print = new frmPring();
try
{
print.Show();
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetReport(this.kdtp_CreateEndTime.Value, this.kdtp_CreateStartTime.Value);
FastReport.Report report = new FastReport.Report();
report.Load("ReportMd\\dayReport.frx");
report.RegisterData(list, "datas");
//report.Design();
report.PrintSettings.ShowDialog = false;
report.Prepare();
report.Print();
}
finally
{
print.Close();
}
}
} }
} }

View File

@@ -131,7 +131,7 @@ namespace CleanMachineHMI.FrmUserControl
{ {
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0) if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
{ {
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst) foreach (PlcItem item in tempLst)
{ {
@@ -147,7 +147,7 @@ namespace CleanMachineHMI.FrmUserControl
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0) if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
{ {
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst) foreach (PlcItem item in tempLst)
{ {
@@ -162,9 +162,9 @@ namespace CleanMachineHMI.FrmUserControl
} }
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_X_List); Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_X_List.Values);
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_Y_List); Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_Y_List.Values);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -32,6 +32,8 @@ namespace CleanMachineHMI.FrmUserControl
private void frmIOMonitorNew_Load(object sender, EventArgs e) private void frmIOMonitorNew_Load(object sender, EventArgs e)
{ {
initControl(); initControl();
// this.SetFormControlText();
PlcOperationHelper.Instance.readIO = true; PlcOperationHelper.Instance.readIO = true;
PlcOperationHelper.Instance.OnShowX_Y_Status += Show_X_Y_Status; PlcOperationHelper.Instance.OnShowX_Y_Status += Show_X_Y_Status;
} }
@@ -127,11 +129,11 @@ namespace CleanMachineHMI.FrmUserControl
{ {
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0) if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
{ {
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst) foreach (PlcItem item in tempLst)
{ {
var IO = new IOBlock(); var IO = new IOBlock();
IO.Code = "X" + (int.Parse( item.PlcItemPriAddress)+1).ToString().PadLeft(2, '0'); IO.Code = "X" + Convert.ToString((int.Parse(item.PlcItemPriAddress)), 8).PadLeft(2, '0');
IO.IOName = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode); IO.IOName = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode);
this.flowLayoutPanel1.Controls.Add(IO); this.flowLayoutPanel1.Controls.Add(IO);
buttons.Add(item, IO); buttons.Add(item, IO);
@@ -147,11 +149,11 @@ namespace CleanMachineHMI.FrmUserControl
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0) if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
{ {
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst) foreach (PlcItem item in tempLst)
{ {
var IO = new IOBlock(); var IO = new IOBlock();
IO.Code = "Y" + (int.Parse(item.PlcItemPriAddress) + 1).ToString().PadLeft(2,'0'); IO.Code = "Y" + Convert.ToString((int.Parse(item.PlcItemPriAddress) ), 8).PadLeft(2, '0');
IO.IOName = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode); IO.IOName = this.T(item.PlcItemName.Replace("(I/O监控)", ""), item.PlcItemCode);
this.flowLayoutPanel1.Controls.Add(IO); this.flowLayoutPanel1.Controls.Add(IO);
@@ -168,9 +170,9 @@ namespace CleanMachineHMI.FrmUserControl
} }
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_X_List); Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_X_List.Values);
Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_Y_List); Show_X_Y_Status(PlcOperationHelper.Instance.PlcItemMd_Y_List.Values);
} }
catch (Exception ex) catch (Exception ex)
{ {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -117,4 +117,10 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="kryptonContextMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>202, 17</value>
</metadata>
</root> </root>

View File

@@ -117,10 +117,4 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="kryptonContextMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>202, 17</value>
</metadata>
</root> </root>

View File

@@ -71,6 +71,8 @@ namespace CleanMachineHMI.FrmUserControl
private void btn_logout_Click(object sender, EventArgs e) private void btn_logout_Click(object sender, EventArgs e)
{ {
Global.LoginForm.Show(); Global.LoginForm.Show();
Global.UserInfo = null;
Global.SysThIsRunFlag = false;
Global.MainFormNew.Hide(); Global.MainFormNew.Hide();
} }
} }

View File

@@ -211,8 +211,8 @@ namespace CleanMachineHMI.FrmUserControl
private void kbtn_Pass_Yes_Click(object sender, EventArgs e) private void kbtn_Pass_Yes_Click(object sender, EventArgs e)
{ {
try //try
{ //{
//自检结束后发送停止检测信号 //自检结束后发送停止检测信号
PlcOperationHelper.Instance.WritePlcItem("SelfCheckFlag", "False", PlcItemTypeDesc.M); PlcOperationHelper.Instance.WritePlcItem("SelfCheckFlag", "False", PlcItemTypeDesc.M);
//自检通过后,发送检测通过信号 //自检通过后,发送检测通过信号
@@ -225,11 +225,11 @@ namespace CleanMachineHMI.FrmUserControl
//frmMainNew.SwitchFrmMenu(EnumFormType.IoMonitor, false); //frmMainNew.SwitchFrmMenu(EnumFormType.IoMonitor, false);
Global.CanOperate = true; Global.CanOperate = true;
} //}
catch (Exception ex) //catch (Exception ex)
{ //{
KryptonMessageBox.Show(ex.Message); // KryptonMessageBox.Show(ex.Message);
} //}
} }
private void kbtn_Pass_No_Click(object sender, EventArgs e) private void kbtn_Pass_No_Click(object sender, EventArgs e)

View File

@@ -42,6 +42,7 @@ namespace CleanMachineHMI.FrmUserControl
this.colOperators = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colOperators = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox(); this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.kryptonButton1 = new Krypton.Toolkit.KryptonButton();
this.kbt_Reset = new Krypton.Toolkit.KryptonButton(); this.kbt_Reset = new Krypton.Toolkit.KryptonButton();
this.kbt_Query = new Krypton.Toolkit.KryptonButton(); this.kbt_Query = new Krypton.Toolkit.KryptonButton();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
@@ -49,7 +50,6 @@ namespace CleanMachineHMI.FrmUserControl
this.kdtp_CreateStartTime = new Krypton.Toolkit.KryptonDateTimePicker(); this.kdtp_CreateStartTime = new Krypton.Toolkit.KryptonDateTimePicker();
this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel(); this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel();
this.kdtp_CreateEndTime = new Krypton.Toolkit.KryptonDateTimePicker(); this.kdtp_CreateEndTime = new Krypton.Toolkit.KryptonDateTimePicker();
this.kryptonButton1 = new Krypton.Toolkit.KryptonButton();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
this.kryptonPanel2.SuspendLayout(); this.kryptonPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit();
@@ -158,10 +158,10 @@ namespace CleanMachineHMI.FrmUserControl
// ColMachineHours // ColMachineHours
// //
this.ColMachineHours.DataPropertyName = "MachineHours"; this.ColMachineHours.DataPropertyName = "MachineHours";
this.ColMachineHours.HeaderText = "MachineHours"; this.ColMachineHours.HeaderText = "MachineRunHours";
this.ColMachineHours.Name = "ColMachineHours"; this.ColMachineHours.Name = "ColMachineHours";
this.ColMachineHours.ReadOnly = true; this.ColMachineHours.ReadOnly = true;
this.ColMachineHours.Width = 114; this.ColMachineHours.Width = 135;
// //
// ColCleaned // ColCleaned
// //
@@ -224,6 +224,20 @@ namespace CleanMachineHMI.FrmUserControl
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 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.Size = new System.Drawing.Size(292, 41);
this.tableLayoutPanel2.TabIndex = 6; this.tableLayoutPanel2.TabIndex = 6;
this.tableLayoutPanel2.Paint += new System.Windows.Forms.PaintEventHandler(this.tableLayoutPanel2_Paint);
//
// kryptonButton1
//
this.kryptonButton1.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.kryptonButton1.Location = new System.Drawing.Point(3, 3);
this.kryptonButton1.Name = "kryptonButton1";
this.kryptonButton1.Size = new System.Drawing.Size(91, 35);
this.kryptonButton1.TabIndex = 1;
this.kryptonButton1.Tag = "show";
this.kryptonButton1.Values.Text = "打印";
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
// //
// kbt_Reset // kbt_Reset
// //
@@ -284,7 +298,7 @@ namespace CleanMachineHMI.FrmUserControl
// kdtp_CreateStartTime // kdtp_CreateStartTime
// //
this.kdtp_CreateStartTime.Anchor = System.Windows.Forms.AnchorStyles.None; this.kdtp_CreateStartTime.Anchor = System.Windows.Forms.AnchorStyles.None;
this.kdtp_CreateStartTime.CustomFormat = "yyyy-MM-dd HH:mm:ss"; this.kdtp_CreateStartTime.CustomFormat = "yyyy-MM-dd";
this.kdtp_CreateStartTime.Location = new System.Drawing.Point(192, 10); this.kdtp_CreateStartTime.Location = new System.Drawing.Point(192, 10);
this.kdtp_CreateStartTime.Name = "kdtp_CreateStartTime"; this.kdtp_CreateStartTime.Name = "kdtp_CreateStartTime";
this.kdtp_CreateStartTime.ShowCheckBox = true; this.kdtp_CreateStartTime.ShowCheckBox = true;
@@ -303,26 +317,13 @@ namespace CleanMachineHMI.FrmUserControl
// kdtp_CreateEndTime // kdtp_CreateEndTime
// //
this.kdtp_CreateEndTime.Anchor = System.Windows.Forms.AnchorStyles.None; this.kdtp_CreateEndTime.Anchor = System.Windows.Forms.AnchorStyles.None;
this.kdtp_CreateEndTime.CustomFormat = "yyyy-MM-dd HH:mm:ss"; this.kdtp_CreateEndTime.CustomFormat = "yyyy-MM-dd";
this.kdtp_CreateEndTime.Location = new System.Drawing.Point(702, 10); this.kdtp_CreateEndTime.Location = new System.Drawing.Point(702, 10);
this.kdtp_CreateEndTime.Name = "kdtp_CreateEndTime"; this.kdtp_CreateEndTime.Name = "kdtp_CreateEndTime";
this.kdtp_CreateEndTime.ShowCheckBox = true; this.kdtp_CreateEndTime.ShowCheckBox = true;
this.kdtp_CreateEndTime.Size = new System.Drawing.Size(246, 21); this.kdtp_CreateEndTime.Size = new System.Drawing.Size(246, 21);
this.kdtp_CreateEndTime.TabIndex = 7; this.kdtp_CreateEndTime.TabIndex = 7;
// //
// kryptonButton1
//
this.kryptonButton1.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.kryptonButton1.Location = new System.Drawing.Point(3, 3);
this.kryptonButton1.Name = "kryptonButton1";
this.kryptonButton1.Size = new System.Drawing.Size(91, 35);
this.kryptonButton1.TabIndex = 1;
this.kryptonButton1.Tag = "show";
this.kryptonButton1.Values.Text = "打印";
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
//
// frmOperatorReport // frmOperatorReport
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -364,6 +365,7 @@ namespace CleanMachineHMI.FrmUserControl
private Krypton.Toolkit.KryptonDateTimePicker kdtp_CreateStartTime; private Krypton.Toolkit.KryptonDateTimePicker kdtp_CreateStartTime;
private Krypton.Toolkit.KryptonLabel kryptonLabel2; private Krypton.Toolkit.KryptonLabel kryptonLabel2;
private Krypton.Toolkit.KryptonLabel kryptonLabel5; private Krypton.Toolkit.KryptonLabel kryptonLabel5;
private Krypton.Toolkit.KryptonButton kryptonButton1;
private System.Windows.Forms.DataGridViewTextBoxColumn colDate; private System.Windows.Forms.DataGridViewTextBoxColumn colDate;
private System.Windows.Forms.DataGridViewTextBoxColumn ColDayOfWeek; private System.Windows.Forms.DataGridViewTextBoxColumn ColDayOfWeek;
private System.Windows.Forms.DataGridViewTextBoxColumn ColStartTime; private System.Windows.Forms.DataGridViewTextBoxColumn ColStartTime;
@@ -372,6 +374,5 @@ namespace CleanMachineHMI.FrmUserControl
private Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn ColCleaned; private Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn ColCleaned;
private Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn ColScrap; private Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn ColScrap;
private System.Windows.Forms.DataGridViewTextBoxColumn colOperators; private System.Windows.Forms.DataGridViewTextBoxColumn colOperators;
private Krypton.Toolkit.KryptonButton kryptonButton1;
} }
} }

View File

@@ -25,12 +25,18 @@ namespace CleanMachineHMI.FrmUserControl
public frmOperatorReport() public frmOperatorReport()
{ {
InitializeComponent(); InitializeComponent();
this.SetFormControlText();
this.kryptonDataGridView1.AutoGenerateColumns = false; this.kryptonDataGridView1.AutoGenerateColumns = false;
this.kdtp_CreateEndTime.Value =DateTime.Today.EndOfTheWeek() ;
this.kdtp_CreateStartTime.Value = DateTime.Today.StartOfTheWeek();
} }
public void Init() public void Init()
{ {
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetOPReport(this.kdtp_CreateStartTime.Value, this.kdtp_CreateEndTime.Value);
this.kryptonDataGridView1.DataSource = list;
//var sql = $@"select PARAMETER_ID 序号,PARAMETER_CODE 参数编码,PARAMETER_NAME 参数名称,PARAMETER_VALUE 参数值,CREATE_TIME 创建时间 from SYS_PARAMETER where USED_FLAG=1 and DEL_FLAG=0 "; //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) //if (kdtp_CreateStartTime.Checked)
@@ -70,8 +76,7 @@ namespace CleanMachineHMI.FrmUserControl
{ {
try try
{ {
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetOPReport(""); this.Init();
this.kryptonDataGridView1.DataSource = list;
} }
@@ -104,13 +109,30 @@ namespace CleanMachineHMI.FrmUserControl
private void kryptonButton1_Click(object sender, EventArgs e) private void kryptonButton1_Click(object sender, EventArgs e)
{ {
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetOPReport(""); var print = new frmPring();
try
{
print.Show();
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetOPReport(this.kdtp_CreateStartTime.Value, this.kdtp_CreateEndTime.Value);
FastReport.Report report = new FastReport.Report(); FastReport.Report report = new FastReport.Report();
report.Load("ReportMd\\operatorReport.frx"); report.Load("ReportMd\\operatorReport.frx");
report.RegisterData(list, "datas"); report.RegisterData(list, "datas");
// report.Design(); // report.Design();
report.PrintSettings.ShowDialog = false;
report.Prepare(); report.Prepare();
report.Print(); report.Print();
} }
finally
{
print.Close();
}
}
private void tableLayoutPanel2_Paint(object sender, PaintEventArgs e)
{
}
} }
} }

View File

@@ -129,16 +129,4 @@
<metadata name="colOperators.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="colOperators.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="ColStartTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColEndTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColMachineHours.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOperators.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> </root>

View File

@@ -109,7 +109,7 @@ namespace CleanMachineHMI.FrmUserControl
private void RefreshPlcData(bool isContainHisData) private void RefreshPlcData(bool isContainHisData)
{ {
List<WarningLog> tmpWarningLogList = new List<WarningLog>(); List<WarningLog> tmpWarningLogList = new List<WarningLog>();
tmpWarningLogList.AddRange(Global.CmWarningLogMd_List); tmpWarningLogList.AddRange(PlcOperationHelper.Instance.CmWarningLogMd_List.Values);
if (isContainHisData) if (isContainHisData)
{ {
string sql = $@"SELECT * FROM CM_WARNING_LOG"; string sql = $@"SELECT * FROM CM_WARNING_LOG";

View File

@@ -155,11 +155,11 @@ namespace CleanMachineHMI.FrmUserControl
List<PlcItem> tmpMdList; List<PlcItem> tmpMdList;
if (!string.IsNullOrEmpty(ktb_plcMsg.Text.Trim())) if (!string.IsNullOrEmpty(ktb_plcMsg.Text.Trim()))
{ {
tmpMdList = PlcOperationHelper.Instance. PlcItemMdList.FindAll(x => x.PlcItemCode.Contains(ktb_plcMsg.Text.Trim()) || x.PlcItemName.Contains(ktb_plcMsg.Text.Trim())); tmpMdList = PlcOperationHelper.Instance. PlcItemMdList.Values.ToList().FindAll(x => x.PlcItemCode.Contains(ktb_plcMsg.Text.Trim()) || x.PlcItemName.Contains(ktb_plcMsg.Text.Trim()));
} }
else else
{ {
tmpMdList = PlcOperationHelper.Instance.PlcItemMdList; tmpMdList = PlcOperationHelper.Instance.PlcItemMdList.Values.ToList();
} }
if (tmpMdList != null && tmpMdList.Count > 0) if (tmpMdList != null && tmpMdList.Count > 0)
{ {

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -27,9 +27,6 @@ namespace CleanMachineHMI
Application.EnableVisualStyles(); Application.EnableVisualStyles();
//frmUtil.DB2Json();//语言字典从数据库转json //frmUtil.DB2Json();//语言字典从数据库转json
Global.LoadTheme(); Global.LoadTheme();
#if DEBUG
Global.LoadzhCN();
#endif
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Global.LoadAllFormData(); Global.LoadAllFormData();
Application.Run(Global.LoginForm); Application.Run(Global.LoginForm);

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="10/12/2020 11:31:31" ReportInfo.Modified="01/14/2021 15:15:33" ReportInfo.CreatorVersion="2014.4.8.0"> <Report ScriptLanguage="CSharp" ReportInfo.Created="10/12/2020 11:31:31" ReportInfo.Modified="05/30/2022 10:34:20" ReportInfo.CreatorVersion="2022.2.0.0">
<ScriptText>using System; <ScriptText>using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@@ -246,33 +246,33 @@ namespace FastReport
<Parameter Name="Parm_PalletNumber" DataType="System.String"/> <Parameter Name="Parm_PalletNumber" DataType="System.String"/>
<Parameter Name="Parm_ScrapNumber" DataType="System.String"/> <Parameter Name="Parm_ScrapNumber" DataType="System.String"/>
</Dictionary> </Dictionary>
<ReportPage Name="Page1" Landscape="true" PaperWidth="279" PaperHeight="210" LeftMargin="5" TopMargin="5" RightMargin="5" BottomMargin="5" FirstPageSource="15" OtherPagesSource="15" FinishPageEvent="、"> <ReportPage Name="Page1" Landscape="true" PaperWidth="279" PaperHeight="210" LeftMargin="5" TopMargin="5" RightMargin="5" BottomMargin="5" FirstPageSource="15" OtherPagesSource="15" Watermark.Font="宋体, 60pt" FinishPageEvent="、">
<ReportTitleBand Name="ReportTitle1" Width="1016.82" Height="208.9"> <ReportTitleBand Name="ReportTitle1" Width="1016.82" Height="208.9">
<TextObject Name="Text1" Left="283.5" Width="396.9" Height="37.8" Text="CP2 Control List CTPS" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 22pt, style=Bold"/> <TextObject Name="Text1" Left="283.5" Width="396.9" Height="37.8" Text="CP2 Control List CTPS" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 22pt, style=Bold"/>
<TextObject Name="Text2" Left="87.05" Top="67.15" Width="151.2" Height="18.9" Text="Customer Name:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text2" Left="87.05" Top="67.15" Width="151.2" Height="18.9" IsIntersectedWithOtherObject="true" Text="Customer Name:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text3" Left="559.55" Top="67.15" Width="141.75" Height="18.9" Text="Machine #:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text3" Left="559.55" Top="67.15" Width="141.75" Height="18.9" IsIntersectedWithOtherObject="true" Text="Machine #:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text4" Left="245.7" Top="66.15" Width="160.65" Height="18.9" Text="[Parm_CusName]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text4" Left="245.7" Top="66.15" Width="160.65" Height="18.9" Text="[Parm_CusName]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text5" Left="708.75" Top="66.15" Width="198.45" Height="18.9" Text="[Parm_MachineCode]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/> <TextObject Name="Text5" Left="708.75" Top="66.15" Width="198.45" Height="18.9" Text="[Parm_MachineCode]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/>
<LineObject Name="Line1" Left="236.25" Top="85.05" Width="170.1"/> <LineObject Name="Line1" Left="236.25" Top="85.05" Width="170.1" IsIntersectedWithOtherObject="true"/>
<LineObject Name="Line2" Left="699.3" Top="85.05" Width="207.9"/> <LineObject Name="Line2" Left="699.3" Top="85.05" Width="245.7" IsIntersectedWithOtherObject="true"/>
<TextObject Name="Text6" Left="87.05" Top="95.5" Width="151.2" Height="18.9" Text="IR Number:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text6" Left="87.05" Top="95.5" Width="151.2" Height="18.9" IsIntersectedWithOtherObject="true" Text="IR Number:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text7" Left="559.55" Top="95.5" Width="141.75" Height="18.9" Text="Receiving Date:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text7" Left="559.55" Top="95.5" Width="141.75" Height="18.9" IsIntersectedWithOtherObject="true" Text="Receiving Date:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text8" Left="708.75" Top="94.5" Width="198.45" Height="18.9" Text="[Parm_RecDate]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/> <TextObject Name="Text8" Left="708.75" Top="94.5" Width="245.7" Height="18.9" Text="[Parm_RecDate]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/>
<TextObject Name="Text9" Left="245.7" Top="94.5" Width="160.65" Height="18.9" Text="[Parm_IRNumber]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text9" Left="245.7" Top="94.5" Width="160.65" Height="18.9" Text="[Parm_IRNumber]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<LineObject Name="Line3" Left="236.25" Top="113.4" Width="170.1"/> <LineObject Name="Line3" Left="236.25" Top="113.4" Width="170.1" IsIntersectedWithOtherObject="true"/>
<LineObject Name="Line4" Left="699.3" Top="113.4" Width="207.9"/> <LineObject Name="Line4" Left="699.3" Top="113.4" Width="245.7" IsIntersectedWithOtherObject="true"/>
<TextObject Name="Text11" Left="219.35" Top="190" Width="189" Height="18.9" Text="Chemical Contamination:" VertAlign="Center" Font="微软雅黑, 10pt"/> <TextObject Name="Text11" Left="219.35" Top="190" Width="189" Height="18.9" Text="Chemical Contamination:" VertAlign="Center" Font="微软雅黑, 10pt"/>
<TextObject Name="Text10" Left="2" Top="190" Width="189" Height="18.9" Text="Physical Contamination:" VertAlign="Center" Font="微软雅黑, 10pt"/> <TextObject Name="Text10" Left="2" Top="190" Width="189" Height="18.9" Text="Physical Contamination:" VertAlign="Center" Font="微软雅黑, 10pt"/>
<TextObject Name="Text12" Left="436.7" Top="190" Width="226.8" Height="18.9" Text="Microbiological Contamination:" VertAlign="Center" Font="微软雅黑, 10pt"/> <TextObject Name="Text12" Left="436.7" Top="190" Width="226.8" Height="18.9" Text="Microbiological Contamination:" VertAlign="Center" Font="微软雅黑, 10pt"/>
<TextObject Name="Text21" Left="87.05" Top="123.85" Width="151.2" Height="18.9" Text="Cleaned Quantity:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text21" Left="87.05" Top="123.85" Width="151.2" Height="18.9" IsIntersectedWithOtherObject="true" Text="Cleaned Quantity:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text23" Left="708.75" Top="122.85" Width="198.45" Height="18.9" Text="[Parm_PalletNumber]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/> <TextObject Name="Text23" Left="708.75" Top="122.85" Width="198.45" Height="18.9" Text="[Parm_PalletNumber]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/>
<TextObject Name="Text24" Left="245.7" Top="122.85" Width="160.65" Height="18.9" Text="[Parm_CleanedNum]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text24" Left="245.7" Top="122.85" Width="160.65" Height="18.9" Text="[Parm_CleanedNum]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<LineObject Name="Line9" Left="236.25" Top="141.75" Width="170.1"/> <LineObject Name="Line9" Left="236.25" Top="141.75" Width="170.1" IsIntersectedWithOtherObject="true"/>
<LineObject Name="Line10" Left="699.3" Top="141.75" Width="207.9"/> <LineObject Name="Line10" Left="699.3" Top="141.75" Width="245.7" IsIntersectedWithOtherObject="true"/>
<TextObject Name="Text25" Left="559.55" Top="123.85" Width="141.75" Height="18.9" Text="Pallet Number:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text25" Left="559.55" Top="123.85" Width="141.75" Height="18.9" IsIntersectedWithOtherObject="true" Text="Pallet Number:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text28" Left="87.05" Top="152.2" Width="151.2" Height="18.9" Text="Scrap Number:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text28" Left="87.05" Top="152.2" Width="151.2" Height="18.9" IsIntersectedWithOtherObject="true" Text="Scrap Number:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text29" Left="245.7" Top="151.2" Width="160.65" Height="18.9" Text="[Parm_ScrapNumber]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text29" Left="245.7" Top="151.2" Width="160.65" Height="18.9" Text="[Parm_ScrapNumber]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<LineObject Name="Line15" Left="236.25" Top="170.1" Width="170.1"/> <LineObject Name="Line15" Left="236.25" Top="170.1" Width="170.1" IsIntersectedWithOtherObject="true"/>
</ReportTitleBand> </ReportTitleBand>
<DataBand Name="Data1" Top="212.9" Width="1016.82" Height="67.15"> <DataBand Name="Data1" Top="212.9" Width="1016.82" Height="67.15">
<TableObject Name="Table1" Width="207.87" Height="37.8" Border.Lines="All" ManualBuildEvent="Table1_ManualBuild"> <TableObject Name="Table1" Width="207.87" Height="37.8" Border.Lines="All" ManualBuildEvent="Table1_ManualBuild">
@@ -354,11 +354,11 @@ namespace FastReport
</DataBand> </DataBand>
</DataBand> </DataBand>
<ColumnFooterBand Name="ColumnFooter1" Top="373.1" Width="1016.82" Height="37.8"> <ColumnFooterBand Name="ColumnFooter1" Top="373.1" Width="1016.82" Height="37.8">
<LineObject Name="Line5" Left="160.65" Top="28.35" Width="207.9"/> <LineObject Name="Line5" Left="160.65" Top="28.35" Width="207.9" IsIntersectedWithOtherObject="true"/>
<LineObject Name="Line6" Left="481.95" Top="28.35" Width="236.25"/> <LineObject Name="Line6" Left="481.95" Top="28.35" Width="236.25" IsIntersectedWithOtherObject="true"/>
<TextObject Name="Text13" Left="11.45" Top="10.45" Width="151.2" Height="18.9" Text="Record verified by:" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text13" Left="11.45" Top="10.45" Width="151.2" Height="18.9" IsIntersectedWithOtherObject="true" Text="Record verified by:" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text14" Left="427.25" Top="10.45" Width="56.7" Height="18.9" Text="Date:" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> <TextObject Name="Text14" Left="427.25" Top="10.45" Width="56.7" Height="18.9" IsIntersectedWithOtherObject="true" Text="Date:" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/>
<TextObject Name="Text15" Left="491.4" Top="9.45" Width="217.35" Height="18.9" Text="[Date]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/> <TextObject Name="Text15" Left="491.4" Top="9.45" Width="226.8" Height="18.9" Text="[Date]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/>
<TextObject Name="Text17" Left="170.1" Top="9.45" Width="217.35" Height="18.9" Text="[Parm_RecordName]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/> <TextObject Name="Text17" Left="170.1" Top="9.45" Width="217.35" Height="18.9" Text="[Parm_RecordName]" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/>
</ColumnFooterBand> </ColumnFooterBand>
</ReportPage> </ReportPage>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="05/17/2022 13:55:09" ReportInfo.Modified="05/30/2022 10:37:31" ReportInfo.CreatorVersion="2022.2.0.0">
<Dictionary>
<BusinessObjectDataSource Name="datas" ReferenceName="datas" DataType="null" Enabled="true">
<Column Name="Date" DataType="System.DateTime"/>
<Column Name="Cleaned" DataType="System.Int32"/>
<Column Name="Scrap" DataType="System.Int32"/>
<Column Name="DayOfWeek" DataType="System.DayOfWeek"/>
<Column Name="StartTime" DataType="System.DateTime"/>
<Column Name="EndTime" DataType="System.DateTime"/>
<Column Name="MachineHours" DataType="System.Single"/>
</BusinessObjectDataSource>
</Dictionary>
<ReportPage Name="Page1" Watermark.Font="宋体, 60pt">
<ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8"/>
<PageHeaderBand Name="PageHeader1" Top="41.8" Width="718.2" Height="18.9">
<TextObject Name="Text2" Left="37.8" Width="94.5" Height="18.9" Text="Date" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text4" Left="132.3" Width="94.5" Height="18.9" Text="DayOfWeek" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text6" Left="226.8" Width="94.5" Height="18.9" Text="Cleaned" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text8" Left="321.3" Width="47.25" Height="18.9" Text="Scrap" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text10" Left="387.45" Width="94.5" Height="18.9" Text="StartTime" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text12" Left="481.95" Width="103.95" Height="18.9" Text="EndTime" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text14" Left="585.9" Width="122.85" Height="18.9" Text="MachineRunHours" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text18" Width="37.8" Height="18.9" Text="NO." VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<LineObject Name="Line1" Top="18.9" Width="680.4" Diagonal="true"/>
</PageHeaderBand>
<DataBand Name="Data1" Top="64.7" Width="718.2" Height="18.9" CanGrow="true" DataSource="datas" KeepTogether="true">
<TextObject Name="Text1" Left="37.8" Width="94.5" Height="18.9" Text="[datas.Date]" Format="Date" Format.Format="d" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text3" Left="132.3" Width="94.5" Height="18.9" Text="[datas.DayOfWeek]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text5" Left="226.8" Width="94.5" Height="18.9" Text="[datas.Cleaned]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text7" Left="321.3" Width="47.25" Height="18.9" Text="[datas.Scrap]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text9" Left="387.45" Width="66.15" Height="18.9" Text="[datas.StartTime]" Format="Time" Format.Format="t" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text11" Left="481.95" Width="103.95" Height="18.9" Text="[datas.EndTime]" Format="Time" Format.Format="t" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text13" Left="585.9" Width="122.85" Height="18.9" Text="[datas.MachineHours]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="2" HorzAlign="Right" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
<TextObject Name="Text17" Width="37.8" Height="18.9" Text="[Row#]" VertAlign="Center" Font="宋体, 9pt"/>
<Sort>
<Sort Expression="[datas.Date]"/>
<Sort Expression="[datas.Operator]"/>
</Sort>
</DataBand>
<PageFooterBand Name="PageFooter1" Top="87.6" Width="718.2" Height="94.5">
<TextObject Name="Text19" Left="585.9" Width="94.5" Height="18.9" Text="[PageN]/[TotalPages#]" Font="宋体, 9pt"/>
<LineObject Name="Line2" Width="680.4" Diagonal="true"/>
</PageFooterBand>
</ReportPage>
</Report>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="05/17/2022 13:55:09" ReportInfo.Modified="05/17/2022 14:48:54" ReportInfo.CreatorVersion="2014.4.8.0"> <Report ScriptLanguage="CSharp" ReportInfo.Created="05/17/2022 13:55:09" ReportInfo.Modified="05/30/2022 10:37:43" ReportInfo.CreatorVersion="2022.2.0.0">
<Dictionary> <Dictionary>
<BusinessObjectDataSource Name="datas" ReferenceName="datas" DataType="System.Collections.Generic.List`1[[CleanMachine.Model.ZBK.OperatorReport, CleanMachine.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]" Enabled="true"> <BusinessObjectDataSource Name="datas" ReferenceName="datas" DataType="null" Enabled="true">
<Column Name="Date" DataType="System.DateTime"/> <Column Name="Date" DataType="System.DateTime"/>
<Column Name="Operator" DataType="System.String"/> <Column Name="Operator" DataType="System.String"/>
<Column Name="Cleaned" DataType="System.Int32"/> <Column Name="Cleaned" DataType="System.Int32"/>
@@ -12,40 +12,38 @@
<Column Name="MachineHours" DataType="System.Single"/> <Column Name="MachineHours" DataType="System.Single"/>
</BusinessObjectDataSource> </BusinessObjectDataSource>
</Dictionary> </Dictionary>
<ReportPage Name="Page1"> <ReportPage Name="Page1" Watermark.Font="宋体, 60pt">
<ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8"/> <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8"/>
<PageHeaderBand Name="PageHeader1" Top="39.8" Width="718.2" Height="18.9"> <PageHeaderBand Name="PageHeader1" Top="41.8" Width="718.2" Height="18.9">
<TextObject Name="Text2" Left="37.8" Width="94.5" Height="18.9" Text="Date" VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text2" Left="37.8" Width="75.6" Height="18.9" Text="Date" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text4" Left="132.3" Width="94.5" Height="18.9" Text="DayOfWeek" VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text4" Left="113.4" Width="94.5" Height="18.9" Text="DayOfWeek" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text6" Left="226.8" Width="94.5" Height="18.9" Text="Cleaned" VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text6" Left="207.9" Width="66.15" Height="18.9" Text="Cleaned" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text8" Left="321.3" Width="47.25" Height="18.9" Text="Scrap" VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text8" Left="274.05" Width="47.25" Height="18.9" Text="Scrap" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text10" Left="368.55" Width="66.15" Height="18.9" Text="StartTime" VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text10" Left="321.3" Width="85.05" Height="18.9" Text="StartTime" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text12" Left="434.7" Width="56.7" Height="18.9" Text="EndTime" VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text12" Left="406.35" Width="103.95" Height="18.9" Text="EndTime" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text14" Left="491.4" Width="94.5" Height="18.9" Text="MachineHours" VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text14" Left="510.3" Width="113.4" Height="18.9" Text="MachineRunHours" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text16" Left="585.9" Width="94.5" Height="18.9" Text="Operator" VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text16" Left="623.7" Width="94.5" Height="18.9" Text="Operator" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text18" Width="37.8" Height="18.9" Text="NO." VertAlign="Center" Font="宋体, 9pt, style=Bold"/> <TextObject Name="Text18" Width="37.8" Height="18.9" Text="NO." VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<LineObject Name="Line1" Top="18.9" Width="680.4" Diagonal="true"/> <LineObject Name="Line1" Left="37.8" Top="18.9" Width="642.6" Diagonal="true"/>
</PageHeaderBand> </PageHeaderBand>
<DataBand Name="Data1" Top="60.7" Width="718.2" Height="18.9" CanGrow="true" DataSource="datas" KeepTogether="true"> <DataBand Name="Data1" Top="64.7" Width="718.2" Height="18.9" CanGrow="true" DataSource="datas" KeepTogether="true">
<TextObject Name="Text1" Left="37.8" Width="94.5" Height="18.9" Text="[datas.Date]" Format="Date" Format.Format="d" VertAlign="Center" Font="宋体, 9pt"/> <TextObject Name="Text1" Left="37.8" Width="75.6" Height="18.9" Text="[datas.Date]" Format="Date" Format.Format="d" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text3" Left="132.3" Width="94.5" Height="18.9" Text="[datas.DayOfWeek]" VertAlign="Center" Font="宋体, 9pt"/> <TextObject Name="Text3" Left="113.4" Width="94.5" Height="18.9" Text="[datas.DayOfWeek]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text5" Left="226.8" Width="94.5" Height="18.9" Text="[datas.Cleaned]" VertAlign="Center" Font="宋体, 9pt"/> <TextObject Name="Text5" Left="207.9" Width="66.15" Height="18.9" Text="[datas.Cleaned]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text7" Left="321.3" Width="47.25" Height="18.9" Text="[datas.Scrap]" VertAlign="Center" Font="宋体, 9pt"/> <TextObject Name="Text7" Left="274.05" Width="47.25" Height="18.9" Text="[datas.Scrap]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text9" Left="368.55" Width="66.15" Height="18.9" Text="[datas.StartTime]" Format="Time" Format.Format="t" VertAlign="Center" Font="宋体, 9pt"/> <TextObject Name="Text9" Left="321.3" Width="85.05" Height="18.9" Text="[datas.StartTime]" Format="Time" Format.Format="t" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text11" Left="434.7" Width="56.7" Height="18.9" Text="[datas.EndTime]" Format="Time" Format.Format="t" VertAlign="Center" Font="宋体, 9pt"/> <TextObject Name="Text11" Left="406.35" Width="103.95" Height="18.9" Text="[datas.EndTime]" Format="Time" Format.Format="t" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text13" Left="491.4" Width="94.5" Height="18.9" Text="[datas.MachineHours]" Format="Number" Format.UseLocale="true" HorzAlign="Right" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/> <TextObject Name="Text13" Left="510.3" Width="113.4" Height="18.9" Text="[datas.MachineHours]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="2" HorzAlign="Right" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
<TextObject Name="Text15" Left="585.9" Width="94.5" Height="18.9" Text="[datas.Operator]" VertAlign="Center" Font="宋体, 9pt"/> <TextObject Name="Text15" Left="623.7" Width="94.5" Height="18.9" Text="[datas.Operator]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text17" Width="37.8" Height="18.9" Text="[Row#]" VertAlign="Center" Font="宋体, 9pt"/> <TextObject Name="Text17" Width="37.8" Height="18.9" Text="[Row#]" VertAlign="Center" Font="宋体, 9pt"/>
<Sort> <Sort>
<Sort Expression="[datas.Date]"/> <Sort Expression="[datas.Date]"/>
<Sort Expression="[datas.Operator]"/> <Sort Expression="[datas.Operator]"/>
</Sort> </Sort>
</DataBand> </DataBand>
<PageFooterBand Name="PageFooter1" Top="81.6" Width="718.2" Height="94.5"> <PageFooterBand Name="PageFooter1" Top="87.6" Width="718.2" Height="94.5">
<TextObject Name="Text19" Left="585.9" Width="94.5" Height="18.9" Text="[PageN]/[TotalPages#]" Font="宋体, 9pt"/> <TextObject Name="Text19" Left="623.7" Width="94.5" Height="18.9" Text="[PageN]/[TotalPages#]" Font="宋体, 9pt"/>
<LineObject Name="Line2" Width="680.4" Diagonal="true"/> <LineObject Name="Line2" Width="680.4" Diagonal="true"/>
<TextObject Name="Text20" Left="226.8" Width="94.5" Height="18.9" Font="宋体, 9pt"/>
<TextObject Name="Text21" Left="28.35" Top="18.9" Width="132.3" Height="18.9" Text="sum([datas.scrap])" Font="宋体, 9pt"/>
</PageFooterBand> </PageFooterBand>
</ReportPage> </ReportPage>
</Report> </Report>

View File

@@ -0,0 +1,31 @@
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);
}
}
}

View File

@@ -1,4 +1,6 @@
using CleanMachine.Model; //#define USE_JSON
using CleanMachine.Model;
using CleanMachine.Model.BAS; using CleanMachine.Model.BAS;
using CleanMachine.Model.CM; using CleanMachine.Model.CM;
using CleanMachineHMI.Domain.Enums; using CleanMachineHMI.Domain.Enums;
@@ -210,7 +212,7 @@ namespace CleanMachineHMI
public static List<Warning> BasWarningMd_List { get; set; } public static List<Warning> BasWarningMd_List { get; set; }
public static List<WarningLog> CmWarningLogMd_List { get; set; } // public static Dictionary<string, WarningLog> CmWarningLogMd_List { get; set; } = new Dictionary<string, WarningLog>();
public static List<WarningLog> CmWarningLogMd_List_1 { get; set; } public static List<WarningLog> CmWarningLogMd_List_1 { get; set; }
@@ -316,39 +318,84 @@ namespace CleanMachineHMI
if (ThemeLanguage == null || ThemeLanguage.Count == 0) if (ThemeLanguage == null || ThemeLanguage.Count == 0)
{ {
// var appPath = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0]; // var appPath = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0];
#if USE_JSON
var filePath = $"Lang\\{Global.LanguageCode}.json"; var filePath = $"Lang\\{Global.LanguageCode}.json";
var str = File.ReadAllText(filePath); var str = File.ReadAllText(filePath);
var lstLanguage = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ThemeLanguage>>(str); var lstLanguage = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ThemeLanguage>>(str);
#else
var filePath = $"Lang\\{Global.LanguageCode}.xlsx";
using (var fiel = new FileStream(filePath, FileMode.Open))
{
var lstLanguage = Snail.Utils.Office.Excel.ExcelImport.GetModels<ThemeLanguage>(fiel).ToList();
#endif
var tmpThemeLanguage = new Dictionary<string, string>(); var tmpThemeLanguage = new Dictionary<string, string>();
lstLanguage.ForEach(item => lstLanguage.ForEach(item =>
{ {
var key = item.formCode + "|" + item.controlCode;
var value = "";
if (item.options != null && item.options.Count > 0) if (item.options != null && item.options.Count > 0)
{ {
tmpThemeLanguage.Add(item.formCode + "|" + item.controlCode, string.Join(",", item.options)); value = string.Join(",", item.options);
} }
else else
{ {
tmpThemeLanguage.Add(item.formCode + "|" + item.controlCode, item.controlName); value = item.controlName;
} }
if (tmpThemeLanguage.ContainsKey(key))
{
tmpThemeLanguage[key] = value;
}
else
{
tmpThemeLanguage.Add(key, value);
}
//if (item.options != null && item.options.Count > 0)
//{
// tmpThemeLanguage.Add(item.formCode + "|" + item.controlCode, string.Join(",", item.options));
//}
//else
//{
// tmpThemeLanguage.Add(item.formCode + "|" + item.controlCode, item.controlName);
//}
}); });
ThemeLanguage = tmpThemeLanguage; ThemeLanguage = tmpThemeLanguage;
#if !USE_JSON
}
#endif
} }
} }
public static void LoadzhCN() //public static void LoadzhCN()
{ //{
if (Utils.frmUtil.znCNLang == null || Utils.frmUtil.znCNLang.Count == 0) // if (Utils.frmUtil.znCNLang == null || Utils.frmUtil.znCNLang.Count == 0)
{ // {
var appPath = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0]; // var appPath = System.Windows.Forms.Application.StartupPath.Split(new string[] { @"bin\Debug" }, StringSplitOptions.RemoveEmptyEntries)[0];
var filePath = appPath + $"Lang\\zh-CN.json"; // var filePath = appPath + $"Lang\\zh-CN.json";
if (!File.Exists(filePath)) // if (!File.Exists(filePath))
{ // {
return; // return;
} // }
var str = File.ReadAllText(filePath); // var str = File.ReadAllText(filePath);
Utils.frmUtil.znCNLang = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ThemeLanguage>>(str); // Utils.frmUtil.znCNLang = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ThemeLanguage>>(str);
} // }
} //}
} }
} }

View File

@@ -1,12 +1,11 @@
//使用本地调式 //使用本地调式
#if DEBUG #if DEBUG
#define USE_LOCAL_TCP_DEBUG
//#define USE_LOCAL_TCP_DEBUG
#endif #endif
//启用心跳检查 //启用心跳检查
#if RELEASE #if !USE_LOCAL_TCP_DEBUG
#define UseHeartbeat #define UseHeartbeat
#endif #endif
using CleanMachine.Model; using CleanMachine.Model;
@@ -135,14 +134,14 @@ namespace CleanMachineHMI
public List<PlcItem> PlcItemMdList { get; set; } = new List<PlcItem>(); public Dictionary<string, PlcItem> PlcItemMdList { get; set; } = new Dictionary<string, PlcItem>();
public List<PlcItem> PlcItemMd_D_List { get; set; } = new List<PlcItem>(); public Dictionary<string, PlcItem> PlcItemMd_D_List { get; set; } = new Dictionary<string, PlcItem>();
public List<PlcItem> PlcItemMd_M_List { get; set; } = new List<PlcItem>(); public Dictionary<string, PlcItem> PlcItemMd_M_List { get; set; } = new Dictionary<string, PlcItem>();
public List<PlcItem> PlcItemMd_X_List { get; set; } = new List<PlcItem>(); public Dictionary<string, PlcItem> PlcItemMd_X_List { get; set; } = new Dictionary<string, PlcItem>();
public List<PlcItem> PlcItemMd_Y_List { get; set; } = new List<PlcItem>(); public Dictionary<string, PlcItem> PlcItemMd_Y_List { get; set; } = new Dictionary<string, PlcItem>();
public void StartRead() public void StartRead()
@@ -251,7 +250,7 @@ namespace CleanMachineHMI
} }
#if USE_LOCAL_TCP_DEBUG #if USE_LOCAL_TCP_DEBUG
port.Connect("10.0.0.95", 5002); port.Connect("10.20.88.95", 5002);
this._isConn = true; this._isConn = true;
return true; return true;
#else #else
@@ -286,20 +285,20 @@ namespace CleanMachineHMI
switch (plcitem.PlcItemDataType) switch (plcitem.PlcItemDataType)
{ {
case PlcItemTypeDesc.M: case PlcItemTypeDesc.M:
PlcItemMd_M_List.Add(plcitem); PlcItemMd_M_List.Add(plcitem.PlcItemCode, plcitem);
break; break;
case PlcItemTypeDesc.D: case PlcItemTypeDesc.D:
PlcItemMd_D_List.Add(plcitem); PlcItemMd_D_List.Add(plcitem.PlcItemCode, plcitem);
break; break;
case PlcItemTypeDesc.X: case PlcItemTypeDesc.X:
PlcItemMd_X_List.Add(plcitem); PlcItemMd_X_List.Add(plcitem.PlcItemCode, plcitem);
break; break;
case PlcItemTypeDesc.Y: case PlcItemTypeDesc.Y:
PlcItemMd_Y_List.Add(plcitem); PlcItemMd_Y_List.Add(plcitem.PlcItemCode, plcitem);
break; break;
} }
PlcItemMdList.Add(plcitem); PlcItemMdList.Add(plcitem.PlcItemCode, plcitem);
} }
@@ -337,7 +336,7 @@ namespace CleanMachineHMI
{ {
if (PlcItemMd_M_List != null && PlcItemMd_M_List.Count > 0) if (PlcItemMd_M_List != null && PlcItemMd_M_List.Count > 0)
{ {
foreach (PlcItem item in PlcItemMd_M_List) foreach (PlcItem item in PlcItemMd_M_List.Values)
{ {
string value = ""; string value = "";
if (Convert.ToInt32(item.PlcItemPriAddress) >= 200) if (Convert.ToInt32(item.PlcItemPriAddress) >= 200)
@@ -398,7 +397,7 @@ namespace CleanMachineHMI
{ {
if (PlcItemMd_D_List != null && PlcItemMd_D_List.Count > 0) if (PlcItemMd_D_List != null && PlcItemMd_D_List.Count > 0)
{ {
foreach (PlcItem item in PlcItemMd_D_List) foreach (PlcItem item in PlcItemMd_D_List.Values)
{ {
var value = ""; var value = "";
if (!string.IsNullOrEmpty(item.PlcItemDeviationAddress)) if (!string.IsNullOrEmpty(item.PlcItemDeviationAddress))
@@ -469,24 +468,59 @@ namespace CleanMachineHMI
string priStr = "D"; string priStr = "D";
int index = 10; int index = 10;
bool alarmChange = false; bool alarmChange = false;
Global.CmWarningLogMd_List.Clear();
//Global.CmWarningLogMd_List.Clear();
for (var i = 0; i < 9; i++) for (var i = 0; i < 9; i++)
{ {
var plcitem = $"{priStr}{index + i}"; var plcitem = $"{priStr}{index + i}";
if (lastAlarm[i] != tmpReadAlarmBytArr_D[i]) if (lastAlarm[i] != tmpReadAlarmBytArr_D[i])
{ {
foreach (var W in CmWarningLogMd_List)
{
if (W.Value.PlcItemCode == plcitem)
{
W.Value.WaringStatus = 1;
}
}
if (tmpReadAlarmBytArr_D[i] != 0) if (tmpReadAlarmBytArr_D[i] != 0)
{ {
var wanglist = Global.CheckWarng(tmpReadAlarmBytArr_D[i], plcitem); var wanglist = Global.CheckWarng(tmpReadAlarmBytArr_D[i], plcitem);
Global.CmWarningLogMd_List.AddRange(wanglist); foreach (var wang in wanglist)
{
if (CmWarningLogMd_List.TryGetValue(wang.PlcItemCode + wang.WarningCode, out var warning))
{
wang.WaringStatus = 0;
}
else
{
//添加
CmWarningLogMd_List.Add(wang.PlcItemCode + wang.WarningCode, wang);
// new CleanMachine.BLL.CM.WarningLogBLL().Add(wang);
}
}
} }
lastAlarm[i] = tmpReadAlarmBytArr_D[i]; lastAlarm[i] = tmpReadAlarmBytArr_D[i];
alarmChange = true; alarmChange = true;
} }
} }
var keys = CmWarningLogMd_List.Keys.ToList();
foreach (var key in keys)
{
if (CmWarningLogMd_List[key].WaringStatus == 1)
{
// new CleanMachine.BLL.CM.WarningLogBLL().Update(Global.CmWarningLogMd_List[key]);
CmWarningLogMd_List.Remove(key);
}
}
if (alarmChange) if (alarmChange)
{ {
@@ -517,6 +551,12 @@ namespace CleanMachineHMI
ushort[] lastAlarm = new ushort[9] { 0, 0, 0, 0, 0, 0, 0, 0, 0, }; ushort[] lastAlarm = new ushort[9] { 0, 0, 0, 0, 0, 0, 0, 0, 0, };
public Dictionary<string, WarningLog> CmWarningLogMd_List { get; set; } = new Dictionary<string, WarningLog>();
@@ -549,230 +589,284 @@ namespace CleanMachineHMI
//报警信息记录 //报警信息记录
private void HandleWaringLog(ushort[] tmpReadAlarmBytArr_D) // private void HandleWaringLog(ushort[] tmpReadAlarmBytArr_D)
{
#if RELEASE
try
{
#endif
int index = 10;
string priStr = "D";
string priWarnCode = "bit";
for (int i = 0; i < tmpReadAlarmBytArr_D.Length; i++)
{
if (i <= 1)
{//D10~D11 报警
char[] tmpCharArr = Convert.ToString(tmpReadAlarmBytArr_D[i], 2).PadLeft(16, '0').Reverse().ToArray();
for (int j = 0; j < tmpCharArr.Length; j++)
{
if (tmpCharArr[j] == '1')
{//当前报警
Warning tmpMd = Global.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
if (tmpMd != null)
{
WarningLog warnLogTmp = Global.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == tmpMd.PlcItemCode);
if (warnLogTmp != null)
{//找到报警项,并增加版本
warnLogTmp.UpdateTime = DateTime.Now;
warnLogTmp.DataVersion += 1;
}
else
{//新报警增加记录
Global.CmWarningLogMd_List.Add(new WarningLog
{
WarningCode = tmpMd.WarningCode,
WarningName = tmpMd.WarningName,
WarningType = tmpMd.WarningType,
WarningMessage = tmpMd.WarningMessage,
WarningTime = DateTime.Now,
PlcItemCode = tmpMd.PlcItemCode,
WaringStatus = 0,
WarningHandleResult = 0,
CreateBy = 1,
CreateTime = DateTime.Now,
UpdateBy = 1,
UpdateTime = DateTime.Now,
DataVersion = 0,
});
}
}
#region 已删除
// string sql = $@"SELECT * FROM BAS_WARNING WHERE PLC_ITEM_CODE = '{priStr + (index + i)}' and WARNING_CODE = '{priWarnCode + i}' and WARNING_TYPE = '1'";
// DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
// if (dt != null && dt.Rows.Count > 0)
// { // {
// string sql1 = $@" //#if RELEASE
// INSERT INTO CM_WARNING_LOG ( // try
// WARNING_CODE,
// WARNING_NAME,
// WARNING_TYPE,
// WARNING_MESSAGE,
// WARNING_TIME,
// PLC_ITEM_CODE,
// WARING_STATUS,
// WARNING_HANDLE_RESULT,
// CREATE_BY,
// CREATE_TIME,
// UPDATE_BY,
// UPDATE_TIME,
// DATA_VERSION
// )
// SELECT
// '{dt.Rows[0]["WARNING_CODE"]}',
// '{dt.Rows[0]["WARNING_NAME"]}',
// '{dt.Rows[0]["WARNING_TYPE"]}',
// '{dt.Rows[0]["WARNING_MESSAGE"]}',
// datetime('now', 'localtime'),
// '{dt.Rows[0]["PLC_ITEM_CODE"]}',
// 0,
// 0,
// 1,
// datetime('now', 'localtime'),
// 1,
// datetime('now', 'localtime'),
// 0
// WHERE NOT EXISTS (SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}')
// ";
// LeadDbHelperSQLite.ExecuteSql(sql1);
// string sql2 = $@"
//UPDATE CM_WARNING_LOG set UPDATE_TIME = datetime('now', 'localtime'),DATA_VERSION = DATA_VERSION + 1
// WHERE EXISTS(SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}') and WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}';
// ";
// LeadDbHelperSQLite.ExecuteSql(sql2);
// }
#endregion
}
else
{//当前报警项没有报警
Warning tmpMd = Global.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
if (tmpMd != null)
{//之前有报警,则结束当前报警项
WarningLog warnLogTmp = Global.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == tmpMd.PlcItemCode);
if (warnLogTmp != null)
{
warnLogTmp.UpdateTime = DateTime.Now;
warnLogTmp.DataVersion += 1;
warnLogTmp.WaringStatus = 1;
warnLogTmp.WarningHandleResult = 1;
warnLogTmp.WarningHandleTime = DateTime.Now;
}
}
#region 已删除
//string sql = $@"SELECT * FROM BAS_WARNING WHERE PLC_ITEM_CODE = '{priStr + (index + i)}' and WARNING_CODE = '{priWarnCode + i}' and WARNING_TYPE = '1'";
//DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
//if (dt != null && dt.Rows.Count > 0)
// { // {
// string sql2 = $@" //#endif
// UPDATE CM_WARNING_LOG // int index = 10;
// SET UPDATE_TIME = datetime('now', 'localtime'), // string priStr = "D";
// DATA_VERSION = DATA_VERSION + 1, // string priWarnCode = "bit";
// WARING_STATUS = 1, // for (int i = 0; i < tmpReadAlarmBytArr_D.Length; i++)
// WARNING_HANDLE_RESULT = 1, // {
// WARNING_HANDLE_TIME = datetime('now', 'localtime') // if (i <= 1)
// WHERE // {//D10~D11 报警
// EXISTS ( SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 AND WARNING_HANDLE_RESULT = 0 AND WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' AND PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}' )
// AND WARING_STATUS = 0
// AND WARNING_HANDLE_RESULT = 0
// AND WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}'
// AND PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}';
// ";
// LeadDbHelperSQLite.ExecuteSql(sql2);
//}
#endregion
}
}
}
else if (i == 2)
{
// char[] tmpCharArr = Convert.ToString(tmpReadAlarmBytArr_D[i], 2).PadLeft(16, '0').Reverse().ToArray(); // char[] tmpCharArr = Convert.ToString(tmpReadAlarmBytArr_D[i], 2).PadLeft(16, '0').Reverse().ToArray();
//if (tmpCharArr.Contains('1'))
//{
// List<Bas_WarningMd> warnLst = new List<Bas_WarningMd>();
// for (int j = 0; j < tmpCharArr.Length; j++) // for (int j = 0; j < tmpCharArr.Length; j++)
// { // {
// if (tmpCharArr[j] == '1') // if (tmpCharArr[j] == '1')
// { // {//当前报警
// Bas_WarningMd tmpMd = GlobalHelper.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1"); // Warning tmpMd = Global.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
// if (tmpMd != null) // if (tmpMd != null)
// { // {
// warnLst.Add(tmpMd); // WarningLog warnLogTmp = Global.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == tmpMd.PlcItemCode);
// if (warnLogTmp != null)
// {//找到报警项,并增加版本
// warnLogTmp.UpdateTime = DateTime.Now;
// warnLogTmp.DataVersion += 1;
// }
// else
// {//新报警增加记录
// Global.CmWarningLogMd_List.Add(new WarningLog
// {
// WarningCode = tmpMd.WarningCode,
// WarningName = tmpMd.WarningName,
// WarningType = tmpMd.WarningType,
// WarningMessage = tmpMd.WarningMessage,
// WarningTime = DateTime.Now,
// PlcItemCode = tmpMd.PlcItemCode,
// WaringStatus = 0,
// WarningHandleResult = 0,
// CreateBy = 1,
// CreateTime = DateTime.Now,
// UpdateBy = 1,
// UpdateTime = DateTime.Now,
// DataVersion = 0,
// });
// } // }
// } // }
// } // #region 已删除
// GlobalHelper.ShowWarningMsg(warnLst, new EventArgs());
//}
}
else if (i >= 3 && i <= 9)
{//D13~D19报警
if (tmpReadAlarmBytArr_D[i] == 0)
{
WarningLog warnLogTmp = Global.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.PlcItemCode == $"{priStr + (index + i)}");
if (warnLogTmp != null)
{
warnLogTmp.UpdateTime = DateTime.Now;
warnLogTmp.DataVersion += 1;
warnLogTmp.WaringStatus = 1;
warnLogTmp.WarningHandleResult = 1;
warnLogTmp.WarningHandleTime = DateTime.Now;
}
#region 已删除
//string sql2 = $@"
// UPDATE CM_WARNING_LOG
// SET UPDATE_TIME = datetime('now', 'localtime'),
// DATA_VERSION = DATA_VERSION + 1,
// WARING_STATUS = 1,
// WARNING_HANDLE_RESULT = 1,
// WARNING_HANDLE_TIME = datetime('now', 'localtime')
// WHERE
// EXISTS ( SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 AND WARNING_HANDLE_RESULT = 0 AND WARNING_CODE = '{i}' AND PLC_ITEM_CODE is NULL )
// AND WARING_STATUS = 0
// AND WARNING_HANDLE_RESULT = 0
// AND WARNING_CODE = 'i'
// AND PLC_ITEM_CODE is NULL;
// ";
//LeadDbHelperSQLite.ExecuteSql(sql2);
#endregion
}
else
{//根据报警编码,获取报警信息,根据读取顺序编号,组成PlcItemCode
Warning tmpMd = Global.BasWarningMd_List.Find(x => string.IsNullOrEmpty(x.PlcItemCode) && x.WarningCode == tmpReadAlarmBytArr_D[i].ToString() && x.WarningType == "2");
if (tmpMd != null)
{
WarningLog warnLogTmp = Global.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == $"{priStr + (index + i)}");
if (warnLogTmp != null)
{
warnLogTmp.UpdateTime = DateTime.Now;
warnLogTmp.DataVersion += 1;
}
else
{
Global.CmWarningLogMd_List.Add(new WarningLog
{
WarningCode = tmpMd.WarningCode,
WarningName = tmpMd.WarningName,
WarningType = tmpMd.WarningType,
WarningMessage = tmpMd.WarningMessage,
WarningTime = DateTime.Now,
PlcItemCode = $"{priStr + (index + i)}",
WaringStatus = 0,
WarningHandleResult = 0,
CreateBy = 1,
CreateTime = DateTime.Now,
UpdateBy = 1,
UpdateTime = DateTime.Now,
DataVersion = 0,
});
}
}
#region 已删除 // // string sql = $@"SELECT * FROM BAS_WARNING WHERE PLC_ITEM_CODE = '{priStr + (index + i)}' and WARNING_CODE = '{priWarnCode + i}' and WARNING_TYPE = '1'";
// // DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
// // if (dt != null && dt.Rows.Count > 0)
// // {
// // string sql1 = $@"
// // INSERT INTO CM_WARNING_LOG (
// // WARNING_CODE,
// // WARNING_NAME,
// // WARNING_TYPE,
// // WARNING_MESSAGE,
// // WARNING_TIME,
// // PLC_ITEM_CODE,
// // WARING_STATUS,
// // WARNING_HANDLE_RESULT,
// // CREATE_BY,
// // CREATE_TIME,
// // UPDATE_BY,
// // UPDATE_TIME,
// // DATA_VERSION
// // )
// // SELECT
// // '{dt.Rows[0]["WARNING_CODE"]}',
// // '{dt.Rows[0]["WARNING_NAME"]}',
// // '{dt.Rows[0]["WARNING_TYPE"]}',
// // '{dt.Rows[0]["WARNING_MESSAGE"]}',
// // datetime('now', 'localtime'),
// // '{dt.Rows[0]["PLC_ITEM_CODE"]}',
// // 0,
// // 0,
// // 1,
// // datetime('now', 'localtime'),
// // 1,
// // datetime('now', 'localtime'),
// // 0
// // WHERE NOT EXISTS (SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}')
// // ";
// // LeadDbHelperSQLite.ExecuteSql(sql1);
// string sql = $@"SELECT * FROM BAS_WARNING WHERE PLC_ITEM_CODE is NULL and WARNING_CODE = '{i}' and WARNING_TYPE = '2'"; // // string sql2 = $@"
// DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0]; // //UPDATE CM_WARNING_LOG set UPDATE_TIME = datetime('now', 'localtime'),DATA_VERSION = DATA_VERSION + 1
// if (dt != null && dt.Rows.Count > 0) // // WHERE EXISTS(SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}') and WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}';
// // ";
// // LeadDbHelperSQLite.ExecuteSql(sql2);
// // }
// #endregion
// }
// else
// {//当前报警项没有报警
// Warning tmpMd = Global.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
// if (tmpMd != null)
// {//之前有报警,则结束当前报警项
// WarningLog warnLogTmp = Global.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == tmpMd.PlcItemCode);
// if (warnLogTmp != null)
// {
// warnLogTmp.UpdateTime = DateTime.Now;
// warnLogTmp.DataVersion += 1;
// warnLogTmp.WaringStatus = 1;
// warnLogTmp.WarningHandleResult = 1;
// warnLogTmp.WarningHandleTime = DateTime.Now;
// }
// }
// #region 已删除
// //string sql = $@"SELECT * FROM BAS_WARNING WHERE PLC_ITEM_CODE = '{priStr + (index + i)}' and WARNING_CODE = '{priWarnCode + i}' and WARNING_TYPE = '1'";
// //DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
// //if (dt != null && dt.Rows.Count > 0)
// //{
// // string sql2 = $@"
// // UPDATE CM_WARNING_LOG
// // SET UPDATE_TIME = datetime('now', 'localtime'),
// // DATA_VERSION = DATA_VERSION + 1,
// // WARING_STATUS = 1,
// // WARNING_HANDLE_RESULT = 1,
// // WARNING_HANDLE_TIME = datetime('now', 'localtime')
// // WHERE
// // EXISTS ( SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 AND WARNING_HANDLE_RESULT = 0 AND WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' AND PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}' )
// // AND WARING_STATUS = 0
// // AND WARNING_HANDLE_RESULT = 0
// // AND WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}'
// // AND PLC_ITEM_CODE = '{dt.Rows[0]["PLC_ITEM_CODE"]}';
// // ";
// // LeadDbHelperSQLite.ExecuteSql(sql2);
// //}
// #endregion
// }
// }
// }
// else if (i == 2)
// {
// //char[] tmpCharArr = Convert.ToString(tmpReadAlarmBytArr_D[i], 2).PadLeft(16, '0').Reverse().ToArray();
// //if (tmpCharArr.Contains('1'))
// //{
// // List<Bas_WarningMd> warnLst = new List<Bas_WarningMd>();
// // for (int j = 0; j < tmpCharArr.Length; j++)
// // {
// // if (tmpCharArr[j] == '1')
// // {
// // Bas_WarningMd tmpMd = GlobalHelper.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
// // if (tmpMd != null)
// // {
// // warnLst.Add(tmpMd);
// // }
// // }
// // }
// // GlobalHelper.ShowWarningMsg(warnLst, new EventArgs());
// //}
// }
// else if (i >= 3 && i <= 9)
// {//D13~D19报警
// if (tmpReadAlarmBytArr_D[i] == 0)
// {
// WarningLog warnLogTmp = Global.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.PlcItemCode == $"{priStr + (index + i)}");
// if (warnLogTmp != null)
// {
// warnLogTmp.UpdateTime = DateTime.Now;
// warnLogTmp.DataVersion += 1;
// warnLogTmp.WaringStatus = 1;
// warnLogTmp.WarningHandleResult = 1;
// warnLogTmp.WarningHandleTime = DateTime.Now;
// }
// #region 已删除
// //string sql2 = $@"
// // UPDATE CM_WARNING_LOG
// // SET UPDATE_TIME = datetime('now', 'localtime'),
// // DATA_VERSION = DATA_VERSION + 1,
// // WARING_STATUS = 1,
// // WARNING_HANDLE_RESULT = 1,
// // WARNING_HANDLE_TIME = datetime('now', 'localtime')
// // WHERE
// // EXISTS ( SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 AND WARNING_HANDLE_RESULT = 0 AND WARNING_CODE = '{i}' AND PLC_ITEM_CODE is NULL )
// // AND WARING_STATUS = 0
// // AND WARNING_HANDLE_RESULT = 0
// // AND WARNING_CODE = 'i'
// // AND PLC_ITEM_CODE is NULL;
// // ";
// //LeadDbHelperSQLite.ExecuteSql(sql2);
// #endregion
// }
// else
// {//根据报警编码,获取报警信息,根据读取顺序编号,组成PlcItemCode
// Warning tmpMd = Global.BasWarningMd_List.Find(x => string.IsNullOrEmpty(x.PlcItemCode) && x.WarningCode == tmpReadAlarmBytArr_D[i].ToString() && x.WarningType == "2");
// if (tmpMd != null)
// {
// WarningLog warnLogTmp = Global.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == $"{priStr + (index + i)}");
// if (warnLogTmp != null)
// {
// warnLogTmp.UpdateTime = DateTime.Now;
// warnLogTmp.DataVersion += 1;
// }
// else
// {
// Global.CmWarningLogMd_List.Add(new WarningLog
// {
// WarningCode = tmpMd.WarningCode,
// WarningName = tmpMd.WarningName,
// WarningType = tmpMd.WarningType,
// WarningMessage = tmpMd.WarningMessage,
// WarningTime = DateTime.Now,
// PlcItemCode = $"{priStr + (index + i)}",
// WaringStatus = 0,
// WarningHandleResult = 0,
// CreateBy = 1,
// CreateTime = DateTime.Now,
// UpdateBy = 1,
// UpdateTime = DateTime.Now,
// DataVersion = 0,
// });
// }
// }
// #region 已删除
// // string sql = $@"SELECT * FROM BAS_WARNING WHERE PLC_ITEM_CODE is NULL and WARNING_CODE = '{i}' and WARNING_TYPE = '2'";
// // DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
// // if (dt != null && dt.Rows.Count > 0)
// // {
// // string sql1 = $@"
// // INSERT INTO CM_WARNING_LOG (
// // WARNING_CODE,
// // WARNING_NAME,
// // WARNING_TYPE,
// // WARNING_MESSAGE,
// // WARNING_TIME,
// // PLC_ITEM_CODE,
// // WARING_STATUS,
// // WARNING_HANDLE_RESULT,
// // CREATE_BY,
// // CREATE_TIME,
// // UPDATE_BY,
// // UPDATE_TIME,
// // DATA_VERSION
// // )
// // SELECT
// // '{dt.Rows[0]["WARNING_CODE"]}',
// // '{dt.Rows[0]["WARNING_NAME"]}',
// // '{dt.Rows[0]["WARNING_TYPE"]}',
// // '{dt.Rows[0]["WARNING_MESSAGE"]}',
// // datetime('now', 'localtime'),
// // '{dt.Rows[0]["PLC_ITEM_CODE"]}',
// // 0,
// // 0,
// // 1,
// // datetime('now', 'localtime'),
// // 1,
// // datetime('now', 'localtime'),
// // 0
// // WHERE NOT EXISTS (SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE is NULL)
// // ";
// // LeadDbHelperSQLite.ExecuteSql(sql1);
// // string sql2 = $@"
// //UPDATE CM_WARNING_LOG set UPDATE_TIME = datetime('now', 'localtime'),DATA_VERSION = DATA_VERSION + 1
// // WHERE EXISTS(SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE is NULL) and WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and is NULL;
// // ";
// // LeadDbHelperSQLite.ExecuteSql(sql2);
// // }
// #endregion
// }
// }
// else if (i > 9)
// {
// break;
// }
// }
// List<WarningLog> tmpLst = Global.CmWarningLogMd_List.Values.FindAll(x => x.WarningHandleResult == 1 && x.WaringStatus == 1);
// if (tmpLst.Count >= 10)
// {
// foreach (WarningLog item in tmpLst)
// { // {
// string sql1 = $@" // string sql1 = $@"
// INSERT INTO CM_WARNING_LOG ( // INSERT INTO CM_WARNING_LOG (
@@ -784,107 +878,53 @@ namespace CleanMachineHMI
// PLC_ITEM_CODE, // PLC_ITEM_CODE,
// WARING_STATUS, // WARING_STATUS,
// WARNING_HANDLE_RESULT, // WARNING_HANDLE_RESULT,
// WARNING_HANDLE_TIME,
// CREATE_BY, // CREATE_BY,
// CREATE_TIME, // CREATE_TIME,
// UPDATE_BY, // UPDATE_BY,
// UPDATE_TIME, // UPDATE_TIME,
// DATA_VERSION // DATA_VERSION
// ) // )
// SELECT // VALUES (
// '{dt.Rows[0]["WARNING_CODE"]}', // '{item.WarningCode}',
// '{dt.Rows[0]["WARNING_NAME"]}', // '{item.WarningName}',
// '{dt.Rows[0]["WARNING_TYPE"]}', // '{item.WarningType}',
// '{dt.Rows[0]["WARNING_MESSAGE"]}', // '{item.WarningMessage}',
// datetime('now', 'localtime'), // '{item.WarningTime.ToString("yyyy-MM-dd HH:mm:ss")}',
// '{dt.Rows[0]["PLC_ITEM_CODE"]}', // '{item.PlcItemCode}',
// 0, // '{item.WaringStatus}',
// 0, // '{item.WarningHandleResult}',
// 1, // '{item.WarningHandleTime.ToString("yyyy-MM-dd HH:mm:ss")}',
// datetime('now', 'localtime'), // '{item.CreateBy}',
// 1, // '{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}',
// datetime('now', 'localtime'), // '{item.UpdateBy}',
// 0 // '{item.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")}',
// WHERE NOT EXISTS (SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE is NULL) // '{item.DataVersion}'
// );
// "; // ";
// LeadDbHelperSQLite.ExecuteSql(sql1); // LeadDbHelperSQLite.Execute(sql1);
// string sql2 = $@" // }
//UPDATE CM_WARNING_LOG set UPDATE_TIME = datetime('now', 'localtime'),DATA_VERSION = DATA_VERSION + 1 // Global.CmWarningLogMd_List.RemoveAll(x => x.WarningHandleResult == 1 && x.WaringStatus == 1);
// WHERE EXISTS(SELECT 1 FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and PLC_ITEM_CODE is NULL) and WARING_STATUS = 0 and WARNING_HANDLE_RESULT = 0 and WARNING_CODE = '{dt.Rows[0]["WARNING_CODE"]}' and is NULL;
// ";
// LeadDbHelperSQLite.ExecuteSql(sql2);
// } // }
#endregion
} // if (Global.CmWarningLogMd_List.FindAll(x => x.WarningHandleResult == 0 && x.WaringStatus == 0).Count > 0)
} // {
else if (i > 9) // //frmMainNew.Show_ptb_Alarm(true);
{ // ShowMainFrmAlarmMsg();
break; // }
} // else
} // {
// //frmMainNew.Show_ptb_Alarm(false);
List<WarningLog> tmpLst = Global.CmWarningLogMd_List.FindAll(x => x.WarningHandleResult == 1 && x.WaringStatus == 1); // ShowMainFrmAlarmMsg();
if (tmpLst.Count >= 10) // }
{ //#if RELEASE
foreach (WarningLog item in tmpLst) // }
{ // catch (Exception ex)
string sql1 = $@" // {
INSERT INTO CM_WARNING_LOG ( // LogHelper.WriteLog($"处理设备报警信息时发生异常:【{ex.Message}】", LogTypeEum.Err);
WARNING_CODE, // }
WARNING_NAME, //#endif
WARNING_TYPE, // }
WARNING_MESSAGE,
WARNING_TIME,
PLC_ITEM_CODE,
WARING_STATUS,
WARNING_HANDLE_RESULT,
WARNING_HANDLE_TIME,
CREATE_BY,
CREATE_TIME,
UPDATE_BY,
UPDATE_TIME,
DATA_VERSION
)
VALUES (
'{item.WarningCode}',
'{item.WarningName}',
'{item.WarningType}',
'{item.WarningMessage}',
'{item.WarningTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.PlcItemCode}',
'{item.WaringStatus}',
'{item.WarningHandleResult}',
'{item.WarningHandleTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.CreateBy}',
'{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.UpdateBy}',
'{item.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.DataVersion}'
);
";
LeadDbHelperSQLite.Execute(sql1);
}
Global.CmWarningLogMd_List.RemoveAll(x => x.WarningHandleResult == 1 && x.WaringStatus == 1);
}
if (Global.CmWarningLogMd_List.FindAll(x => x.WarningHandleResult == 0 && x.WaringStatus == 0).Count > 0)
{
//frmMainNew.Show_ptb_Alarm(true);
ShowMainFrmAlarmMsg();
}
else
{
//frmMainNew.Show_ptb_Alarm(false);
ShowMainFrmAlarmMsg();
}
#if RELEASE
}
catch (Exception ex)
{
LogHelper.WriteLog($"处理设备报警信息时发生异常:【{ex.Message}】", LogTypeEum.Err);
}
#endif
}
public void RefreshPlcItem_X(ref bool haschange) public void RefreshPlcItem_X(ref bool haschange)
{ {
@@ -899,7 +939,7 @@ namespace CleanMachineHMI
{ {
if (PlcItemMd_X_List != null && PlcItemMd_X_List.Count > 0) if (PlcItemMd_X_List != null && PlcItemMd_X_List.Count > 0)
{ {
foreach (PlcItem item in PlcItemMd_X_List) foreach (PlcItem item in PlcItemMd_X_List.Values)
{ {
string value = ""; string value = "";
if (!string.IsNullOrEmpty(item.PlcItemDeviationAddress)) if (!string.IsNullOrEmpty(item.PlcItemDeviationAddress))
@@ -960,7 +1000,7 @@ namespace CleanMachineHMI
{ {
if (PlcItemMd_Y_List != null && PlcItemMd_Y_List.Count > 0) if (PlcItemMd_Y_List != null && PlcItemMd_Y_List.Count > 0)
{ {
foreach (PlcItem item in PlcItemMd_Y_List) foreach (PlcItem item in PlcItemMd_Y_List.Values)
{ {
string value = ""; string value = "";
if (!string.IsNullOrEmpty(item.PlcItemDeviationAddress)) if (!string.IsNullOrEmpty(item.PlcItemDeviationAddress))
@@ -1003,7 +1043,11 @@ namespace CleanMachineHMI
public object ReadPlcItem(string plcItemCode) public object ReadPlcItem(string plcItemCode)
{ {
PlcItem item = PlcItemMdList.Find(x => x.PlcItemCode == plcItemCode); // PlcItem item = PlcItemMdList.Find(x => x.PlcItemCode == plcItemCode);
PlcItemMdList.TryGetValue(plcItemCode, out var item);
if (item == null) if (item == null)
{ {
return null; return null;
@@ -1057,8 +1101,8 @@ namespace CleanMachineHMI
switch (itemType) switch (itemType)
{ {
case PlcItemTypeDesc.M: case PlcItemTypeDesc.M:
PlcItemMd_M_List.TryGetValue(plcItemCode, out var item_M);
PlcItem item_M = PlcItemMd_M_List.Find(x => x.PlcItemCode == plcItemCode);
if (item_M == null) if (item_M == null)
{ {
return null; return null;
@@ -1073,7 +1117,8 @@ namespace CleanMachineHMI
} }
break; break;
case PlcItemTypeDesc.D: case PlcItemTypeDesc.D:
PlcItem item_D = PlcItemMd_D_List.Find(x => x.PlcItemCode == plcItemCode); PlcItemMd_D_List.TryGetValue(plcItemCode, out var item_D);
// PlcItem item_D = PlcItemMd_D_List.Find(x => x.PlcItemCode == plcItemCode);
if (item_D == null) if (item_D == null)
{ {
return null; return null;
@@ -1096,7 +1141,8 @@ namespace CleanMachineHMI
} }
break; break;
case PlcItemTypeDesc.X: case PlcItemTypeDesc.X:
PlcItem item_X = PlcItemMd_X_List.Find(x => x.PlcItemCode == plcItemCode); PlcItemMd_X_List.TryGetValue(plcItemCode, out var item_X);
//PlcItem item_X = PlcItemMd_X_List.Find(x => x.PlcItemCode == plcItemCode);
if (item_X == null) if (item_X == null)
{ {
return null; return null;
@@ -1111,7 +1157,8 @@ namespace CleanMachineHMI
} }
break; break;
case PlcItemTypeDesc.Y: case PlcItemTypeDesc.Y:
PlcItem item_Y = PlcItemMd_Y_List.Find(x => x.PlcItemCode == plcItemCode); PlcItemMd_Y_List.TryGetValue(plcItemCode, out var item_Y);
// PlcItem item_Y = PlcItemMd_Y_List.Find(x => x.PlcItemCode == plcItemCode);
if (item_Y == null) if (item_Y == null)
{ {
return null; return null;
@@ -1147,10 +1194,11 @@ namespace CleanMachineHMI
try try
{ {
#endif #endif
// if (!this.IsConn) return false;
switch (itemType) switch (itemType)
{ {
case PlcItemTypeDesc.M: case PlcItemTypeDesc.M:
PlcItem item_M = PlcItemMd_M_List.Find(x => x.PlcItemCode == plcItemCode); PlcItemMd_M_List.TryGetValue(plcItemCode, out var item_M);
if (item_M == null) if (item_M == null)
{ {
return false; return false;
@@ -1158,7 +1206,8 @@ namespace CleanMachineHMI
master.WriteSingleCoil(slaveAddress, Convert.ToUInt16(item_M.PlcItemModbusAddress), bool.Parse(writeValue)); master.WriteSingleCoil(slaveAddress, Convert.ToUInt16(item_M.PlcItemModbusAddress), bool.Parse(writeValue));
return true; return true;
case PlcItemTypeDesc.Y: case PlcItemTypeDesc.Y:
PlcItem item_Y = PlcItemMd_Y_List.Find(x => x.PlcItemCode == plcItemCode); PlcItemMd_Y_List.TryGetValue(plcItemCode, out var item_Y);
if (item_Y == null) if (item_Y == null)
{ {
return false; return false;
@@ -1166,7 +1215,7 @@ namespace CleanMachineHMI
master.WriteSingleCoil(slaveAddress, Convert.ToUInt16(item_Y.PlcItemModbusAddress), bool.Parse(writeValue)); master.WriteSingleCoil(slaveAddress, Convert.ToUInt16(item_Y.PlcItemModbusAddress), bool.Parse(writeValue));
return true; return true;
case PlcItemTypeDesc.D: case PlcItemTypeDesc.D:
PlcItem item_D = PlcItemMd_D_List.Find(x => x.PlcItemCode == plcItemCode); PlcItemMd_D_List.TryGetValue(plcItemCode, out var item_D);
if (item_D == null) if (item_D == null)
{ {
return false; return false;
@@ -1273,7 +1322,7 @@ namespace CleanMachineHMI
#if UseHeartbeat #if UseHeartbeat
if (DateTime.Now > HeartbeatTime.AddSeconds(5))//心跳超时 if (DateTime.Now > HeartbeatTime.AddSeconds(10))//心跳超时
{ {
IsConn = false; IsConn = false;
//报警处理。 //报警处理。

View File

@@ -4,6 +4,7 @@ using Krypton.Toolkit;
using LeadDataBaseUtility; using LeadDataBaseUtility;
using Newtonsoft.Json; using Newtonsoft.Json;
using NX_LogUtility; using NX_LogUtility;
using Scriban;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
@@ -21,7 +22,10 @@ namespace CleanMachineHMI.Utils
/// </summary> /// </summary>
public static class frmUtil public static class frmUtil
{ {
public static List<ThemeLanguage> znCNLang = new List<ThemeLanguage>(); /// <summary>
/// 新增的翻译
/// </summary>
public static List<ThemeLanguage> _newlyLang = new List<ThemeLanguage>();
/// <summary> /// <summary>
/// 给一个字符串进行MD5加密 /// 给一个字符串进行MD5加密
@@ -148,18 +152,28 @@ namespace CleanMachineHMI.Utils
/// <param name="languageCode">语言编码</param> /// <param name="languageCode">语言编码</param>
public static void SetFormControlText(this Control form) public static void SetFormControlText(this Control form)
{ {
try //try
{ //{
var lstControls = GetAllControls(form); var lstControls = GetAllControls(form);
lstControls.Add(form); lstControls.Add(form);
foreach (Control item in lstControls) foreach (Control item in lstControls)
{ {
var key = form.Name + "|" + item.Name;
if (!Global.ThemeLanguage.ContainsKey(key)) if (item is KryptonDateTimePicker)
{ {
continue; continue;
} }
var key = form.Name + "|" + item.Name;
if (!Global.ThemeLanguage.ContainsKey(key))
{
AddzhCN(key, item.Text, ""); AddzhCN(key, item.Text, "");
continue;
}
if (item is KryptonGroupBox) if (item is KryptonGroupBox)
{ {
((KryptonGroupBox)item).Values.Heading = Global.ThemeLanguage[key]; ((KryptonGroupBox)item).Values.Heading = Global.ThemeLanguage[key];
@@ -171,31 +185,39 @@ namespace CleanMachineHMI.Utils
} }
} //}
catch (Exception ex) //catch (Exception ex)
{ //{
LogHelper.WriteLog(ex.Message, LogTypeEum.Err); // LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
} //}
} }
public static void SetSingleControlText(this Control form, Control control) public static void SetSingleControlText(this Control form, Control control)
{ {
#if RELEASE
try try
{ {
#endif
var key = form.Name + "|" + control.Name; var key = form.Name + "|" + control.Name;
if (!Global.ThemeLanguage.ContainsKey(key)) if (!Global.ThemeLanguage.ContainsKey(key))
{ {
AddzhCN(key, control.Text, "");
control.Text = control.Name; control.Text = control.Name;
} }
AddzhCN(key, control.Text, ""); else
{
control.Text = Global.ThemeLanguage[key]; control.Text = Global.ThemeLanguage[key];
}
#if RELEASE
} }
catch (Exception ex) catch (Exception ex)
{ {
LogHelper.WriteLog(ex.Message, LogTypeEum.Err); LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
} }
#endif
} }
/// <summary> /// <summary>
@@ -213,9 +235,10 @@ namespace CleanMachineHMI.Utils
var key = formName + "|" + item.Name; var key = formName + "|" + item.Name;
if (!Global.ThemeLanguage.ContainsKey(key)) if (!Global.ThemeLanguage.ContainsKey(key))
{ {
AddzhCN(key, item.HeaderText, "");
continue; continue;
} }
AddzhCN(key, item.HeaderText, "");
item.HeaderText = Global.ThemeLanguage[key]; item.HeaderText = Global.ThemeLanguage[key];
} }
} }
@@ -226,6 +249,37 @@ namespace CleanMachineHMI.Utils
} }
public static string T(this Control form, string defaultValue, string infoCode, object Param)
{
try
{
var key = form.Name + "|" + infoCode;
var result = defaultValue;
if (!Global.ThemeLanguage.ContainsKey(key))
{
AddzhCN(key, defaultValue, "");
}
else
{
result = Global.ThemeLanguage[key];
}
var template = Template.Parse(result);
return template.Render(Param);
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.Message, LogTypeEum.Err);
return null;
}
}
/// <summary> /// <summary>
/// 获取信息文本 /// 获取信息文本
/// </summary> /// </summary>
@@ -239,11 +293,12 @@ namespace CleanMachineHMI.Utils
var key = form.Name + "|" + infoCode; var key = form.Name + "|" + infoCode;
if (!Global.ThemeLanguage.ContainsKey(key)) if (!Global.ThemeLanguage.ContainsKey(key))
{ {
AddzhCN(key, defaultValue, "");
return defaultValue; return defaultValue;
} }
else else
{ {
AddzhCN(key, defaultValue, "");
return Global.ThemeLanguage[key]; return Global.ThemeLanguage[key];
} }
} }
@@ -261,6 +316,14 @@ namespace CleanMachineHMI.Utils
var key = form.Name + "|" + controlCode; var key = form.Name + "|" + controlCode;
if (!Global.ThemeLanguage.ContainsKey(key)) if (!Global.ThemeLanguage.ContainsKey(key))
{ {
var control = (KryptonComboBox)form.Controls.Find(controlCode, true)[0];
var str = "";
foreach (var item in control.Items)
{
str += $"{item},";
}
AddzhCN(key, "", string.IsNullOrEmpty(str) ? Global.ThemeLanguage[key] : str.TrimEnd(new char[] { ',' }));
return new List<string>(); return new List<string>();
} }
else else
@@ -343,26 +406,34 @@ namespace CleanMachineHMI.Utils
private static void AddzhCN(string key, string name, string options) private static void AddzhCN(string key, string name, string options)
{ {
#if DEBUG
if (string.IsNullOrEmpty(name) && string.IsNullOrEmpty(options)) if (string.IsNullOrEmpty(name) && string.IsNullOrEmpty(options))
{ {
Console.WriteLine(key + "空"); Console.WriteLine(key + "空");
return; return;
} }
var codes = key.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries); var codes = key.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
if (codes.Length != 2)
if (znCNLang.Any(x => x.formCode == codes[0] && x.controlCode == codes[1]))
{ {
return; return;
} }
znCNLang.Add(new ThemeLanguage if (Global.ThemeLanguage.ContainsKey(key))
{
return;
}
_newlyLang.Add(new ThemeLanguage
{ {
formCode = codes[0], formCode = codes[0],
controlCode = codes[1], controlCode = codes[1],
controlName = string.IsNullOrEmpty(options) ? name : null, controlName = string.IsNullOrEmpty(options) ? name : null,
options = string.IsNullOrEmpty(options) ? null : options.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(), options = string.IsNullOrEmpty(options) ? null : options.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList(),
}); });
var str1 = Newtonsoft.Json.JsonConvert.SerializeObject(znCNLang); var str1 = Newtonsoft.Json.JsonConvert.SerializeObject(_newlyLang);
WriteLangFile("zh-CN.json", str1); WriteLangFile("newly.json", str1);
#endif
} }
} }

View File

@@ -149,7 +149,7 @@ namespace CleanMachineHMI
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0) if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
{ {
//List<BasPlcItemMd> tempLst = AppConfig.PlcItemMd_X_List.FindAll(x => x.PlcItemName != "备用").OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); //List<BasPlcItemMd> tempLst = AppConfig.PlcItemMd_X_List.FindAll(x => x.PlcItemName != "备用").OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
int dataSum = tempLst.Count; int dataSum = tempLst.Count;
int rowNum; int rowNum;
if (dataSum % 2 == 0) if (dataSum % 2 == 0)
@@ -265,7 +265,7 @@ namespace CleanMachineHMI
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0) if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
{ {
//List<BasPlcItemMd> tempLst = AppConfig.PlcItemMd_Y_List.FindAll(x => x.PlcItemName != "备用").OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); //List<BasPlcItemMd> tempLst = AppConfig.PlcItemMd_Y_List.FindAll(x => x.PlcItemName != "备用").OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
int dataSum = tempLst.Count; int dataSum = tempLst.Count;
//int dataSum = AppConfig.PlcItemMd_Y_List.Count; //int dataSum = AppConfig.PlcItemMd_Y_List.Count;
int rowNum; int rowNum;

View File

@@ -171,7 +171,7 @@ namespace CleanMachineHMI
{ {
if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0) if (PlcOperationHelper.Instance.PlcItemMd_X_List != null && PlcOperationHelper.Instance.PlcItemMd_X_List.Count > 0)
{ {
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_X_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst) foreach (PlcItem item in tempLst)
{ {
Invoke(new Action(() => Invoke(new Action(() =>
@@ -188,7 +188,7 @@ namespace CleanMachineHMI
if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0) if (PlcOperationHelper.Instance.PlcItemMd_Y_List != null && PlcOperationHelper.Instance.PlcItemMd_Y_List.Count > 0)
{ {
List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList(); List<PlcItem> tempLst = PlcOperationHelper.Instance.PlcItemMd_Y_List.Values.OrderBy(x => Convert.ToInt32(x.PlcItemPriAddress)).ToList();
foreach (PlcItem item in tempLst) foreach (PlcItem item in tempLst)
{ {
Invoke(new Action(() => Invoke(new Action(() =>
@@ -223,7 +223,7 @@ namespace CleanMachineHMI
string plcItemNameAddress = pic.Name.Replace("picb_", ""); string plcItemNameAddress = pic.Name.Replace("picb_", "");
if (plcItemNameAddress.StartsWith("M")) if (plcItemNameAddress.StartsWith("M"))
{ {
PlcItem tmpPlc = PlcOperationHelper.Instance.PlcItemMd_M_List.First(x => x.PlcItemPriAddress == plcItemNameAddress.Replace("M", "")); PlcItem tmpPlc = PlcOperationHelper.Instance.PlcItemMd_M_List.Values.First(x => x.PlcItemPriAddress == plcItemNameAddress.Replace("M", ""));
if (tmpPlc != null) if (tmpPlc != null)
{ {
ttp.SetToolTip(pic, tmpPlc.PlcItemName); ttp.SetToolTip(pic, tmpPlc.PlcItemName);
@@ -231,7 +231,7 @@ namespace CleanMachineHMI
} }
else else
{ {
PlcItem tmpPlc = PlcOperationHelper.Instance.PlcItemMd_X_List.First(x => x.PlcItemPriAddress == Convert.ToInt32(plcItemNameAddress.Replace("X", ""), 10).ToString()); PlcItem tmpPlc = PlcOperationHelper.Instance.PlcItemMd_X_List.Values.First(x => x.PlcItemPriAddress == Convert.ToInt32(plcItemNameAddress.Replace("X", ""), 10).ToString());
if (tmpPlc != null) if (tmpPlc != null)
{ {
ttp.SetToolTip(pic, tmpPlc.PlcItemName); ttp.SetToolTip(pic, tmpPlc.PlcItemName);

View File

@@ -59,7 +59,7 @@ namespace CleanMachineHMI
KryptonMessageBox.Show(this.T("用户已被停用!", "UserStop"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); KryptonMessageBox.Show(this.T("用户已被停用!", "UserStop"), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
return; return;
} }
if (_user.Password.ToLower() != _user.Password.ToLower()) if (_user.Password.ToLower() != txtPs.Text.ToLower())
{ {
KryptonMessageBox.Show(this.T("输入密码错误!", "PasswordFail")); KryptonMessageBox.Show(this.T("输入密码错误!", "PasswordFail"));
return; return;
@@ -97,10 +97,12 @@ namespace CleanMachineHMI
// GlobalHelper.RoleMenuPermission = LeadDbHelperSQLite.Query(sql).Tables[0]; // GlobalHelper.RoleMenuPermission = LeadDbHelperSQLite.Query(sql).Tables[0];
Global.RoleMenuPermission = new CleanMachine.BLL.SYS.RoleMenuPermissionBLL().GetList(_user.RoleId).ToList(); Global.RoleMenuPermission = new CleanMachine.BLL.SYS.RoleMenuPermissionBLL().GetList(_user.RoleId).ToList();
if (Global.MainFormNew == null)
{
Global.MainFormNew = new frmMainNew(); Global.MainFormNew = new frmMainNew();
}
Global.MainFormNew.Show(); Global.MainFormNew.Show();
} }
else else
{ {

View File

@@ -45,6 +45,7 @@
this.MainDetail = new Krypton.Navigator.KryptonPage(); this.MainDetail = new Krypton.Navigator.KryptonPage();
this.kryptonManager = new Krypton.Toolkit.KryptonManager(this.components); this.kryptonManager = new Krypton.Toolkit.KryptonManager(this.components);
this.timer = new System.Windows.Forms.Timer(this.components); this.timer = new System.Windows.Forms.Timer(this.components);
this.buttonSpecAny1 = new Krypton.Toolkit.ButtonSpecAny();
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit();
this.kryptonGroupBox1.Panel.SuspendLayout(); this.kryptonGroupBox1.Panel.SuspendLayout();
@@ -59,7 +60,10 @@
// kryptonGroupBox1 // kryptonGroupBox1
// //
this.kryptonGroupBox1.CaptionOverlap = 0D; this.kryptonGroupBox1.CaptionOverlap = 0D;
this.kryptonGroupBox1.CaptionStyle = Krypton.Toolkit.LabelStyle.GroupBoxCaption;
this.kryptonGroupBox1.Dock = System.Windows.Forms.DockStyle.Top; this.kryptonGroupBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.kryptonGroupBox1.GroupBackStyle = Krypton.Toolkit.PaletteBackStyle.ControlGroupBox;
this.kryptonGroupBox1.GroupBorderStyle = Krypton.Toolkit.PaletteBorderStyle.ControlGroupBox;
this.kryptonGroupBox1.Location = new System.Drawing.Point(0, 0); this.kryptonGroupBox1.Location = new System.Drawing.Point(0, 0);
this.kryptonGroupBox1.Name = "kryptonGroupBox1"; this.kryptonGroupBox1.Name = "kryptonGroupBox1";
// //
@@ -135,6 +139,8 @@
this.btnExit.Name = "btnExit"; this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(107, 45); this.btnExit.Size = new System.Drawing.Size(107, 45);
this.btnExit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnExit.StateCommon.Content.ShortText.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnExit.StateCommon.Content.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.btnExit.StateCommon.Content.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.btnExit.TabIndex = 13; this.btnExit.TabIndex = 13;
this.btnExit.Values.Text = "返回"; this.btnExit.Values.Text = "返回";
this.btnExit.Visible = false; this.btnExit.Visible = false;
@@ -148,16 +154,21 @@
this.lbSysAlreadyRunning.Name = "lbSysAlreadyRunning"; this.lbSysAlreadyRunning.Name = "lbSysAlreadyRunning";
this.lbSysAlreadyRunning.Size = new System.Drawing.Size(112, 20); this.lbSysAlreadyRunning.Size = new System.Drawing.Size(112, 20);
this.lbSysAlreadyRunning.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbSysAlreadyRunning.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbSysAlreadyRunning.StateCommon.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.lbSysAlreadyRunning.StateCommon.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.lbSysAlreadyRunning.TabIndex = 8; this.lbSysAlreadyRunning.TabIndex = 8;
this.lbSysAlreadyRunning.Values.Text = "系统运行时间:"; this.lbSysAlreadyRunning.Values.Text = "系统运行时间:";
// //
// label3Professional // label3Professional
// //
this.label3Professional.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label3Professional.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label3Professional.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel;
this.label3Professional.Location = new System.Drawing.Point(885, 23); this.label3Professional.Location = new System.Drawing.Point(885, 23);
this.label3Professional.Name = "label3Professional"; this.label3Professional.Name = "label3Professional";
this.label3Professional.Size = new System.Drawing.Size(112, 22); this.label3Professional.Size = new System.Drawing.Size(112, 22);
this.label3Professional.StateCommon.ShortText.Font = new System.Drawing.Font("Verdana", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label3Professional.StateCommon.ShortText.Font = new System.Drawing.Font("Verdana", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3Professional.StateCommon.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.label3Professional.StateCommon.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.label3Professional.TabIndex = 7; this.label3Professional.TabIndex = 7;
this.label3Professional.Values.Image = global::CleanMachineHMI.Properties.Resources.conn; this.label3Professional.Values.Image = global::CleanMachineHMI.Properties.Resources.conn;
this.label3Professional.Values.Text = "通讯已连接"; this.label3Professional.Values.Text = "通讯已连接";
@@ -170,62 +181,91 @@
this.lbSysTime.Name = "lbSysTime"; this.lbSysTime.Name = "lbSysTime";
this.lbSysTime.Size = new System.Drawing.Size(83, 20); this.lbSysTime.Size = new System.Drawing.Size(83, 20);
this.lbSysTime.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbSysTime.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbSysTime.StateCommon.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.lbSysTime.StateCommon.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.lbSysTime.TabIndex = 4; this.lbSysTime.TabIndex = 4;
this.lbSysTime.Values.Text = "系统时间:"; this.lbSysTime.Values.Text = "系统时间:";
// //
// kryptonLabel1 // kryptonLabel1
// //
this.kryptonLabel1.Location = new System.Drawing.Point(804, 47); this.kryptonLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.kryptonLabel1.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel;
this.kryptonLabel1.Location = new System.Drawing.Point(829, 47);
this.kryptonLabel1.Name = "kryptonLabel1"; this.kryptonLabel1.Name = "kryptonLabel1";
this.kryptonLabel1.PaletteMode = Krypton.Toolkit.PaletteMode.ProfessionalSystem; this.kryptonLabel1.PaletteMode = Krypton.Toolkit.PaletteMode.ProfessionalSystem;
this.kryptonLabel1.Size = new System.Drawing.Size(82, 23); this.kryptonLabel1.Size = new System.Drawing.Size(82, 23);
this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.kryptonLabel1.StateCommon.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.kryptonLabel1.StateCommon.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.kryptonLabel1.StateNormal.Image.Effect = Krypton.Toolkit.PaletteImageEffect.Inherit;
this.kryptonLabel1.StateNormal.Image.ImageH = Krypton.Toolkit.PaletteRelativeAlign.Far; this.kryptonLabel1.StateNormal.Image.ImageH = Krypton.Toolkit.PaletteRelativeAlign.Far;
this.kryptonLabel1.StateNormal.LongText.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.kryptonLabel1.StateNormal.LongText.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.kryptonLabel1.StateNormal.LongText.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.kryptonLabel1.StateNormal.LongText.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.kryptonLabel1.StateNormal.LongText.ColorAngle = 45F; this.kryptonLabel1.StateNormal.LongText.ColorAngle = 45F;
this.kryptonLabel1.StateNormal.LongText.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Sigma; this.kryptonLabel1.StateNormal.LongText.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Sigma;
this.kryptonLabel1.StateNormal.LongText.Font = new System.Drawing.Font("Verdana", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.kryptonLabel1.StateNormal.LongText.Font = new System.Drawing.Font("Verdana", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel1.StateNormal.LongText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.kryptonLabel1.StateNormal.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.kryptonLabel1.StateNormal.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center;
this.kryptonLabel1.StateNormal.LongText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.kryptonLabel1.StateNormal.ShortText.Color1 = System.Drawing.Color.Blue; this.kryptonLabel1.StateNormal.ShortText.Color1 = System.Drawing.Color.Blue;
this.kryptonLabel1.StateNormal.ShortText.Color2 = System.Drawing.Color.MidnightBlue; this.kryptonLabel1.StateNormal.ShortText.Color2 = System.Drawing.Color.MidnightBlue;
this.kryptonLabel1.StateNormal.ShortText.ColorAngle = 45F; this.kryptonLabel1.StateNormal.ShortText.ColorAngle = 45F;
this.kryptonLabel1.StateNormal.ShortText.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Sigma; this.kryptonLabel1.StateNormal.ShortText.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Sigma;
this.kryptonLabel1.StateNormal.ShortText.Font = new System.Drawing.Font("Verdana", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.kryptonLabel1.StateNormal.ShortText.Font = new System.Drawing.Font("Verdana", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.kryptonLabel1.StateNormal.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.kryptonLabel1.StateNormal.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.kryptonLabel1.TabIndex = 3; this.kryptonLabel1.TabIndex = 3;
this.kryptonLabel1.Values.Text = "0 Minutes"; this.kryptonLabel1.Values.Text = "0 Minutes";
// //
// lbNow // lbNow
// //
this.lbNow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lbNow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lbNow.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel;
this.lbNow.Location = new System.Drawing.Point(804, 1); this.lbNow.Location = new System.Drawing.Point(804, 1);
this.lbNow.Name = "lbNow"; this.lbNow.Name = "lbNow";
this.lbNow.PaletteMode = Krypton.Toolkit.PaletteMode.ProfessionalSystem; this.lbNow.PaletteMode = Krypton.Toolkit.PaletteMode.ProfessionalSystem;
this.lbNow.Size = new System.Drawing.Size(171, 23); this.lbNow.Size = new System.Drawing.Size(171, 23);
this.lbNow.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lbNow.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbNow.StateCommon.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.lbNow.StateCommon.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.lbNow.StateNormal.Image.Effect = Krypton.Toolkit.PaletteImageEffect.Inherit;
this.lbNow.StateNormal.Image.ImageH = Krypton.Toolkit.PaletteRelativeAlign.Far; this.lbNow.StateNormal.Image.ImageH = Krypton.Toolkit.PaletteRelativeAlign.Far;
this.lbNow.StateNormal.LongText.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); this.lbNow.StateNormal.LongText.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.lbNow.StateNormal.LongText.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.lbNow.StateNormal.LongText.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.lbNow.StateNormal.LongText.ColorAngle = 45F; this.lbNow.StateNormal.LongText.ColorAngle = 45F;
this.lbNow.StateNormal.LongText.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Sigma; this.lbNow.StateNormal.LongText.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Sigma;
this.lbNow.StateNormal.LongText.Font = new System.Drawing.Font("Verdana", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbNow.StateNormal.LongText.Font = new System.Drawing.Font("Verdana", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbNow.StateNormal.LongText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.lbNow.StateNormal.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; this.lbNow.StateNormal.LongText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center;
this.lbNow.StateNormal.LongText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.lbNow.StateNormal.ShortText.Color1 = System.Drawing.Color.Blue; this.lbNow.StateNormal.ShortText.Color1 = System.Drawing.Color.Blue;
this.lbNow.StateNormal.ShortText.Color2 = System.Drawing.Color.MidnightBlue; this.lbNow.StateNormal.ShortText.Color2 = System.Drawing.Color.MidnightBlue;
this.lbNow.StateNormal.ShortText.ColorAngle = 45F; this.lbNow.StateNormal.ShortText.ColorAngle = 45F;
this.lbNow.StateNormal.ShortText.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Sigma; this.lbNow.StateNormal.ShortText.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Sigma;
this.lbNow.StateNormal.ShortText.Font = new System.Drawing.Font("Verdana", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbNow.StateNormal.ShortText.Font = new System.Drawing.Font("Verdana", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbNow.StateNormal.ShortText.ImageStyle = Krypton.Toolkit.PaletteImageStyle.Inherit;
this.lbNow.StateNormal.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near; this.lbNow.StateNormal.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Near;
this.lbNow.StateNormal.ShortText.Trim = Krypton.Toolkit.PaletteTextTrim.Inherit;
this.lbNow.TabIndex = 3; this.lbNow.TabIndex = 3;
this.lbNow.Values.Text = "2020-02-02 22:00:00\r\n"; this.lbNow.Values.Text = "2020-02-02 22:00:00\r\n";
// //
// kryptonNavigator1 // kryptonNavigator1
// //
this.kryptonNavigator1.Button.ButtonDisplayLogic = Krypton.Navigator.ButtonDisplayLogic.ContextNextPrevious; this.kryptonNavigator1.Button.ButtonDisplayLogic = Krypton.Navigator.ButtonDisplayLogic.ContextNextPrevious;
this.kryptonNavigator1.Button.CloseButtonAction = Krypton.Navigator.CloseButtonAction.RemovePageAndDispose;
this.kryptonNavigator1.Button.CloseButtonDisplay = Krypton.Navigator.ButtonDisplay.Hide; this.kryptonNavigator1.Button.CloseButtonDisplay = Krypton.Navigator.ButtonDisplay.Hide;
this.kryptonNavigator1.Button.ContextButtonAction = Krypton.Navigator.ContextButtonAction.SelectPage;
this.kryptonNavigator1.Button.ContextButtonDisplay = Krypton.Navigator.ButtonDisplay.Logic;
this.kryptonNavigator1.Button.ContextMenuMapImage = Krypton.Navigator.MapKryptonPageImage.Small;
this.kryptonNavigator1.Button.ContextMenuMapText = Krypton.Navigator.MapKryptonPageText.TextTitle;
this.kryptonNavigator1.Button.NextButtonAction = Krypton.Navigator.DirectionButtonAction.ModeAppropriateAction;
this.kryptonNavigator1.Button.NextButtonDisplay = Krypton.Navigator.ButtonDisplay.Logic;
this.kryptonNavigator1.Button.PreviousButtonAction = Krypton.Navigator.DirectionButtonAction.ModeAppropriateAction;
this.kryptonNavigator1.Button.PreviousButtonDisplay = Krypton.Navigator.ButtonDisplay.Logic;
this.kryptonNavigator1.Dock = System.Windows.Forms.DockStyle.Fill; this.kryptonNavigator1.Dock = System.Windows.Forms.DockStyle.Fill;
this.kryptonNavigator1.Location = new System.Drawing.Point(0, 79); this.kryptonNavigator1.Location = new System.Drawing.Point(0, 79);
this.kryptonNavigator1.Name = "kryptonNavigator1"; this.kryptonNavigator1.Name = "kryptonNavigator1";
this.kryptonNavigator1.NavigatorMode = Krypton.Navigator.NavigatorMode.BarTabGroup;
this.kryptonNavigator1.Pages.AddRange(new Krypton.Navigator.KryptonPage[] { this.kryptonNavigator1.Pages.AddRange(new Krypton.Navigator.KryptonPage[] {
this.MainDetail}); this.MainDetail});
this.kryptonNavigator1.SelectedIndex = 0; this.kryptonNavigator1.SelectedIndex = 0;
@@ -236,11 +276,13 @@
// MainDetail // MainDetail
// //
this.MainDetail.AutoHiddenSlideSize = new System.Drawing.Size(200, 200); this.MainDetail.AutoHiddenSlideSize = new System.Drawing.Size(200, 200);
this.MainDetail.ButtonSpecs.AddRange(new Krypton.Toolkit.ButtonSpecAny[] {
((Krypton.Toolkit.ButtonSpecAny)(this.buttonSpecAny1))});
this.MainDetail.Flags = 65534; this.MainDetail.Flags = 65534;
this.MainDetail.LastVisibleSet = true; this.MainDetail.LastVisibleSet = true;
this.MainDetail.MinimumSize = new System.Drawing.Size(50, 50); this.MainDetail.MinimumSize = new System.Drawing.Size(50, 50);
this.MainDetail.Name = "MainDetail"; this.MainDetail.Name = "MainDetail";
this.MainDetail.Size = new System.Drawing.Size(1006, 623); this.MainDetail.Size = new System.Drawing.Size(1006, 615);
this.MainDetail.Text = "MainDetail"; this.MainDetail.Text = "MainDetail";
this.MainDetail.ToolTipTitle = "Page ToolTip"; this.MainDetail.ToolTipTitle = "Page ToolTip";
this.MainDetail.UniqueName = "0E1DA5225D8D4CFC70A2EFA8667116CC"; this.MainDetail.UniqueName = "0E1DA5225D8D4CFC70A2EFA8667116CC";
@@ -254,14 +296,19 @@
this.timer.Interval = 1000; this.timer.Interval = 1000;
this.timer.Tick += new System.EventHandler(this.timer_Tick); this.timer.Tick += new System.EventHandler(this.timer_Tick);
// //
// buttonSpecAny1
//
this.buttonSpecAny1.Enabled = Krypton.Toolkit.ButtonEnabled.False;
this.buttonSpecAny1.Style = Krypton.Toolkit.PaletteButtonStyle.FormClose;
this.buttonSpecAny1.Type = Krypton.Toolkit.PaletteButtonSpecStyle.FormClose;
this.buttonSpecAny1.UniqueName = "b98969b28fc84ecca8db41d2f99b165b";
//
// frmMainNew // frmMainNew
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1008, 729); this.ClientSize = new System.Drawing.Size(1008, 729);
this.Controls.Add(this.kryptonNavigator1); this.Controls.Add(this.kryptonNavigator1);
this.Controls.Add(this.kryptonGroupBox1); this.Controls.Add(this.kryptonGroupBox1);
this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "frmMainNew"; this.Name = "frmMainNew";
this.ShowIcon = false; this.ShowIcon = false;
@@ -301,5 +348,6 @@
private Krypton.Navigator.KryptonNavigator kryptonNavigator1; private Krypton.Navigator.KryptonNavigator kryptonNavigator1;
private Krypton.Navigator.KryptonPage MainDetail; private Krypton.Navigator.KryptonPage MainDetail;
public Krypton.Toolkit.KryptonLabel kryptonLabel1; public Krypton.Toolkit.KryptonLabel kryptonLabel1;
private Krypton.Toolkit.ButtonSpecAny buttonSpecAny1;
} }
} }

View File

@@ -172,8 +172,11 @@ namespace CleanMachineHMI
private void frmMainNew_Load(object sender, EventArgs e) private void frmMainNew_Load(object sender, EventArgs e)
{ {
#if RELEASE
try try
{ {
#endif
this.SetFormControlText(); this.SetFormControlText();
SwitchFrmMenu = new dlgSwitchFrmMenu(AddFrmMenuPage); SwitchFrmMenu = new dlgSwitchFrmMenu(AddFrmMenuPage);
@@ -309,11 +312,14 @@ namespace CleanMachineHMI
RemoveMaintainingFlag = new dlgShowMessage(ClearMaintainingFlag); RemoveMaintainingFlag = new dlgShowMessage(ClearMaintainingFlag);
timer.Enabled = true; timer.Enabled = true;
InitControl(); InitControl();
#if RELEASE
} }
catch (Exception ex) catch (Exception ex)
{ {
KryptonMessageBox.Show(ex.Message); KryptonMessageBox.Show(ex.Message);
} }
#endif
} }
private void ClearMaintainingFlag() private void ClearMaintainingFlag()
{ {
@@ -325,7 +331,13 @@ namespace CleanMachineHMI
private void ShowWarningMsg() private void ShowWarningMsg()
{ {
PlcItem item = PlcOperationHelper.Instance.PlcItemMd_D_List.FirstOrDefault(x => x.PlcItemCode == "AlarmPopUpMsg"); if (!PlcOperationHelper.Instance.PlcItemMd_D_List.TryGetValue("AlarmPopUpMsg", out var item))
{
return;
}
// PlcItem item = PlcOperationHelper.Instance.PlcItemMd_D_List.FirstOrDefault(x => x.PlcItemCode == "AlarmPopUpMsg");
char[] tmpCharArr = Convert.ToString(Convert.ToInt32(item.PlcItemValue), 2).PadLeft(16, '0').Reverse().ToArray(); char[] tmpCharArr = Convert.ToString(Convert.ToInt32(item.PlcItemValue), 2).PadLeft(16, '0').Reverse().ToArray();
if (tmpCharArr.Contains('1')) if (tmpCharArr.Contains('1'))
{ {
@@ -371,7 +383,7 @@ namespace CleanMachineHMI
private void ShowPicAlarm() private void ShowPicAlarm()
{ {
ptb_Alarm.Visible = Global.CmWarningLogMd_List.Count > 0; ptb_Alarm.Visible = PlcOperationHelper.Instance.CmWarningLogMd_List.Count > 0;
//Invoke(new Action(() => //Invoke(new Action(() =>
//{ //{
@@ -404,34 +416,34 @@ namespace CleanMachineHMI
// } // }
//} //}
Global.BasWarningMd_List = new CleanMachine.BLL.BAS.WarningBLL().GetList("").ToList(); Global.BasWarningMd_List = new CleanMachine.BLL.BAS.WarningBLL().GetList("").ToList();
Global.CmWarningLogMd_List = new List<WarningLog>(); //Global.CmWarningLogMd_List = new Dictionary<string, WarningLog>();
string sql1 = $@"SELECT * FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 AND WARNING_HANDLE_RESULT =0"; //string sql1 = $@"SELECT * FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 AND WARNING_HANDLE_RESULT =0";
DataTable dt1 = LeadDbHelperSQLite.Query(sql1).Tables[0]; //DataTable dt1 = LeadDbHelperSQLite.Query(sql1).Tables[0];
if (dt1 != null && dt1.Rows.Count > 0) //if (dt1 != null && dt1.Rows.Count > 0)
{ //{
foreach (DataRow item in dt1.Rows) // foreach (DataRow item in dt1.Rows)
{ // {
Global.CmWarningLogMd_List.Add(new WarningLog // Global.CmWarningLogMd_List.Add(,new WarningLog
{ // {
WarningCode = item["WARNING_CODE"].ToString(), // WarningCode = item["WARNING_CODE"].ToString(),
WarningName = item["WARNING_NAME"].ToString(), // WarningName = item["WARNING_NAME"].ToString(),
WarningType = item["WARNING_TYPE"].ToString(), // WarningType = item["WARNING_TYPE"].ToString(),
WarningMessage = item["WARNING_MESSAGE"].ToString(), // WarningMessage = item["WARNING_MESSAGE"].ToString(),
WarningTime = Convert.ToDateTime(item["WARNING_TIME"]), // WarningTime = Convert.ToDateTime(item["WARNING_TIME"]),
PlcItemCode = item["PLC_ITEM_CODE"].ToString(), // PlcItemCode = item["PLC_ITEM_CODE"].ToString(),
WaringStatus = 0, // WaringStatus = 0,
WarningHandleResult = 0, // WarningHandleResult = 0,
CreateBy = Convert.ToInt32(item["CREATE_BY"]), // CreateBy = Convert.ToInt32(item["CREATE_BY"]),
CreateTime = Convert.ToDateTime(item["CREATE_TIME"]), // CreateTime = Convert.ToDateTime(item["CREATE_TIME"]),
UpdateBy = Convert.ToInt32(item["UPDATE_BY"]), // UpdateBy = Convert.ToInt32(item["UPDATE_BY"]),
UpdateTime = Convert.ToDateTime(item["UPDATE_TIME"]), // UpdateTime = Convert.ToDateTime(item["UPDATE_TIME"]),
DataVersion = Convert.ToInt32(item["DATA_VERSION"]), // DataVersion = Convert.ToInt32(item["DATA_VERSION"]),
}); // });
} // }
string sql2 = $@"DELETE FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 AND WARNING_HANDLE_RESULT =0"; // string sql2 = $@"DELETE FROM CM_WARNING_LOG WHERE WARING_STATUS = 0 AND WARNING_HANDLE_RESULT =0";
LeadDbHelperSQLite.Execute(sql2); // LeadDbHelperSQLite.Execute(sql2);
} //}
} }
//private void SetPlcItem(List<PlcItem> PlcItemMdList, DataRow item) //private void SetPlcItem(List<PlcItem> PlcItemMdList, DataRow item)
//{ //{
@@ -813,86 +825,86 @@ namespace CleanMachineHMI
timer.Enabled = false; timer.Enabled = false;
Global.SysThIsRunFlag = false; Global.SysThIsRunFlag = false;
PlcOperationHelper.Instance.eventAlarmLock = true; PlcOperationHelper.Instance.eventAlarmLock = true;
if (Global.CmWarningLogMd_List.Count > 0) //if (Global.CmWarningLogMd_List.Count > 0)
{ //{
foreach (WarningLog item in Global.CmWarningLogMd_List) // foreach (WarningLog item in Global.CmWarningLogMd_List.Values)
{ // {
if (item.WaringStatus == 0 && item.WarningHandleResult == 0) // if (item.WaringStatus == 0 && item.WarningHandleResult == 0)
{ // {
string sql1 = $@" // string sql1 = $@"
INSERT INTO CM_WARNING_LOG ( // INSERT INTO CM_WARNING_LOG (
WARNING_CODE, // WARNING_CODE,
WARNING_NAME, // WARNING_NAME,
WARNING_TYPE, // WARNING_TYPE,
WARNING_MESSAGE, // WARNING_MESSAGE,
WARNING_TIME, // WARNING_TIME,
PLC_ITEM_CODE, // PLC_ITEM_CODE,
WARING_STATUS, // WARING_STATUS,
WARNING_HANDLE_RESULT, // WARNING_HANDLE_RESULT,
CREATE_BY, // CREATE_BY,
CREATE_TIME, // CREATE_TIME,
UPDATE_BY, // UPDATE_BY,
UPDATE_TIME, // UPDATE_TIME,
DATA_VERSION // DATA_VERSION
) // )
VALUES ( // VALUES (
'{item.WarningCode}', // '{item.WarningCode}',
'{item.WarningName}', // '{item.WarningName}',
'{item.WarningType}', // '{item.WarningType}',
'{item.WarningMessage}', // '{item.WarningMessage}',
'{item.WarningTime.ToString("yyyy-MM-dd HH:mm:ss")}', // '{item.WarningTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.PlcItemCode}', // '{item.PlcItemCode}',
'{item.WaringStatus}', // '{item.WaringStatus}',
'{item.WarningHandleResult}', // '{item.WarningHandleResult}',
'{item.CreateBy}', // '{item.CreateBy}',
'{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}', // '{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.UpdateBy}', // '{item.UpdateBy}',
'{item.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")}', // '{item.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.DataVersion}' // '{item.DataVersion}'
); // );
"; // ";
LeadDbHelperSQLite.Execute(sql1); // LeadDbHelperSQLite.Execute(sql1);
} // }
else // else
{ // {
string sql1 = $@" // string sql1 = $@"
INSERT INTO CM_WARNING_LOG ( // INSERT INTO CM_WARNING_LOG (
WARNING_CODE, // WARNING_CODE,
WARNING_NAME, // WARNING_NAME,
WARNING_TYPE, // WARNING_TYPE,
WARNING_MESSAGE, // WARNING_MESSAGE,
WARNING_TIME, // WARNING_TIME,
PLC_ITEM_CODE, // PLC_ITEM_CODE,
WARING_STATUS, // WARING_STATUS,
WARNING_HANDLE_RESULT, // WARNING_HANDLE_RESULT,
WARNING_HANDLE_TIME, // WARNING_HANDLE_TIME,
CREATE_BY, // CREATE_BY,
CREATE_TIME, // CREATE_TIME,
UPDATE_BY, // UPDATE_BY,
UPDATE_TIME, // UPDATE_TIME,
DATA_VERSION // DATA_VERSION
) // )
VALUES ( // VALUES (
'{item.WarningCode}', // '{item.WarningCode}',
'{item.WarningName}', // '{item.WarningName}',
'{item.WarningType}', // '{item.WarningType}',
'{item.WarningMessage}', // '{item.WarningMessage}',
'{item.WarningTime.ToString("yyyy-MM-dd HH:mm:ss")}', // '{item.WarningTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.PlcItemCode}', // '{item.PlcItemCode}',
'{item.WaringStatus}', // '{item.WaringStatus}',
'{item.WarningHandleResult}', // '{item.WarningHandleResult}',
'{item.WarningHandleTime.ToString("yyyy-MM-dd HH:mm:ss")}', // '{item.WarningHandleTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.CreateBy}', // '{item.CreateBy}',
'{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}', // '{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.UpdateBy}', // '{item.UpdateBy}',
'{item.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")}', // '{item.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss")}',
'{item.DataVersion}' // '{item.DataVersion}'
); // );
"; // ";
LeadDbHelperSQLite.Execute(sql1); // LeadDbHelperSQLite.Execute(sql1);
} // }
} // }
} // }
await Task.Delay(300); await Task.Delay(300);
if (isPlcConnStatus) if (isPlcConnStatus)

69
CleanMachineHMI/frmPring.Designer.cs generated Normal file
View File

@@ -0,0 +1,69 @@
namespace CleanMachineHMI
{
partial class frmPring
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.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.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(99, 29);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(154, 24);
this.label1.TabIndex = 0;
this.label1.Text = "printing ...";
//
// frmPring
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(355, 91);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "frmPring";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "frmPring";
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
}
}

View File

@@ -0,0 +1,21 @@
using Krypton.Toolkit;
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
{
public partial class frmPring : KryptonForm
{
public frmPring()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,120 @@
<?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>
</root>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Krypton.Navigator" version="5.550.2108.1" targetFramework="net45" requireReinstallation="true" />
<package id="Krypton.Toolkit" version="5.550.2108.1" targetFramework="net45" requireReinstallation="true" />
<package id="Microsoft.ReportingServices.ReportViewerControl.Winforms" version="140.1000.523" targetFramework="net45" />
<package id="Microsoft.SqlServer.Types" version="14.0.314.76" targetFramework="net45" />
<package id="NModbus4" version="2.1.0" targetFramework="net45" />
</packages>

51
nuget.config Normal file
View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<!--
Used to specify the default location to expand packages.
See: nuget.exe help install
See: nuget.exe help update
In this example, %PACKAGEHOME% is an environment variable. On Mac/Linux,
use $PACKAGE_HOME/External as the value.
-->
<add key="repositoryPath" value="%PACKAGEHOME%\External" />
<!--
Used to specify default source for the push command.
See: nuget.exe help push
-->
<add key="defaultPushSource" value="https://MyRepo/ES/api/v2/package" />
</config>
<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
<add key="snailRepo" value="http://10.20.88.96:8081/repository/nuget-group/" />
</packageSources>
<packageSourceCredentials>
<snailRepo>
<add key="Username" value="admin" />
<add key="ClearTextPassword" value="gonzo1982" />
</snailRepo>
</packageSourceCredentials>
-->
</configuration>