code style changes
This commit is contained in:
parent
f605c35935
commit
f55c669e5e
2 changed files with 6 additions and 3 deletions
|
@ -136,7 +136,7 @@ void AHistoryGraph::Update ( )
|
||||||
curDate = QDate::currentDate();
|
curDate = QDate::currentDate();
|
||||||
|
|
||||||
// set oldest date to draw
|
// 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
|
// get oldest date in history
|
||||||
QDate oldestDate = curDate.addDays ( 1 ); // one day in the future
|
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;
|
oldestDate = minDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int iNumDaysInHistory = -curDate.daysTo ( oldestDate ) + 1;
|
const int iNumDaysInHistory = -curDate.daysTo ( oldestDate ) + 1;
|
||||||
|
|
||||||
// draw frame of the graph
|
// draw frame of the graph
|
||||||
|
@ -166,7 +168,7 @@ void AHistoryGraph::Update ( )
|
||||||
for ( i = 0; i < iNumItemsForHistory; i++ )
|
for ( i = 0; i < iNumItemsForHistory; i++ )
|
||||||
{
|
{
|
||||||
// only use valid dates
|
// 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] );
|
AddMarker ( vHistoryDataFifo[i] );
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
/* Definitions ****************************************************************/
|
/* Definitions ****************************************************************/
|
||||||
// number of history items to store
|
// number of history items to store
|
||||||
#define NUM_ITEMS_HISTORY 4800
|
#define NUM_ITEMS_HISTORY 4800
|
||||||
|
|
||||||
// oldest item to draw
|
// oldest item to draw
|
||||||
#define MAX_DAYS_HISTORY 60
|
#define MAX_DAYS_HISTORY 60
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue