GoalProgress.h header

#include <ew/app/GoalProgress.h>

Namespace ew::app

GoalProgress struct

struct ew::app::GoalProgress

A snapshot of progress toward the project's writing goals, plus a pace-based projection of when the manuscript target will be reached and whether that beats the deadline. Computed by evaluateGoal from the goal, the current manuscript word count, and the writing log. Fields for a target that is not set are left at their defaults with the matching has* flag false.

Members

bool ew::app::GoalProgress::hasDailyTarget = false

Whether a daily words-written habit target is set.

int ew::app::GoalProgress::dailyTarget = 0

The daily words-written target.

int ew::app::GoalProgress::wordsToday = 0

Words written today.

double ew::app::GoalProgress::dailyFraction = 0.0

Fraction of the daily target met today, clamped to [0, 1].

bool ew::app::GoalProgress::dailyGoalMet = false

Whether today's words meet or exceed the daily target.

bool ew::app::GoalProgress::hasManuscriptTarget = false

Whether a manuscript total-words target is set.

int ew::app::GoalProgress::manuscriptTarget = 0

The manuscript total-words target.

int ew::app::GoalProgress::currentWords = 0

The current manuscript word count.

int ew::app::GoalProgress::remainingWords = 0

Words still needed to reach the manuscript target (never negative).

double ew::app::GoalProgress::manuscriptFraction = 0.0

Fraction of the manuscript target reached, clamped to [0, 1].

bool ew::app::GoalProgress::manuscriptGoalMet = false

Whether the current word count meets or exceeds the manuscript target.

double ew::app::GoalProgress::recentWordsPerDay = 0.0

Average words per day over the recent trailing window (calendar days, including days with no writing).

bool ew::app::GoalProgress::hasProjectedFinish = false

Whether a finish date could be projected (a manuscript target is set and either it is already met or the recent pace is positive).

QDate ew::app::GoalProgress::projectedFinish

The projected date the manuscript target is reached, at the recent pace.

bool ew::app::GoalProgress::hasDeadline = false

Whether a manuscript deadline is set.

QDate ew::app::GoalProgress::deadline

The manuscript deadline.

int ew::app::GoalProgress::daysUntilDeadline = 0

Days from today until the deadline (negative if the deadline has passed).

int ew::app::GoalProgress::wordsPerDayNeeded = 0

Words per day required from today to reach the manuscript target by the deadline.

bool ew::app::GoalProgress::onTrack = false

Whether the projected finish reaches the target on or before the deadline.

Functions

GoalProgress ew::app::evaluateGoal(const ew::core::WritingGoal &goal, int currentWords, const ew::core::WritingLog &log, QDate today)

Evaluates progress toward goal given currentWords already written in the manuscript and the day-by-day log, relative to today. The recent pace averages the trailing two weeks of the log.