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

📄 channelselect.c

📁 可编程器件厂商Xilinx的手持式逻辑分析仪的逻辑设计
💻 C
📖 第 1 页 / 共 2 页
字号:
                        ChnlCnt++;
                    }
                    else
                        AppPrefs.bChnlOn[3] = false;

                    /*========================================================*/
                    /* Save the value of the Channel 2 display state to the   */
                    /* applications preferences structure.                    */
                    /*========================================================*/
                    bValue = CtlGetValue (
                             GetObjectPtr(frmChnlSelectCh2SelectCheckbox));
                    if (bValue == true)
                    {
                        AppPrefs.bChnlOn[2] = true;
                        ChnlCnt++;
                    }
                    else
                        AppPrefs.bChnlOn[2] = false;

                    /*========================================================*/
                    /* Save the value of the Channel 1 display state to the   */
                    /* applications preferences structure.                    */
                    /*========================================================*/
                    bValue = CtlGetValue (
                             GetObjectPtr(frmChnlSelectCh1SelectCheckbox));
                    if (bValue == true)
                    {
                        AppPrefs.bChnlOn[1] = true;
                        ChnlCnt++;
                    }
                    else
                        AppPrefs.bChnlOn[1] = false;

                    /*========================================================*/
                    /* Save the value of the Channel 0 display state to the   */
                    /* applications preferences structure.                    */
                    /*========================================================*/
                    bValue = CtlGetValue (
                             GetObjectPtr(frmChnlSelectCh0SelectCheckbox));
                    if (bValue == true)
                    {
                        AppPrefs.bChnlOn[0] = true;
                        ChnlCnt++;
                    }
                    else
                        AppPrefs.bChnlOn[0] = false;

                    /*========================================================*/
                    /* Store the number of active channels and call the       */
                    /* function that sets the drawing coordinates for each of */
                    /* the active channels.                                   */
                    /*========================================================*/
                    AppPrefs.ActiveChnlCnt = ChnlCnt;

                    FrmGotoForm (FrmMainForm);
                    bHandled = true;
                    break;

                /*============================================================*/
                /* The user has selected to discard the modified data and     */
                /* then return to the Main Screen.                            */
                /*============================================================*/
                case frmChnlSelectCancelButton:
                    FrmGotoForm (FrmMainForm);
                    bHandled = true;
                    break;
            }
        }
    return bHandled;
}




/***********************************************************************
 *
 * FUNCTION:    ChannelSelectFormInit
 *
 * DESCRIPTION: This routine initializes the ChannelSelect form.
 *
 * PARAMETERS:  frm - pointer to the ChannelSelect form.
 *
 * RETURNED:    nothing
 *
 * REVISION HISTORY:
 *
 *
 ***********************************************************************/
static void ChannelSelectFormInit(FormPtr /*frmP*/)
{
    /*========================================================================*/
    /* Check or Uncheck the Channel 0 display object based on the value in    */
    /* the Applications Preferences.                                          */
    /*========================================================================*/
    if (AppPrefs.bChnlOn[0] == true)
        CtlSetValue (GetObjectPtr (frmChnlSelectCh0SelectCheckbox), true);
    else
        CtlSetValue (GetObjectPtr (frmChnlSelectCh0SelectCheckbox), false);

    /*========================================================================*/
    /* Check or Uncheck the Channel 1 display object based on the value in    */
    /* the Applications Preferences.                                          */
    /*========================================================================*/
    if (AppPrefs.bChnlOn[1] == true)
        CtlSetValue (GetObjectPtr (frmChnlSelectCh1SelectCheckbox), true);
    else
        CtlSetValue (GetObjectPtr (frmChnlSelectCh1SelectCheckbox), false);

    /*========================================================================*/
    /* Check or Uncheck the Channel 2 display object based on the value in    */
    /* the Applications Preferences.                                          */
    /*========================================================================*/
    if (AppPrefs.bChnlOn[2] == true)
        CtlSetValue (GetObjectPtr (frmChnlSelectCh2SelectCheckbox), true);
    else
        CtlSetValue (GetObjectPtr (frmChnlSelectCh2SelectCheckbox), false);

    /*========================================================================*/
    /* Check or Uncheck the Channel 3 display object based on the value in    */
    /* the Applications Preferences.                                          */
    /*========================================================================*/
    if (AppPrefs.bChnlOn[3] == true)
        CtlSetValue (GetObjectPtr (frmChnlSelectCh3SelectCheckbox), true);
    else
        CtlSetValue (GetObjectPtr (frmChnlSelectCh3SelectCheckbox), false);

    /*========================================================================*/
    /* Check or Uncheck the Channel 4 display object based on the value in    */
    /* the Applications Preferences.                                          */
    /*========================================================================*/
    if (AppPrefs.bChnlOn[4] == true)
        CtlSetValue (GetObjectPtr (frmChnlSelectCh4SelectCheckbox), true);
    else
        CtlSetValue (GetObjectPtr (frmChnlSelectCh4SelectCheckbox), false);

    /*========================================================================*/
    /* Check or Uncheck the Channel 5 display object based on the value in    */
    /* the Applications Preferences.                                          */
    /*========================================================================*/
    if (AppPrefs.bChnlOn[5] == true)
        CtlSetValue (GetObjectPtr (frmChnlSelectCh5SelectCheckbox), true);
    else
        CtlSetValue (GetObjectPtr (frmChnlSelectCh5SelectCheckbox), false);

    /*========================================================================*/
    /* Check or Uncheck the Channel 6 display object based on the value in    */
    /* the Applications Preferences.                                          */
    /*========================================================================*/
    if (AppPrefs.bChnlOn[6] == true)
        CtlSetValue (GetObjectPtr (frmChnlSelectCh6SelectCheckbox), true);
    else
        CtlSetValue (GetObjectPtr (frmChnlSelectCh6SelectCheckbox), false);

    /*========================================================================*/
    /* Check or Uncheck the Channel 7 display object based on the value in    */
    /* the Applications Preferences.                                          */
    /*========================================================================*/
    if (AppPrefs.bChnlOn[7] == true)
        CtlSetValue (GetObjectPtr (frmChnlSelectCh7SelectCheckbox), true);
    else
        CtlSetValue (GetObjectPtr (frmChnlSelectCh7SelectCheckbox), false);
}




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

    switch (command)
        {
        case OptionsHelp:
            MenuEraseStatus(0);                 /* Clear menu from display.   */
            pFrm = FrmGetActiveForm();
            FrmHelp (ChnlSelectHelpString);
            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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -