Added new graphs
[harbour-pedalo.git] / src / harbour-pedalo.cpp
index 729edae..f19a8fc 100644 (file)
@@ -7,10 +7,15 @@
 
 #include "journey.h"
 #include "journeymodel.h"
+#include "statsmodel.h"
 #include "status.h"
 #include "settings.h"
 #include "imageprovider.h"
 #include "graph.h"
+#include "statsweekdayave.h"
+#include "statshourjourneys.h"
+#include "statsweekdaycongestion.h"
+#include "statshourcongestion.h"
 
 #include "harbour-pedalo.h"
 
@@ -43,6 +48,20 @@ int main(int argc, char *argv[])
     Settings::getInstance().setMainStatus(currentStatus);
     Settings::getInstance().loadSettings();
 
+    StatsModel statsmodel;
+
+    StatsWeekdayAve statsweekdayave(&journeys);
+    statsmodel.addStats(statsweekdayave);
+
+    StatsHourJourneys statshourjourneys(&journeys);
+    statsmodel.addStats(statshourjourneys);
+
+    StatsWeekdayCongestion statsweekdaycongestion(&journeys);
+    statsmodel.addStats(statsweekdaycongestion);
+
+    StatsHourCongestion statshourcongestion(&journeys);
+    statsmodel.addStats(statshourcongestion);
+
     QFile file;
     file.setFileName(Settings::getConfigDir() + "/journeys.csv");
     journeys.importFromFile(file);
@@ -61,6 +80,7 @@ int main(int argc, char *argv[])
 
     ctxt->setContextProperty("journeymodel", &journeys);
     ctxt->setContextProperty("currentStatus", &currentStatus);
+    ctxt->setContextProperty("statsmodel", &statsmodel);
 
     view->show();
     int result = app->exec();