dev
liuwf 2 months ago
parent 20bd269fa3
commit c5fcd12bec

@ -44,6 +44,16 @@ namespace SlnMesnac.Config
set { iniHelper.IniWriteValue("system", "MaxBufferWeight", value); } set { iniHelper.IniWriteValue("system", "MaxBufferWeight", value); }
} }
/// <summary>
///2楼缓存区最小启动重量
/// </summary>
public string MinBufferWeight
{
get { return iniHelper.IniReadValue("system", "MinBufferWeight"); }
set { iniHelper.IniWriteValue("system", "MinBufferWeight", value); }
}
/// <summary> /// <summary>
///系统当前使用配方模版 ///系统当前使用配方模版
/// </summary> /// </summary>

@ -100,6 +100,17 @@ namespace SlnMesnac.WPF.Model
} }
/// <summary>
/// 2楼缓存区最小启动重量
/// </summary>
public double MinBufferWeight
{
get { return double.Parse(config.MinBufferWeight); }
set { config.MinBufferWeight = value.ToString(); }
}
/// <summary> /// <summary>
/// 当前使用模版名称 /// 当前使用模版名称
/// </summary> /// </summary>

@ -5,19 +5,21 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SlnMesnac.WPF.Page" xmlns:local="clr-namespace:SlnMesnac.WPF.Page"
mc:Ignorable="d" mc:Ignorable="d"
Title="重量设置" Height="300" Width="700" WindowStartupLocation="CenterScreen" Background="#73B0F5"> Title="重量设置" Height="300" Width="900" WindowStartupLocation="CenterScreen" Background="#73B0F5">
<Border Margin="5" Background="Transparent" CornerRadius="10"> <Border Margin="5" Background="Transparent" CornerRadius="10">
<Border.Effect> <Border.Effect>
<DropShadowEffect Color="LightGoldenrodYellow" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect> <DropShadowEffect Color="LightGoldenrodYellow" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
</Border.Effect> </Border.Effect>
<Grid> <Grid>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal"> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock Text="最小重量阈值:" FontSize="25" VerticalAlignment="Center" Width="200" Margin="0,0,20,0" Foreground="Black" HorizontalAlignment="Left"/>
<TextBox x:Name="MinWeightTxt" Width="100" FontSize="25" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="Black" BorderThickness="3" BorderBrush="Black"/>
<TextBlock Text="最大重量阈值:" FontSize="25" VerticalAlignment="Center" Width="200" Margin="0,0,20,0" Foreground="Black" HorizontalAlignment="Left"/> <TextBlock Text="最大重量阈值:" FontSize="25" VerticalAlignment="Center" Width="200" Margin="0,0,20,0" Foreground="Black" HorizontalAlignment="Left"/>
<TextBox x:Name="MaxWeightTxt" Width="100" FontSize="25" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="Black" BorderThickness="3" BorderBrush="Black"/> <TextBox x:Name="MaxWeightTxt" Width="100" FontSize="25" VerticalAlignment="Center" Margin="0,0,20,0" Foreground="Black" BorderThickness="3" BorderBrush="Black"/>
<Button x:Name="MaxWeightChangeButton" Style="{StaticResource BUTTON_AGREE}" Content="数量调整" FontSize="30" Background="Green" Width="180" Height="60" Margin="0 0 20 0" HorizontalAlignment="Left" Click="MaxWeightChangeButton_Click" /> <Button x:Name="MaxWeightChangeButton" Style="{StaticResource BUTTON_AGREE}" Content="数量调整" FontSize="30" Background="Green" Width="180" Height="60" Margin="0 0 20 0" HorizontalAlignment="Left" Click="MaxWeightChangeButton_Click" />
</StackPanel> </StackPanel>
<StackPanel Margin="80 150 0 0" VerticalAlignment="Center" > <StackPanel Margin="80 150 0 0" VerticalAlignment="Center" >
<TextBlock Text="提示信息: 缓存区重量超过该值,设备将会停止!" FontSize="25" Width="600" Margin="0,0,20,0" Foreground="Yellow" HorizontalAlignment="Left"/> <TextBlock Text="提示信息: 缓存区重量超过最大值,设备将会自动停止!" FontSize="25" Width="600" Margin="0,0,20,0" Foreground="Yellow" HorizontalAlignment="Left"/>
</StackPanel> </StackPanel>
</Grid> </Grid>

@ -38,10 +38,12 @@ namespace SlnMesnac.WPF.Page
private void MaxWeightChangeButton_Click(object sender, RoutedEventArgs e) private void MaxWeightChangeButton_Click(object sender, RoutedEventArgs e)
{ {
bool flag = double.TryParse(MaxWeightTxt.Text,out double result); bool flag = double.TryParse(MaxWeightTxt.Text,out double maxValue);
if (flag) bool flag2 = double.TryParse(MinWeightTxt.Text,out double minValue);
if (flag&&flag2)
{ {
recipeManageCache.MaxBufferWeight = result; recipeManageCache.MaxBufferWeight = maxValue;
} }
else else
{ {

Loading…
Cancel
Save