~ubuntu-branches/ubuntu/saucy/goldencheetah/saucy

« back to all changes in this revision

Viewing changes to src/MetricAggregator.h

  • Committer: Package Import Robot
  • Author(s): KURASHIKI Satoru
  • Date: 2013-08-18 07:02:45 UTC
  • mfrom: (4.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130818070245-zgdvb47e1k3mtgil
Tags: 3.0-3
debian/control: remove needless dependency. (Closes: #719571)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#ifndef METRICAGGREGATOR_H_
21
21
#define METRICAGGREGATOR_H_
 
22
#include "GoldenCheetah.h"
22
23
 
23
24
#include <QMap>
24
25
#include "RideFile.h"
29
30
#include "SummaryMetrics.h"
30
31
#include "MainWindow.h"
31
32
#include "DBAccess.h"
 
33
#include "Colors.h"
32
34
 
33
 
class MetricAggregator : public QWidget
 
35
class MetricAggregator : public QObject
34
36
{
35
37
    Q_OBJECT
 
38
    G_OBJECT
 
39
 
36
40
 
37
41
        public:
38
42
        MetricAggregator(MainWindow *, QDir , const Zones *, const HrZones *);
39
43
                ~MetricAggregator();
40
44
 
41
45
 
42
 
                void refreshMetrics();
 
46
        void refreshMetrics();
 
47
        void refreshMetrics(QDateTime forceAfterThisDate);
43
48
        void getFirstLast(QDate &, QDate &);
 
49
        DBAccess *db() { return dbaccess; }
 
50
        SummaryMetrics getAllMetricsFor(QString filename); // for a single ride
44
51
        QList<SummaryMetrics> getAllMetricsFor(QDateTime start, QDateTime end);
 
52
        QList<SummaryMetrics> getAllMetricsFor(DateRange);
 
53
        QList<SummaryMetrics> getAllMeasuresFor(QDateTime start, QDateTime end);
 
54
        QList<SummaryMetrics> getAllMeasuresFor(DateRange);
 
55
        SummaryMetrics getRideMetrics(QString filename);
 
56
        void writeAsCSV(QString filename); // export all...
 
57
 
 
58
    signals:
 
59
        void dataChanged(); // when metricDB table changed
45
60
 
46
61
    public slots:
47
 
        void update() { main->isclean = false; }
 
62
        void update();
 
63
        void addRide(RideItem*);
 
64
        void importMeasure(SummaryMetrics *sm);
48
65
 
49
66
    private:
50
67
        MainWindow *main;
51
68
        DBAccess *dbaccess;
52
69
        QDir home;
53
70
        const Zones *zones;
54
 
        const HrZones *hrZones;
 
71
        const HrZones *hrzones;
55
72
 
56
73
            typedef QHash<QString,RideMetric*> MetricMap;
57
74
            bool importRide(QDir path, RideFile *ride, QString fileName, unsigned long, bool modify);
58
75
            MetricMap metrics;
 
76
        ColorEngine *colorEngine;
59
77
};
60
78
 
61
79
#endif /* METRICAGGREGATOR_H_ */