瀏覽代碼

Merge branch 'master' of http://192.168.1.123:10080/SDD1/HOZ

# Conflicts:
#	MeasureData/CutHole.cs
#	MeasureData/MeasureFile.cs
HaoShuang 5 年之前
父節點
當前提交
52c9773a88
共有 6 個文件被更改,包括 28 次插入48 次删除
  1. 1 1
      FileManager/Serialize.cs
  2. 12 3
      HOZProject/FormUnitControl.cs
  3. 2 2
      HOZProject/Program.cs
  4. 1 31
      MeasureData/CutHole.cs
  5. 10 9
      MeasureData/MeasureFile.cs
  6. 2 2
      MeasureData/SemPosition.cs

+ 1 - 1
FileManager/Serialize.cs

@@ -109,7 +109,7 @@ namespace FileManager
             bool value = false;
             string sHelp = m_sValue;
             //transform(sHelp.GetEnumerator(), sHelp.end(), sHelp.GetEnumerator(), toupper);
-            sHelp.ToUpper();
+            sHelp=sHelp.ToUpper();
             if (sHelp == "TRUE")
                 return true;
             return value;

+ 12 - 3
HOZProject/FormUnitControl.cs

@@ -617,12 +617,12 @@ namespace HOZProject
             MeasureFile mf = new MeasureFile();
 
             XmlDocument doc = new XmlDocument();
-            doc.Load("test.xml");//载入xml文件
+            doc.Load("test_opton.msf");//载入xml文件
             XmlNode root = doc.SelectSingleNode("XMLData");
 
             mf.Serialize(false, doc, root);
 
-            doc.Save("test.xml");
+            doc.Save("test_opton.msf");
         }
         #endregion
 
@@ -631,7 +631,7 @@ namespace HOZProject
         {
             MeasureFile mf = new MeasureFile();
 
-            mf.FileName = "test_opton.msf";
+            mf.FileName = path + "\\test_opton.msf";
             mf.FilePath = path;
 
             CutHole ch = new CutHole();
@@ -672,6 +672,15 @@ namespace HOZProject
 
             mf.ListCutHole.Add(ch);
 
+            MeasureParam md = new MeasureParam();
+            md.SampleName = "aaaaaa";
+            md.PT = true;
+            md.PTTemp = "bbbbb";
+            md.FIBTemp = "cccc";
+            md.FocusMode = false;
+
+            mf.MParam = md;
+
             mf.New();
             //XmlDocument doc = new XmlDocument();
             //doc.Load(mf.FilePath+"\\" + mf.FileName);//载入xml文件

+ 2 - 2
HOZProject/Program.cs

@@ -17,8 +17,8 @@ namespace HOZProject
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             //Application.Run(new FormUCMain());
-            //Application.Run(new FormUnitControl());
-            Application.Run(new FormMeasureTest());
+            Application.Run(new FormUnitControl());
+            //Application.Run(new FormMeasureTest());
         }
     }
 }

+ 1 - 31
MeasureData/CutHole.cs

@@ -139,31 +139,7 @@ namespace MeasureData
             SampleName.AssignValue(this.HoleName);
             slo_cuthole.Register("SampleName", SampleName);
 
-            Slo slo_sp = new Slo();
-            xDouble ptx = new xDouble();
-            ptx.AssignValue(this.Position.X);
-            slo_sp.Register("X", ptx);
-
-            xDouble pty = new xDouble();
-            pty.AssignValue(this.Position.X);
-            slo_sp.Register("Y", pty);
-
-            xDouble ptz = new xDouble();
-            ptz.AssignValue(this.Position.Z);
-            slo_sp.Register("Z", ptz);
-
-            xDouble ptt = new xDouble();
-            ptt.AssignValue(this.Position.T);
-            slo_sp.Register("T", ptt);
-
-            xDouble ptr = new xDouble();
-            ptr.AssignValue(this.Position.R);
-            slo_sp.Register("R", ptr);
-
-            xDouble ptm = new xDouble();
-            ptx.AssignValue(this.Position.M);
-            slo_sp.Register("M", ptm);
-            slo_cuthole.Register("Position", slo_sp);
+            slo_cuthole.Register("Position", this.Position);
            
             //操作步骤
             xInt OPT = new xInt();
@@ -199,12 +175,6 @@ namespace MeasureData
                 this.END = END.value();
                 this.STATE = (State)STATE.value();
                 this.SWITCH = SWITCH.value();
-                this.Position.X = (float)ptx.value();
-                this.Position.Y = (float)pty.value();
-                this.Position.Z = (float)ptz.value();
-                this.Position.T = (float)ptt.value();
-                this.Position.R = (float)ptr.value();
-                this.Position.M = (float)ptm.value();
             }
         }
 

+ 10 - 9
MeasureData/MeasureFile.cs

@@ -72,6 +72,7 @@ namespace MeasureData
             }
             else
             {
+                XmlManager.CreateXmlFile(this.FileName);
                 return 2;
             }
         }
@@ -133,18 +134,18 @@ namespace MeasureData
         //新建
         public bool New()
         {
-            //int ret = CreateXml();
-            //if(ret>0)
-            //{
-            //    XmlDocument doc = new XmlDocument();
-            //    doc.Load(this.FilePath + "\\" + this.FileName);//载入xml文件
+            int ret = CreateXml();
+            if (ret > 0)
+            {
+                XmlDocument doc = new XmlDocument();
+                doc.Load(this.FileName);//载入xml文件
 
-            //    XmlNode root = doc.SelectSingleNode("XMLData");
+                XmlNode root = doc.SelectSingleNode("XMLData");
 
-            //    Serialize(true, doc, root);
+                Serialize(true, doc, root);
 
-            //    doc.Save(this.FilePath + "\\" + this.FileName);
-            //}
+                doc.Save(this.FileName);
+            }
 
             // 设置路径为初始默认路径
             this.FileName = UNTITLED_FILE_NAME;

+ 2 - 2
MeasureData/SemPosition.cs

@@ -156,7 +156,7 @@ namespace MeasureData
             slo_sp.Register("X", ptx);
 
             xDouble pty = new xDouble();
-            pty.AssignValue(this.X);
+            pty.AssignValue(this.Y);
             slo_sp.Register("Y", pty);
 
             xDouble ptz = new xDouble();
@@ -172,7 +172,7 @@ namespace MeasureData
             slo_sp.Register("R", ptr);
 
             xDouble ptm = new xDouble();
-            ptx.AssignValue(this.M);
+            ptm.AssignValue(this.M);
             slo_sp.Register("M", ptm);
 
             if (isStoring)