server logging: fix for weekend grid in server history graph

This commit is contained in:
Volker Fischer 2009-10-23 14:58:14 +00:00
parent f4427db93e
commit 62d3b3f4a4

View file

@ -36,7 +36,7 @@ CHistoryGraph::CHistoryGraph() :
iYAxisEnd ( 24 ), iYAxisEnd ( 24 ),
iNumTicksY ( 5 ), iNumTicksY ( 5 ),
iGridFrameOffset ( 10 ), iGridFrameOffset ( 10 ),
iGridWidthWeekend ( 4 ), // should be even iGridWidthWeekend ( 3 ), // should be odd value
iTextOffsetToGrid ( 3 ), iTextOffsetToGrid ( 3 ),
iXAxisTextHeight ( 22 ), iXAxisTextHeight ( 22 ),
iMarkerSizeNewCon ( 11 ), iMarkerSizeNewCon ( 11 ),
@ -134,7 +134,12 @@ void CHistoryGraph::DrawFrame ( const int iNewNumTicksX )
iBottomExtraTickLen = 5; iBottomExtraTickLen = 5;
} }
// grid (different grid width for weekends) // regular grid
PlotPainter.setPen ( PlotGridColor );
PlotPainter.drawLine ( iCurX, 1 + PlotGridFrame.y(),
iCurX, PlotGridFrame.bottom() + iBottomExtraTickLen );
// different grid width for weekends (overwrite regular grid)
if ( ( curXAxisDate.dayOfWeek() == 6 ) || if ( ( curXAxisDate.dayOfWeek() == 6 ) ||
( curXAxisDate.dayOfWeek() == 7 ) ) ( curXAxisDate.dayOfWeek() == 7 ) )
{ {
@ -142,15 +147,7 @@ void CHistoryGraph::DrawFrame ( const int iNewNumTicksX )
PlotPainter.setPen ( QPen ( PlotGridColor, iGridWidthWeekend ) ); PlotPainter.setPen ( QPen ( PlotGridColor, iGridWidthWeekend ) );
PlotPainter.drawLine ( iCurX, 1 + PlotGridFrame.y() + iGridWidthWeekendHalf, PlotPainter.drawLine ( iCurX, 1 + PlotGridFrame.y() + iGridWidthWeekendHalf,
iCurX, PlotGridFrame.bottom() - iGridWidthWeekendHalf + 1 + iCurX, PlotGridFrame.bottom() - iGridWidthWeekendHalf );
iBottomExtraTickLen );
}
else
{
// regular grid
PlotPainter.setPen ( PlotGridColor );
PlotPainter.drawLine ( iCurX, 1 + PlotGridFrame.y(),
iCurX, PlotGridFrame.bottom() + iBottomExtraTickLen );
} }
} }