Browse Source

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 years ago
parent
commit
cf2d7804ac

+ 162 - 0
UAS-MES/CustomControl/HeadBar/PDFOperater.Designer.cs

@@ -0,0 +1,162 @@
+namespace UAS_MES.CustomControl
+{
+    partial class PDFOperater
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.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.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
+            this.ScrollTimer = new System.Windows.Forms.Timer(this.components);
+            this.KeyWord_label = new System.Windows.Forms.ToolStripLabel();
+            this.KeyWord = new System.Windows.Forms.ToolStripTextBox();
+            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+            this.toolStrip1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // toolStrip1
+            // 
+            this.toolStrip1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.ZoomComBox_label,
+            this.ZoomComBox,
+            this.toolStripLabel1,
+            this.toolStripSeparator1,
+            this.ScrollSpan_label,
+            this.ScrollSpan,
+            this.toolStripLabel2,
+            this.toolStripSeparator2,
+            this.KeyWord_label,
+            this.KeyWord});
+            this.toolStrip1.Location = new System.Drawing.Point(0, 0);
+            this.toolStrip1.Name = "toolStrip1";
+            this.toolStrip1.Size = new System.Drawing.Size(598, 30);
+            this.toolStrip1.TabIndex = 0;
+            this.toolStrip1.Text = "toolStrip1";
+            // 
+            // ZoomComBox_label
+            // 
+            this.ZoomComBox_label.Name = "ZoomComBox_label";
+            this.ZoomComBox_label.Size = new System.Drawing.Size(56, 27);
+            this.ZoomComBox_label.Text = "缩放比例";
+            // 
+            // ZoomComBox
+            // 
+            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";
+            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 30);
+            // 
+            // ScrollSpan_label
+            // 
+            this.ScrollSpan_label.Name = "ScrollSpan_label";
+            this.ScrollSpan_label.Size = new System.Drawing.Size(56, 27);
+            this.ScrollSpan_label.Text = "滚动间隔";
+            // 
+            // ScrollSpan
+            // 
+            this.ScrollSpan.Name = "ScrollSpan";
+            this.ScrollSpan.Size = new System.Drawing.Size(30, 30);
+            this.ScrollSpan.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ScrollSpan_KeyDown);
+            // 
+            // toolStripLabel2
+            // 
+            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);
+            // 
+            // KeyWord_label
+            // 
+            this.KeyWord_label.Name = "KeyWord_label";
+            this.KeyWord_label.Size = new System.Drawing.Size(68, 27);
+            this.KeyWord_label.Text = "关键词搜索";
+            // 
+            // KeyWord
+            // 
+            this.KeyWord.Name = "KeyWord";
+            this.KeyWord.Size = new System.Drawing.Size(100, 30);
+            this.KeyWord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.toolStripTextBox1_KeyDown);
+            // 
+            // toolStripSeparator2
+            // 
+            this.toolStripSeparator2.Name = "toolStripSeparator2";
+            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 30);
+            // 
+            // PDFOperater
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.ControlDarkDark;
+            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);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.ToolStrip toolStrip1;
+        private System.Windows.Forms.ToolStripComboBox ZoomComBox;
+        private System.Windows.Forms.ToolStripLabel ZoomComBox_label;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+        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;
+        private System.Windows.Forms.ToolStripLabel KeyWord_label;
+        private System.Windows.Forms.ToolStripTextBox KeyWord;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+    }
+}

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

@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using O2S.Components.PDFView4NET;
+using UAS_MES.PublicMethod;
+using O2S.Components.PDFView4NET.Text;
+
+namespace UAS_MES.CustomControl
+{
+    public partial class PDFOperater : UserControl
+    {
+        private PDFPageView PageView1;
+
+        public PDFPageView PageView
+        {
+            get
+            {
+                return PageView1;
+            }
+
+            set
+            {
+                PageView1 = value;
+            }
+        }
+
+        public PDFOperater()
+        {
+            InitializeComponent();
+            for (int i = 1; i <= 20; i++)
+            {
+                ZoomComBox.Items.Add(i * 10);
+            }
+        }
+
+        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);
+        }
+
+        private void ZoomComBox_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                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();
+            }
+        }
+
+        private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                PageView1.SearchText(KeyWord.Text, PDFHighlightSearchResultsMode.AllResults);
+            }
+        }
+    }
+}

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

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

+ 39 - 81
UAS-MES/Form1.Designer.cs

@@ -28,14 +28,12 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.components = new System.ComponentModel.Container();
             this.button1 = new System.Windows.Forms.Button();
             this.button2 = new System.Windows.Forms.Button();
-            this.button3 = new System.Windows.Forms.Button();
-            this.button4 = new System.Windows.Forms.Button();
-            this.txtMsg = new System.Windows.Forms.RichTextBox();
-            this.txtIP = new System.Windows.Forms.TextBox();
-            this.txtPORT = new System.Windows.Forms.TextBox();
-            this.enterTextBox2 = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.document = new O2S.Components.PDFView4NET.PDFDocument(this.components);
+            this.pageView = new O2S.Components.PDFView4NET.PDFPageView();
+            this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.SuspendLayout();
             // 
             // button1
@@ -58,84 +56,47 @@
             this.button2.Text = "button2";
             this.button2.UseVisualStyleBackColor = true;
             // 
-            // button3
-            // 
-            this.button3.Location = new System.Drawing.Point(424, 198);
-            this.button3.Margin = new System.Windows.Forms.Padding(4);
-            this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(100, 29);
-            this.button3.TabIndex = 0;
-            this.button3.Text = "OPEN";
-            this.button3.UseVisualStyleBackColor = true;
-            this.button3.Click += new System.EventHandler(this.button3_Click_1);
-            // 
-            // button4
-            // 
-            this.button4.Location = new System.Drawing.Point(547, 198);
-            this.button4.Margin = new System.Windows.Forms.Padding(4);
-            this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(100, 29);
-            this.button4.TabIndex = 2;
-            this.button4.Text = "Send";
-            this.button4.UseVisualStyleBackColor = true;
-            this.button4.Click += new System.EventHandler(this.button4_Click);
-            // 
-            // txtMsg
-            // 
-            this.txtMsg.Location = new System.Drawing.Point(424, 320);
-            this.txtMsg.Name = "txtMsg";
-            this.txtMsg.Size = new System.Drawing.Size(283, 160);
-            this.txtMsg.TabIndex = 7;
-            this.txtMsg.Text = "";
-            // 
-            // txtIP
-            // 
-            this.txtIP.Location = new System.Drawing.Point(424, 270);
-            this.txtIP.Name = "txtIP";
-            this.txtIP.Size = new System.Drawing.Size(136, 25);
-            this.txtIP.TabIndex = 8;
-            this.txtIP.Text = "127.0.0.1";
-            // 
-            // txtPORT
-            // 
-            this.txtPORT.Location = new System.Drawing.Point(607, 270);
-            this.txtPORT.Name = "txtPORT";
-            this.txtPORT.Size = new System.Drawing.Size(100, 25);
-            this.txtPORT.TabIndex = 9;
-            this.txtPORT.Text = "8080";
-            // 
-            // enterTextBox2
-            // 
-            this.enterTextBox2.AllPower = null;
-            this.enterTextBox2.BackColor = System.Drawing.Color.White;
-            this.enterTextBox2.ID = null;
-            this.enterTextBox2.Location = new System.Drawing.Point(753, 270);
-            this.enterTextBox2.Name = "enterTextBox2";
-            this.enterTextBox2.Power = null;
-            this.enterTextBox2.Size = new System.Drawing.Size(196, 25);
-            this.enterTextBox2.Str = null;
-            this.enterTextBox2.Str1 = null;
-            this.enterTextBox2.Str2 = null;
-            this.enterTextBox2.TabIndex = 10;
+            // document
+            // 
+            this.document.Metadata = null;
+            this.document.PageLayout = O2S.Components.PDFView4NET.PDFPageLayout.SinglePage;
+            this.document.PageMode = O2S.Components.PDFView4NET.PDFPageMode.UseNone;
+            // 
+            // pageView
+            // 
+            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.document;
+            this.pageView.DownscaleLargeImages = false;
+            this.pageView.EnableRepeatedKeys = false;
+            this.pageView.Location = new System.Drawing.Point(0, 0);
+            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(929, 590);
+            this.pageView.SubstituteFonts = null;
+            this.pageView.TabIndex = 2;
+            this.pageView.VerticalPageSpacing = 5;
+            this.pageView.WorkMode = O2S.Components.PDFView4NET.UserInteractiveWorkMode.PanAndScan;
             // 
             // Form1
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1239, 738);
-            this.Controls.Add(this.enterTextBox2);
-            this.Controls.Add(this.txtPORT);
-            this.Controls.Add(this.txtIP);
-            this.Controls.Add(this.txtMsg);
-            this.Controls.Add(this.button4);
-            this.Controls.Add(this.button3);
-            this.Margin = new System.Windows.Forms.Padding(4);
+            this.ClientSize = new System.Drawing.Size(929, 590);
+            this.Controls.Add(this.pageView);
             this.Name = "Form1";
             this.Tag = "123123";
             this.Text = "Form1";
             this.Load += new System.EventHandler(this.Form1_Load);
             this.ResumeLayout(false);
-            this.PerformLayout();
 
         }
 
@@ -146,11 +107,8 @@
         private CustomControl.ButtonUtil.NormalButton normalButton1;
         private CustomControl.TextBoxWithIcon.EnterTextBox enterTextBox1;
         private CustomControl.SetLoading.LoadingCircle loadingCircle1;
-        private System.Windows.Forms.Button button3;
-        private System.Windows.Forms.Button button4;
-        private System.Windows.Forms.RichTextBox txtMsg;
-        private System.Windows.Forms.TextBox txtIP;
-        private System.Windows.Forms.TextBox txtPORT;
-        private CustomControl.TextBoxWithIcon.EnterTextBox enterTextBox2;
+        private O2S.Components.PDFView4NET.PDFDocument document;
+        private O2S.Components.PDFView4NET.PDFPageView pageView;
+        private System.Windows.Forms.Timer timer1;
     }
 }

+ 14 - 46
UAS-MES/Form1.cs

@@ -29,59 +29,27 @@ namespace UAS_MES
         public Form1()
         {
             InitializeComponent();
+            timer1.Interval = 1000;
+            timer1.Tick += Timer1_Tick;
         }
 
-
-
         private void Form1_Load(object sender, EventArgs e)
         {
-            //Com.PortName = "COM4";
-            //Com.ReadTimeout = 5000;
-            //Com.WriteTimeout = 5000;
-            //Com.BaudRate = 9600;
-            //Com.StopBits = StopBits.One;
-            //Com.Parity = Parity.None;
-
-        }
-
-        [DllImport("WinIo64.dll")]
-        public static extern bool InitializeWinIo();
-        [DllImport("WinIo64.dll")]
-        public static extern void ShutdownWinIo();
-        [DllImport("WinIo64.dll")]
-        public static extern bool GetPortVal(IntPtr wPortAddr, out int pdwPortVal, byte bSize);
-        [DllImport("WinIo64.dll")]
-        public static extern bool SetPortVal(IntPtr wPortAddr, int dwPortVal, byte bSize);
-        //以下是与并口无关  
-        [DllImport("WinIo64.dll")]
-        public static extern byte MapPhysToLin(byte pbPhysAddr, uint dwPhysSize, IntPtr PhysicalMemoryHandle);
-        [DllImport("WinIo64.dll")]
-        public static extern bool UnmapPhysicalMemory(IntPtr PhysicalMemoryHandle, byte pbLinAddr);
-        [DllImport("WinIo64.dll")]
-        public static extern bool GetPhysLong(IntPtr pbPhysAddr, byte pdwPhysVal);
-        [DllImport("WinIo64.dll")]
-        public static extern bool SetPhysLong(IntPtr pbPhysAddr, byte dwPhysVal);
-        [DllImport("user32.dll")]
-        public static extern int MapVirtualKey(uint Ucode, uint uMapType);
-
-        public bool online = false;                          //WinIo打开标志  
-        //数据端口共8位,控制端口共4位,可以组成1~12位的任意数字输出端口;  
-        //状态端口共5位,控制端口共4位,可以组成1~9位的任意数字输入端口  
-        private static IntPtr data_port = (IntPtr)0x378;     //数据端口地址 D0-D7 8个端口  
-        private static IntPtr state_port = (IntPtr)0x379;    //状态端口地址 S3-S7 只能读取5位  
-        private static IntPtr control_port = (IntPtr)0x37A;  //控制端口地址 C0-C3 只能控制或输出4位  
-
-        ModeBusTCPServer md;
-        private void button3_Click_1(object sender, EventArgs e)
-        {
-            md = new ModeBusTCPServer();
-            md.Open();
-            txtMsg.AppendText("SUCCESS");
+            document.Load(@"H:\PDFView4NET 5.0.1 WinForms Edition\SupportFiles\multicolumntextandimages.pdf");
+            pageView.PageDisplayLayout = 0;
+            timer1.Start();
         }
 
-        private void button4_Click(object sender, EventArgs e)
+        private void Timer1_Tick(object sender, EventArgs e)
         {
-            md.SendOrder(enterTextBox2.Text);
+            pageView.GoToNextPage();
+            if (document.PageCount - 1 == pageView.PageNumber)
+            {
+                pageView.GoToFirstPage();
+                //设置滚动的范围
+                //pageView.ScrollPosition;
+                Thread.Sleep(1000);
+            }
         }
     }
 }

+ 6 - 0
UAS-MES/Form1.resx

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

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

@@ -91,8 +91,8 @@
             this.FileList.FormattingEnabled = true;
             this.FileList.Items.AddRange(new object[] {
             "1.mp4",
-            "C:\\Users\\callm\\Desktop\\工作文档\\考勤机数据对接\\1.pdf",
-            "3.jpg",
+            "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);
             this.FileList.Name = "FileList";

+ 22 - 2
UAS-MES/FunctionCode/Query/Query_OperationInstruction.cs

@@ -46,8 +46,28 @@ namespace UAS_MES.Query
 
         private void OpenFile_Click(object sender, EventArgs e)
         {
-            Query.Query_ShowInstruction showin = new Query_ShowInstruction(FileList.Text);
-            showin.Show();
+
+            switch (BaseUtil.GetFileSuffix(FileList.Text))
+            {
+                case "MP4":
+                    Query.Query_ShowVideo ShowVideo = new Query_ShowVideo(FileList.Text);
+                    ShowVideo.Show();
+                    break;
+                case "PDF":
+                    Query.Query_ShowPDF ShowPdf = new Query_ShowPDF(FileList.Text);
+                    ShowPdf.Show();
+                    break;
+                case "JPEG":
+                    Query.Query_ShowPicture ShowPic = new Query_ShowPicture(FileList.Text);
+                    ShowPic.Show();
+                    break;
+                case "JPG":
+                    Query.Query_ShowPicture ShowPic1 = new Query_ShowPicture(FileList.Text);
+                    ShowPic1.Show();
+                    break;
+                default:
+                    break;
+            }
         }
     }
 }

+ 0 - 67
UAS-MES/FunctionCode/Query/Query_ShowInstruction.cs

@@ -1,67 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using UAS_MES.PublicMethod;
-
-namespace UAS_MES.Query
-{
-    public partial class Query_ShowInstruction : Form
-    {
-        //文件具体地址
-        string type = "";
-
-        public Query_ShowInstruction(string FileType)
-        {
-            InitializeComponent();
-            MediaPlayer.PlayStateChange += MediaPlayer_PlayStateChange;
-            type = FileType;
-            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 Quert_ShowInstruction_Load(object sender, EventArgs e)
-        {
-            switch (BaseUtil.GetFileSuffix(type))
-            {
-                case "MP4":
-                    MediaPlayer.Visible = true;
-                    PageView.Visible = false;
-                    PicBox.Visible = false;
-                    MediaPlayer.URL = type;
-                    MediaPlayer.Ctlcontrols.play();
-                    break;
-                case "PDF":
-                    MediaPlayer.Visible = false;
-                    PageView.Visible = true;
-                    PDFDocument.FilePath = type;
-                    PicBox.Visible = false;
-                    break;
-                case "JPEG":
-                    MediaPlayer.Visible = false;
-                    PageView.Visible = false;
-                    PicBox.Visible = true;
-                    break;
-                case "JPG":
-                    MediaPlayer.Visible = false;
-                    PageView.Visible = false;
-                    PicBox.Visible = true;
-                    break;
-                default:
-                    break;
-            }
-        }
-    }
-}

+ 22 - 41
UAS-MES/FunctionCode/Query/Query_ShowInstruction.Designer.cs → UAS-MES/FunctionCode/Query/Query_ShowPDF.Designer.cs

@@ -1,6 +1,6 @@
 namespace UAS_MES.Query
 {
-    partial class Query_ShowInstruction
+    partial class Query_ShowPDF
     {
         /// <summary>
         /// Required designer variable.
@@ -29,50 +29,36 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_ShowInstruction));
-            this.PicBox = new System.Windows.Forms.PictureBox();
             this.PageView = new O2S.Components.PDFView4NET.PDFPageView();
             this.PDFDocument = new O2S.Components.PDFView4NET.PDFDocument(this.components);
-            this.MediaPlayer = new AxWMPLib.AxWindowsMediaPlayer();
-            ((System.ComponentModel.ISupportInitialize)(this.PicBox)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.MediaPlayer)).BeginInit();
+            this.PDFOperater = new UAS_MES.CustomControl.PDFOperater();
             this.SuspendLayout();
             // 
-            // PicBox
-            // 
-            this.PicBox.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.PicBox.Image = global::UAS_MES.Properties.Resources.LoginBG;
-            this.PicBox.Location = new System.Drawing.Point(0, 0);
-            this.PicBox.Name = "PicBox";
-            this.PicBox.Size = new System.Drawing.Size(1006, 600);
-            this.PicBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
-            this.PicBox.TabIndex = 203;
-            this.PicBox.TabStop = false;
-            this.PicBox.Visible = false;
-            // 
             // 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.DefaultHighlightAnnotationColor = System.Drawing.Color.OliveDrab;
             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;
-            this.PageView.Visible = false;
             this.PageView.WorkMode = O2S.Components.PDFView4NET.UserInteractiveWorkMode.PanAndScan;
             // 
             // PDFDocument
@@ -81,42 +67,37 @@
             this.PDFDocument.PageLayout = O2S.Components.PDFView4NET.PDFPageLayout.SinglePage;
             this.PDFDocument.PageMode = O2S.Components.PDFView4NET.PDFPageMode.UseNone;
             // 
-            // MediaPlayer
+            // PDFOperater
             // 
-            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(1006, 600);
-            this.MediaPlayer.TabIndex = 205;
-            this.MediaPlayer.Visible = false;
+            this.PDFOperater.BackColor = System.Drawing.SystemColors.ControlDarkDark;
+            this.PDFOperater.Dock = System.Windows.Forms.DockStyle.Top;
+            this.PDFOperater.Location = new System.Drawing.Point(0, 0);
+            this.PDFOperater.Name = "PDFOperater";
+            this.PDFOperater.PageView = this.PageView;
+            this.PDFOperater.Size = new System.Drawing.Size(1006, 30);
+            this.PDFOperater.TabIndex = 203;
+            this.PDFOperater.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PDFOperater_KeyDown);
             // 
-            // Query_ShowInstruction
+            // Query_ShowPDF
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1006, 600);
-            this.Controls.Add(this.MediaPlayer);
+            this.Controls.Add(this.PDFOperater);
             this.Controls.Add(this.PageView);
-            this.Controls.Add(this.PicBox);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
-            this.Name = "Query_ShowInstruction";
+            this.Name = "Query_ShowPDF";
             this.Tag = "Query!ShowInstruction";
             this.Text = "作业指导书";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
-            this.Load += new System.EventHandler(this.Quert_ShowInstruction_Load);
-            ((System.ComponentModel.ISupportInitialize)(this.PicBox)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.MediaPlayer)).EndInit();
+            this.Load += new System.EventHandler(this.Query_ShowPDF_Load);
             this.ResumeLayout(false);
 
         }
 
         #endregion
-
-        private System.Windows.Forms.PictureBox PicBox;
         private O2S.Components.PDFView4NET.PDFPageView PageView;
         private O2S.Components.PDFView4NET.PDFDocument PDFDocument;
-        private AxWMPLib.AxWindowsMediaPlayer MediaPlayer;
+        private CustomControl.PDFOperater PDFOperater;
     }
 }

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

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES.CustomControl;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.Query
+{
+    public partial class Query_ShowPDF : Form
+    {
+        //文件具体地址
+        string type = "";
+
+        public Query_ShowPDF(string FileType)
+        {
+            InitializeComponent();
+            type = FileType;
+            StartPosition = FormStartPosition.CenterScreen;
+        }
+
+        private void Query_ShowPDF_Load(object sender, EventArgs e)
+        {
+            PDFDocument.FilePath = type;
+        }
+
+        private void PDFOperater_KeyDown(object sender, KeyEventArgs e)
+        {
+
+        }
+    }
+}

+ 123 - 0
UAS-MES/FunctionCode/Query/Query_ShowPDF.resx

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

+ 64 - 0
UAS-MES/FunctionCode/Query/Query_ShowPicture.Designer.cs

@@ -0,0 +1,64 @@
+namespace UAS_MES.Query
+{
+    partial class Query_ShowPicture
+    {
+        /// <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.PicBox = new System.Windows.Forms.PictureBox();
+            ((System.ComponentModel.ISupportInitialize)(this.PicBox)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // PicBox
+            // 
+            this.PicBox.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.PicBox.Location = new System.Drawing.Point(0, 0);
+            this.PicBox.Name = "PicBox";
+            this.PicBox.Size = new System.Drawing.Size(1102, 686);
+            this.PicBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.PicBox.TabIndex = 0;
+            this.PicBox.TabStop = false;
+            // 
+            // Query_ShowPicture
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1102, 686);
+            this.Controls.Add(this.PicBox);
+            this.Name = "Query_ShowPicture";
+            this.Text = "作业指导书";
+            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+            this.Load += new System.EventHandler(this.Query_ShowPicture_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.PicBox)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.PictureBox PicBox;
+    }
+}

+ 29 - 0
UAS-MES/FunctionCode/Query/Query_ShowPicture.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.Query
+{
+    public partial class Query_ShowPicture : Form
+    {
+        string type = "";
+
+        public Query_ShowPicture(string FileType)
+        {
+            InitializeComponent();
+            StartPosition = FormStartPosition.CenterScreen;
+            type = FileType;
+        }
+
+        private void Query_ShowPicture_Load(object sender, EventArgs e)
+        {
+            PicBox.Image = Image.FromFile(type);
+        }
+    }
+}

+ 120 - 0
UAS-MES/FunctionCode/Query/Query_ShowPicture.resx

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

+ 65 - 0
UAS-MES/FunctionCode/Query/Query_ShowVideo.Designer.cs

@@ -0,0 +1,65 @@
+namespace UAS_MES.Query
+{
+    partial class Query_ShowVideo
+    {
+        /// <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()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_ShowVideo));
+            this.MediaPlayer = new AxWMPLib.AxWindowsMediaPlayer();
+            ((System.ComponentModel.ISupportInitialize)(this.MediaPlayer)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // MediaPlayer
+            // 
+            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.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.MediaPlayer)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private AxWMPLib.AxWindowsMediaPlayer MediaPlayer;
+    }
+}

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

@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace UAS_MES.Query
+{
+    public partial class Query_ShowVideo : Form
+    {
+
+        string type = "";
+
+        public Query_ShowVideo(string FileType)
+        {
+            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 - 4
UAS-MES/FunctionCode/Query/Query_ShowInstruction.resx → UAS-MES/FunctionCode/Query/Query_ShowVideo.resx

@@ -117,9 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="PDFDocument.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
   <data name="MediaPlayer.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
     <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
@@ -127,7 +124,7 @@
         ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAtwAAAAIB
         AAAAAQAAAAAAAAAAAAAAAKIAAAAAAwAACAAAAAAABQAAAAAAAADwPwMAAAAAAAUAAAAAAAAAAAAIAAIA
         AAAAAAMAAQAAAAsA//8DAAAAAAALAP//CAACAAAAAAADADIAAAALAAAACAAKAAAAZgB1AGwAbAAAAAsA
-        AAALAAAACwD//wsA//8LAAAACAACAAAAAAAIAAIAAAAAAAgAAgAAAAAACAACAAAAAAALAAAAmGgAAAQ7
+        AAALAAAACwD//wsA//8LAAAACAACAAAAAAAIAAIAAAAAAAgAAgAAAAAACAACAAAAAAALAAAAK3QAAKhI
         AAAL
 </value>
   </data>