From 03e7fcbc153bd49abba5228a4958ba15176009a7 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Sat, 5 Nov 2022 21:02:51 +0100 Subject: [PATCH] allow a choice whether to collate entries --- BGS/Report.cs | 22 +++++++++++----------- MainWindow.xaml | 2 ++ MainWindow.xaml.cs | 3 ++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/BGS/Report.cs b/BGS/Report.cs index 33621d3..9fd585a 100644 --- a/BGS/Report.cs +++ b/BGS/Report.cs @@ -49,7 +49,7 @@ namespace EliteBGS.BGS { ; } - public void Scan(PlayerJournal journal, DateTime start, DateTime end) { + public void Scan(PlayerJournal journal, DateTime start, DateTime end, bool CollateEntries = true) { /* Log files only get rotated if you restart the game client. This means that there might * be - say - entries from the 4th of May in the file with a timestamp of 3rd of May. This * happens if you happen to play a session late into the night. @@ -72,10 +72,10 @@ namespace EliteBGS.BGS { .Where(e => e.Timestamp >= start && e.Timestamp < actualend) .ToList() ; - Scan(entries); + Scan(entries, CollateEntries); } - public void Scan(List entries) { + public void Scan(List entries, bool CollateEntries = true) { if (entries.Count <= 0) { return; } @@ -198,7 +198,7 @@ namespace EliteBGS.BGS { System = current_system, Faction = faction, }); - collate = true; + collate = CollateEntries; } else if (e.Is(Events.MissionCompleted)) { MissionCompletedEntry completed = e as MissionCompletedEntry; MissionAcceptedEntry accepted = null; @@ -411,7 +411,7 @@ namespace EliteBGS.BGS { /* Mission failed should be collated if they are in the same system/station */ - collate = true; + collate = CollateEntries; } else if (e.Is(Events.SellExplorationData)) { results.Add(new Cartographics(e as SellExplorationDataEntry) { System = current_system, @@ -420,7 +420,7 @@ namespace EliteBGS.BGS { }); /* colate single cartographic selling into one */ - collate = true; + collate = CollateEntries; } else if (e.Is(Events.SellOrganicData)) { /* organic data sold to Vista Genomics */ results.Add(new OrganicData(e as SellOrganicDataEntry) { @@ -429,7 +429,7 @@ namespace EliteBGS.BGS { Faction = controlling_faction, }); - collate = true; + collate = CollateEntries; } else if (e.Is(Events.MultiSellExplorationData)) { /* For multi-sell-exploraton-data only the controlling faction of the station sold to matters. */ @@ -439,7 +439,7 @@ namespace EliteBGS.BGS { Faction = controlling_faction }); - collate = true; + collate = CollateEntries; } else if (e.Is(Events.RedeemVoucher)) { RedeemVoucherEntry voucher = e as RedeemVoucherEntry; List current_factions = new List(); @@ -470,7 +470,7 @@ namespace EliteBGS.BGS { }); } - collate = true; + collate = CollateEntries; } else if (e.Is(Events.SellMicroResources)) { results.Add(new SellMicroResources(e as SellMicroResourcesEntry) { Faction = controlling_faction, @@ -490,7 +490,7 @@ namespace EliteBGS.BGS { System = current_system, }); - collate = true; + collate = CollateEntries; } else if (e.Is(Events.SearchAndRescue)) { results.Add(new SearchAndRescue(e as SearchAndRescueEntry) { Faction = controlling_faction, @@ -498,7 +498,7 @@ namespace EliteBGS.BGS { System = current_system, }); - collate = true; + collate = CollateEntries; } else if (e.Is(Events.MarketSell)) { MarketSellEntry sell = e as MarketSellEntry; long profit = 0; diff --git a/MainWindow.xaml b/MainWindow.xaml index f6e4172..cbf4b0a 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -50,6 +50,8 @@