From 4cac0e935b36ec16b6d1b437f615c15c1d16d069 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 22 Mar 2020 20:24:30 +0100 Subject: [PATCH] code style changes --- src/global.h | 2 +- src/historygraph.cpp | 8 ++++---- src/historygraph.h | 6 +++--- src/main.cpp | 3 +-- src/serverlogging.cpp | 8 -------- src/serverlogging.h | 6 +++++- 6 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/global.h b/src/global.h index 7e20b385..4fad8793 100755 --- a/src/global.h +++ b/src/global.h @@ -92,7 +92,7 @@ LED bar: lbr // file name for logging file #define DEFAULT_LOG_FILE_NAME "Jamulussrvlog.txt" -// Default oldest item to draw in history graph (days ago) +// default oldest item to draw in history graph (days ago) #define DEFAULT_DAYS_HISTORY 60 // default server address diff --git a/src/historygraph.cpp b/src/historygraph.cpp index 6c118245..175e9de2 100644 --- a/src/historygraph.cpp +++ b/src/historygraph.cpp @@ -27,7 +27,7 @@ /* Abstract class *************************************************************/ -AHistoryGraph::AHistoryGraph( const int iMaxDaysHistory ) : +AHistoryGraph::AHistoryGraph ( const int iMaxDaysHistory ) : sFileName ( "" ), bDoHistory ( false ), vHistoryDataFifo ( NUM_ITEMS_HISTORY ), @@ -137,7 +137,7 @@ void AHistoryGraph::Update ( ) curDate = QDate::currentDate(); // set oldest date to draw - QDate minDate = curDate.addDays ( iHistMaxDays * -1 ); + QDate minDate = curDate.addDays ( iHistMaxDays * -1 ); // get oldest date in history QDate oldestDate = curDate.addDays ( 1 ); // one day in the future @@ -299,7 +299,7 @@ void AHistoryGraph::AddMarker ( const SHistoryData& curHistoryData ) /* JPEG History Graph implementation ******************************************/ -CJpegHistoryGraph::CJpegHistoryGraph( const int iMaxDaysHistory ) : +CJpegHistoryGraph::CJpegHistoryGraph ( const int iMaxDaysHistory ) : AHistoryGraph ( iMaxDaysHistory ), PlotPixmap ( 1, 1, QImage::Format_RGB32 ), iAxisFontWeight ( -1 ) @@ -404,7 +404,7 @@ void CJpegHistoryGraph::point ( const unsigned int x, const unsigned int y, cons /* SVG History Graph implementation *******************************************/ -CSvgHistoryGraph::CSvgHistoryGraph( const int iMaxDaysHistory ) : +CSvgHistoryGraph::CSvgHistoryGraph ( const int iMaxDaysHistory ) : AHistoryGraph ( iMaxDaysHistory ), svgImage ( "" ), svgStreamWriter ( &svgImage ) diff --git a/src/historygraph.h b/src/historygraph.h index c60ed6d6..1a5709b4 100644 --- a/src/historygraph.h +++ b/src/historygraph.h @@ -58,7 +58,7 @@ public: HIT_SERVER_STOP }; - AHistoryGraph( const int iMaxDaysHistory ); + AHistoryGraph ( const int iMaxDaysHistory ); ~AHistoryGraph() { } void Start ( const QString& sNewFileName ); @@ -139,7 +139,7 @@ class CJpegHistoryGraph : public QObject, virtual public AHistoryGraph Q_OBJECT public: - CJpegHistoryGraph( const int iMaxDaysHistory ); + CJpegHistoryGraph ( const int iMaxDaysHistory ); virtual void Update ( ); protected: @@ -163,7 +163,7 @@ class CSvgHistoryGraph : public QObject, virtual public AHistoryGraph Q_OBJECT public: - CSvgHistoryGraph( const int iMaxDaysHistory ); + CSvgHistoryGraph ( const int iMaxDaysHistory ); virtual void Update(); protected: diff --git a/src/main.cpp b/src/main.cpp index a4506fe5..dc6e3edc 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -130,8 +130,7 @@ int main ( int argc, char** argv ) } - - // Maximum days in history display ------------------------------------ + // Maximum days in history display ------------------------------------- if ( GetNumericArgument ( tsConsole, argc, argv, diff --git a/src/serverlogging.cpp b/src/serverlogging.cpp index e3c42a4d..3b70096f 100755 --- a/src/serverlogging.cpp +++ b/src/serverlogging.cpp @@ -25,14 +25,6 @@ #include "serverlogging.h" // Server logging -------------------------------------------------------------- -CServerLogging::CServerLogging( const int iMaxDaysHistory ) : - JpegHistoryGraph ( iMaxDaysHistory ), - SvgHistoryGraph ( iMaxDaysHistory ), - bDoLogging ( false ), - File ( DEFAULT_LOG_FILE_NAME ) -{ -} - CServerLogging::~CServerLogging() { // close logging file of open diff --git a/src/serverlogging.h b/src/serverlogging.h index fbef06e3..15137abc 100755 --- a/src/serverlogging.h +++ b/src/serverlogging.h @@ -38,7 +38,11 @@ class CServerLogging { public: - CServerLogging( const int iMaxDaysHistory ); + CServerLogging ( const int iMaxDaysHistory ) : + JpegHistoryGraph ( iMaxDaysHistory ), + SvgHistoryGraph ( iMaxDaysHistory ), + bDoLogging ( false ), + File ( DEFAULT_LOG_FILE_NAME ) {} virtual ~CServerLogging();