code style changes

This commit is contained in:
Volker Fischer 2020-03-21 09:54:43 +01:00
parent f605c35935
commit f55c669e5e
2 changed files with 6 additions and 3 deletions

View file

@ -136,7 +136,7 @@ void AHistoryGraph::Update ( )
curDate = QDate::currentDate();
// set oldest date to draw
QDate minDate = curDate.addDays ( MAX_DAYS_HISTORY * -1 );
QDate minDate = curDate.addDays ( MAX_DAYS_HISTORY * -1 );
// get oldest date in history
QDate oldestDate = curDate.addDays ( 1 ); // one day in the future
@ -153,10 +153,12 @@ void AHistoryGraph::Update ( )
}
}
}
if (oldestDate < minDate)
if ( oldestDate < minDate )
{
oldestDate = minDate;
}
const int iNumDaysInHistory = -curDate.daysTo ( oldestDate ) + 1;
// draw frame of the graph
@ -166,7 +168,7 @@ void AHistoryGraph::Update ( )
for ( i = 0; i < iNumItemsForHistory; i++ )
{
// only use valid dates
if ( vHistoryDataFifo[i].DateTime.date().isValid() && oldestDate <= vHistoryDataFifo[i].DateTime.date() )
if ( vHistoryDataFifo[i].DateTime.date().isValid() && ( oldestDate <= vHistoryDataFifo[i].DateTime.date() ) )
{
AddMarker ( vHistoryDataFifo[i] );
}

View file

@ -45,6 +45,7 @@
/* Definitions ****************************************************************/
// number of history items to store
#define NUM_ITEMS_HISTORY 4800
// oldest item to draw
#define MAX_DAYS_HISTORY 60