@wang_qi0307 5 years ago
parent
commit
3631e155a0
1 changed files with 69 additions and 53 deletions
  1. 69 53
      MeasureData/ConfigFile.cs

+ 69 - 53
MeasureData/ConfigFile.cs

@@ -13,6 +13,22 @@ namespace MeasureData
     public class ConfigFile : ISlo
     {
         #region 内容
+        //文件名
+        private string m_fileName;
+        public string FileName
+        {
+            get { return this.m_fileName; }
+            set { this.m_fileName = value; }
+        }
+
+        //文件路径
+        private string m_filepath;
+        public string FilePath
+        {
+            get { return this.m_filepath; }
+            set { this.m_filepath = value; }
+        }
+
         public MeasureParam m_Config;
         #endregion
 
@@ -92,47 +108,47 @@ namespace MeasureData
         public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
         {
             Slo sFile = new Slo();
-
-            xBool isPhotograph = new xBool();
-            xBool ptDepostion = new xBool();
-            isPhotograph.AssignValue(m_Config.Is_Photograph);
-            ptDepostion.AssignValue(m_Config.PT);
-            sFile.Register("Is_Photograph", isPhotograph);
-            sFile.Register("PT_Depostion", ptDepostion);
-
-            xString ptELYFile = new xString();
-            xString fibELYFile = new xString();
-            ptELYFile.AssignValue(m_Config.PTTemp);
-            fibELYFile.AssignValue(m_Config.FIBTemp);
-            sFile.Register("PT_ELYFile", ptELYFile);
-            sFile.Register("FIB_ELYFile", fibELYFile);
-
-            xDouble stretchMagnification = new xDouble();
-            xDouble locationMagnification = new xDouble();
-            xDouble locationVoltage = new xDouble();
-            xDouble photographMagnification = new xDouble();
-            xDouble photographVoltage = new xDouble();
-            stretchMagnification.AssignValue(m_Config.Stretch_Magnification);
-            locationMagnification.AssignValue(m_Config.Location_Magnification);
-            locationVoltage.AssignValue(m_Config.Location_Voltage);
-            photographMagnification.AssignValue(m_Config.Photograph_Magnification);
-            photographVoltage.AssignValue(m_Config.Photograph_Voltage);
-            sFile.Register("Strectch_Magnification", stretchMagnification);
-            sFile.Register("Locatio_Magnification", locationMagnification);
-            sFile.Register("Location_Voltage", locationVoltage);
-            sFile.Register("Photograph_Magnification", photographMagnification);
-            sFile.Register("Photograph_Voltage", photographVoltage);
-
-            xDouble correctionAngle = new xDouble();
-            correctionAngle.AssignValue(m_Config.Correction_Angle);
-            sFile.Register("Correction_Angle", correctionAngle);
-
-            xString sampleType = new xString();
-            xString _firm = new xString();
-            sampleType.AssignValue(m_Config.SampleName);
-            _firm.AssignValue(m_Config.Firm);
-            sFile.Register("Sample_Type", sampleType);
-            sFile.Register("Firm", _firm);
+            sFile.Register("Param", this.m_Config);
+            //xBool isPhotograph = new xBool();
+            //xBool ptDepostion = new xBool();
+            //isPhotograph.AssignValue(m_Config.Is_Photograph);
+            //ptDepostion.AssignValue(m_Config.PT);
+            //sFile.Register("Is_Photograph", isPhotograph);
+            //sFile.Register("PT_Depostion", ptDepostion);
+
+            //xString ptELYFile = new xString();
+            //xString fibELYFile = new xString();
+            //ptELYFile.AssignValue(m_Config.PTTemp);
+            //fibELYFile.AssignValue(m_Config.FIBTemp);
+            //sFile.Register("PT_ELYFile", ptELYFile);
+            //sFile.Register("FIB_ELYFile", fibELYFile);
+
+            //xDouble stretchMagnification = new xDouble();
+            //xDouble locationMagnification = new xDouble();
+            //xDouble locationVoltage = new xDouble();
+            //xDouble photographMagnification = new xDouble();
+            //xDouble photographVoltage = new xDouble();
+            //stretchMagnification.AssignValue(m_Config.Stretch_Magnification);
+            //locationMagnification.AssignValue(m_Config.Location_Magnification);
+            //locationVoltage.AssignValue(m_Config.Location_Voltage);
+            //photographMagnification.AssignValue(m_Config.Photograph_Magnification);
+            //photographVoltage.AssignValue(m_Config.Photograph_Voltage);
+            //sFile.Register("Strectch_Magnification", stretchMagnification);
+            //sFile.Register("Locatio_Magnification", locationMagnification);
+            //sFile.Register("Location_Voltage", locationVoltage);
+            //sFile.Register("Photograph_Magnification", photographMagnification);
+            //sFile.Register("Photograph_Voltage", photographVoltage);
+
+            //xDouble correctionAngle = new xDouble();
+            //correctionAngle.AssignValue(m_Config.Correction_Angle);
+            //sFile.Register("Correction_Angle", correctionAngle);
+
+            //xString sampleType = new xString();
+            //xString _firm = new xString();
+            //sampleType.AssignValue(m_Config.SampleName);
+            //_firm.AssignValue(m_Config.Firm);
+            //sFile.Register("Sample_Type", sampleType);
+            //sFile.Register("Firm", _firm);
 
             if (isStoring)
             {
@@ -142,22 +158,22 @@ namespace MeasureData
             {
                 sFile.Serialize(false, xml, rootNode);
 
-                m_Config.Is_Photograph = isPhotograph.value();
-                m_Config.PT = ptDepostion.value();
+                //m_Config.Is_Photograph = isPhotograph.value();
+                //m_Config.PT = ptDepostion.value();
 
-                m_Config.PTTemp = ptELYFile.value();
-                m_Config.FIBTemp = fibELYFile.value();
+                //m_Config.PTTemp = ptELYFile.value();
+                //m_Config.FIBTemp = fibELYFile.value();
 
-                m_Config.Stretch_Magnification = stretchMagnification.value();
-                m_Config.Location_Magnification = locationMagnification.value();
-                m_Config.Location_Voltage = locationVoltage.value();
-                m_Config.Photograph_Magnification = photographMagnification.value();
-                m_Config.Photograph_Voltage = photographVoltage.value();
+                //m_Config.Stretch_Magnification = stretchMagnification.value();
+                //m_Config.Location_Magnification = locationMagnification.value();
+                //m_Config.Location_Voltage = locationVoltage.value();
+                //m_Config.Photograph_Magnification = photographMagnification.value();
+                //m_Config.Photograph_Voltage = photographVoltage.value();
 
-                m_Config.Correction_Angle = correctionAngle.value();
+                //m_Config.Correction_Angle = correctionAngle.value();
 
-                m_Config.SampleName = sampleType.value();
-                m_Config.Firm = _firm.value();
+                //m_Config.SampleName = sampleType.value();
+                //m_Config.Firm = _firm.value();
             }
         }
     }