-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added config panel and auto-clean old logs.
- Loading branch information
Showing
7 changed files
with
236 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<Window x:Class="OKEGui.ConfigPanel" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:OKEGui" | ||
DataContext="{Binding RelativeSource={RelativeSource Self}}" | ||
mc:Ignorable="d" | ||
Title="设置" Height="300" Width="500"> | ||
<Window.Resources> | ||
<Style TargetType="DataGridCell"> | ||
<Setter Property="HorizontalContentAlignment" Value="Left" /> | ||
<Setter Property="VerticalContentAlignment" Value="Center" /> | ||
</Style> | ||
</Window.Resources> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="70"/> | ||
<RowDefinition Height="105"/> | ||
<RowDefinition/> | ||
</Grid.RowDefinitions> | ||
<Grid Grid.Row="0" Height="70" VerticalAlignment="Top"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="110"/> | ||
<ColumnDefinition Width="290"/> | ||
<ColumnDefinition Width="95"/> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition/> | ||
<RowDefinition/> | ||
</Grid.RowDefinitions> | ||
<TextBlock Margin="10,9" Height="30" Grid.Row="0" Grid.Column="0" Text="vspipe.exe"/> | ||
<TextBox Height="25" Grid.Row="0" Grid.Column="1" Text="{Binding Config.vspipePath}"/> | ||
<Button Height="25" Width="40" Grid.Row="0" Grid.Column="2" Content="选择" Click="Vspipe_Click"/> | ||
<TextBlock Margin="10,9" Height="30" Grid.Row="1" Grid.Column="0" Text="RPChecker.exe"/> | ||
<TextBox Height="25" Grid.Row="1" Grid.Column="1" Text="{Binding Config.rpCheckerPath}"/> | ||
<Button Height="25" Width="40" Grid.Row="1" Grid.Column="2" Content="选择" Click="RPChecker_Click"/> | ||
</Grid> | ||
<Grid Grid.Row="1" Height="105" VerticalAlignment="Top"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="400"/> | ||
<ColumnDefinition Width="95"/> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition/> | ||
<RowDefinition/> | ||
<RowDefinition/> | ||
</Grid.RowDefinitions> | ||
<TextBlock Margin="10,9" Height="30" Grid.Row="0" Grid.Column="0" Text="记录详细程度(从上到下越来越详细)"/> | ||
<ComboBox Height="25" Width="70" Grid.Row="0" HorizontalAlignment="Center" Grid.Column="1" SelectedValue="{Binding Config.logLevel}" SelectedValuePath="Content"> | ||
<ComboBoxItem Content="OFF"/> | ||
<ComboBoxItem Content="FATAL"/> | ||
<ComboBoxItem Content="ERROR"/> | ||
<ComboBoxItem Content="WARN"/> | ||
<ComboBoxItem Content="INFO"/> | ||
<ComboBoxItem Content="DEBUG"/> | ||
<ComboBoxItem Content="TRACE"/> | ||
</ComboBox> | ||
<TextBlock Margin="10,9" Height="30" Grid.Row="1" Grid.Column="0" Text="跳过Numa检测(AMD Ryzen 1000系列请勾选)"/> | ||
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" IsChecked="{Binding Config.noNuma}"/> | ||
<TextBlock Margin="10,9" Height="30" Grid.Row="2" Grid.Column="0" Text="开启AVX512烤鸡模式"/> | ||
<CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="2" Grid.Column="1" IsChecked="{Binding Config.avx512}"/> | ||
</Grid> | ||
<Grid Grid.Row="2"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition/> | ||
<ColumnDefinition/> | ||
</Grid.ColumnDefinitions> | ||
<Button Grid.Column="0" Margin="20,20,20,20" Width="100" Height="30" HorizontalAlignment="Center" VerticalAlignment="Bottom" Content="保存" FontWeight="Bold" Click="Save_Click"/> | ||
<Button Grid.Column="1" Margin="20,20,20,20" Width="100" Height="30" HorizontalAlignment="Center" VerticalAlignment="Bottom" Content="取消" IsCancel="True"/> | ||
</Grid> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using Microsoft.Win32; | ||
using OKEGui.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
|
||
namespace OKEGui | ||
{ | ||
/// <summary> | ||
/// Config.xaml 的交互逻辑 | ||
/// </summary> | ||
public partial class ConfigPanel : Window | ||
{ | ||
public OKEGuiConfig Config { get; } | ||
|
||
private void Vspipe_Click(object sender, RoutedEventArgs e) | ||
{ | ||
OpenFileDialog ofd = new OpenFileDialog | ||
{ | ||
Multiselect = false, | ||
Filter = "vspipe.exe (vspipe.exe)|vspipe.exe", | ||
InitialDirectory = Config.vspipePath | ||
}; | ||
bool result = ofd.ShowDialog().GetValueOrDefault(false); | ||
if (result) | ||
{ | ||
Config.vspipePath = ofd.FileName; | ||
} | ||
} | ||
|
||
private void RPChecker_Click(object sender, RoutedEventArgs e) | ||
{ | ||
OpenFileDialog ofd = new OpenFileDialog | ||
{ | ||
Multiselect = false, | ||
Filter = "RPChecker.exe (RPChecker*.exe)|RPChecker*.exe", | ||
InitialDirectory = Config.rpCheckerPath | ||
}; | ||
bool result = ofd.ShowDialog().GetValueOrDefault(false); | ||
if (result) | ||
{ | ||
Config.rpCheckerPath = ofd.FileName; | ||
} | ||
} | ||
|
||
private void Save_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Initializer.Config = Config; | ||
Initializer.WriteConfig(); | ||
Close(); | ||
} | ||
|
||
public ConfigPanel() | ||
{ | ||
Config = Initializer.Config.Clone() as OKEGuiConfig; | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters