summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/perioddayeventmodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/domain/perioddayeventmodel.h')
-rw-r--r--framework/src/domain/perioddayeventmodel.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/framework/src/domain/perioddayeventmodel.h b/framework/src/domain/perioddayeventmodel.h
index cd26fe46..5f493bbe 100644
--- a/framework/src/domain/perioddayeventmodel.h
+++ b/framework/src/domain/perioddayeventmodel.h
@@ -30,22 +30,22 @@
30 30
31#include <limits> 31#include <limits>
32 32
33// Facility used to get a restricted view into a Sink model comprised of 33// Facility used to get a restricted period into a Sink model comprised of
34// events, partitioned according to the day the events take place. 34// events, partitioned according to the day the events take place.
35// 35//
36// Model Format 36// Model Format
37// ============ 37// ============
38// 38//
39// Day 0 39// Day 0
40// |--- Event 0 starting at `viewStart + 0d` 40// |--- Event 0 starting at `periodStart + 0d`
41// |--- Event 1 starting at `viewStart + 0d` 41// |--- Event 1 starting at `periodStart + 0d`
42// '--- Event 2 starting at `viewStart + 0d` 42// '--- Event 2 starting at `periodStart + 0d`
43// Day 1 43// Day 1
44// '--- Event 0 starting at `viewStart + 1d` 44// '--- Event 0 starting at `periodStart + 1d`
45// Day 2 45// Day 2
46// Day 3 46// Day 3
47// |--- Event 0 starting at `viewStart + 3d` 47// |--- Event 0 starting at `periodStart + 3d`
48// '--- Event 1 starting at `viewStart + 3d` 48// '--- Event 1 starting at `periodStart + 3d`
49// Day 4 49// Day 4
50// ⋮ 50// ⋮
51// 51//
@@ -58,7 +58,7 @@
58// Columns are never used. 58// Columns are never used.
59// 59//
60// Top-level items just contains the ".events" attribute, and their rows 60// Top-level items just contains the ".events" attribute, and their rows
61// correspond to their offset compared to the start of the view (in number of 61// correspond to their offset compared to the start of the period (in number of
62// days). In that case the internalId contains DAY_ID. 62// days). In that case the internalId contains DAY_ID.
63// 63//
64// Direct children are events, and their rows corresponds to their index in 64// Direct children are events, and their rows corresponds to their index in
@@ -80,8 +80,8 @@ class PeriodDayEventModel : public QAbstractItemModel
80{ 80{
81 Q_OBJECT 81 Q_OBJECT
82 82
83 Q_PROPERTY(QVariant viewStart READ viewStart WRITE setViewStart) 83 Q_PROPERTY(QVariant start READ periodStart WRITE setPeriodStart)
84 Q_PROPERTY(int viewLength READ viewLength WRITE setViewLength) 84 Q_PROPERTY(int length READ periodLength WRITE setPeriodLength)
85 85
86public: 86public:
87 using Event = Sink::ApplicationDomain::Event; 87 using Event = Sink::ApplicationDomain::Event;
@@ -108,19 +108,19 @@ public:
108 108
109 QHash<int, QByteArray> roleNames() const override; 109 QHash<int, QByteArray> roleNames() const override;
110 110
111 QDate viewStart() const; 111 QDate periodStart() const;
112 void setViewStart(QDate); 112 void setPeriodStart(QDate);
113 void setViewStart(QVariant); 113 void setPeriodStart(QVariant);
114 int viewLength() const; 114 int periodLength() const;
115 void setViewLength(int); 115 void setPeriodLength(int);
116 116
117private: 117private:
118 void partitionData(); 118 void partitionData();
119 119
120 int bucketOf(QDate const &candidate) const; 120 int bucketOf(QDate const &candidate) const;
121 121
122 QDate mViewStart; 122 QDate mPeriodStart;
123 int mViewLength = 7; 123 int mPeriodLength = 7;
124 124
125 QSharedPointer<QAbstractItemModel> eventModel; 125 QSharedPointer<QAbstractItemModel> eventModel;
126 QVector<QList<QSharedPointer<Event>>> partitionedEvents; 126 QVector<QList<QSharedPointer<Event>>> partitionedEvents;