mainform.c
来自「可编程器件厂商Xilinx的手持式逻辑分析仪的逻辑设计」· C语言 代码 · 共 1,395 行 · 第 1/5 页
C
1,395 行
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
xPosEnd = xPosBegin;
yPosEnd = PlotPixelY + TraceAmp;
WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
}
else if (CurrValue[0] == true)
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
WinDrawPixel (xPosBegin, yPosBegin);
}
else
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY + TraceAmp;
WinDrawPixel (xPosBegin, yPosBegin);
WinDrawPixel (xPosBegin, (yPosBegin -1));
}
PrevValue[0] = CurrValue[0];
PlotPixelY += (TraceAmp + InterSpc);
}
else
{
CtlHideControl(GetObjectPtr(frmMainCh0LabelButton));
}
/*============================================================*/
/* Do Channel 1 if it is active. */
/*============================================================*/
if (AppPrefs.bChnlOn[1] == true)
{
CtlHideControl(GetObjectPtr(frmMainCh1LabelButton));
FrmSetObjectPosition(pFrm,
FrmGetObjectIndex(pFrm, frmMainCh1LabelButton),
0, PlotPixelY);
CtlShowControl(GetObjectPtr(frmMainCh1LabelButton));
if (CurrValue[1] != PrevValue[1])
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
xPosEnd = xPosBegin;
yPosEnd = PlotPixelY + TraceAmp;
WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
}
else if (CurrValue[1] == true)
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
WinDrawPixel (xPosBegin, yPosBegin);
}
else
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY + TraceAmp;
WinDrawPixel (xPosBegin, yPosBegin);
WinDrawPixel (xPosBegin, (yPosBegin -1));
}
PrevValue[1] = CurrValue[1];
PlotPixelY += (TraceAmp + InterSpc);
}
else
{
CtlHideControl(GetObjectPtr(frmMainCh1LabelButton));
}
/*============================================================*/
/* Do Channel 2 if it is active. */
/*============================================================*/
if (AppPrefs.bChnlOn[2] == true)
{
CtlHideControl(GetObjectPtr(frmMainCh2LabelButton));
FrmSetObjectPosition(pFrm,
FrmGetObjectIndex(pFrm, frmMainCh2LabelButton),
0, PlotPixelY);
CtlShowControl(GetObjectPtr(frmMainCh2LabelButton));
if (CurrValue[2] != PrevValue[2])
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
xPosEnd = xPosBegin;
yPosEnd = PlotPixelY + TraceAmp;
WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
}
else if (CurrValue[2] == true)
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
WinDrawPixel (xPosBegin, yPosBegin);
}
else
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY + TraceAmp;
WinDrawPixel (xPosBegin, yPosBegin);
WinDrawPixel (xPosBegin, (yPosBegin -1));
}
PrevValue[2] = CurrValue[2];
PlotPixelY += (TraceAmp + InterSpc);
}
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 = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
xPosEnd = xPosBegin;
yPosEnd = PlotPixelY + TraceAmp;
WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
}
else if (CurrValue[3] == true)
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
WinDrawPixel (xPosBegin, yPosBegin);
}
else
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY + TraceAmp;
WinDrawPixel (xPosBegin, yPosBegin);
WinDrawPixel (xPosBegin, (yPosBegin -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 = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
xPosEnd = xPosBegin;
yPosEnd = PlotPixelY + TraceAmp;
WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
}
else if (CurrValue[4] == true)
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
WinDrawPixel (xPosBegin, yPosBegin);
}
else
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY + TraceAmp;
WinDrawPixel (xPosBegin, yPosBegin);
WinDrawPixel (xPosBegin, (yPosBegin -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 = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
xPosEnd = xPosBegin;
yPosEnd = PlotPixelY + TraceAmp;
WinDrawLine (xPosBegin, yPosBegin, xPosEnd, yPosEnd);
}
else if (CurrValue[5] == true)
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY;
WinDrawPixel (xPosBegin, yPosBegin);
}
else
{
xPosBegin = 24 + ((UInt32)SmplIdx * 136 /
(PlotData.PlotToSmplIdx -
PlotData.PlotFromSmplIdx));
yPosBegin = PlotPixelY + TraceAmp;
WinDrawPixel (xPosBegin, yPosBegin);
WinDrawPixel (xPosBegin, (yPosBegin -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),
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?