浏览代码

add missing files

lizhongsys 3 年之前
父节点
当前提交
0a04c8d6f2

+ 531 - 0
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CMeasure.cs

@@ -0,0 +1,531 @@
+using System.Collections.Generic;
+using OTSDataType;
+using System;
+using System.Drawing;
+using static OTSDataType.otsdataconst;
+
+using OTSModelSharp.ImageProcess;
+using OTSModelSharp.ServiceInterface;
+
+namespace OTSModelSharp
+{
+
+
+    // enum and struct used for send message to App
+    public enum ENUM_MSG_TYPE
+    {
+        MTHREADSTATUS = 1001,
+        MSAMPLESTATUS = 1002,
+        MSAMPLERESULT = 1003
+    };
+
+
+    public enum MSAMPLE_RET
+    {
+        BSE_DATA = 0,
+        FIELD_DATA = 1,
+        START_MSR_FIELD = 2
+
+    };
+
+    public struct SMSR_COMPLETE_DATA
+    {
+        public OTS_MSR_THREAD_STATUS MsrStatus;
+        public string csMsrStartTime;
+        public int iMsrCompleteSampleCount;
+        public int iMsrCompleteFieldCount;
+        public int iParticleCount;
+        public TimeSpan MsrUsedTime;
+        public string csMsrEndTime;
+    };
+
+
+
+    public struct STMThreadStatus
+    {
+        public OTS_MSR_THREAD_STATUS iMsrStatu;        //OTS_MSR_THREAD_STATUS
+        public string csMsrStartTime;   //MSR_START_TIME
+        public string csMsrEndTime;     //MSR_END_TIME
+        public SMSR_COMPLETE_DATA SMsrCompleteData;
+    };
+    public struct STMSampleStatus
+    {
+        public OTS_MSR_SAMPLE_STATUS iMsrSampleStatu;    //OTS_MSR_SAMPLE_STATUS
+        public string cSampleName;
+        public string csSampleMsrStartTime;
+        public List<Point> BCompleteFieldList;
+    };
+
+
+    public struct STMSampleResultData
+    {
+        public MSAMPLE_RET iRetDataType;                 //ENUM_MEASURE_SAMPLE_RESULT
+
+        public struct RBSEDATA
+        {
+
+            public System.Drawing.Point pos;
+            public int iBSEDataHeight;
+            public int iBSEDataWidth;
+            public byte[] lpBSEData;
+        };
+
+        public struct SAMPLEFIELDDATA
+        {
+            public System.Drawing.Point FieldPos;
+            public int iMeasureFieldCount;
+            public int iCompleteFieldCount;
+            public int iSParticleCount;     // Field particle count
+            public TimeSpan TUsedTime;
+        };
+
+        public struct StartToMsrField
+        {
+            public System.Drawing.Point FieldPos;
+        };
+
+        public RBSEDATA BSEData;
+        public SAMPLEFIELDDATA SFieldData;
+        public StartToMsrField SMsrField;
+    };
+
+    public  struct ST_MSTMsg
+    {
+
+    
+      public ENUM_MSG_TYPE iMsgType;
+      public   STMThreadStatus STMThreadStu;
+      public   STMSampleStatus STMSampleStu;
+      public   STMSampleResultData STMSampleRetData;
+
+
+    };
+    
+    public class CMeasure
+    {
+      
+        private const string UNTITLED_FILE_NAME = "Untitled";
+        public delegate void   ProgressEventHandler(ST_MSTMsg msg);
+        public event ProgressEventHandler ProgressEvent;
+        COTSMsrPrjResultData m_pProjData;
+        List< COTSSample> m_listMeasurableSamples;
+        string m_strWorkingFolder;
+        CMsrThreadStatus m_ThreadStatus;
+       
+       
+       SemController m_SemController;// there is no correspondense clr,so use this instead temporarilly
+        protected static NLog.Logger loger = NLog.LogManager.GetCurrentClassLogger();
+
+
+        public CMeasure()
+        {         
+            m_strWorkingFolder = "";
+            m_ThreadStatus = new CMsrThreadStatus();
+          
+          
+            m_SemController = new SemController();
+           
+
+        }
+
+       
+            public COTSMsrPrjResultData GetProjResultData()
+        {
+            return m_pProjData;
+        }
+        public ISemController GetSEMController()
+        {
+
+            // get SEM, scanner and x-ray controller via hardware manager
+            return m_SemController;
+        }
+     
+
+        public CMsrThreadStatus GetMsrThreadStatus() { return m_ThreadStatus; }
+       public  void Init(COTSMsrPrjResultData a_pProjMgrFile)
+        {
+            m_pProjData = a_pProjMgrFile;
+            m_listMeasurableSamples = a_pProjMgrFile.GetSampleList() ;
+            return ;
+        }
+        void ThreadOver()
+        {
+            
+
+
+            DateTime timeEnd = m_ThreadStatus.GetEndTime();
+
+             ST_MSTMsg MsrMsg = new ST_MSTMsg();
+            MsrMsg.iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
+         
+           MsrMsg.STMThreadStu.iMsrStatu = m_ThreadStatus.GetStatus();
+               
+
+            MsrMsg.STMThreadStu.csMsrEndTime = timeEnd.ToShortDateString();
+          
+            ProgressEvent(MsrMsg);
+            //disconnect the semcontroller when we exit this task.
+            m_SemController.DisConnect();
+        }
+        void SetWorkingFolderStr()
+        {
+            // get project file pathname
+            string  strSettingFilePathName = m_pProjData.GetPathName();
+            strSettingFilePathName.Trim();
+
+            if (strSettingFilePathName == "")
+            {
+                loger .Error("SetWorkingFolderStr: project file pathname is an empty string");
+                return ;
+            }
+            else if (strSettingFilePathName==UNTITLED_FILE_NAME)
+            {
+                loger .Error ("SetWorkingFolderStr: project file pathname is an invalid string");
+                return ;
+            }
+
+            // working folder string
+             m_strWorkingFolder = FileHelper.GetFolderName(strSettingFilePathName);
+
+
+            return ;
+        }
+       public void SendMessageToMeasureApp(ST_MSTMsg msg)
+        {
+            ProgressEvent(msg);
+        }
+        public bool IsMeasureStopped()
+        {
+            return m_ThreadStatus.GetStatus() == OTS_MSR_THREAD_STATUS.STOPPED;
+        }
+
+        public bool  IsMeasureRunning() { return m_ThreadStatus.GetStatus() == OTS_MSR_THREAD_STATUS.INPROCESS; }
+        public bool  IsMeasureFailed() { return m_ThreadStatus.GetStatus() == OTS_MSR_THREAD_STATUS.FAILED; }
+        public bool  IsMeasureCompleted() { return m_ThreadStatus.GetStatus() == OTS_MSR_THREAD_STATUS.COMPLETED; }
+        public   void DoMeasure()
+        {
+            // start measurement, creat thread measure status class, let the main thread know that measurement started
+
+
+             SortedDictionary<string , CSmplMeasure> mapSmplMsr=new SortedDictionary<string, CSmplMeasure>();//use this map to hold all the smplMeasure object 
+
+           
+            m_ThreadStatus.SetStartTime(System.DateTime.Now);
+            DateTime timeStart = m_ThreadStatus.GetStartTime(); 
+            
+            ST_MSTMsg MsgMsrStart=new ST_MSTMsg();
+            MsgMsrStart.iMsgType  = ENUM_MSG_TYPE.MTHREADSTATUS;
+            MsgMsrStart.STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.INPROCESS;
+            MsgMsrStart.STMThreadStu.csMsrStartTime = timeStart.ToShortDateString();
+
+            ProgressEvent (MsgMsrStart);
+            loger.Info("Measurement started!");
+            // connect hardware
+            loger.Info("Connect SEM!");
+            if (!m_SemController.Connect())
+            {
+                loger .Error("DoMeasure: failed to connect hardware.");
+                m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.FAILED);
+            
+                m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+                ThreadOver();
+                return;
+            }
+
+
+            // set working directory which is the same directory of the setting file
+            SetWorkingFolderStr();
+     
+        
+
+            List <string >  listMeasuredSamples = m_ThreadStatus.GetCompletedSamples();
+
+            // got through measure list
+            foreach (var pSample in m_listMeasurableSamples)
+            {// check and break if stop button is clicked 
+                if (m_ThreadStatus.GetStatus()== OTS_MSR_THREAD_STATUS.STOPPED )
+                {
+                    // stop button clicked
+                    loger .Info("DoMeasure: stop button is clicked.");                   
+                    // record end time
+                    m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+                    ThreadOver();
+                    return;
+                }
+
+                if (!pSample.GetSwitch())
+                {
+                    continue;
+                }
+             
+                CSmplMeasure pSmplMeasure;
+                if (!mapSmplMsr.ContainsKey(pSample.GetName()))
+                {// create a sample measure object for the sample
+                    switch (m_pProjData.m_nPackId)
+                    {
+                        case OTS_SysType_ID.IncA:
+                            pSmplMeasure = new CSmplMeasureInclution(m_strWorkingFolder, pSample);
+                            break;
+                        case OTS_SysType_ID.CleanlinessA:
+                            pSmplMeasure = new CSmplMeasureCleanliness(m_strWorkingFolder, pSample);
+                            break;
+                        default:
+                            pSmplMeasure = new CSmplMeasureInclution(m_strWorkingFolder, pSample);
+                            break;
+
+                    }
+                       
+                  
+                    
+                    // set measure thread
+                    pSmplMeasure.SetMsrThread(this);
+
+                    mapSmplMsr[pSample.GetName()] = pSmplMeasure;
+                }
+                else
+                {
+                    pSmplMeasure = mapSmplMsr[pSample.GetName()];
+                    pSample.GetMsrStatus().SetStatus(OTS_MSR_SAMPLE_STATUS.INPROCESS);
+                    m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.INPROCESS);
+                }
+
+
+
+               
+               
+                pSmplMeasure.DoMeasureForOneSample();
+
+
+                // check if measurement is successful
+                if (pSample.GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.STOPPED)
+                {// record end time
+                    m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.STOPPED);
+                    m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+
+                    // update thread measure status class, let the main thread know that this sample measurement stopped
+                    ST_MSTMsg MsgSmpStop = new ST_MSTMsg(); 
+                    MsgSmpStop.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
+                    MsgSmpStop.STMThreadStu.iMsrStatu= OTS_MSR_THREAD_STATUS.STOPPED;
+                    MsgSmpStop.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.STOPPED;
+                    MsgSmpStop.STMThreadStu.csMsrEndTime = DateTime .Now .ToShortDateString();
+                    MsgSmpStop.STMThreadStu.iMsrStatu= OTS_MSR_THREAD_STATUS.STOPPED;
+                    ProgressEvent(MsgSmpStop);
+
+
+                    ThreadOver();
+                    return;
+                }
+			    else if (pSample.GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.FAILED)
+			    {
+                    // measurement failed
+                    m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.FAILED);
+                // record end time
+                    m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+
+                // update thread measure status class, let the main thread know that this sample measurement failed
+                ST_MSTMsg MsgSmpFailed=new ST_MSTMsg(); 
+              
+                MsgSmpFailed.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
+				MsgSmpFailed.STMSampleStu.iMsrSampleStatu =  OTS_MSR_SAMPLE_STATUS.FAILED;                 
+
+                   
+                 ProgressEvent(MsgSmpFailed);
+                ThreadOver();
+				  return;
+			    }
+
+               // record end time
+               m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+
+              // update thread measure status class, let the main thread know that this sample measurement successes
+               ST_MSTMsg MsgSmpSuccess=new ST_MSTMsg();           
+              MsgSmpSuccess.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
+	          MsgSmpSuccess.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.SUCCESSED;         
+              ProgressEvent(MsgSmpSuccess);
+                		
+
+            // continue to the next sample
+              listMeasuredSamples.Add (pSample.GetName());
+		}
+
+            // measurement completed
+            m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.COMPLETED);
+            // record end time
+            m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+
+            ThreadOver();
+	}
+
+        // hole preview
+       public  void DoHolePreview(int a_nHoleID, CDomain a_pMeasureArea)
+        {
+            // start measurement, creat thread measure status class, let the main thread know that measurement started
+            // set measure status to in-process
+            //record time
+            m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.START);
+            DateTime timeStart = m_ThreadStatus.GetStartTime();
+
+  
+
+            ST_MSTMsg MsgMsrStart = new ST_MSTMsg();
+          
+            MsgMsrStart.iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
+            MsgMsrStart.STMThreadStu.iMsrStatu =OTS_MSR_THREAD_STATUS.INPROCESS;
+         
+            SendMessageToMeasureApp(MsgMsrStart);
+            // connect hardware
+            if (!m_SemController.Connect())
+            {
+                // failed to connect hardware
+                
+                SetMsrLoopStatus(otsdataconst.OTS_MSR_THREAD_STATUS.FAILED);
+                m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+                ThreadOver();
+            }
+
+           
+	
+            
+            COTSSample pSampleHole = CreateHoleSample(a_pMeasureArea);
+
+
+            // create a sample measure object for the sample
+            CSmplMeasure pSmplMeasure = new CSmplMeasureCleanliness(m_strWorkingFolder,pSampleHole);
+
+          
+            // set measure thread
+            pSmplMeasure.SetMsrThread(this);
+
+            // update thread measure status class, let the main thread know that this sample measurement starts
+            // set working folder string
+            pSmplMeasure.SetSample(pSampleHole);
+            pSmplMeasure.SetWorkingFolder(m_strWorkingFolder);
+
+            // do measure
+            pSmplMeasure.DoHolePreview(a_nHoleID);
+
+            // check if measurement is successful
+            if (pSampleHole.GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.STOPPED)
+            {
+                // record end time
+                m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+                // measurement stopped
+                SetMsrLoopStatus(otsdataconst.OTS_MSR_THREAD_STATUS.STOPPED);
+
+                // update thread measure status class, let the main thread know that this sample measurement stopped
+                ST_MSTMsg MsgSmpStop = new ST_MSTMsg();
+           
+                MsgSmpStop.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
+                MsgSmpStop.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.STOPPED;
+          
+                SendMessageToMeasureApp(MsgSmpStop);
+
+                ThreadOver();
+                return;
+            }
+            else if (pSampleHole.GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.FAILED)
+            {
+                // measurement failed
+                SetMsrLoopStatus(otsdataconst.OTS_MSR_THREAD_STATUS.FAILED);
+                // record end time
+                m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+
+                // update thread measure status class, let the main thread know that this sample measurement failed
+                ST_MSTMsg MsgSmpFailed = new ST_MSTMsg();
+          
+                MsgSmpFailed.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
+                MsgSmpFailed.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.FAILED;
+           
+                SendMessageToMeasureApp(MsgSmpFailed);
+                ThreadOver();
+                return;
+            }
+
+            // record end time
+            m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+
+            // update thread measure status class, let the main thread know that this sample measurement successes
+            ST_MSTMsg MsgSmpSuccess = new ST_MSTMsg();
+         
+            MsgSmpSuccess.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
+            MsgSmpSuccess.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.SUCCESSED;
+         
+
+
+            SendMessageToMeasureApp(MsgSmpSuccess);
+
+            // measurement completed
+            SetMsrLoopStatus(otsdataconst.OTS_MSR_THREAD_STATUS.COMPLETED);
+            // record end time
+            m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
+
+            ThreadOver();
+        }
+
+      public  COTSSample CreateHoleSample(CDomain a_pMsrArea)
+        {
+            
+
+            COTSSample pHoleSample = new COTSSample();
+
+            pHoleSample.SetMsrArea(a_pMsrArea);
+
+           
+
+            // get min magnification
+            CSEMStageData pSEMStageData = m_pProjData.GetSEMStageData();
+            double dMinMag = pSEMStageData.GetMinMag();
+            // get scan field size 100
+            int nScanFieldSize100 = pSEMStageData.GetScanFieldSize100();
+            // get working distance
+            double dWorkingDistance = 0.0;
+            if (!GetSEMWorkingDistanceFromHW(ref dWorkingDistance))
+            {
+
+                return null;
+            }
+
+            CSEMDataMsr poSEMDataMsr = new CSEMDataMsr();
+            poSEMDataMsr.SetScanFieldSize100(nScanFieldSize100);
+            poSEMDataMsr.SetWorkingDistance(dWorkingDistance);
+            poSEMDataMsr.SetMagnification(dMinMag);
+
+            pHoleSample.SetSEMDataMsr(poSEMDataMsr);
+
+            // Set image scan param
+            COTSImgScanPrm poImageScanParam = new COTSImgScanPrm();
+            poImageScanParam.SetStopMode(OTS_MEASURE_STOP_MODE.CoverMode);
+            poImageScanParam.SetStartImageMode(OTS_GET_IMAGE_MODE.FROM_CENTER);
+            poImageScanParam.SetScanImageSpeed(OTS_IMAGE_SCANSPEED_OPTIONS.low);
+            //poImageScanParam.SetImagePixelSize(OTS_FIVE_TIES_OPTIONS.TIE1);
+
+            CSampleParam poMsrParams = pHoleSample.GetMsrParams();
+            poImageScanParam.SetImageResulotion(m_listMeasurableSamples[0].GetMsrParams().GetImageScanParam().GetImageResulotion());//由于各样品分辨率应该一致,故此处没有读取选取的特定样品孔样品
+            poMsrParams.SetImageScanParam(poImageScanParam);
+            pHoleSample.SetMsrParams(poMsrParams);
+
+            return pHoleSample;
+        }
+
+      public  bool GetSEMWorkingDistanceFromHW(ref double a_dWorkingDistance)
+        {
+
+            m_SemController.GetWorkingDistance(ref a_dWorkingDistance);
+
+
+            return true;
+        }
+    
+
+        // measure status
+       public void SetMsrLoopStatus(otsdataconst.OTS_MSR_THREAD_STATUS a_nMsrLoopStatus)
+        {
+            //if (a_nMsrLoopStatus >= otsdataconst.OTS_MSR_THREAD_STATUS.MIN && a_nMsrLoopStatus <= otsdataconst.OTS_MSR_THREAD_STATUS.MAX)
+            //{
+                m_ThreadStatus.SetStatus( a_nMsrLoopStatus);
+            //}
+        }
+
+    
+    }
+}

+ 126 - 0
OTSIncAMeasureApp/0-OTSModel/Measure/ParamData/CSpecialGrayRangeParam.cs

@@ -0,0 +1,126 @@
+using OTSDataType;
+using OTSModelSharp;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace OTSMeasureApp._0_OTSModel.Measure.ParamData
+{
+  public  class CSpecialGrayRange:ISlo
+    {
+        public  CIntRange range=new CIntRange();
+        public bool ifCollectXray;
+     
+        public override void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
+        {
+            xInt xStart = new xInt();
+            xInt xEnd = new xInt();
+            xBool xIfXray = new xBool();
+            Slo slo = new Slo();
+            slo.Register("start", xStart);
+            slo.Register("end", xEnd);
+            slo.Register("collectXray", xIfXray);
+            if (isStoring)
+            {
+                xStart.AssignValue(range.GetStart());
+                xEnd.AssignValue(range.GetEnd());
+                xIfXray.AssignValue(ifCollectXray);
+
+                slo.Serialize(true, classDoc, rootNode);
+            }
+            else
+            {
+                slo.Serialize(false, classDoc, rootNode);
+                range.SetStart(xStart.value());
+                range.SetEnd(xEnd.value());
+                ifCollectXray = xIfXray.value();
+
+            }
+        }
+    }
+   public class CSpecialGrayRangeParam: ISlo
+    {
+        const string STRSPECIALGRAYCONFIGFILE = "SpecialGrayConfig.xml";
+        private List<CSpecialGrayRange> Ranges=new List<CSpecialGrayRange>();
+        private bool isToRun;
+       public static string GetParamFileFullName()
+        {
+            String path = ".\\" + DataPublic.STR_COFIGPATH + "\\" + DataPublic.STR_SYSTEM_DATA + "\\" + STRSPECIALGRAYCONFIGFILE;
+            return path;
+        }
+        public bool IsToRun { get => isToRun; set => isToRun = value; }
+
+        public List<CSpecialGrayRange> GetIntRanges()
+        {
+            return Ranges;
+        }
+
+        public void SetIntRanges(List<CSpecialGrayRange> value)
+        {
+            Ranges = value;
+        }
+
+        public override void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
+        {
+          
+            Collection<CSpecialGrayRange> xRangelist = new Collection<CSpecialGrayRange>();
+            xBool xtoRun = new xBool();
+           
+
+            Slo slo = new Slo();
+
+
+            slo.Register("ToRun", xtoRun);
+            slo.Register("GrayRangeList", xRangelist);
+            if (isStoring)
+            {
+                xtoRun.AssignValue(isToRun);
+                for (int i = 0; i < Ranges.Count; i++)
+                {
+                    xRangelist.addItem(Ranges[i]);
+                }
+               
+                slo.Serialize(true, classDoc, rootNode);
+            }
+            else
+            {
+                slo.Serialize(false, classDoc, rootNode);
+
+                isToRun = xtoRun.value();
+                Ranges.Clear();
+                for (int i = 0; i < xRangelist.size(); i++)
+                {
+                    Ranges.Add(xRangelist.getItem(i));
+                }
+            }
+        }
+        public bool LoadParam()
+        {
+          
+
+
+            String path = ".\\" + DataPublic.STR_COFIGPATH + "\\" + DataPublic.STR_SYSTEM_DATA + "\\"+ STRSPECIALGRAYCONFIGFILE;
+            // 5. check if the stage file exist 
+            if (File.Exists(path))
+            {// the stage file exist
+
+       
+
+                XmlDocument doc = new XmlDocument();
+                //载入xml文件
+                doc.Load(path);
+                XmlNode root = doc.SelectSingleNode("XMLData");
+                Serialize(false, doc, root);
+                return true;
+            }
+
+
+
+            return false;
+        }
+    }
+}

+ 220 - 0
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/frmSpecialGrayParticle.Designer.cs

@@ -0,0 +1,220 @@
+namespace OTSMeasureApp
+{
+    partial class frmSpecialGrayParticle
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.tbGrayStart = new System.Windows.Forms.TrackBar();
+            this.label1 = new System.Windows.Forms.Label();
+            this.nuDownGrayStart = new System.Windows.Forms.NumericUpDown();
+            this.nuDownGrayEnd = new System.Windows.Forms.NumericUpDown();
+            this.label2 = new System.Windows.Forms.Label();
+            this.btnYes = new System.Windows.Forms.Button();
+            this.btnCancel = new System.Windows.Forms.Button();
+            this.tbGrayEnd = new System.Windows.Forms.TrackBar();
+            this.txtGrayStart = new System.Windows.Forms.TextBox();
+            this.txtGrayEnd = new System.Windows.Forms.TextBox();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.pbBSEImage = new System.Windows.Forms.PictureBox();
+            ((System.ComponentModel.ISupportInitialize)(this.tbGrayStart)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nuDownGrayStart)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nuDownGrayEnd)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbGrayEnd)).BeginInit();
+            this.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pbBSEImage)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // tbGrayStart
+            // 
+            this.tbGrayStart.Location = new System.Drawing.Point(263, 52);
+            this.tbGrayStart.Maximum = 255;
+            this.tbGrayStart.Name = "tbGrayStart";
+            this.tbGrayStart.Size = new System.Drawing.Size(97, 45);
+            this.tbGrayStart.TabIndex = 5;
+            this.tbGrayStart.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbGrayStart.Scroll += new System.EventHandler(this.tbGrayStart_Scroll);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(11, 33);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(77, 12);
+            this.label1.TabIndex = 6;
+            this.label1.Text = "选择灰度范围";
+            // 
+            // nuDownGrayStart
+            // 
+            this.nuDownGrayStart.Location = new System.Drawing.Point(110, 31);
+            this.nuDownGrayStart.Maximum = new decimal(new int[] {
+            255,
+            0,
+            0,
+            0});
+            this.nuDownGrayStart.Name = "nuDownGrayStart";
+            this.nuDownGrayStart.Size = new System.Drawing.Size(68, 21);
+            this.nuDownGrayStart.TabIndex = 8;
+            this.nuDownGrayStart.ValueChanged += new System.EventHandler(this.nuDwonGrayStart_ValueChanged);
+            // 
+            // nuDownGrayEnd
+            // 
+            this.nuDownGrayEnd.Location = new System.Drawing.Point(193, 31);
+            this.nuDownGrayEnd.Maximum = new decimal(new int[] {
+            255,
+            0,
+            0,
+            0});
+            this.nuDownGrayEnd.Name = "nuDownGrayEnd";
+            this.nuDownGrayEnd.Size = new System.Drawing.Size(68, 21);
+            this.nuDownGrayEnd.TabIndex = 7;
+            this.nuDownGrayEnd.ValueChanged += new System.EventHandler(this.nuDownGrayEnd_ValueChanged);
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(180, 35);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(11, 12);
+            this.label2.TabIndex = 9;
+            this.label2.Text = "-";
+            // 
+            // btnYes
+            // 
+            this.btnYes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnYes.Location = new System.Drawing.Point(468, 25);
+            this.btnYes.Name = "btnYes";
+            this.btnYes.Size = new System.Drawing.Size(75, 36);
+            this.btnYes.TabIndex = 10;
+            this.btnYes.Text = "显示效果";
+            this.btnYes.UseVisualStyleBackColor = true;
+            this.btnYes.Click += new System.EventHandler(this.btnYes_Click);
+            // 
+            // btnCancel
+            // 
+            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnCancel.Location = new System.Drawing.Point(927, 16);
+            this.btnCancel.Name = "btnCancel";
+            this.btnCancel.Size = new System.Drawing.Size(75, 51);
+            this.btnCancel.TabIndex = 10;
+            this.btnCancel.Text = "退出";
+            this.btnCancel.UseVisualStyleBackColor = true;
+            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+            // 
+            // tbGrayEnd
+            // 
+            this.tbGrayEnd.Location = new System.Drawing.Point(355, 52);
+            this.tbGrayEnd.Maximum = 255;
+            this.tbGrayEnd.Name = "tbGrayEnd";
+            this.tbGrayEnd.Size = new System.Drawing.Size(97, 45);
+            this.tbGrayEnd.TabIndex = 11;
+            this.tbGrayEnd.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbGrayEnd.Scroll += new System.EventHandler(this.tbGrayEnd_Scroll);
+            // 
+            // txtGrayStart
+            // 
+            this.txtGrayStart.Location = new System.Drawing.Point(272, 31);
+            this.txtGrayStart.Name = "txtGrayStart";
+            this.txtGrayStart.ReadOnly = true;
+            this.txtGrayStart.Size = new System.Drawing.Size(80, 21);
+            this.txtGrayStart.TabIndex = 12;
+            // 
+            // txtGrayEnd
+            // 
+            this.txtGrayEnd.Location = new System.Drawing.Point(364, 31);
+            this.txtGrayEnd.Name = "txtGrayEnd";
+            this.txtGrayEnd.ReadOnly = true;
+            this.txtGrayEnd.Size = new System.Drawing.Size(80, 21);
+            this.txtGrayEnd.TabIndex = 13;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.txtGrayEnd);
+            this.groupBox1.Controls.Add(this.txtGrayStart);
+            this.groupBox1.Controls.Add(this.tbGrayEnd);
+            this.groupBox1.Controls.Add(this.btnCancel);
+            this.groupBox1.Controls.Add(this.btnYes);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.nuDownGrayEnd);
+            this.groupBox1.Controls.Add(this.nuDownGrayStart);
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.tbGrayStart);
+            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.groupBox1.Location = new System.Drawing.Point(0, 624);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(1008, 73);
+            this.groupBox1.TabIndex = 5;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "设置参数";
+            // 
+            // pbBSEImage
+            // 
+            this.pbBSEImage.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.pbBSEImage.Location = new System.Drawing.Point(0, 0);
+            this.pbBSEImage.Name = "pbBSEImage";
+            this.pbBSEImage.Size = new System.Drawing.Size(1008, 624);
+            this.pbBSEImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pbBSEImage.TabIndex = 6;
+            this.pbBSEImage.TabStop = false;
+            // 
+            // frmSpecialGrayParticle
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1008, 697);
+            this.Controls.Add(this.pbBSEImage);
+            this.Controls.Add(this.groupBox1);
+            this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Name = "frmSpecialGrayParticle";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "可视化设置灰度范围";
+            this.Load += new System.EventHandler(this.frmSpecialGrayParticle_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.tbGrayStart)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nuDownGrayStart)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.nuDownGrayEnd)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbGrayEnd)).EndInit();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pbBSEImage)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+        private System.Windows.Forms.TrackBar tbGrayStart;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.NumericUpDown nuDownGrayStart;
+        private System.Windows.Forms.NumericUpDown nuDownGrayEnd;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Button btnYes;
+        private System.Windows.Forms.Button btnCancel;
+        private System.Windows.Forms.TrackBar tbGrayEnd;
+        private System.Windows.Forms.TextBox txtGrayStart;
+        private System.Windows.Forms.TextBox txtGrayEnd;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.PictureBox pbBSEImage;
+    }
+}

+ 351 - 0
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/frmSpecialGrayParticle.cs

@@ -0,0 +1,351 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+using System.Windows.Forms;
+using OTS.WinFormsUI.Docking;
+using OTSDataType;
+using OTSSysMgrTools;
+using static OTSMeasureApp.OTSMeasureStatusWindow;
+
+namespace OTSMeasureApp
+{
+    public partial class frmSpecialGrayParticle : DockContent
+    {
+        //国际化
+        OTSSysMgrTools.Language lan;
+        Hashtable table;
+
+        //测量主窗体
+        public OTSIncAMeasureAppForm m_MeasureAppForm;
+        public OTSMeasureStatusWindow MeasureStatuWindow;
+        OTSImageData m_ImageData = null;
+        NLog.Logger log ;
+        public frmSpecialGrayParticle(OTSIncAMeasureAppForm m_MeasureForm, OTSMeasureStatusWindow MeasureStatuForm)
+        {
+            log = NLog.LogManager.GetCurrentClassLogger();
+            InitializeComponent();
+            m_MeasureAppForm = m_MeasureForm;
+            MeasureStatuWindow = MeasureStatuForm;
+            //国际化
+            lan = new OTSSysMgrTools.Language(this);
+            table = lan.GetNameTable(this.Name);
+        }
+        private Bitmap bseImg;
+        /// <summary>
+        /// 获取当前的BSE原图
+        /// </summary>
+        public Bitmap BseImg { get => bseImg; set => bseImg = value; }
+
+        private byte[] bBseData;
+        private byte[] originalBseData;
+        /// <summary>
+        /// 获取当前的BSE原图数据
+        /// </summary>
+        public byte[] GetBBseData()
+        {
+            return bBseData;
+        }
+
+        /// <summary>
+        /// 获取当前的BSE原图数据
+        /// </summary>
+        public void SetBBseData(byte[] value)
+        {
+            bBseData = value;
+            originalBseData = value;
+        }
+        private void RestoreOriginalBseData()
+        {
+            bBseData = originalBseData;
+        }
+
+        //去背景灰度最小值
+        private int bseGrayMinValue=-1;
+        /// <summary>
+        /// 去背景灰度最小值
+        /// </summary>
+        public int BseGrayMinValue { get => bseGrayMinValue; set => bseGrayMinValue = value; }
+        //去背景灰度最大值
+        private int bseGrayMaxValue = -1;
+        /// <summary>
+        /// 去背景灰度最大值
+        /// </summary>
+        public int BseGrayMaxValue { get => bseGrayMaxValue; set => bseGrayMaxValue = value; }
+
+        private void frmSpecialGrayParticle_Load(object sender, EventArgs e)
+        {
+            if (BseImg != null)
+            {
+                pbBSEImage.Image = BseImg;
+            }
+            if (BseGrayMinValue >-1)
+            {
+                nuDownGrayStart.Value = BseGrayMinValue;
+                tbGrayStart.Value = BseGrayMinValue;
+                txtGrayStart.Text = BseGrayMinValue.ToString();
+            }
+            if (BseGrayMaxValue >-1)
+            {
+                nuDownGrayEnd.Value = BseGrayMaxValue;
+                tbGrayEnd.Value = BseGrayMaxValue;
+                txtGrayEnd.Text = BseGrayMaxValue.ToString();
+            }
+            if (m_ImageData == null)
+            {
+                m_ImageData = new OTSImageData(MeasureStatuWindow, m_MeasureAppForm);
+            }
+        }
+        #region BSE图去背景
+        /// <summary>
+        /// BSE图去背景
+        /// </summary>
+        /// <param name="bInput">BSE原图</param>
+        /// <param name="grayStart">开始灰度值</param>
+        /// <param name="grayEnd">结束灰度值</param>
+        /// <returns></returns>
+        protected Bitmap RemoveBseGray(Bitmap bInput,int grayStart, int grayEnd)
+        {
+            int imgWidth = bInput.Width;
+            int imgHeight = bInput.Height;
+            //转换颜色
+            List<ColorMap> colorMapTemp = new List<ColorMap>();
+      
+            for (int i = 0; i <= grayStart; i++)
+            {
+                ColorMap colorMap = new ColorMap();
+                string colorName = "#" + Color.FromArgb(i, i, i).Name.ToString();
+                colorMap.OldColor = ColorTranslator.FromHtml(colorName);
+                colorMap.NewColor = Color.White;
+                colorMapTemp.Add(colorMap);
+            }
+            for (int i = grayEnd; i <= 255; i++)
+            {
+                ColorMap colorMap = new ColorMap();
+                string colorName = "#" + Color.FromArgb(i, i, i).Name.ToString();
+                colorMap.OldColor = ColorTranslator.FromHtml(colorName);
+                colorMap.NewColor = Color.White;
+                colorMapTemp.Add(colorMap);
+            }
+            if (colorMapTemp.Count > 0)
+            {
+                Bitmap cutbitmap = new Bitmap(bInput.Width, bInput.Height);
+                //创建Graphics对象
+                Graphics g = Graphics.FromImage(cutbitmap);
+                //生成的图像大小
+                int width = bInput.Width;
+                int height = bInput.Height;
+                //编辑被着急图像所要显示的位置
+                Rectangle DrawRect = new Rectangle(0, 0, imgWidth, imgHeight);
+                //编辑输出画布中着色的位置
+                Rectangle ShowRect = new Rectangle(0, 0, imgWidth, imgHeight);
+                ImageAttributes attr = new ImageAttributes();
+                attr.SetRemapTable(colorMapTemp.ToArray());
+                //从输入图像中截图至临时图像中
+                g.DrawImage(bInput, ShowRect, 0, 0, DrawRect.Width, DrawRect.Height, GraphicsUnit.Pixel, attr);
+                g.Dispose();
+
+                MemoryStream ms = new MemoryStream();
+                cutbitmap.Save(ms, ImageFormat.Png);
+                cutbitmap.Dispose();
+                //返回图像对象
+                return (Bitmap)Image.FromStream(ms);
+            }
+            else
+            {
+                return null;
+            }
+
+
+        }
+        #endregion
+        protected void ShowRemoveBGImage(COTSImageProcParam ImgProcPrm)
+        {
+            try
+            {
+                //获取电镜中图像大小
+                int m_iWidth=0, m_iHeight=0;
+                string str = m_MeasureAppForm.m_ProjParam.GetBSEImageResolution();
+                string[] sArray = str.Split('X');
+                if (sArray[0] != "" && sArray[1] != "")
+                {
+                    m_iWidth = Convert.ToInt32(sArray[0]);
+                    m_iHeight = Convert.ToInt32(sArray[1]);
+                }
+             
+                 byte[] cBseData=new byte[m_iHeight*m_iWidth];
+       
+              var  bfResult = m_ImageData.GetRemoveBGImage(ImgProcPrm, m_iWidth, m_iHeight, bBseData, ref cBseData);
+
+                bBseData = cBseData;
+                //取图不成功就返回
+                if (!bfResult) { return; }
+                Bitmap bitmap = Imagepro.ToGrayBitmap(cBseData, m_iWidth, m_iHeight);
+                ShowBSEImage(bitmap);
+               
+            }
+            catch (Exception ex)
+            {
+                log.Error("(LZMeasureStatusWindow.ShowRemoveBGImage_Click)  " + ex.ToString());
+            }
+        }
+
+        #region 显示去背景BSE图
+        public void ShowBSEImage(Bitmap BseImg)
+        {
+            if (BseImg != null)
+            {
+                pbBSEImage.Image = BseImg;
+                pbBSEImage.Refresh();
+            }
+        }
+        #endregion
+
+        private void nuDwonGrayStart_ValueChanged(object sender, EventArgs e)
+        {
+            RemoveBseGrayValueChanged();
+        }
+
+        private void nuDownGrayEnd_ValueChanged(object sender, EventArgs e)
+        {
+            RemoveBseGrayValueChanged();
+        }
+
+        protected void RemoveBseGrayValueChanged()
+        {
+            int grayStart = (int)nuDownGrayStart.Value;
+            int grayEnd = (int)nuDownGrayEnd.Value;
+            if (grayStart <= grayEnd)
+            {
+                Bitmap reBseImg = RemoveBseGray(BseImg, grayStart, grayEnd);
+                if (reBseImg != null)
+                {
+                    ShowBSEImage(reBseImg);
+                }
+            }
+            else
+            {
+                nuDownGrayEnd.Value = nuDownGrayStart.Value;
+            }
+            txtGrayStart.Text = nuDownGrayStart.Value.ToString();
+            txtGrayEnd.Text = nuDownGrayEnd.Value.ToString();
+            tbGrayStart.Value = (int)nuDownGrayStart.Value;
+            tbGrayEnd.Value = (int)nuDownGrayEnd.Value;
+        }
+
+        private void tbGrayStart_Scroll(object sender, EventArgs e)
+        {
+            int grayStart = (int)tbGrayStart.Value;
+            int grayEnd = (int)tbGrayEnd.Value;
+            if (grayStart <= grayEnd)
+            {
+                Bitmap reBseImg = RemoveBseGray(BseImg, grayStart, grayEnd);
+                if (reBseImg != null)
+                {
+                    ShowBSEImage(reBseImg);
+                }
+            }
+            else
+            {
+                tbGrayStart.Value = tbGrayStart.Value;
+                tbGrayEnd.Value = tbGrayStart.Value;
+            }
+
+            txtGrayStart.Text = tbGrayStart.Value.ToString();
+            txtGrayEnd.Text = tbGrayEnd.Value.ToString();
+            nuDownGrayStart.Value = (int)tbGrayStart.Value;
+            nuDownGrayEnd.Value = (int)tbGrayEnd.Value;
+        }
+
+        private void tbGrayEnd_Scroll(object sender, EventArgs e)
+        {
+            int grayStart = (int)tbGrayStart.Value;
+            int grayEnd = (int)tbGrayEnd.Value;
+            if (grayStart <= grayEnd)
+            {
+                txtGrayStart.Text = grayStart.ToString();
+                txtGrayEnd.Text = grayEnd.ToString();
+                Bitmap reBseImg = RemoveBseGray(BseImg, grayStart, grayEnd);
+              
+                if (reBseImg != null)
+                {
+                    ShowBSEImage(reBseImg);
+                }
+            }
+            else
+            {
+                tbGrayEnd.Value = tbGrayStart.Value;
+                txtGrayEnd.Text = grayStart.ToString();
+            }
+            nuDownGrayStart.Value = tbGrayStart.Value;
+            nuDownGrayEnd.Value = tbGrayEnd.Value;
+        }
+
+        private void btnYes_Click(object sender, EventArgs e)
+        {
+            RestoreOriginalBseData();
+            BseGrayMinValue = Convert.ToInt32(txtGrayStart.Text);
+            BseGrayMaxValue = Convert.ToInt32(txtGrayEnd.Text);
+      
+            COTSImageProcParam cOTSImgProc = new COTSImageProcParam();
+
+            //remove the low end gray pixel
+            CIntRange cIntRange = new CIntRange();
+            cIntRange.SetStart(0);
+            cIntRange.SetEnd(BseGrayMinValue);
+            cOTSImgProc.SetBGGray(cIntRange);        
+            ShowRemoveBGImage(cOTSImgProc);
+
+            //remove the high end gray pixel
+            cIntRange.SetStart(BseGrayMaxValue);
+            cIntRange.SetEnd(255);
+            cOTSImgProc.SetBGGray(cIntRange);
+            ShowRemoveBGImage(cOTSImgProc);
+        }
+
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+        }
+
+        #region BSE图去背景
+        protected Bitmap ShowRemoveBGImage(byte[] bBseData,int grayStart,int grayEnd)
+        {
+            try
+            {
+                int m_iWidth = 0;
+                int m_iHeight = 0;
+                //获取电镜中图像大小
+                string str = m_MeasureAppForm.m_ProjParam.GetBSEImageResolution();
+                string[] sArray = str.Split('X');
+                if (sArray[0] != "" && sArray[1] != "")
+                {
+                    m_iWidth = Convert.ToInt32(sArray[0]);
+                    m_iHeight = Convert.ToInt32(sArray[1]);
+                }
+                //去背景图
+                byte[] cBseData = null;
+                //获取图像数据
+                var imagefun = new OTSBSEImageFun();
+                bool bfResult = imagefun.GetBSEImage(bBseData, m_iHeight, m_iWidth, grayStart, grayEnd, ref cBseData);
+                if (bfResult)
+                {
+                    Bitmap reImg= Imagepro.ToGrayBitmap(cBseData, m_iWidth, m_iHeight);
+                    return reImg;
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            catch (Exception ex)
+            {
+               log.Error("(ShowRemoveBGImage_Click):" + ex.ToString());
+            }
+            return null;
+        }
+        #endregion
+    }
+}

+ 120 - 0
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/frmSpecialGrayParticle.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>