1
0
Fork 0

Compare commits

..

3 Commits

Author SHA1 Message Date
Peter Nelson aa2b051df4
Merge b24ceb27f5 into 7bb4940ebd 2025-07-19 15:03:21 +00:00
Peter Nelson b24ceb27f5
Change: Add support for different horizontal graph scales. 2025-07-19 16:03:06 +01:00
Peter Nelson 7feaac5391
Codechange: Extend industry cargo history to 24 years.
Monthly data is stored for the current 24 months.
Quarterly data is stored for a further 2-6 years.
Yearly data is stored for a further 6-24 years.
2025-07-19 16:03:05 +01:00
1 changed files with 2 additions and 1 deletions

View File

@ -46,13 +46,14 @@ T GetHistory(const HistoryData<T> &history, uint period, uint age)
TEST_CASE("History Rotation and Reporting tests") TEST_CASE("History Rotation and Reporting tests")
{ {
HistoryData<uint16_t> history{}; HistoryData<uint16_t> history{};
uint64_t valid_history = 0; ValidHistoryMask valid_history = 0;
/* Fill the history with decreasing data points for 24 years of history. This ensures that no data period should /* Fill the history with decreasing data points for 24 years of history. This ensures that no data period should
* contain the same value as another period. */ * contain the same value as another period. */
uint16_t i = 12 * HISTORY_PERIODS; uint16_t i = 12 * HISTORY_PERIODS;
for (uint date = 1; date <= 12 * HISTORY_PERIODS; ++date, --i) { for (uint date = 1; date <= 12 * HISTORY_PERIODS; ++date, --i) {
history[THIS_MONTH] = i; history[THIS_MONTH] = i;
UpdateValidHistory(valid_history, date % 12);
RotateHistory(history, valid_history, date % 12); RotateHistory(history, valid_history, date % 12);
} }