Browse Source

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

gsp 3 years ago
parent
commit
56e83d3f65

+ 16 - 5
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -3209,16 +3209,27 @@ namespace OTSMeasureApp
                     DeleteHoleBSEImageData();
                     DeleteHoleBSEImageData();
                     break;
                     break;
                 case "SlopFocusMenuItem":
                 case "SlopFocusMenuItem":
-                    _5_OTSMeasureStatuImageFun.SlopFocus slopFocus = new _5_OTSMeasureStatuImageFun.SlopFocus();
+                    _5_OTSMeasureStatuImageFun.SlopFocus slopFocus = new _5_OTSMeasureStatuImageFun.SlopFocus(this);
                     slopFocus.Show();
                     slopFocus.Show();
-                    if (slopFocus.result)
-                    {
-                        m_MeasureAppForm.m_ProjParam.GetWorkSample().GetMsrParams().SlopParam = slopFocus.GetCSlopFocusParam();
-                    }
                     
                     
                     break;
                     break;
             }
             }
         }
         }
+
+        public bool setSlopFocusParam(_5_OTSMeasureStatuImageFun.SlopFocus slopFocus)
+        {
+            if (slopFocus == null)
+            {
+                return false;
+            }
+            else
+            {
+                m_MeasureAppForm.m_ProjParam.GetWorkSample().GetMsrParams().SlopParam = slopFocus.GetCSlopFocusParam();
+                return true;
+            }
+
+        }
+
         protected override bool ProcessDialogKey(Keys keyData)
         protected override bool ProcessDialogKey(Keys keyData)
         {
         {
 
 

+ 21 - 18
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/SlopFocus.cs

@@ -18,10 +18,12 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
         COTSControlFunExport cfun;
         COTSControlFunExport cfun;
         CSlopFocusParam slopFocusParam;
         CSlopFocusParam slopFocusParam;
         bool m_result=false;
         bool m_result=false;
+        OTSSamplespaceWindow oTSSamplespaceWindow;
         public bool result {get => m_result; set => m_result = value; }
         public bool result {get => m_result; set => m_result = value; }
-    public SlopFocus()
+        public SlopFocus(OTSSamplespaceWindow a_oTSSamplespaceWindow)
         {
         {
             InitializeComponent();
             InitializeComponent();
+            oTSSamplespaceWindow = a_oTSSamplespaceWindow;
         }
         }
         public CSlopFocusParam GetCSlopFocusParam()
         public CSlopFocusParam GetCSlopFocusParam()
         {
         {
@@ -54,7 +56,8 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
             slopFocusParam.SecondWD = dPW2;
             slopFocusParam.SecondWD = dPW2;
             slopFocusParam.ThirdPoint = new Point(iPX3, iPY3);
             slopFocusParam.ThirdPoint = new Point(iPX3, iPY3);
             slopFocusParam.ThirdWD = dPW3;
             slopFocusParam.ThirdWD = dPW3;
-            m_result=true;
+            oTSSamplespaceWindow.setSlopFocusParam(this);
+            this.Close();
         }
         }
 
 
         private void SlopFocus_Load(object sender, EventArgs e)
         private void SlopFocus_Load(object sender, EventArgs e)
@@ -67,12 +70,12 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
 
 
         private void bn_FirstPoint_Click(object sender, EventArgs e)
         private void bn_FirstPoint_Click(object sender, EventArgs e)
         {
         {
-            //double a, b, c;
-            //a = b = 20;
-            //c = 20;
-            //cfun.SetSemPositionXY(a, b, c);
-            //cfun.SetSemWorkingDistance(c);
-                        double Px = 0;
+            double a, b, c;
+            a = b = 20;
+            c = 20;
+            cfun.SetSemPositionXY(a, b, c);
+            cfun.SetSemWorkingDistance(c);
+            double Px = 0;
             double Py = 0;
             double Py = 0;
             double Pr = 0;
             double Pr = 0;
             if(cfun.GetSemPositionXY(ref Px,ref Py,ref Pr))
             if(cfun.GetSemPositionXY(ref Px,ref Py,ref Pr))
@@ -89,11 +92,11 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
 
 
         private void bn_SecondPoint_Click(object sender, EventArgs e)
         private void bn_SecondPoint_Click(object sender, EventArgs e)
         {
         {
-            //double a, b, c;
-            //a = b =10;
-            //c = 10;
-            //cfun.SetSemPositionXY(a,b,c);
-            //cfun.SetSemWorkingDistance(c);
+            double a, b, c;
+            a = b = 10;
+            c = 10;
+            cfun.SetSemPositionXY(a, b, c);
+            cfun.SetSemWorkingDistance(c);
 
 
             double Px = 0;
             double Px = 0;
             double Py = 0;
             double Py = 0;
@@ -113,11 +116,11 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
 
 
         private void bn_ThirdPoint_Click(object sender, EventArgs e)
         private void bn_ThirdPoint_Click(object sender, EventArgs e)
         {
         {
-            //double a, b, c;
-            //a = b = 30;
-            //c = 30;
-            //cfun.SetSemPositionXY(a, b, c);
-            //cfun.SetSemWorkingDistance(c);
+            double a, b, c;
+            a = b = 30;
+            c = 30;
+            cfun.SetSemPositionXY(a, b, c);
+            cfun.SetSemWorkingDistance(c);
 
 
             double Px = 0;
             double Px = 0;
             double Py = 0;
             double Py = 0;

+ 34 - 12
OTSIncAReportApp/2-CommonFunction/OTSDataMgrFunction/ResultDataMgr.cs

@@ -80,44 +80,66 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
         }
         }
         public bool AddDataResult(string str_path)
         public bool AddDataResult(string str_path)
         {
         {
-               
-            if (str_path == "")
-            {
-                return false;
-            }
-
             //加载测量结果文件
             //加载测量结果文件
             Dictionary<string, object> suggestions = DataOperation.DataAccess.XMLoperate.GetXMLAllInfo(str_path);
             Dictionary<string, object> suggestions = DataOperation.DataAccess.XMLoperate.GetXMLAllInfo(str_path);
 
 
             string name = System.IO.Path.GetFileName(str_path);
             string name = System.IO.Path.GetFileName(str_path);
             int workingid = (ResultFileId++);
             int workingid = (ResultFileId++);
             string path = System.IO.Path.GetDirectoryName(str_path);
             string path = System.IO.Path.GetDirectoryName(str_path);
-            if (ResultFilesList.Find(s => s.FileName == name) != null)
+            if (ResultFilesList.Find(s => s.FilePath == path) != null)
+            {
+                MessageBox.Show("Already have the same result!");
+                return false;
+            }
+            string strname = UpdateName(name, ResultFilesList);
+            if (strname == "")
             {
             {
                 MessageBox.Show("Already have the same result!");
                 MessageBox.Show("Already have the same result!");
                 return false;
                 return false;
             }
             }
 
 
+
             DataOperation.Model.ResultFile result = new DataOperation.Model.ResultFile()
             DataOperation.Model.ResultFile result = new DataOperation.Model.ResultFile()
             {
             {
                 FileId = workingid.ToString(),
                 FileId = workingid.ToString(),
-                FileName = name,
+                FileName = strname,
                 FilePath = path,
                 FilePath = path,
                 ResultInfo = suggestions
                 ResultInfo = suggestions
             };
             };
             ResultFilesList.Add(result);
             ResultFilesList.Add(result);
-          
+
             SetWorkingResult(ResultFilesList.IndexOf(result));
             SetWorkingResult(ResultFilesList.IndexOf(result));
-          
+
             FieldData fieldData = new FieldData(path);
             FieldData fieldData = new FieldData(path);
             List<Field> fieldlist = fieldData.GetFieldList();
             List<Field> fieldlist = fieldData.GetFieldList();
             CurResultFile.List_OTSField = fieldlist;
             CurResultFile.List_OTSField = fieldlist;
-          
 
 
-           
+
+
             return true;
             return true;
         }
         }
 
 
+        private string UpdateName(string name, List<ResultFile> ResultFilesList)
+        {
+            int reg = 51;
+            if (ResultFilesList.Find(s => s.FileName == name) != null)
+            {
+                for (int i = 1; i < reg; i++)
+                {
+                    string str = name.Split('.')[0].ToString() + "(" + i.ToString() + ")" + name.Split('.')[1].ToString();
+                    if (ResultFilesList.Find(s => s.FileName == str) == null)
+                    {
+                        return name.Split('.')[0].ToString() + "(" + i.ToString() + ")" + name.Split('.')[1].ToString();
+
+                    }
+                }
+            }
+            else
+            {
+                return name;
+            }
+            return "";
+        }
         #endregion
         #endregion
 
 
         #region 获取组合项相关方法
         #region 获取组合项相关方法