+ //Grey background
+ painter.fillRect(rect(), QColor(60, 60, 60));
+ //Black foreground
+ painter.fillRect(plotRect, QColor(0, 0, 0));
+
+ // center line
+ int zeroHeight = plotRect.top() + (plotRect.bottom() - plotRect.top()) / 2;
+ painter.setPen(QColor(100, 100, 100));
+ painter.drawLine(plotRect.left(), zeroHeight, plotRect.right(), zeroHeight);
+ // plot X and Y grid lines
+ plotGridLines(&painter, plotRect);
+
+ //Start painting graph
+ if (showDemod && DemodBufferLen > 8) {
+ PlotDemod(DemodBuffer, DemodBufferLen,plotRect,infoRect,&painter,2,g_DemodStartIdx);
+ }
+ PlotGraph(s_Buff, GraphTraceLen,plotRect,infoRect,&painter,1);
+ PlotGraph(GraphBuffer, GraphTraceLen,plotRect,infoRect,&painter,0);
+ // End graph drawing
+
+ //Draw the cursors
+ if(CursorAPos > GraphStart && xCoordOf(CursorAPos, plotRect) < plotRect.right())
+ {
+ painter.setPen(QColor(255, 255, 0));
+ painter.drawLine(xCoordOf(CursorAPos, plotRect),plotRect.top(),xCoordOf(CursorAPos, plotRect),plotRect.bottom());
+ }
+ if(CursorBPos > GraphStart && xCoordOf(CursorBPos, plotRect) < plotRect.right())
+ {
+ painter.setPen(QColor(255, 0, 255));
+ painter.drawLine(xCoordOf(CursorBPos, plotRect),plotRect.top(),xCoordOf(CursorBPos, plotRect),plotRect.bottom());
+ }
+ if(CursorCPos > GraphStart && xCoordOf(CursorCPos, plotRect) < plotRect.right())
+ {
+ painter.setPen(QColor(255, 153, 0)); //orange
+ painter.drawLine(xCoordOf(CursorCPos, plotRect),plotRect.top(),xCoordOf(CursorCPos, plotRect),plotRect.bottom());
+ }
+ if(CursorDPos > GraphStart && xCoordOf(CursorDPos, plotRect) < plotRect.right())
+ {
+ painter.setPen(QColor(0, 0, 205)); //light blue
+ painter.drawLine(xCoordOf(CursorDPos, plotRect),plotRect.top(),xCoordOf(CursorDPos, plotRect),plotRect.bottom());
+ }
+
+ //Draw annotations
+ char str[200];
+ sprintf(str, "@%d dt=%d [%2.2f] zoom=%2.2f CursorAPos=%d CursorBPos=%d GridX=%d GridY=%d (%s) GridXoffset=%d",
+ GraphStart, CursorBPos - CursorAPos, (CursorBPos - CursorAPos)/CursorScaleFactor,
+ GraphPixelsPerPoint,CursorAPos,CursorBPos,PlotGridXdefault,PlotGridYdefault,GridLocked?"Locked":"Unlocked",GridOffset);