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

📄 mainform.c

📁 可编程器件厂商Xilinx的手持式逻辑分析仪的逻辑设计
💻 C
📖 第 1 页 / 共 5 页
字号:
            }
            else
            {
                CtlHideControl(GetObjectPtr(frmMainCh2LabelButton));
            }

            /*================================================================*/
            /* Do Channel 3 if it is active.                                  */
            /*================================================================*/
            if (AppPrefs.bChnlOn[3] == true)
            {
                CtlHideControl(GetObjectPtr(frmMainCh3LabelButton));
                FrmSetObjectPosition(pFrm,
                                FrmGetObjectIndex(pFrm, frmMainCh3LabelButton),
                                0, PlotPixelY);
                CtlShowControl(GetObjectPtr(frmMainCh3LabelButton));

                if (CurrValue[3] != PrevValue[3])
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }

                if (CurrValue[3] == true)
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }
                else
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY + TraceAmp;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                    WinDrawLine (xPosBegin, (yPosBegin-1), xPosEnd, (yPosEnd-1));
                }

                PrevValue[3] = CurrValue[3];
                PlotPixelY += (TraceAmp + InterSpc);
            }
            else
            {
                CtlHideControl(GetObjectPtr(frmMainCh3LabelButton));
            }

            /*================================================================*/
            /* Do Channel 4 if it is active.                                  */
            /*================================================================*/
            if (AppPrefs.bChnlOn[4] == true)
            {
                CtlHideControl(GetObjectPtr(frmMainCh4LabelButton));
                FrmSetObjectPosition(pFrm,
                                FrmGetObjectIndex(pFrm, frmMainCh4LabelButton),
                                0, PlotPixelY);
                CtlShowControl(GetObjectPtr(frmMainCh4LabelButton));

                if (CurrValue[4] != PrevValue[4])
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }

                if (CurrValue[4] == true)
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }
                else
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY + TraceAmp;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                    WinDrawLine (xPosBegin, (yPosBegin-1), xPosEnd, (yPosEnd-1));
                }

                PrevValue[4] = CurrValue[4];
                PlotPixelY += (TraceAmp + InterSpc);
            }
            else
            {
                CtlHideControl(GetObjectPtr(frmMainCh4LabelButton));
            }

            /*================================================================*/
            /* Do Channel 5 if it is active.                                  */
            /*================================================================*/
            if (AppPrefs.bChnlOn[5] == true)
            {
                CtlHideControl(GetObjectPtr(frmMainCh5LabelButton));
                FrmSetObjectPosition(pFrm,
                                FrmGetObjectIndex(pFrm, frmMainCh5LabelButton),
                                0, PlotPixelY);
                CtlShowControl(GetObjectPtr(frmMainCh5LabelButton));

                if (CurrValue[5] != PrevValue[5])
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }

                if (CurrValue[5] == true)
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }
                else
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY + TraceAmp;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                    WinDrawLine (xPosBegin, (yPosBegin-1), xPosEnd, (yPosEnd-1));
                }

                PrevValue[5] = CurrValue[5];
                PlotPixelY += (TraceAmp + InterSpc);
            }
            else
            {
                CtlHideControl(GetObjectPtr(frmMainCh5LabelButton));
            }

            /*================================================================*/
            /* Do Channel 6 if it is active.                                  */
            /*================================================================*/
            if (AppPrefs.bChnlOn[6] == true)
            {
                CtlHideControl(GetObjectPtr(frmMainCh6LabelButton));
                FrmSetObjectPosition(pFrm,
                                FrmGetObjectIndex(pFrm, frmMainCh6LabelButton),
                                0, PlotPixelY);
                CtlShowControl(GetObjectPtr(frmMainCh6LabelButton));

                if (CurrValue[6] != PrevValue[6])
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }

                if (CurrValue[6] == true)
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }
                else
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY + TraceAmp;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                    WinDrawLine (xPosBegin, (yPosBegin-1), xPosEnd, (yPosEnd-1));
                }

                PrevValue[6] = CurrValue[6];
                PlotPixelY += (TraceAmp + InterSpc);
            }
            else
            {
                CtlHideControl(GetObjectPtr(frmMainCh6LabelButton));
            }

            /*================================================================*/
            /* Do Channel 7 if it is active.                                  */
            /*================================================================*/
            if (AppPrefs.bChnlOn[7] == true)
            {
                CtlHideControl(GetObjectPtr(frmMainCh7LabelButton));
                FrmSetObjectPosition(pFrm,
                                FrmGetObjectIndex(pFrm, frmMainCh7LabelButton),
                                0, PlotPixelY);
                CtlShowControl(GetObjectPtr(frmMainCh7LabelButton));

                if (CurrValue[7] != PrevValue[7])
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }

                if (CurrValue[7] == true)
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                }
                else
                {
                    xPosBegin = PlotPixelX;
                    yPosBegin = PlotPixelY + TraceAmp;
                    xPosEnd = PlotPixelX + (UInt8)PixelsPerSmpl;
                    yPosEnd = PlotPixelY + TraceAmp;
                    WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
                    WinDrawLine (xPosBegin, (yPosBegin-1), xPosEnd, (yPosEnd-1));
                }

                PlotPixelY += (TraceAmp + InterSpc);
                PrevValue[7] = CurrValue[7];
            }
            else
            {
                CtlHideControl(GetObjectPtr(frmMainCh7LabelButton));
            }

            PlotPixelX += (UInt8)(PixelsPerSmpl + 1);
        }
    }

    /*========================================================================*/
    /* If the data is going to be so dense that there will be multiple        */
    /* samples plotted per pixel, do it this way.                             */
    /*========================================================================*/
    else
    {
        /*====================================================================*/
        /* Plot the data.                                                     */
        /*====================================================================*/
        for (SmplIdx = PlotData.PlotFromSmplIdx;
             SmplIdx <= PlotData.PlotToSmplIdx; SmplIdx++)
        {
            PlotPixelY = 23 + TopSpc;

            /*================================================================*/
            /* Decode the individual channel values from the packed data byte.*/
            /*================================================================*/
            BytValue = PlotData.SmplData[SmplIdx];
            CurrValue[0] = ((BytValue & 0x01) != 0) ? true : false;
            CurrValue[1] = ((BytValue & 0x02) != 0) ? true : false;
            CurrValue[2] = ((BytValue & 0x04) != 0) ? true : false;
            CurrValue[3] = ((BytValue & 0x08) != 0) ? true : false;
            CurrValue[4] = ((BytValue & 0x10) != 0) ? true : false;
            CurrValue[5] = ((BytValue & 0x20) != 0) ? true : false;
            CurrValue[6] = ((BytValue & 0x40) != 0) ? true : false;
            CurrValue[7] = ((BytValue & 0x80) != 0) ? true : false;

            /*============================================================*/
            /* Do Channel 0 if it is active.                              */
            /*============================================================*/
            if (AppPrefs.bChnlOn[0] == true)
            {
                CtlHideControl(GetObjectPtr(frmMainCh0LabelButton));
                FrmSetObjectPosition(pFrm,
                                FrmGetObjectIndex(pFrm, frmMainCh0LabelButton),
                                0, PlotPixelY);
                CtlShowControl(GetObjectPtr(frmMainCh0LabelButton));

                if (CurrValue[0] != PrevValue[0])

⌨️ 快捷键说明

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