1. private void InitMultiStageSubPanel(TriggerMultiStageItem e)
    2. {
    3. //先判定和级联可选触发类型一样
    4. if (Acquire.Default.TSys.MultiStageSubType == TriggerMultiStageSubType.Qualified)
    5. InitQualifiedSubPanel();
    6. else
    7. InitMultiCascSubPanel(null, null);
    8. }
    9. private void InitMultiCascSubPanel(Object sender, EventArgs e)
    10. {
    11. Int32 i = 0;
    12. Int32 j = 0;
    13. Boolean[] PostEvent = { false, false, false, false };
    14. TriggerCascadedType[] TempType = new TriggerCascadedType[4];
    15. foreach (TriggerMultiStageItem Event in Acquire.Default.TSys.MultiStage.Events)
    16. {
    17. if (Event.Enabled)
    18. {
    19. TempType[i] = Event.CascType;
    20. PostEvent[i] = true;
    21. i++;
    22. }
    23. }
    24. for (j = 0; j < 3; j++)
    25. {
    26. if (TempType[j] != TriggerCascadedType.Edge)
    27. {
    28. for (i = j + 1; i < 4; i++)
    29. {
    30. if (TempType[j].Equals(TempType[i]))
    31. PostEvent[i] = false;
    32. }
    33. }
    34. }
    35. j = 0;
    36. for (i = 0; i < 4; i++)
    37. {
    38. j++;
    39. if (PostEvent[i])
    40. {
    41. switch (TempType[i])
    42. {
    43. case TriggerCascadedType.Window:
    44. //currentsubparameter = null;
    45. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 8);
    46. break;
    47. case TriggerCascadedType.Interval:
    48. //currentsubparameter = null;
    49. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 1);
    50. break;
    51. case TriggerCascadedType.Glitch:
    52. //currentsubparameter = null;
    53. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 2);
    54. break;
    55. case TriggerCascadedType.Dropout:
    56. //currentsubparameter = null;
    57. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 3);
    58. break;
    59. case TriggerCascadedType.Runt:
    60. //currentsubparameter = null;
    61. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 4);
    62. break;
    63. case TriggerCascadedType.SlewRate:
    64. //currentsubparameter = null;
    65. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 5);
    66. break;
    67. case TriggerCascadedType.Edge:
    68. //currentsubparameter = null;
    69. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, j + 11);
    70. break;
    71. case TriggerCascadedType.PulseWidth:
    72. //currentsubparameter = null;
    73. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 9);
    74. break;
    75. case TriggerCascadedType.Pattern:
    76. //currentsubparameter = null;
    77. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 10);
    78. break;
    79. }
    80. }
    81. }
    82. //if (Acquire.Default.TSys.MultiStageSubType == TriggerMultiStageSubType.Cascaded)
    83. // PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 17);
    84. }
    85. private void InitQualifiedSubPanel()
    86. {
    87. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 0);
    88. switch (Acquire.Default.TSys.MultiStage.Events[0].QualType)
    89. {
    90. case TriggerQualifiedType.Edge:
    91. //currentsubparameter = null;
    92. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 12);
    93. break;
    94. case TriggerQualifiedType.State:
    95. //currentsubparameter = null;
    96. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 16);
    97. break;
    98. default:
    99. //currentsubparameter = null;
    100. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 10);
    101. break;
    102. }
    103. switch (Acquire.Default.TSys.MultiStage.Events[1].CascType)
    104. {
    105. case TriggerCascadedType.PulseWidth:
    106. //currentsubparameter = null;
    107. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 9);
    108. break;
    109. case TriggerCascadedType.Interval:
    110. //currentsubparameter = null;
    111. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 1);
    112. break;
    113. case TriggerCascadedType.Glitch:
    114. //currentsubparameter = null;
    115. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 2);
    116. break;
    117. default:
    118. //currentsubparameter = null;
    119. Acquire.Default.TSys.MultiStage.Events[1].CascType = TriggerCascadedType.Edge;
    120. //PostMessage(MainFormHandle, 0x0400/*WM_USER*/, 13, 13);
    121. break;
    122. }
    123. }
    124. UpdateMQInfo()