Browse Source

联合结束方式阶段1

CXS 3 years ago
parent
commit
303d31bdc4

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

@@ -511,7 +511,7 @@ namespace OTSModelSharp
 
             // Set image scan param
             COTSImgScanPrm poImageScanParam = new COTSImgScanPrm();
-            poImageScanParam.SetStopMode(OTS_MEASURE_STOP_MODE.CoverMode);
+            poImageScanParam.SetStopMode(((int)OTS_MEASURE_STOP_MODE.CoverMode).ToString());
             poImageScanParam.SetStartImageMode(OTS_GET_IMAGE_MODE.FROM_CENTER);
             poImageScanParam.SetScanImageSpeed(OTS_IMAGE_SCANSPEED_OPTIONS.low);
             //poImageScanParam.SetImagePixelSize(OTS_FIVE_TIES_OPTIONS.TIE1);

+ 38 - 33
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -353,7 +353,7 @@ namespace OTSModelSharp
         {
           
 
-            int nStopMode = (int)a_pScanParam.GetStopMode();
+            string sStopMode = a_pScanParam.GetStopMode();
             int nStopField = a_pScanParam.GetStopParamFields();
 
             // completed fields number
@@ -382,41 +382,46 @@ namespace OTSModelSharp
             int nMeasTimeAim = a_pScanParam.GetStopParamMeasTime();
 
             bool bRet = true;
-            switch (nStopMode)
+
+            string[] str = sStopMode.Replace(" ", "").Split('+');
+            for(int i=0;i< str.Length;i++)
             {
-                case (int)OTS_MEASURE_STOP_MODE.CoverMode:
-                    // completed fields number
-                    if (nCompeltedField < a_nTotalFields)
-                    {
-                 
-                        bRet = false;
-                    }
-                    break;
-                case (int)OTS_MEASURE_STOP_MODE.FieldMode:
-                    if (nCompeltedField < nStopField)
-                    {
-                     
-                        bRet = false;
-                    }
-                    break;
-                case (int)OTS_MEASURE_STOP_MODE.ParticleMode:
+                switch (int.Parse(str[i].Split(':')[0]))
+                {
+                    case (int)OTS_MEASURE_STOP_MODE.CoverMode:
+                        // completed fields number
+                        if (nCompeltedField < a_nTotalFields)
+                        {
 
-                    if (nNumParticle < nParticlAim)
-                    {
-                    
-                        bRet = false;
-                    }
-                    break;
-                case (int)OTS_MEASURE_STOP_MODE.TimeMode:
+                            bRet = false;
+                        }
+                        break;
+                    case (int)OTS_MEASURE_STOP_MODE.FieldMode:
+                        if (nCompeltedField < nStopField)
+                        {
 
-                    if (nUsedTime < nMeasTimeAim)
-                    {
-                      
-                        bRet = false;
-                    }
-                    break;
-                default:
-                    break;
+                            bRet = false;
+                        }
+                        break;
+                    case (int)OTS_MEASURE_STOP_MODE.ParticleMode:
+
+                        if (nNumParticle < nParticlAim)
+                        {
+
+                            bRet = false;
+                        }
+                        break;
+                    case (int)OTS_MEASURE_STOP_MODE.TimeMode:
+
+                        if (nUsedTime < nMeasTimeAim)
+                        {
+
+                            bRet = false;
+                        }
+                        break;
+                    default:
+                        break;
+                }
             }
 
             return bRet;

+ 2 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/ParamData/OTSDefaultParam.cs

@@ -150,7 +150,8 @@ namespace OTSModelSharp
 
                 //image scan parameter
                 COTSImgScanPrm  pImageScanParam = new COTSImgScanPrm ();
-                pImageScanParam.SetStopMode(DataPublic.STOPT_MODE);
+
+                pImageScanParam.SetStopMode(((int)DataPublic.STOPT_MODE).ToString());
                 pImageScanParam.SetStopParamMeasTime(DataPublic.MEASURE_TIME);
                 pImageScanParam.SetStopParamFields(DataPublic.FIELDS_NUM);
                 pImageScanParam.SetStopParamParticles(DataPublic.PARTICL_NUM);

+ 20 - 7
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSImageScanParam.cs

@@ -10,7 +10,7 @@ namespace OTSDataType
 {
    public class COTSImgScanPrm : ISlo
     {
-        private OTS_MEASURE_STOP_MODE m_nStopMode;
+        private string m_nStopMode;
         private int m_nStopParamMeasTime;
         private int m_nStopParamFields;
         private int m_nStopParamParticles;
@@ -26,7 +26,7 @@ namespace OTSDataType
 
      
 
-        const OTS_MEASURE_STOP_MODE DEFUALT_MEASURE_STOP_MODE = OTS_MEASURE_STOP_MODE.CoverMode;
+        //const OTS_MEASURE_STOP_MODE DEFUALT_MEASURE_STOP_MODE = OTS_MEASURE_STOP_MODE.CoverMode;
 
         // stop parameters
          const int DEFUALT_PARAM_FIELD = 500;
@@ -44,7 +44,7 @@ namespace OTSDataType
         void Init()
         {
 
-            m_nStopMode = DEFUALT_MEASURE_STOP_MODE;                            //测量终止方式
+            m_nStopMode = ((int)OTS_MEASURE_STOP_MODE.CoverMode).ToString();                            //测量终止方式
             m_nStopParamMeasTime = DEFUALT_PARAM_TIME;                          //测量时间
             m_nStopParamFields = DEFUALT_PARAM_FIELD;                           //帧图数
             m_nStopParamParticles = DEFUALT_PARAM_PARTICLE;                     //夹杂物数
@@ -110,8 +110,8 @@ namespace OTSDataType
 
         //测量终止方式
 
-        public OTS_MEASURE_STOP_MODE GetStopMode() { return m_nStopMode; }
-        public void SetStopMode(OTS_MEASURE_STOP_MODE a_nStopMode) { m_nStopMode = a_nStopMode; }
+        public string GetStopMode() { return m_nStopMode; }
+        public void SetStopMode(string a_nStopMode) { m_nStopMode = a_nStopMode; }
 
         //测量时间
         public int GetStopParamMeasTime() { return m_nStopParamMeasTime; }
@@ -203,7 +203,14 @@ namespace OTSDataType
 
             if (isStoring)
             {
-                xnStopMode.AssignValue((int)m_nStopMode+":"+m_nStopMode.ToString());//
+                string[] st = m_nStopMode.Replace(" ","").Split('+');
+                string str = "";
+                for (int k = 0; k < st.Length; k++)
+                {
+                    str += st[k] + ":" + ((OTS_MEASURE_STOP_MODE)int.Parse(m_nStopMode)).ToString()+",";
+                }
+
+                xnStopMode.AssignValue(str.Substring(0, str.Length-1));//
                 xnStopParamMeasTime.AssignValue( m_nStopParamMeasTime);
                 xnStopParamFields.AssignValue(m_nStopParamFields);
                 xnStopParamParticles.AssignValue(m_nStopParamParticles);
@@ -223,7 +230,13 @@ namespace OTSDataType
             {
                 slo.Serialize(false, classDoc, rootNode);
 
-                m_nStopMode = (OTS_MEASURE_STOP_MODE)Convert.ToInt32(xnStopMode.value().Split(':')[0]);
+                string[] st = xnStopMode.value().Split(',');
+                string str = "";
+                for (int k = 0; k < st.Length; k++)
+                {
+                    str += st[k].Split(':')[0] + " + ";
+                }
+                m_nStopMode = str.Substring(0, str.Length - 3);
                 m_nStopParamMeasTime = xnStopParamMeasTime.value();
                 m_nStopParamFields = xnStopParamFields.value();
                 m_nStopParamParticles = xnStopParamParticles.value();

+ 89 - 124
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSSample.cs

@@ -940,70 +940,39 @@ namespace OTSDataType
                             
                                 poPropItem = new CPropItem();
                                 nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE;
-                                poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
+                                poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.STRING, true, bShow);
                                 a_listPropItems.Add(poPropItem);
-                           
-                            // stop parameter
-                            switch (m_poMsrParams.GetImageScanParam().GetStopMode())
-                            {
-                                case OTS_MEASURE_STOP_MODE.ParticleMode:
-                                    {
-                                        // particle
-                                       
-                                            poPropItem = new CPropItem();
-                                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_PARTICLE;
-                                            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
-                                            a_listPropItems.Add(poPropItem);
-                                       
-                                    }
-                                    break;
 
-                                case OTS_MEASURE_STOP_MODE.FieldMode:
-                                    {
-                                        // field
-                                        
-                                            poPropItem = new CPropItem();
-                                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_FIELD;
-                                            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
-                                            a_listPropItems.Add(poPropItem);
-                                       
-                                    }
-                                    break;
+                            //// stop parameter
 
-                                case OTS_MEASURE_STOP_MODE.TimeMode:
-                                    {
-                                        // used time
-                                       
-                                            poPropItem = new CPropItem();
-                                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_TIME;
-                                            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
-                                            a_listPropItems.Add(poPropItem);
-                                       
-                                    }
-                                    break;
+                            poPropItem = new CPropItem();
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_PARTICLE;
+                            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
+                            a_listPropItems.Add(poPropItem);
+                            // field
+                            poPropItem = new CPropItem();
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_FIELD;
+                            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
+                            a_listPropItems.Add(poPropItem);
+                            // used time
+                            poPropItem = new CPropItem();
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_TIME;
+                            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
+                            a_listPropItems.Add(poPropItem);
+                            // scan speed
 
-                                case OTS_MEASURE_STOP_MODE.CoverMode:
-                                default:
-                                    {
-                                        // no stop parameter item
-                                    }
-                                    break;
-                            }
+                            poPropItem = new CPropItem();
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.SCAN_SPEED;
+                            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
+                            a_listPropItems.Add(poPropItem);
 
-                            // scan speed
-                           
-                                poPropItem = new CPropItem();
-                                nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.SCAN_SPEED;
-                                poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
-                                a_listPropItems.Add(poPropItem);
-                          
                             // image resolution
-                           
-                                poPropItem = new CPropItem();
-                                nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.IMAGE_RESOLUTION;
-                                poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
-                                a_listPropItems.Add(poPropItem);
-                            
+
+                            poPropItem = new CPropItem();
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.IMAGE_RESOLUTION;
+                            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
+                            a_listPropItems.Add(poPropItem);
+
                         }
                         break;
 
@@ -1406,52 +1375,52 @@ namespace OTSDataType
                             poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
                             a_listPropItems.Add(poPropItem);
 
-                            // stop parameter
-                            switch (m_poMsrParams.GetImageScanParam().GetStopMode())
-                            {
-                                case OTS_MEASURE_STOP_MODE.ParticleMode:
-                                    {
-                                        // particle
-
-                                        poPropItem = new CPropItem();
-                                        nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_PARTICLE;
-                                        poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
-                                        a_listPropItems.Add(poPropItem);
-
-                                    }
-                                    break;
-
-                                case OTS_MEASURE_STOP_MODE.FieldMode:
-                                    {
-                                        // field
-
-                                        poPropItem = new CPropItem();
-                                        nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_FIELD;
-                                        poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
-                                        a_listPropItems.Add(poPropItem);
-
-                                    }
-                                    break;
-
-                                case OTS_MEASURE_STOP_MODE.TimeMode:
-                                    {
-                                        // used time
-
-                                        poPropItem = new CPropItem();
-                                        nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_TIME;
-                                        poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
-                                        a_listPropItems.Add(poPropItem);
-
-                                    }
-                                    break;
-
-                                case OTS_MEASURE_STOP_MODE.CoverMode:
-                                default:
-                                    {
-                                        // no stop parameter item
-                                    }
-                                    break;
-                            }
+                            //// stop parameter
+                            //switch (m_poMsrParams.GetImageScanParam().GetStopMode())
+                            //{
+                            //    case OTS_MEASURE_STOP_MODE.ParticleMode:
+                            //        {
+                            //            // particle
+
+                            //            poPropItem = new CPropItem();
+                            //            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_PARTICLE;
+                            //            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
+                            //            a_listPropItems.Add(poPropItem);
+
+                            //        }
+                            //        break;
+
+                            //    case OTS_MEASURE_STOP_MODE.FieldMode:
+                            //        {
+                            //            // field
+
+                            //            poPropItem = new CPropItem();
+                            //            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_FIELD;
+                            //            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
+                            //            a_listPropItems.Add(poPropItem);
+
+                            //        }
+                            //        break;
+
+                            //    case OTS_MEASURE_STOP_MODE.TimeMode:
+                            //        {
+                            //            // used time
+
+                            //            poPropItem = new CPropItem();
+                            //            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.STOP_PARAM_TIME;
+                            //            poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
+                            //            a_listPropItems.Add(poPropItem);
+
+                            //        }
+                            //        break;
+
+                            //    case OTS_MEASURE_STOP_MODE.CoverMode:
+                            //    default:
+                            //        {
+                            //            // no stop parameter item
+                            //        }
+                            //        break;
+                            //}
 
                             // scan speed
 
@@ -2107,6 +2076,12 @@ namespace OTSDataType
                     }
                     break;
 
+                case OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE:
+                    {
+                        a_strValue = m_poMsrParams.GetImageScanParam().GetStopMode();
+                    }
+                    break;
+
                 default:
                     {
                         // something wrong, return false
@@ -2136,6 +2111,16 @@ namespace OTSDataType
                     }
                     break;
 
+                case OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE:
+                    {
+                        if (m_poMsrParams.GetImageScanParam().GetStopMode() != a_strValue)
+                        {
+                            m_poMsrParams.GetImageScanParam().SetStopMode(a_strValue);
+                            m_Status = new CMsrSampleStatus();
+                        }
+                    }
+                    break;
+
                 // read only property, tread as default. 
                 case OTS_SAMPLE_PROP_GRID_ITEMS.SAMPLE_HOLE_NAME:
                 case OTS_SAMPLE_PROP_GRID_ITEMS.MAGNIFICATION:
@@ -2168,12 +2153,6 @@ namespace OTSDataType
                     }
                     break;
 
-                case OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE:
-                    {
-                        a_nValue = (int)m_poMsrParams.GetImageScanParam().GetStopMode();
-                    }
-                    break;
-
                 case OTS_SAMPLE_PROP_GRID_ITEMS.SCAN_SPEED:
                     {
                         a_nValue = (int)m_poMsrParams.GetImageScanParam().GetScanImageSpeed();
@@ -2262,20 +2241,6 @@ namespace OTSDataType
                     }
                     break;
 
-                case OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE:
-                    {
-                        if (OTS_MEASURE_STOP_MODE.CoverMode > (OTS_MEASURE_STOP_MODE)a_nValue || (OTS_MEASURE_STOP_MODE)a_nValue > OTS_MEASURE_STOP_MODE.TimeMode)
-                        {
-                            return false;
-                        }
-                        if (m_poMsrParams.GetImageScanParam().GetStopMode() != (OTS_MEASURE_STOP_MODE)a_nValue)
-                        {
-                            m_poMsrParams.GetImageScanParam().SetStopMode((OTS_MEASURE_STOP_MODE)a_nValue);
-                            m_Status.SetStatus(OTS_MSR_SAMPLE_STATUS.UNMEASURED);
-                        }
-                    }
-                    break;
-
                 case OTS_SAMPLE_PROP_GRID_ITEMS.SCAN_SPEED:
                     {
                         if (OTS_IMAGE_SCANSPEED_OPTIONS.low > (OTS_IMAGE_SCANSPEED_OPTIONS)a_nValue || (OTS_IMAGE_SCANSPEED_OPTIONS)a_nValue > OTS_IMAGE_SCANSPEED_OPTIONS.high)

+ 70 - 2
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSDisplaySampleGrid.cs

@@ -1,4 +1,5 @@
 using OTSDataType;
+using OTSMeasureApp._3_OTSDisplaySourceGridData;
 using OTSModelSharp.ResourceManage;
 using SourceGrid;
 using System;
@@ -55,9 +56,10 @@ namespace OTSMeasureApp
         public int m_PropWindow_Y = 0;
 
      //   int Cur_Grid_Rows = 0;           //临时用于计算用的grid行号
-        public static int Const_Grid_Row = 46;    //总行数
+        public static int Const_Grid_Row = 48;    //总行数
         public static int Const_Grid_Column = 3;   //总列数
 
+        MeasureStopMode StopModeDialog;
 
         //后台工作线程
         BackgroundWorker m_bgWorker = null;
@@ -99,7 +101,43 @@ namespace OTSMeasureApp
             m_linkClickEvent3 = new SourceGrid.Cells.Controllers.Button();
             m_linkClickEvent3.Executed += new EventHandler(CellLink_Click_Status);
         }
-      
+
+        /// <summary>
+        /// 帧结束方式事件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void clickEvent_Click(object sender, EventArgs e)
+        {
+            SourceGrid.CellContext context = (SourceGrid.CellContext)sender;
+            int i = context.Position.Row;
+            int j = context.Position.Column;
+
+            /// 保证鼠标点击的GRID行和列是有效的
+            if (i >= 0 && j >= 0)
+            {
+                if(StopModeDialog==null)
+                {
+                    StopModeDialog = new MeasureStopMode();
+                }
+                DialogResult result = StopModeDialog.ShowDialog();
+                
+                if (result == DialogResult.OK)
+                {   
+                    string[] rst= StopModeDialog.StopMode.Split(',');
+                    m_PropWindow.PropGrid[i, j].Value = "";
+                    for (int k=0;k< rst.Length;k++)
+                    {
+                        m_PropWindow.PropGrid[i, j].Value += rst[k].Split(':')[0] + " + ";
+                    }
+                    m_PropWindow.PropGrid[i, j].Value = m_PropWindow.PropGrid[i, j].Value.ToString().Substring(0, m_PropWindow.PropGrid[i, j].Value.ToString().Length-3);
+
+                    //m_SampleGrid.m_PropWindow.SampleGridInfoChange((OTS_SAMPLE_PROP_GRID_ITEMS)SampleId, ValType, objVal);
+                }
+            }
+            m_PropWindow.PropGrid.Refresh();
+        }
+
 
         //初始化工作线程
         private void InitWorkThread()
@@ -327,6 +365,36 @@ namespace OTSMeasureApp
                                 m_PropWindow.PropGrid[Row, 2].AddController(m_ChangeCellValEvent);
                             }
                         }
+                        else if(SampleID == OTS_SAMPLE_PROP_GRID_ITEMS.STOP_MODE)
+                        {
+                            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;
+
+                                //SourceGrid.Cells.Controllers.CustomEvents clickEvent = new SourceGrid.Cells.Controllers.CustomEvents();
+                                //clickEvent.Click += new EventHandler(clickEvent_Click);
+
+                                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;
+                            }
+                        }
                         else
                         {
                             if (null == m_PropWindow.PropGrid[Row, 2])

+ 25 - 2
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSPropertyWindow.cs

@@ -4,6 +4,7 @@ using System.Linq;
 using System.Windows.Forms;
 using OTS.WinFormsUI.Docking;
 using OTSDataType;
+using OTSMeasureApp._3_OTSDisplaySourceGridData;
 using OTSModelSharp.ResourceManage;
 
 namespace OTSMeasureApp
@@ -13,7 +14,7 @@ namespace OTSMeasureApp
 
         public OTSIncAMeasureAppForm m_MeasureAppForm = null;   
         public OTSDisplaySampleGrid m_SampleGrid = null;
-
+        MeasureStopMode StopModeDialog;
         public OTSPropertyWindow(OTSIncAMeasureAppForm MeasureAppForm)
         {
             InitializeComponent();
@@ -44,7 +45,8 @@ namespace OTSMeasureApp
             }
             m_SampleGrid.InitGrid();
             m_SampleGrid.ShowSampleInfoGrid(SampleInfo);
-            ;
+
+
             int iPropertyDisplayMode = m_MeasureAppForm.m_ProjParam.m_DefaultParam.GetGenParam().PropertyDisplayMode();
             if (iPropertyDisplayMode == 1)
             {
@@ -241,6 +243,27 @@ namespace OTSMeasureApp
             if(m_SampleGrid.m_ClickRow>=0 && m_SampleGrid.m_ClickColumn>=0)
             {
                 m_SampleGrid.SetGridTitleStatus();
+                if(m_SampleGrid.m_ClickRow==9&& m_SampleGrid.m_ClickColumn==2)
+                {
+                    if (StopModeDialog == null)
+                    {
+                        StopModeDialog = new MeasureStopMode();
+                    }
+                    DialogResult result = StopModeDialog.ShowDialog();
+
+                    if (result == DialogResult.OK)
+                    {
+                        string[] rst = StopModeDialog.StopMode.Split(',');
+                        string str="";
+                        for (int k = 0; k < rst.Length; k++)
+                        {
+                            str += rst[k].Split(':')[0] + " + ";
+                        }
+                        PropGrid[m_SampleGrid.m_ClickRow, m_SampleGrid.m_ClickColumn].Value = str.Substring(0, str.Length - 3);
+
+                        //m_SampleGrid.m_PropWindow.SampleGridInfoChange((OTS_SAMPLE_PROP_GRID_ITEMS)SampleId, ValType, objVal);
+                    }
+                }
             }
             
         }

+ 38 - 23
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -13,6 +13,7 @@ using static OTSModelSharp.ResourceManage.ResourceData;
 using static OTSDataType.otsdataconst;
 using OTSModelSharp.Measure.GetStageInfo;
 using OTSMeasureApp._0_OTSModel.Measure.ParamData;
+using OTSMeasureApp._3_OTSDisplaySourceGridData;
 
 namespace OTSMeasureApp
 {
@@ -36,6 +37,8 @@ namespace OTSMeasureApp
         public bool m_b_checkstagefile = false;
         //定位程序管理路径用的变量
         public string m_ParameterPath;
+
+        MeasureStopMode StopModeDialog;
         //国际化
         OTSSysMgrTools.Language lan;
         Hashtable table;
@@ -153,19 +156,19 @@ namespace OTSMeasureApp
             if (IDC_COMBO_YDIRECT.Items.Count > 0)
                 IDC_COMBO_YDIRECT.SelectedIndex = 0;
             this.IDC_COMBO_YDIRECT.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_YDIRECT_SelectedIndexChanged);
-            //测量终止方式
-            IDC_COMBO_STOPMODE.Items.Clear();
-            foreach (otsdataconst.OTS_MEASURE_STOP_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_MEASURE_STOP_MODE)))
-            {
-                ComboBoxItem cbi = new ComboBoxItem();
-                cbi.Text = GetStopModeIdString(enum_one);
-                cbi.Value = (int)enum_one;
-                IDC_COMBO_STOPMODE.Items.Add(cbi);
-            }
-            this.IDC_COMBO_STOPMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
-            if (IDC_COMBO_STOPMODE.Items.Count > 0)
-                IDC_COMBO_STOPMODE.SelectedIndex = 0;
-            this.IDC_COMBO_STOPMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
+            ////测量终止方式
+            //IDC_COMBO_STOPMODE.Items.Clear();
+            //foreach (otsdataconst.OTS_MEASURE_STOP_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_MEASURE_STOP_MODE)))
+            //{
+            //    ComboBoxItem cbi = new ComboBoxItem();
+            //    cbi.Text = GetStopModeIdString(enum_one);
+            //    cbi.Value = (int)enum_one;
+            //    IDC_COMBO_STOPMODE.Items.Add(cbi);
+            //}
+            //this.IDC_COMBO_STOPMODE.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
+            //if (IDC_COMBO_STOPMODE.Items.Count > 0)
+            //    IDC_COMBO_STOPMODE.SelectedIndex = 0;
+            //this.IDC_COMBO_STOPMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
             //取图方式
             IDC_COMBO_FETCHIMGMODE.Items.Clear();
             foreach (otsdataconst.OTS_GET_IMAGE_MODE enum_one in Enum.GetValues(typeof(otsdataconst.OTS_GET_IMAGE_MODE)))
@@ -448,14 +451,7 @@ namespace OTSMeasureApp
         {
 
             //测量终止方式
-            foreach (ComboBoxItem cbi in IDC_COMBO_STOPMODE.Items)
-            {
-                if (cbi.Value.ToString() != "")
-                    if (Convert.ToInt32(cbi.Value) == (int)m_cotsimgscanprm.GetStopMode())
-                    {
-                        IDC_COMBO_STOPMODE.SelectedItem = cbi;
-                    }
-            }
+            tB_StopMode.Text = m_cotsimgscanprm.GetStopMode().ToString();
             //终止时间
             IDC_EDIT_STOP_TIME.Text = m_cotsimgscanprm.GetStopParamMeasTime().ToString();
             //终止帧图数
@@ -713,8 +709,7 @@ namespace OTSMeasureApp
             //  保存图像扫描参数");
 
             //测量终止方式
-            ComboBoxItem enum_stopmode = (ComboBoxItem)IDC_COMBO_STOPMODE.SelectedItem;
-            m_cotsimgscanprm.SetStopMode((otsdataconst.OTS_MEASURE_STOP_MODE)Convert.ToInt32(enum_stopmode.Value));
+            m_cotsimgscanprm.SetStopMode(tB_StopMode.Text);
 
             //终止时间
             m_cotsimgscanprm.SetStopParamMeasTime(Convert.ToInt32(IDC_EDIT_STOP_TIME.Text));
@@ -2045,6 +2040,26 @@ namespace OTSMeasureApp
         {
             System.Diagnostics.Process.Start("notepad.exe",CSpecialGrayRangeParam.GetParamFileFullName());
         }
+
+        private void btn_StopMode_Click(object sender, EventArgs e)
+        {
+            if (StopModeDialog == null)
+            {
+                StopModeDialog = new MeasureStopMode();
+            }
+            DialogResult result = StopModeDialog.ShowDialog();
+
+            if (result == DialogResult.OK)
+            {
+                string[] rst = StopModeDialog.StopMode.Split(',');
+                string str = "";
+                for (int k = 0; k < rst.Length; k++)
+                {
+                    str += rst[k].Split(':')[0] + " + ";
+                }
+                tB_StopMode.Text = str.Substring(0, str.Length - 3);
+            }
+        }
     }
     public class ComboBoxItem
     {

+ 52 - 42
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.designer.cs

@@ -51,6 +51,8 @@
             this.label3 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.tB_StopMode = new System.Windows.Forms.TextBox();
+            this.btn_StopMode = new System.Windows.Forms.Button();
             this.IDC_EDIT_STOP_INCA_NUM = new System.Windows.Forms.TextBox();
             this.IDC_EDIT_STOP_FIELD_NUM = new System.Windows.Forms.TextBox();
             this.IDC_EDIT_STOP_TIME = new System.Windows.Forms.TextBox();
@@ -58,7 +60,6 @@
             this.IDC_COMBO_IMGSIZE = new System.Windows.Forms.ComboBox();
             this.IDC_COMBO_IMGSCANSPEED = new System.Windows.Forms.ComboBox();
             this.IDC_COMBO_FETCHIMGMODE = new System.Windows.Forms.ComboBox();
-            this.IDC_COMBO_STOPMODE = new System.Windows.Forms.ComboBox();
             this.label12 = new System.Windows.Forms.Label();
             this.label11 = new System.Windows.Forms.Label();
             this.label10 = new System.Windows.Forms.Label();
@@ -121,6 +122,8 @@
             this.IDC_BACK_MAX_SWITCH = new System.Windows.Forms.CheckBox();
             this.IDC_PART_MAX_SWITCH = new System.Windows.Forms.CheckBox();
             this.groupBox6 = new System.Windows.Forms.GroupBox();
+            this.IDC_EDIT_XrayLimit = new System.Windows.Forms.TextBox();
+            this.label47 = new System.Windows.Forms.Label();
             this.IDC_EDIT_SmallPartAQTime = new System.Windows.Forms.TextBox();
             this.label45 = new System.Windows.Forms.Label();
             this.label46 = new System.Windows.Forms.Label();
@@ -152,8 +155,6 @@
             this.lbModelSel = new System.Windows.Forms.Label();
             this.IDC_COMBO_Model = new System.Windows.Forms.ComboBox();
             this.groupBox7 = new System.Windows.Forms.GroupBox();
-            this.label47 = new System.Windows.Forms.Label();
-            this.IDC_EDIT_XrayLimit = new System.Windows.Forms.TextBox();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -402,6 +403,8 @@
             // 
             // groupBox3
             // 
+            this.groupBox3.Controls.Add(this.tB_StopMode);
+            this.groupBox3.Controls.Add(this.btn_StopMode);
             this.groupBox3.Controls.Add(this.IDC_EDIT_STOP_INCA_NUM);
             this.groupBox3.Controls.Add(this.IDC_EDIT_STOP_FIELD_NUM);
             this.groupBox3.Controls.Add(this.IDC_EDIT_STOP_TIME);
@@ -409,7 +412,6 @@
             this.groupBox3.Controls.Add(this.IDC_COMBO_IMGSIZE);
             this.groupBox3.Controls.Add(this.IDC_COMBO_IMGSCANSPEED);
             this.groupBox3.Controls.Add(this.IDC_COMBO_FETCHIMGMODE);
-            this.groupBox3.Controls.Add(this.IDC_COMBO_STOPMODE);
             this.groupBox3.Controls.Add(this.label12);
             this.groupBox3.Controls.Add(this.label11);
             this.groupBox3.Controls.Add(this.label10);
@@ -425,6 +427,24 @@
             this.groupBox3.TabStop = false;
             this.groupBox3.Text = "图像扫描参数";
             // 
+            // tB_StopMode
+            // 
+            this.tB_StopMode.Location = new System.Drawing.Point(129, 19);
+            this.tB_StopMode.Name = "tB_StopMode";
+            this.tB_StopMode.ReadOnly = true;
+            this.tB_StopMode.Size = new System.Drawing.Size(174, 25);
+            this.tB_StopMode.TabIndex = 372;
+            // 
+            // btn_StopMode
+            // 
+            this.btn_StopMode.Location = new System.Drawing.Point(309, 18);
+            this.btn_StopMode.Name = "btn_StopMode";
+            this.btn_StopMode.Size = new System.Drawing.Size(75, 23);
+            this.btn_StopMode.TabIndex = 371;
+            this.btn_StopMode.Text = "选择";
+            this.btn_StopMode.UseVisualStyleBackColor = true;
+            this.btn_StopMode.Click += new System.EventHandler(this.btn_StopMode_Click);
+            // 
             // IDC_EDIT_STOP_INCA_NUM
             // 
             this.IDC_EDIT_STOP_INCA_NUM.Location = new System.Drawing.Point(228, 106);
@@ -500,17 +520,6 @@
             this.IDC_COMBO_FETCHIMGMODE.TabIndex = 330;
             this.IDC_COMBO_FETCHIMGMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_FETCHIMGMODE_SelectedIndexChanged);
             // 
-            // IDC_COMBO_STOPMODE
-            // 
-            this.IDC_COMBO_STOPMODE.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.IDC_COMBO_STOPMODE.FormattingEnabled = true;
-            this.IDC_COMBO_STOPMODE.Location = new System.Drawing.Point(167, 20);
-            this.IDC_COMBO_STOPMODE.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.IDC_COMBO_STOPMODE.Name = "IDC_COMBO_STOPMODE";
-            this.IDC_COMBO_STOPMODE.Size = new System.Drawing.Size(217, 23);
-            this.IDC_COMBO_STOPMODE.TabIndex = 250;
-            this.IDC_COMBO_STOPMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_STOPMODE_SelectedIndexChanged);
-            // 
             // label12
             // 
             this.label12.AutoSize = true;
@@ -904,7 +913,7 @@
             // button1
             // 
             this.button1.Location = new System.Drawing.Point(23, 199);
-            this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button1.Margin = new System.Windows.Forms.Padding(4);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(260, 28);
             this.button1.TabIndex = 823;
@@ -1186,16 +1195,34 @@
             this.groupBox6.Location = new System.Drawing.Point(425, 94);
             this.groupBox6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.groupBox6.Name = "groupBox6";
-            this.groupBox6.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox6.Padding = new System.Windows.Forms.Padding(4);
             this.groupBox6.Size = new System.Drawing.Size(408, 234);
             this.groupBox6.TabIndex = 700;
             this.groupBox6.TabStop = false;
             this.groupBox6.Text = "X-ray参数";
             // 
+            // IDC_EDIT_XrayLimit
+            // 
+            this.IDC_EDIT_XrayLimit.Location = new System.Drawing.Point(188, 203);
+            this.IDC_EDIT_XrayLimit.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.IDC_EDIT_XrayLimit.MaxLength = 10;
+            this.IDC_EDIT_XrayLimit.Name = "IDC_EDIT_XrayLimit";
+            this.IDC_EDIT_XrayLimit.Size = new System.Drawing.Size(199, 25);
+            this.IDC_EDIT_XrayLimit.TabIndex = 834;
+            // 
+            // label47
+            // 
+            this.label47.AutoSize = true;
+            this.label47.Location = new System.Drawing.Point(12, 206);
+            this.label47.Name = "label47";
+            this.label47.Size = new System.Drawing.Size(67, 15);
+            this.label47.TabIndex = 833;
+            this.label47.Text = "数量限值";
+            // 
             // IDC_EDIT_SmallPartAQTime
             // 
             this.IDC_EDIT_SmallPartAQTime.Location = new System.Drawing.Point(189, 141);
-            this.IDC_EDIT_SmallPartAQTime.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.IDC_EDIT_SmallPartAQTime.Margin = new System.Windows.Forms.Padding(4);
             this.IDC_EDIT_SmallPartAQTime.MaxLength = 10;
             this.IDC_EDIT_SmallPartAQTime.Name = "IDC_EDIT_SmallPartAQTime";
             this.IDC_EDIT_SmallPartAQTime.Size = new System.Drawing.Size(155, 25);
@@ -1223,7 +1250,7 @@
             // IDC_EDIT_QuantifyMinSize
             // 
             this.IDC_EDIT_QuantifyMinSize.Location = new System.Drawing.Point(189, 79);
-            this.IDC_EDIT_QuantifyMinSize.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.IDC_EDIT_QuantifyMinSize.Margin = new System.Windows.Forms.Padding(4);
             this.IDC_EDIT_QuantifyMinSize.MaxLength = 10;
             this.IDC_EDIT_QuantifyMinSize.Name = "IDC_EDIT_QuantifyMinSize";
             this.IDC_EDIT_QuantifyMinSize.Size = new System.Drawing.Size(155, 25);
@@ -1332,7 +1359,7 @@
             // IDC_TEXTBOX_ANALYXRAYSPEED_TIME
             // 
             this.IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Location = new System.Drawing.Point(189, 109);
-            this.IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Margin = new System.Windows.Forms.Padding(4);
             this.IDC_TEXTBOX_ANALYXRAYSPEED_TIME.MaxLength = 10;
             this.IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Name = "IDC_TEXTBOX_ANALYXRAYSPEED_TIME";
             this.IDC_TEXTBOX_ANALYXRAYSPEED_TIME.Size = new System.Drawing.Size(155, 25);
@@ -1344,7 +1371,7 @@
             this.IDC_COMBO_ANALYXRAYSPEED.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.IDC_COMBO_ANALYXRAYSPEED.FormattingEnabled = true;
             this.IDC_COMBO_ANALYXRAYSPEED.Location = new System.Drawing.Point(48, 315);
-            this.IDC_COMBO_ANALYXRAYSPEED.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.IDC_COMBO_ANALYXRAYSPEED.Margin = new System.Windows.Forms.Padding(4);
             this.IDC_COMBO_ANALYXRAYSPEED.Name = "IDC_COMBO_ANALYXRAYSPEED";
             this.IDC_COMBO_ANALYXRAYSPEED.Size = new System.Drawing.Size(95, 23);
             this.IDC_COMBO_ANALYXRAYSPEED.TabIndex = 780;
@@ -1492,32 +1519,14 @@
             this.groupBox7.Controls.Add(this.lbModelSel);
             this.groupBox7.Controls.Add(this.IDC_COMBO_Model);
             this.groupBox7.Location = new System.Drawing.Point(8, 2);
-            this.groupBox7.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox7.Margin = new System.Windows.Forms.Padding(4);
             this.groupBox7.Name = "groupBox7";
-            this.groupBox7.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox7.Padding = new System.Windows.Forms.Padding(4);
             this.groupBox7.Size = new System.Drawing.Size(403, 71);
             this.groupBox7.TabIndex = 822;
             this.groupBox7.TabStop = false;
             this.groupBox7.Text = "模式选择";
             // 
-            // label47
-            // 
-            this.label47.AutoSize = true;
-            this.label47.Location = new System.Drawing.Point(12, 206);
-            this.label47.Name = "label47";
-            this.label47.Size = new System.Drawing.Size(67, 15);
-            this.label47.TabIndex = 833;
-            this.label47.Text = "数量限值";
-            // 
-            // IDC_EDIT_XrayLimit
-            // 
-            this.IDC_EDIT_XrayLimit.Location = new System.Drawing.Point(188, 203);
-            this.IDC_EDIT_XrayLimit.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.IDC_EDIT_XrayLimit.MaxLength = 10;
-            this.IDC_EDIT_XrayLimit.Name = "IDC_EDIT_XrayLimit";
-            this.IDC_EDIT_XrayLimit.Size = new System.Drawing.Size(199, 25);
-            this.IDC_EDIT_XrayLimit.TabIndex = 834;
-            // 
             // ProgMgrInfoForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -1622,7 +1631,6 @@
         public System.Windows.Forms.Button IDC_BUTTON_STAGE;
         public System.Windows.Forms.ComboBox IDC_COMBO_YDIRECT;
         public System.Windows.Forms.ComboBox IDC_COMBO_XDIREC;
-        public System.Windows.Forms.ComboBox IDC_COMBO_STOPMODE;
         public System.Windows.Forms.ComboBox IDC_COMBO_IMGSIZE;
         public System.Windows.Forms.ComboBox IDC_COMBO_IMGSCANSPEED;
         public System.Windows.Forms.ComboBox IDC_COMBO_FETCHIMGMODE;
@@ -1704,5 +1712,7 @@
         private System.Windows.Forms.Label label40;
         public System.Windows.Forms.TextBox IDC_EDIT_XrayLimit;
         private System.Windows.Forms.Label label47;
+        private System.Windows.Forms.TextBox tB_StopMode;
+        private System.Windows.Forms.Button btn_StopMode;
     }
 }

+ 9 - 0
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -247,6 +247,12 @@
     <Compile Include="0-OTSModel\OTSDataType\SEMStageData.cs" />
     <Compile Include="0-OTSModel\OTSDataType\XmlResourceData.cs" />
     <Compile Include="0-OTSModel\OTSDataType\XMLSerialization.cs" />
+    <Compile Include="3-OTSDisplaySourceGridData\MeasureStopMode.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="3-OTSDisplaySourceGridData\MeasureStopMode.Designer.cs">
+      <DependentUpon>MeasureStopMode.cs</DependentUpon>
+    </Compile>
     <Compile Include="5-OTSMeasureStatuImageFun\frmSpecialGrayParticle.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -445,6 +451,9 @@
     <EmbeddedResource Include="0-OTSModel\Measure\ParamData\DIALOG_CHECK_PARAM_RESULT.resx">
       <DependentUpon>DIALOG_CHECK_PARAM_RESULT.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="3-OTSDisplaySourceGridData\MeasureStopMode.resx">
+      <DependentUpon>MeasureStopMode.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="5-OTSMeasureStatuImageFun\Control_Ruler.resx">
       <DependentUpon>Control_Ruler.cs</DependentUpon>
     </EmbeddedResource>