|
|
@@ -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
|