change - 初始化SOP文件展示,根据文件类型进行显示

master
wenjy 9 months ago
parent 1076160e6c
commit 3a9dc82f27

33
Main.Designer.cs generated

@ -37,7 +37,6 @@ namespace ZJ_BYD
this.sysLogo = new DevExpress.XtraEditors.PictureEdit();
this.lblLineName = new DevExpress.XtraEditors.LabelControl();
this.tablePanel1 = new DevExpress.Utils.Layout.TablePanel();
this.imageSlider1 = new DevExpress.XtraEditors.Controls.ImageSlider();
this.stationpanel = new DevExpress.Utils.Layout.StackPanel();
this.panelControl3 = new DevExpress.XtraEditors.PanelControl();
this.stackPanel2 = new DevExpress.Utils.Layout.StackPanel();
@ -53,12 +52,12 @@ namespace ZJ_BYD
this.Result = new DevExpress.XtraGrid.Columns.GridColumn();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.lbldatetime = new DevExpress.XtraEditors.LabelControl();
this.sopPanelControl = new DevExpress.XtraEditors.PanelControl();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
this.panelControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.sysLogo.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tablePanel1)).BeginInit();
this.tablePanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.imageSlider1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.stationpanel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl3)).BeginInit();
this.panelControl3.SuspendLayout();
@ -68,6 +67,7 @@ namespace ZJ_BYD
this.stackPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridTestInfo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.sopPanelControl)).BeginInit();
this.SuspendLayout();
//
// panelControl1
@ -164,7 +164,7 @@ namespace ZJ_BYD
this.tablePanel1.Columns.AddRange(new DevExpress.Utils.Layout.TablePanelColumn[] {
new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 18.74F),
new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 58.62F)});
this.tablePanel1.Controls.Add(this.imageSlider1);
this.tablePanel1.Controls.Add(this.sopPanelControl);
this.tablePanel1.Controls.Add(this.stationpanel);
this.tablePanel1.Controls.Add(this.panelControl3);
this.tablePanel1.Controls.Add(this.lbldatetime);
@ -178,19 +178,6 @@ namespace ZJ_BYD
this.tablePanel1.Size = new System.Drawing.Size(1044, 973);
this.tablePanel1.TabIndex = 5;
//
// imageSlider1
//
this.tablePanel1.SetColumn(this.imageSlider1, 1);
this.imageSlider1.CurrentImageIndex = 0;
this.imageSlider1.Dock = System.Windows.Forms.DockStyle.Fill;
this.imageSlider1.Images.Add(((System.Drawing.Image)(resources.GetObject("imageSlider1.Images"))));
this.imageSlider1.Location = new System.Drawing.Point(256, 53);
this.imageSlider1.Name = "imageSlider1";
this.tablePanel1.SetRow(this.imageSlider1, 1);
this.imageSlider1.Size = new System.Drawing.Size(785, 917);
this.imageSlider1.TabIndex = 9;
this.imageSlider1.Text = "imageSlider1";
//
// stationpanel
//
this.stationpanel.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(9)))), ((int)(((byte)(28)))), ((int)(((byte)(77)))));
@ -497,6 +484,16 @@ namespace ZJ_BYD
this.lbldatetime.TabIndex = 4;
this.lbldatetime.Text = "2022-03-16 00:00:00";
//
// sopPanelControl
//
this.tablePanel1.SetColumn(this.sopPanelControl, 1);
this.sopPanelControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.sopPanelControl.Location = new System.Drawing.Point(256, 53);
this.sopPanelControl.Name = "sopPanelControl";
this.tablePanel1.SetRow(this.sopPanelControl, 1);
this.sopPanelControl.Size = new System.Drawing.Size(785, 917);
this.sopPanelControl.TabIndex = 9;
//
// Main
//
this.Appearance.BackColor = System.Drawing.Color.Transparent;
@ -520,7 +517,6 @@ namespace ZJ_BYD
((System.ComponentModel.ISupportInitialize)(this.tablePanel1)).EndInit();
this.tablePanel1.ResumeLayout(false);
this.tablePanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.imageSlider1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.stationpanel)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl3)).EndInit();
this.panelControl3.ResumeLayout(false);
@ -530,6 +526,7 @@ namespace ZJ_BYD
this.stackPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridTestInfo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.sopPanelControl)).EndInit();
this.ResumeLayout(false);
}
@ -558,6 +555,6 @@ namespace ZJ_BYD
private DevExpress.XtraEditors.SimpleButton btnSearchResult;
private DevExpress.XtraEditors.SimpleButton btnPassRate;
private DevExpress.XtraEditors.LabelControl lbldatetime;
private DevExpress.XtraEditors.Controls.ImageSlider imageSlider1;
private DevExpress.XtraEditors.PanelControl sopPanelControl;
}
}

@ -1,4 +1,7 @@
using DevExpress.XtraEditors;
using DevExpress.Pdf;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraPdfViewer;
using HslCommunication;
using Seagull.BarTender.Print;
using System;
@ -101,26 +104,43 @@ namespace ZJ_BYD
ShowData();
}, cancellationTokenSource.Token);
// 获取图片文件夹路径
string path = Program.SopFilePath;
InitSopView();
//初始化默认机型
MskCodeHelper.InitMachineType();
}
/// <summary>
/// 初始化SOP文件根据文件类型进行显示
/// </summary>
private void InitSopView()
{
string filePath = Program.SopFilePath;
// 获取文件夹内所有图片文件
string[] files = Directory.GetFiles(path);
string[] files = Directory.GetFiles(filePath);
// 清空ImageSlider
imageSlider1.Images.Clear();
List<string> pdfFiles = files.Where(x=>Path.GetExtension(x).Equals(".pdf")).ToList();
// 遍历文件并依次添加到ImageSlider中
foreach (string file in files)
if(pdfFiles.Count > 0)
{
imageSlider1.Images.Add(System.Drawing.Image.FromFile(file));
PdfViewer pdfViewer = new PdfViewer();
pdfViewer.Show();
pdfViewer.LoadDocument(pdfFiles.First());
pdfViewer.Dock = System.Windows.Forms.DockStyle.Fill;
this.sopPanelControl.Controls.Add(pdfViewer);
return;
}
// 刷新ImageSlider
imageSlider1.Refresh();
ImageSlider imageSlider = new ImageSlider();
imageSlider.Images.Clear();
foreach (string file in files)
{
imageSlider.Images.Add(System.Drawing.Image.FromFile(file));
}
imageSlider.Refresh();
imageSlider.Dock = System.Windows.Forms.DockStyle.Fill;
this.sopPanelControl.Controls.Add(imageSlider);
//初始化默认机型
MskCodeHelper.InitMachineType();
}
/// <summary>

File diff suppressed because it is too large Load Diff

@ -1,13 +1,14 @@
DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ProgressBarControl, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.LookUpEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.PictureEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.PictureEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ProgressBarControl, DevExpress.XtraEditors.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraPdfViewer.PdfViewer, DevExpress.XtraPdfViewer.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

@ -66,6 +66,8 @@
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Drawing.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Pdf.v22.1.Core, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Pdf.v22.1.Drawing, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Sparkline.v22.1.Core, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.SpellChecker.v22.1.Core, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
@ -79,6 +81,7 @@
<Reference Include="DevExpress.XtraGrid.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraLayout.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraNavBar.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraPdfViewer.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraPrinting.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraScheduler.v22.1, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraScheduler.v22.1.Core.Desktop, Version=22.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />

Loading…
Cancel
Save