@@ -119,6 +119,7 @@ | |||
<None Remove="Image\智慧城市科技风登录页面边框.png" /> | |||
<None Remove="Image\有告警.png" /> | |||
<None Remove="Image\标题背景.png" /> | |||
<None Remove="Image\浅色背景.jpeg" /> | |||
<None Remove="Image\环形切图\内圈\未选中.png" /> | |||
<None Remove="Image\环形切图\内圈\选中.png" /> | |||
<None Remove="Image\环形切图\占位.png" /> | |||
@@ -161,6 +162,7 @@ | |||
<None Remove="Image\窗体样式\Tab\Tab_SelectBJ.png" /> | |||
<None Remove="Image\窗体样式\Tab\Tab_SelectWZBJ.png" /> | |||
<None Remove="Image\竖线.png" /> | |||
<None Remove="Image\纹理背景.jpeg" /> | |||
<None Remove="Image\维护.png" /> | |||
<None Remove="Image\背景.png" /> | |||
<None Remove="Image\背景2.png" /> | |||
@@ -183,6 +185,7 @@ | |||
<None Remove="Image\表格\表格顶右.png" /> | |||
<None Remove="Image\表格\表格顶左.png" /> | |||
<None Remove="Image\表格标题背景2.png" /> | |||
<None Remove="Image\调味品.jpeg" /> | |||
<None Remove="Image\边框效果2.png" /> | |||
<None Remove="Image\边角.png" /> | |||
<None Remove="Image\退出.png" /> | |||
@@ -261,14 +264,17 @@ | |||
<Resource Include="Image\工艺流程.png" /> | |||
<Resource Include="Image\智慧城市科技风登录页面.png" /> | |||
<Resource Include="Image\智慧城市科技风登录页面边框.png" /> | |||
<Resource Include="Image\浅色背景.jpeg" /> | |||
<Resource Include="Image\界面2.png"> | |||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |||
</Resource> | |||
<Resource Include="Image\圆角矩形 30 拷贝.png" /> | |||
<Resource Include="Image\登录界面背景.jpg" /> | |||
<Resource Include="Image\登录界面背景1.jpg" /> | |||
<Resource Include="Image\纹理背景.jpeg" /> | |||
<Resource Include="Image\背景2.png" /> | |||
<Resource Include="Image\背景3.jpg" /> | |||
<Resource Include="Image\调味品.jpeg" /> | |||
<Resource Include="Image\边角.png" /> | |||
</ItemGroup> | |||
@@ -552,9 +552,8 @@ | |||
FontSize="18" | |||
Foreground="#1A8ADE" | |||
Text="{Binding TimeVisible}" /> | |||
<ContentControl Grid.Row="1" Content="{Binding MainContent}" /> | |||
<ContentControl Grid.Row="1" Width="auto" Height="auto" Content="{Binding MainContent}" /> | |||
</Grid> | |||
<!--#endregion--> | |||
@@ -1866,7 +1866,7 @@ | |||
<Style x:Key="80号字体样式" TargetType="TextBlock"> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="TextWrapping" Value="Wrap" /> | |||
<Setter Property="FontFamily" Value="/BPASmartClient.CustomResource;Component/Fonts/#zihun80hao-mengquxiaoyuti" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="Foreground" Value="#FFFCD5B5" /> | |||
</Style> | |||
@@ -8,6 +8,7 @@ | |||
<ItemGroup> | |||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="6.0.6" /> | |||
<PackageReference Include="System.Runtime" Version="4.3.1" /> | |||
</ItemGroup> | |||
</Project> |
@@ -73,7 +73,7 @@ namespace FryPot_DosingSystem | |||
SubMenuName = "配方管理", | |||
SubMenuPermission = new Permission[] { Permission.管理员, Permission.技术员 }, | |||
AssemblyName = "FryPot_DosingSystem", | |||
ToggleWindowPath = "View.RecipeSetView" | |||
ToggleWindowPath = "View.RecipeManageView" | |||
}); | |||
RecipeManage.Add(new SubMenumodel() | |||
@@ -930,6 +930,7 @@ namespace FryPot_DosingSystem.Control | |||
globalVar.LThreeMaterialNum = result.materialCollection.Count; | |||
globalVar.LThreeFryPotSerial = headNum; | |||
globalVar.LThreeCurrentRecipeName = result.RecipeName; | |||
AgvViewModel.GetInstance().Set滚筒线上数量(3, globalVar.LThreeMaterialNum.ToString()); | |||
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线开始制作【{result.RecipeName}】 配方"); | |||
for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 | |||
{ | |||
@@ -953,7 +954,7 @@ namespace FryPot_DosingSystem.Control | |||
} | |||
} | |||
DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据 | |||
AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LThreeFryPotSerial, IsRun.Stop); | |||
//AgvViewModel.GetInstance().Set启动或停止炒锅(globalVar.LThreeFryPotSerial, IsRun.Stop); | |||
} | |||
} | |||
@@ -998,6 +999,7 @@ namespace FryPot_DosingSystem.Control | |||
globalVar.LTwoMaterialNum = result.materialCollection.Count; | |||
globalVar.LTwoFryPotSerial = headNum; | |||
globalVar.LTwoCurrentRecipeName = result.RecipeName; | |||
AgvViewModel.GetInstance().Set滚筒线上数量(2, globalVar.LTwoMaterialNum.ToString()); | |||
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线开始制作【{result.RecipeName}】 配方"); | |||
for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 | |||
{ | |||
@@ -1071,6 +1073,7 @@ namespace FryPot_DosingSystem.Control | |||
globalVar.LOneMaterialNum = result.materialCollection.Count; | |||
globalVar.LOneFryPotSerial = headNum; | |||
globalVar.LOneCurrentRecipeName = result.RecipeName; | |||
AgvViewModel.GetInstance().Set滚筒线上数量(1, globalVar.LOneMaterialNum.ToString()); | |||
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线开始制作【{result.RecipeName}】 配方"); | |||
for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 | |||
{ | |||
@@ -20,6 +20,7 @@ | |||
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" /> | |||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | |||
<PackageReference Include="NModbus" Version="3.0.72" /> | |||
<PackageReference Include="System.Runtime" Version="4.3.1" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -30,4 +31,8 @@ | |||
<ProjectReference Include="..\BPASmartClient.Modbus\BPASmartClient.Modbus.csproj" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Images\" /> | |||
</ItemGroup> | |||
</Project> |
@@ -21,12 +21,23 @@ namespace FryPot_DosingSystem.Model | |||
private string _recipeName; | |||
public string RecipeName { get { return _recipeName; } set { _recipeName = value;OnPropertyChanged(); } } | |||
/// <summary> | |||
/// 配方创建时间 | |||
/// </summary> | |||
private string _dateTime; | |||
public string DataTime { get { return _dateTime; } set { _dateTime = value;OnPropertyChanged(); } } | |||
private string _updateTime; | |||
public string UpdateTime { get { return _updateTime; } set { _updateTime = value;OnPropertyChanged(); } } | |||
/// <summary> | |||
/// 配方下发状况信息 | |||
/// </summary> | |||
private string _recipeSetInfo; | |||
public string RecipeSetInfo { get { return _recipeSetInfo; } set { _recipeSetInfo = value; OnPropertyChanged(); } } | |||
public ObservableCollection<MaterialType> materialCollection { get; set; } = new ObservableCollection<MaterialType>(); | |||
} | |||
} |
@@ -0,0 +1,170 @@ | |||
<UserControl x:Class="FryPot_DosingSystem.View.RecipeManageView" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:FryPot_DosingSystem.View" | |||
xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel" | |||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
mc:Ignorable="d" | |||
d:DesignHeight="450" d:DesignWidth="800"> | |||
<UserControl.DataContext> | |||
<vm:RecipeSetViewModel/> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<Style x:Key="GridResize" TargetType="Grid"> | |||
<Style.Triggers> | |||
<!--<Trigger Property="IsMouseOver" Value="False"/>--> | |||
<EventTrigger RoutedEvent="MouseEnter" > | |||
<BeginStoryboard> | |||
<Storyboard> | |||
<DoubleAnimation Duration="0:0:0.2" To="236" Storyboard.TargetProperty="Width"/> | |||
<DoubleAnimation Duration="0:0:0.2" To="281" Storyboard.TargetProperty="Height"/> | |||
</Storyboard> | |||
</BeginStoryboard> | |||
</EventTrigger> | |||
<EventTrigger RoutedEvent="MouseLeave" > | |||
<BeginStoryboard> | |||
<Storyboard> | |||
<DoubleAnimation Duration="0:0:0.2" To="235" Storyboard.TargetProperty="Width"/> | |||
<DoubleAnimation Duration="0:0:0.2" To="280" Storyboard.TargetProperty="Height"/> | |||
</Storyboard> | |||
</BeginStoryboard> | |||
</EventTrigger> | |||
</Style.Triggers> | |||
</Style> | |||
<Style x:Key="FocusVisual"> | |||
<Setter Property="Control.Template"> | |||
<Setter.Value> | |||
<ControlTemplate> | |||
<Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/> | |||
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/> | |||
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="Transparent"/> | |||
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/> | |||
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/> | |||
<SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/> | |||
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/> | |||
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/> | |||
<SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/> | |||
<Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> | |||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> | |||
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/> | |||
<Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/> | |||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> | |||
<Setter Property="BorderThickness" Value="1"/> | |||
<Setter Property="HorizontalContentAlignment" Value="Center"/> | |||
<Setter Property="VerticalContentAlignment" Value="Center"/> | |||
<Setter Property="Padding" Value="1"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type Button}"> | |||
<Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"> | |||
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsDefaulted" Value="true"> | |||
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/> | |||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/> | |||
</Trigger> | |||
<Trigger Property="IsPressed" Value="true"> | |||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/> | |||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/> | |||
</Trigger> | |||
<Trigger Property="IsEnabled" Value="false"> | |||
<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/> | |||
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/> | |||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="55"></RowDefinition> | |||
<!--<RowDefinition Height="30"></RowDefinition>--> | |||
<RowDefinition></RowDefinition> | |||
</Grid.RowDefinitions> | |||
<UniformGrid Columns="2"> | |||
<Image Source="../hbl.ico" HorizontalAlignment="Left"></Image> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="2"> | |||
<pry:IcoButton Content="新建配方" | |||
Margin="80,15,10,0" | |||
Width="150" | |||
FontSize="16" | |||
Foreground="Aqua" | |||
IcoText="" | |||
Cursor="Hand" | |||
Style="{StaticResource IcoButtonStyle}" | |||
Command="{Binding NewRecipe}"> | |||
</pry:IcoButton> | |||
<pry:IcoButton | |||
Content="保存配方" Margin="5,15,10,0" | |||
Width="150" | |||
FontSize="16" | |||
Foreground="Aqua" | |||
IcoText="" | |||
Cursor="Hand" | |||
Style="{StaticResource IcoButtonStyle}" | |||
Command="{Binding SaveRecipe}"> | |||
</pry:IcoButton> | |||
</StackPanel> | |||
</UniformGrid> | |||
<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Padding="0,5,0,0"> | |||
<ItemsControl ItemsSource="{Binding recipeModels}"> | |||
<ItemsControl.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<WrapPanel></WrapPanel> | |||
</ItemsPanelTemplate> | |||
</ItemsControl.ItemsPanel> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Width="235" Height="280" Margin="6,6" Style="{StaticResource GridResize}"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="150"/> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<Button Panel.ZIndex="1" VerticalAlignment="Top" Background="Transparent" HorizontalAlignment="Right" Width="15" Height="15" FontFamily="/BPASmartClient.CustomResource;component/Fonts/#iconfont" Content="" BorderThickness="0" Foreground="LightGray" Command="{Binding DataContext.DeleteRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}"></Button> | |||
<Image Stretch="Fill" Source="/BPASmartClient.CustomResource;component/Image/调味品.jpeg"/> | |||
<StackPanel Grid.Row="2"> | |||
<StackPanel.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/浅色背景.jpeg" Opacity="0.4"/> | |||
</StackPanel.Background> | |||
<StackPanel Orientation="Horizontal" Margin="0,5"> | |||
<TextBlock Text="配方:" Foreground="White" FontSize="18"></TextBlock> | |||
<TextBlock Text="{Binding RecipeName}" Foreground="Orange" FontSize="18"></TextBlock> | |||
</StackPanel> | |||
<StackPanel Orientation="Horizontal" Margin="0,5"> | |||
<TextBlock Text="操作:" Foreground="White" FontSize="18"></TextBlock> | |||
<Button Style="{DynamicResource ButtonStyle1}" Content="编辑" Cursor="Hand" Foreground="Orange" FontSize="18" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.EditRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" | |||
CommandParameter="{Binding RecipeId}"/> | |||
</StackPanel> | |||
<StackPanel Orientation="Horizontal" Margin="0,5"> | |||
<TextBlock Text="创建时间:" FontSize="18" Foreground="White"></TextBlock> | |||
<TextBlock Text="{Binding DataTime}" FontSize="18" Foreground="Orange"/> | |||
</StackPanel> | |||
<StackPanel Orientation="Horizontal" Margin="0,5"> | |||
<TextBlock Text="更新时间:" FontSize="18" Foreground="White"></TextBlock> | |||
<TextBlock Text="{Binding UpdateTime}" FontSize="18" Foreground="Orange"/> | |||
</StackPanel> | |||
</StackPanel> | |||
</Grid> | |||
</DataTemplate> | |||
</ItemsControl.ItemTemplate> | |||
</ItemsControl> | |||
</ScrollViewer> | |||
</Grid> | |||
</UserControl> |
@@ -0,0 +1,28 @@ | |||
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.Navigation; | |||
using System.Windows.Shapes; | |||
namespace FryPot_DosingSystem.View | |||
{ | |||
/// <summary> | |||
/// RecipeManageView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class RecipeManageView : UserControl | |||
{ | |||
public RecipeManageView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -73,10 +73,10 @@ | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<RadioButton | |||
HorizontalAlignment="Left" > | |||
HorizontalAlignment="Center" > | |||
<RadioButton.Template> | |||
<ControlTemplate> | |||
<Grid > | |||
<Grid ShowGridLines="True" HorizontalAlignment="Center" Width="600"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.1*"/> | |||
<ColumnDefinition Width="0.3*"/> | |||
@@ -91,8 +91,8 @@ | |||
</RadialGradientBrush> | |||
</Border.Background> | |||
</Border> | |||
<TextBlock Grid.Column="1" Text="{Binding MaterialName }" Margin="30,5" FontSize="20" HorizontalAlignment="Left"></TextBlock> | |||
<TextBlock Grid.Column="2" Text="{Binding MaterialLoc}" Margin="30,5" FontSize="20" HorizontalAlignment="Left"></TextBlock> | |||
<TextBlock Grid.Column="1" Text="{Binding MaterialName }" Margin="30,5,0,5" FontSize="20" HorizontalAlignment="Left"></TextBlock> | |||
<TextBlock Grid.Column="2" Text="{Binding MaterialLoc}" Margin="30,5,0,5" FontSize="20" HorizontalAlignment="Left"></TextBlock> | |||
<StackPanel Orientation="Horizontal" Grid.Column="3"> | |||
<TextBlock Text="{Binding MaterialWeight}" Margin="30,5,2,5" FontSize="20" HorizontalAlignment="Center"></TextBlock> | |||
<TextBlock Foreground="LightSeaGreen" Text="g" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock> | |||
@@ -112,7 +112,7 @@ | |||
<ColumnDefinition/> | |||
</Grid.ColumnDefinitions> | |||
<Line StrokeThickness="3" Grid.Column="0" HorizontalAlignment="Left" Stroke="LawnGreen" X1="0" Y1="5" X2="0" Y2="110"></Line> | |||
<TextBlock Grid.Column="1" FontSize="16" Text="{Binding RecipeSetInfo}" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock> | |||
<TextBlock Grid.Column="1" FontSize="16" Text="{Binding RecipeSetInfo}" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock> | |||
</Grid> | |||
</Grid> | |||
@@ -102,17 +102,17 @@ namespace FryPot_DosingSystem.ViewModel | |||
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.RecipeId == recipeID); | |||
if (res == null) | |||
{ | |||
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, materialCollection = materials });//配方添加 | |||
Json<RecipeManage>.Data.Recipes.Add(new NewRecipeModel { RecipeId = recipeID, RecipeName = RecipeName, materialCollection = materials,DataTime=DateTime.Now.ToShortDateString()});//配方添加 | |||
} | |||
else | |||
{ | |||
goto prop; | |||
} | |||
MessageLog.GetInstance.ShowUserLog("新建配方成功"); | |||
MessageLog.GetInstance.ShowUserLog($"配方【{RecipeName}】新建成功"); | |||
} | |||
else | |||
{ | |||
MessageLog.GetInstance.ShowUserLog("新建配方无效【配方中没有添加原料】"); | |||
MessageLog.GetInstance.ShowUserLog($"新建配方【{RecipeName}】无效【配方中没有添加原料】"); | |||
} | |||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
} | |||
@@ -126,6 +126,7 @@ namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
bom.materialCollection = materials; | |||
bom.RecipeName = RecipeName; | |||
bom.UpdateTime = DateTime.Now.ToShortDateString(); | |||
Json<RecipeManage>.Save(); | |||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
} | |||
@@ -8,6 +8,7 @@ using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
namespace FryPot_DosingSystem.ViewModel | |||
@@ -38,6 +39,8 @@ namespace FryPot_DosingSystem.ViewModel | |||
{ | |||
RecipeSetDown(new NewRecipeModel[] { res }); | |||
} | |||
res.RecipeSetInfo = "配方下发成功"; | |||
Task.Run(() => { Thread.Sleep(1500);res.RecipeSetInfo = string.Empty; }); | |||
} | |||
}); | |||
AllRecipeSetDownCommand = new RelayCommand(() => | |||
@@ -49,6 +52,19 @@ namespace FryPot_DosingSystem.ViewModel | |||
// RecipeSetDown(recipeModel); | |||
//} | |||
RecipeSetDown(Recipes.ToArray()); | |||
Task.Run(() => | |||
{ | |||
foreach (var item in Recipes) | |||
{ | |||
item.RecipeSetInfo = "下发成功"; | |||
} | |||
Thread.Sleep(1500); | |||
foreach (var item in Recipes) | |||
{ | |||
item.RecipeSetInfo = string.Empty; | |||
} | |||
}); | |||
} | |||
}); | |||
@@ -29,9 +29,9 @@ namespace FryPot_DosingSystem.ViewModel | |||
public ObservableCollection<NewRecipeModel> recipeModels { get; set; } = new ObservableCollection<NewRecipeModel>(); | |||
public Action NewRecipe { get; set; } | |||
public RelayCommand NewRecipe { get; set; } | |||
public Action SaveRecipe { get; set; } | |||
public RelayCommand SaveRecipe { get; set; } | |||
/// <summary> | |||
/// 编辑配方 | |||
/// </summary> | |||
@@ -69,17 +69,17 @@ namespace FryPot_DosingSystem.ViewModel | |||
} | |||
}), "RecipeIsChange"); | |||
NewRecipe = new Action(() => | |||
NewRecipe =new RelayCommand( new Action(() => | |||
{ | |||
NewRecipeView nrv = new NewRecipeView(); | |||
nrv.ShowDialog(); | |||
MessageLog.GetInstance.ShowUserLog("新建配方"); | |||
}); | |||
SaveRecipe = new Action(() => | |||
//MessageLog.GetInstance.ShowUserLog("新建配方"); | |||
})); | |||
SaveRecipe =new RelayCommand( new Action(() => | |||
{ | |||
Json<RecipeManage>.Save(); | |||
count = recipeModels.Count; | |||
}); | |||
})); | |||
EditRecipeCommand = new RelayCommand<object>((Id) => | |||
{ | |||
if (Id != null) | |||