Browse Source

修改 stopmode 传输值为结构体对应int值+1

CXS 3 years ago
parent
commit
b2d51efef7

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

@@ -386,7 +386,7 @@ namespace OTSModelSharp
             string[] str = sStopMode.Replace(" ", "").Split('+');
             string[] str = sStopMode.Replace(" ", "").Split('+');
             for(int i=0;i< str.Length;i++)
             for(int i=0;i< str.Length;i++)
             {
             {
-                switch (int.Parse(str[i].Split(':')[0]))
+                switch (int.Parse(str[i].Split(':')[0])-1)
                 {
                 {
                     case (int)OTS_MEASURE_STOP_MODE.CoverMode:
                     case (int)OTS_MEASURE_STOP_MODE.CoverMode:
                         // completed fields number
                         // completed fields number

+ 3 - 3
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSImageScanParam.cs

@@ -44,7 +44,7 @@ namespace OTSDataType
         void Init()
         void Init()
         {
         {
 
 
-            m_nStopMode = ((int)OTS_MEASURE_STOP_MODE.CoverMode).ToString();                            //测量终止方式
+            m_nStopMode = ((int)OTS_MEASURE_STOP_MODE.CoverMode+1).ToString();                            //测量终止方式
             m_nStopParamMeasTime = DEFUALT_PARAM_TIME;                          //测量时间
             m_nStopParamMeasTime = DEFUALT_PARAM_TIME;                          //测量时间
             m_nStopParamFields = DEFUALT_PARAM_FIELD;                           //帧图数
             m_nStopParamFields = DEFUALT_PARAM_FIELD;                           //帧图数
             m_nStopParamParticles = DEFUALT_PARAM_PARTICLE;                     //夹杂物数
             m_nStopParamParticles = DEFUALT_PARAM_PARTICLE;                     //夹杂物数
@@ -207,7 +207,7 @@ namespace OTSDataType
                 string str = "";
                 string str = "";
                 for (int k = 0; k < st.Length; k++)
                 for (int k = 0; k < st.Length; k++)
                 {
                 {
-                    str += st[k] + ":" + ((OTS_MEASURE_STOP_MODE)int.Parse(st[k])).ToString()+",";
+                    str += (int.Parse(st[k]) - 1).ToString() + ":" + ((OTS_MEASURE_STOP_MODE)int.Parse(st[k])-1).ToString()+",";
                 }
                 }
 
 
                 xnStopMode.AssignValue(str.Substring(0, str.Length-1));//
                 xnStopMode.AssignValue(str.Substring(0, str.Length-1));//
@@ -234,7 +234,7 @@ namespace OTSDataType
                 string str = "";
                 string str = "";
                 for (int k = 0; k < st.Length; k++)
                 for (int k = 0; k < st.Length; k++)
                 {
                 {
-                    str += st[k].Split(':')[0] + " + ";
+                    str += (int.Parse(st[k].Split(':')[0])+1) + " + ";
                 }
                 }
                 m_nStopMode = str.Substring(0, str.Length - 3);
                 m_nStopMode = str.Substring(0, str.Length - 3);
                 m_nStopParamMeasTime = xnStopParamMeasTime.value();
                 m_nStopParamMeasTime = xnStopParamMeasTime.value();

+ 15 - 15
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/MeasureStopMode.Designer.cs

@@ -44,23 +44,23 @@ namespace OTSMeasureApp._3_OTSDisplaySourceGridData
             // cB_FieldMode
             // cB_FieldMode
             // 
             // 
             this.cB_FieldMode.AutoSize = true;
             this.cB_FieldMode.AutoSize = true;
-            this.cB_FieldMode.Location = new System.Drawing.Point(55, 39);
+            this.cB_FieldMode.Location = new System.Drawing.Point(50, 84);
             this.cB_FieldMode.Name = "cB_FieldMode";
             this.cB_FieldMode.Name = "cB_FieldMode";
             this.cB_FieldMode.Size = new System.Drawing.Size(120, 19);
             this.cB_FieldMode.Size = new System.Drawing.Size(120, 19);
             this.cB_FieldMode.TabIndex = 0;
             this.cB_FieldMode.TabIndex = 0;
-            this.cB_FieldMode.Text = "1.终止帧图数";
+            this.cB_FieldMode.Text = "2.终止帧图数";
             this.cB_FieldMode.UseVisualStyleBackColor = true;
             this.cB_FieldMode.UseVisualStyleBackColor = true;
             // 
             // 
             // tB_FieldMode
             // tB_FieldMode
             // 
             // 
-            this.tB_FieldMode.Location = new System.Drawing.Point(223, 37);
+            this.tB_FieldMode.Location = new System.Drawing.Point(218, 82);
             this.tB_FieldMode.Name = "tB_FieldMode";
             this.tB_FieldMode.Name = "tB_FieldMode";
             this.tB_FieldMode.Size = new System.Drawing.Size(164, 25);
             this.tB_FieldMode.Size = new System.Drawing.Size(164, 25);
             this.tB_FieldMode.TabIndex = 1;
             this.tB_FieldMode.TabIndex = 1;
             // 
             // 
             // tB_ParticleMode
             // tB_ParticleMode
             // 
             // 
-            this.tB_ParticleMode.Location = new System.Drawing.Point(223, 82);
+            this.tB_ParticleMode.Location = new System.Drawing.Point(218, 127);
             this.tB_ParticleMode.Name = "tB_ParticleMode";
             this.tB_ParticleMode.Name = "tB_ParticleMode";
             this.tB_ParticleMode.Size = new System.Drawing.Size(164, 25);
             this.tB_ParticleMode.Size = new System.Drawing.Size(164, 25);
             this.tB_ParticleMode.TabIndex = 3;
             this.tB_ParticleMode.TabIndex = 3;
@@ -68,16 +68,16 @@ namespace OTSMeasureApp._3_OTSDisplaySourceGridData
             // cB_ParticleMode
             // cB_ParticleMode
             // 
             // 
             this.cB_ParticleMode.AutoSize = true;
             this.cB_ParticleMode.AutoSize = true;
-            this.cB_ParticleMode.Location = new System.Drawing.Point(55, 84);
+            this.cB_ParticleMode.Location = new System.Drawing.Point(50, 129);
             this.cB_ParticleMode.Name = "cB_ParticleMode";
             this.cB_ParticleMode.Name = "cB_ParticleMode";
             this.cB_ParticleMode.Size = new System.Drawing.Size(135, 19);
             this.cB_ParticleMode.Size = new System.Drawing.Size(135, 19);
             this.cB_ParticleMode.TabIndex = 2;
             this.cB_ParticleMode.TabIndex = 2;
-            this.cB_ParticleMode.Text = "2.终止夹杂物数";
+            this.cB_ParticleMode.Text = "3.终止夹杂物数";
             this.cB_ParticleMode.UseVisualStyleBackColor = true;
             this.cB_ParticleMode.UseVisualStyleBackColor = true;
             // 
             // 
             // tB_TimeMode
             // tB_TimeMode
             // 
             // 
-            this.tB_TimeMode.Location = new System.Drawing.Point(223, 128);
+            this.tB_TimeMode.Location = new System.Drawing.Point(218, 173);
             this.tB_TimeMode.Name = "tB_TimeMode";
             this.tB_TimeMode.Name = "tB_TimeMode";
             this.tB_TimeMode.Size = new System.Drawing.Size(164, 25);
             this.tB_TimeMode.Size = new System.Drawing.Size(164, 25);
             this.tB_TimeMode.TabIndex = 5;
             this.tB_TimeMode.TabIndex = 5;
@@ -85,21 +85,21 @@ namespace OTSMeasureApp._3_OTSDisplaySourceGridData
             // cB_TimeMode
             // cB_TimeMode
             // 
             // 
             this.cB_TimeMode.AutoSize = true;
             this.cB_TimeMode.AutoSize = true;
-            this.cB_TimeMode.Location = new System.Drawing.Point(55, 130);
+            this.cB_TimeMode.Location = new System.Drawing.Point(50, 175);
             this.cB_TimeMode.Name = "cB_TimeMode";
             this.cB_TimeMode.Name = "cB_TimeMode";
             this.cB_TimeMode.Size = new System.Drawing.Size(136, 19);
             this.cB_TimeMode.Size = new System.Drawing.Size(136, 19);
             this.cB_TimeMode.TabIndex = 4;
             this.cB_TimeMode.TabIndex = 4;
-            this.cB_TimeMode.Text = "3.终止时间(秒)";
+            this.cB_TimeMode.Text = "4.终止时间(秒)";
             this.cB_TimeMode.UseVisualStyleBackColor = true;
             this.cB_TimeMode.UseVisualStyleBackColor = true;
             // 
             // 
             // cB_CoverMode
             // cB_CoverMode
             // 
             // 
             this.cB_CoverMode.AutoSize = true;
             this.cB_CoverMode.AutoSize = true;
-            this.cB_CoverMode.Location = new System.Drawing.Point(55, 176);
+            this.cB_CoverMode.Location = new System.Drawing.Point(50, 42);
             this.cB_CoverMode.Name = "cB_CoverMode";
             this.cB_CoverMode.Name = "cB_CoverMode";
             this.cB_CoverMode.Size = new System.Drawing.Size(135, 19);
             this.cB_CoverMode.Size = new System.Drawing.Size(135, 19);
             this.cB_CoverMode.TabIndex = 6;
             this.cB_CoverMode.TabIndex = 6;
-            this.cB_CoverMode.Text = "0.覆盖测量区域";
+            this.cB_CoverMode.Text = "1.覆盖测量区域";
             this.cB_CoverMode.UseVisualStyleBackColor = true;
             this.cB_CoverMode.UseVisualStyleBackColor = true;
             // 
             // 
             // groupBox1
             // groupBox1
@@ -114,16 +114,16 @@ namespace OTSMeasureApp._3_OTSDisplaySourceGridData
             this.groupBox1.Controls.Add(this.tB_ParticleMode);
             this.groupBox1.Controls.Add(this.tB_ParticleMode);
             this.groupBox1.Location = new System.Drawing.Point(12, 12);
             this.groupBox1.Location = new System.Drawing.Point(12, 12);
             this.groupBox1.Name = "groupBox1";
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(452, 246);
+            this.groupBox1.Size = new System.Drawing.Size(458, 252);
             this.groupBox1.TabIndex = 7;
             this.groupBox1.TabIndex = 7;
             this.groupBox1.TabStop = false;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "测量结束方式";
             this.groupBox1.Text = "测量结束方式";
             // 
             // 
             // bt_ok
             // bt_ok
             // 
             // 
-            this.bt_ok.Location = new System.Drawing.Point(316, 191);
+            this.bt_ok.Location = new System.Drawing.Point(340, 213);
             this.bt_ok.Name = "bt_ok";
             this.bt_ok.Name = "bt_ok";
-            this.bt_ok.Size = new System.Drawing.Size(119, 39);
+            this.bt_ok.Size = new System.Drawing.Size(112, 33);
             this.bt_ok.TabIndex = 7;
             this.bt_ok.TabIndex = 7;
             this.bt_ok.Text = "确 定";
             this.bt_ok.Text = "确 定";
             this.bt_ok.UseVisualStyleBackColor = true;
             this.bt_ok.UseVisualStyleBackColor = true;
@@ -133,7 +133,7 @@ namespace OTSMeasureApp._3_OTSDisplaySourceGridData
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(478, 269);
+            this.ClientSize = new System.Drawing.Size(482, 276);
             this.ControlBox = false;
             this.ControlBox = false;
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.groupBox1);
             this.MaximizeBox = false;
             this.MaximizeBox = false;

+ 9 - 9
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/MeasureStopMode.cs

@@ -86,22 +86,23 @@ namespace OTSMeasureApp._3_OTSDisplaySourceGridData
             }
             }
 
 
             m_StopMode = "";
             m_StopMode = "";
+            if (cB_CoverMode.Checked)
+            {
+                m_StopMode += (int)OTS_MEASURE_STOP_MODE.CoverMode+1 + " + ";
+            }
             if (cB_FieldMode.Checked)
             if (cB_FieldMode.Checked)
             {
             {
-                m_StopMode += (int)OTS_MEASURE_STOP_MODE.FieldMode + " + ";
+                m_StopMode += (int)OTS_MEASURE_STOP_MODE.FieldMode+1 + " + ";
             }
             }
             if (cB_ParticleMode.Checked)
             if (cB_ParticleMode.Checked)
             {
             {
-                m_StopMode += (int)OTS_MEASURE_STOP_MODE.ParticleMode + " + ";
+                m_StopMode += (int)OTS_MEASURE_STOP_MODE.ParticleMode+1 + " + ";
             }
             }
             if (cB_TimeMode.Checked)
             if (cB_TimeMode.Checked)
             {
             {
-                m_StopMode += (int)OTS_MEASURE_STOP_MODE.TimeMode + " + ";
-            }
-            if (cB_CoverMode.Checked)
-            {
-                m_StopMode += (int)OTS_MEASURE_STOP_MODE.CoverMode + " + ";
+                m_StopMode += (int)OTS_MEASURE_STOP_MODE.TimeMode+1 + " + ";
             }
             }
+            
             m_StopMode = m_StopMode.Substring(0, m_StopMode.Length -3);
             m_StopMode = m_StopMode.Substring(0, m_StopMode.Length -3);
 
 
 
 
@@ -141,10 +142,9 @@ namespace OTSMeasureApp._3_OTSDisplaySourceGridData
             tB_ParticleMode.Text = m_ParticleMode.ToString();
             tB_ParticleMode.Text = m_ParticleMode.ToString();
             tB_TimeMode.Text= m_TimeMode.ToString();
             tB_TimeMode.Text= m_TimeMode.ToString();
             string[] st = m_StopMode.Replace(" ", "").Split('+');
             string[] st = m_StopMode.Replace(" ", "").Split('+');
-            string str = "";
             for (int k = 0; k < st.Length; k++)
             for (int k = 0; k < st.Length; k++)
             {
             {
-                switch ((OTS_MEASURE_STOP_MODE)int.Parse(st[k]))
+                switch ((OTS_MEASURE_STOP_MODE)(int.Parse(st[k])-1))
                 {
                 {
                     case OTS_MEASURE_STOP_MODE.FieldMode: 
                     case OTS_MEASURE_STOP_MODE.FieldMode: 
                          { 
                          { 

+ 5 - 4
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSPropertyWindow.cs

@@ -284,10 +284,11 @@ namespace OTSMeasureApp
                 m_SampleGrid.SetGridTitleStatus();
                 m_SampleGrid.SetGridTitleStatus();
                 if(m_SampleGrid.m_ClickRow==9&& m_SampleGrid.m_ClickColumn==2)
                 if(m_SampleGrid.m_ClickRow==9&& m_SampleGrid.m_ClickColumn==2)
                 {
                 {
-                    if (StopModeDialog == null)
-                    {
-                        StopModeDialog = new MeasureStopMode();
-                    }
+                    StopModeDialog = new MeasureStopMode();
+                    //if (StopModeDialog == null)
+                    //{
+                        
+                    //}
                     StopModeDialog.FieldMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 2, m_SampleGrid.m_ClickColumn].Value.ToString());
                     StopModeDialog.FieldMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 2, m_SampleGrid.m_ClickColumn].Value.ToString());
                     StopModeDialog.TimeMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 3, m_SampleGrid.m_ClickColumn].Value.ToString());
                     StopModeDialog.TimeMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 3, m_SampleGrid.m_ClickColumn].Value.ToString());
                     StopModeDialog.ParticleMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 1, m_SampleGrid.m_ClickColumn].Value.ToString());
                     StopModeDialog.ParticleMode = int.Parse(PropGrid[m_SampleGrid.m_ClickRow + 1, m_SampleGrid.m_ClickColumn].Value.ToString());