⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pocketanalyzer.c

📁 可编程器件厂商Xilinx的手持式逻辑分析仪的逻辑设计
💻 C
📖 第 1 页 / 共 3 页
字号:
    /*========================================================================*/
    /* Declare all local variables.                                           */
    /*========================================================================*/
    /***** None *****/

    /*========================================================================*/
    /* Write the saved preferences / saved-state information.  This data will */
    /* be backed up during a HotSync.                                         */
    /*========================================================================*/
    PrefSetAppPreferences (appFileCreator,
                           appPrefID,
                           appPrefVersionNum,
                           &AppPrefs,
                           sizeof(AppPrefs),
                           true);

    /*========================================================================*/
    /* Close all the open forms.                                              */
    /*========================================================================*/
    FrmCloseAllForms ();
}




/*============================================================================*/
/* Function:            AppEventLoop                                          */
/* Description:         This routine is the event loop for the PocketAnalyzer */
/*                      analyzer.                                             */
/*                                                                            */
/* Arguments:           None                                                  */
/* Returns:             None                                                  */
/* Globals affected:    None                                                  */
/* Hardware affected:   None                                                  */
/*                                                                            */
/*============================================================================*/
/* Change History:                                                            */
/*                                                                            */
/* ECO#:  ?                                                                   */
/* Change Date:  dd-mmm-yyyy                                                  */
/* Changed By:   ?                                                            */
/* Description of Change:  ?                                                  */
/*                                                                            */
/*============================================================================*/
static void AppEventLoop(void)
{
    /*========================================================================*/
    /* Declare all local variables.                                           */
    /*========================================================================*/
    UInt16 error;
    EventType event;

    /*========================================================================*/
    /* Loop until the application gets a Stop Event.                          */
    /*========================================================================*/
    do
    {
        /*====================================================================*/
        /* Get the next event from the event queue.  Wait forever if there is */
        /* not currently an event on the queue.                               */
        /*====================================================================*/
        EvtGetEvent(&event, EventLoopTimeout);

        /*====================================================================*/
        /* Let the System Event Handler have an opportunity to resolve the    */
        /* event.                                                             */
        /*====================================================================*/
        if (! SysHandleEvent(&event))
            /*================================================================*/
            /* If the System Event Handler did not resolve the event, then    */
            /* let the Menu Event Handler have an opportunity to resolve the  */
            /* event.                                                         */
            /*================================================================*/
            if (! MenuHandleEvent(0, &event, &error))
                /*============================================================*/
                /* If the Menu Event Handler id not resolve the event, then   */
                /* let the Event Handler for the currently active form have   */
                /* an opportunity to resolve the event.                       */
                /*============================================================*/
                if (! AppHandleEvent(&event))
                    FrmDispatchEvent(&event);

        /*====================================================================*/
        /* Reset the Auto-Off timer to prevent the HandSpring from shutting   */
        /* down while the application is running.                             */
        /*====================================================================*/
        EvtResetAutoOffTimer();

    } while (event.eType != appStopEvent);
}




/*============================================================================*/
/* Function:            AppHandleEvent                                        */
/* Description:         This routine handles the loading of the form resources*/
/*                      and setting their corresponding event handlers.       */
/*                                                                            */
/* Arguments:           pEvent = a pointer to an EventType structure          */
/* Returns:             bHandled = TRUE if the event is handled and should    */
/*                                 not be passed to a higher level handler.   */
/*                                 FALSE if the event was not handled and     */
/*                                 should be passed to the next higher level  */
/*                                 handler.                                   */
/* Globals affected:    None                                                  */
/* Hardware affected:   None                                                  */
/*                                                                            */
/*============================================================================*/
/* Change History:                                                            */
/*                                                                            */
/* ECO#:  ?                                                                   */
/* Change Date:  dd-mmm-yyyy                                                  */
/* Changed By:   ?                                                            */
/* Description of Change:  ?                                                  */
/*                                                                            */
/*============================================================================*/
static Boolean AppHandleEvent(EventPtr pEvent)
{
    /*========================================================================*/
    /* Declare all local variables.                                           */
    /*========================================================================*/
    UInt16 uiFormId;
    FormPtr pFrm;

    /*========================================================================*/
    /* If the event is a Form Load event, then set the initialize the form,   */
    /* set it to the active form, and set the appropriate form event handler. */
    /*========================================================================*/
    if (pEvent->eType == frmLoadEvent)
        {
        /*====================================================================*/
        /* Load the form resource by first getting its ID, then initializing  */
        /* it and finally setting it to be the active form.                   */
        /*====================================================================*/
        uiFormId = pEvent->data.frmLoad.formID;
        pFrm = FrmInitForm(uiFormId);
        FrmSetActiveForm(pFrm);

        /*====================================================================*/
        /* Based on the form that was loaded, set the appropriate form event  */
        /* handler.  The handler of the currently active form is called by    */
        /* FrmHandleEvent each time it receives an event.                     */
        /*====================================================================*/
        switch (uiFormId)
            {
            case FrmMainForm:
                FrmSetEventHandler (pFrm, MainFormHandleEvent);
                break;
            case FrmRunModeForm:
                FrmSetEventHandler (pFrm, RunModeHandleEvent);
                break;
            case FrmTrigDefForm:
                FrmSetEventHandler (pFrm, TrigDefHandleEvent);
                break;
            case FrmTimebaseSelectForm:
                FrmSetEventHandler (pFrm, TimebaseSelectHandleEvent);
                break;
            case FrmChnlSelectForm:
                FrmSetEventHandler (pFrm, ChannelSelectHandleEvent);
                break;
            case FrmCursorDataForm:
                FrmSetEventHandler (pFrm, CursorDataHandleEvent);
                break;
            case FrmPrefsForm:
                FrmSetEventHandler (pFrm, PrefsHandleEvent);
                break;
            default:
                ErrFatalDisplay("Invalid Form Load Event");
                break;
            }

        return(true);
        }
    return(false);
}

⌨️ 快捷键说明

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