Explorar el Código

modify some errors in several forms

CXS hace 5 años
padre
commit
6fa768d530

+ 2 - 2
OTS/OTSIncAMeasureApp/OTSDataMgrFunction/OTSDataMgrFun.cs

@@ -365,11 +365,11 @@ namespace OTSIncAMeasureApp
         }
 
         //将样品台坐标转换为Sem 坐标
-        public System.Windows.Point ChangeOTSToSemCoord(System.Windows.Point POTSCoord)
+        public System.Drawing.Point ChangeOTSToSemCoord(System.Drawing.Point POTSCoord)
         {
         ValueType VSemCoord = new System.Windows.Point();
         m_StageFile.ConverOTSToSEMPoint(POTSCoord,  (System.Drawing.Point)VSemCoord);
-        return (System.Windows.Point)VSemCoord;
+        return (System.Drawing.Point)VSemCoord;
         }
 
         //将Sem 坐标转换为样品台坐标

+ 8 - 0
OTS/OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -299,10 +299,18 @@
     </None>
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\OTSControl\OTSControl.vcxproj">
+      <Project>{3737bd0b-0dbb-4c11-aad1-6e2b9822270b}</Project>
+      <Name>OTSControl</Name>
+    </ProjectReference>
     <ProjectReference Include="..\OTSModelSharp\OTSModelSharp.csproj">
       <Project>{63A944EC-AF52-4BD4-BEFF-B09F5DDDA9B1}</Project>
       <Name>OTSModelSharp</Name>
     </ProjectReference>
+    <ProjectReference Include="..\OTSSysMgrTools\OTSSysMgrTools.csproj">
+      <Project>{3B7695AA-8231-45AC-B493-84390A945D02}</Project>
+      <Name>OTSSysMgrTools</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
     <None Include="Resources\Image\保存.png" />

+ 1 - 1
OTS/OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -160,7 +160,7 @@ namespace OTSIncAMeasureApp
         public static string m_MeasureStauWindowName = "测量状态";
         public static string m_MeasureRetWindowName = "测量结果";
         public static string m_NoWindowName = "未知工作窗口";
-        protected static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
+        public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
         //国际化
         OTSSysMgrTools.Language lan;
         Hashtable table;

+ 79 - 75
OTS/OTSIncAMeasureApp/OTSProgMgrInfo/OTSProgMgrInfoFunction/OTSProgMgrInfoFun.cs

@@ -277,9 +277,9 @@ enum OTS_FIVE_TIES_OPTIONS
         public COTSProgMgrParamFile m_cotsprogmgrparamfileclr;          //参数类
         //
         public CSEMStageData m_csemstagedataclr;                        //SEM样品台处理类
-        public COTSImageScanParam m_cotsimgscanprmclr;                      //图像扫描类
+        public COTSImgScanPrm m_cotsimgscanprmclr;                      //图像扫描类
         public COTSGeneralParameters m_cgenparamclr;                                //一般参数类
-        public COTSImageProcessParam m_cotsimgprocprmclr;                      //图像处理类
+        public COTSImgProcPrm m_cotsimgprocprmclr;                      //图像处理类
         public COTSXRayParam m_cotsxrayprmclr;                            //X-Ray类
 
         //后加
@@ -301,7 +301,7 @@ enum OTS_FIVE_TIES_OPTIONS
             m_cotsprogmgrparamfileclr = new COTSProgMgrParamFile();
             //m_LogFunExport = new CFunExportClass();
             //m_LogFunExport.InitLog(m_csFileName);
-            loger.Trace(m_csFileName);
+            //loger.Trace(m_csFileName);
 
             m_cstageclr = new CStage();
             m_cstagefileclr = new CStageFile();
@@ -326,8 +326,8 @@ enum OTS_FIVE_TIES_OPTIONS
 
             if (!m_cstagefileclr.Load((int)OTS_SOFT_PACKAGE_ID.OTSIncA, true, !PMIF.m_b_checkstagefile))
             {
-                //m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.StageLoad)  加载样品台信息失败");
-                loger.Trace("(OTSProgMgrInfoFun.StageLoad)  加载样品台信息失败");
+                //loger.Error("(OTSProgMgrInfoFun.StageLoad)  加载样品台信息失败");
+                loger.Error("(OTSProgMgrInfoFun.StageLoad)  加载样品台信息失败");
                 return false;
             }
 
@@ -345,8 +345,8 @@ enum OTS_FIVE_TIES_OPTIONS
             CStage ls_cstageclr = m_cstagefileclr.GetWorkingStage();
             if (null == ls_cstageclr)
             {
-                //m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetWorkingStage)  获取正在工作的样品台类失败");
-                loger.Trace("(OTSProgMgrInfoFun.GetWorkingStage)  获取正在工作的样品台类失败");
+                //loger.Error("(OTSProgMgrInfoFun.GetWorkingStage)  获取正在工作的样品台类失败");
+                loger.Error("(OTSProgMgrInfoFun.GetWorkingStage)  获取正在工作的样品台类失败");
                 return ls_cstageclr;
             }
 
@@ -386,8 +386,8 @@ enum OTS_FIVE_TIES_OPTIONS
             //m_LogFunExport.TraceLog("(OTSProgMgrInfoFun.StageSave)  保存样品台信息");
             if (!m_cstagefileclr.Save((int)OTS_SOFT_PACKAGE_ID.OTSIncA))
             {
-                //m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.StageLoad)  保存样品台信息失败");
-                loger.Trace("(OTSProgMgrInfoFun.StageLoad)  保存样品台信息失败");
+                //loger.Error("(OTSProgMgrInfoFun.StageLoad)  保存样品台信息失败");
+                loger.Error("(OTSProgMgrInfoFun.StageLoad)  保存样品台信息失败");
                 return false;
             }
             return true;
@@ -403,8 +403,8 @@ enum OTS_FIVE_TIES_OPTIONS
             List<CStage> l_cstageclr = m_cstagefileclr.GetStagesList();
             if (null == l_cstageclr)
             {
-                //m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetStageList)  获取样品台信息列表失败");
-                loger.Trace("(OTSProgMgrInfoFun.GetStageList)  获取样品台信息列表失败");
+                //loger.Error("(OTSProgMgrInfoFun.GetStageList)  获取样品台信息列表失败");
+                loger.Error("(OTSProgMgrInfoFun.GetStageList)  获取样品台信息列表失败");
                 return l_cstageclr;
             }
             return l_cstageclr;
@@ -831,17 +831,17 @@ enum OTS_FIVE_TIES_OPTIONS
             //取图方式
             //OTS_GET_IMAGE_MODE enum_fetchimgmode = (OTS_GET_IMAGE_MODE)Enum.Parse(typeof(OTS_GET_IMAGE_MODE), PMIF.IDC_COMBO_FETCHIMGMODE.SelectedItem.ToString(), false);
             OTSPeriodicTable.ComboBoxItem enum_fetchimgmode = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_FETCHIMGMODE.SelectedItem;
-            m_cotsimgscanprmclr.SetStartImageMode((otsdataconst.OTS_MEASURE_STOP_MODE)enum_fetchimgmode.Value);
+            m_cotsimgscanprmclr.SetStartImageMode((otsdataconst.OTS_GET_IMAGE_MODE)enum_fetchimgmode.Value);
 
             //扫描图精度
             //OTS_THREE_TIES_OPTIONS enum_imgscanspeed = (OTS_THREE_TIES_OPTIONS)Enum.Parse(typeof(OTS_THREE_TIES_OPTIONS), PMIF.IDC_COMBO_IMGSCANSPEED.SelectedItem.ToString(), false);
             OTSPeriodicTable.ComboBoxItem enum_imgscanspeed = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_IMGSCANSPEED.SelectedItem;
-            m_cotsimgscanprmclr.SetScanImageSpeed((otsdataconst.OTS_MEASURE_STOP_MODE)enum_imgscanspeed.Value);
+            m_cotsimgscanprmclr.SetScanImageSpeed((otsdataconst.OTS_THREE_TIES_OPTIONS)enum_imgscanspeed.Value);
 
             //扫描图尺寸
             //OTS_FIVE_TIES_OPTIONS enum_imgsize = (OTS_FIVE_TIES_OPTIONS)Enum.Parse(typeof(OTS_FIVE_TIES_OPTIONS), PMIF.IDC_COMBO_IMGSIZE.SelectedItem.ToString(), false);
             OTSPeriodicTable.ComboBoxItem enum_imgsize = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_IMGSIZE.SelectedItem;
-            m_cotsimgscanprmclr.SetImagePixelSize((otsdataconst.OTS_MEASURE_STOP_MODE)enum_imgsize.Value);
+            m_cotsimgscanprmclr.SetImagePixelSize((otsdataconst.OTS_FIVE_TIES_OPTIONS)enum_imgsize.Value);
 
             //m_cotsimgscanprmclr.SetShowStopMode(PMIF.IDC_STOP_MODE_SWITCH.Checked);
             //m_cotsimgscanprmclr.SetShowMeasTime(PMIF.IDC_STOP_TIME_SWITCH.Checked);
@@ -855,7 +855,7 @@ enum OTS_FIVE_TIES_OPTIONS
 
             //帧结束方式
             OTSPeriodicTable.ComboBoxItem enum_FrameEndMode = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_FrameEndMode.SelectedItem;
-            m_cotsimgscanprmclr.SetFieldStopMode((otsdataconst.OTS_MEASURE_STOP_MODE)enum_FrameEndMode.Value);
+            m_cotsimgscanprmclr.SetFieldStopMode((otsdataconst.OTS_MEASURE_FIELD_STOP_MODE)enum_FrameEndMode.Value);
 
             //帧结束方式对应参数
             if (PMIF.IDC_COMBO_FrameEndMode.SelectedItem.ToString()== "颗粒百分比")
@@ -905,7 +905,7 @@ enum OTS_FIVE_TIES_OPTIONS
 
             //测量区域形状
             OTSPeriodicTable.ComboBoxItem enum_Shape = (OTSPeriodicTable.ComboBoxItem)PMIF.cBMeasShape.SelectedItem;
-            m_cgenparamclr.SetShape((otsdataconst.OTS_MEASURE_STOP_MODE)enum_Shape.Value);
+            m_cgenparamclr.SetShape((DOMAIN_SHAPE)enum_Shape.Value);
 
             //测量区域大小
             m_cgenparamclr.SetArea(Convert.ToDouble(PMIF.tBMeasArea.Text));
@@ -935,7 +935,7 @@ enum OTS_FIVE_TIES_OPTIONS
 
             //颗粒面积范围 最小 最大
             CDoubleRange crc_partareamin = new CDoubleRange(Convert.ToDouble(PMIF.IDC_EDIT_PARTAREAMIN.Text), Convert.ToDouble(PMIF.IDC_EDIT_PARTAREAMAX.Text));
-            m_cotsimgprocprmclr.SetIncArea(crc_partareamin);
+            m_cotsimgprocprmclr.SetIncAreaRange(crc_partareamin);
 
             //背景灰度范围 最小  最大
             CIntRange crc_backmin = new CIntRange(Convert.ToInt32(PMIF.IDC_EDIT_BACKMIN.Text), Convert.ToInt32(PMIF.IDC_EDIT_BACKMAX.Text));
@@ -954,11 +954,11 @@ enum OTS_FIVE_TIES_OPTIONS
 
             //搜索X-ray精度
             OTSPeriodicTable.ComboBoxItem enum_AUTOBGREMOVETYPE = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_AUTOBGREMOVE_TYPE.SelectedItem;
-            m_cotsimgprocprmclr.SetBGRemoveType((otsdataconst.OTS_MEASURE_STOP_MODE)enum_AUTOBGREMOVETYPE.Value);
+            m_cotsimgprocprmclr.SetBGRemoveType((otsdataconst.OTS_BGREMOVE_TYPE)enum_AUTOBGREMOVETYPE.Value);
 
             //搜索X-ray精度
             OTSPeriodicTable.ComboBoxItem enum_IMAGEMODE = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_AUTO.SelectedItem;
-            m_cotsimgprocprmclr.SetAutoBGRemoveType((otsdataconst.OTS_MEASURE_STOP_MODE)enum_IMAGEMODE.Value);
+            m_cotsimgprocprmclr.SetAutoBGRemoveType((otsdataconst.OTS_AUTOBGREMOVE_TYPE)enum_IMAGEMODE.Value);
         }
 
         /// <summary>
@@ -969,7 +969,7 @@ enum OTS_FIVE_TIES_OPTIONS
 
             //搜索X-ray精度
             OTSPeriodicTable.ComboBoxItem enum_searchxrayspeed = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_SEARCHXRAYSPEED.SelectedItem;
-            m_cotsxrayprmclr.SetSearchSpeed((otsdataconst.OTS_MEASURE_STOP_MODE)enum_searchxrayspeed.Value);
+            m_cotsxrayprmclr.SetSearchSpeed((otsdataconst.OTS_THREE_TIES_OPTIONS)enum_searchxrayspeed.Value);
 
             //搜索X - ray精度对应的时间
             m_cotsxrayprmclr.SetMidSearchAQTime(Convert.ToInt32(PMIF.IDC_TEXTBOX_SEARCHXRAYSPEED_TIME.Text.Trim()));
@@ -979,11 +979,11 @@ enum OTS_FIVE_TIES_OPTIONS
 
             //X-ray扫描方式
             OTSPeriodicTable.ComboBoxItem enum_xrayscanmode = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_XRAYSCANMODE.SelectedItem;
-            m_cotsxrayprmclr.SetScanMode((otsdataconst.OTS_MEASURE_STOP_MODE)enum_xrayscanmode.Value);
+            m_cotsxrayprmclr.SetScanMode((otsdataconst.OTS_X_RAY_SCAN_MODE)enum_xrayscanmode.Value);
 
             //分析X-ray精度
             OTSPeriodicTable.ComboBoxItem enum_analyxrayspeed = (OTSPeriodicTable.ComboBoxItem)PMIF.IDC_COMBO_ANALYXRAYSPEED.SelectedItem;
-            m_cotsxrayprmclr.SetAnalySpeed((otsdataconst.OTS_MEASURE_STOP_MODE)enum_analyxrayspeed.Value);
+            m_cotsxrayprmclr.SetAnalySpeed((otsdataconst.OTS_THREE_TIES_OPTIONS)enum_analyxrayspeed.Value);
 
             //分析X-ray精度对应的时间
             m_cotsxrayprmclr.SetMidAnalyAQTime(Convert.ToInt32(PMIF.IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Text.Trim()));
@@ -1010,7 +1010,7 @@ enum OTS_FIVE_TIES_OPTIONS
         {
             if (false == m_cotsprogmgrparamfileclr.SaveInfoToProgMgrFile((int)OTS_SOFT_PACKAGE_ID.OTSIncA))
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.SaveInfoToProgMgrFile)  将参数保存到文件失败");
+                loger.Error("(OTSProgMgrInfoFun.SaveInfoToProgMgrFile)  将参数保存到文件失败");
                 return false;
             }
             return true;
@@ -1025,42 +1025,42 @@ enum OTS_FIVE_TIES_OPTIONS
             m_cotsprogmgrparamfileclr .LoadInfoFromProgMgrFile((int)OTS_SOFT_PACKAGE_ID.OTSIncA);
             if (null == m_cotsprogmgrparamfileclr)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.LoadParamFun)  LoadInfoFromProgMgrFile失败");
+                loger.Error("(OTSProgMgrInfoFun.LoadParamFun)  LoadInfoFromProgMgrFile失败");
                 return false;
             }
 
             m_csemstagedataclr = m_cstagefileclr.GetStageData();
             if (null == m_csemstagedataclr)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.LoadParamFun)  GetStageData失败");
+                loger.Error("(OTSProgMgrInfoFun.LoadParamFun)  GetStageData失败");
                 return false;
             }
 
             m_cotsimgscanprmclr = m_cotsprogmgrparamfileclr.GetImageScanParam();
             if (null == m_cotsimgscanprmclr)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.LoadParamFun)  GetImageScanParam失败");
+                loger.Error("(OTSProgMgrInfoFun.LoadParamFun)  GetImageScanParam失败");
                 return false;
             }
 
             m_cgenparamclr = m_cotsprogmgrparamfileclr.GetGenParam();
             if (null == m_cgenparamclr)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.LoadParamFun)  GetGenParam失败");
+                loger.Error("(OTSProgMgrInfoFun.LoadParamFun)  GetGenParam失败");
                 return false;
             }
 
             m_cotsimgprocprmclr = m_cotsprogmgrparamfileclr.GetImageProcParam();
             if (null == m_cotsimgprocprmclr)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.LoadParamFun)  GetImageProcParam失败");
+                loger.Error("(OTSProgMgrInfoFun.LoadParamFun)  GetImageProcParam失败");
                 return false;
             }
 
             m_cotsxrayprmclr = m_cotsprogmgrparamfileclr.GetXRayParam();
             if (null == m_cotsxrayprmclr)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.LoadParamFun)  GetXRayParam失败");
+                loger.Error("(OTSProgMgrInfoFun.LoadParamFun)  GetXRayParam失败");
                 return false;
             }
 
@@ -1077,10 +1077,10 @@ enum OTS_FIVE_TIES_OPTIONS
         public string GetXAxisDirectionIdString(int i_enum)
         {
             string ls_str = "";
-            ls_str = m_cotsprogmgrclr.GetXAxisDirectionIdString(i_enum);
+            ls_str = COTSProgMgr.GetXAxisDirectionIdString((otsdataconst.OTS_X_AXIS_DIRECTION)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetXAxisDirectionIdString)  获取x轴方向下拉项对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetXAxisDirectionIdString)  获取x轴方向下拉项对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1093,10 +1093,10 @@ enum OTS_FIVE_TIES_OPTIONS
         public string GetYAxisDirectionIdString(int i_enum)
         {
             string ls_str = "";
-            ls_str = m_cotsprogmgrclr.GetYAxisDirectionIdString(i_enum);
+            ls_str = COTSProgMgr.GetYAxisDirectionIdString((otsdataconst.OTS_Y_AXIS_DIRECTION)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetYAxisDirectionIdString)  y轴方向取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetYAxisDirectionIdString)  y轴方向取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1109,10 +1109,10 @@ enum OTS_FIVE_TIES_OPTIONS
         public string GetStopModeIdString(int i_enum)
         {
             string ls_str = "";
-            ls_str = m_cotsprogmgrclr.GetStopModeIdString(i_enum);
+            ls_str = COTSProgMgr.GetStopModeIdString((otsdataconst.OTS_MEASURE_STOP_MODE)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetStopModeIdString)  测量终止方式 ,取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetStopModeIdString)  测量终止方式 ,取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1125,10 +1125,10 @@ enum OTS_FIVE_TIES_OPTIONS
         public string GetAreaShapeString(int i_enum)
         {
             string ls_str = "";
-            ls_str = m_cotsprogmgrclr.GetAreaShapeString(i_enum);
+            ls_str = COTSProgMgr.GetAreaShapeString((DOMAIN_SHAPE)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetAreaShapeString)  测量区域形状取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetAreaShapeString)  测量区域形状取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1141,10 +1141,10 @@ enum OTS_FIVE_TIES_OPTIONS
         public string GetModelString(int i_enum)
         {
             string ls_str = "";
-            ls_str = m_cotsprogmgrclr.GetModelString(i_enum);
+            ls_str = COTSProgMgr.GetModelString((otsdataconst.StartModel)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetModelString)  模式选择取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetModelString)  模式选择取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1157,10 +1157,10 @@ enum OTS_FIVE_TIES_OPTIONS
         public string GetFrameEndModeString(int i_enum)
         {
             string ls_str = "";
-            ls_str = m_cotsprogmgrclr.GetFrameEndModeString(i_enum);
+            ls_str = COTSProgMgr.GetFrameEndModeString((otsdataconst.FrameEndMode)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetFrameEndModeString)  模式选择取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetFrameEndModeString)  模式选择取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1172,10 +1172,10 @@ enum OTS_FIVE_TIES_OPTIONS
         public string GetAUTOBGREMOVETYPEString(int i_enum)
         {
             string ls_str = "";
-            ls_str = m_cotsprogmgrclr.GetAUTOBGREMOVETYPEString(i_enum);
+            ls_str = COTSProgMgr.GetAUTOBGREMOVETYPEString((otsdataconst.OTS_AUTOBGREMOVETYPE)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetAUTOBGREMOVETYPEString)  背景处理方式取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetAUTOBGREMOVETYPEString)  背景处理方式取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1187,10 +1187,10 @@ enum OTS_FIVE_TIES_OPTIONS
         public string GetIMAGEMODEString(int i_enum)
         {
             string ls_str = "";
-            ls_str = m_cotsprogmgrclr.GetIMAGEMODEString(i_enum);
+            ls_str = COTSProgMgr.GetIMAGEMODEString((otsdataconst.OTS_IMAGE_MODE)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetIMAGEMODEString)  IMAGEMODE自动项择取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetIMAGEMODEString)  IMAGEMODE自动项择取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1204,10 +1204,10 @@ enum OTS_FIVE_TIES_OPTIONS
         {
             string ls_str = "";
             //m_LogFunExport.TraceLog("(OTSProgMgrInfoFun.GetGetImageIdString)   取图方式 ,取enum中对应的中文名");
-            ls_str = m_cotsprogmgrclr.GetGetImageIdString(i_enum);
+            ls_str = COTSProgMgr.GetGetImageIdString((otsdataconst.OTS_GET_IMAGE_MODE)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetGetImageIdString)  取图方式 ,取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetGetImageIdString)  取图方式 ,取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1221,10 +1221,10 @@ enum OTS_FIVE_TIES_OPTIONS
         {
             string ls_str = "";
             // 扫描图精度 ,取enum中对应的中文名");
-            ls_str = m_cotsprogmgrclr.GetScanSpeedString(i_enum);
+            ls_str = COTSProgMgr.GetScanSpeedString((otsdataconst.OTS_THREE_TIES_OPTIONS)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetScanSpeedString)  扫描图精度 ,取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetScanSpeedString)  扫描图精度 ,取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1238,10 +1238,10 @@ enum OTS_FIVE_TIES_OPTIONS
         {
             string ls_str = "";
             //扫描图尺寸 ,取enum中对应的中文名");
-            ls_str = m_cotsprogmgrclr.GetImageSizeIdString(i_enum);
+            ls_str = COTSProgMgr.GetImageSizeIdString((otsdataconst.OTS_FIVE_TIES_OPTIONS)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetImageSizeIdString)  扫描图尺寸 ,取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetImageSizeIdString)  扫描图尺寸 ,取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1255,10 +1255,10 @@ enum OTS_FIVE_TIES_OPTIONS
         {
             string ls_str = "";
             // 搜索X-Ray精度 ,取enum中对应的中文名");
-            ls_str = m_cotsprogmgrclr.GetXRaySearchSpeedIdString(i_enum);
+            ls_str = COTSProgMgr.GetXRaySearchSpeedIdString((otsdataconst.OTS_THREE_TIES_OPTIONS)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetXRaySearchSpeedIdString) 搜索X-Ray精度 ,取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetXRaySearchSpeedIdString) 搜索X-Ray精度 ,取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1272,10 +1272,10 @@ enum OTS_FIVE_TIES_OPTIONS
         {
             string ls_str = "";
             //  X-Ray扫描方式 ,取enum中对应的中文名");
-            ls_str = m_cotsprogmgrclr.GetXRayScanModeIdString(i_enum);
+            ls_str = COTSProgMgr.GetXRayScanModeIdString((otsdataconst.OTS_X_RAY_SCAN_MODE)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetXRayScanModeIdString)  X-Ray扫描方式 ,取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetXRayScanModeIdString)  X-Ray扫描方式 ,取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1289,10 +1289,10 @@ enum OTS_FIVE_TIES_OPTIONS
         {
             string ls_str = "";
             // 分析X-Ray精度 ,取enum中对应的中文名
-            ls_str = m_cotsprogmgrclr.GetXRayAnalySpeedIdString(i_enum);
+            ls_str = COTSProgMgr.GetXRayAnalySpeedIdString((otsdataconst.OTS_THREE_TIES_OPTIONS)i_enum);
             if (ls_str == null)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetXRayAnalySpeedIdString)  分析X-Ray精度 ,取enum中对应的中文名 失败");
+                loger.Error("(OTSProgMgrInfoFun.GetXRayAnalySpeedIdString)  分析X-Ray精度 ,取enum中对应的中文名 失败");
             }
             return ls_str;
         }
@@ -1307,10 +1307,14 @@ enum OTS_FIVE_TIES_OPTIONS
         {
             //弹出样品台选择窗体
             m_cstagefileclr.SetInUse(isuse);
-            m_cstagefileclr = m_cstagefileclr.ShowStageDialogExport((int)OTS_SOFT_PACKAGE_ID.OTSIncA, m_cstagefileclr);
+
+            DlgStageMgr m_dlgStageMgr = new DlgStageMgr();
+
+            m_cstagefileclr = m_dlgStageMgr.ShowStageMgrDialog((int)OTS_SOFT_PACKAGE_ID.OTSIncA, m_cstagefileclr);
+
             if (null == m_cstagefileclr)
             {
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.ShowStageDialogExport) 弹出样品台选择窗体出错!");
+                loger.Error("(OTSProgMgrInfoFun.ShowStageDialogExport) 弹出样品台选择窗体出错!");
             }
 
             return;
@@ -1326,38 +1330,38 @@ enum OTS_FIVE_TIES_OPTIONS
             if (m_cstagefileclr == null)
             {
                 //报错
-                m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.CStageFileClrSave) 保存样品台信息出错!");
+                loger.Error("(OTSProgMgrInfoFun.CStageFileClrSave) 保存样品台信息出错!");
             }
             else
             {
                 bool b_ret = m_cstagefileclr.Save((int)OTS_SOFT_PACKAGE_ID.OTSIncA);
                 if (false == b_ret)
                 {
-                    m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.CStageFileClrSave) 保存样品台信息出错!");
+                    loger.Error("(OTSProgMgrInfoFun.CStageFileClrSave) 保存样品台信息出错!");
                 }
             }
             return false;
         }
 
-        /// <summary>
-        /// 写追踪日志
-        /// </summary>
-        /// <param name="strLog"></param>
-        /// <returns></returns>
-        public int TraceLog(string strLog)
-        {
-           return m_LogFunExport.TraceLog(strLog);
-        }
+        ///// <summary>
+        ///// 写追踪日志
+        ///// </summary>
+        ///// <param name="strLog"></param>
+        ///// <returns></returns>
+        //public int TraceLog(string strLog)
+        //{
+        //   return loger.Trace(strLog);
+        //}
 
         /// <summary>
         /// 写错误日志
         /// </summary>
         /// <param name="strLog"></param>
         /// <returns></returns>
-        public int TraceErrorLog(string strLog)
-        {
-            return m_LogFunExport.TraceErrorLog(strLog);
-        }
+        //public int TraceErrorLog(string strLog)
+        //{
+        //    return loger.Error(strLog);
+        //}
 
         /// <summary>
         /// 获取颗粒分析标准库文件列表
@@ -1371,7 +1375,7 @@ enum OTS_FIVE_TIES_OPTIONS
         //    ret_cstditemclr = m_cotsprogmgrparamfileclr.GetGenParam().GetPartSTDLib().GetSTDItemsList();
         //    if (null == ret_cstditemclr)
         //    {
-        //        m_LogFunExport.TraceErrorLog("(OTSProgMgrInfoFun.GetStdFileList) 获取STD颗粒分析标准库文件列表出错!");
+        //        loger.Error("(OTSProgMgrInfoFun.GetStdFileList) 获取STD颗粒分析标准库文件列表出错!");
         //    }
         //    return ret_cstditemclr;
         //}

+ 26 - 23
OTS/OTSIncAMeasureApp/OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -12,10 +12,10 @@ using OTSPeriodicTable;
 
 using OTSProgMgrInfo.OTSProgMgrInfoFunction;
 using OTSProgMgrInfo;
-using NSLogFunExport;
 
 using System.Text.RegularExpressions;
 using System.Collections;
+using OTSIncAMeasureApp;
 
 namespace OTSProgMgrInfo
 {
@@ -31,8 +31,10 @@ namespace OTSProgMgrInfo
         //定位程序管理路径用的变量
         public string m_ParameterPath;
         //国际化
-        OTSSysMgrTools.Language lan;
+        Language lan;
         Hashtable table;
+        //日志
+        public static NLog.Logger loger = NLog.LogManager.GetCurrentClassLogger();
         #endregion
 
         #region 构造函数
@@ -44,7 +46,7 @@ namespace OTSProgMgrInfo
             m_otsMif = new OTSProgMgrInfoFun(this);
             InitializeComponent();
             //国际化
-            lan = new OTSSysMgrTools.Language(this);
+            lan = new Language(this);
             table = lan.GetNameTable(this.Name);
         }
 
@@ -58,7 +60,7 @@ namespace OTSProgMgrInfo
             m_bInUse = in_bInUse;
             InitializeComponent();
             //国际化
-            lan = new OTSSysMgrTools.Language(this);
+            lan = new Language(this);
             table = lan.GetNameTable(this.Name);
         }
 
@@ -130,7 +132,7 @@ namespace OTSProgMgrInfo
 
             //x轴方向
             IDC_COMBO_XDIREC.Items.Clear();
-            foreach (OTS_X_AXIS_DIRECTION enum_one in Enum.GetValues(typeof(OTS_X_AXIS_DIRECTION)))
+            foreach (OTSProgMgrInfo.OTSProgMgrInfoFunction.OTS_X_AXIS_DIRECTION enum_one in Enum.GetValues(typeof(OTSProgMgrInfo.OTSProgMgrInfoFunction.OTS_X_AXIS_DIRECTION)))
             {
                 OTSPeriodicTable.ComboBoxItem cbi = new OTSPeriodicTable.ComboBoxItem();
                 cbi.Text = m_otsMif.GetXAxisDirectionIdString((int)enum_one);
@@ -144,7 +146,7 @@ namespace OTSProgMgrInfo
 
             //y轴方向
             IDC_COMBO_YDIRECT.Items.Clear();
-            foreach (OTS_Y_AXIS_DIRECTION enum_one in Enum.GetValues(typeof(OTS_Y_AXIS_DIRECTION)))
+            foreach (OTSProgMgrInfo.OTSProgMgrInfoFunction.OTS_Y_AXIS_DIRECTION enum_one in Enum.GetValues(typeof(OTSProgMgrInfo.OTSProgMgrInfoFunction.OTS_Y_AXIS_DIRECTION)))
             {
                 OTSPeriodicTable.ComboBoxItem cbi = new OTSPeriodicTable.ComboBoxItem();
                 cbi.Text = m_otsMif.GetYAxisDirectionIdString((int)enum_one);
@@ -157,7 +159,7 @@ namespace OTSProgMgrInfo
             this.IDC_COMBO_YDIRECT.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_YDIRECT_SelectedIndexChanged);
             //测量终止方式
             IDC_COMBO_STOPMODE.Items.Clear();
-            foreach (OTS_MEASURE_STOP_MODE enum_one in Enum.GetValues(typeof(OTS_MEASURE_STOP_MODE)))
+            foreach (OTSProgMgrInfo.OTSProgMgrInfoFunction.OTS_MEASURE_STOP_MODE enum_one in Enum.GetValues(typeof(OTSProgMgrInfo.OTSProgMgrInfoFunction.OTS_MEASURE_STOP_MODE)))
             {
                 OTSPeriodicTable.ComboBoxItem cbi = new OTSPeriodicTable.ComboBoxItem();
                 cbi.Text = m_otsMif.GetStopModeIdString((int)enum_one);
@@ -262,19 +264,19 @@ namespace OTSProgMgrInfo
             if (IDC_COMBO_STDLIBSELECT.Items.Count > 0)
                 IDC_COMBO_STDLIBSELECT.SelectedIndex = 0;
 
-            //精炼工艺下拉框选项
-            IDC_COMBO_TECHNOLOGY.Items.Clear();
-            foreach (OTS_TECHNOLOGY_OPTIONS enum_one in Enum.GetValues(typeof(OTS_TECHNOLOGY_OPTIONS)))
-            {
-                OTSPeriodicTable.ComboBoxItem cbi = new OTSPeriodicTable.ComboBoxItem();
-                cbi.Text = m_otsMif.m_cotsprogmgrclr.GetSteelTechIdString((int)enum_one);
-                cbi.Value = (int)enum_one;
-                IDC_COMBO_TECHNOLOGY.Items.Add(cbi);
-            }
-            this.IDC_COMBO_TECHNOLOGY.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_TECHNOLOGY_SelectedIndexChanged);
-            if (IDC_COMBO_TECHNOLOGY.Items.Count > 0)
-                IDC_COMBO_TECHNOLOGY.SelectedIndex = 0;
-            this.IDC_COMBO_TECHNOLOGY.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_TECHNOLOGY_SelectedIndexChanged);
+            ////精炼工艺下拉框选项
+            //IDC_COMBO_TECHNOLOGY.Items.Clear();
+            //foreach (OTS_TECHNOLOGY_OPTIONS enum_one in Enum.GetValues(typeof(OTS_TECHNOLOGY_OPTIONS)))
+            //{
+            //    OTSPeriodicTable.ComboBoxItem cbi = new OTSPeriodicTable.ComboBoxItem();
+            //    cbi.Text = m_otsMif.m_cotsprogmgrclr.GetSteelTechIdString((int)enum_one);
+            //    cbi.Value = (int)enum_one;
+            //    IDC_COMBO_TECHNOLOGY.Items.Add(cbi);
+            //}
+            //this.IDC_COMBO_TECHNOLOGY.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_TECHNOLOGY_SelectedIndexChanged);
+            //if (IDC_COMBO_TECHNOLOGY.Items.Count > 0)
+            //    IDC_COMBO_TECHNOLOGY.SelectedIndex = 0;
+            //this.IDC_COMBO_TECHNOLOGY.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_TECHNOLOGY_SelectedIndexChanged);
 
             //测量区域形状
             cBMeasShape.Items.Clear();
@@ -356,7 +358,7 @@ namespace OTSProgMgrInfo
             //先插入正在工作的样品台
             int ls_workingstageid = 0;
             IDC_COMBO_STAGE.Items.Clear();
-            CStageClr ls_cstageclr = m_otsMif.GetWorkingStage();
+            OTSDataType.CStage ls_cstageclr = m_otsMif.GetWorkingStage();
 
             OTSPeriodicTable.ComboBoxItem ls_cbi = new OTSPeriodicTable.ComboBoxItem();
             ls_cbi.Text = ls_cstageclr.GetName();
@@ -366,7 +368,7 @@ namespace OTSProgMgrInfo
 
             //添加其它的样品台信息
             //这个相当于就是id了,与郝工的dll中,的getworkingstageid是相同的
-            List<CStageClr> l_cstageclr = m_otsMif.GetStageList();
+            List<OTSDataType.CStage> l_cstageclr = m_otsMif.GetStageList();
             for (int i = 0; i < l_cstageclr.Count(); i++)
             {
                 if (ls_workingstageid != i)//将已经插入过的正在工作样品台信息跳过去
@@ -1130,7 +1132,8 @@ namespace OTSProgMgrInfo
                 else
                 {
                     string message = table["message54"].ToString();
-                    m_otsMif.TraceErrorLog("(ProgMgrInfoForm.btnok_Click) "+ message);
+                    //m_otsMif.TraceErrorLog("(ProgMgrInfoForm.btnok_Click) "+ message);
+                    loger.Error("(ProgMgrInfoForm.btnok_Click) " + message);
                     this.Close();
                     return;
                 }

+ 1 - 1
OTS/OTSIncAMeasureApp/OTSSamplespaceGraphicsPanel/CStageManage.cs

@@ -701,7 +701,7 @@ namespace OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel
         public static void SetShowCMStrip(int IsSelectType, ContextMenuStrip cmStrip, bool IsTrue)
         {
             //国际化
-            OTSSysMgrTools.Language lan = new OTSSysMgrTools.Language();
+            Language lan = new Language();
             Hashtable table;
             table = lan.GetNameTable("CStageManage");
             string str1 = "拍摄样品孔BSE照片";

+ 9 - 7
OTS/OTSIncAMeasureApp/OTSSamplespaceGraphicsPanel/SEMDATAFieldManage.cs

@@ -8,6 +8,7 @@ using System.Drawing;
 
 using System.Windows.Forms;
 using Microsoft.Win32;
+using OTSModelSharp;
 
 namespace OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel
 {
@@ -28,7 +29,8 @@ namespace OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel
         NSOTSController.COTSControlFunExport cfun = null;
         //主窗体对象
         OTSIncAMeasureAppForm m_MeasureAppForm;
-        CFieldMgrClr cFieldMgrClr;
+        CFieldMgr cFieldMgrClr;
+        public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
         #endregion
 
         #region 构造方法
@@ -55,21 +57,21 @@ namespace OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel
                 //控制类对象初始化
                 if (cfun == null)
                 {
-                    cfun = new COTSControlFunExport(LogPath);
+                    cfun = new NSOTSController.COTSControlFunExport(LogPath);
                     //获取模拟状态
                     IsSimulationStatus = cfun.IsSimulationStatus();
                 }
                 //获取帧图操作类对象
                 if (cFieldMgrClr == null)
                 {
-                    cFieldMgrClr = new CFieldMgrClr();
+                    cFieldMgrClr = new CFieldMgr();
                 }
                 //连接电镜
                 return ConnectSEM();
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceLog("SEMDATAFieldManage_InitAndConntion:--错误日志:"+ ex.ToString() + "");
+                Nloger.Trace("SEMDATAFieldManage_InitAndConntion:--错误日志:"+ ex.ToString() + "");
                 return false;
             }
         }
@@ -165,7 +167,7 @@ namespace OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("SEMDATAFieldManage_GetSemWorkingDistance--错误日志:" + ex.ToString() + "");
+                Nloger.Error("SEMDATAFieldManage_GetSemWorkingDistance--错误日志:" + ex.ToString() + "");
                 return 0;
             }
         }
@@ -192,7 +194,7 @@ namespace OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("SEMDATAFieldManage_SetSemWorkingDistance--错误日志:" + ex.ToString() + "");
+                Nloger.Error("SEMDATAFieldManage_SetSemWorkingDistance--错误日志:" + ex.ToString() + "");
                 return false;
             }
         }
@@ -219,7 +221,7 @@ namespace OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("SEMDATAFieldManage_SetSemWorkingDistance--错误日志:" + ex.ToString() + "");
+                Nloger.Error("SEMDATAFieldManage_SetSemWorkingDistance--错误日志:" + ex.ToString() + "");
                 return false;
             }
         }

+ 4 - 4
OTS/OTSModelSharp/Measure/GetParam/OTSProgMgrParamFile.cs

@@ -99,10 +99,10 @@ namespace OTSModelSharp
             Duplicate(a_poSource);
         }
 
-        public COTSProgMgrParamFile GetImageScanParam() { return null; }
+        public COTSImgScanPrm GetImageScanParam() { return null; }
 
-        public COTSProgMgrParamFile GetImageProcParam() { return null; }
-        public COTSProgMgrParamFile GetXRayParam() { return null; }
+        public COTSImgProcPrm GetImageProcParam() { return null; }
+        public COTSXRayParam GetXRayParam() { return null; }
 
         //COTSProgMgrParamFile(const COTSProgMgrParamFile&);					// copy constructor
         //COTSProgMgrParamFile& operator=(const COTSProgMgrParamFile&);		// =operator
@@ -131,7 +131,7 @@ namespace OTSModelSharp
             return m_strPathName;
         }
 
-        public COTSProgMgrParamFile GetGenParam() { return null; }
+        public COTSGeneralParameters GetGenParam() { return null; }
         // set path name
         public void SetPathName(string a_strPathName)
         {

+ 29 - 0
OTS/OTSModelSharp/Measure/GetStageInfo/DlgStageMgr.cs

@@ -18,6 +18,8 @@ namespace OTSModelSharp
 {
     public class DlgStageMgr
     {
+        public static NLog.Logger loger = NLog.LogManager.GetCurrentClassLogger();
+
         otsdataconst model = new otsdataconst();
 
         // stage file
@@ -389,5 +391,32 @@ namespace OTSModelSharp
 		    
     }
 
+        public CStageFile ShowStageMgrDialog(OTS_SOFT_PACKAGE_ID a_nPackId, CStageFile a_pStageFile)
+        {
+            if (a_pStageFile==null)
+            {
+                //LogErrorTrace(__FILE__, __LINE__, _T("ShowStageMgrDialog:invalid stage file."));
+                loger.Error("ShowStageMgrDialog:invalid stage file.");
+                return null;
+            }
+
+            //show the dialog
+            DlgStageMgr dlg=new DlgStageMgr();
+            dlg.SetStageFile(a_pStageFile);
+            dlg.SetPackId(a_nPackId);
+
+            dlg.ShowDialog();
+
+            CStageFile pStageFile = dlg.GetStageFile();
+            //ASSERT(pStageFile);
+            if (pStageFile==null)
+            {
+                //LogErrorTrace(__FILE__, __LINE__, _T("ShowStageMgrDialog: Load stage from stage manager dlg failed."));
+                loger.Error("ShowStageMgrDialog: Load stage from stage manager dlg failed.");
+                return null;
+            }
+
+            return pStageFile;
+        }
     }
 }