章政 7 жил өмнө
parent
commit
643c85ba56

+ 25 - 6
UAS-MES/CustomControl/HeadBar/PDFOperater.Designer.cs

@@ -28,13 +28,16 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();
             this.ZoomComBox_label = new System.Windows.Forms.ToolStripLabel();
             this.ZoomComBox = new System.Windows.Forms.ToolStripComboBox();
+            this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.ScrollSpan_label = new System.Windows.Forms.ToolStripLabel();
             this.ScrollSpan = new System.Windows.Forms.ToolStripTextBox();
-            this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
+            this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
+            this.ScrollTimer = new System.Windows.Forms.Timer(this.components);
             this.toolStrip1.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -47,7 +50,8 @@
             this.toolStripLabel1,
             this.toolStripSeparator1,
             this.ScrollSpan_label,
-            this.ScrollSpan});
+            this.ScrollSpan,
+            this.toolStripLabel2});
             this.toolStrip1.Location = new System.Drawing.Point(0, 0);
             this.toolStrip1.Name = "toolStrip1";
             this.toolStrip1.Size = new System.Drawing.Size(598, 30);
@@ -64,9 +68,16 @@
             // 
             this.ZoomComBox.Name = "ZoomComBox";
             this.ZoomComBox.Size = new System.Drawing.Size(75, 30);
+            this.ZoomComBox.Text = "100";
             this.ZoomComBox.SelectedIndexChanged += new System.EventHandler(this.ZoomComBox_SelectedIndexChanged);
             this.ZoomComBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ZoomComBox_KeyDown);
             // 
+            // toolStripLabel1
+            // 
+            this.toolStripLabel1.Name = "toolStripLabel1";
+            this.toolStripLabel1.Size = new System.Drawing.Size(19, 27);
+            this.toolStripLabel1.Text = "%";
+            // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
@@ -82,12 +93,17 @@
             // 
             this.ScrollSpan.Name = "ScrollSpan";
             this.ScrollSpan.Size = new System.Drawing.Size(30, 30);
+            this.ScrollSpan.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ScrollSpan_KeyDown);
             // 
-            // toolStripLabel1
+            // toolStripLabel2
             // 
-            this.toolStripLabel1.Name = "toolStripLabel1";
-            this.toolStripLabel1.Size = new System.Drawing.Size(19, 27);
-            this.toolStripLabel1.Text = "%";
+            this.toolStripLabel2.Name = "toolStripLabel2";
+            this.toolStripLabel2.Size = new System.Drawing.Size(20, 27);
+            this.toolStripLabel2.Text = "秒";
+            // 
+            // ScrollTimer
+            // 
+            this.ScrollTimer.Tick += new System.EventHandler(this.ScrollTimer_Tick);
             // 
             // PDFOperater
             // 
@@ -97,6 +113,7 @@
             this.Controls.Add(this.toolStrip1);
             this.Name = "PDFOperater";
             this.Size = new System.Drawing.Size(598, 30);
+            this.Load += new System.EventHandler(this.PDFOperater_Load);
             this.toolStrip1.ResumeLayout(false);
             this.toolStrip1.PerformLayout();
             this.ResumeLayout(false);
@@ -113,5 +130,7 @@
         private System.Windows.Forms.ToolStripLabel ScrollSpan_label;
         private System.Windows.Forms.ToolStripTextBox ScrollSpan;
         private System.Windows.Forms.ToolStripLabel toolStripLabel1;
+        private System.Windows.Forms.Timer ScrollTimer;
+        private System.Windows.Forms.ToolStripLabel toolStripLabel2;
     }
 }

+ 28 - 0
UAS-MES/CustomControl/HeadBar/PDFOperater.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Windows.Forms;
 using O2S.Components.PDFView4NET;
+using UAS_MES.PublicMethod;
 
 namespace UAS_MES.CustomControl
 {
@@ -36,6 +37,11 @@ namespace UAS_MES.CustomControl
             }
         }
 
+        private void PDFOperater_Load(object sender, EventArgs e)
+        {
+            PageView1.Zoom = double.Parse(ZoomComBox.Text);
+        }
+
         private void ZoomComBox_SelectedIndexChanged(object sender, EventArgs e)
         {
             PageView1.Zoom = double.Parse(ZoomComBox.Text);
@@ -48,5 +54,27 @@ namespace UAS_MES.CustomControl
                 PageView1.Zoom = double.Parse(ZoomComBox.Text);
             }
         }
+
+        private void ScrollSpan_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                ScrollTimer.Interval = int.Parse(ScrollSpan.Text) * 1000;
+                ScrollTimer.Start();
+                BaseUtil.SetCacheData("ScrollSpan", ScrollSpan.Text);
+            }
+        }
+
+        private void ScrollTimer_Tick(object sender, EventArgs e)
+        {
+            if (PageView1.Document.PageCount - 1 == PageView1.PageNumber)
+            {
+                PageView1.GoToFirstPage();
+            }
+            else
+            {
+                PageView1.GoToNextPage();
+            }
+        }
     }
 }

+ 3 - 0
UAS-MES/CustomControl/HeadBar/PDFOperater.resx

@@ -120,4 +120,7 @@
   <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <metadata name="ScrollTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>127, 17</value>
+  </metadata>
 </root>

+ 1 - 1
UAS-MES/FunctionCode/Query/Query_OperationInstruction.Designer.cs

@@ -91,7 +91,7 @@
             this.FileList.FormattingEnabled = true;
             this.FileList.Items.AddRange(new object[] {
             "1.mp4",
-            "C:\\Users\\callm\\Desktop\\工作文档\\考勤机数据对接\\1.pdf",
+            "H:\\PDFView4NET 5.0.1 WinForms Edition\\SupportFiles\\multicolumntextandimages.pdf",
             "H:\\UAS_WinForm\\UAS_MES_NEW\\Resources\\LoginBG.jpg",
             "4.jpeg"});
             this.FileList.Location = new System.Drawing.Point(325, 18);

+ 5 - 3
UAS-MES/FunctionCode/Query/Query_ShowPDF.Designer.cs

@@ -36,23 +36,25 @@
             // 
             // PageView
             // 
+            this.PageView.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.PageView.AutoScroll = true;
             this.PageView.BackColor = System.Drawing.SystemColors.Window;
             this.PageView.DefaultEllipseAnnotationBorderWidth = 1D;
             this.PageView.DefaultInkAnnotationWidth = 1D;
             this.PageView.DefaultRectangleAnnotationBorderWidth = 1D;
-            this.PageView.Dock = System.Windows.Forms.DockStyle.Fill;
             this.PageView.Document = this.PDFDocument;
             this.PageView.DownscaleLargeImages = false;
             this.PageView.EnableRepeatedKeys = false;
-            this.PageView.Location = new System.Drawing.Point(0, 0);
+            this.PageView.Location = new System.Drawing.Point(0, 30);
             this.PageView.Name = "PageView";
             this.PageView.PageDisplayLayout = O2S.Components.PDFView4NET.PDFPageDisplayLayout.OneColumn;
             this.PageView.PageNumber = 0;
             this.PageView.RenderingProgressColor = System.Drawing.Color.Empty;
             this.PageView.RequiredFormFieldHighlightColor = System.Drawing.Color.Empty;
             this.PageView.ScrollPosition = new System.Drawing.Point(0, 0);
-            this.PageView.Size = new System.Drawing.Size(1006, 600);
+            this.PageView.Size = new System.Drawing.Size(1006, 570);
             this.PageView.SubstituteFonts = null;
             this.PageView.TabIndex = 204;
             this.PageView.VerticalPageSpacing = 5;

+ 0 - 9
UAS-MES/FunctionCode/Query/Query_ShowPDF.cs

@@ -23,15 +23,6 @@ namespace UAS_MES.Query
             StartPosition = FormStartPosition.CenterScreen;
         }
 
-        //private void MediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
-        //{
-        //    //if ((int)MediaPlayer.playState == 1)
-        //    //{
-        //    //    System.Threading.Thread.Sleep(1000);
-        //    //    MediaPlayer.Ctlcontrols.play();
-        //    //}
-        //}
-
         private void Query_ShowPDF_Load(object sender, EventArgs e)
         {
             PDFDocument.FilePath = type;

+ 13 - 13
UAS-MES/FunctionCode/Query/Query_ShowVideo.Designer.cs

@@ -29,37 +29,37 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_ShowVideo));
-            this.axWindowsMediaPlayer1 = new AxWMPLib.AxWindowsMediaPlayer();
-            ((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).BeginInit();
+            this.MediaPlayer = new AxWMPLib.AxWindowsMediaPlayer();
+            ((System.ComponentModel.ISupportInitialize)(this.MediaPlayer)).BeginInit();
             this.SuspendLayout();
             // 
-            // axWindowsMediaPlayer1
+            // MediaPlayer
             // 
-            this.axWindowsMediaPlayer1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.axWindowsMediaPlayer1.Enabled = true;
-            this.axWindowsMediaPlayer1.Location = new System.Drawing.Point(0, 0);
-            this.axWindowsMediaPlayer1.Name = "axWindowsMediaPlayer1";
-            this.axWindowsMediaPlayer1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWindowsMediaPlayer1.OcxState")));
-            this.axWindowsMediaPlayer1.Size = new System.Drawing.Size(1124, 703);
-            this.axWindowsMediaPlayer1.TabIndex = 0;
+            this.MediaPlayer.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.MediaPlayer.Enabled = true;
+            this.MediaPlayer.Location = new System.Drawing.Point(0, 0);
+            this.MediaPlayer.Name = "MediaPlayer";
+            this.MediaPlayer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("MediaPlayer.OcxState")));
+            this.MediaPlayer.Size = new System.Drawing.Size(1124, 703);
+            this.MediaPlayer.TabIndex = 0;
             // 
             // Query_ShowVideo
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1124, 703);
-            this.Controls.Add(this.axWindowsMediaPlayer1);
+            this.Controls.Add(this.MediaPlayer);
             this.Name = "Query_ShowVideo";
             this.Text = "作业指导书";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             this.Load += new System.EventHandler(this.Query_ShowVideo_Load);
-            ((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.MediaPlayer)).EndInit();
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private AxWMPLib.AxWindowsMediaPlayer axWindowsMediaPlayer1;
+        private AxWMPLib.AxWindowsMediaPlayer MediaPlayer;
     }
 }

+ 10 - 0
UAS-MES/FunctionCode/Query/Query_ShowVideo.cs

@@ -18,9 +18,19 @@ namespace UAS_MES.Query
         {
             InitializeComponent();
             StartPosition = FormStartPosition.CenterScreen;
+            MediaPlayer.PlayStateChange += MediaPlayer_PlayStateChange;
             type = FileType;
         }
 
+        private void MediaPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
+        {
+            if ((int)MediaPlayer.playState == 1)
+            {
+                System.Threading.Thread.Sleep(1000);
+                MediaPlayer.Ctlcontrols.play();
+            }
+        }
+
         private void Query_ShowVideo_Load(object sender, EventArgs e)
         {
 

+ 1 - 1
UAS-MES/FunctionCode/Query/Query_ShowVideo.resx

@@ -117,7 +117,7 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <data name="axWindowsMediaPlayer1.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
+  <data name="MediaPlayer.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
     <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0