diff --git a/PetWash.Api/petwash.db b/PetWash.Api/petwash.db index 11059db..891e78f 100644 Binary files a/PetWash.Api/petwash.db and b/PetWash.Api/petwash.db differ diff --git a/PetWash.Api/petwash.db-shm b/PetWash.Api/petwash.db-shm new file mode 100644 index 0000000..4f7f38f Binary files /dev/null and b/PetWash.Api/petwash.db-shm differ diff --git a/PetWash.Api/petwash.db-wal b/PetWash.Api/petwash.db-wal new file mode 100644 index 0000000..4774bfc Binary files /dev/null and b/PetWash.Api/petwash.db-wal differ diff --git a/PetWashControl/Converters/BoolToStatusConverter.cs b/PetWashControl/Converters/BoolToStatusConverter.cs index 1df3073..d266d81 100644 --- a/PetWashControl/Converters/BoolToStatusConverter.cs +++ b/PetWashControl/Converters/BoolToStatusConverter.cs @@ -70,3 +70,21 @@ public class InverseBoolToVisibilityConverter : IValueConverter throw new NotImplementedException(); } } + +public class ProgressToWidthConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is int progress) + { + // 假设进度条容器宽度为300,根据百分比计算实际宽度 + return progress * 3.0; // 300px * (progress/100) + } + return 0.0; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } +} diff --git a/PetWashControl/Images/qrcode.png b/PetWashControl/Images/qrcode.png new file mode 100644 index 0000000..82fe195 Binary files /dev/null and b/PetWashControl/Images/qrcode.png differ diff --git a/PetWashControl/Images/unnamed.jpg b/PetWashControl/Images/unnamed.jpg new file mode 100644 index 0000000..492e123 Binary files /dev/null and b/PetWashControl/Images/unnamed.jpg differ diff --git a/PetWashControl/PetWashControl.csproj b/PetWashControl/PetWashControl.csproj index d6e6372..034a214 100644 --- a/PetWashControl/PetWashControl.csproj +++ b/PetWashControl/PetWashControl.csproj @@ -16,4 +16,9 @@ + + + + + diff --git a/PetWashControl/ViewModels/MainViewModel.cs b/PetWashControl/ViewModels/MainViewModel.cs index 7ca081b..e7a4f58 100644 --- a/PetWashControl/ViewModels/MainViewModel.cs +++ b/PetWashControl/ViewModels/MainViewModel.cs @@ -65,6 +65,12 @@ public partial class MainViewModel : ObservableObject [ObservableProperty] private ObservableCollection _washSteps = new(); + [ObservableProperty] + private double _waterTemperature = 40.0; + + [ObservableProperty] + private double _roomTemperature = 25.0; + public MainViewModel() { _config = new ConfigurationService(); @@ -141,6 +147,15 @@ public partial class MainViewModel : ObservableObject _logger.LogInfo("切换到支付界面"); } + [RelayCommand] + private void ShowSettings() + { + CurrentView = "Settings"; + ViewChanged?.Invoke("Settings"); + StatusMessage = "系统设置"; + _logger.LogInfo("切换到设置界面"); + } + [RelayCommand] private void BackToIdle() { @@ -370,6 +385,9 @@ public partial class MainViewModel : ObservableObject int seconds = remaining % 60; RemainingTime = $"{minutes:D2}:{seconds:D2}"; + // 模拟温度变化 + UpdateTemperatures(stepName, i, duration); + await Task.Delay(100); // 加速模拟,实际应为1000ms } } @@ -474,4 +492,52 @@ public partial class MainViewModel : ObservableObject } }); } + + private void UpdateTemperatures(string stepName, int currentTime, int totalTime) + { + // 根据不同步骤模拟温度变化 + var random = new Random(); + double progress = (double)currentTime / totalTime; + + switch (stepName) + { + case "第一次冲水": + case "第二次冲水": + case "第三次冲水": + // 冲水阶段:水温在38-42度之间波动 + WaterTemperature = 40.0 + (random.NextDouble() - 0.5) * 4; + RoomTemperature = 25.0 + (random.NextDouble() - 0.5) * 2; + break; + + case "沐浴露喷洒": + case "香波喷洒": + // 喷洒阶段:水温略低 + WaterTemperature = 38.0 + (random.NextDouble() - 0.5) * 2; + RoomTemperature = 25.0 + (random.NextDouble() - 0.5) * 2; + break; + + case "热风吹毛": + // 热风阶段:水温降低,室温升高 + WaterTemperature = 35.0 - progress * 10 + (random.NextDouble() - 0.5) * 2; + RoomTemperature = 25.0 + progress * 8 + (random.NextDouble() - 0.5) * 2; + break; + + case "冷热风混合": + // 混合风阶段:温度逐渐降低 + WaterTemperature = 25.0 + (random.NextDouble() - 0.5) * 2; + RoomTemperature = 30.0 - progress * 5 + (random.NextDouble() - 0.5) * 2; + break; + + default: + // 默认温度 + WaterTemperature = 40.0 + (random.NextDouble() - 0.5) * 2; + RoomTemperature = 25.0 + (random.NextDouble() - 0.5) * 2; + break; + } + + // 确保温度在合理范围内 + WaterTemperature = Math.Max(20, Math.Min(45, WaterTemperature)); + RoomTemperature = Math.Max(20, Math.Min(35, RoomTemperature)); + } } + diff --git a/PetWashControl/Views/MainWindow.xaml b/PetWashControl/Views/MainWindow.xaml index 7abc211..1d8e00e 100644 --- a/PetWashControl/Views/MainWindow.xaml +++ b/PetWashControl/Views/MainWindow.xaml @@ -4,15 +4,94 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:PetWashControl.Views" + xmlns:converters="clr-namespace:PetWashControl.Converters" mc:Ignorable="d" - Title="无人自动洗宠机智能控制系统" - Height="800" Width="1024" + Title="全自动洗宠机" + Height="800" Width="1280" WindowStyle="None" ResizeMode="NoResize" - WindowStartupLocation="CenterScreen" - Background="{StaticResource BackgroundGradient}"> + WindowStartupLocation="CenterScreen"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -23,311 +102,347 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + + + + + + + + + - - + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + - - - + + + + + + - - - - - - - - - + + + + + + + + + + + + @@ -472,188 +631,728 @@ - - - + + + + + + + + + + + - - + + - - + + - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PetWashControl/Views/MainWindow.xaml.cs b/PetWashControl/Views/MainWindow.xaml.cs index 4a38d15..a473988 100644 --- a/PetWashControl/Views/MainWindow.xaml.cs +++ b/PetWashControl/Views/MainWindow.xaml.cs @@ -30,6 +30,7 @@ public partial class MainWindow : Window PaymentView.Visibility = Visibility.Collapsed; QRCodeView.Visibility = Visibility.Collapsed; WashingView.Visibility = Visibility.Collapsed; + SettingsView.Visibility = Visibility.Collapsed; // 显示指定视图 switch (viewName) @@ -46,6 +47,9 @@ public partial class MainWindow : Window case "Washing": WashingView.Visibility = Visibility.Visible; break; + case "Settings": + SettingsView.Visibility = Visibility.Visible; + break; } }