Parcourir la source

C++升级到C#,修改类中的错误

sunyi il y a 5 ans
Parent
commit
11e6ccfc75

+ 1 - 1
OTS/OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -113,7 +113,7 @@ namespace OTSIncAMeasureApp
             public SMSR_Sample_Status iMsrSampleStatu;
             public string csSampleName;
             public string csSampleMsrStartTime;
-            public List<System.Windows.Point> BCompleteFieldList;    //样品之前已经测试完的帧图数
+            public List<System.Drawing.Point> BCompleteFieldList;    //样品之前已经测试完的帧图数
         }
 
 

+ 121 - 111
OTS/OTSIncAMeasureApp/OTSMeasureStatusWindow.cs

@@ -15,6 +15,9 @@ using OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel;
 
 using System.Data;
 using System.Collections;
+using NSOTSController;
+using OTSModelSharp;
+using OTSDataType;
 
 namespace OTSIncAMeasureApp
 {
@@ -69,6 +72,10 @@ namespace OTSIncAMeasureApp
         //绘制采集点对象
         public static List<ARectangleGDIObject> m_ElementPointGDIObjects;
         Point m_mouseCurrentPoint = new Point();
+
+        public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
+
+        COTSSample sample;
         #endregion
         #region 在右下角状态栏中显示鼠标当前位置所需要的参数
         double dPositionX = 0;
@@ -123,12 +130,12 @@ namespace OTSIncAMeasureApp
 
                 //进入时首先对XRayTable进行隐藏
                 panelXray.Visible = false;
-              
+
             }
             catch (Exception ex)
             {
 
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow)  " + ex.ToString());
 
             }
 
@@ -154,7 +161,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.ShowImage)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.ShowImage)  " + ex.ToString());
             }
         }
 
@@ -173,7 +180,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
 
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.ShowImage)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.ShowImage)  " + ex.ToString());
                 return null;
             }
         }
@@ -229,7 +236,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
 
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.DrawCurve)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.DrawCurve)  " + ex.ToString());
 
             }
         }
@@ -239,7 +246,7 @@ namespace OTSIncAMeasureApp
         #region 处理获取调试图菜单事件
         private void AcquireBSEImage_Click(object sender, EventArgs e)
         {
-            
+
             GetAcquireBSEImage();
             DelElementPointGDIObjects();
             panelXray.Visible = false;
@@ -313,7 +320,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.AcquireBSEImage_Click)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.AcquireBSEImage_Click)  " + ex.ToString());
             }
         }
         #endregion
@@ -402,7 +409,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.UpdataImageChart)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.UpdataImageChart)  " + ex.ToString());
 
             }
         }
@@ -468,7 +475,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
 
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.ShowRemoveBGImage_Click)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.ShowRemoveBGImage_Click)  " + ex.ToString());
 
 
             }
@@ -513,7 +520,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.ShowGrayLevelImage_Click)  "
+                Nloger.Error("(OTSMeasureStatusWindow.ShowGrayLevelImage_Click)  "
                     + ex.ToString());
 
             }
@@ -543,7 +550,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.ShowGrayLevelLine_Click)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.ShowGrayLevelLine_Click)  " + ex.ToString());
 
             }
         }
@@ -612,7 +619,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
 
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.OTSMeasureStatusWindow_MouseClick)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.OTSMeasureStatusWindow_MouseClick)  " + ex.ToString());
 
 
             }
@@ -640,7 +647,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.SizeShow)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.SizeShow)  " + ex.ToString());
             }
 
         }
@@ -673,7 +680,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
 
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.GetLineImage)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.GetLineImage)  " + ex.ToString());
 
 
             }
@@ -724,7 +731,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.contextMenuStrip1_Opened)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.contextMenuStrip1_Opened)  " + ex.ToString());
             }
         }
 
@@ -801,7 +808,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
 
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.pictureBox1_Paint)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.pictureBox1_Paint)  " + ex.ToString());
             }
         }
 
@@ -962,7 +969,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
 
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.pictureBox1_MouseMove)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.pictureBox1_MouseMove)  " + ex.ToString());
             }
         }
 
@@ -979,7 +986,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.pictureBox1_MouseDown)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.pictureBox1_MouseDown)  " + ex.ToString());
             }
         }
         #endregion
@@ -1037,7 +1044,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.ShowAbandonGrayLevelImage_Click)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.ShowAbandonGrayLevelImage_Click)  " + ex.ToString());
             }
         }
         #endregion
@@ -1067,7 +1074,7 @@ namespace OTSIncAMeasureApp
             }
             catch (Exception ex)
             {
-                m_MeasureAppForm.Nloger.TraceErrorLog("(OTSMeasureStatusWindow.pictureBox1_MouseClick)  " + ex.ToString());
+                Nloger.Error("(OTSMeasureStatusWindow.pictureBox1_MouseClick)  " + ex.ToString());
             }
         }
 
@@ -1078,7 +1085,7 @@ namespace OTSIncAMeasureApp
             string message6 = table["message6"].ToString();
             if (contextMenuStrip1.Items[(int)MeasureStateMenuType.ChangeDiffImageShow].Text == message1)
             {
-               
+
                 contextMenuStrip1.Items[(int)MeasureStateMenuType.ChangeDiffImageShow].Enabled = true;
                 contextMenuStrip1.Items[(int)MeasureStateMenuType.ChangeDiffImageShow].Text = message6;
 
@@ -1368,116 +1375,116 @@ namespace OTSIncAMeasureApp
                 initResult = cfun.EDSInit();
                 if (initResult)
                 {
-                    CProjMgrClr cProjMgrClr = m_MeasureAppForm.m_DataMgrFun.m_ProjDataMgr;
+                    COTSProjMgrFile cProjMgrClr = m_MeasureAppForm.m_DataMgrFun.m_ProjDataMgr;
                     //获取工作样品对象
-                    COTSSampleClr sampleClr = cProjMgrClr.GetWorkingSample();
+                    sample = cProjMgrClr.GetWorkingSample();
 
                     //清空之前记录的标识
                     if (m_ElementPointGDIObjects != null)
-                    {
+
                         if (m_ElementPointGDIObjects.Count > 0)
                         {
                             //清空
                             m_ElementPointGDIObjects.Clear();
                         }
-                    }
-                    //2.获取鼠标在图像的位置
-                    double dImgX = m_MouseMoveImageX;
-                    double dImgY = m_MouseMoveImageY;
-                    //3.根据所要扫描的位置进行元素分析
-                    uint a_Milliseconds = 0;
-                    //采集时间
-                    a_Milliseconds = Convert.ToUInt32(sampleClr.GetMsrParams().GetXRayParam().GetMidAnalyAQTime());
-                    //元素数量
-                    ValueType a_nElementNum = 0;
-                    //元素名称
-                    string a_strElementName = "";
-                    //元素Xray数据
-                    int[] a_ElementXrayData = new int[2000];
-                    if (cfun.GetXRayAndElements(a_Milliseconds, (int)dImgX, (int)dImgY, ref a_ElementXrayData, ref a_nElementNum, ref a_strElementName))
-                    {
-                        //string message10 = table["message10"].ToString();
-                        //string message11 = table["message11"].ToString();
-                        //m_MeasureAppForm.m_LogFunExport.TraceLog(message10 + a_nElementNum + message11 + a_strElementName + "'--");
-                        //4.在BSE上绘制扫描标记
-                        //4-1 获取鼠标在BSE图上的位置
-                        //Point p_mouseCurrentTempPoint = m_mouseCurrentPoint;
-                        ////4-2 根据位置绘制标记
-                        //Rectangle rect = new Rectangle(p_mouseCurrentTempPoint, new Size(1, 1));
-                        //CreateRectangle createRect = new CreateRectangle(rect, (int)CreateRectangleType.DrawBSEElementSignPoint);
-                        //m_ElementPointGDIObjects.Add(createRect);
-                        ////5.获取成功后弹出对话框
-                        ////计数率
-                        //double electronicCount = 0;
-                        //uint[] u_ElementXrayData = new uint[2000];
-                        //for (int i = 0; i < a_ElementXrayData.Length; i++)
-                        //{
-                        //    u_ElementXrayData[i] = (uint)a_ElementXrayData[i];
-                        //    //累加计数率
-                        //    electronicCount += a_ElementXrayData[i];
-                        //}
-                        ////显示Xray控件
-                        //panelXray.Visible = true;
-                        ////获取数据后,需要对xraytable设置
-                        ////设置分析Xray数据
-                        ////control_XRayTable1.SetXRayShowLineValue(new uint[2000], u_ElementXrayData);
-                        string[] strGroup = a_strElementName.Split('\n');
-                        //get CElementChemistryClr list
-                        //List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
-                        //for (int i = 0; i < strGroup.Length; i++)
-                        //{
-                        //    if (!strGroup[i].Equals(""))
-                        //    {
-                        //        ShowElementInfo ls_sei = new ShowElementInfo();
-                        //        ls_sei.ElementName = strGroup[i].Split(':')[(int)IndexNum.First];
-                        //        ls_sei.Percentage = Convert.ToDouble(strGroup[i].Split(':')[(int)IndexNum.Second]);
-                        //        list_showelementinfo.Add(ls_sei);
-                        //    }
-                        //}
-                        ////需要显示计数率
-                        //string strElectronicCount = string.Empty;
-                        //if (electronicCount > 1000)
-                        //{
-                        //    strElectronicCount = (Convert.ToDouble(electronicCount) / 1000).ToString("f2") + "kcps";
-                        //}
-                        //control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
-                        //control_XRayTable1.GoodName = "XXX";
-                        //CInclutionSTDDataClr cPartSTDData = sampleClr.GetMsrParams().GetInclutionSTDData();
-                        //int steelTech = sampleClr.GetMsrParams().GetSteelTechnology();
-                        //CMsrThreadClr cMsrThreadClr = new CMsrThreadClr();
-                        ////夹杂物编号
-                        //int nInclusionID = cMsrThreadClr.GetClassifyParticleId(cPartSTDData, steelTech, a_strElementName);
-                        ////根据夹杂物编号获取夹杂物名称
-                        //string GoodName = string.Empty;
-                        //GoodName = GetInclusionName(nInclusionID);
-                        ////杂夹物名称
-                        ////control_XRayTable1.STDName = "STDName";
-                        //control_XRayTable1.GoodName = GoodName;
-                        ////control_XRayTable1.GoodChineseName = "GoodChineseName";
-                        //this.Refresh();
-                        //contextMenuStrip1.Items[(int)MeasureStateMenuType.ExportReport].Enabled = true;
-                        MessageBox.Show(a_strElementName);
-                    }
-                }
-
-                try
-                {
-                    cfun.DisConnectSem();
-                    cfun.FreeDll();
                 }
-                catch (Exception)
+                //2.获取鼠标在图像的位置
+                double dImgX = m_MouseMoveImageX;
+                double dImgY = m_MouseMoveImageY;
+                //3.根据所要扫描的位置进行元素分析
+                uint a_Milliseconds = 0;
+                //采集时间
+                a_Milliseconds = Convert.ToUInt32(sample.GetMsrParams().GetXRayParam().GetMidAnalyAQTime());
+                //元素数量
+                ValueType a_nElementNum = 0;
+                //元素名称
+                string a_strElementName = "";
+                //元素Xray数据
+                int[] a_ElementXrayData = new int[2000];
+                if (cfun.GetXRayAndElements(a_Milliseconds, (int)dImgX, (int)dImgY, ref a_ElementXrayData, ref a_nElementNum, ref a_strElementName))
                 {
+                    //string message10 = table["message10"].ToString();
+                    //string message11 = table["message11"].ToString();
+                    //m_MeasureAppForm.m_LogFunExport.TraceLog(message10 + a_nElementNum + message11 + a_strElementName + "'--");
+                    //4.在BSE上绘制扫描标记
+                    //4-1 获取鼠标在BSE图上的位置
+                    //Point p_mouseCurrentTempPoint = m_mouseCurrentPoint;
+                    ////4-2 根据位置绘制标记
+                    //Rectangle rect = new Rectangle(p_mouseCurrentTempPoint, new Size(1, 1));
+                    //CreateRectangle createRect = new CreateRectangle(rect, (int)CreateRectangleType.DrawBSEElementSignPoint);
+                    //m_ElementPointGDIObjects.Add(createRect);
+                    ////5.获取成功后弹出对话框
+                    ////计数率
+                    //double electronicCount = 0;
+                    //uint[] u_ElementXrayData = new uint[2000];
+                    //for (int i = 0; i < a_ElementXrayData.Length; i++)
+                    //{
+                    //    u_ElementXrayData[i] = (uint)a_ElementXrayData[i];
+                    //    //累加计数率
+                    //    electronicCount += a_ElementXrayData[i];
+                    //}
+                    ////显示Xray控件
+                    //panelXray.Visible = true;
+                    ////获取数据后,需要对xraytable设置
+                    ////设置分析Xray数据
+                    ////control_XRayTable1.SetXRayShowLineValue(new uint[2000], u_ElementXrayData);
+                    string[] strGroup = a_strElementName.Split('\n');
+                    //get CElementChemistryClr list
+                    //List<ShowElementInfo> list_showelementinfo = new List<ShowElementInfo>();
+                    //for (int i = 0; i < strGroup.Length; i++)
+                    //{
+                    //    if (!strGroup[i].Equals(""))
+                    //    {
+                    //        ShowElementInfo ls_sei = new ShowElementInfo();
+                    //        ls_sei.ElementName = strGroup[i].Split(':')[(int)IndexNum.First];
+                    //        ls_sei.Percentage = Convert.ToDouble(strGroup[i].Split(':')[(int)IndexNum.Second]);
+                    //        list_showelementinfo.Add(ls_sei);
+                    //    }
+                    //}
+                    ////需要显示计数率
+                    //string strElectronicCount = string.Empty;
+                    //if (electronicCount > 1000)
+                    //{
+                    //    strElectronicCount = (Convert.ToDouble(electronicCount) / 1000).ToString("f2") + "kcps";
+                    //}
+                    //control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
+                    //control_XRayTable1.GoodName = "XXX";
+                    //CInclutionSTDDataClr cPartSTDData = sampleClr.GetMsrParams().GetInclutionSTDData();
+                    //int steelTech = sampleClr.GetMsrParams().GetSteelTechnology();
+                    //CMsrThreadClr cMsrThreadClr = new CMsrThreadClr();
+                    ////夹杂物编号
+                    //int nInclusionID = cMsrThreadClr.GetClassifyParticleId(cPartSTDData, steelTech, a_strElementName);
+                    ////根据夹杂物编号获取夹杂物名称
+                    //string GoodName = string.Empty;
+                    //GoodName = GetInclusionName(nInclusionID);
+                    ////杂夹物名称
+                    ////control_XRayTable1.STDName = "STDName";
+                    //control_XRayTable1.GoodName = GoodName;
+                    ////control_XRayTable1.GoodChineseName = "GoodChineseName";
+                    //this.Refresh();
+                    //contextMenuStrip1.Items[(int)MeasureStateMenuType.ExportReport].Enabled = true;
+                    MessageBox.Show(a_strElementName);
                 }
             }
+
+            try
+            {
+                cfun.DisConnectSem();
+                cfun.FreeDll();
+            }
+            catch (Exception)
+            {
+            }
         }
 
+
         #region 根据夹杂物编号获取夹杂物名称
         public string GetInclusionName(int nInclusionID)
         {
             //获取使用标准库的名称,也许这个也不是很正确??
             string str_stdname = "";
             string str_IncALibName = "";
-            COTSSampleClr cOTSSampleClr = m_MeasureAppForm.m_DataMgrFun.m_ProjDataMgr.GetWorkingSample();
+            COTSSample cOTSSampleClr = m_MeasureAppForm.m_DataMgrFun.m_ProjDataMgr.GetWorkingSample();
             OTSSysSTDMgrClass osc = new OTSSysSTDMgrClass();
 
             if (nInclusionID < 1000)
@@ -1504,7 +1511,7 @@ namespace OTSIncAMeasureApp
             }
             return str_IncALibName;
         }
-        #endregion
+        // #endregion
 
         public void DelElementPointGDIObjects()
         {
@@ -1613,6 +1620,9 @@ namespace OTSIncAMeasureApp
                 }
             }
         }
+        #endregion
     }
 }
 
+
+

+ 14 - 12
OTS/OTSIncAMeasureApp/OTSMeasureThread/OTSGetMreRetThread.cs

@@ -30,6 +30,8 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
         SMSR_RET_DATA MeasureResultMsrData;
         //测量结果信息窗口对象
         public OTSMeasureResultWindow m_OTSMeasureResultWindow = null;
+
+        public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
         public OTSGetMreRetThread(OTSIncAMeasureAppForm MeasureApp)
         {
             m_MeasureApp = MeasureApp;
@@ -91,7 +93,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                     {
                         if (!m_MeasureApp.m_DataMgrFun.SaveMeasureSampleInfo())
                         {
-                            m_MeasureApp.Nloger.TraceErrorLog("(OTSGetMreRetThread MSTMsg.STMThreadStu.iMThreadStatus = RET_MEASURE_THREAD_STATUS.STOPPED )  m_MeasureApp.m_DataMgrFun.SaveMeasureSampleInfo() = false ");
+                            Nloger.Error("(OTSGetMreRetThread MSTMsg.STMThreadStu.iMThreadStatus = RET_MEASURE_THREAD_STATUS.STOPPED )  m_MeasureApp.m_DataMgrFun.SaveMeasureSampleInfo() = false ");
                         }
                     }
 
@@ -112,7 +114,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                         {
                             string csETime = m_MeasureApp.GetString(MSTMsg.STMThreadStu.cMsrEndTime);
                              m_MRetData.StopMeasure(csETime, SMSR_Thread_Status.SMSR_FAILED_ID);
-                            m_MeasureApp.Nloger.TraceErrorLog("(OTSGetMreRetThread)  MSTMsg.STMThreadStu.iMThreadStatus = RET_MEASURE_THREAD_STATUS.FAILED");
+                            Nloger.Error("(OTSGetMreRetThread)  MSTMsg.STMThreadStu.iMThreadStatus = RET_MEASURE_THREAD_STATUS.FAILED");
 
 
                         }
@@ -124,7 +126,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                         }
                         else
                         {
-                            m_MeasureApp.Nloger.TraceErrorLog("(OTSGetMreRetThread) MSTMsg.STMThreadStu.iMThreadStatus =" + MSTMsg.STMThreadStu.iMThreadStatus.ToString() + "Failed");
+                            Nloger.Error("(OTSGetMreRetThread) MSTMsg.STMThreadStu.iMThreadStatus =" + MSTMsg.STMThreadStu.iMThreadStatus.ToString() + "Failed");
                         }
                     }
 
@@ -140,11 +142,11 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                         }
                         else if (MSTMsg.STMSampleStu.iMeasureSampleStatus == RET_MEASURE_SAMPLE_STATUS.STOPPED)
                         {
-                            m_MeasureApp.Nloger.TraceErrorLog("(OTSGetMreRetThread) MSTMsg.STMSampleStu.iMeasureSampleStatus = RET_MEASURE_SAMPLE_STATUS.STOPPED Failed");
+                            Nloger.Error("(OTSGetMreRetThread) MSTMsg.STMSampleStu.iMeasureSampleStatus = RET_MEASURE_SAMPLE_STATUS.STOPPED Failed");
                         }
                         else if (MSTMsg.STMSampleStu.iMeasureSampleStatus == RET_MEASURE_SAMPLE_STATUS.FAILED)
                         {
-                            m_MeasureApp.Nloger.TraceErrorLog("(OTSGetMreRetThread) MSTMsg.STMSampleStu.iMeasureSampleStatus = RET_MEASURE_SAMPLE_STATUS.FAILED Failed");
+                            Nloger.Error("(OTSGetMreRetThread) MSTMsg.STMSampleStu.iMeasureSampleStatus = RET_MEASURE_SAMPLE_STATUS.FAILED Failed");
 
                         }
                         else if (MSTMsg.STMSampleStu.iMeasureSampleStatus == RET_MEASURE_SAMPLE_STATUS.SUCCESSED)
@@ -153,7 +155,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                         }
                         else
                         {
-                            m_MeasureApp.Nloger.TraceErrorLog("(OTSGetMreRetThread) MSTMsg.STMSampleStu.iMeasureSampleStatus =" + MSTMsg.STMSampleStu.iMeasureSampleStatus.ToString() + "Failed");
+                            Nloger.Error("(OTSGetMreRetThread) MSTMsg.STMSampleStu.iMeasureSampleStatus =" + MSTMsg.STMSampleStu.iMeasureSampleStatus.ToString() + "Failed");
                         }
                     }
 
@@ -174,7 +176,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                             }
                             else
                             {
-                                m_MeasureApp.Nloger.TraceErrorLog("(OTSGetMreRetThread) BSEDataHeight = " + iHeight.ToString() + "BSEDataWidth = " + iWidth.ToString() + " Failed");
+                                Nloger.Error("(OTSGetMreRetThread) BSEDataHeight = " + iHeight.ToString() + "BSEDataWidth = " + iWidth.ToString() + " Failed");
                             }
                         }
                         else if (MSTMsg.STMSampleRetData.iRetDataType == MEASURE_SAMPLE_RESULT.FIELD_DATA)
@@ -188,7 +190,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                         }
                         else
                         {
-                            m_MeasureApp.Nloger.TraceErrorLog("(OTSGetMreRetThread) MSTMsg.STMSampleRetData.iRetDataType =" + MSTMsg.STMSampleRetData.iRetDataType.ToString() + "Failed");
+                           Nloger.Error("(OTSGetMreRetThread) MSTMsg.STMSampleRetData.iRetDataType =" + MSTMsg.STMSampleRetData.iRetDataType.ToString() + "Failed");
                         }
                     }
 
@@ -220,7 +222,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                     }
                     catch (Exception ex)
                     {
-                        m_MeasureApp.Nloger.TraceErrorLog("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
+                        Nloger.Error("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
                     }
                 }
                 //测量结果
@@ -247,14 +249,14 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                     }
                     catch (Exception ex)
                     {
-                        m_MeasureApp.Nloger.TraceErrorLog("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
+                        Nloger.Error("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
                     }
                 }
 
             }
             catch (Exception ex)
             {
-                m_MeasureApp.Nloger.TraceErrorLog("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
+                Nloger.Error("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
             }
         }
 
@@ -366,7 +368,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
             m_MeasureApp.m_DataMgrFun.GetMsrSampleStartTime(ref SampleMsrStartTime);           
             SMsrData.SampleStatu.csSampleMsrStartTime = SampleMsrStartTime.ToString("yyyy-MM-dd HH:mm:ss");
             string csSName = "";
-            List<System.Windows.Point> FieldList = new List<System.Windows.Point>();
+            List<System.Drawing.Point> FieldList = new List<System.Drawing.Point>();
             m_MeasureApp.m_DataMgrFun.GetBeforeCompleteField(ref csSName, ref FieldList);
             if(csSName == csSampleName)
             {

+ 7 - 5
OTS/OTSIncAMeasureApp/OTSMeasureThread/OTSMeasureResult.cs

@@ -57,6 +57,8 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
         //已完成帧图的绘制 根据位置-判断相差范围  四舍五入返回的数值有偏差
         static int minRange = -5;
         static int maxRange = 5;
+
+        public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
         #endregion
 
         #region 构造方法
@@ -84,7 +86,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
             }
             catch (Exception ex)
             {
-                m_MeasureApp.Nloger.TraceErrorLog("OTSIncAMeasureApp_OTSMeasureResult:--构造方法--错误日志:" + ex.ToString());
+                Nloger.Error("OTSIncAMeasureApp_OTSMeasureResult:--构造方法--错误日志:" + ex.ToString());
             }
         }
         #endregion
@@ -124,7 +126,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                     }
                     catch (Exception ex)
                     {
-                        m_MeasureApp.Nloger.TraceErrorLog("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
+                        Nloger.Error("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
                     }
                 }
                 //测量结果
@@ -151,14 +153,14 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                     }
                     catch (Exception ex)
                     {
-                        m_MeasureApp.Nloger.TraceErrorLog("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
+                        Nloger.Error("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
                     }
                 }
 
             }
             catch (Exception ex)
             {
-                m_MeasureApp.Nloger.TraceErrorLog("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
+               Nloger.Error("OTSIncAMeasureApp_backgroundWorker_ProgressChanged:--打开测量结果列表窗口--错误日志:" + ex.ToString());
             }
         }
         #endregion
@@ -761,7 +763,7 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
             }
             catch (Exception ex)
             {
-                m_MeasureApp.Nloger.TraceLog("RunMeasureState--错误信息:"+ ex.ToString()); 
+                Nloger.Trace("RunMeasureState--错误信息:"+ ex.ToString()); 
             }
         }
         #endregion

+ 4 - 2
OTS/OTSIncAMeasureApp/OTSMeasureThread/OTSMeasureThreadFun.cs

@@ -24,6 +24,8 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
         public static int DoRunType = 1;
         public static int m_HoleID;
         public static CDomain c_DomainMessure;
+
+        public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
         #endregion
 
         #region 构造方法
@@ -151,10 +153,10 @@ namespace OTSIncAMeasureApp.OTSMeasureThread
                 }
                 
                
-                m_MeasureApp.Nloger.TraceLog("**************   Begin to Measure Sample  *********************");
+                Nloger.Trace("**************   Begin to Measure Sample  *********************");
                 m_MeasureApp.m_DataMgrFun.SetMeasureThreadStatus(MSR_THREAD_STATUS.INPROCESS);
                 m_MeasureApp.m_DataMgrFun.DoMeasure();
-                m_MeasureApp.Nloger.TraceLog("###############    End to Measure Sample  #################");
+                Nloger.Trace("###############    End to Measure Sample  #################");
             }
             else if (DoRunType == (int)MSR_THREAD_RunSTATUS.RUNSampleHoleImage)
             {

+ 1 - 0
OTS/OTSIncAMeasureApp/OTSProgMgrInfo/OTSProgMgrInfoFunction/OTSProgMgrInfoFun.cs

@@ -11,6 +11,7 @@ using OTSProgMgrInfo.OTSProgMgrInfoFunction;
 //using NSLogFunExport;
 using OTSDataType;
 using OTSModelSharp;
+using OTSModelSharp.Measure.GetStageInfo;
 
 namespace OTSProgMgrInfo.OTSProgMgrInfoFunction
 {

+ 2 - 2
OTS/OTSModelSharp/DTLBase/CSQLiteTable.cs

@@ -10,9 +10,9 @@ namespace OTSModelSharp.DTL
     {
 
         //数据操作
-       // private SqlHelper dbHelper;
+        // private SqlHelper dbHelper;
         //表结构
-        private TableModel table;
+        private TableModel table = new TableModel();
         //数据库连接地址
         private string conStr;
         /// <summary>

+ 9 - 5
OTS/OTSModelSharp/Measure/GetParticle/IncAFileMgr.cs

@@ -16,15 +16,17 @@ namespace OTSModelSharp
         String m_strPathName;
 
         // particle list
-        List< COTSParticle> m_listParticle;
+        List<COTSParticle> m_listParticle = new List<COTSParticle>();
 
         // X-ray list
-        List<CPosXray> m_listPosXray;
+        List<CPosXray> m_listPosXray = new List<CPosXray>();
 
         //database
         CIncAFileMgr m_pIncADataDB;
 
-        CMergeParticleDB m_pMergePartDB;
+        CSQLiteTable cSQLiteTable = new CSQLiteTable();
+
+        CMergeParticleDB m_pMergePartDB = new CMergeParticleDB("", null);
 
         CSmallParticleInfoDB m_pSmallPartInfoDB;
 
@@ -45,7 +47,7 @@ namespace OTSModelSharp
 
         CSegmentDB m_SegmentDB;
 
-        CSQLiteTable cSQLiteTable = new CSQLiteTable();
+       
 
         public   CIncAFileMgr(String fileName)
 	    {
@@ -200,7 +202,9 @@ namespace OTSModelSharp
         return false;
 	 }
 
-      public  bool InitFile()
+        // particle list
+       public List<COTSParticle> GetParticleList() { return m_listParticle; }
+        public  bool InitFile()
         {
             var generalInfoTable = GetGeneralInfoDB();
             

+ 0 - 1
OTS/OTSModelSharp/OTSModelSharp.csproj

@@ -83,7 +83,6 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="ARACrypt.cs" />
-    <Compile Include="CGenParam.cs" />
     <Compile Include="CProjMgr.cs" />
     <Compile Include="CSmallParticleInfo.cs" />
     <Compile Include="CStdioFile.cs" />