feat: 优化UI
This commit is contained in:
@@ -18,7 +18,7 @@ public class ConfigurationService
|
|||||||
public int SprayShampoo1Time { get; set; } = 1; // 喷沐浴露1时间
|
public int SprayShampoo1Time { get; set; } = 1; // 喷沐浴露1时间
|
||||||
public int SprayShampoo2Time { get; set; } = 1; // 喷沐浴露2时间
|
public int SprayShampoo2Time { get; set; } = 1; // 喷沐浴露2时间
|
||||||
public int SprayShampoo3Time { get; set; } = 1; // 喷沐浴露3时间
|
public int SprayShampoo3Time { get; set; } = 1; // 喷沐浴露3时间
|
||||||
public int SprayWaterTime { get; set; } = 2; // 喷水时间(保留用于兼容)
|
|
||||||
public int ColdAirTime { get; set; } = 2; // 冷风机时间
|
public int ColdAirTime { get; set; } = 2; // 冷风机时间
|
||||||
public int HotAirTime { get; set; } = 5; // 热风机时间
|
public int HotAirTime { get; set; } = 5; // 热风机时间
|
||||||
|
public int UvSterilizationTime { get; set; } = 3; // 紫外线杀菌时间
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,15 +112,24 @@ public partial class MainViewModel : ObservableObject
|
|||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private int _sprayShampoo3Time = 1;
|
private int _sprayShampoo3Time = 1;
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
private int _sprayWaterTime = 2;
|
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private int _coldAirTime = 2;
|
private int _coldAirTime = 2;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private int _hotAirTime = 5;
|
private int _hotAirTime = 5;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private int _uvSterilizationTime = 3;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private int _shampoo1Level = 80;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private int _shampoo2Level = 75;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private int _shampoo3Level = 70;
|
||||||
|
|
||||||
private readonly System.Timers.Timer _carouselTimer;
|
private readonly System.Timers.Timer _carouselTimer;
|
||||||
private readonly System.Timers.Timer _clockTimer;
|
private readonly System.Timers.Timer _clockTimer;
|
||||||
private readonly string[] _carouselImages = { "/Images/dog.png", "/Images/dog1.png", "/Images/dog2.png" };
|
private readonly string[] _carouselImages = { "/Images/dog.png", "/Images/dog1.png", "/Images/dog2.png" };
|
||||||
@@ -142,9 +151,9 @@ public partial class MainViewModel : ObservableObject
|
|||||||
SprayShampoo1Time = _config.SprayShampoo1Time;
|
SprayShampoo1Time = _config.SprayShampoo1Time;
|
||||||
SprayShampoo2Time = _config.SprayShampoo2Time;
|
SprayShampoo2Time = _config.SprayShampoo2Time;
|
||||||
SprayShampoo3Time = _config.SprayShampoo3Time;
|
SprayShampoo3Time = _config.SprayShampoo3Time;
|
||||||
SprayWaterTime = _config.SprayWaterTime;
|
|
||||||
ColdAirTime = _config.ColdAirTime;
|
ColdAirTime = _config.ColdAirTime;
|
||||||
HotAirTime = _config.HotAirTime;
|
HotAirTime = _config.HotAirTime;
|
||||||
|
UvSterilizationTime = _config.UvSterilizationTime;
|
||||||
|
|
||||||
// 初始化洗护步骤
|
// 初始化洗护步骤
|
||||||
InitializeWashSteps();
|
InitializeWashSteps();
|
||||||
@@ -186,6 +195,7 @@ public partial class MainViewModel : ObservableObject
|
|||||||
WashSteps.Add(new WashStep { Name = "第四次冲水", Status = "等待中" });
|
WashSteps.Add(new WashStep { Name = "第四次冲水", Status = "等待中" });
|
||||||
WashSteps.Add(new WashStep { Name = "热风吹毛", Status = "等待中" });
|
WashSteps.Add(new WashStep { Name = "热风吹毛", Status = "等待中" });
|
||||||
WashSteps.Add(new WashStep { Name = "冷热风混合", Status = "等待中" });
|
WashSteps.Add(new WashStep { Name = "冷热风混合", Status = "等待中" });
|
||||||
|
WashSteps.Add(new WashStep { Name = "紫外线杀菌", Status = "等待中" });
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task InitializeAsync()
|
public async Task InitializeAsync()
|
||||||
@@ -294,11 +304,11 @@ public partial class MainViewModel : ObservableObject
|
|||||||
_config.SprayShampoo1Time = SprayShampoo1Time;
|
_config.SprayShampoo1Time = SprayShampoo1Time;
|
||||||
_config.SprayShampoo2Time = SprayShampoo2Time;
|
_config.SprayShampoo2Time = SprayShampoo2Time;
|
||||||
_config.SprayShampoo3Time = SprayShampoo3Time;
|
_config.SprayShampoo3Time = SprayShampoo3Time;
|
||||||
_config.SprayWaterTime = SprayWaterTime;
|
|
||||||
_config.ColdAirTime = ColdAirTime;
|
_config.ColdAirTime = ColdAirTime;
|
||||||
_config.HotAirTime = HotAirTime;
|
_config.HotAirTime = HotAirTime;
|
||||||
|
_config.UvSterilizationTime = UvSterilizationTime;
|
||||||
|
|
||||||
_logger.LogInfo($"系统参数已保存 - 首次喷水:{FirstSprayWaterTime}min, 沐浴1后喷水:{AfterShampoo1SprayTime}min, 沐浴2后喷水:{AfterShampoo2SprayTime}min, 沐浴3后喷水:{AfterShampoo3SprayTime}min, 喷沐浴露1:{SprayShampoo1Time}min, 喷沐浴露2:{SprayShampoo2Time}min, 喷沐浴露3:{SprayShampoo3Time}min, 喷水:{SprayWaterTime}min, 冷风:{ColdAirTime}min, 热风:{HotAirTime}min");
|
_logger.LogInfo($"系统参数已保存 - 首次喷水:{FirstSprayWaterTime}min, 沐浴1后喷水:{AfterShampoo1SprayTime}min, 沐浴2后喷水:{AfterShampoo2SprayTime}min, 沐浴3后喷水:{AfterShampoo3SprayTime}min, 喷沐浴露1:{SprayShampoo1Time}min, 喷沐浴露2:{SprayShampoo2Time}min, 喷沐浴露3:{SprayShampoo3Time}min, 冷风:{ColdAirTime}min, 热风:{HotAirTime}min, 紫外线杀菌:{UvSterilizationTime}min");
|
||||||
|
|
||||||
MessageBox.Show("系统参数保存成功!", "成功", MessageBoxButton.OK, MessageBoxImage.Information);
|
MessageBox.Show("系统参数保存成功!", "成功", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
@@ -529,7 +539,8 @@ public partial class MainViewModel : ObservableObject
|
|||||||
("护理液喷洒", SprayShampoo3Time * 60),
|
("护理液喷洒", SprayShampoo3Time * 60),
|
||||||
("第四次冲水", AfterShampoo3SprayTime * 60),
|
("第四次冲水", AfterShampoo3SprayTime * 60),
|
||||||
("热风吹毛", HotAirTime * 60),
|
("热风吹毛", HotAirTime * 60),
|
||||||
("冷热风混合", ColdAirTime * 60)
|
("冷热风混合", ColdAirTime * 60),
|
||||||
|
("紫外线杀菌", UvSterilizationTime * 60)
|
||||||
};
|
};
|
||||||
|
|
||||||
int totalDuration = steps.Sum(s => s.Item2);
|
int totalDuration = steps.Sum(s => s.Item2);
|
||||||
@@ -694,6 +705,7 @@ public partial class MainViewModel : ObservableObject
|
|||||||
case "第一次冲水":
|
case "第一次冲水":
|
||||||
case "第二次冲水":
|
case "第二次冲水":
|
||||||
case "第三次冲水":
|
case "第三次冲水":
|
||||||
|
case "第四次冲水":
|
||||||
// 冲水阶段:水温在38-42度之间波动
|
// 冲水阶段:水温在38-42度之间波动
|
||||||
WaterTemperature = 40.0 + (random.NextDouble() - 0.5) * 4;
|
WaterTemperature = 40.0 + (random.NextDouble() - 0.5) * 4;
|
||||||
RoomTemperature = 25.0 + (random.NextDouble() - 0.5) * 2;
|
RoomTemperature = 25.0 + (random.NextDouble() - 0.5) * 2;
|
||||||
@@ -701,6 +713,7 @@ public partial class MainViewModel : ObservableObject
|
|||||||
|
|
||||||
case "沐浴露喷洒":
|
case "沐浴露喷洒":
|
||||||
case "香波喷洒":
|
case "香波喷洒":
|
||||||
|
case "护理液喷洒":
|
||||||
// 喷洒阶段:水温略低
|
// 喷洒阶段:水温略低
|
||||||
WaterTemperature = 38.0 + (random.NextDouble() - 0.5) * 2;
|
WaterTemperature = 38.0 + (random.NextDouble() - 0.5) * 2;
|
||||||
RoomTemperature = 25.0 + (random.NextDouble() - 0.5) * 2;
|
RoomTemperature = 25.0 + (random.NextDouble() - 0.5) * 2;
|
||||||
@@ -718,6 +731,12 @@ public partial class MainViewModel : ObservableObject
|
|||||||
RoomTemperature = 30.0 - progress * 5 + (random.NextDouble() - 0.5) * 2;
|
RoomTemperature = 30.0 - progress * 5 + (random.NextDouble() - 0.5) * 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "紫外线杀菌":
|
||||||
|
// 紫外线杀菌阶段:温度稳定
|
||||||
|
WaterTemperature = 25.0 + (random.NextDouble() - 0.5) * 1;
|
||||||
|
RoomTemperature = 26.0 + (random.NextDouble() - 0.5) * 1;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// 默认温度
|
// 默认温度
|
||||||
WaterTemperature = 40.0 + (random.NextDouble() - 0.5) * 2;
|
WaterTemperature = 40.0 + (random.NextDouble() - 0.5) * 2;
|
||||||
|
|||||||
@@ -1808,41 +1808,6 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- 喷水时间 -->
|
|
||||||
<Border Background="#F5F5F5"
|
|
||||||
CornerRadius="10"
|
|
||||||
Padding="15,12"
|
|
||||||
Margin="0,0,0,10">
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Text="喷水时间"
|
|
||||||
FontSize="16"
|
|
||||||
Foreground="#424242"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
||||||
<TextBox Text="{Binding SprayWaterTime, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
Width="70"
|
|
||||||
FontSize="16"
|
|
||||||
FontWeight="Bold"
|
|
||||||
Foreground="#FF6F00"
|
|
||||||
Background="White"
|
|
||||||
BorderBrush="#FF6F00"
|
|
||||||
BorderThickness="2"
|
|
||||||
Padding="6,4"
|
|
||||||
TextAlignment="Center"
|
|
||||||
VerticalContentAlignment="Center"/>
|
|
||||||
<TextBlock Text="分钟"
|
|
||||||
FontSize="16"
|
|
||||||
Foreground="#424242"
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- 冷风机时间 -->
|
<!-- 冷风机时间 -->
|
||||||
<Border Background="#F5F5F5"
|
<Border Background="#F5F5F5"
|
||||||
CornerRadius="10"
|
CornerRadius="10"
|
||||||
@@ -1912,6 +1877,41 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<!-- 紫外线杀菌 -->
|
||||||
|
<Border Background="#F5F5F5"
|
||||||
|
CornerRadius="10"
|
||||||
|
Padding="15,12"
|
||||||
|
Margin="0,0,0,10">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Text="紫外线杀菌"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="#424242"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||||
|
<TextBox Text="{Binding UvSterilizationTime, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
Width="70"
|
||||||
|
FontSize="16"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="#FF6F00"
|
||||||
|
Background="White"
|
||||||
|
BorderBrush="#FF6F00"
|
||||||
|
BorderThickness="2"
|
||||||
|
Padding="6,4"
|
||||||
|
TextAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"/>
|
||||||
|
<TextBlock Text="分钟"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="#424242"
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -1950,11 +1950,29 @@
|
|||||||
Padding="15,12"
|
Padding="15,12"
|
||||||
Margin="0,0,0,10">
|
Margin="0,0,0,10">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBlock Text="水压设置"
|
<TextBlock Text="风温设置"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
Foreground="#424242"
|
Foreground="#424242"
|
||||||
VerticalAlignment="Center"/>
|
VerticalAlignment="Center"/>
|
||||||
<TextBlock Text="标准"
|
<TextBlock Text="45°C"
|
||||||
|
FontSize="18"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="#FF6F00"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<Border Background="#F5F5F5"
|
||||||
|
CornerRadius="10"
|
||||||
|
Padding="15,12"
|
||||||
|
Margin="0,0,0,10">
|
||||||
|
<Grid>
|
||||||
|
<TextBlock Text="1号浴露液位"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="#424242"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBlock Text="{Binding Shampoo1Level, StringFormat={}{0}%}"
|
||||||
FontSize="18"
|
FontSize="18"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="#4CAF50"
|
Foreground="#4CAF50"
|
||||||
@@ -1970,19 +1988,38 @@
|
|||||||
Padding="15,12"
|
Padding="15,12"
|
||||||
Margin="0,0,0,10">
|
Margin="0,0,0,10">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBlock Text="风温设置"
|
<TextBlock Text="2号浴露液位"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
Foreground="#424242"
|
Foreground="#424242"
|
||||||
VerticalAlignment="Center"/>
|
VerticalAlignment="Center"/>
|
||||||
<TextBlock Text="45°C"
|
<TextBlock Text="{Binding Shampoo2Level, StringFormat={}{0}%}"
|
||||||
FontSize="18"
|
FontSize="18"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="#FF6F00"
|
Foreground="#4CAF50"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center"/>
|
VerticalAlignment="Center"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<Border Background="#F5F5F5"
|
||||||
|
CornerRadius="10"
|
||||||
|
Padding="15,12"
|
||||||
|
Margin="0,0,0,10">
|
||||||
|
<Grid>
|
||||||
|
<TextBlock Text="3号浴露液位"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="#424242"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBlock Text="{Binding Shampoo3Level, StringFormat={}{0}%}"
|
||||||
|
FontSize="18"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="#4CAF50"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
|
||||||
<Border Background="#F5F5F5"
|
<Border Background="#F5F5F5"
|
||||||
CornerRadius="10"
|
CornerRadius="10"
|
||||||
Padding="15,12"
|
Padding="15,12"
|
||||||
|
|||||||
Reference in New Issue
Block a user