Browse Source

添加OtherSelection

cxs 1 year ago
parent
commit
16370e5398

+ 1 - 1
Bin/x64/Debug/Config/ConfigTemplate/BatteryCleannessA/OTSProgMgrParam.pmf

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="CleannessA">
   <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="Cleanness_F" SteelTechnology="0" UseSysSTD="true" />
-  <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" ErrodDilateParam="0" OverlapParam="0">
+  <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" OtherSelection="" ErrodDilateParam="0" OverlapParam="0">
     <Member RegName="BGGray" end="255" start="80" />
     <Member RegName="IncArea" end="100" start="3" />
     <Member RegName="ParticleGray" end="255" start="0" />

+ 1 - 1
Bin/x64/Debug/Config/ConfigTemplate/CleannessA/OTSProgMgrParam.pmf

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="CleannessA">
   <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="OTSCleanlinessSTD1" SteelTechnology="0" UseSysSTD="true" />
-  <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" ErrodDilateParam="0" OverlapParam="0">
+  <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" OtherSelection="" ErrodDilateParam="0" OverlapParam="0">
     <Member RegName="BGGray" end="255" start="80" />
     <Member RegName="IncArea" end="100" start="3" />
     <Member RegName="ParticleGray" end="255" start="0" />

+ 1 - 1
Bin/x64/Debug/Config/ConfigTemplate/IncA/OTSProgMgrParam.pmf

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="IncA">
   <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="NoSTDDB" SteelTechnology="0" UseSysSTD="true" />
-  <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" ErrodDilateParam="0" OverlapParam="0">
+  <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" ErrodDilateParam="0" OtherSelection="" OverlapParam="0">
     <Member RegName="BGGray" end="255" start="80" />
     <Member RegName="IncArea" end="100" start="3" />
     <Member RegName="ParticleGray" end="255" start="0" />

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

@@ -41,6 +41,7 @@
 			<member itemKey="20025" itemName="" itemText="颗粒灰度最大值" description="输入分析颗粒灰度最大值(0~255),不小于分析颗粒灰度最小值。"/>
 			<member itemKey="20020" itemName="" itemText="等效圆直径最小值(微米)" description="输入分析颗粒面积最小值(微米)。"/>
 			<member itemKey="20021" itemName="" itemText="等效圆直径最大值(微米)" description="输入分析颗粒面积最大值(微米)。"/>
+			<member itemKey="20029" itemName="" itemText="其他选择" description="otherselection"/>	
 
         </collection>
 		<collection RegName="ResGrp" grpKey="3" text="x-ray参数" description="">

+ 18 - 3
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSImageProcParam.cs

@@ -23,6 +23,7 @@ namespace OTSDataType
         private OTS_BGREMOVE_TYPE m_BGRemoveType;
         private OTS_AUTOBGREMOVE_TYPE m_autoBGRemoveType;
         int m_OverlapParam;
+        string m_OtherSelection;
 
         private CSpecialGrayRangeParam m_specialGreyRangeParam;
         private string particleSelectCondition = "";
@@ -54,11 +55,18 @@ namespace OTSDataType
         
         }
 
+        public string GetOtherSelection()
+        { 
+            return m_OtherSelection;
+        }
         public void SetParticleSelectCondition(string value)
         {
             particleSelectCondition = value;
         }
-
+        public void SetOtherSelection(string a_OtherSelection)
+        {
+            m_OtherSelection = a_OtherSelection;
+        }
 
         public CSpecialGrayRangeParam GetSpecialGreyRangeParam()
         {
@@ -94,6 +102,7 @@ namespace OTSDataType
             m_BGRemoveType = OTS_BGREMOVE_TYPE.MANUAL;// OTS_BGREMOVE_TYPE.AUTO;
             m_autoBGRemoveType = OTS_AUTOBGREMOVE_TYPE.MIDDLE;           
             m_OverlapParam = 20;
+            m_OtherSelection = "";
         }
         public CDoubleRange GetIncAreaRange() { return m_oIncArea; }
         public void SetIncAreaRange(CDoubleRange a_oVal) { m_oIncArea = a_oVal; }
@@ -134,7 +143,7 @@ namespace OTSDataType
             m_autoBGRemoveType = a_oSource.m_autoBGRemoveType;
             SetParticleSelectCondition(a_oSource.GetParticleSelectCondition());
             m_OverlapParam = a_oSource.m_OverlapParam;
-
+            m_OtherSelection = a_oSource.m_OtherSelection;
 
         }
         public bool Equals(COTSImageProcParam a_oSource)
@@ -145,7 +154,8 @@ namespace OTSDataType
                 m_oBGGray == a_oSource.m_oBGGray &&
                 m_oParticleGray == a_oSource.m_oParticleGray &&
                
-                m_OverlapParam == a_oSource.m_OverlapParam;
+                m_OverlapParam == a_oSource.m_OverlapParam&&
+                m_OtherSelection==a_oSource.m_OtherSelection;
 
         }
 
@@ -173,6 +183,9 @@ namespace OTSDataType
             xString xpartselcondition = new xString();
             slo.Register("ParticleSelectionCondition", xpartselcondition);
 
+            xString xOtherSelection = new xString();
+            slo.Register("OtherSelection", xOtherSelection);
+
             if (isStoring)
             {
 
@@ -181,6 +194,7 @@ namespace OTSDataType
                
                 xnOverlapParam.AssignValue(m_OverlapParam);
                 xpartselcondition.AssignValue(GetParticleSelectCondition());
+                xOtherSelection.AssignValue(m_OtherSelection);
                 slo.Serialize(true, classDoc, rootNode);
             }
             else
@@ -191,6 +205,7 @@ namespace OTSDataType
                 m_autoBGRemoveType = (OTS_AUTOBGREMOVE_TYPE)Convert.ToInt32( xnautoBGRemoveType.value().Split(':')[0]);
               
                 m_OverlapParam = Convert.ToInt32(xnOverlapParam.value());
+                m_OtherSelection = xOtherSelection.value();
                 SetParticleSelectCondition(xpartselcondition.value());
             }
         }

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

@@ -12,7 +12,7 @@ namespace OTSDataType
         public string text;
         public List<string> combolist=new List<string>();
         public string Description;
-
+        public string Tag;
     }
     public class ResourceGroup
     {

+ 6 - 1
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/CPropItem.cs

@@ -14,6 +14,7 @@ namespace OTSMeasureApp
         public List<String> comboDownList = new List<string>();//如果iSampleValType是combobox则在此处存储下拉列表  
         public bool bReadOnly;          //值的类型
         private string sDescriptionInfo;   //描述信息
+        private string sTag;
 
         public OTS_SAMPLE_PROP_GRID_ITEMS SampleId { get => iSampleId; set => iSampleId = value; }
         public string CaptionName { get => sSCaptionName; set => sSCaptionName = value; }
@@ -31,6 +32,7 @@ namespace OTSMeasureApp
         }
 
         public string Description { get => sDescriptionInfo; set => sDescriptionInfo = value; }
+        public string Tag { get => sTag; set => sTag = value; }
 
         public void InitialSmplParameter(OTS_SAMPLE_PROP_GRID_ITEM_GROUPS GROUPS, OTS_SAMPLE_PROP_GRID_ITEMS a_nSmplId, OTS_ITEM_TYPES a_nType, bool a_bReadOnly, bool a_bShow)
         {
@@ -40,7 +42,10 @@ namespace OTSMeasureApp
             {
                 comboDownList = strRes.combolist;
             }
-            
+            if (a_nType == OTS_ITEM_TYPES.BUTTON)
+            {
+                sTag = a_nSmplId.ToString();
+            }
             sSCaptionName = strRes.text;
             sDescriptionInfo = strRes.Description;
             iSampleId = a_nSmplId;

+ 49 - 8
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSDisplaySampleGrid.cs

@@ -1,5 +1,6 @@
 using OTSDataType;
 using OTSMeasureApp._3_OTSDisplaySourceGridData;
+using OTSMeasureApp._7_OTSProgMgrInfo;
 using OTSModelSharp.ResourceManage;
 using SourceGrid;
 using System;
@@ -41,6 +42,7 @@ namespace OTSMeasureApp
         SelectComboboxItem m_SeletComboboxValEvent = null;
         //EditFileDialog
         EditorFileDialog m_EditFileDlg = new EditorFileDialog();
+
         //CELL的第一例的 "-" 的事件
         SourceGrid.Cells.Controllers.Button m_linkClickEvent3 = null;
 
@@ -420,7 +422,53 @@ namespace OTSMeasureApp
                     }
                     break;
 
-               
+
+                case OTS_ITEM_TYPES.BUTTON:
+                    {
+                        if (null == m_PropWindow.PropGrid[Row, 1])
+                        {
+                            m_PropWindow.PropGrid[Row, 1] = new SourceGrid.Cells.Cell(sCaptionName);
+                        }
+                        else
+                        {
+                            m_PropWindow.PropGrid[Row, 1].Value = sCaptionName;
+                        }
+
+                        if (null == m_PropWindow.PropGrid[Row, 2])
+                            {
+                                m_PropWindow.PropGrid[Row, 2] = new SourceGrid.Cells.Cell(SampleVal, typeof(string));
+                                m_PropWindow.PropGrid[Row, 1].View = m_Col_NameMode;
+                                m_PropWindow.PropGrid[Row, 2].View = m_Col_ValMode;
+
+
+
+                                if (bReadOnly)          //只读模式
+                                {
+                                    m_PropWindow.PropGrid[Row, 2].Editor = null;
+                                    m_PropWindow.PropGrid[Row, 2].View = M_Col_readonly;// 设置只读
+
+
+                                    m_PropWindow.PropGrid[Row, 2].AddController(m_ChangeCellValEvent);
+                                }
+                                else
+                                {
+                                    //设置允许修改值的事件
+                                    m_PropWindow.PropGrid[Row, 2].AddController(m_ChangeCellValEvent);
+                                }
+                            }
+                            else
+                            {
+                                m_PropWindow.PropGrid[Row, 2].Value = SampleVal;
+                            }
+                        
+
+
+                        //将ID绑定到行号上,当在行上Click时,就可以查到对应的样品ID所在的行上的的值
+                        m_PropWindow.PropGrid.Rows[Row].Tag = SampleID;
+                        //将参数类型绑定到单元格上,当在行上Click时,就可以查到对应的参数类型所在的行上的的值
+                        m_PropWindow.PropGrid[Row, 2].Tag = SampleValType;
+                    }
+                    break;
                 case OTS_ITEM_TYPES.COMBO:
                     {
                         //初始化 ComboxTest ,COMBBOX 显示文字使用
@@ -753,8 +801,6 @@ namespace OTSMeasureApp
         }
 
     }
-    
-
     //当选择了Grid的某个row ,修改Row的值,引发的事件
     class ChangeGridCellValEvent : SourceGrid.Cells.Controllers.ControllerBase
     {
@@ -1026,11 +1072,6 @@ namespace OTSMeasureApp
         }
  
     }
-   
-
-
-
-
     //选择Combobox下拉框中的值引发事件函数
     class SelectComboboxItem : SourceGrid.Cells.Controllers.ControllerBase
     {

+ 103 - 99
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSPropertyWindow.cs

@@ -7,26 +7,28 @@ using OTSDataType;
 using OTSMeasureApp._3_OTSDisplaySourceGridData;
 using OTSModelSharp.ResourceManage;
 using System.Collections.Generic;
+using OTSMeasureApp._7_OTSProgMgrInfo;
 
 namespace OTSMeasureApp
 {
     public partial class OTSPropertyWindow : DockContent
     {
 
-        public OTSIncAMeasureAppForm m_MeasureAppForm = null;   
+        public OTSIncAMeasureAppForm m_MeasureAppForm = null;
         public OTSDisplaySampleGrid m_SampleGrid = null;
         frmMeasureStopMode frmStopModeDialog;
+        OtherSelectionForm otherSelectionForm;
         public OTSPropertyWindow(OTSIncAMeasureAppForm MeasureAppForm)
         {
             InitializeComponent();
             m_MeasureAppForm = MeasureAppForm;
-         
+
             m_SampleGrid = new OTSDisplaySampleGrid(this);
             //国际化
             OTSCommon.Language lan = new OTSCommon.Language(this);
         }
 
-   
+
         //接收 MeasureApp 发送的样品属性数据,通过Grid显示在properyWindow上
         public void DisplaySampleMeasureInfo(OTSSampleVisualPropertyInfo SampleInfo)
         {
@@ -36,7 +38,7 @@ namespace OTSMeasureApp
             PropGrid.Show();
             m_SampleGrid.m_ClickRow = 0;
             m_SampleGrid.m_ClickColumn = 0;
-            if(PropGrid.Rows.Count()>0)
+            if (PropGrid.Rows.Count() > 0)
             {
                 PropGrid.Rows.Clear();
                 PropGrid.Redim(OTSDisplaySampleGrid.Const_Grid_Row, OTSDisplaySampleGrid.Const_Grid_Column);
@@ -63,32 +65,32 @@ namespace OTSMeasureApp
             PropGrid.Refresh();
             PropGrid.Invalidate();
         }
-      
+
         private void OTSPropertyWindow_Load(object sender, EventArgs e)
         {
-           
+
         }
-           
+
         private void OTSPropertyWindow_Resize(object sender, EventArgs e)
         {
-    
-           
-                if (null != m_SampleGrid )
-                {
-                    m_SampleGrid.m_PropWindow_X = this.Width;              
-                    m_SampleGrid.InitGridTitlet();
-                }
-         
-            
+
+
+            if (null != m_SampleGrid)
+            {
+                m_SampleGrid.m_PropWindow_X = this.Width;
+                m_SampleGrid.InitGridTitlet();
+            }
+
+
         }
-  
+
 
         public void SampleGridInfoChange(OTS_SAMPLE_PROP_GRID_ITEMS SampleId, OTS_ITEM_TYPES ValType, object ObjVal)
         {
-           
+
 
             var PropertyMeasureThreadRunFlag = m_MeasureAppForm.m_MsrThreadWrapper.BGWorkThreadIsRunning();
-            var measureTreadIsPaused= m_MeasureAppForm.m_MsrThreadWrapper.BgWorkIsPaused();
+            var measureTreadIsPaused = m_MeasureAppForm.m_MsrThreadWrapper.BgWorkIsPaused();
 
             if (measureTreadIsPaused == false && PropertyMeasureThreadRunFlag == true)
             {
@@ -100,30 +102,30 @@ namespace OTSMeasureApp
             var m_measurePara = m_MeasureAppForm.m_ProjParam;
             var sample = m_measurePara.GetWorkSample();
             var stype = m_measurePara.GetDefaultParam().GetSysType();
-           
-           
 
-            OTSSampleVisualPropertyInfo SMInfo = new OTSSampleVisualPropertyInfo(sample,stype);
+
+
+            OTSSampleVisualPropertyInfo SMInfo = new OTSSampleVisualPropertyInfo(sample, stype);
 
 
             switch (SampleId)
             {
                 case OTS_SAMPLE_PROP_GRID_ITEMS.STD_FILE_NAME:
-                if (SMInfo.SetSTDFileName((int)ObjVal))
-                {
+                    if (SMInfo.SetSTDFileName((int)ObjVal))
+                    {
 
-                    //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
+                        //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
 
-                    DisplaySampleMeasureInfo(SMInfo);
-                    return;
-                }
+                        DisplaySampleMeasureInfo(SMInfo);
+                        return;
+                    }
                     break;
                 case OTS_SAMPLE_PROP_GRID_ITEMS.SAMPLE_NAME:
                     string strNewName = (string)ObjVal;
                     strNewName = strNewName.Trim();
                     string oldName = m_measurePara.GetWorkSampleName();
                     if (!m_measurePara.CheckSampleNameIsValid(strNewName))
-                   {
+                    {
 
                         //update source grid,recover to the original value
                         //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
@@ -142,8 +144,8 @@ namespace OTSMeasureApp
                     //update source grid
                     DisplaySampleMeasureInfo(SMInfo);
 
-                   
-                  
+
+
 
                     break;
                 case OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE:
@@ -153,11 +155,11 @@ namespace OTSMeasureApp
                         //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
 
 
-                    DisplaySampleMeasureInfo(SMInfo);
-                    return;
+                        DisplaySampleMeasureInfo(SMInfo);
+                        return;
                     }
                     if (!m_measurePara.SetSampleParamVal(OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_TIME, OTS_ITEM_TYPES.INT, frmStopModeDialog.TimeMode))    // Prop值变化,修改样品值成功
-                   {
+                    {
 
                         //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
 
@@ -189,6 +191,19 @@ namespace OTSMeasureApp
                         //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
 
 
+                        DisplaySampleMeasureInfo(SMInfo);
+                        return;
+                    }
+                    break;
+
+
+                case OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection:
+                    if (!m_measurePara.SetSampleParamVal(OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection, OTS_ITEM_TYPES.STRING, otherSelectionForm.OtherSelection))    // Prop值变化,修改样品值成功
+                    {
+
+                        //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
+
+
                         DisplaySampleMeasureInfo(SMInfo);
                         return;
                     }
@@ -205,8 +220,8 @@ namespace OTSMeasureApp
                         return;
                     }
                     break;
-             
-                }
+
+            }
 
             //---after modify the value of current sample properties,update the corresponding value of GUI.---
 
@@ -216,29 +231,29 @@ namespace OTSMeasureApp
                    || OTS_SAMPLE_PROP_GRID_ITEMS.START_PHOTO_MODE == SampleId
                     || OTS_SAMPLE_PROP_GRID_ITEMS.XRAYSCAN_MODE == SampleId
                     )
-                {
+            {
 
 
 
-                        var sam = m_MeasureAppForm.m_SamplepaceWindow.GetWorkingVisualSample();
+                var sam = m_MeasureAppForm.m_SamplepaceWindow.GetWorkingVisualSample();
 
-                        m_MeasureAppForm.m_SamplepaceWindow.PrepareMeasureField(sam, MSR_RUN_TYPE.RUNMEASURE);
+                m_MeasureAppForm.m_SamplepaceWindow.PrepareMeasureField(sam, MSR_RUN_TYPE.RUNMEASURE);
 
 
                 //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
                 DisplaySampleMeasureInfo(SMInfo);
                 return;
-                }
+            }
 
 
             //m_measurePara.GetWorkSamplePerameter(m_measurePara.GetWorkSample(), ref SMInfo);
             if (OTS_SAMPLE_PROP_GRID_ITEMS.SWITCH == SampleId)
             {
-                    
+
                 m_MeasureAppForm.m_SolutionWindows.Rev_MeasureApp_CheckboxStatuChange_Event(m_measurePara.GetWorkSampleName(), SMInfo.TSampleParam.bSwitch);
                 // 设置 开始 ,停止 和检查参数 按钮状态
                 m_MeasureAppForm.m_RibbonFun.SetMeasureRibbonButnStatu();
-               }
+            }
 
 
 
@@ -265,70 +280,59 @@ namespace OTSMeasureApp
             m_SampleGrid.m_ClickRow = ls_gd.Selection.ActivePosition.Row;
             m_SampleGrid.m_ClickColumn = ls_gd.Selection.ActivePosition.Column;
             /// 保证鼠标点击的GRID行和列是有效的
-            if(m_SampleGrid.m_ClickRow>=0 && m_SampleGrid.m_ClickColumn>=0)
+            if (m_SampleGrid.m_ClickRow >= 0 && m_SampleGrid.m_ClickColumn >= 0)
             {
                 m_SampleGrid.SetGridTitleStatus();
-                if(m_MeasureAppForm.m_ProjData.SystemTypeId == otsdataconst.OTS_SysType_ID.CleannessA )
+                if (PropGrid.Rows[m_SampleGrid.m_ClickRow].Tag == null)
                 {
-                    const int CleannessASysStopModeGridRowPos = 7;
-                    if (m_SampleGrid.m_ClickRow == CleannessASysStopModeGridRowPos && m_SampleGrid.m_ClickColumn == 2)
+                    return;
+                }
+
+                if ((OTS_SAMPLE_PROP_GRID_ITEMS)PropGrid.Rows[m_SampleGrid.m_ClickRow].Tag == OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE && m_SampleGrid.m_ClickColumn == 2)
+                {
+                    frmStopModeDialog = new frmMeasureStopMode();
+                    frmStopModeDialog.FieldMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 2, m_SampleGrid.m_ClickColumn].Value.ToString());
+                    frmStopModeDialog.TimeMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 3, m_SampleGrid.m_ClickColumn].Value.ToString());
+                    frmStopModeDialog.ParticleMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 1, m_SampleGrid.m_ClickColumn].Value.ToString());
+                    frmStopModeDialog.StopMode = PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value.ToString();
+                    frmStopModeDialog.AreaMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 4, m_SampleGrid.m_ClickColumn].Value.ToString());
+                    DialogResult result = frmStopModeDialog.ShowDialog();
+
+                    if (result == DialogResult.OK)
                     {
-                        frmStopModeDialog = new frmMeasureStopMode();
-                        frmStopModeDialog.FieldMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 2, m_SampleGrid.m_ClickColumn].Value.ToString());
-                        frmStopModeDialog.TimeMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 3, m_SampleGrid.m_ClickColumn].Value.ToString());
-                        frmStopModeDialog.ParticleMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 1, m_SampleGrid.m_ClickColumn].Value.ToString());
-                        frmStopModeDialog.StopMode = PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value.ToString();
-                        frmStopModeDialog.AreaMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 4, m_SampleGrid.m_ClickColumn].Value.ToString());
-                        DialogResult result = frmStopModeDialog.ShowDialog();
-
-                        if (result == DialogResult.OK)
-                        {
-                            string str = PropGrid[0, 0].Value.ToString();
-
-                            PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.StopMode;
-                            PropGrid[m_SampleGrid.m_ClickRow + 2, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.FieldMode;
-                            PropGrid[m_SampleGrid.m_ClickRow + 3, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.TimeMode;
-                            PropGrid[m_SampleGrid.m_ClickRow + 1, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.ParticleMode;
-                            PropGrid[m_SampleGrid.m_ClickRow + 4, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.AreaMode;
-
-                            PropGrid[0, 0].Value = str;
-                            PropGrid.Refresh();
-                            PropGrid.Invalidate();
-                        }
+                        string str = PropGrid[0, 0].Value.ToString();
+
+                        PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.StopMode;
+                        PropGrid[m_SampleGrid.m_ClickRow + 2, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.FieldMode;
+                        PropGrid[m_SampleGrid.m_ClickRow + 3, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.TimeMode;
+                        PropGrid[m_SampleGrid.m_ClickRow + 1, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.ParticleMode;
+                        PropGrid[m_SampleGrid.m_ClickRow + 4, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.AreaMode;
+
+                        PropGrid[0, 0].Value = str;
+                        PropGrid.Refresh();
+                        PropGrid.Invalidate();
                     }
                 }
-                else
+
+                else if ((OTS_SAMPLE_PROP_GRID_ITEMS)PropGrid.Rows[m_SampleGrid.m_ClickRow].Tag == OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection && m_SampleGrid.m_ClickColumn == 2)
                 {
-                    const int IncASysStopModeGridRowPos = 9;
-                    if (m_SampleGrid.m_ClickRow == IncASysStopModeGridRowPos && m_SampleGrid.m_ClickColumn == 2)
+                    otherSelectionForm = new OtherSelectionForm();
+                    otherSelectionForm.OtherSelection = PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value.ToString();
+                    DialogResult result = otherSelectionForm.ShowDialog();
+
+                    if (result == DialogResult.OK)
                     {
-                        frmStopModeDialog = new frmMeasureStopMode();
-                        frmStopModeDialog.FieldMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 2, m_SampleGrid.m_ClickColumn].Value.ToString());
-                        frmStopModeDialog.TimeMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 3, m_SampleGrid.m_ClickColumn].Value.ToString());
-                        frmStopModeDialog.ParticleMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 1, m_SampleGrid.m_ClickColumn].Value.ToString());
-                        frmStopModeDialog.StopMode = PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value.ToString();
-                        frmStopModeDialog.AreaMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 4, m_SampleGrid.m_ClickColumn].Value.ToString());
-                        DialogResult result = frmStopModeDialog.ShowDialog();
-
-                        if (result == DialogResult.OK)
-                        {
-                            string str = PropGrid[0, 0].Value.ToString();
-
-                            PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.StopMode;
-                            PropGrid[m_SampleGrid.m_ClickRow + 2, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.FieldMode;
-                            PropGrid[m_SampleGrid.m_ClickRow + 3, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.TimeMode;
-                            PropGrid[m_SampleGrid.m_ClickRow + 1, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.ParticleMode;
-                            PropGrid[m_SampleGrid.m_ClickRow + 4, m_SampleGrid.m_ClickColumn].Value = frmStopModeDialog.AreaMode;
-
-                            PropGrid[0, 0].Value = str;
-                            PropGrid.Refresh();
-                            PropGrid.Invalidate();
-                        }
+                        string str = PropGrid[0, 0].Value.ToString();
+
+                        PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value = otherSelectionForm.OtherSelection;
+
+                        PropGrid[0, 0].Value = str;
+                        PropGrid.Refresh();
+                        PropGrid.Invalidate();
                     }
                 }
-                
             }
-            
+
         }
 
         private void TSSaveAs_Click(object sender, EventArgs e)
@@ -349,8 +353,8 @@ namespace OTSMeasureApp
 
         private void TSEdit_Click(object sender, EventArgs e)
         {
-                            
-           
+
+
         }
 
         private void TSLoad_Click(object sender, EventArgs e)
@@ -360,10 +364,10 @@ namespace OTSMeasureApp
                 m_MeasureAppForm.m_ProjParam.LoadWorkMeasureFile();
                 return;
             }
-          
+
             if (OTS_SAMPLE_PROP_GRID_ITEMS.STD_FILE_NAME == (OTS_SAMPLE_PROP_GRID_ITEMS)PropGrid.Rows[m_SampleGrid.m_ClickRow].Tag)
             {
-                
+
                 return;
             }
             else

+ 74 - 4
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSSampleVisualPropertyInfo.cs

@@ -20,8 +20,8 @@ namespace OTSMeasureApp
         STRING = 3,
         COMBO = 4,
         TIME = 5,
-        TIME_SPAN = 6
-      
+        TIME_SPAN = 6,
+        BUTTON=7
 
     }
     public class CTreeSampleParam
@@ -647,7 +647,12 @@ namespace OTSMeasureApp
                         m_poMsrParams.GetImageProcessParam().SetAutoBGRemoveType((OTS_AUTOBGREMOVE_TYPE)(int)objVal);
                     }
                     break;
+                case OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection:
+                    {
 
+                        m_poMsrParams.GetImageProcessParam().SetOtherSelection((string)objVal);
+                    }
+                    break;
                 default:
 
                     bSetFalg = false;
@@ -920,7 +925,7 @@ namespace OTSMeasureApp
 
                             poPropItem = new CPropItem();
                             nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE;
-                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.STRING, true, bShow);
+                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.BUTTON, true, bShow);
                             a_listPropItems.Add(poPropItem);
 
                             //// stop parameter
@@ -998,6 +1003,11 @@ namespace OTSMeasureApp
                                     poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
                                     a_listPropItems.Add(poPropItem);
 
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection;
+                                    poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.BUTTON, true, bShow);
+                                    a_listPropItems.Add(poPropItem);
+
                                     break;
                                 case OTS_BGREMOVE_TYPE.MANUAL:
 
@@ -1031,6 +1041,10 @@ namespace OTSMeasureApp
                                     poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
                                     a_listPropItems.Add(poPropItem);
 
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection;
+                                    poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.BUTTON, true, bShow);
+                                    a_listPropItems.Add(poPropItem);
 
 
                                     break;
@@ -1356,7 +1370,7 @@ namespace OTSMeasureApp
 
                             poPropItem = new CPropItem();
                             nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE;
-                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.STRING, true, bShow);
+                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.BUTTON, true, bShow);
                             a_listPropItems.Add(poPropItem);
 
 
@@ -1436,6 +1450,11 @@ namespace OTSMeasureApp
                                     poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
                                     a_listPropItems.Add(poPropItem);
 
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection;
+                                    poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.BUTTON, true, bShow);
+                                    a_listPropItems.Add(poPropItem);
+
                                     break;
                                 case OTS_BGREMOVE_TYPE.MANUAL:
 
@@ -1470,6 +1489,11 @@ namespace OTSMeasureApp
 
 
 
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection;
+                                    poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.BUTTON, true, bShow);
+                                    a_listPropItems.Add(poPropItem);
+
                                     break;
 
                             }
@@ -1776,6 +1800,16 @@ namespace OTSMeasureApp
                             
                         }
 
+                    }
+                    break;
+                case OTS_ITEM_TYPES.BUTTON:
+                    {
+                        string StrVal = "";
+                        if (GetPropButtonData(ItemID, out StrVal))
+                        {
+                            valStr = StrVal;
+                        }
+
                     }
                     break;
                 case OTS_ITEM_TYPES.TIME:
@@ -1956,6 +1990,12 @@ namespace OTSMeasureApp
                     }
                     break;
 
+                case OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection:
+                    {
+                        a_strValue = m_poMsrParams.GetImageProcessParam().GetOtherSelection();
+                    }
+                    break;
+
                 default:
                     {
                         // something wrong, return false
@@ -1970,6 +2010,36 @@ namespace OTSMeasureApp
             return true;
         }
 
+        public bool GetPropButtonData(OTS_SAMPLE_PROP_GRID_ITEMS a_nId, out string a_strValue)
+        {
+            var m_poMsrParams = m_Sample.GetMsrParams();
+            var m_poSEMDataMsr = m_Sample.GetSEMDataMsr();
+            var m_Status = m_Sample.GetMsrStatus();
+            var m_poMsrResults = m_Sample.GetMsrResults();
+            switch (a_nId)
+            {
+                case OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE:
+                    {
+                        a_strValue = m_poMsrParams.GetImageScanParam().GetStopMode();
+                    }
+                    break;
+
+                case OTS_SAMPLE_PROP_GRID_ITEMS.OtherSelection:
+                    {
+                        a_strValue = m_poMsrParams.GetImageProcessParam().GetOtherSelection();
+                    }
+                    break;
+
+                default:
+                    {
+                        // something wrong, return false
+                        a_strValue = NOT_APPLIED;
+                        return false;
+                    }
+            }
+            return true;
+        }
+
         public bool GetPropComboData(OTS_SAMPLE_PROP_GRID_ITEMS a_nId, out int a_nValue)
         {
             var m_poMsrParams = m_Sample.GetMsrParams();

+ 18 - 2
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -39,6 +39,7 @@ namespace OTSMeasureApp
         public string m_ParameterPath;
 
         frmMeasureStopMode StopModeDialog;
+        _7_OTSProgMgrInfo.OtherSelectionForm otherSelectionForm;
         //国际化
         OTSCommon.Language lan;
         Hashtable table;
@@ -601,7 +602,7 @@ namespace OTSMeasureApp
             }
             //重叠尺寸
             IDC_EDIT_Overlap.Text = m_cotsimgprocprm.GetOverlapParam().ToString();
-
+            IDC_EDIT_OTHERSELECTION.Text = m_cotsimgprocprm.GetOtherSelection().ToString();
         }
 
         /// <summary>
@@ -784,7 +785,7 @@ namespace OTSMeasureApp
             //重叠像素
             m_cotsimgprocprm.SetOverlapParam(Convert.ToInt32(IDC_EDIT_Overlap.Text));
 
-         
+            m_cotsimgprocprm.SetOtherSelection(IDC_EDIT_OTHERSELECTION.Text);
         }
 
         /// <summary>
@@ -2026,6 +2027,21 @@ namespace OTSMeasureApp
         {
   
         }
+
+        private void btn_otherselection_Click(object sender, EventArgs e)
+        {
+            if (otherSelectionForm == null)
+            {
+                otherSelectionForm = new _7_OTSProgMgrInfo.OtherSelectionForm();
+                otherSelectionForm.OtherSelection = m_cotsimgprocprm.GetOtherSelection();
+            }
+            DialogResult result = otherSelectionForm.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                m_cotsimgprocprm.SetOtherSelection(otherSelectionForm.OtherSelection);
+                IDC_EDIT_OTHERSELECTION.Text = otherSelectionForm.OtherSelection;
+            }
+        }
     }
     public class ComboBoxItem
     {

File diff suppressed because it is too large
+ 283 - 156
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.designer.cs


+ 9 - 0
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -374,6 +374,12 @@
     <Compile Include="5-OTSMeasureStatuImageFun\SlopFocus.Designer.cs">
       <DependentUpon>SlopFocus.cs</DependentUpon>
     </Compile>
+    <Compile Include="7-OTSProgMgrInfo\OtherSelection.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="7-OTSProgMgrInfo\OtherSelection.Designer.cs">
+      <DependentUpon>OtherSelection.cs</DependentUpon>
+    </Compile>
     <Compile Include="7-OTSProgMgrInfo\SpecialParticleForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -600,6 +606,9 @@
     <EmbeddedResource Include="5-OTSMeasureStatuImageFun\SlopFocus.resx">
       <DependentUpon>SlopFocus.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="7-OTSProgMgrInfo\OtherSelection.resx">
+      <DependentUpon>OtherSelection.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="7-OTSProgMgrInfo\SpecialParticleForm.resx">
       <DependentUpon>SpecialParticleForm.cs</DependentUpon>
     </EmbeddedResource>

+ 2 - 2
OTSIncAMeasureApp/ResourceManage/ResourceData.cs

@@ -50,8 +50,8 @@ namespace OTSModelSharp.ResourceManage
         PARTICLE_GRAY_MAX = 20025,
         BGREMOVE_TYPE = 20026,
         AUTOBGREMOVE_TYPE = 20027,//Auto BGremove still has three types to choose
-       
-       
+        OtherSelection = 20029,
+
         ANALYSIS_RESOLUTION = 20032,
         XRAYSCAN_MODE = 20033,
         ANALYSIS_COUNTS = 20034,

Some files were not shown because too many files changed in this diff