private void InitMultiStageSubPanel(TriggerMultiStageItem e)
{
//先判定和级联可选触发类型一样
if (Acquire.Default.TSys.MultiStageSubType == TriggerMultiStageSubType.Qualified)
InitQualifiedSubPanel();
else
InitMultiCascSubPanel(null, null);
}
private void InitMultiCascSubPanel(Object sender, EventArgs e)
{
Int32 i = 0;
Int32 j = 0;
Boolean[] PostEvent = { false, false, false, false };
TriggerCascadedType[] TempType = new TriggerCascadedType[4];
foreach (TriggerMultiStageItem Event in Acquire.Default.TSys.MultiStage.Events)
{
if (Event.Enabled)
{
TempType[i] = Event.CascType;
PostEvent[i] = true;
i++;
}
}
for (j = 0; j < 3; j++)
{
if (TempType[j] != TriggerCascadedType.Edge)
{
for (i = j + 1; i < 4; i++)
{
if (TempType[j].Equals(TempType[i]))
PostEvent[i] = false;
}
}
}
j = 0;
for (i = 0; i < 4; i++)
{
j++;
if (PostEvent[i])
{
switch (TempType[i])
{
case TriggerCascadedType.Window:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 8);
break;
case TriggerCascadedType.Interval:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 1);
break;
case TriggerCascadedType.Glitch:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 2);
break;
case TriggerCascadedType.Dropout:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 3);
break;
case TriggerCascadedType.Runt:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 4);
break;
case TriggerCascadedType.SlewRate:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 5);
break;
case TriggerCascadedType.Edge:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, j + 11);
break;
case TriggerCascadedType.PulseWidth:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 9);
break;
case TriggerCascadedType.Pattern:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 10);
break;
}
}
}
//if (Acquire.Default.TSys.MultiStageSubType == TriggerMultiStageSubType.Cascaded)
// PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 17);
}
private void InitQualifiedSubPanel()
{
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 0);
switch (Acquire.Default.TSys.MultiStage.Events[0].QualType)
{
case TriggerQualifiedType.Edge:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 12);
break;
case TriggerQualifiedType.State:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 16);
break;
default:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 10);
break;
}
switch (Acquire.Default.TSys.MultiStage.Events[1].CascType)
{
case TriggerCascadedType.PulseWidth:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 9);
break;
case TriggerCascadedType.Interval:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 1);
break;
case TriggerCascadedType.Glitch:
//currentsubparameter = null;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 2);
break;
default:
//currentsubparameter = null;
Acquire.Default.TSys.MultiStage.Events[1].CascType = TriggerCascadedType.Edge;
//PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 13);
break;
}
}
UpdateMQInfo()