Browse Source

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

cxs 1 year ago
parent
commit
6bb23862aa

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/ResourceForMeasureSourceGrid-EN.xml

@@ -20,7 +20,7 @@
 			<member itemKey="20014" itemName="" itemText="MeasureTime(s)"/>
 			<member itemKey="20015" itemName="" itemText="MeasureStopArea(mm2)"/>
 			<member itemKey="20016" itemName="" itemText="ScanResolution" comboContent="Low,Medium,High"/>
-			<member itemKey="20017" itemName="" itemText="MeasureImageResolution" comboContent="512X384,1024X684,1024X704,1024X768,1536X1024,2048X1408,2048X1536,3072X2048,4096X3072" />
+			<member itemKey="20017" itemName="" itemText="MeasureImageResolution" comboContent="" />
 	
 			<member itemKey="20163" itemName="" itemText="Random"/>
 			<member itemKey="20170" itemName="" itemText="CoverMeasureArea"/>

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/ResourceForMeasureSourceGrid-ZH.xml

@@ -23,7 +23,7 @@
 			<member itemKey="20014" itemName="" itemText="测量时间(秒)" description="输入测量时间。"/>
 			<member itemKey="20015" itemName="" itemText="测量结束面积(mm2)" description="输入测量结束面积。"/>
 			<member itemKey="20016" itemName="" itemText="扫描精度" comboContent="低,中,高" description="选择扫描精度。"/>
-			<member itemKey="20017" itemName="" itemText="测量图精度" comboContent="512X384,1024X684,1024X704,1024X768,1536X1024,2048X1408,2048X1536,3072X2048,4096X3072"  description="选择扫描图精度(尺寸)。"/>
+			<member itemKey="20017" itemName="" itemText="测量图精度" comboContent=""  description="选择扫描图精度(尺寸)。"/>
 			
            
 

+ 1 - 1
OTSCPP/OTSClrInterface/OTSClrInterface.vcxproj

@@ -367,7 +367,7 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <PrecompiledHeader>Create</PrecompiledHeader>
     </ClCompile>
     <Link>
       <AdditionalDependencies>OTSData.lib;OTSLog.lib;OTSClassifyEngine.lib;OTSControl.lib;OTSImagePro.lib;OTSRptCalculate.lib;OTSSQLiteDll.lib;%(AdditionalDependencies)</AdditionalDependencies>

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSSample.cs

@@ -67,7 +67,7 @@ namespace OTSDataType
                 // get image size
                 OTS_IMAGE_RESULOTION_OPTIONS nImageSizeId = m_poMsrParams.GetImageScanParam().GetImageResulotion();
                 long nResulotionId = RESOLUTION_ID_FIRST_TIE + (long)nImageSizeId;
-                int nImagewidth = RESOLUTION_VALUE[nResulotionId].Width;
+                int nImagewidth = otsdataconst.RESOLUTION_VALUE[nResulotionId].Width;
                 int nHeight = RESOLUTION_VALUE[nResulotionId].Height;
 
                 // calculate scan field size

+ 51 - 16
OTSIncAMeasureApp/0-OTSModel/OTSDataType/otsdataconst.cs

@@ -65,10 +65,10 @@ namespace OTSDataType
         public const int RESOLUTION_ID_MAX = 7;
         public const int RESOLUTION_ID_DEFAULT = 4;
         public const int RESOLUTION_ID_FIRST_TIE = 0;
-        public static readonly Size[] RESOLUTION_VALUE = { new Size(512, 384), new Size(1024, 684), new Size(1024, 704), new Size(1024, 768), new Size(1536, 1024), new Size(2048, 1408),new Size(2048,1416), new Size(2048, 1536), new Size(3072, 2048),new Size(4096, 3072) };
-
-        public static readonly string[] RESOLUTION_STRINGS = { "512 X 384", "1024 X 684", "1024 X 704", "1024 X 768", "1536 X 1024", "2048 X 1408", "2048 X 1416" , "2048 X 1536", "3072 X 2048",  "4096 X 3072" };
+//        private  Size[] rESOLUTION_VALUE; /*= { new Size(512, 384), new Size(1024, 684), new Size(1024, 704), new Size(1024, 768), new Size(1536, 1024), new Size(2048, 1408),new Size(2048,1416), new Size(2048, 1536), new Size(3072, 2048),new Size(4096, 3072) };*/
 
+//        private  string[] rESOLUTION_STRINGS;/* = { "512 X 384", "1024 X 684", "1024 X 704", "1024 X 768", "1536 X 1024", "2048 X 1408", "2048 X 1416" , "2048 X 1536", "3072 X 2048",  "4096 X 3072" };
+//*/
         // image parameter
         public const int STOP_PARAM_PARTICLE_MIN = 0;
         public const int STOP_PARAM_PARTICLE_MAX = 100000;
@@ -112,6 +112,53 @@ namespace OTSDataType
         // rigiditymod
         public const double RIGIDITYMOD_DEFAULT = 1.0;
         public const int INVALIDPART_GROUPID = -1;
+        public enum OTS_IMAGE_RESULOTION_OPTIONS
+        {
+            _512_384 = 0,
+            _1024_684 = 1,
+            _1024_704 = 2,
+            _1024_768 = 3,
+            _1536_1024 = 4,
+            _2048_1408 = 5,
+            _2048_1416 = 6,
+            _2048_1536 = 7,
+            _3072_2048 = 8,
+            _4096_3072 = 9
+        }
+        public static Size[] RESOLUTION_VALUE
+        {
+            get
+            {
+               var names = Enum.GetNames(typeof(OTS_IMAGE_RESULOTION_OPTIONS));
+              var  rESOLUTION_VALUE = new Size[names.Length];
+                int i = 0;
+                foreach (var itm in names)
+                {
+                    Size s = new Size();
+                    s.Width =Convert.ToInt32( itm.TrimStart('_').Split('_')[0]);
+                    s.Height = Convert.ToInt32(itm.TrimStart('_').Split('_')[1]);
+                    rESOLUTION_VALUE[i] = s;
+                    i++;
+                }
+                return rESOLUTION_VALUE;
+            }
+        }
+
+        public static string[] RESOLUTION_STRINGS
+        {
+            get
+            { 
+                string[] names = Enum.GetNames(typeof(OTS_IMAGE_RESULOTION_OPTIONS));
+                foreach (var itm in names)
+                {
+                    itm.TrimStart('_');
+                    itm.Replace('_', 'X');
+                
+                }
+                return names;
+            }
+        }
+
         public enum OTS_X_AXIS_DIRECTION
         {
             LEFT_TOWARD = 0,
@@ -225,19 +272,7 @@ namespace OTSDataType
         }
 
 
-        public enum OTS_IMAGE_RESULOTION_OPTIONS
-        {
-            _512_384 = 0,
-            _1024_684 = 1,
-            _1024_704 = 2,
-            _1024_768 = 3,
-            _1536_1024 = 4,
-            _2048_1408 = 5,
-            _2048_1416 = 6,
-            _2048_1536 = 7,
-            _3072_2048= 8,
-            _4096_3072 = 9
-        }
+       
 
 
         public enum OTS_X_RAY_SCAN_MODE

+ 12 - 12
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -159,25 +159,25 @@ namespace OTSModelSharp
             OTS_IMAGE_SCANSPEED_OPTIONS nDwellTime = pImgScanParam.GetScanImageSpeed();
 
             // convert dwell time to bruker dwell time 
-            int nBrukerDwellTimeId;
+            DwellTimeLevel DwellTimeId;
             switch (nDwellTime)
             {
                 case OTS_IMAGE_SCANSPEED_OPTIONS.low:
-                    nBrukerDwellTimeId = 1;
+                    DwellTimeId = DwellTimeLevel.Low;
                     break;
                 case OTS_IMAGE_SCANSPEED_OPTIONS.meddium:
-                    nBrukerDwellTimeId = 2;
+                    DwellTimeId = DwellTimeLevel.Medium;
                     break;
                 case OTS_IMAGE_SCANSPEED_OPTIONS.high:
-                    nBrukerDwellTimeId = 3;
+                    DwellTimeId = DwellTimeLevel.High;
                     break;
                 default:
-                    nBrukerDwellTimeId = 1;
+                    DwellTimeId = DwellTimeLevel.Low;
                     break;
 
             }
 
-            long nBrukerDwellTime = OTSDataType.otsdataconst.DWELLTIME_BRUKER_VALUES[nBrukerDwellTimeId];
+            //long nBrukerDwellTime = OTSDataType.otsdataconst.DWELLTIME_BRUKER_VALUES[DwellTimeId];
 
 
             if (!pScanController.Init())
@@ -186,11 +186,11 @@ namespace OTSModelSharp
                
                 return false;
             }
-
+           
             // set dwell time
-            if (!pScanController.SetDwellTime(nBrukerDwellTime))
+            if (!pScanController.SetDwellTime(DwellTimeId))
             {
-                log.Error("SetBSEParam: failed to set dwell time (%d) for bruker system.", nBrukerDwellTime);
+                //log.Error("SetBSEParam: failed to set dwell time (%d) for bruker system.", nBrukerDwellTime);
                 return false;
             }
 
@@ -225,7 +225,7 @@ namespace OTSModelSharp
             OTS_IMAGE_SCANSPEED_OPTIONS nDwellTime = pImgScanParam.GetScanImageSpeed();
 
             // convert dwell time to bruker dwell time 
-            long nBrukerDwellTime = DWELLTIME_BRUKER_VALUES[2];// choose the third option, so the dwell time will be 4 . there's no need to change here. it shoud be a const.
+            //long nBrukerDwellTime = DWELLTIME_BRUKER_VALUES[2];// choose the third option, so the dwell time will be 4 . there's no need to change here. it shoud be a const.
 
 
             if (!pScanController.Init())
@@ -236,9 +236,9 @@ namespace OTSModelSharp
             }
 
             // set dwell time
-            if (!pScanController.SetDwellTime(nBrukerDwellTime))
+            if (!pScanController.SetDwellTime(DwellTimeLevel.Low))
             {
-                log.Error("SetBSEParam: failed to set dwell time (%d) for bruker system.", nBrukerDwellTime);
+                //log.Error("SetBSEParam: failed to set dwell time (%d) for bruker system.", nBrukerDwellTime);
                 return false;
             }
 

+ 16 - 2
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/CPropItem.cs

@@ -1,4 +1,5 @@
-using OTSModelSharp.ResourceManage;
+using OTSDataType;
+using OTSModelSharp.ResourceManage;
 using System;
 using System.Collections.Generic;
 namespace OTSMeasureApp
@@ -40,7 +41,20 @@ namespace OTSMeasureApp
             var strRes = ResourceData.GetStringResourceByKey(GROUPS, a_nSmplId);
             if (a_nType == OTS_ITEM_TYPES.COMBO)
             {
-                comboDownList = strRes.combolist;
+                if (GROUPS == OTS_SAMPLE_PROP_GRID_ITEM_GROUPS.IMAGESCAN && a_nSmplId == OTS_SAMPLE_PROP_GRID_ITEMS.IMAGE_RESOLUTION)
+                {
+                    List<string> resolution = new List<string>();
+                    foreach (var str in otsdataconst.RESOLUTION_STRINGS)
+                    {
+                        resolution.Add(str);
+                    }
+                    comboDownList = resolution;
+                }
+                else 
+                {
+                    comboDownList = strRes.combolist;
+                }
+                
             }
             if (a_nType == OTS_ITEM_TYPES.BUTTON)
             {

+ 15 - 2
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSSampleVisualPropertyInfo.cs

@@ -2232,7 +2232,7 @@ namespace OTSMeasureApp
             OTS_SAMPLE_PROP_GRID_ITEM_GROUPS g = ResourceData.GetResourceGrpIdOfPropItem(a_nId);
 
             a_listComboStrings.Clear();
-
+          
             switch (a_nId)
             {
 
@@ -2249,8 +2249,21 @@ namespace OTSMeasureApp
                 default:
                     {
                         var strRes = XmlResourceData.GetInstance().GetStringResourceByKey(g, a_nId);
+                        if ( a_nId == OTS_SAMPLE_PROP_GRID_ITEMS.IMAGE_RESOLUTION)
+                        {
+                            List<string> resolution = new List<string>();
+                            foreach (var str in otsdataconst.RESOLUTION_STRINGS)
+                            {
+                                resolution.Add(str);
+                            }
+                            a_listComboStrings = resolution;
+                        }
+                        else
+                        {
+                            a_listComboStrings = strRes.combolist;
+                        }
 
-                        a_listComboStrings = strRes.combolist;
+                       
                     }
                     break;
 

+ 6 - 6
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSMeasureStatusWindow.cs

@@ -374,26 +374,26 @@ namespace OTSMeasureApp
             //建立图像数据
             originalBseData = new byte[m_iWidth * m_iHeight];
             //获取图像数据
-            int nDwellTime = 4;
+            DwellTimeLevel nDwellTime=DwellTimeLevel.Low;
             try
             {
                 int level = (int)m_MeasureAppForm.m_ProjParam.GetResultData().GetWorkingSample().GetMsrParams().GetImageScanParam().GetScanImageSpeed();
                 switch (level)
                 {
                     case 0:
-                        nDwellTime = 2;
+                        nDwellTime = DwellTimeLevel.Low;
                         break;
                     case 1:
-                        nDwellTime = 4;
+                        nDwellTime = DwellTimeLevel.Medium;
                         break;
                     case 2:
-                        nDwellTime = 8;
+                        nDwellTime =DwellTimeLevel.High;
                         break;
                 }
             }
             catch (Exception)
             {
-                nDwellTime = 8;
+                nDwellTime = DwellTimeLevel.Low;
             }
 
 
@@ -450,7 +450,7 @@ namespace OTSMeasureApp
             return GrayLevelData;
 
         }
-        public bool GetScanImage(int iWidth, int iHeight, int iDwellTime, ref byte[] bImageData)
+        public bool GetScanImage(int iWidth, int iHeight, DwellTimeLevel iDwellTime, ref byte[] bImageData)
         {
 
             //电镜设置对象

+ 17 - 2
OTSIncAMeasureApp/ServiceCenter/CPP(Bruker)API/ScanController.cs

@@ -93,15 +93,30 @@ namespace OTSModelSharp.ServiceCenter
             
         }
 
-        public bool SetDwellTime(double val)
+        public bool SetDwellTime(DwellTimeLevel val)
         {
+            double dwelltime=2;
+            switch (val)
+            {
+                case DwellTimeLevel.Low:
+                    dwelltime = 2;
+                    break;
+                case DwellTimeLevel.Medium:
+                    dwelltime = 4;
+                    break;
+                case DwellTimeLevel.High:
+                    dwelltime = 8;
+                    break;
+
 
+
+            }
                 if (!scan.IsConnected())
                 {
                     return false;
                 }
 
-                return scan.SetDwellTime((int)val);
+                return scan.SetDwellTime((int)dwelltime);
            
         }
 

+ 21 - 2
OTSIncAMeasureApp/ServiceCenter/FEIAutoScript/FEIScanController.cs

@@ -53,9 +53,28 @@ namespace OTSMeasureApp.ServiceCenter
             return ApiClass.Connect(FEIIP, FEIPORT);
         }
 
-        public bool SetDwellTime(double val)
+        public bool SetDwellTime(DwellTimeLevel val)
         {
-            dwelltime = val;
+             dwelltime = 0.5;
+            switch (val)
+            {
+                case DwellTimeLevel.Low:
+                    dwelltime = 0.5;
+                    break;
+                case DwellTimeLevel.Medium:
+                    dwelltime = 1;
+                    break;
+                case DwellTimeLevel.High:
+                    dwelltime = 4;
+                    break;
+
+
+
+            }
+          
+
+           
+            
             return true;
         }
 

+ 9 - 1
OTSIncAMeasureApp/ServiceCenter/IMeasureHardware.cs

@@ -16,6 +16,14 @@ namespace OTSModelSharp.ServiceCenter
       OXFORD=2,
       FEI=3
     
+    }
+    public enum DwellTimeLevel
+    {
+        Low = 0,
+        Medium = 1,
+        High = 2,
+      
+
     }
 
     public interface ISemController
@@ -55,7 +63,7 @@ namespace OTSModelSharp.ServiceCenter
     public interface IScanController
     {
         bool Init();
-        bool SetDwellTime(double val);
+        bool SetDwellTime(DwellTimeLevel val);
         bool SetImageSize(int nWidth,int nHeight);
 
       

+ 1 - 1
OTSIncAMeasureApp/ServiceCenter/IpcSEMController.cs

@@ -48,7 +48,7 @@ namespace OTSMeasureApp.ServiceCenter
             return sem.SetMagnification(a_dMagnification);
         }
 
-        public bool AcquireBSEImage(string sampleName, int width, int height, int dwellTime, ref byte[] ImageByte)
+        public bool AcquireBSEImage(string sampleName, int width, int height, DwellTimeLevel dwellTime, ref byte[] ImageByte)
         {
             scan.Init();
             scan.SetDwellTime(dwellTime);

+ 18 - 2
OTSIncAMeasureApp/ServiceCenter/OxfordExtender/OxfordScanController.cs

@@ -67,9 +67,25 @@ namespace OTSMeasureApp.ServiceCenter
             return true;
         }
 
-        public bool SetDwellTime(double val)
+        public bool SetDwellTime(DwellTimeLevel val)
         {
-            dwelltime = val;
+             dwelltime = 2;
+            switch (val)
+            {
+                case DwellTimeLevel.Low:
+                    dwelltime = 2;
+                    break;
+                case DwellTimeLevel.Medium:
+                    dwelltime = 4;
+                    break;
+                case DwellTimeLevel.High:
+                    dwelltime = 8;
+                    break;
+
+
+
+            }
+           
             return true;
         }
 

+ 2 - 1
OTSIncAReportApp/1-UI/Control_Grids/OTSIncAReportGridsFuncation/OTSReportGridsFun.cs

@@ -2,6 +2,7 @@
 using OTSCLRINTERFACE;
 using OTSCommon.Model;
 using OTSIncAReportApp.SysMgrTools;
+using OTSModelSharp.ServiceCenter;
 using ServiceInterface;
 using System;
 using System.Collections;
@@ -215,7 +216,7 @@ namespace OTSIncAReportGrids.OTSIncAReportGridsFuncation
             return isSuccess;
         }
 
-        public bool AcquireBSEImage(string sampleName, int width, int height, int dwellTime, ref byte[] ImageByte)
+        public bool AcquireBSEImage(string sampleName, int width, int height, DwellTimeLevel dwellTime, ref byte[] ImageByte)
         {
             bool isSuccess = false;
             if (m_SEMConnectionState)

+ 8 - 7
OTSIncAReportApp/1-UI/frmReMeasure.cs

@@ -29,6 +29,7 @@ using OTSModelSharp.DTLBase;
 using OTSRptPeriodicTable;
 using ExportToExcel;
 using ComboBoxItem = OTSMeasureApp.ComboBoxItem;
+using OTSModelSharp.ServiceCenter;
 
 namespace OTSIncAReportApp
 {
@@ -45,7 +46,7 @@ namespace OTSIncAReportApp
         Point handPoint;
         int partFunIndex = 0;
         int xrayScanMode = 0;
-        int nBrukerDwellTime = 0;
+        DwellTimeLevel nBrukerDwellTime = DwellTimeLevel.Low;
         double ScanFieldSizeX = 0;
         double ScanFieldSizeX100 = 0;
         double ScanFieldSizeY100 = 0;
@@ -639,23 +640,23 @@ namespace OTSIncAReportApp
         private void BTN_YES_Click(object sender, EventArgs e)
         {
             //参数定义
-            int nBrukerDwellTimeId = 3;
+             nBrukerDwellTime = DwellTimeLevel.Low;
             switch (IDC_COMBO_IMGSCANSPEED.SelectedIndex)
             {
                 case (int)OTS_IMAGE_SCANSPEED_OPTIONS.low:
-                    nBrukerDwellTimeId = 3;
+                    nBrukerDwellTime = DwellTimeLevel.Low;
                     break;
                 case (int)OTS_IMAGE_SCANSPEED_OPTIONS.meddium:
-                    nBrukerDwellTimeId = 4;
+                    nBrukerDwellTime = DwellTimeLevel.Medium;
                     break;
                 case (int)OTS_IMAGE_SCANSPEED_OPTIONS.high:
-                    nBrukerDwellTimeId = 5;
+                    nBrukerDwellTime = DwellTimeLevel.High;
                     break;
                 default:
-                    nBrukerDwellTimeId = 3;
+                    nBrukerDwellTime = DwellTimeLevel.Low;
                     break;
             }
-            nBrukerDwellTime = DWELLTIME_BRUKER_VALUES[nBrukerDwellTimeId];
+            //nBrukerDwellTime = DWELLTIME_BRUKER_VALUES[nBrukerDwellTimeId];
 
             tabControl_grid.SelectedIndex = 0;
             tabControl_grid.Enabled = false;

+ 2 - 1
OTSIncAReportApp/3-ServiceCenter/HardwareController.cs

@@ -12,6 +12,7 @@ using OTSMeasureApp.ServiceCenter;
 using OTSCommon.Model;
 using OTSCLRINTERFACE;
 using OTSDataType;
+using OTSModelSharp.ServiceCenter;
 
 namespace ServiceInterface
 {
@@ -89,7 +90,7 @@ namespace ServiceInterface
             return false;
         }
 
-        public bool AcquireBSEImage(string sampleName, int width, int height, int dwellTime, ref byte[] ImageByte)
+        public bool AcquireBSEImage(string sampleName, int width, int height, DwellTimeLevel dwellTime, ref byte[] ImageByte)
         {
             //Connect();
             if (remoteObj == null)

+ 3 - 7
OTSSysMgrApp/ControllerSettingForm.Designer.cs

@@ -125,13 +125,9 @@
             this.ddlDwellTime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.ddlDwellTime.FormattingEnabled = true;
             this.ddlDwellTime.Items.AddRange(new object[] {
-            "4",
-            "8",
-            "16",
-            "32",
-            "64",
-            "128",
-            "256"});
+            "Low",
+            "Medium",
+            "High"});
             this.ddlDwellTime.Location = new System.Drawing.Point(266, 16);
             this.ddlDwellTime.Margin = new System.Windows.Forms.Padding(2);
             this.ddlDwellTime.Name = "ddlDwellTime";

+ 18 - 4
OTSSysMgrApp/ControllerSettingForm.cs

@@ -210,11 +210,25 @@ namespace OTSSysMgrApp
 
                         return false;
                     }
-                    #endregion
+                #endregion
+
+                #region 采集时间
+                //采集时间
+                DwellTimeLevel nDwellTime=DwellTimeLevel.Low;
+                switch (DwellTime)
+                {
+                    case "Low":
+                        nDwellTime = DwellTimeLevel.Low;
+                        break;
+                    case "Medium":
+                        nDwellTime = DwellTimeLevel.Medium;
+                        break;
+                    case "High":
+                        nDwellTime = DwellTimeLevel.High;
+                        break;
+                
+                }
 
-                    #region 采集时间
-                    //采集时间
-                    int nDwellTime = Convert.ToInt32(DwellTime);
                     //设置采集时间
                     if (!scan.SetDwellTime(nDwellTime))
                     {