From b7862341cd813d3ee06863a9f3a44a347187cce1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 26 Apr 2016 23:51:30 -0400 Subject: [PATCH] CmdReportSummary: Added data handling, needs output --- src/commands/CmdReportSummary.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/commands/CmdReportSummary.cpp b/src/commands/CmdReportSummary.cpp index 2b42fe6f..3050e933 100644 --- a/src/commands/CmdReportSummary.cpp +++ b/src/commands/CmdReportSummary.cpp @@ -26,6 +26,7 @@ #include #include +#include #include //////////////////////////////////////////////////////////////////////////////// @@ -34,7 +35,35 @@ int CmdReportSummary ( Rules& rules, Database& database) { - std::cout << "# CmdReportSummary\n"; + auto filter = createFilterIntervalFromCLI (cli); + + // If filter is empty, choose 'today'. + if (! filter.range.started ()) + filter.range = Range (Datetime ("today"), Datetime ("tomorrow")); + + // Load the data. + auto timeline = createTimelineFromData (database, filter); + auto tracked = timeline.tracked (rules); + auto excluded = timeline.excluded (rules); + + // Create a color palette. + auto palette = createPalette (rules); + + // Map tags to colors. + auto tag_colors = createTagColorMap (rules, palette, tracked); + + std::cout << '\n'; + std::string indent = " "; + + // Each day is rendered separately. + for (Datetime day = filter.range.start; day < filter.range.end; day++) + { + for (auto& track : tracked) + { + // TODO Intersect track with day. + } + } + return 0; }