triggerdef.c

来自「可编程器件厂商Xilinx的手持式逻辑分析仪的逻辑设计」· C语言 代码 · 共 969 行 · 第 1/4 页

C
969
字号
    }
    else
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh5StateHiBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh5StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh5StateLoBitMap));
    }

    /*========================================================================*/
    /* Set the Channel 4 Probe State Display to represent the current state.  */
    /* If this is not the initial display and the current and previous values */
    /* are different, the current state will be shown as a transition,        */
    /* otherwise a high or low level signal will be shown as is appropriate.  */
    /*========================================================================*/
    uiChnlState = (UInt8)(uiProbeState & 0x0010);
    uiPrevChnlState = (UInt8)(uiPreviousState & 0x0010);
    if (!bInitialDisplay && (uiChnlState != uiPrevChnlState))
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateHiBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateTransBitMap));
    }
    else if (uiChnlState)
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateHiBitMap));
    }
    else
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateHiBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh4StateLoBitMap));
    }

    /*========================================================================*/
    /* Set the Channel 3 Probe State Display to represent the current state.  */
    /* If this is not the initial display and the current and previous values */
    /* are different, the current state will be shown as a transition,        */
    /* otherwise a high or low level signal will be shown as is appropriate.  */
    /*========================================================================*/
    uiChnlState = (UInt8)(uiProbeState & 0x0008);
    uiPrevChnlState = (UInt8)(uiPreviousState & 0x08);
    if (!bInitialDisplay && (uiChnlState != uiPrevChnlState))
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateHiBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateTransBitMap));
    }
    else if (uiChnlState)
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateHiBitMap));
    }
    else
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateHiBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh3StateLoBitMap));
    }

    /*========================================================================*/
    /* Set the Channel 2 Probe State Display to represent the current state.  */
    /* If this is not the initial display and the current and previous values */
    /* are different, the current state will be shown as a transition,        */
    /* otherwise a high or low level signal will be shown as is appropriate.  */
    /*========================================================================*/
    uiChnlState = (UInt8)(uiProbeState & 0x0004);
    uiPrevChnlState = (UInt8)(uiPreviousState & 0x0004);
    if (!bInitialDisplay && (uiChnlState != uiPrevChnlState))
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateHiBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateTransBitMap));
    }
    else if (uiChnlState)
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateHiBitMap));
    }
    else
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateHiBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh2StateLoBitMap));
    }

    /*========================================================================*/
    /* Set the Channel 1 Probe State Display to represent the current state.  */
    /* If this is not the initial display and the current and previous values */
    /* are different, the current state will be shown as a transition,        */
    /* otherwise a high or low level signal will be shown as is appropriate.  */
    /*========================================================================*/
    uiChnlState = (UInt8)(uiProbeState & 0x02);
    uiPrevChnlState = (UInt8)(uiPreviousState & 0x02);
    if (!bInitialDisplay && (uiChnlState != uiPrevChnlState))
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateHiBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateTransBitMap));
    }
    else if (uiChnlState)
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateHiBitMap));
    }
    else
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateHiBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh1StateLoBitMap));
    }

    /*========================================================================*/
    /* Set the Channel 0 Probe State Display to represent the current state.  */
    /* If this is not the initial display and the current and previous values */
    /* are different, the current state will be shown as a transition,        */
    /* otherwise a high or low level signal will be shown as is appropriate.  */
    /*========================================================================*/
    uiChnlState = (UInt8)(uiProbeState & 0x0001);
    uiPrevChnlState = (UInt8)(uiPreviousState & 0x0001);
    if (!bInitialDisplay && (uiChnlState != uiPrevChnlState))
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateHiBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateTransBitMap));
    }
    else if (uiChnlState)
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateLoBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateHiBitMap));
    }
    else
    {
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateHiBitMap));
        FrmHideObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateTransBitMap));
        FrmShowObject(pFrm, FrmGetObjectIndex(pFrm,
                                              frmTrigDefCh0StateLoBitMap));
    }

    /*========================================================================*/
    /* Save the current probe state for use in detecting a transition on the  */
    /* next set of readings.                                                  */
    /*========================================================================*/
    uiPreviousState = uiProbeState;
}



/***********************************************************************
 *
 * FUNCTION:    TrigDefDoCommand
 *
 * DESCRIPTION: This routine performs the menu command specified.
 *
 * PARAMETERS:  command  - menu item id
 *
 * RETURNED:    nothing
 *
 * REVISION HISTORY:
 *
 *
 ***********************************************************************/
static Boolean TrigDefDoCommand(UInt16 command)
{
    Boolean handled = false;
    FormPtr pFrm;

    switch (command)
        {
        case OptionsHelp:
            MenuEraseStatus(0);                 /* Clear menu from display.   */
            pFrm = FrmGetActiveForm();
            FrmHelp (TrigDefHelpString);
            handled = true;
            break;
        case OptionsAboutPocketAnalyzer:
            MenuEraseStatus(0);                 /* Clear menu from display.   */
            pFrm = FrmInitForm (FrmAboutForm);
            FrmDoDialog (pFrm);                 /* Display the About Box.     */
            FrmDeleteForm (pFrm);
            handled = true;
            break;
        }

    return handled;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?