X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=src%2Fharbour-pedalo.cpp;h=f19a8fcc0dd56df91b931f93cf487a1af889fa72;hp=729edae2592b4825ca93f4bfefa4f45454b85e26;hb=e6c4099f5bb1565a770e55d1dd671d846dcbd68b;hpb=41ee443df2b12e7a4373be580006f57cc5fd768a diff --git a/src/harbour-pedalo.cpp b/src/harbour-pedalo.cpp index 729edae..f19a8fc 100644 --- a/src/harbour-pedalo.cpp +++ b/src/harbour-pedalo.cpp @@ -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", ¤tStatus); + ctxt->setContextProperty("statsmodel", &statsmodel); view->show(); int result = app->exec();