use datetimepicker for more carefull transaction picking
This commit is contained in:
parent
44410e86c8
commit
65d12cb052
@ -55,11 +55,12 @@
|
|||||||
<Resource Include="EliteBGS.ico" />
|
<Resource Include="EliteBGS.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.0" />
|
||||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||||
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||||
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
|
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:abc="http://wpfcontrols.com/"
|
xmlns:abc="http://wpfcontrols.com/"
|
||||||
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:local="clr-namespace:EliteBGS"
|
xmlns:local="clr-namespace:EliteBGS"
|
||||||
xmlns:Util="clr-namespace:EliteBGS.Util" d:DataContext="{d:DesignInstance Type=Util:AppConfig}" x:Name="window" x:Class="EliteBGS.MainWindow"
|
xmlns:Util="clr-namespace:EliteBGS.Util" d:DataContext="{d:DesignInstance Type=Util:AppConfig}" x:Name="window" x:Class="EliteBGS.MainWindow"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
@ -39,10 +40,10 @@
|
|||||||
<ToolBar VerticalAlignment="Top" Grid.Row="0" Width="Auto" Margin="0,0,0,0" Height="Auto" Grid.ColumnSpan="3" HorizontalAlignment="Left">
|
<ToolBar VerticalAlignment="Top" Grid.Row="0" Width="Auto" Margin="0,0,0,0" Height="Auto" Grid.ColumnSpan="3" HorizontalAlignment="Left">
|
||||||
<Button x:Name="ParseJournal" Content="Parse Journal" VerticalAlignment="Center" Click="ParseJournal_Click" HorizontalAlignment="Center"/>
|
<Button x:Name="ParseJournal" Content="Parse Journal" VerticalAlignment="Center" Click="ParseJournal_Click" HorizontalAlignment="Center"/>
|
||||||
<Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
|
<Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
|
||||||
<Label Content="From:" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center"/>
|
<Label Content="From (UTC):" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<DatePicker x:Name="startdate" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<xctk:DateTimePicker x:Name="startdate" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<Label Content="To:" Height="26.2857142857143" VerticalAlignment="Top"/>
|
<Label Content="To:" Height="26.2857142857143" VerticalAlignment="Top"/>
|
||||||
<DatePicker x:Name="enddate" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<xctk:DateTimePicker x:Name="enddate" Height="26.2857142857143" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
|
<Separator Margin="1" VerticalAlignment="Center" MinWidth="1" HorizontalAlignment="Center" MinHeight="22"/>
|
||||||
<Button x:Name="ManuallyParse" Content="Manually Parse JSON" Click="ManuallyParse_Click" />
|
<Button x:Name="ManuallyParse" Content="Manually Parse JSON" Click="ManuallyParse_Click" />
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
|
@ -11,6 +11,7 @@ using EDPlayerJournal.BGS;
|
|||||||
using EDPlayerJournal.Entries;
|
using EDPlayerJournal.Entries;
|
||||||
using EliteBGS.BGS;
|
using EliteBGS.BGS;
|
||||||
using EliteBGS.Util;
|
using EliteBGS.Util;
|
||||||
|
using System.Globalization;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace EliteBGS;
|
namespace EliteBGS;
|
||||||
@ -56,11 +57,20 @@ public partial class MainWindow : Window {
|
|||||||
journal = new PlayerJournal(Config.Global.JournalLocation);
|
journal = new PlayerJournal(Config.Global.JournalLocation);
|
||||||
|
|
||||||
// Set both to now
|
// Set both to now
|
||||||
startdate.SelectedDate = DateTime.Now;
|
startdate.CultureInfo = enddate.CultureInfo = CultureInfo.InvariantCulture;
|
||||||
enddate.SelectedDate = DateTime.Now;
|
ResetTime();
|
||||||
|
|
||||||
journallocation.Text = Config.Global.JournalLocation;
|
journallocation.Text = Config.Global.JournalLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ResetTime() {
|
||||||
|
DateTime today = DateTime.Today;
|
||||||
|
DateTime tomorrow = today.AddDays(1);
|
||||||
|
|
||||||
|
startdate.Value = today;
|
||||||
|
enddate.Value = tomorrow;
|
||||||
|
}
|
||||||
|
|
||||||
private void TreeView_CheckBox_Updated(object sender, RoutedEventArgs args) {
|
private void TreeView_CheckBox_Updated(object sender, RoutedEventArgs args) {
|
||||||
GenerateLog();
|
GenerateLog();
|
||||||
}
|
}
|
||||||
@ -86,9 +96,8 @@ public partial class MainWindow : Window {
|
|||||||
List<Transaction> transactions = parser.Parse(entries);
|
List<Transaction> transactions = parser.Parse(entries);
|
||||||
|
|
||||||
// Filter the transactions down to the given time frame
|
// Filter the transactions down to the given time frame
|
||||||
DateTime actualend = end.AddDays(1);
|
|
||||||
transactions = transactions
|
transactions = transactions
|
||||||
.Where(t => t.CompletedAtDateTime >= start && t.CompletedAtDateTime <= actualend)
|
.Where(t => t.CompletedAtDateTime >= start && t.CompletedAtDateTime <= end)
|
||||||
.ToList()
|
.ToList()
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -120,8 +129,8 @@ public partial class MainWindow : Window {
|
|||||||
try {
|
try {
|
||||||
TransactionParser parser = new TransactionParser();
|
TransactionParser parser = new TransactionParser();
|
||||||
|
|
||||||
DateTime start = startdate.SelectedDate ?? DateTime.Now;
|
DateTime start = startdate.Value ?? DateTime.Now;
|
||||||
DateTime end = enddate.SelectedDate ?? DateTime.Now;
|
DateTime end = enddate.Value ?? DateTime.Now;
|
||||||
|
|
||||||
journal.Open(); // Load all files
|
journal.Open(); // Load all files
|
||||||
// Log files only get rotated if you restart the game client. This means that there might
|
// Log files only get rotated if you restart the game client. This means that there might
|
||||||
|
Loading…
Reference in New Issue
Block a user