Explorar o código

add delete sample data feature.

gsp %!s(int64=2) %!d(string=hai) anos
pai
achega
56cd8d9b6f

+ 2 - 2
Bin/x64/Debug/Config/ProData/HardwareConfig.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData PathName="HardwareConfig.xml" ID="1">
-  <Member RegName="SemControllerName" Value="Oxford" ImageInputSources="SE" />
-  <Member RegName="EDSName" Value="Oxford" />
+  <Member RegName="SemControllerName" Value="OffLine" ImageInputSources="SE" />
+  <Member RegName="EDSName" Value="OffLine" />
   <Member RegName="BrukerDllVersion" Version="Bruker.API.Esprit2.2.dll" />
   <Member RegName="FEIIP" Value="192.168.0.1" />
   <Member RegName="FEIPORT" Value="7520" />

BIN=BIN
OTSCPP/OpenDll/OxfordApi61Dll/Help/Extender.chm


BIN=BIN
OTSCPP/OpenDll/OxfordApi61Dll/Help/Extender.chw


+ 0 - 264
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CMsrDisplayResults.cs

@@ -1,264 +0,0 @@
-using OTSCLRINTERFACE;
-using OTSDataType;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-namespace OTSModelSharp
-{
-    //public double DEFAULT_RADIO = 1.0;
-    using CMsrResultItemsList = List<CMsrResultItem>;
-
-
-
-    public class CMsrResultItem
-    {   // Type ID
-        private int m_nTypeId;
-        // area (micros)
-        private double m_nArea;
-        // particle number
-        private System.UInt32 m_nNumber;
-        private string m_sName;
-        //---------------------public----------------------
-        public CMsrResultItem()//constructor
-        {            
-            Init();
-        }
-        public CMsrResultItem(CMsrResultItem a_oSource)
-        {
- 
-            Duplicate(a_oSource);
-        }
-       
-        public bool Equals(CMsrResultItem a_oSource)
-        {
-            return m_nTypeId == a_oSource.m_nTypeId &&
-            m_nArea == a_oSource.m_nArea &&
-            m_nNumber == a_oSource.m_nNumber&&
-            m_sName == a_oSource.m_sName;
-        }
-        //serialization
-        // Type ID
-        public int GetTypeId()
-        {
-            return m_nTypeId;
-        }
-        public void SetTypeId(int a_nTypeId)
-        {
-            m_nTypeId = a_nTypeId;
-        }
-        // area (micros)
-        public double GetArea()
-        {
-            return m_nArea;
-        }
-        public void SetArea(double a_nArea)
-        {
-            m_nArea = a_nArea;
-        }
-        // particle number
-        public System.UInt32 GetNumber()
-        {
-            return m_nNumber;
-        }
-        public void SetNumber(System.UInt32 a_nNumber)
-        {
-            m_nNumber = a_nNumber;
-        }
-        public string GetName()
-        {
-            return m_sName;
-        }
-        public void SetName(string val)
-        {
-            m_sName = val;
-        }
-        //---------------------protected---------------------
-        // initialization
-        protected void Init()
-        {
-            m_nTypeId = -1;
-            m_nArea = 0;
-            m_nNumber = 0;
-            m_sName = "";
-        }
-        //duplication
-        protected void Duplicate(CMsrResultItem a_oSource)
-        {
-            // initialization
-            Init();
-            // copy data over
-            m_nTypeId = a_oSource.m_nTypeId;
-            m_nArea = a_oSource.m_nArea;
-            m_nNumber = a_oSource.m_nNumber;
-            m_sName = a_oSource.m_sName;
-        }
-    }
-    // CMsrResults command target
-   public class CMsrDisplayResults
-    {
-        public double DEFAULT_RADIO = 1.0;
-        // radio
-        double m_dRadio;
-        // measured area (micros)
-        double m_nMeasuredArea;
-        // result items list
-        List<CMsrResultItem> m_listResultItems;
-
-        //-----------------public-----------------
-        public   CMsrDisplayResults()
-        {
-            // initialization
-            Init();
-        }
-        public CMsrDisplayResults(CMsrDisplayResults a_oSource)
-        {
-            // copy data over
-            Duplicate(a_oSource);
-        }
-   
-        public double GetRatio()
-        {
-            return m_dRadio;
-        }
-        public void SetRatio(double a_dRadio)
-        {
-            m_dRadio = a_dRadio;
-        }
-        // measured area (micros)
-        public double GetMeasuredArea()
-        {
-            return m_nMeasuredArea;
-        }
-        public void SetMeasuredArea(double a_nMeasuredArea)
-        {
-            m_nMeasuredArea = a_nMeasuredArea;
-        }
-        public void CumulateMeasuredArea(double a_nMeasuredArea)
-        {
-            m_nMeasuredArea += a_nMeasuredArea;
-        }
-
-        public List<CMsrResultItem> GetResultItems()
-        {
-            return m_listResultItems;
-        }
-        public void SetResultItems(List<CMsrResultItem> a_listResultItems)
-        {
-            // set results item list
-            m_listResultItems.Clear();
-            foreach (CMsrResultItem poResultItem in a_listResultItems)
-            {
-                CMsrResultItem cMsrResultItem =  poResultItem;
-                m_listResultItems.Add(cMsrResultItem);
-            }
-        }
-        public double GetTotalParticleArea()
-        {
-            double nArea = 0;
-            foreach (CMsrResultItem poResultItem in m_listResultItems)
-            {
-                nArea += poResultItem.GetArea();
-            }
-            return nArea;
-        }
-        public double GetTotalparticleIdentifyArea()
-        {
-            double nArea = 0;
-            foreach (CMsrResultItem poResultItem in m_listResultItems)
-            {
-                if (poResultItem.GetTypeId() > 7)
-                {
-                    nArea += poResultItem.GetArea();
-                }
-            }
-            return nArea;
-        }
-        public System.UInt32 GetTotalParticleNumber()
-        {
-            System.UInt32 nParticleNum = 0;
-            foreach (CMsrResultItem poResultItem in m_listResultItems)
-            {
-                nParticleNum += poResultItem.GetNumber();
-            }
-            return nParticleNum;
-        }
-        // calculate display ratio
-        public double CalDisplayRadio()
-        {
-            double dDisplayRadio = 0;
-            if (m_nMeasuredArea == 0)
-            {
-                return dDisplayRadio;
-            }
-            double nTotalParticleArea = GetTotalParticleArea();
-            dDisplayRadio = (double)nTotalParticleArea / (double)m_nMeasuredArea * m_dRadio;
-            return dDisplayRadio;
-        }
-        // cumulate measure results
-        public void CumulateMeasureResult(COTSParticleClr a_poResultItem)
-        {
-
-           var itr= m_listResultItems.Find((item) => { return a_poResultItem.GetClassifyId() == item.GetTypeId(); });
-            if (itr != null)
-            {
-
-                itr.SetArea(a_poResultItem.GetActualArea() + itr.GetArea());
-                itr.SetNumber(itr.GetNumber() + 1);
-            }
-            else            
-            {
-                CMsrResultItem pMsrResultItem = new CMsrResultItem();
-                pMsrResultItem.SetTypeId(a_poResultItem.GetClassifyId());
-
-                pMsrResultItem.SetArea(a_poResultItem.GetActualArea() + 0.5);
-                pMsrResultItem.SetNumber(1);
-                pMsrResultItem.SetName(a_poResultItem.GetTypeName());
-                m_listResultItems.Add(pMsrResultItem);
-            }
-         
-        }
-  
-        //-----------------protected---------------
-        protected bool GetID (CMsrResultItem poResultItem ,int a_TypeId)
-        {
-            if (poResultItem.GetTypeId() == a_TypeId)
-            {
-                return true;
-            }
-            else
-            {
-                return false;
-            }
-        }
-        // initialization
-        protected void Init()
-        {
-            m_dRadio = DEFAULT_RADIO;
-            m_nMeasuredArea = 0;
-            if (m_listResultItems != null)
-            {
-                m_listResultItems.Clear();
-            }
-            else
-            {
-                m_listResultItems = new CMsrResultItemsList();
-            }
-        }
-        // duplication 
-        protected void Duplicate(CMsrDisplayResults a_oSource)
-        {
-            // initialization
-            Init();
-            // copy data over
-            m_dRadio = a_oSource.m_dRadio;
-            m_nMeasuredArea = a_oSource.m_nMeasuredArea;
-            foreach (CMsrResultItem poResultItem in a_oSource.m_listResultItems)
-            {
-                CMsrResultItem cMsrResultItem = poResultItem;
-                m_listResultItems.Add(cMsrResultItem);
-            }
-        }
-    }
-}

+ 6 - 23
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -338,7 +338,7 @@ namespace OTSModelSharp
             CMsrSampleStatus pMsrSampleStatus = m_Sample.GetMsrStatus();
             int nCompeltedField = pMsrSampleStatus.GetCompletedFields();
 
-            CMsrDisplayResults pMsrResults = m_Sample.GetMsrResults();
+            CMsrResultItems pMsrResults = m_Sample.GetMsrResults();
             List<CMsrResultItem> listMsrResult = pMsrResults.GetResultItems();
             int nNumParticle = 0;
             foreach (var pResult in listMsrResult)
@@ -750,12 +750,9 @@ namespace OTSModelSharp
 
 
                         measuredArea = a_pBSEImg.GetHeight() * a_pBSEImg.GetWidth()* dPixelSize * dPixelSize + 0.5; //Get measured area
-                    if (!CumulateFieldData(curFld.GetListAnalysisParticles(), measuredArea))
-                    { // failed to call SaveFieldFile method
-                        log.Error("ImageProcess: call CumulateFieldData method.");
-                        pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
-                        return;
-                    }
+
+                    CumulateFieldData(curFld.GetListAnalysisParticles(), measuredArea);
+
                     log.Info("Send field data to screen!");
                
                     pStatus.AddCompletedFieldCenter(poiFieldCentre);
@@ -1280,7 +1277,7 @@ namespace OTSModelSharp
         {
 
             // get measure result items of the sample
-            CMsrDisplayResults pMsrResults = m_Sample.GetMsrResults();
+            CMsrResultItems pMsrResults = m_Sample.GetMsrResults();
 
             // cumulate field data info
         
@@ -1304,21 +1301,7 @@ namespace OTSModelSharp
             return true;
         }
 
-        // hole BSE images list
-        void SetHoleBESImgList(CHoleBSEImgsList a_listHoleBSEImg, bool a_bClear/* = TRUE*/)
-        {// clear the hole BSE image list if necessary 
-            if (a_bClear)
-            {
-                m_listHoleBSEImg.Clear();
-            }
-
-            // go through the input list
-            foreach (var pHoleBSEImg in a_listHoleBSEImg)
-            {// add the new hole BSE image into HoleBSEImage list
-                m_listHoleBSEImg.Add(pHoleBSEImg);
-            }
-
-        }
+      
 
 
         public bool SaveMergedParticles(List<COTSParticleClr> mergedParts)

+ 7 - 155
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMsrResult.cs

@@ -84,33 +84,7 @@ namespace OTSModelSharp
             m_pSample = new COTSSample();
            
         }
-        protected void Duplicate(CSmplMsrResult a_oSource)
-        {
-            // initialization
-            Init();
-            m_pSample = new COTSSample();
-            // copy data over
-            // file version string
-            m_strFileVersion = a_oSource.m_strFileVersion;
-            // SEM sample stage
-            m_pSEMStageData = a_oSource.m_pSEMStageData;
-            // sample stage
-            m_pStage = a_oSource.m_pStage;
-            // SEM condition??
-            //CSEMStageDataPtr m_pSEMData;
-            m_pSEMData = a_oSource.m_pSEMData;
-            // sample setting
-            m_pSample = a_oSource.m_pSample;
-            // switch
-            m_bSwitch = a_oSource.m_bSwitch;
-            // fields
-            m_pSample.GetFieldsData().Clear();
-            foreach (COTSFieldData pFieldData in a_oSource.m_pSample.GetFieldsData())
-            {
-                COTSFieldData pFieldDataNew = pFieldData;
-                m_pSample.GetFieldsData().Add(pFieldDataNew);
-            }
-        }
+       
      
         public CSmplMsrResult(string measureWorkingFolder,COTSSample a_pSample)
         {
@@ -630,7 +604,7 @@ namespace OTSModelSharp
             List<COTSFieldData> allFlds;
             allFlds = null;
             CMsrSampleStatus poMsrStatus = m_pSample.GetMsrStatus();
-            CMsrDisplayResults poMsrResults = m_pSample.GetMsrResults();
+            CMsrResultItems poMsrResults = m_pSample.GetMsrResults();
             double aFldArea = m_pSample.CalculateAFieldArea();
             if (GetAllFieldsFromDB(allFlds, poMsrStatus, poMsrResults, aFldArea))
             {
@@ -644,7 +618,7 @@ namespace OTSModelSharp
             }
         }
 
-        public bool GetAllFieldsFromDB(List<COTSFieldData> allFlds, CMsrSampleStatus status, CMsrDisplayResults rst, double aFieldArea)
+        public bool GetAllFieldsFromDB(List<COTSFieldData> allFlds, CMsrSampleStatus status, CMsrResultItems rst, double aFieldArea)
         {
             
             List<System.Drawing.PointF> completedfld = new List<System.Drawing.PointF>();
@@ -818,22 +792,7 @@ namespace OTSModelSharp
             // ok, return TRUE
             return true;
         }
-        // fields
-        //public COTSFieldData GetFieldById(int a_nID)
-        //{
-        //    List<COTSFieldData> listFieldData = m_pSample.GetFieldsData();
-        //    if (a_nID < 0 || a_nID > (int)listFieldData.Count)
-        //    {
-        //        return null;
-        //    }
-        //   COTSFieldData pFieldData = listFieldData[a_nID];
-        //    return pFieldData;
-        //}
-        //public void AddAField(COTSFieldData a_pFieldData)
-        //{
-        //    m_pSample.AddFieldData(a_pFieldData);
-        //    return ;
-        //}
+  
 
         public void SetFieldData(List<COTSFieldData> a_listFieldData)
         {
@@ -842,21 +801,7 @@ namespace OTSModelSharp
 
         }
        
-        //public bool DeleteAFieldById(int a_nID)
-        //{
-        //    List<COTSFieldData> listFieldData = GetFieldData();
-        //    if (a_nID < 0 || a_nID > (int)listFieldData.Count)
-        //    {
-        //        return false;
-        //    }
-        //    //listFieldData.erase(listFieldData.begin() + a_nID);
-        //    for (int i = 0; i < a_nID; i++)
-        //    {
-        //        listFieldData.RemoveAt(0);
-        //    }
-        //    return true;
-        //}
-        // pathname
+  
         public string GetPathFileName()
         {
             return m_strRstFileName;
@@ -869,12 +814,10 @@ namespace OTSModelSharp
         {
             m_strRstFileName = PathName;
         }
-        // set sample
-     
-        // set SEM general data
+       
         public void SetSEMGnr(CSEMDataGnr a_pSEMGnr)
         {
-            //ASSERT(a_pSEMGnr);
+         
             if (a_pSEMGnr == null)
             {
                 logger.Info("input a invalid SEM general data pointer.");
@@ -884,11 +827,7 @@ namespace OTSModelSharp
 
            m_pSEMData= a_pSEMGnr;
         }
-        // get id for a new field 
-       
-        // set SEMStageData
 
-        // set SEMStage
         public void SetSEMStage(CStage a_pStage)
         {
             //ASSERT(a_pStage);
@@ -900,94 +839,7 @@ namespace OTSModelSharp
       
             m_pStage= a_pStage;
         }
-        // according to a sample result file get a list of OTSFieldMgr
-        //public List<COTSFieldData> GetOTSFldMgrListAndAnalysisXrayList()
-        //{
-      
        
-        //    //Get FieldDataList
-        //    List<COTSFieldData> listFieldData =GetFieldData();
-        //    int nFieldNum = (int)listFieldData.Count;
-          
-        //    // get field number
-        //    foreach (COTSFieldData pFieldData in listFieldData)
-        //    {
-              
-        //        string strIncAFilename = m_strDBFileFolder + "\\" + DBFILE_NAME;
-        //        CIncAFileMgr DBFile = new CIncAFileMgr(strIncAFilename);
-        //        COTSFieldData pFieldMgr = new COTSFieldData();
-               
-        //        // get FieldData
-              
-        //        //pFieldMgr.SetOTSFieldData(pFieldData);
-        //        List<COTSParticleClr> listParticle = pFieldData.ListAnalysisParticles;
-        //        if (listParticle == null)
-        //        {
-
-        //            logger.Info("GetOTSFieldMgrList: there is no particle in this field.");
-        //            continue;
-        //        }
-
-        //        // get BSE
-        //        string strFieldFileFolder = m_strFieldFileSubFolder;
-
-        //        int nId = pFieldData.GetId();
-        //        string sFieldId;              
-        //        sFieldId = nId.ToString();
-        //        CBSEImageFileMgr cBSEImgFileMgr = new CBSEImageFileMgr();
-        //        string strBSEFilePathname = strFieldFileFolder + SMPL_MSR_RESULT_FIELDS_BSE + sFieldId + cBSEImgFileMgr.BMP_IMG_FILE_EXT;
-
-
-
-        //        CBSEImageFileMgr pBSEImgFile = new CBSEImageFileMgr();
-        //        if (!pBSEImgFile.LoadFromBitmap(strBSEFilePathname, true) == true)
-        //        {
-        //            logger.Error("GetOTSFieldMgrList: can't load BSE File.");
-                 
-
-        //            AddAField(pFieldMgr);
-        //            continue;
-        //        }
-
-        //        CBSEImgClr pBSEImg = pBSEImgFile.GetBSEImg();
-        //        pFieldMgr.SetBSEImage(pBSEImg);
-        //        // get analysis X-ray list
-
-
-        //        CPosXrayDBMgr pPosAnalysisXrayFileMgr = DBFile.GetPosXrayDBMgr();
-
-        //        pPosAnalysisXrayFileMgr.SetHasElement(true);
-        //        if (!pPosAnalysisXrayFileMgr.Load(pFieldData.GetId(), true))
-        //        {
-
-
-        //           AddAField(pFieldMgr);
-        //            continue;
-        //        }
-
-        //        List<CPosXrayClr> listAnalysisXray = pPosAnalysisXrayFileMgr.GetPosXrayList();
-             
-
-        //        AddAField(pFieldMgr);
-        //    }
-        //    var flddata = GetFieldData();
-        //    return flddata;
-        //}
-      
-  
-  
-        //----------------protected-----------------
-        //protected bool GetID(COTSFieldData cOTSFieldData, int a_TypeId)
-        //{
-        //    if (cOTSFieldData.GetId() == a_TypeId)
-        //    {
-        //        return true;
-        //    }
-        //    else
-        //    {
-        //        return false;
-        //    }
-        //}
       
     }
 }

+ 3 - 3
OTSIncAMeasureApp/0-OTSModel/Measure/ParamData/COTSMsrPrjResultData.cs

@@ -152,7 +152,7 @@ namespace OTSModelSharp
                 List<COTSFieldData> allMeasuredFlds = new List<COTSFieldData>();
                 CMsrSampleStatus poMsrStatus = new CMsrSampleStatus();
                
-                CMsrDisplayResults poMsrResults = smpl.GetMsrResults();
+                CMsrResultItems poMsrResults = smpl.GetMsrResults();
                 double aFldArea = smpl.CalculateAFieldArea();
                 SetPathName(strIncAFilename);
 
@@ -277,7 +277,7 @@ namespace OTSModelSharp
         // file pathname
         public String GetPathName() { return m_strPathName; }
 
-        public bool GetAllFieldsFromDB(ref List<COTSFieldData> allFlds, ref CMsrSampleStatus status, CMsrDisplayResults rst, double aFieldArea,Size picSize,double pixelSize)
+        public bool GetAllFieldsFromDB(ref List<COTSFieldData> allFlds, ref CMsrSampleStatus status, CMsrResultItems rst, double aFieldArea,Size picSize,double pixelSize)
         {
             String sDatabaseName = m_strPathName;
 
@@ -1383,7 +1383,7 @@ namespace OTSModelSharp
             foreach (var pSample in m_listSamples)
             {
 
-                if (pSample.GetMsrResults() == new CMsrDisplayResults())
+                if (pSample.GetMsrResults() == new CMsrResultItems())
                 {
 
                     continue;

+ 5 - 19
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSSample.cs

@@ -47,7 +47,7 @@ namespace OTSDataType
         private CDomain m_poMsrArea;
         private CSEMDataMsr m_poSEMDataMsr;
         private CMsrSampleStatus m_Status;
-        private CMsrDisplayResults m_poMsrResults;
+        private CMsrResultItems m_poMsrResults;
         private MEMBRANE_TYPE m_membraneType;
         private List<COTSFieldData> m_listFieldData;
         private List<CPropItemGrp> m_listPropItemGrp;
@@ -67,7 +67,7 @@ namespace OTSDataType
             m_poMsrArea = new CDomain();
             m_poSEMDataMsr = new CSEMDataMsr();
             m_Status = new CMsrSampleStatus();
-            m_poMsrResults = new CMsrDisplayResults();
+            m_poMsrResults = new CMsrResultItems();
             m_membraneType = MEMBRANE_TYPE.Abrasive;
             m_listFieldData = new List<COTSFieldData>();
             m_listPropItemGrp = new List<CPropItemGrp>();
@@ -525,21 +525,7 @@ namespace OTSDataType
 
         public CDomain GetMsrDomain() { return m_poMsrArea; }
        
-        // duplication 
-        public void Duplicate(COTSSample a_oSource)
-        {
-            // copy data over
-            m_strName = a_oSource.m_strName;
-            m_strHoleName = a_oSource.m_strHoleName;
-            m_bParamLock = a_oSource.m_bParamLock;
-            m_bSwitch = a_oSource.m_bSwitch;
-            m_poMsrParams = new CSampleParam(a_oSource.m_poMsrParams);
-            m_poMsrArea = new CDomain(a_oSource.m_poMsrArea);
-            m_poSEMDataMsr = new CSEMDataMsr(a_oSource.m_poSEMDataMsr);
-            m_Status = new CMsrSampleStatus(a_oSource.m_Status);
-            m_poMsrResults = new CMsrDisplayResults(a_oSource.m_poMsrResults);
-            m_membraneType = a_oSource.m_membraneType;
-        }
+  
         // calculate scan field size
         public void CalculateScanFieldSize(double a_dPixelSize,ref int scanFieldWidth,ref int scanFieldHeight)
         {
@@ -690,8 +676,8 @@ namespace OTSDataType
             return nNewFieldId;
         }
         // measure results
-        public CMsrDisplayResults GetMsrResults() { return m_poMsrResults; }
-        public void SetMsrResults(CMsrDisplayResults a_poMsrResults)
+        public CMsrResultItems GetMsrResults() { return m_poMsrResults; }
+        public void SetMsrResults(CMsrResultItems a_poMsrResults)
         {
             m_poMsrResults = a_poMsrResults;
         }

+ 5 - 6
OTSIncAMeasureApp/1-OTSMeasure/OTSMeasureDisplayResult.cs

@@ -55,7 +55,7 @@ namespace OTSMeasureApp
                 m_MeasureApp = m_MeasureApps;
                
                 m_OTSSamplespaceWindow = m_MeasureApps.m_SamplepaceWindow;
-                m_OTSMeasureResultWindow = m_MeasureApp.m_MeasureRetWindow;
+                m_OTSMeasureResultWindow = m_MeasureApp.m_MeasureResultWindow;
                 m_OTSMeasureStatusWindow = new OTSMeasureStatusWindow(m_MeasureApp);
                
                 Control.CheckForIllegalCrossThreadCalls = false;
@@ -95,17 +95,16 @@ namespace OTSMeasureApp
                         if (m_OTSMeasureResultWindow == null)
                         {
                             //实例窗体
-                            m_OTSMeasureResultWindow = m_MeasureApp.m_MeasureRetWindow;
+                            m_OTSMeasureResultWindow = m_MeasureApp.m_MeasureResultWindow;
                         }
                         //设置工作样品
                         m_MeasureApp.m_ProjParam.SetWorkSample(m_OTSSamplespaceWindow.GetWorkingVisualSample().GetSampleName());
                         //获取工作样品信息
                         COTSSample WSample = m_MeasureApp.m_ProjParam.GetWorkSample();
-                        CMsrDisplayResults cMsrResultsClr = WSample.GetMsrResults();
+                        CMsrResultItems MsrResults = WSample.GetMsrResults();
                         //获取结果文件 颗粒列表信息
-                        List<CMsrResultItem> cMsrResultItemClrList = cMsrResultsClr.GetResultItems();
-                        //根据编号获取分类名称
-                        List<CMsrResultItem> cMsrResultItemClrListTemp = cMsrResultItemClrList;
+                        List<CMsrResultItem> cMsrResultItemClrList = MsrResults.GetResultItems();
+                        
                         //设置测量状态数据列表
                         SetMeasureListInfo(cMsrResultItemClrList);
                    

+ 14 - 14
OTSIncAMeasureApp/1-OTSMeasure/OTSMeasureResultWindow.Designer.cs

@@ -64,7 +64,7 @@
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
-            this.lblSingleCount = new System.Windows.Forms.Label();
+            this.lblFieldCount = new System.Windows.Forms.Label();
             this.lblMeasureTime = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
@@ -458,17 +458,17 @@
             // 
             // lblSingleCount
             // 
-            this.lblSingleCount.AutoSize = true;
-            this.lblSingleCount.BackColor = System.Drawing.Color.White;
-            this.lblSingleCount.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lblSingleCount.ForeColor = System.Drawing.Color.Black;
-            this.lblSingleCount.ImeMode = System.Windows.Forms.ImeMode.NoControl;
-            this.lblSingleCount.Location = new System.Drawing.Point(559, 7);
-            this.lblSingleCount.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.lblSingleCount.Name = "lblSingleCount";
-            this.lblSingleCount.Size = new System.Drawing.Size(11, 12);
-            this.lblSingleCount.TabIndex = 49;
-            this.lblSingleCount.Text = "0";
+            this.lblFieldCount.AutoSize = true;
+            this.lblFieldCount.BackColor = System.Drawing.Color.White;
+            this.lblFieldCount.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lblFieldCount.ForeColor = System.Drawing.Color.Black;
+            this.lblFieldCount.ImeMode = System.Windows.Forms.ImeMode.NoControl;
+            this.lblFieldCount.Location = new System.Drawing.Point(559, 7);
+            this.lblFieldCount.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.lblFieldCount.Name = "lblSingleCount";
+            this.lblFieldCount.Size = new System.Drawing.Size(11, 12);
+            this.lblFieldCount.TabIndex = 49;
+            this.lblFieldCount.Text = "0";
             // 
             // lblMeasureTime
             // 
@@ -505,7 +505,7 @@
             this.Controls.Add(this.PBState);
             this.Controls.Add(this.lblParticleCount);
             this.Controls.Add(this.lblSampleName);
-            this.Controls.Add(this.lblSingleCount);
+            this.Controls.Add(this.lblFieldCount);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.pictureBox7);
@@ -570,7 +570,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Number;
         private System.Windows.Forms.DataGridViewTextBoxColumn Area;
         private System.Windows.Forms.PictureBox pictureBox2;
-        private System.Windows.Forms.Label lblSingleCount;
+        private System.Windows.Forms.Label lblFieldCount;
         private System.Windows.Forms.Label lblMeasureTime;
     }
 }

+ 2 - 2
OTSIncAMeasureApp/1-OTSMeasure/OTSMeasureResultWindow.cs

@@ -136,7 +136,7 @@ namespace OTSMeasureApp
             lblMeasureTime.Text = string.Empty;
             lblParticleCount.Text = string.Empty;
             lblBeginTime.Text = string.Empty;
-            lblSingleCount.Text = string.Empty;
+            lblFieldCount.Text = string.Empty;
             lblProgressInfo.Text = "0%";
             PBState.Value = 0;
             dg_Info.DataSource = null;
@@ -161,7 +161,7 @@ namespace OTSMeasureApp
                 int currentProgress = m_MinValue;
                 int currentMeasureCountAdd = currentMeasureCount;
                 //设置当前帧图数
-                lblSingleCount.Text = currentMeasureCount.ToString();
+                lblFieldCount.Text = currentMeasureCount.ToString();
                 if (currentMeasureCountAdd <= measureAllCount)
                 {
                     currentProgress = (currentMeasureCountAdd) * 100 / measureAllCount;

+ 86 - 37
OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs

@@ -302,6 +302,53 @@ namespace OTSMeasureApp
 
             return MeasureInfo;
         }
+        public OTSSamplePropertyInfo DeleteCurrentSampleData()
+        {
+
+            COTSSample Sample = GetWorkSample();
+            if (Sample == null) return null;
+           var sname= Sample.GetName();
+
+            var pathname = resultData.GetFolderName(resultData.GetPathName());
+
+
+             var sampleResultFolder = pathname + "\\" + sname;
+            if (Directory.Exists(sampleResultFolder))
+            {
+               
+                    Directory.Delete(sampleResultFolder, true);
+                    var flds = Sample.GetFieldsData();
+                    foreach (var f in flds)
+                    {
+                        f.SetIsMeasureComplete(false);
+                    }
+               
+
+            }
+            var sta = Sample.GetMsrStatus();
+
+            sta.ClearCompletedFieldsInfo();
+
+            sta.SetStatus(OTS_MSR_SAMPLE_STATUS.UNMEASURED);
+            var rsts = Sample.GetMsrResults();
+            var itms = rsts.GetResultItems();
+            itms.Clear();
+            rsts.SetResultItems(itms);
+            rsts.SetMeasuredArea(0);
+            rsts.SetRatio(0);
+            
+          
+
+
+            // 获取样品的属性值
+            OTSSamplePropertyInfo MeasureInfo = new OTSSamplePropertyInfo();
+            if (!GetWorkSamplePerameter(Sample, ref MeasureInfo))
+            {
+                return null;
+            }
+
+            return MeasureInfo;
+        }
         protected COTSSample SetSampleDefaultPara(ref COTSSample pSample, String a_strHoleName)
         {
             // get new sample name
@@ -1366,7 +1413,7 @@ namespace OTSMeasureApp
             }
            
 
-                bool MeasurementStatus = false;
+               
            
 
             //样品的标题名 (Treeview的根节点名)           
@@ -1429,42 +1476,44 @@ namespace OTSMeasureApp
                     }
                     SData.sSCaptionName = (String)SDataObj.GetName();
                     //------------------------------修改--------------------------
-
-                    if ((String)SDataObj.GetName() == "样品名")
-                    {
-                        for (int a = 0; a < ja.Count; a++)
-                        {
-                            var grpa = ja[a];
-                            var SDataArra = grpa.GetItemsList();
-                            for (int b = 0; b < SDataArra.Count; b++)
-                            {
-                                var SDataObb = SDataArra[b];
-                                if ((String)SDataObb.GetName() == "测量状态")
-                                {
-                                    if ((String)Sample.GetItemValueStr((OTS_SAMPLE_PROP_GRID_ITEMS)SDataObb.GetSmplItemId()) == "未测量")
-                                    {
-                                        MeasurementStatus = false;
-                                    }
-                                    else
-                                    {
-                                        MeasurementStatus = true;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    else
-                    {
-                        MeasurementStatus = false;
-                    }
-                    if (MeasurementStatus)
-                    {
-                        SData.bReadOnly = MeasurementStatus;
-                    }
-                    else
-                    {
-                        SData.bReadOnly = (bool)SDataObj.IsReadOnly();// OTS_ITEM_TYPES
-                    }
+                    //bool MeasurementStatus = false;
+                    //if (SDataObj.GetSmplItemId() == OTS_SAMPLE_PROP_GRID_ITEMS.SAMPLE_NAME) //"样品名")
+                    //{
+                    //    for (int a = 0; a < ja.Count; a++)
+                    //    {
+                    //        var grpa = ja[a];
+                    //        var SDataArra = grpa.GetItemsList();
+                    //        for (int b = 0; b < SDataArra.Count; b++)
+                    //        {
+                    //            var SDataObb = SDataArra[b];
+                    //            if (SDataObb.GetSmplItemId() == OTS_SAMPLE_PROP_GRID_ITEMS.MEASURE_STATAU)//"测量状态")
+                    //            {
+                    //                if (Sample.GetItemValueStr(SDataObb.GetSmplItemId()) == "未测量")
+
+                    //                    if (Sample.GetItemValue(SDataObb.GetSmplItemId()) == "未测量")
+                    //                {
+                    //                    MeasurementStatus = false;
+                    //                }
+                    //                else
+                    //                {
+                    //                    MeasurementStatus = true;
+                    //                }
+                    //            }
+                    //        }
+                    //    }
+                    //}
+                    //else
+                    //{
+                    //    MeasurementStatus = false;
+                    //}
+                    //if (MeasurementStatus)
+                    //{
+                    //    SData.bReadOnly = MeasurementStatus;
+                    //}
+                    //else
+                    //{
+                    //    SData.bReadOnly = (bool)SDataObj.IsReadOnly();// OTS_ITEM_TYPES
+                    //}
 
                     //---------------------------------------------------------------
 

+ 3 - 55
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/CreateRectangle.cs

@@ -1307,64 +1307,12 @@ namespace OTSMeasureApp
 
         RingShape=18
     }
-    public enum ContextMenuType
-    {
-        //样品孔右键菜单
-        SampleHoleMenu = 0,
-        //样品右键菜单
-        SampleMenu = 1,
-        //测量区域右键菜单
-        MeasureMenu = 2,
-        //线程运行后菜单
-        ThreadRunMenu = 3,
-        //样品台右键菜单
-        SampleStateMenu = 4,
-        //样品孔BSE图像
-        SampleHoleBSEImage = 5,
-        //帧图菜单
-        FieldMenu = 6
-    }
+  
+
+  
 
-    public enum MeasureStateMenuType
-    {
-        //获取BSE图
-        ReadBSEPic = 0,
-        //设置可视化灰度
-        SetVisualGray = 1,
-        //显示BSE灰度曲线图
-        SetVisualGrayForSpecialGray=2,
-        grayToolStripMenuItem =3,
-        //切换至BSE图
-        ChangeDiffImageShow = 4,
-        //BSE去背景图
-        DelBSEBG =5,
-        ColoredBSENoBG=6,
-        //显示BSE去背景灰度曲线图
-        SampleHoleBSEImage = 7,
-        //线扫描曲线
-        MenuItemLineScam = 8,
-        //单点采集Xray与元素信息
-        PointScanElementMenuItem = 9,
-        //导出采集信息报告
-        ExportReport =10
-    }
 
 
-    public enum MenuIndex
-    {
-        AddSample = 0,
-        DeleteSample = 1,
-        SampleStripSeparator = 2,
-        ReadSEMData = 3,
-        SetSemData = 4,
-        SetSEMCenterLocation = 5,
-        DriveSEMToCenterLocation = 6,
-        DriveSEMToCurrentLocation = 7,
-        SEMStripSeparator = 8,
-        ShootBSEPicture = 9,
-        DeleteBSEPicture = 10,
-        SlopFocus=11
-    }
     public enum ColorType
     {
         SingleColor,//帧图fd8f8f

+ 13 - 3
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.Designer.cs

@@ -34,6 +34,7 @@ namespace OTSMeasureApp
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OTSSamplespaceWindow));
             this.CMStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.AddStage = new System.Windows.Forms.ToolStripMenuItem();
+            this.DeleteSampleData = new System.Windows.Forms.ToolStripMenuItem();
             this.DeleteStage = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.ReadSEMData = new System.Windows.Forms.ToolStripMenuItem();
@@ -66,9 +67,10 @@ namespace OTSMeasureApp
             this.toolStripSeparator2,
             this.ShootBSEPicture,
             this.DeleteBSEPicture,
+            this.DeleteSampleData,
             this.SlopFocusMenuItem});
             this.CMStrip.Name = "CMStrip";
-            this.CMStrip.Size = new System.Drawing.Size(195, 338);
+            this.CMStrip.Size = new System.Drawing.Size(195, 346);
             this.CMStrip.Text = "添加样品";
             this.CMStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.CMStrip_ItemClicked);
             // 
@@ -79,6 +81,14 @@ namespace OTSMeasureApp
             this.AddStage.Size = new System.Drawing.Size(194, 30);
             this.AddStage.Text = "增加样品测量";
             // 
+            // DeleteSampleData
+            // 
+            this.DeleteSampleData.Image = global::OTSMeasureApp.Properties.Resources.deletefile321;
+            this.DeleteSampleData.Name = "DeleteSampleData";
+            this.DeleteSampleData.Size = new System.Drawing.Size(194, 30);
+            this.DeleteSampleData.Text = "删除已测数据";
+            this.DeleteSampleData.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
+            // 
             // DeleteStage
             // 
             this.DeleteStage.Image = global::OTSMeasureApp.Properties.Resources.删除样品;
@@ -151,7 +161,6 @@ namespace OTSMeasureApp
             this.DeleteBSEPicture.Name = "DeleteBSEPicture";
             this.DeleteBSEPicture.Size = new System.Drawing.Size(194, 30);
             this.DeleteBSEPicture.Text = "删除BSE照片";
-            //this.DeleteBSEPicture.Click += new System.EventHandler(this.DeleteBSEPicture_Click);
             // 
             // SlopFocusMenuItem
             // 
@@ -195,7 +204,7 @@ namespace OTSMeasureApp
             | OTS.WinFormsUI.Docking.DockAreas.DockTop) 
             | OTS.WinFormsUI.Docking.DockAreas.DockBottom) 
             | OTS.WinFormsUI.Docking.DockAreas.Document)));
-            this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.KeyPreview = true;
             this.Margin = new System.Windows.Forms.Padding(4);
@@ -232,5 +241,6 @@ namespace OTSMeasureApp
         private System.Windows.Forms.DataGridView dgvFocus;
         public System.Windows.Forms.Label lblFocus;
         public System.Windows.Forms.ContextMenuStrip CMStrip;
+        private System.Windows.Forms.ToolStripMenuItem DeleteSampleData;
     }
 }

+ 64 - 7
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -27,6 +27,39 @@ namespace OTSMeasureApp
         MouseSizeBottomRight = 8, //'拉伸右下角  
         MouseDrag = 9   // '鼠标拖动  
     }
+    public enum ContextMenuType
+    {
+        //样品孔右键菜单
+        SampleHoleMenu = 0,
+        //样品右键菜单
+        SampleMenu = 1,
+        //测量区域右键菜单
+        MeasureMenu = 2,
+        //线程运行后菜单
+        ThreadRunMenu = 3,
+        //样品台右键菜单
+        SampleStateMenu = 4,
+        //样品孔BSE图像
+        SampleHoleBSEImage = 5,
+        //帧图菜单
+        FieldMenu = 6
+    }
+    public enum MenuIndex
+    {
+        AddSample = 0,
+        DeleteSample = 1,
+        SampleStripSeparator = 2,
+        ReadSEMData = 3,
+        SetSemData = 4,
+        SetSEMCenterLocation = 5,
+        DriveSEMToCenterLocation = 6,
+        DriveSEMToCurrentLocation = 7,
+        SEMStripSeparator = 8,
+        ShootBSEPicture = 9,
+        DeleteBSEPicture = 10,
+        DeleteSampleData=11,
+        SlopFocus = 12
+    }
     public partial class OTSSamplespaceWindow : DockContent
     {
         #region 全局变量定义
@@ -227,15 +260,14 @@ namespace OTSMeasureApp
             switch (e.ClickedItem.Name)
             {
                 case "AddStage":
-                    m_MeasureAppForm.m_SPropertyWindows.TSSaveAs.Enabled = true;
-                    m_MeasureAppForm.m_SPropertyWindows.TSLoad.Enabled = true;
-                    m_MeasureAppForm.m_SPropertyWindows.TSEdit.Enabled = false;
-                    m_MeasureAppForm.m_SPropertyWindows.TSEdit.Visible = false;
+                   
 
                     //添加样品
                     m_MeasureAppForm.AddNewSampleMeasure(m_SampleHoleSelectName);
                    
                     break;
+
+              
                 case "DeleteStage":
                     //删除样品
                     DeleteSampleInfo(m_SampleSelectName);
@@ -290,6 +322,14 @@ namespace OTSMeasureApp
                 case "DeleteBSEPicture":
                     DeleteHoleBSEImageDataNoMessageBox();
                     break;
+                case "DeleteSampleData":
+                    if (MessageBox.Show("The result data of this sample will be deleted, continue?", "DeleteData", MessageBoxButtons.OKCancel) == DialogResult.OK)
+                    {
+                        m_MeasureAppForm.DeleteCurrentSampleData();
+                        m_MeasureAppForm.m_MeasureResultWindow.SetInit();
+                        PrepareMeasureField(GetWorkingVisualSample(), MSR_RUN_TYPE.RUNMEASURE);
+                    }
+                    break;
                 case "SlopFocusMenuItem":
 
                     if (slopFocus == null)
@@ -788,7 +828,7 @@ namespace OTSMeasureApp
         #region 将测量状态进度窗口信息初始化
         public void InitMeasureStateInfo()
         {
-           m_MeasureAppForm.m_MeasureRetWindow.SetInit();
+           m_MeasureAppForm.m_MeasureResultWindow.SetInit();
         }
         #endregion
        
@@ -831,7 +871,7 @@ namespace OTSMeasureApp
         }
         public static void SetShowCMStrip(ContextMenuType IsSelectType, ContextMenuStrip cmStrip, bool IsTrue)
         {
-
+           
             switch (IsSelectType)
             {
                 case ContextMenuType.SampleHoleMenu:
@@ -845,6 +885,7 @@ namespace OTSMeasureApp
                     cmStrip.Items[(int)MenuIndex.SEMStripSeparator].Enabled = false;
                     cmStrip.Items[(int)MenuIndex.ShootBSEPicture].Enabled = false;
                     cmStrip.Items[(int)MenuIndex.DeleteBSEPicture].Enabled = false;
+                    cmStrip.Items[(int)MenuIndex.DeleteSampleData].Enabled = false;
                     cmStrip.Items[(int)MenuIndex.SlopFocus].Enabled = false;
                     break;
                 case ContextMenuType.SampleMenu:
@@ -858,6 +899,7 @@ namespace OTSMeasureApp
                     cmStrip.Items[(int)MenuIndex.SEMStripSeparator].Enabled = false;
                     cmStrip.Items[(int)MenuIndex.ShootBSEPicture].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.DeleteBSEPicture].Enabled = false;
+                    cmStrip.Items[(int)MenuIndex.DeleteSampleData].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.SlopFocus].Enabled = true;
                     break;
                 case ContextMenuType.MeasureMenu:
@@ -870,6 +912,7 @@ namespace OTSMeasureApp
                     cmStrip.Items[(int)MenuIndex.DriveSEMToCurrentLocation].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.ShootBSEPicture].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.DeleteBSEPicture].Enabled = true;
+                    cmStrip.Items[(int)MenuIndex.DeleteSampleData].Enabled = false;
                     cmStrip.Items[(int)MenuIndex.SlopFocus].Enabled = true;
                
                   
@@ -884,6 +927,7 @@ namespace OTSMeasureApp
                     cmStrip.Items[(int)MenuIndex.DriveSEMToCurrentLocation].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.ShootBSEPicture].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.DeleteBSEPicture].Enabled = true;
+                    cmStrip.Items[(int)MenuIndex.DeleteSampleData].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.SlopFocus].Enabled = true;
                 
                    
@@ -904,6 +948,7 @@ namespace OTSMeasureApp
                     cmStrip.Items[(int)MenuIndex.DriveSEMToCurrentLocation].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.ShootBSEPicture].Enabled = false;
                     cmStrip.Items[(int)MenuIndex.DeleteBSEPicture].Enabled = false;
+                    cmStrip.Items[(int)MenuIndex.DeleteSampleData].Enabled = false;
                     cmStrip.Items[(int)MenuIndex.SlopFocus].Enabled = false;
                     break;
                 case ContextMenuType.SampleHoleBSEImage:
@@ -916,6 +961,7 @@ namespace OTSMeasureApp
                     cmStrip.Items[(int)MenuIndex.DriveSEMToCurrentLocation].Enabled = true;
                     cmStrip.Items[(int)MenuIndex.ShootBSEPicture].Enabled = IsTrue;
                     cmStrip.Items[(int)MenuIndex.DeleteBSEPicture].Enabled = true;
+                    cmStrip.Items[(int)MenuIndex.DeleteSampleData].Enabled = false;
                     cmStrip.Items[(int)MenuIndex.SlopFocus].Enabled = IsTrue;                   
                     break;
             }
@@ -3086,8 +3132,19 @@ namespace OTSMeasureApp
             Invalidate();
                
         }
+
         #endregion
 
-     
+        private void toolStripMenuItem1_Click(object sender, EventArgs e)
+        {
+
+        }
+        private void DeleteCurrentSampleData()
+        {
+           
+
+        }
+
+       
     }
 }

+ 34 - 99
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSMeasureStatusWindow.cs

@@ -27,6 +27,29 @@ namespace OTSMeasureApp
         //灰度图
         GrayImage = 1
     }
+    public enum MeasureStateMenuType
+    {
+        //获取BSE图
+        ReadBSEPic = 0,
+        //设置可视化灰度
+        SetVisualGray = 1,
+        //显示BSE灰度曲线图
+        SetVisualGrayForSpecialGray = 2,
+        grayToolStripMenuItem = 3,
+        //切换至BSE图
+        ChangeDiffImageShow = 4,
+        //BSE去背景图
+        DelBSEBG = 5,
+        ColoredBSENoBG = 6,
+        //显示BSE去背景灰度曲线图
+        SampleHoleBSEImage = 7,
+        //线扫描曲线
+        MenuItemLineScam = 8,
+        //单点采集Xray与元素信息
+        PointScanElementMenuItem = 9,
+        //导出采集信息报告
+        ExportReport = 10
+    }
     public partial class OTSMeasureStatusWindow : DockContent
     {
 
@@ -568,58 +591,7 @@ namespace OTSMeasureApp
 
         //更新当前的图
         #region 更新当前的图
-        //private void UpdateImageOrChart(ImageType imagetype)
-        //{
-            
-        //        switch (imagetype)
-        //        {
-        //            case ImageType.BSEImage:
-        //                {
-        //                    //在控件中显示图像
-        //                    ShowImage(m_iWidth, m_iHeight, originalBseData);
-        //                    //Imagedata = new byte[m_iWidth];
-        //                    IsShowGrayLevelLine = false;
-        //                    //获取默认Y轴
-        //                    //GetYSize();
-        //                    ////获取行数据
-        //                    //GetLineImage(YSize, m_iWidth, ref Imagedata);
-        //                }
-        //                break;
-        //            case ImageType.RemoveBGImage:
-        //                {
-        //                    ShowImage(m_iWidth, m_iHeight, removeBGBseData);
-        //                    //Imagedata = new byte[m_iWidth];
-        //                    IsShowGrayLevelLine = false;
-        //                    //获取默认Y轴
-        //                    //GetYSize();
-        //                    ////获取行数据
-        //                    //GetLineImage(YSize, m_iWidth, ref Imagedata);
-        //                }
-        //                break;
-        //            case ImageType.GrayLevelLine:
-        //                {
-        //                    //GetLineImage(YSize, m_iWidth, ref Imagedata);
-        //                }
-        //                break;
-        //            case ImageType.ColorParticleImage:
-        //                {
-        //                    ShowColoredImage(m_iWidth, m_iHeight, coloredParticleImage);
-        //                    //Imagedata = new byte[m_iWidth];
-        //                    IsShowGrayLevelLine = false;
-        //                    //获取默认Y轴
-        //                    //GetYSize();
-        //                    ////获取行数据
-        //                    //GetLineImage(YSize, m_iWidth, ref Imagedata);
-        //                }
-        //                break;
-        //            default:
-        //                { }
-        //                break;
-
-        //        }
-        //        this.Refresh();
-          
-        //}
+      
         #endregion
         //显示去背景图 = AUTO
         #region 显示去背景图
@@ -649,26 +621,10 @@ namespace OTSMeasureApp
                 var imageProcessParam = WSample.GetMsrParams().GetImageProcessParam();
 
                 var imageHandle = new CImageHandler();
-              //var  m_systype = m_MeasureAppForm.m_ProjParam.GetResultData().m_systemTypeId;
-              //  if (m_systype == otsdataconst.OTS_SysType_ID.CleannessA)
-              //  {
-              //      coloredParticleImage = new Bitmap(m_iWidth, m_iHeight);
-              //      CBSEImgClr pImgNoBG = new CBSEImgClr(new Rectangle(0,0,m_iWidth,m_iHeight));
-              //      bfResult = imageHandle.GetColoredImage(imageProcessParam, pixelSize, originalBseData, m_iWidth, m_iHeight, ref pImgNoBG,ref coloredParticleImage);
-              //      m_imagetype = ImageType.ColorParticleImage;
-                   
-              //      removeBGBseData = pImgNoBG.GetImageDataPtr();
-
-              //  }
-              //  else if(m_systype == otsdataconst.OTS_SysType_ID.IncA)
-              //  {
+       
                     bfResult = imageHandle.GetBSEImage(imageProcessParam, pixelSize, originalBseData, m_iWidth, m_iHeight, ref removeBGBseData);
                     m_IsShowImageType = ImageType.RemoveBGImage;
-                    //m_imagetype = ImageType.RemoveBGImage;
-              
-                //}
-              
-
+                 
                 //获取去背景灰度图数据
                 dGrayAbandonLevelData = new double[(int)GrayLevel.Max];
                 dGrayAbandonLevelData = GetGrayAbandonData(removeBGBseData, dGrayAbandonLevelData);
@@ -686,12 +642,12 @@ namespace OTSMeasureApp
                 if (!bfResult) { return; }
 
 
-                //用于线扫描曲线
+            
 
-                //UpdateImageOrChart(m_imagetype);
+             
 
             ShowImage(m_iWidth, m_iHeight, removeBGBseData);
-            //Imagedata = new byte[m_iWidth];
+          
             IsShowGrayLevelLine = false;
 
             myChart.Visible = false;
@@ -719,24 +675,14 @@ namespace OTSMeasureApp
             var imageProcessParam = WSample.GetMsrParams().GetImageProcessParam();
 
             var imageHandle = new CImageHandler();
-            //var m_systype = m_MeasureAppForm.m_ProjParam.GetResultData().m_systemTypeId;
-            //if (m_systype == otsdataconst.OTS_SysType_ID.CleannessA)
-            //{
+           
                 coloredParticleImage = new Bitmap(m_iWidth, m_iHeight);
                 CBSEImgClr pImgNoBG = new CBSEImgClr(new Rectangle(0, 0, m_iWidth, m_iHeight));
                 bfResult = imageHandle.GetColoredImage(imageProcessParam, pixelSize, originalBseData, m_iWidth, m_iHeight, ref pImgNoBG, ref coloredParticleImage);
-                //m_imagetype = ImageType.ColorParticleImage;
-
+              
                 removeBGBseData = pImgNoBG.GetImageDataPtr();
 
-            //}
-            //else if (m_systype == otsdataconst.OTS_SysType_ID.IncA)
-            //{
-            //    bfResult = imageHandle.GetBSEImage(imageProcessParam, pixelSize, originalBseData, m_iWidth, m_iHeight, ref removeBGBseData);
-            //    m_IsShowImageType = ImageType.RemoveBGImage;
-            //    m_imagetype = ImageType.RemoveBGImage;
-
-            //}
+      
 
 
             //获取去背景灰度图数据
@@ -848,20 +794,9 @@ namespace OTSMeasureApp
             panelXray.Visible = false;
 
             picBox.Refresh();
-            //ShowGrayLevelLine();
+          
         }
-        //protected void ShowGrayLevelLine()
-        //{
-
-        //    m_imagetype = ImageType.GrayLevelLine;
-        //    //取图不成功就返回
-        //    if (!bfResult) { return; }
-        //    byte[] Imagedata= new byte[m_iWidth];
-        //    GetLineImage(YSize, m_iWidth, ref Imagedata);
-        //    //UpdateImageOrChart(m_imagetype);
-        //    m_ImageData.Line = idLine.GrayLine;
-
-        //}
+
         #endregion
 
         #region  扫描线轴X

+ 4 - 4
OTSIncAMeasureApp/6-OTSDisplayTreeViewData/OTSSolutionWindow.cs

@@ -164,7 +164,7 @@ namespace OTSMeasureApp
                     m_TreeViewBase.GetTreeWorkSampleNode(m_WorkSampleName);
 
                     //删除时重新初始化结果窗体结果
-                    m_MeasureAppForm.m_MeasureRetWindow.SetInit();
+                    m_MeasureAppForm.m_MeasureResultWindow.SetInit();
                    
                 }
             }
@@ -333,7 +333,7 @@ namespace OTSMeasureApp
 
             }
             //通过样品名称获取
-            m_MeasureAppForm.m_MeasureRetWindow.GetResultFileInfoBySampleName(m_WorkSampleNode.Text);
+            m_MeasureAppForm.m_MeasureResultWindow.GetResultFileInfoBySampleName(m_WorkSampleNode.Text);
         }
 
         //Treeview增加测量样品节点
@@ -712,7 +712,7 @@ namespace OTSMeasureApp
                                 {
                                     treeView1.SelectedNode = treeView1.Nodes[0].Nodes[currentNodeIndex];
                                     //通过样品名称获取
-                                    m_MeasureAppForm.m_MeasureRetWindow.GetResultFileInfoBySampleName(treeView1.Nodes[0].Nodes[currentNodeIndex - 1].Text);
+                                    m_MeasureAppForm.m_MeasureResultWindow.GetResultFileInfoBySampleName(treeView1.Nodes[0].Nodes[currentNodeIndex - 1].Text);
                                     break;
                                 }
                             }
@@ -731,7 +731,7 @@ namespace OTSMeasureApp
                                 {
                                     treeView1.SelectedNode = treeView1.Nodes[0].Nodes[currentNodeIndex];
                                     //通过样品名称获取
-                                    m_MeasureAppForm.m_MeasureRetWindow.GetResultFileInfoBySampleName(treeView1.Nodes[0].Nodes[currentNodeIndex + 1].Text);
+                                    m_MeasureAppForm.m_MeasureResultWindow.GetResultFileInfoBySampleName(treeView1.Nodes[0].Nodes[currentNodeIndex + 1].Text);
                                     break;
                                 }
                             }

+ 1 - 1
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -266,7 +266,7 @@
     <Compile Include="0-OTSModel\Measure\2-OTSCleanliness\CFieldDataClean.cs" />
     <Compile Include="0-OTSModel\Measure\2-OTSCleanliness\SmplMeasureCleanliness.cs" />
     <Compile Include="0-OTSModel\Measure\3-MeasureFlow\CFieldPositionMgr.cs" />
-    <Compile Include="0-OTSModel\Measure\3-MeasureFlow\CMsrDisplayResults.cs" />
+    <Compile Include="0-OTSModel\Measure\3-MeasureFlow\CMsrResultItems.cs" />
     <Compile Include="0-OTSModel\Measure\3-MeasureFlow\CMeasure.cs" />
     <Compile Include="0-OTSModel\Measure\3-MeasureFlow\CSmplMeasure.cs" />
     <Compile Include="0-OTSModel\Measure\3-MeasureFlow\CSmplMsrResult.cs" />

+ 42 - 18
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -66,7 +66,7 @@ namespace OTSMeasureApp
 
 
         //  Control m_ControlWindow = null;
-        public OTSMeasureResultWindow m_MeasureRetWindow = null;
+        public OTSMeasureResultWindow m_MeasureResultWindow = null;
         public OTSMeasureStatusWindow m_MessureStatuWindow = null;
         public OTSSamplespaceWindow m_SamplepaceWindow = null;
         public OTSMeasureOutputNlog m_OTSMeasureOutputNlog = null;
@@ -123,8 +123,8 @@ namespace OTSMeasureApp
             m_SolutionWindows = new OTSSolutionWindow(this);
             m_SPropertyWindows = new OTSPropertyWindow(this);
 
-            m_MeasureRetWindow = new OTSMeasureResultWindow(this);
-            m_MeasureRetWindow.Text = m_MeasureRetWindowName;
+            m_MeasureResultWindow = new OTSMeasureResultWindow(this);
+            m_MeasureResultWindow.Text = m_MeasureRetWindowName;
             m_MessureStatuWindow = new OTSMeasureStatusWindow(this);
             m_MessureStatuWindow.Text = m_MeasureStauWindowName;
             m_SamplepaceWindow = new OTSSamplespaceWindow(this);
@@ -243,7 +243,7 @@ namespace OTSMeasureApp
            m_MessureStatuWindow.Show(dockPanel);
 
             //Show 测量结果窗口
-           m_MeasureRetWindow.Show(dockPanel);
+           m_MeasureResultWindow.Show(dockPanel);
 
            m_SolutionWindows.Show(dockPanel, DockState.DockLeft);
             //Show 测量过程中Log显示窗口
@@ -468,7 +468,7 @@ namespace OTSMeasureApp
             //隐藏XrayTable控件
             m_MessureStatuWindow.HideXRayTable();
             //新建时重新初始化结果窗体结果
-            m_MeasureRetWindow.SetInit();
+            m_MeasureResultWindow.SetInit();
         }
 
         // 新建样品时提示保存样品信息Messagebox 
@@ -634,13 +634,10 @@ namespace OTSMeasureApp
             {
                 m_MsrThreadWrapper.m_measure.mapSmplMsr.Remove(sDeleteWSampleName);
             }
-           
 
-            if (!m_ProjParam.DeleteWorkSample(sDeleteWSampleName))
-            {
-                log.Error("(OTSIncAMeasureAppForm.DeleteSample)  m_DataMgrFun.DeleteWorkSample(sDeleteWSampleName) Failed, sDeleteWSampleName = " + sDeleteWSampleName);
-              
-            }
+
+            m_ProjParam.DeleteWorkSample(sDeleteWSampleName);
+           
             // 设置 开始 ,停止 和检查参数 按钮状态
             m_RibbonFun.SetMeasureRibbonButnStatu();
             //设置 删除,复位,圆形,矩形 按钮状态
@@ -657,7 +654,7 @@ namespace OTSMeasureApp
                 m_SolutionWindows.treeView1.Nodes.Clear();
                 m_MessureStatuWindow.HideXRayTable();
 
-                m_MeasureRetWindow.SetInit();
+                m_MeasureResultWindow.SetInit();
                 return ;
             }
             else 
@@ -693,9 +690,6 @@ namespace OTSMeasureApp
         public void AddNewSampleMeasure(string sSampleHoleName = "")
         {
 
-            //样品的属性值
-           
-
             OTSSamplePropertyInfo SMInfo = m_ProjParam.AddNewSampleMeasure(sSampleHoleName);
             if (null == SMInfo)
             {
@@ -706,8 +700,10 @@ namespace OTSMeasureApp
             }
             m_SPropertyWindows.TSSaveAs.Enabled = true;
             m_SPropertyWindows.TSLoad.Enabled = true;
+            m_SPropertyWindows.TSEdit.Enabled = false;
+            m_SPropertyWindows.TSEdit.Visible = false;
             //给SampleWindow 发送样品信息
-           
+
             m_SamplepaceWindow.AddSampleArea(SMInfo.SMeasurePara);
 
              m_SamplepaceWindow.ReadSEMDataAndSetToCurrentSample();
@@ -723,7 +719,35 @@ namespace OTSMeasureApp
             SetRunType(MSR_RUN_TYPE.RUNMEASURE);
          
         }
+        public void DeleteCurrentSampleData()
+        {
+            OTSSamplePropertyInfo SMInfo = m_ProjParam.DeleteCurrentSampleData();
+            if (null == SMInfo)
+            {
+                // 设置 开始 ,停止 和检查参数 按钮状态
+                m_RibbonFun.SetMeasureRibbonButnStatu();
+                log.Error("(OTSIncAMeasureAppForm.AddNewSample)  m_DataMgrFun.AddNewSample(sSampleHoleName) = null ");
+                return;
+            }
+            m_SPropertyWindows.TSSaveAs.Enabled = true;
+            m_SPropertyWindows.TSLoad.Enabled = true;
+            //给SampleWindow 发送样品信息
+
+            //m_SamplepaceWindow.AddSampleArea(SMInfo.SMeasurePara);
+
+            m_SamplepaceWindow.ReadSEMDataAndSetToCurrentSample();
+            //给PropWindow 发送工作样品属性信息
+            m_SPropertyWindows.DisplaySampleMeasureInfo(SMInfo);
+            //给SoluWindow 发送样品显示信息
+            //m_SolutionWindows.AddSampleMeasure(SMInfo.TSampleParam);
+            // 设置 开始 ,停止 和检查参数 按钮状态
+            m_RibbonFun.SetMeasureRibbonButnStatu();
+            //设置 删除,复位,圆形,矩形 按钮状态
+            m_RibbonFun.SetSampleRibbonButnStatus();
+            //清空帧图信息
+            SetRunType(MSR_RUN_TYPE.RUNMEASURE);
 
+        }
       
 
         private void rbSelectDlg_Click(object sender, EventArgs e)
@@ -1067,7 +1091,7 @@ namespace OTSMeasureApp
             //显示样品台窗口 测量状态与测量结果窗口
             m_SamplepaceWindow.Show(dockPanel);
             m_MessureStatuWindow.Show(dockPanel);
-            m_MeasureRetWindow.Show(dockPanel);
+            m_MeasureResultWindow.Show(dockPanel);
 
             //此处将在父窗体选项卡上显示
             foreach (Form child in this.MdiChildren)
@@ -1086,7 +1110,7 @@ namespace OTSMeasureApp
             m_SPropertyWindows.DockPanel = null;
             m_SamplepaceWindow.DockPanel = null;
             m_MessureStatuWindow.DockPanel = null;
-            m_MeasureRetWindow.DockPanel = null;
+            m_MeasureResultWindow.DockPanel = null;
             CloseAllDocuments();
         }
         private void CloseAllDocuments()