Просмотр исходного кода

Merge branch 'dev' of http://192.168.1.123:10080/gaoshipeng/OTS2_0 into dev

sunyi 5 лет назад
Родитель
Сommit
6a80e9791b

+ 0 - 64
OTS/OTSIncAReportApp/Frm_UserProgress.designer.cs

@@ -1,64 +0,0 @@
-namespace OTSIncAReportMailInterface
-{
-    partial class Frm_UserProgress
-    {
-        /// <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.progressBar1 = new System.Windows.Forms.ProgressBar();
-            this.SuspendLayout();
-            // 
-            // progressBar1
-            // 
-            this.progressBar1.Location = new System.Drawing.Point(0, 0);
-            this.progressBar1.Name = "progressBar1";
-            this.progressBar1.Size = new System.Drawing.Size(657, 26);
-            this.progressBar1.TabIndex = 0;
-            // 
-            // Frm_UserProgress
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(800, 50);
-            this.Controls.Add(this.progressBar1);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.MaximizeBox = false;
-            this.MinimizeBox = false;
-            this.Name = "Frm_UserProgress";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
-            this.Text = "进度显示";
-            this.TopMost = true;
-            this.Load += new System.EventHandler(this.Frm_UserProgress_Load);
-            this.SizeChanged += new System.EventHandler(this.Frm_UserProgress_SizeChanged);
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.ProgressBar progressBar1;
-    }
-}

+ 0 - 120
OTS/OTSIncAReportApp/Frm_UserProgress.resx

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

+ 0 - 9
OTS/OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -264,12 +264,6 @@
     <Compile Include="DataOperation\Model\Particle.cs" />
     <Compile Include="DataOperation\Model\ResultFile.cs" />
     <Compile Include="DataOperation\Model\XRay.cs" />
-    <Compile Include="Frm_UserProgress.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Frm_UserProgress.designer.cs">
-      <DependentUpon>Frm_UserProgress.cs</DependentUpon>
-    </Compile>
     <Compile Include="frmMultiSourceSelect.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -466,9 +460,6 @@
     <EmbeddedResource Include="Control_Grids\ResultGrid.resx">
       <DependentUpon>ResultGrid.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Frm_UserProgress.resx">
-      <DependentUpon>Frm_UserProgress.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="frmMultiSourceSelect.resx">
       <DependentUpon>frmMultiSourceSelect.cs</DependentUpon>
     </EmbeddedResource>

+ 7 - 0
OTS/OTSModelSharp/Measure/GetStageInfo/DlgStageMgr.Designer.cs

@@ -63,6 +63,7 @@
             this.m_ctrlBtnExport.TabIndex = 6;
             this.m_ctrlBtnExport.Text = "导出";
             this.m_ctrlBtnExport.UseVisualStyleBackColor = true;
+            this.m_ctrlBtnExport.Click += new System.EventHandler(this.OnClickedBtnExport);
             // 
             // IDC_BTN_IMPORT
             // 
@@ -72,6 +73,7 @@
             this.IDC_BTN_IMPORT.TabIndex = 5;
             this.IDC_BTN_IMPORT.Text = "导入";
             this.IDC_BTN_IMPORT.UseVisualStyleBackColor = true;
+            this.IDC_BTN_IMPORT.Click += new System.EventHandler(this.OnClickedBtnImport);
             // 
             // m_ctrlBtnRename
             // 
@@ -81,6 +83,7 @@
             this.m_ctrlBtnRename.TabIndex = 4;
             this.m_ctrlBtnRename.Text = "重命名";
             this.m_ctrlBtnRename.UseVisualStyleBackColor = true;
+            this.m_ctrlBtnRename.Click += new System.EventHandler(this.OnClickedBtnRename);
             // 
             // m_ctrlBtnDelete
             // 
@@ -90,6 +93,7 @@
             this.m_ctrlBtnDelete.TabIndex = 3;
             this.m_ctrlBtnDelete.Text = "删除";
             this.m_ctrlBtnDelete.UseVisualStyleBackColor = true;
+            this.m_ctrlBtnDelete.Click += new System.EventHandler(this.OnClickedBtnDel);
             // 
             // m_ctrlBtnApply
             // 
@@ -99,6 +103,7 @@
             this.m_ctrlBtnApply.TabIndex = 2;
             this.m_ctrlBtnApply.Text = "应用";
             this.m_ctrlBtnApply.UseVisualStyleBackColor = true;
+            this.m_ctrlBtnApply.Click += new System.EventHandler(this.OnClickedBtnAply);
             // 
             // m_ctrlStagePicture
             // 
@@ -116,6 +121,7 @@
             this.m_ctrlListBoxStageList.Name = "m_ctrlListBoxStageList";
             this.m_ctrlListBoxStageList.Size = new System.Drawing.Size(294, 268);
             this.m_ctrlListBoxStageList.TabIndex = 0;
+            this.m_ctrlListBoxStageList.SelectedValueChanged += new System.EventHandler(this.OnSelchangeListStage);
             // 
             // DlgStageMgr
             // 
@@ -126,6 +132,7 @@
             this.Name = "DlgStageMgr";
             this.Text = "DlgStageMgr";
             this.Load += new System.EventHandler(this.DlgStageMgr_Load);
+            this.Paint += new System.Windows.Forms.PaintEventHandler(this.OnPaint);
             this.groupBox1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.m_ctrlStagePicture)).EndInit();
             this.ResumeLayout(false);

+ 63 - 26
OTS/OTSModelSharp/Measure/GetStageInfo/DlgStageMgr.cs

@@ -57,12 +57,20 @@ namespace OTSModelSharp.Measure.GetStageInfo
 
         private void DlgStageMgr_Load(object sender, EventArgs e)
         {
-
+            SetStageListControlData();
+            m_ctrlListBoxStageList.Text = MultiLang.GetInstance().GetStringByKey(OTSModelresource.GrpOtherParam, OTSModelresource.DlgStageMgr_StageList);
+            m_ctrlBtnApply.Text = MultiLang.GetInstance().GetStringByKey(OTSModelresource.GrpOtherParam, OTSModelresource.DlgStageMgr_Apply);
+            m_ctrlBtnDelete.Text = MultiLang.GetInstance().GetStringByKey(OTSModelresource.GrpOtherParam, OTSModelresource.DlgStageMgr_Delete);
+            m_ctrlBtnRename.Text=MultiLang.GetInstance().GetStringByKey(OTSModelresource.GrpOtherParam, OTSModelresource.DlgStageMgr_Rename);
+            IDC_BTN_IMPORT.Text= MultiLang.GetInstance().GetStringByKey(OTSModelresource.GrpOtherParam, OTSModelresource.DlgStageMgr_Import);
+            m_ctrlBtnExport.Text=MultiLang.GetInstance().GetStringByKey(OTSModelresource.GrpOtherParam, OTSModelresource.DlgStageMgr_Export);
+
+            this.Text=MultiLang.GetInstance().GetStringByKey(OTSModelresource.GrpOtherParam, OTSModelresource.DlgStageMgr_Title);
         }
 
 
         // CDlgStageMgr message map
-        public void OnClickedBtnImport()
+        public void OnClickedBtnImport(object sender, EventArgs e)
         {
             loger.Trace("OnClickedBtnImport: import a stage from txt file.");
 
@@ -112,7 +120,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
 
         }
 
-        public void OnClickedBtnAply()
+        public void OnClickedBtnAply(object sender, EventArgs e)
         {
 
             loger.Info("OnClickedBtnAply: the selected stage will be the working stage.");
@@ -132,7 +140,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
             this.Close();   //CDialog::OnOK();
         }
 
-        public void OnClickedBtnDel()
+        public void OnClickedBtnDel(object sender, EventArgs e)
         {
             loger.Info("OnClickedBtnDel: the selected stage will be deleted.");
 
@@ -161,47 +169,76 @@ namespace OTSModelSharp.Measure.GetStageInfo
 
         }
 
-        public void OnClickedBtnExport()
+        public void OnClickedBtnExport(object sender, EventArgs e)
         {
             loger.Info("OnClickedBtnExport: the selected stage will be export stage into a txt.");
 
             UpdateStageFileData(true);
+            // export a stage into text file
+            SaveFileDialog saveFileDialog = new SaveFileDialog();
+            saveFileDialog.DefaultExt = null;
+            saveFileDialog.InitialDirectory = null;
+            saveFileDialog.CheckPathExists = true;
+            saveFileDialog.Filter = "txt files(*.txt)|*.txt|All files(*.*)|*.*";
 
+            DialogResult dr = saveFileDialog.ShowDialog();
 
-            // export a stage into text file
-            CFileDialog dlg(FALSE, NULL, NULL, OFN_FILEMUSTEXIST, TEXTFILE_FILTER);
-            if (dlg.DoModal() == IDOK)
+            if (dr == System.Windows.Forms.DialogResult.OK)
             {
-                // get file path
-                CString strPathName = dlg.GetPathName() + TEXTFILE_FILE_EXT;
-                if (strPathName.IsEmpty())
+                string strPathName = saveFileDialog.FileName;
+                if (string.IsNullOrEmpty(strPathName))
                 {
-                    LogErrorTrace(__FILE__, __LINE__, _T("OnClickedBtnExport: empty path."));
+                    loger.Error("OnClickedBtnExport: empty path.");
                     return;
                 }
-                m_pStageFile->SaveStageIntoTextFile(m_nListBoxStageList, strPathName);
+                m_pStageFile.SaveStageIntoTextFile(m_nListBoxStageList, strPathName);
             }
             else
             {
-                LogErrorTrace(__FILE__, __LINE__, _T("OnClickedBtnExport: export action is cancled."));
+                loger.Error("OnClickedBtnExport: export action is cancled.");
                 return;
             }
+            SetStageListControlData();
+        }
 
-            SaveFileDialog saveFileDialog = new SaveFileDialog();
-            saveFileDialog.DefaultExt = null;
-            saveFileDialog.InitialDirectory = null;
-            saveFileDialog.
+        public void OnClickedBtnRename(object sender, EventArgs e)
+        {
+            loger.Trace("OnClickedBtnRename: the selected stage will be renamed.");
 
-            DialogResult dr = saveFileDialog.ShowDialog();
-            if (dr == System.Windows.Forms.DialogResult.OK && !string.IsNullOrEmpty(saveFileDialog.FileName.ToString()))
+            UpdateStageFileData(true);
+
+            DlgStageRename dlg = new DlgStageRename(); ;
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                CStage pStage = m_pStageFile.GetStagesList()[m_nListBoxStageList];
+                pStage.SetName(dlg.m_sStageName);
+                m_pStageFile.SetModify();
+            }
+            else
             {
-                StreamWriter sw = new StreamWriter(filename, true, Encoding.UTF8);
-                sw.Write(textBox1.Text);
-                sw.Close();
+                loger.Error("OnClickedBtnRename: rename action is cancled.");
+                return;
             }
 
+            SetStageListControlData();
+        }
 
+        void OnSelchangeListStage(object sender, EventArgs e)
+        {
+            loger.Trace("OnSelchangeListStage: change a working stage.");
+            UpdateStageFileData(true);
             SetStageListControlData();
+            DrawStage();
+        }
+
+        void OnPaint(object sender, PaintEventArgs e)
+        {
+            //CPaintDC dc(this); // device context for painting
+
+            if (!m_bShowFlag)
+            {
+                this.DrawStage();
+            }
         }
 
         public void SetStageListControlData()
@@ -382,9 +419,9 @@ namespace OTSModelSharp.Measure.GetStageInfo
         }
 
         // soft pack id get and set
-        public OTS_SOFT_PACKAGE_ID GetPackId() { return m_nPackId; }
+        public otsdataconst.OTS_SOFT_PACKAGE_ID GetPackId() { return m_nPackId; }
 
-        public void SetPackId(OTS_SOFT_PACKAGE_ID a_nPackId) { m_nPackId = a_nPackId; }
+        public void SetPackId(otsdataconst.OTS_SOFT_PACKAGE_ID a_nPackId) { m_nPackId = a_nPackId; }
 
         // draw shape
         public void DrawShape(Rectangle a_PixRect, Object a_pDC, DOMAIN_SHAPE a_nShape, bool a_bIsRand) { }
@@ -470,7 +507,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
 
         }
 
-        public CStageFile ShowStageMgrDialog(OTS_SOFT_PACKAGE_ID a_nPackId, CStageFile a_pStageFile)
+        public CStageFile ShowStageMgrDialog(otsdataconst.OTS_SOFT_PACKAGE_ID a_nPackId, CStageFile a_pStageFile)
         {
             if (a_pStageFile == null)
             {

+ 0 - 1
OTS/OTSModelSharp/OTSModelSharp.csproj

@@ -157,7 +157,6 @@
     <Compile Include="Measure\GetStageInfo\DlgStageRename.Designer.cs">
       <DependentUpon>DlgStageRename.cs</DependentUpon>
     </Compile>
-    <Compile Include="Measure\GetStageInfo\DlgStageRename2.cs" />
     <Compile Include="Measure\GetStageInfo\StageFile.cs" />
     <Compile Include="Measure\GetXrayInfo\PosXrayFileMgr.cs" />
     <Compile Include="OTSControl\EBrukerErrorCode.cs" />