@@ -59,7 +59,7 @@ | |||
</Setter> | |||
</Style> | |||
</ResourceDictionary> | |||
</Application.Resources> | |||
</Application> |
@@ -1,16 +1,18 @@ | |||
<UserControl x:Class="BPASmartClient.JXJFoodBigStation.View.BomOfMaterialView" | |||
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:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel" | |||
mc:Ignorable="d" | |||
d:DesignHeight="1080" d:DesignWidth="1920"> | |||
<UserControl | |||
x:Class="BPASmartClient.JXJFoodBigStation.View.BomOfMaterialView" | |||
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:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel" | |||
d:DesignHeight="1080" | |||
d:DesignWidth="1920" | |||
mc:Ignorable="d"> | |||
<UserControl.DataContext> | |||
<vm:BomOfMaterialViewModel /> | |||
</UserControl.DataContext> | |||
<Grid Margin="10"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50" /> | |||
@@ -19,7 +21,10 @@ | |||
</Grid.RowDefinitions> | |||
<!--#region 表格标题栏设置--> | |||
<Grid> | |||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal"> | |||
<StackPanel | |||
HorizontalAlignment="Right" | |||
VerticalAlignment="Center" | |||
Orientation="Horizontal"> | |||
<pry:IcoButton | |||
Margin="5" | |||
Command="{Binding AddMaterial}" | |||
@@ -35,32 +40,55 @@ | |||
Foreground="Aqua" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</StackPanel> | |||
</Grid> | |||
<Grid | |||
Grid.Row="1" | |||
Margin="0,10,0,0" | |||
Background="#ff0C255F"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="1*"/> | |||
<ColumnDefinition Width="1*"/> | |||
<ColumnDefinition Width="1*"/> | |||
<ColumnDefinition Width="1*"/> | |||
<ColumnDefinition Width="1*" /> | |||
<ColumnDefinition Width="1*" /> | |||
<ColumnDefinition Width="1*" /> | |||
<ColumnDefinition Width="1*" /> | |||
</Grid.ColumnDefinitions> | |||
<Grid Grid.Column="0"> | |||
<TextBlock Text="序号" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"/> | |||
<Border BorderThickness="1,1,1,1" Cursor="SizeWE" /> | |||
<TextBlock | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
FontSize="24" | |||
Foreground="Aqua" | |||
Text="序号" /> | |||
<Border BorderThickness="1,1,1,1" Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock Grid.Column="1" FontSize="24" Text="原料编号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
<TextBlock Grid.Column="2" FontSize="24" Text="原料名称" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
<TextBlock Grid.Column="3" FontSize="24" Text="操作" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
<TextBlock | |||
Grid.Column="1" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
FontSize="24" | |||
Foreground="Aqua" | |||
Text="原料编号" /> | |||
<TextBlock | |||
Grid.Column="2" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
FontSize="24" | |||
Foreground="Aqua" | |||
Text="原料名称" /> | |||
<TextBlock | |||
Grid.Column="3" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
FontSize="24" | |||
Foreground="Aqua" | |||
Text="操作" /> | |||
</Grid> | |||
<Grid Grid.Row="2"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible" > | |||
<ItemsControl ItemsSource="{Binding RawMaterialInfo}" Foreground="Aqua"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible"> | |||
<ItemsControl Foreground="Aqua" ItemsSource="{Binding RawMaterialInfo}"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Name="gr" > | |||
<Grid Name="gr"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
@@ -69,28 +97,33 @@ | |||
</Grid.ColumnDefinitions> | |||
<Grid Grid.Column="0" Margin="5"> | |||
<TextBlock | |||
FontSize="16" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding RawMaterialCount}" /> | |||
FontSize="16" | |||
Text="{Binding RawMaterialCount}" /> | |||
</Grid> | |||
<Grid Grid.Column="1" Margin="5"> | |||
<TextBox | |||
FontSize="16" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding RawMaterialName}" /> | |||
VerticalAlignment="Center" | |||
HorizontalContentAlignment="Center" | |||
VerticalContentAlignment="Center" | |||
Width="200" | |||
FontSize="16" | |||
Text="{Binding RawMaterialName}" /> | |||
</Grid> | |||
<Grid Grid.Column="2"> | |||
<TextBox | |||
Width="200" | |||
FontSize="16" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding RawMaterialChineseName}" /> | |||
VerticalAlignment="Center" | |||
HorizontalContentAlignment="Center" | |||
VerticalContentAlignment="Center" | |||
FontSize="16" | |||
Text="{Binding RawMaterialChineseName}" /> | |||
</Grid> | |||
<Grid Grid.Column="3"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"> | |||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal"> | |||
<pry:IcoButton | |||
Margin="3,4,4,0" | |||
HorizontalAlignment="Center" | |||
@@ -107,7 +140,7 @@ | |||
</StackPanel> | |||
</Grid> | |||
</Grid> | |||
<DataTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" /> | |||
@@ -1,14 +1,16 @@ | |||
<UserControl x:Class="BPASmartClient.JXJFoodBigStation.View.DeviceManageView" | |||
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:BPASmartClient.JXJFoodBigStation.View" | |||
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel" | |||
mc:Ignorable="d" | |||
d:DesignHeight="450" d:DesignWidth="800"> | |||
<UserControl | |||
x:Class="BPASmartClient.JXJFoodBigStation.View.DeviceManageView" | |||
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:local="clr-namespace:BPASmartClient.JXJFoodBigStation.View" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodBigStation.ViewModel" | |||
d:DesignHeight="450" | |||
d:DesignWidth="800" | |||
mc:Ignorable="d"> | |||
<UserControl.DataContext> | |||
<vm:DeviceManageViewModel/> | |||
<vm:DeviceManageViewModel /> | |||
</UserControl.DataContext> | |||
<Grid Margin="-5,0,5,0"> | |||
@@ -43,10 +45,10 @@ | |||
ClipToBounds="True" | |||
CornerRadius="0"> | |||
<Border.Background> | |||
<ImageBrush Stretch="Fill" ImageSource="/BPASmartClient.CustomResource;component/Image/蓝色背景.png" /> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/蓝色背景.png" Stretch="Fill" /> | |||
</Border.Background> | |||
<Grid Margin="20 0"> | |||
<Grid Margin="20,0"> | |||
<!--<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
@@ -16,56 +16,67 @@ | |||
<vm:HardwareStatusViewModel /> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<PathGeometry x:Key="move" Figures="M 0,0 L 0,20"/> | |||
<Storyboard x:Key="Open" > | |||
<DoubleAnimationUsingPath Duration="0:0:1" PathGeometry="{StaticResource move}" RepeatBehavior="Forever" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(Y)" Source="Y"></DoubleAnimationUsingPath> | |||
<PathGeometry x:Key="move" Figures="M 0,0 L 0,20" /> | |||
<Storyboard x:Key="Open"> | |||
<DoubleAnimationUsingPath | |||
PathGeometry="{StaticResource move}" | |||
RepeatBehavior="Forever" | |||
Source="Y" | |||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(Y)" | |||
Duration="0:0:1" /> | |||
</Storyboard> | |||
<SolidColorBrush x:Key="ListBox.Static.Background" Color="#FFFFFFFF"/> | |||
<SolidColorBrush x:Key="ListBox.Static.Border" Color="#FFABADB3"/> | |||
<SolidColorBrush x:Key="ListBox.Disabled.Background" Color="#FFFFFFFF"/> | |||
<SolidColorBrush x:Key="ListBox.Disabled.Border" Color="#FFD9D9D9"/> | |||
<SolidColorBrush x:Key="ListBox.Static.Background" Color="#FFFFFFFF" /> | |||
<SolidColorBrush x:Key="ListBox.Static.Border" Color="#FFABADB3" /> | |||
<SolidColorBrush x:Key="ListBox.Disabled.Background" Color="#FFFFFFFF" /> | |||
<SolidColorBrush x:Key="ListBox.Disabled.Border" Color="#FFD9D9D9" /> | |||
<Style x:Key="ListViewStyle1" TargetType="{x:Type ListView}"> | |||
<Setter Property="Background" Value="{StaticResource ListBox.Static.Background}"/> | |||
<Setter Property="BorderBrush" Value="{StaticResource ListBox.Static.Border}"/> | |||
<Setter Property="BorderThickness" Value="1"/> | |||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> | |||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> | |||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> | |||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/> | |||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/> | |||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/> | |||
<Setter Property="VerticalContentAlignment" Value="Center"/> | |||
<Setter Property="Background" Value="{StaticResource ListBox.Static.Background}" /> | |||
<Setter Property="BorderBrush" Value="{StaticResource ListBox.Static.Border}" /> | |||
<Setter Property="BorderThickness" Value="1" /> | |||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" /> | |||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> | |||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> | |||
<Setter Property="ScrollViewer.CanContentScroll" Value="true" /> | |||
<Setter Property="ScrollViewer.PanningMode" Value="Both" /> | |||
<Setter Property="Stylus.IsFlicksEnabled" Value="False" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ListView}"> | |||
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1" SnapsToDevicePixels="true"> | |||
<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}"> | |||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> | |||
<Border | |||
x:Name="Bd" | |||
Padding="1" | |||
Background="{TemplateBinding Background}" | |||
BorderBrush="{TemplateBinding BorderBrush}" | |||
BorderThickness="{TemplateBinding BorderThickness}" | |||
SnapsToDevicePixels="true"> | |||
<ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false"> | |||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> | |||
</ScrollViewer> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsEnabled" Value="false"> | |||
<Setter Property="Background" TargetName="Bd" Value="{StaticResource ListBox.Disabled.Background}"/> | |||
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ListBox.Disabled.Border}"/> | |||
<Setter TargetName="Bd" Property="Background" Value="{StaticResource ListBox.Disabled.Background}" /> | |||
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource ListBox.Disabled.Border}" /> | |||
</Trigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsGrouping" Value="true"/> | |||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/> | |||
<Condition Property="IsGrouping" Value="true" /> | |||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" /> | |||
</MultiTrigger.Conditions> | |||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/> | |||
<Setter Property="ScrollViewer.CanContentScroll" Value="false" /> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</UserControl.Resources> | |||
<!--<UserControl.Triggers> | |||
<EventTrigger RoutedEvent="Loaded"> | |||
<BeginStoryboard Storyboard="{StaticResource Open}"></BeginStoryboard> | |||
</EventTrigger> | |||
</UserControl.Triggers>--> | |||
<!--<Grid> | |||
@@ -360,14 +371,15 @@ | |||
<!--#region 顶部料仓--> | |||
<Grid Name="TopGrid"> | |||
<ListView Style="{DynamicResource ListViewStyle1}" | |||
<ListView | |||
x:Name="FListView" | |||
Height="{Binding ElementName=TopGrid, Path=ActualHeight}" | |||
VerticalAlignment="Center" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding TopDeviceCurrentStatuses}" | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled" | |||
Style="{DynamicResource ListViewStyle1}"> | |||
<ListView.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<!--<WrapPanel Orientation="Horizontal" IsItemsHost="True"/>--> | |||
@@ -395,7 +407,7 @@ | |||
VerticalAlignment="Bottom" | |||
FontSize="25" | |||
Text="{Binding DeviceName}"> | |||
</TextBox>--> | |||
<TextBlock | |||
Margin="0,0,0,35" | |||
@@ -403,28 +415,31 @@ | |||
VerticalAlignment="Bottom" | |||
FontSize="25" | |||
Foreground="#ffccd61f" | |||
Text="{Binding DeviceName}" | |||
/> | |||
Text="{Binding DeviceName}" /> | |||
<StackPanel | |||
Grid.RowSpan="2" | |||
Panel.ZIndex="1" | |||
Margin="55,100,0,0" | |||
HorizontalAlignment="Center"> | |||
HorizontalAlignment="Center" | |||
Panel.ZIndex="1"> | |||
<Path x:Name="path" Tag="{Binding DeviceName}" Visibility="Hidden" Data="M -15,8 L 17,17 C 17,17 19,18 17,19 L 17,19 L -15,28 C -15,28 -17,28.2 -16,26 L -16,26 L -5,18 L -16,10 C -16,10 -17,8.5 -15,8 Z"> | |||
<Path | |||
x:Name="path" | |||
Data="M -15,8 L 17,17 C 17,17 19,18 17,19 L 17,19 L -15,28 C -15,28 -17,28.2 -16,26 L -16,26 L -5,18 L -16,10 C -16,10 -17,8.5 -15,8 Z" | |||
Tag="{Binding DeviceName}" | |||
Visibility="Hidden"> | |||
<Path.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90"/> | |||
<TranslateTransform Y="0"/> | |||
<RotateTransform Angle="90" /> | |||
<TranslateTransform Y="0" /> | |||
</TransformGroup> | |||
</Path.RenderTransform> | |||
<Path.Fill> | |||
<LinearGradientBrush> | |||
<LinearGradientBrush.RelativeTransform> | |||
<RotateTransform Angle="-15"/> | |||
<RotateTransform Angle="-15" /> | |||
</LinearGradientBrush.RelativeTransform> | |||
<GradientStop Color="LightGreen" Offset="0"/> | |||
<GradientStop Color="LightSeaGreen" Offset="0.6"/> | |||
<GradientStop Offset="0" Color="LightGreen" /> | |||
<GradientStop Offset="0.6" Color="LightSeaGreen" /> | |||
</LinearGradientBrush> | |||
</Path.Fill> | |||
</Path> | |||
@@ -446,9 +461,9 @@ | |||
FontSize="20" | |||
Foreground="#FF0084FF" | |||
Text=" kg" /> | |||
</StackPanel> | |||
<StackPanel | |||
Grid.Row="1" | |||
@@ -484,7 +499,7 @@ | |||
<!--<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="2"> | |||
<pry:IcoButton | |||
Width="80" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
Margin="5,0,10,0" | |||
@@ -495,7 +510,7 @@ | |||
Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" | |||
CommandParameter="{Binding DeviceName}" | |||
Tag="{Binding DeviceName}" | |||
Content="启动" | |||
EnterBackground="#222AB2E7" | |||
Foreground="#FF2AB2E7" | |||
@@ -503,7 +518,7 @@ | |||
Style="{StaticResource IcoButtonStyle}" | |||
/> | |||
<pry:IcoButton | |||
Width="80" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
HorizontalAlignment="Center" | |||
@@ -513,7 +528,7 @@ | |||
Command="{Binding DataContext.StopCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" | |||
CommandParameter="{Binding DeviceName}" | |||
Tag="{Binding DeviceName}" | |||
Content="停止" | |||
EnterBackground="#22F53F62" | |||
Foreground="#FFF53F62" | |||
@@ -529,7 +544,10 @@ | |||
</Grid> | |||
<!--#endregion--> | |||
<Grid x:Name="gr" Grid.Row="1" Margin="0,50,0,0"> | |||
<Grid | |||
x:Name="gr" | |||
Grid.Row="1" | |||
Margin="0,50,0,0"> | |||
<pry:ConveyorBelt | |||
Grid.Row="1" | |||
Width="{Binding ElementName=gr, Path=ActualWidth}" | |||
@@ -540,19 +558,19 @@ | |||
StrokeBrush="#00BEFA" | |||
StrokeDashArray="1.5 1.5" | |||
StrokeFillBrush="#00BEFA" | |||
StrokeThickness="2" /> | |||
StrokeThickness="2" /> | |||
</Grid> | |||
<!--#region 底部料仓--> | |||
<Grid Grid.Row="2"> | |||
<ListView | |||
Style="{DynamicResource ListViewStyle1}" | |||
x:Name="buttonListView" | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding BottomDeviceCurrentStatuses}" | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled" | |||
Style="{DynamicResource ListViewStyle1}"> | |||
<ListView.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<UniformGrid | |||
@@ -568,8 +586,8 @@ | |||
<Border Margin="5" Background="Transparent"> | |||
<Grid Height="220"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
<!--<RowDefinition Height="0.1*"/>--> | |||
</Grid.RowDefinitions> | |||
@@ -582,24 +600,28 @@ | |||
Text="{Binding DeviceName}" /> | |||
<StackPanel | |||
Grid.RowSpan="2" | |||
Panel.ZIndex="1" | |||
Margin="55,100,0,0" | |||
HorizontalAlignment="Center"> | |||
HorizontalAlignment="Center" | |||
Panel.ZIndex="1"> | |||
<Path x:Name="path1" Tag="{Binding DeviceName}" Visibility="Collapsed" Data="M -15,8 L 17,17 C 17,17 19,18 17,19 L 17,19 L -15,28 C -15,28 -17,28.2 -16,26 L -16,26 L -5,18 L -16,10 C -16,10 -17,8.5 -15,8 Z"> | |||
<Path | |||
x:Name="path1" | |||
Data="M -15,8 L 17,17 C 17,17 19,18 17,19 L 17,19 L -15,28 C -15,28 -17,28.2 -16,26 L -16,26 L -5,18 L -16,10 C -16,10 -17,8.5 -15,8 Z" | |||
Tag="{Binding DeviceName}" | |||
Visibility="Collapsed"> | |||
<Path.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90"/> | |||
<TranslateTransform Y="0"/> | |||
<RotateTransform Angle="90" /> | |||
<TranslateTransform Y="0" /> | |||
</TransformGroup> | |||
</Path.RenderTransform> | |||
<Path.Fill> | |||
<LinearGradientBrush> | |||
<LinearGradientBrush.RelativeTransform> | |||
<RotateTransform Angle="-15"/> | |||
<RotateTransform Angle="-15" /> | |||
</LinearGradientBrush.RelativeTransform> | |||
<GradientStop Color="LightGreen" Offset="0"/> | |||
<GradientStop Color="LightSeaGreen" Offset="0.5"/> | |||
<GradientStop Offset="0" Color="LightGreen" /> | |||
<GradientStop Offset="0.5" Color="LightSeaGreen" /> | |||
</LinearGradientBrush> | |||
</Path.Fill> | |||
</Path> | |||
@@ -651,7 +673,7 @@ | |||
Stretch="Fill" /> | |||
<!--<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="2"> | |||
<pry:IcoButton | |||
Width="80" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
Margin="5,0,10,0" | |||
@@ -662,7 +684,7 @@ | |||
Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" | |||
CommandParameter="{Binding DeviceName}" | |||
Tag="{Binding DeviceName}" | |||
Content="启动" | |||
EnterBackground="#222AB2E7" | |||
Foreground="#FF2AB2E7" | |||
@@ -670,7 +692,7 @@ | |||
Style="{StaticResource IcoButtonStyle}" | |||
/> | |||
<pry:IcoButton | |||
Width="80" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
HorizontalAlignment="Center" | |||
@@ -680,7 +702,7 @@ | |||
Command="{Binding DataContext.StopCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}" | |||
CommandParameter="{Binding DeviceName}" | |||
Tag="{Binding DeviceName}" | |||
Content="停止" | |||
EnterBackground="#22F53F62" | |||
Foreground="#FFF53F62" | |||
@@ -40,6 +40,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
RawMaterialCount = Json<BomMaterial>.Data.RawMaterials.Count +1 , | |||
}); | |||
MessageNotify.GetInstance.ShowUserLog("新增一条物料数据。"); | |||
}); | |||
SaveMaterials = new RelayCommand(() => | |||
{ | |||
@@ -61,6 +62,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
RawMaterialInfo.Remove(res); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"删除成功"); | |||
MessageNotify.GetInstance.ShowUserLog($"删除一条物料数据,物料为:【{res.RawMaterialName}】:{res.RawMaterialChineseName}。"); | |||
} | |||
} | |||
} | |||
@@ -1,4 +1,5 @@ | |||
using BPASmartClient.Helper; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.Helper; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using System; | |||
@@ -41,6 +42,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
return; | |||
} | |||
ActionManage.GetInstance.Send("UpdateDeviceName", DeviceName); | |||
MessageNotify.GetInstance.ShowUserLog($"修改了设备名称为【{DeviceName}】。"); | |||
ActionManage.GetInstance.Send("ChangeDeviceNameViewClose"); | |||
}); | |||
} | |||
@@ -30,6 +30,8 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
byte loc = Convert.ToByte(o); | |||
GVL_BigStation.AGVPutTray = GVL_BigStation.AGVPutTray.SetBitValue(loc, true); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"操作成功"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动点击AGV到达工位{loc}。"); | |||
} | |||
}); | |||
TrayLeave = new RelayCommand<object>((o) => | |||
@@ -38,11 +40,15 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
byte loc = Convert.ToByte(o); | |||
GVL_BigStation.AGVPutTray = GVL_BigStation.AGVPutTray.SetBitValue(loc, false); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"操作成功"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动点击AGV离开工位{loc}。"); | |||
} | |||
}); | |||
ClearTrayInPlace = new RelayCommand(() => | |||
{ | |||
GVL_BigStation.AGVPutTray = 0; | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"操作成功"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动点击清除AGV到位信号按钮。"); | |||
}); | |||
ClearAllRecipe = new RelayCommand(() => | |||
{ | |||
@@ -52,7 +58,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
} | |||
Json<RemoteRecipe>.Data.Recipes.Clear(); | |||
GVL_BigStation.SiemensSendRecipeStatus = 0; | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"清楚所有配方完成"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"清除所有配方完成"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动清除所有西门子配方。"); | |||
}); | |||
CancelRecipeCommand = new RelayCommand(() => | |||
@@ -75,13 +75,17 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
if (IsWashingBarrel) | |||
{ | |||
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode,RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType="洗桶",RecipeCategory=RecipeCategory}); | |||
var newRecipeData = new RecipeData { RecipeCode = recipeCode, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType = "洗桶", RecipeCategory = RecipeCategory }; | |||
Json<LocalRecipe>.Data.Recipes.Add(newRecipeData); | |||
Json<LocalRecipe>.Data.SelectedRecipes.Add(newRecipeData); | |||
if (RawMaterialsInfo.Count > 0) | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Info, App.MainWindow, "提示", $"订单类型为洗桶,不保存原料信息"); | |||
} | |||
else | |||
{ | |||
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType = "配料", RecipeCategory = RecipeCategory }); | |||
var newRecipeData = new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode, IsWashingBarrel = IsWashingBarrel, OrderType = "配料", RecipeCategory = RecipeCategory }; | |||
Json<LocalRecipe>.Data.Recipes.Add(newRecipeData); | |||
Json<LocalRecipe>.Data.SelectedRecipes.Add(newRecipeData) ; | |||
} | |||
Json<LocalRecipe>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方保存完成"); | |||
@@ -38,7 +38,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
var res = Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == num); | |||
ActionManage.GetInstance.Send("RecipeInfo", res); | |||
nrv.Show(); | |||
MessageNotify.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}"); | |||
MessageNotify.GetInstance.ShowUserLog($"编辑配方,配方名称:【{res.RecipeName}】"); | |||
} | |||
}); | |||
NewRecipe = new RelayCommand(() => | |||
@@ -114,7 +114,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
Json<LocalRecipe>.Data.Recipes.Clear(); | |||
Json<LocalRecipe>.Save(); | |||
Json<LocalRecipe>.Data.SelectedRecipes.Clear(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"本地配方已全部删除!"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动清除所有配方。"); | |||
}); | |||
@@ -131,7 +131,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
Recipes.Remove(res); | |||
Json<LocalRecipe>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方删除完成"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动删除【{res.RecipeName}】配方:【{recipeCode}】,"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动删除【{res.RecipeName}】配方,编号:【{recipeCode}】,"); | |||
} | |||
}); | |||
} | |||
@@ -66,7 +66,8 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
res.RecipesSource = RecipeSource.本地; | |||
Json<RemoteRecipe>.Data.Recipes.Add(res); | |||
MessageNotify.GetInstance.ShowRunLog($"手动下发配方:{recipeName}完成"); | |||
MessageNotify.GetInstance.ShowRunLog($"接收手动下发配方:【{recipeName}】"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动下发配方:【{recipeName}】完成"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"配方下发完成"); | |||
} | |||
else | |||
@@ -97,7 +97,9 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
/// </summary> | |||
public RelayCommand ConfirmCommand { get; set; } | |||
/// <summary> | |||
/// 一个配方数据的包装类。 | |||
/// </summary> | |||
internal class RecipeDataWithCheck:ObservableObject | |||
{ | |||
public RecipeData Recipe { get; set; } | |||
@@ -1116,7 +1116,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
string address = "DB5.DBX" + (index / 8) + "." + (index % 8 - 1); | |||
if (index == 8) address = "DB5.DBX0.7"; | |||
HKDevice.HK_PLC_S7.Write<bool>(address, true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:{address},值:true"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:{address},值:true。"); | |||
} | |||
} | |||
else if (o.ToString().Contains("阻挡气缸")) | |||
@@ -1141,43 +1141,48 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
if (index == 14) address = "DB5.DBX3.4"; | |||
if (index == 15) address = "DB5.DBX3.5"; | |||
HKDevice.HK_PLC_S7.Write<bool>(address, true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:{address},值:true。"); | |||
} | |||
} | |||
else if (o.ToString().Contains("进料桶顶升气缸")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX3.6", false);//默认顶升 | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX3.6,值:false"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX3.6,值:false。"); | |||
} | |||
else if (o.ToString().Contains("出料桶顶升气缸1")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX3.7", true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX3.7,值:true"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX3.7,值:true。"); | |||
} | |||
else if (o.ToString().Contains("出料桶顶升气缸2")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.0", true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.0,值:true"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.0,值:true。"); | |||
} | |||
else if (o.ToString().Contains("出料桶顶升气缸3")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.1", true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.1,值:true"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.1,值:true。"); | |||
} | |||
else if (o.ToString().Contains("托盘气缸1_1")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.2", false);//默认伸出 | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.2,值:false。"); | |||
} | |||
else if (o.ToString().Contains("托盘气缸1_2")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.3", false); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.3,值:false。"); | |||
} | |||
else if (o.ToString().Contains("托盘气缸2_1")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.4", false); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.4,值:false。"); | |||
} | |||
else if (o.ToString().Contains("托盘气缸2_2")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.5", false); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.5,值:false。"); | |||
} | |||
} | |||
}), "ManualOpen", true);//根据下发的配方ID将 托盘的位置信息添加到配方中 | |||
@@ -1193,7 +1198,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
string address = "DB5.DBX" + (index / 8) + "." + (index % 8 - 1); | |||
if (index == 8) address = "DB5.DBX0.7"; | |||
HKDevice.HK_PLC_S7.Write<bool>(address, false); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:{address},值:false"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:{address},值:false。"); | |||
} | |||
} | |||
else if (o.ToString().Contains("阻挡气缸")) | |||
@@ -1218,57 +1223,62 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
if (index == 14) address = "DB5.DBX3.4"; | |||
if (index == 15) address = "DB5.DBX3.5"; | |||
HKDevice.HK_PLC_S7.Write<bool>(address, false); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:{address},值:false。"); | |||
} | |||
} | |||
else if (o.ToString().Contains("进料桶顶升气缸")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX3.6", true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX3.6,值:true"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX3.6,值:true。"); | |||
} | |||
else if (o.ToString().Contains("出料桶顶升气缸1")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX3.7", false); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX3.7,值:false"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX3.7,值:false。"); | |||
} | |||
else if (o.ToString().Contains("出料桶顶升气缸2")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.0", false); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.0,值:false"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.0,值:false。"); | |||
} | |||
else if (o.ToString().Contains("出料桶顶升气缸3")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.1", false); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.1,值:false"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.1,值:false。"); | |||
} | |||
else if (o.ToString().Contains("托盘气缸1_1")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.2", true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.2,值:true。"); | |||
} | |||
else if (o.ToString().Contains("托盘气缸1_2")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.3", true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.3,值:true。"); | |||
} | |||
else if (o.ToString().Contains("托盘气缸2_1")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.4", true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.4,值:true。"); | |||
} | |||
else if (o.ToString().Contains("托盘气缸2_2")) | |||
{ | |||
HKDevice.HK_PLC_S7.Write("DB5.DBX4.5", true); | |||
MessageNotify.GetInstance.ShowUserLog($"手动操作气缸,地址:DB5.DBX4.5,值:true。"); | |||
} | |||
} | |||
}), "ManualClose", true);//根据下发的配方ID将 托盘的位置信息添加到配方中 | |||
//手动控制电机轴 DB5.DBX4.6~DB5.DBX5.2 | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX4.6", true); }), "StartAxisLoadCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX4.6", false); }), "StopAxisLoadCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX4.7", true); }), "StartAxisMidCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX4.7", false); }), "StopAxisMidCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.0", true); }), "StartAxisUnLoadCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.0", false); }), "StopAxisUnLoadCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.1", true); }), "StartAxis1Command", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.1", false); }), "StopAxis1Command", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.2", true); }), "StartAxis2Command", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.2", false); }), "StopAxis2Command", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX4.6", true); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX4.6,值:true。"); }), "StartAxisLoadCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX4.6", false); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX4.6,值:false。"); }), "StopAxisLoadCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX4.7", true); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX4.7,值:true。"); }), "StartAxisMidCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX4.7", false); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX4.7,值:false。"); }), "StopAxisMidCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.0", true); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX5.0,值:true。"); }), "StartAxisUnLoadCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.0", false); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX5.0,值:false。"); }), "StopAxisUnLoadCommand", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.1", true); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX5.1,值:true。"); }), "StartAxis1Command", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.1", false); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX5.1,值:false。"); }), "StopAxis1Command", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.2", true); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX5.2,值:true。"); }), "StartAxis2Command", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB5.DBX5.2", false); MessageNotify.GetInstance.ShowUserLog($"手动控制电机轴,地址:DB5.DBX5.2,值:false。"); }), "StopAxis2Command", true); | |||
//西门子配方处理 | |||
ActionManage.GetInstance.Register(new Action<object>((res) => | |||
@@ -1382,15 +1392,15 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
}), "LocalSimulationRecipeIssue", true); | |||
//手动控制系统模式 | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.0", true); }), "SystemStart", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.0", false); }), "SystemStop", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.2", true); }), "SystemPause", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.2", false); }), "SystemReset", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.1", false); }), "SystemAutoMode", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.1", true); }), "SystemDebugMode", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.0", true); MessageNotify.GetInstance.ShowUserLog($"手动控制系统启动,地址:DB44.DBX0.0,值:true。"); }), "SystemStart", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.0", false); MessageNotify.GetInstance.ShowUserLog($"手动控制系统停止,地址:DB44.DBX0.0,值:false。"); }), "SystemStop", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.2", true); MessageNotify.GetInstance.ShowUserLog($"手动控制系统暂停,地址:DB44.DBX0.2,值:true。"); }), "SystemPause", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.2", false); MessageNotify.GetInstance.ShowUserLog($"手动控制系统复位,地址:DB44.DBX0.2,值:false。"); }), "SystemReset", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.1", false); MessageNotify.GetInstance.ShowUserLog($"手动切换为自动模式,地址:DB44.DBX0.1,值:false。"); }), "SystemAutoMode", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.1", true); MessageNotify.GetInstance.ShowUserLog($"手动切换为手动模式,地址:DB44.DBX0.1,值:true。"); }), "SystemDebugMode", true); | |||
//流程控制 | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.3", true); }), "ManualSystemReset", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.4", true); }), "CLearRecipeInfo", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.3", true);}), "ManualSystemReset", true); | |||
ActionManage.GetInstance.Register(new Action(() => { HKDevice.HK_PLC_S7.Write<bool>("DB44.DBX0.4", true);}), "CLearRecipeInfo", true); | |||
ActionManage.GetInstance.Register(new Action(() => | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Clear(); | |||
@@ -91,7 +91,7 @@ | |||
Foreground="#FF0084FF" | |||
Text=" 号仓" /> | |||
</StackPanel> | |||
<StackPanel | |||
Grid.Row="1" | |||
Margin="0,70,0,0" | |||
@@ -65,99 +65,115 @@ | |||
Background="#ff0C255F"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="1*"/> | |||
<ColumnDefinition Width="3*"/> | |||
<ColumnDefinition Width="4*"/> | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="1*" /> | |||
<ColumnDefinition Width="3*" /> | |||
<ColumnDefinition Width="4*" /> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2*" /> | |||
</Grid.ColumnDefinitions> | |||
<Grid Grid.Column="0"> | |||
<TextBlock Text="序号" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua"/> | |||
<TextBlock | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Foreground="Aqua" | |||
Text="序号" /> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock Grid.Column="1" Text="地址" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
<TextBlock | |||
Grid.Column="1" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Foreground="Aqua" | |||
Text="地址" /> | |||
<Grid Grid.Column="2"> | |||
<TextBlock Text="描述" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
<TextBlock | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Foreground="Aqua" | |||
Text="描述" /> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock Grid.Column="3" Text="当前值" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
<TextBlock | |||
Grid.Column="3" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Foreground="Aqua" | |||
Text="当前值" /> | |||
<Grid Grid.Column="4"> | |||
<TextBlock Text="设定值" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
<TextBlock | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Foreground="Aqua" | |||
Text="设定值" /> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock Grid.Column="5" Text="功能操作" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" /> | |||
<TextBlock | |||
Grid.Column="5" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Foreground="Aqua" | |||
Text="功能操作" /> | |||
<Border Grid.ColumnSpan="10" BorderThickness="1,0,1,0" /> | |||
</Grid> | |||
<Grid Grid.Row="1"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" > | |||
<ItemsControl ItemsSource="{Binding PlcInfo}" Foreground="Aqua"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl Foreground="Aqua" ItemsSource="{Binding PlcInfo}"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Name="gr" > | |||
<Grid Name="gr"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="1*"/> | |||
<ColumnDefinition Width="3*"/> | |||
<ColumnDefinition Width="4*"/> | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="1*" /> | |||
<ColumnDefinition Width="3*" /> | |||
<ColumnDefinition Width="4*" /> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2*" /> | |||
</Grid.ColumnDefinitions> | |||
<Grid Grid.Column="0"> | |||
<TextBlock | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding SerialNum}" /> | |||
<Border | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock | |||
Grid.Column="1" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding Address }" /> | |||
VerticalAlignment="Center" | |||
Text="{Binding Address}" /> | |||
<Grid Grid.Column="2"> | |||
<TextBlock | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding Describe}" /> | |||
<Border | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Grid.Column="3" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Text="{Binding NowValue}" /> | |||
<Grid Grid.Column="4"> | |||
<TextBox | |||
Text="{Binding SetValue}" /> | |||
<Border | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
<TextBox Text="{Binding SetValue}" /> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
</Grid> | |||
<Grid Grid.Column="5"> | |||
<pry:IcoButton | |||
Command="{Binding DataContext.SetParCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding Address}" | |||
<pry:IcoButton | |||
Grid.Column="0" | |||
Margin="40,5,40,5" | |||
Command="{Binding DataContext.SetParCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding Address}" | |||
Content="设置" | |||
FontSize="20" | |||
Foreground="Aqua" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
<Border | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" /> | |||
</Grid> | |||
<Border | |||
Grid.ColumnSpan="10" | |||
BorderThickness="1,0,1,1" /> | |||
<Border Grid.ColumnSpan="10" BorderThickness="1,0,1,1" /> | |||
</Grid> | |||
<DataTemplate.Triggers> | |||
@@ -141,7 +141,7 @@ | |||
</Grid.RowDefinitions> | |||
<Grid Grid.Row="0"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2.5*" /> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2*" /> | |||
@@ -189,7 +189,7 @@ | |||
<DataTemplate> | |||
<Grid x:Name="grb" Height="25"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2.5*" /> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2*" /> | |||
<ColumnDefinition Width="2*" /> | |||
@@ -30,6 +30,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
Count = Json<DevicePar>.Data.BomMaterial.Count +1 , | |||
}); | |||
MessageNotify.GetInstance.ShowUserLog("新增一条物料数据。"); | |||
}); | |||
SaveMaterials = new RelayCommand(() => | |||
{ | |||
@@ -48,14 +49,15 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
Json<DevicePar>.Data.BomMaterial.Add(new BomMaterial() { Count = Json<DevicePar>.Data.BomMaterial.Count + 1, MaterialCode = item.Key, MaterialName = item.Value }); | |||
} | |||
MessageNotify.GetInstance.ShowUserLog("西门子物料数据拉取了本地数据。"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"读取程序的Bom清单"); | |||
}); | |||
DeleteAllMaterial = new RelayCommand(() => | |||
{ | |||
if (MessageNotify.GetInstance.ShowDialog("请确认是否删除所有原料数据!") == true) | |||
if (MessageNotify.GetInstance.ShowDialog("请确认,是否删除所有原料数据!") == true) | |||
{ | |||
Json<DevicePar>.Data.BomMaterial.Clear(); | |||
MessageNotify.GetInstance.ShowUserLog($"西门子物料清单删除完成"); | |||
MessageNotify.GetInstance.ShowUserLog($"手动点击西门子物料清单全部清除。"); | |||
} | |||
}); | |||
RemoveCommand = new RelayCommand<int>((Count) => | |||
@@ -65,10 +67,11 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
var res = RawMaterialInfo.FirstOrDefault(p => p.Count == cnt); | |||
if (res != null) | |||
{ | |||
if (MessageNotify.GetInstance.ShowDialog($"请确认是否删除[{res.MaterialCode}],[{res.MaterialName}]!") == true) | |||
if (MessageNotify.GetInstance.ShowDialog($"请确认是否删除物料编码:【{res.MaterialCode}】,物料名称:【{res.MaterialName}】的信息?") == true) | |||
{ | |||
RawMaterialInfo.Remove(res); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"删除成功"); | |||
MessageNotify.GetInstance.ShowUserLog($"删除一条物料数据,物料编码:【{res.MaterialCode}】,物料名称:{res.MaterialName}。"); | |||
} | |||
} | |||
} | |||
@@ -48,6 +48,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName; | |||
} | |||
} | |||
MessageNotify.GetInstance.ShowUserLog($"修改设备名称为【{DeviceName}】"); | |||
ActionManage.GetInstance.Send("ChangeDeviceNameViewClose"); | |||
} | |||
} | |||
@@ -11,6 +11,7 @@ using Microsoft.Toolkit.Mvvm.Input; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.CustomResource.UserControls; | |||
using System.Diagnostics; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
@@ -23,10 +24,13 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
var res = deviceParModels.FirstOrDefault(p => p.MaterialName == o?.ToString()); | |||
if (res != null) deviceParModels.Remove(res); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{o.ToString()}:原料删除成功!"); | |||
MessageNotify.GetInstance.ShowUserLog($"删除一条味魔方原料参数设置。原料名称:{o.ToString()}"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"原料:【{o.ToString()}】删除成功!"); | |||
}); | |||
AddCommand = new RelayCommand(() => { deviceParModels.Add(new DeviceParMode()); }); | |||
AddCommand = new RelayCommand(() => { deviceParModels.Add(new DeviceParMode()); | |||
MessageNotify.GetInstance.ShowUserLog($"新增一条味魔方原料参数设置。"); | |||
}); | |||
SaveCommand = new RelayCommand(() => | |||
{ | |||
if (deviceParModels == null || deviceParModels.Count <= 0) | |||
@@ -55,6 +59,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
Json<DevicePar>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"原料参数保存成功!"); | |||
MessageNotify.GetInstance.ShowUserLog("保存味魔法原料参数设置。"); | |||
}); | |||
} | |||
@@ -222,6 +222,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
Open = new RelayCommand<object>((o) => | |||
{ | |||
ActionManage.GetInstance.Send("ManualOpen", o); | |||
}); | |||
Close = new RelayCommand<object>((o) => | |||
{ | |||
@@ -201,6 +201,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
Json<LocalRecipeDataColl>.Data.Recipes.ElementAt(index).RawMaterial = RawMaterials; | |||
Json<LocalRecipeDataColl>.Data.Recipes.ElementAt(index).WindSend = WindSendRawMaterials; | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"修改配方完成!"); | |||
MessageNotify.GetInstance.ShowUserLog($"修改配方名称:【{RecipeName}】,配方编号:【{RecipeCode}】。"); | |||
} | |||
else | |||
{ | |||
@@ -229,15 +230,19 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
} | |||
} | |||
Json<LocalRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
var newRemoteRecipeData = new RemoteRecipeData() | |||
{ | |||
RecipeName = RecipeName, | |||
RecipeCode = RecipeCode, | |||
TrayCode = TrayNum, | |||
RawMaterial = RawMaterials, | |||
WindSend = WindSendRawMaterials, | |||
}); | |||
}; | |||
Json<LocalRecipeDataColl>.Data.Recipes.Add(newRemoteRecipeData); | |||
//新增一条配方应该默认显示出来。 | |||
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Add(newRemoteRecipeData); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"自定义配方添加完成!"); | |||
MessageNotify.GetInstance.ShowUserLog($"添加一个自定义配方,配方名称:【{RecipeName}】,配方编号:【{RecipeCode}】。"); | |||
} | |||
ActionManage.GetInstance.Send("CloseNewRemoteRecipeView"); | |||
}); | |||
@@ -11,6 +11,8 @@ using BPASmartClient.JXJFoodSmallStation.Model; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.Model; | |||
using BPASmartClient.JXJFoodSmallStation.Model.RawMaterial; | |||
using System.Windows.Controls; | |||
using Renci.SshNet.Messages; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
@@ -42,6 +44,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
RawMaterialId = guid | |||
}); | |||
MessageNotify.GetInstance.ShowUserLog($"添加一条原料:{guid}"); | |||
} | |||
else goto p; | |||
}); | |||
@@ -51,7 +54,11 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
if (obj is string rm) | |||
{ | |||
var res = RawMaterials.FirstOrDefault(p => p.RawMaterialId == rm); | |||
if (res != null) Global.DeviceRawMaterials.Remove(res); | |||
if (res != null) | |||
{ | |||
Global.DeviceRawMaterials.Remove(res); | |||
MessageNotify.GetInstance.ShowUserLog($"删除一条原料,原料名称:【{res.RawMaterialName}】"); | |||
} | |||
} | |||
}); | |||
@@ -98,6 +105,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Add(item); | |||
} | |||
MessageNotify.GetInstance.ShowUserLog($"修改了一条配方,配方编号:【{RecipeCode}】"); | |||
} | |||
} | |||
ActionManage.GetInstance.Send("CloseNewRecipeView"); | |||
@@ -160,6 +168,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
RecipCode = sb.ToString(), | |||
RecipeName = RecipeName, | |||
}); | |||
MessageNotify.GetInstance.ShowUserLog($"新增了一条配方,配方名称:【{RecipeName}】,配方编号:【{RecipeCode}】"); | |||
} | |||
public string RecipeCode { get { return _mRecipeCode; } set { _mRecipeCode = value; OnPropertyChanged(); } } | |||
@@ -95,7 +95,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
ActionManage.GetInstance.Send("LocalSimulationRecipeIssue", res); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{res.RecipeName}配方下发成功!"); | |||
MessageNotify.GetInstance.ShowUserLog($"下发本地模拟配方——{res.RecipeName}"); | |||
MessageNotify.GetInstance.ShowUserLog($"下发本地模拟配方,配方名称:【{res.RecipeName}】"); | |||
} | |||
GVL_SmallStation.GetInstance.LatestIssueRecipe=DateTime.Now; | |||
} | |||
@@ -144,13 +144,18 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
var res = Array.FindIndex(Json<LocalRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == recipeCode); | |||
if (res < 0) | |||
{ | |||
Json<LocalRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
var newRemoteRecipedata = new RemoteRecipeData() | |||
{ | |||
RecipeName = recipeName, | |||
RecipeCode = recipeCode, | |||
TrayCode = trayCode, | |||
RawMaterial = RawMaterials, | |||
}); | |||
}; | |||
Json<LocalRecipeDataColl>.Data.Recipes.Add(newRemoteRecipedata); | |||
//新增了配方之后应该默认显示出来。 | |||
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Add(newRemoteRecipedata); | |||
MessageNotify.GetInstance.ShowUserLog("新增一条本地模拟配方。"); | |||
} | |||
}); | |||
@@ -159,6 +164,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
if (MessageNotify.GetInstance.ShowDialog("请确认,是否清除所有本地配方?", DialogType.Warning)) | |||
{ | |||
Json<LocalRecipeDataColl>.Data.Recipes.Clear(); | |||
Json<LocalRecipeDataColl>.Data.SelectedRecipes.Clear(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"本地配方清空成功。"); | |||
MessageNotify.GetInstance.ShowUserLog("手动清除所有本地配方"); | |||
} | |||
@@ -181,6 +187,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
} | |||
//不保存会导致下次打开本地配方下发页面,会重新读取之前存储的文件。 | |||
Json<LocalRecipeDataColl>.Save(); | |||
MessageNotify.GetInstance.ShowUserLog("筛选了一次配方。"); | |||
}); | |||
} | |||
@@ -29,6 +29,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
var res = RawMaterialInfo.FirstOrDefault(p => p.RawMaterialLocation == pos); | |||
if (res != null) RawMaterialInfo.Remove(res); | |||
MessageNotify.GetInstance.ShowUserLog($"删除一条料仓物料配置信息,原料料仓位置:【{res.RawMaterialLocation}】,原料编号:【{res.RawMaterialName}】"); | |||
} | |||
}); | |||
SaveRawMaterialPara = new RelayCommand(() => | |||
@@ -45,6 +46,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
UpdateRawMaterial = new RelayCommand(() => | |||
{ | |||
RawMaterialInfo.Add(new RawMaterialStockBin() { RawMaterialCount = (short)(RawMaterialInfo.Count + 1)}); | |||
MessageNotify.GetInstance.ShowUserLog($"新增一条料仓物料配置信息。"); | |||
}); | |||
} | |||
public ObservableCollection<RawMaterialStockBin> RawMaterialInfo { get; set; } = new ObservableCollection<RawMaterialStockBin>(); | |||
@@ -14,6 +14,7 @@ using System.Diagnostics; | |||
using BPASmartClient.JXJFoodSmallStation.Model.WindSend; | |||
using BPASmartClient.JXJFoodSmallStation.Model.Par; | |||
using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
@@ -46,7 +47,8 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
Json<DevicePar>.Data.deviceConnectPar.Axis1Speed = Axis1Speed; | |||
Json<DevicePar>.Data.deviceConnectPar.Axis2Speed = Axis2Speed; | |||
Json<DevicePar>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"参数保存成功!"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"系统设置参数保存成功!"); | |||
MessageNotify.GetInstance.ShowUserLog("保存系统设置参数。"); | |||
}); | |||
SetParCommand = new RelayCommand(() => | |||
{ | |||
@@ -61,7 +63,8 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
//ActionManage.GetInstance.Send("AxisUnLoadSpeedSet", AxisUnLoadSpeed); | |||
//ActionManage.GetInstance.Send("Axis1SpeedSet", Axis1Speed); | |||
//ActionManage.GetInstance.Send("Axis2SpeedSet", Axis2Speed); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"参数设置成功!"); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"电机参数设置成功!"); | |||
MessageNotify.GetInstance.ShowUserLog("电机设置参数下发成功。"); | |||
}); | |||
} | |||
@@ -13,6 +13,7 @@ using BPASmartClient.CustomResource.UserControls; | |||
using System.Diagnostics; | |||
using BPASmartClient.JXJFoodSmallStation.Model.WindSend; | |||
using System.Threading; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
@@ -34,6 +35,8 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
SaveRawMaterialPara = new RelayCommand(() => | |||
{ | |||
Json<DevicePar>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"风送料仓原料信息参数保存成功!"); | |||
MessageNotify.GetInstance.ShowUserLog("风送料仓原料信息参数保存成功。"); | |||
}); | |||
} | |||