@@ -0,0 +1,24 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0-windows</TargetFramework> | |||
<Nullable>enable</Nullable> | |||
<UseWPF>true</UseWPF> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<None Remove="Image\方形背景2.png" /> | |||
<None Remove="Image\方形背景3.png" /> | |||
<None Remove="Image\背景边框\方形背景3.png" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Resource Include="Image\方形背景2.png" /> | |||
<Resource Include="Image\方形背景3.png" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Image\背景边框\" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,176 @@ | |||
<UserControl x:Class="BPASmart.RecipeManagement.MainControl" | |||
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:BPASmart.RecipeManagement" | |||
xmlns:view="clr-namespace:BPASmart.RecipeManagement.View" | |||
xmlns:vm="clr-namespace:BPASmart.RecipeManagement.ViewModel" | |||
mc:Ignorable="d" | |||
d:DesignHeight="800" d:DesignWidth="1400"> | |||
<UserControl.DataContext> | |||
<vm:MainControl/> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<Style x:Key="RadioNavigation" TargetType="RadioButton"> | |||
<Setter Property="Margin" Value="-4,0"/> | |||
<Setter Property="Background" Value="Transparent"/> | |||
<Setter Property="GroupName" Value="Navigation"/> | |||
<Setter Property="VerticalAlignment" Value="Center"/> | |||
<Setter Property="HorizontalAlignment" Value="Center"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="RadioButton"> | |||
<Border x:Name="_borderOver" Background="Transparent" Width="200" BorderBrush="Transparent" BorderThickness="0,1"> | |||
<Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}"> | |||
<TextBlock Foreground="White" Text="{TemplateBinding Content}" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center"/> | |||
</Grid> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter Property="BorderBrush" TargetName="_borderOver" Value="#1971B6"/> | |||
<Setter Property="Background" TargetName="_borderOver"> | |||
<Setter.Value> | |||
<LinearGradientBrush StartPoint="0,1" EndPoint="1,1"> | |||
<GradientStop Color="#104E8B" Offset="0"/> | |||
<GradientStop Color="#1874CD" Offset="0.4"/> | |||
<GradientStop Color="#1874CD" Offset="0.6"/> | |||
<GradientStop Color="#27408B" Offset="1"/> | |||
</LinearGradientBrush> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<Setter Property="Background" TargetName="_borderOver" > | |||
<Setter.Value> | |||
<ImageBrush ImageSource="../Image/leftImage.png"/> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<ControlTemplate x:Key="butonTempalte" TargetType="RadioButton"> | |||
<Border x:Name="_borderOver" Background="Transparent" Width="200" Height="60" BorderBrush="Transparent" BorderThickness="0,1"> | |||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter Property="BorderBrush" TargetName="_borderOver" Value="#1971B6"/> | |||
<Setter Property="Background" TargetName="_borderOver"> | |||
<Setter.Value> | |||
<LinearGradientBrush StartPoint="0,1" EndPoint="1,1"> | |||
<GradientStop Color="#104E8B" Offset="0"/> | |||
<GradientStop Color="#1874CD" Offset="0.4"/> | |||
<GradientStop Color="#1874CD" Offset="0.6"/> | |||
<GradientStop Color="#27408B" Offset="1"/> | |||
</LinearGradientBrush> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<Setter Property="Background" TargetName="_borderOver" > | |||
<Setter.Value> | |||
<ImageBrush ImageSource="../Image/leftImage.png"/> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
<Style x:Key="fonticon" TargetType="{x:Type TextBlock}"> | |||
<Setter Property="FontFamily" Value="pack://application:,,,/Font/#iconfont"/> | |||
<Setter Property="FontSize" Value="24"/> | |||
<Setter Property="Foreground" Value="White"/> | |||
<Setter Property="HorizontalAlignment" Value="Center"/> | |||
<Setter Property="VerticalAlignment" Value="Center"/> | |||
<Setter Property="Margin" Value="0,0,20,0"/> | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="*"/> | |||
<ColumnDefinition Width="6*"/> | |||
</Grid.ColumnDefinitions> | |||
<Border Grid.Row="1" Grid.RowSpan="2" BorderBrush="#1E90FF" BorderThickness="0,0,2,0"> | |||
<Border.Background> | |||
<LinearGradientBrush StartPoint="0,1" EndPoint="1,1"> | |||
<GradientStop Color="#01003B" Offset="0.2"/> | |||
<GradientStop Color="#010050" Offset="1"/> | |||
</LinearGradientBrush> | |||
</Border.Background> | |||
</Border> | |||
<StackPanel x:Name="mylistview" Background="Transparent" Grid.RowSpan="1" Grid.Row="1" | |||
ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" | |||
MouseLeftButtonDown="mylistview_MouseDown" > | |||
<RadioButton Style="{DynamicResource RadioNavigation}" IsChecked="True" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="OrderManager"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="订单管理" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton> | |||
<RadioButton Style="{DynamicResource RadioNavigation}" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="RecipeManager"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="配方管理" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton> | |||
<RadioButton Style="{DynamicResource RadioNavigation}" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="MaterialManager"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="原料管理" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton> | |||
<RadioButton Style="{DynamicResource RadioNavigation}" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="PowerManager"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="权限分配" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton> | |||
</StackPanel> | |||
<ContentControl x:Name="contentRegion" Grid.Column="1" Grid.Row="1" Background="#01003B" BorderBrush="Transparent"> | |||
<view:OrderManager/> | |||
</ContentControl> | |||
</Grid> | |||
</UserControl> |
@@ -0,0 +1,51 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Reflection; | |||
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 BPASmart.RecipeManagement | |||
{ | |||
/// <summary> | |||
/// MainControl.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class MainControl : UserControl | |||
{ | |||
public MainControl() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private void mylistview_MouseDown(object sender, MouseButtonEventArgs e) | |||
{ | |||
} | |||
private void NavButton_Click(object sender, RoutedEventArgs e) | |||
{ | |||
try | |||
{ | |||
if (sender is RadioButton bt) | |||
{ | |||
Type type = Type.GetType($"BPASmart.RecipeManagement.View.{bt.Tag?.ToString()}"); | |||
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes); | |||
contentRegion.Content = (FrameworkElement)cti.Invoke(null); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
} | |||
} | |||
} | |||
} |
@@ -12,88 +12,9 @@ | |||
<vm:MainWindowViewModel/> | |||
</Window.DataContext> | |||
<Window.Resources> | |||
<Style x:Key="fonticon" TargetType="{x:Type TextBlock}"> | |||
<Setter Property="FontFamily" Value="pack://application:,,,/Font/#iconfont"/> | |||
<Setter Property="FontSize" Value="24"/> | |||
<Setter Property="Foreground" Value="White"/> | |||
<Setter Property="HorizontalAlignment" Value="Center"/> | |||
<Setter Property="VerticalAlignment" Value="Center"/> | |||
<Setter Property="Margin" Value="0,0,20,0"/> | |||
</Style> | |||
<Style x:Key="RadioNavigation" TargetType="RadioButton"> | |||
<Setter Property="Margin" Value="-4,0"/> | |||
<Setter Property="Background" Value="Transparent"/> | |||
<Setter Property="GroupName" Value="Navigation"/> | |||
<Setter Property="VerticalAlignment" Value="Center"/> | |||
<Setter Property="HorizontalAlignment" Value="Center"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="RadioButton"> | |||
<Border x:Name="_borderOver" Background="Transparent" Width="200" BorderBrush="Transparent" BorderThickness="0,1"> | |||
<Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}"> | |||
<TextBlock Foreground="White" Text="{TemplateBinding Content}" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center"/> | |||
</Grid> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter Property="BorderBrush" TargetName="_borderOver" Value="#1971B6"/> | |||
<Setter Property="Background" TargetName="_borderOver"> | |||
<Setter.Value> | |||
<LinearGradientBrush StartPoint="0,1" EndPoint="1,1"> | |||
<GradientStop Color="#104E8B" Offset="0"/> | |||
<GradientStop Color="#1874CD" Offset="0.4"/> | |||
<GradientStop Color="#1874CD" Offset="0.6"/> | |||
<GradientStop Color="#27408B" Offset="1"/> | |||
</LinearGradientBrush> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<Setter Property="Background" TargetName="_borderOver" > | |||
<Setter.Value> | |||
<ImageBrush ImageSource="../Image/leftImage.png"/> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<ControlTemplate x:Key="butonTempalte" TargetType="RadioButton"> | |||
<Border x:Name="_borderOver" Background="Transparent" Width="200" Height="60" BorderBrush="Transparent" BorderThickness="0,1"> | |||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter Property="BorderBrush" TargetName="_borderOver" Value="#1971B6"/> | |||
<Setter Property="Background" TargetName="_borderOver"> | |||
<Setter.Value> | |||
<LinearGradientBrush StartPoint="0,1" EndPoint="1,1"> | |||
<GradientStop Color="#104E8B" Offset="0"/> | |||
<GradientStop Color="#1874CD" Offset="0.4"/> | |||
<GradientStop Color="#1874CD" Offset="0.6"/> | |||
<GradientStop Color="#27408B" Offset="1"/> | |||
</LinearGradientBrush> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<Setter Property="Background" TargetName="_borderOver" > | |||
<Setter.Value> | |||
<ImageBrush ImageSource="../Image/leftImage.png"/> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Window.Resources> | |||
<Grid > | |||
<Grid.ColumnDefinitions> | |||
@@ -150,91 +71,10 @@ | |||
</Style> | |||
</Button.Style> | |||
</Button> | |||
<Grid Grid.Row="1" Grid.ColumnSpan="2"> | |||
<local:MainControl/> | |||
</Grid> | |||
<Border Grid.Row="1" Grid.RowSpan="2" BorderBrush="#1E90FF" BorderThickness="0,0,2,0"> | |||
<Border.Background> | |||
<LinearGradientBrush StartPoint="0,1" EndPoint="1,1"> | |||
<GradientStop Color="#01003B" Offset="0.2"/> | |||
<GradientStop Color="#010050" Offset="1"/> | |||
</LinearGradientBrush> | |||
</Border.Background> | |||
</Border> | |||
<StackPanel x:Name="mylistview" Background="Transparent" Grid.RowSpan="1" Grid.Row="1" | |||
ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" | |||
MouseLeftButtonDown="mylistview_MouseDown" > | |||
<RadioButton Style="{DynamicResource RadioNavigation}" IsChecked="True" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="OrderManager"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="订单管理" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton> | |||
<RadioButton Style="{DynamicResource RadioNavigation}" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="RecipeManager"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="配方管理" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton> | |||
<RadioButton Style="{DynamicResource RadioNavigation}" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="MaterialManager"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="原料管理" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton> | |||
<!--<RadioButton Style="{DynamicResource RadioNavigation}" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="TechnologySetting"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="工艺参数" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton>--> | |||
<RadioButton Style="{DynamicResource RadioNavigation}" Template="{DynamicResource butonTempalte }" | |||
Click="NavButton_Click" Tag="PowerManager"> | |||
<Grid Background="Transparent" > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto"/> | |||
<ColumnDefinition Width="*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="" Style="{DynamicResource fonticon}"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="权限分配" FontSize="24" Background="Transparent" | |||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="楷体"/> | |||
</Grid> | |||
</RadioButton> | |||
</StackPanel> | |||
<ContentControl x:Name="contentRegion" Grid.Column="1" Grid.Row="1" Background="#01003B" BorderBrush="Transparent"> | |||
<view:OrderManager/> | |||
</ContentControl> | |||
</Grid> | |||
</Window> |
@@ -38,10 +38,6 @@ namespace BPASmart.RecipeManagement | |||
} | |||
private void mylistview_MouseDown(object sender, MouseButtonEventArgs e) | |||
{ | |||
this.DragMove(); | |||
} | |||
private void Button_Click(object sender, RoutedEventArgs e) | |||
{ | |||
@@ -49,22 +45,7 @@ namespace BPASmart.RecipeManagement | |||
} | |||
private void NavButton_Click(object sender, RoutedEventArgs e) | |||
{ | |||
try | |||
{ | |||
if (sender is RadioButton bt) | |||
{ | |||
Type type = Type.GetType($"BPASmart.RecipeManagement.View.{bt.Tag?.ToString()}"); | |||
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes); | |||
contentRegion.Content = (FrameworkElement)cti.Invoke(null); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
} | |||
} | |||
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) | |||
{ | |||
@@ -117,9 +117,12 @@ | |||
</Grid> | |||
</ScrollViewer> | |||
<Button Grid.Row="4" Content="配方工艺" Style="{DynamicResource ButtonStyle}" | |||
Height="20" Width="80" HorizontalAlignment="Right" VerticalAlignment="Top" | |||
<Button Grid.Row="4" Content="配方下发" Style="{DynamicResource GreenButton}" BorderBrush="Green" BorderThickness="1" | |||
Height="20" Width="70" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,5,0" | |||
Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=DataContext.PecipeStartCommand}" | |||
CommandParameter="{Binding ID}"/> | |||
<Button Grid.Row="4" Content="配方工艺" Style="{DynamicResource ButtonStyle}" | |||
Height="20" Width="70" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5,0,0,0" | |||
Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor},Path=DataContext.PecipeSettingCommand}" | |||
CommandParameter="{Binding ID}"/> | |||
</Grid> | |||
@@ -0,0 +1,20 @@ | |||
using BPASmart.Model; | |||
using BPASmartClient.Helper; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmart.RecipeManagement.ViewModel | |||
{ | |||
public class MainControl:ObservableObject | |||
{ | |||
public MainControl() | |||
{ | |||
Json<LocalMaterails>.Read(); | |||
Json<LocalRecipes>.Read(); | |||
} | |||
} | |||
} |
@@ -14,8 +14,7 @@ namespace BPASmart.RecipeManagement.ViewModel | |||
public MainWindowViewModel() | |||
{ | |||
Json<LocalMaterails>.Read(); | |||
Json<LocalRecipes>.Read(); | |||
} | |||
} | |||
@@ -16,12 +16,22 @@ namespace BPASmart.RecipeManagement.ViewModel | |||
public class RecipeManagerViewModel : ObservableObject | |||
{ | |||
public ObservableCollection<Recipes> RecipeList { get; set; } = Json<LocalRecipes>.Data.locaRecipes; | |||
/// <summary> | |||
/// 创建配方 | |||
/// </summary> | |||
public RelayCommand CreateRecipeCommand { get; set; } | |||
public RelayCommand<object> EditRecipeCommand { get; set; } | |||
public RelayCommand<object> DeleteRecipeCommand { get; set; } | |||
/// <summary> | |||
/// 配方工艺 | |||
/// </summary> | |||
public RelayCommand<object> PecipeSettingCommand { get; set; } | |||
/// <summary> | |||
/// 配方下发 | |||
/// </summary> | |||
public RelayCommand<object> PecipeStartCommand { get; set; } | |||
private void EditRecipe(object o) | |||
{ | |||
@@ -62,6 +72,21 @@ namespace BPASmart.RecipeManagement.ViewModel | |||
} | |||
} | |||
private void PecipeStart(object o) | |||
{ | |||
if (o == null) return; | |||
if (o is string id) | |||
{ | |||
var res = Json<LocalRecipes>.Data.locaRecipes.FirstOrDefault(p => p.ID == id); | |||
if (res != null) | |||
{ | |||
//下发配方 | |||
} | |||
} | |||
} | |||
public RecipeManagerViewModel() | |||
{ | |||
CreateRecipeCommand = new RelayCommand(() => | |||
@@ -77,6 +102,8 @@ namespace BPASmart.RecipeManagement.ViewModel | |||
PecipeSettingCommand = new RelayCommand<object>(PecipeSetting); | |||
PecipeStartCommand = new RelayCommand<object>(PecipeStart); | |||
} | |||
} | |||
} |
@@ -6,17 +6,23 @@ | |||
<Application.Resources> | |||
<SolidColorBrush x:Key="commanTextblock" Color="#FF2AB2E7"/> | |||
<SolidColorBrush x:Key="selectedColor" Color=" #4169E1"/> | |||
<SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="#F4F4F4"/> | |||
<!--#region ScrollViewer--> | |||
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}"> | |||
<Setter Property="SnapsToDevicePixels" Value="True" /> | |||
<Setter Property="OverridesDefaultStyle" Value="true" /> | |||
<Setter Property="IsTabStop" Value="false" /> | |||
<Setter Property="Focusable" Value="false" /> | |||
<Setter Property="OverridesDefaultStyle" Value="true"/> | |||
<Setter Property="IsTabStop" Value="false"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type Thumb}"> | |||
<Border CornerRadius="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" /> | |||
<!--滚动条颜色和圆角设置--> | |||
<Rectangle Name="thumbRect" Fill="#03ffea" RadiusX="3" RadiusY="3"/> | |||
<!--鼠标拉动滚动条时的颜色--> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter Property="Fill" Value="CornflowerBlue" TargetName="thumbRect" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
@@ -69,7 +75,40 @@ | |||
<ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/> | |||
</Grid> | |||
</ControlTemplate> | |||
<ControlTemplate x:Key="MyScrollViewer" TargetType="{x:Type ScrollViewer}"> | |||
<!--View区域背景色--> | |||
<Grid x:Name="Grid" Background="{TemplateBinding Background}"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="*"/> | |||
<ColumnDefinition Width="Auto"/> | |||
</Grid.ColumnDefinitions> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="*"/> | |||
<RowDefinition Height="Auto"/> | |||
</Grid.RowDefinitions> | |||
<Rectangle x:Name="Corner" Grid.Column="1" Fill="White" Grid.Row="1"/> | |||
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/> | |||
<ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource MyScrollBarStyle}"/> | |||
<ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" Style="{DynamicResource MyScrollBarStyle}"/> | |||
</Grid> | |||
</ControlTemplate> | |||
<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> | |||
<Setter Property="OverridesDefaultStyle" Value="true"/> | |||
<Setter Property="Background" Value="Transparent"/> | |||
<Setter Property="Focusable" Value="false"/> | |||
<Setter Property="IsTabStop" Value="false"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type RepeatButton}"> | |||
<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<!--#endregion--> | |||
<!--#region右键菜单--> | |||
<Style TargetType="{x:Type ContextMenu}"> | |||
<Setter Property="Template"> | |||
@@ -201,6 +240,28 @@ | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="ButtontextStyle" TargetType="Button"> | |||
<Setter Property="Background" Value="Transparent"/> | |||
<Setter Property="Foreground" Value="#FF2AB2E7"/> | |||
<Setter Property="BorderBrush" Value="Transparent"/> | |||
<Setter Property="BorderThickness" Value="0"/> | |||
<Setter Property="FontSize" Value="14"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type Button}"> | |||
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"> | |||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter TargetName="border" Property="Background" Value="Transparent"/> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<!--#endregion--> | |||
<!--#region 用户输入框样式--> | |||
@@ -281,7 +342,8 @@ | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<!--#endregion--> | |||
<!--#region 密码输入框样式--> | |||
<Style x:Key="PasswordBoxStyle" TargetType="{x:Type PasswordBox}"> | |||
<Setter Property="Background" Value="Transparent" /> | |||
@@ -372,6 +434,300 @@ | |||
</Style> | |||
<!--#endregion--> | |||
<!--#region Combox--> | |||
<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}"> | |||
<Grid Height="25" HorizontalAlignment="Stretch" Background="Transparent"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="*" /> | |||
<ColumnDefinition Width="30" /> | |||
</Grid.ColumnDefinitions> | |||
<Border | |||
Grid.ColumnSpan="2" | |||
Background="White" | |||
Opacity="0" /> | |||
<Path | |||
x:Name="Arrow" | |||
Grid.Column="1" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Data="M 0 0 6 6 12 0 Z" | |||
Fill="#FF2AB2E7" | |||
Stretch="None"> | |||
<Path.Effect> | |||
<DropShadowEffect | |||
BlurRadius="10" | |||
Direction="90" | |||
Opacity="1" | |||
RenderingBias="Quality" | |||
ShadowDepth="0" | |||
Color="Transparent" /> | |||
</Path.Effect> | |||
</Path> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsChecked" Value="true"> | |||
<Setter TargetName="Arrow" Property="RenderTransform"> | |||
<Setter.Value> | |||
<RotateTransform Angle="180" CenterX="6" CenterY="3" /> | |||
</Setter.Value> | |||
</Setter> | |||
<Setter TargetName="Arrow" Property="Margin" Value="0,0,0,2" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
<Style x:Key="CommonCombox" TargetType="{x:Type ComboBox}"> | |||
<Setter Property="BorderThickness" Value="1" /> | |||
<Setter Property="Background" Value=" #041039"/> | |||
<Setter Property="BorderBrush" Value="#FF2AB2E7"/> | |||
<Setter Property="BorderThickness" Value="1"/> | |||
<Setter Property="ItemContainerStyle"> | |||
<Setter.Value> | |||
<Style TargetType="ComboBoxItem"> | |||
<Setter Property="Height" Value="25" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ComboBoxItem}"> | |||
<Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" > | |||
<Border x:Name="_borderbg" Background=" #041039" BorderBrush="#FF2AB2E7" BorderThickness="0"/> | |||
<TextBlock | |||
x:Name="_txt" | |||
Margin="5,0,3,0" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
Foreground="#FF2AB2E7" | |||
Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" /> | |||
<Border | |||
x:Name="_border" | |||
Background="Transparent" | |||
Opacity="0" /> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsSelected" Value="false" /> | |||
<Condition Property="IsMouseOver" Value="true" /> | |||
</MultiTrigger.Conditions> | |||
<Setter TargetName="_borderbg" Property="Background" Value="#37405E" /> | |||
<Setter TargetName="_borderbg" Property="BorderBrush" Value="white" /> | |||
<Setter TargetName="_borderbg" Property="BorderThickness" Value="1" /> | |||
<Setter TargetName="_txt" Property="Foreground" Value="white" /> | |||
</MultiTrigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsSelected" Value="true" /> | |||
</MultiTrigger.Conditions> | |||
<Setter TargetName="_borderbg" Property="Background" Value="#022352" /> | |||
<Setter TargetName="_borderbg" Property="BorderBrush" Value=" #00BFFF" /> | |||
<Setter TargetName="_borderbg" Property="BorderThickness" Value="1" /> | |||
<Setter TargetName="_txt" Property="Foreground" Value="white" /> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</Setter.Value> | |||
</Setter> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ComboBox}"> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.7*" /> | |||
<ColumnDefinition Width="0.3*" MaxWidth="30" /> | |||
</Grid.ColumnDefinitions> | |||
<Border | |||
x:Name="_prybr" | |||
Grid.Column="0" | |||
Grid.ColumnSpan="2" | |||
BorderBrush="{TemplateBinding BorderBrush}" | |||
BorderThickness="{TemplateBinding BorderThickness}" | |||
CornerRadius="0" /> | |||
<ContentPresenter | |||
x:Name="ContentSite" | |||
Margin="3,3,0,3" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Content="{TemplateBinding SelectionBoxItem}" | |||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" | |||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" | |||
IsHitTestVisible="False" /> | |||
<!-- ToggleButton 已数据绑定到 ComboBox 本身以切换 IsDropDownOpen --> | |||
<ToggleButton | |||
Background="Transparent" | |||
x:Name="ToggleButton" | |||
Grid.Column="0" | |||
Grid.ColumnSpan="2" | |||
ClickMode="Press" | |||
Focusable="false" | |||
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" | |||
Template="{StaticResource ComboBoxToggleButton}" /> | |||
<!-- 必须将 TextBox 命名为 PART_EditableTextBox,否则 ComboBox 将无法识别它 --> | |||
<TextBox | |||
x:Name="PART_EditableTextBox" | |||
Margin="2,0,0,0" | |||
VerticalAlignment="Center" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
CaretBrush="{TemplateBinding Foreground}" | |||
Focusable="True" | |||
Foreground="{TemplateBinding Foreground}" | |||
IsReadOnly="{TemplateBinding IsReadOnly}" | |||
Visibility="Hidden" /> | |||
<!-- Popup 可显示 ComboBox 中的项列表。IsOpen 已数据绑定到通过 ComboBoxToggleButton 来切换的 IsDropDownOpen --> | |||
<Popup | |||
x:Name="Popup" | |||
AllowsTransparency="True" | |||
Focusable="False" | |||
IsOpen="{TemplateBinding IsDropDownOpen}" | |||
Placement="Bottom" | |||
PopupAnimation="Slide"> | |||
<Grid | |||
x:Name="DropDown" | |||
MinWidth="{TemplateBinding ActualWidth}" | |||
MaxHeight="150" | |||
SnapsToDevicePixels="True"> | |||
<Border | |||
x:Name="DropDownBorder" | |||
BorderBrush="Black" | |||
BorderThickness="0" /> | |||
<ScrollViewer | |||
Margin="1" | |||
CanContentScroll="True" | |||
HorizontalScrollBarVisibility="Hidden" | |||
SnapsToDevicePixels="True" | |||
VerticalScrollBarVisibility="Auto" | |||
Template="{DynamicResource MyScrollViewer }"> | |||
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True --> | |||
<!-- 一下可以设置列表背景色 --> | |||
<StackPanel | |||
Background="{TemplateBinding Background}" | |||
IsItemsHost="True" | |||
KeyboardNavigation.DirectionalNavigation="Contained"/> | |||
</ScrollViewer> | |||
</Grid> | |||
</Popup> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsEditable" Value="true"> | |||
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" /> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter TargetName="_prybr" Property="BorderBrush" Value="#aa3ba7f2" /> | |||
</Trigger> | |||
<Trigger Property="IsEnabled" Value="False"> | |||
<Setter TargetName="ContentSite" Property="Opacity" Value="0.6" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<!--滚动条颜色、圆角等设置--> | |||
<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}"> | |||
<Setter Property="OverridesDefaultStyle" Value="true"/> | |||
<Setter Property="Background" Value="Transparent"/> | |||
<Setter Property="Focusable" Value="false"/> | |||
<Setter Property="IsTabStop" Value="false"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type RepeatButton}"> | |||
<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="MyScrollBarStyle" TargetType="{x:Type ScrollBar}"> | |||
<Setter Property="Background" Value="AliceBlue"/> | |||
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/> | |||
<Setter Property="Stylus.IsFlicksEnabled" Value="false"/> | |||
<!--滚动条宽度--> | |||
<Setter Property="Width" Value="8"/> | |||
<Setter Property="MinWidth" Value="6"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ScrollBar}"> | |||
<!--滚动条背景色--> | |||
<Grid x:Name="Bg" Background="#001f55" SnapsToDevicePixels="true" Width="8"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}"> | |||
<Track.DecreaseRepeatButton> | |||
<RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/> | |||
</Track.DecreaseRepeatButton> | |||
<Track.IncreaseRepeatButton> | |||
<RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/> | |||
</Track.IncreaseRepeatButton> | |||
<Track.Thumb> | |||
<Thumb Style="{StaticResource ScrollBarThumb}"/> | |||
</Track.Thumb> | |||
</Track> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsEnabled" Value="false"> | |||
<Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
<Style.Triggers> | |||
<Trigger Property="Orientation" Value="Horizontal"> | |||
<Setter Property="Width" Value="Auto"/> | |||
<Setter Property="MinWidth" Value="0"/> | |||
<Setter Property="Height" Value="6"/> | |||
<Setter Property="MinHeight" Value="6"/> | |||
<Setter Property="Background" Value="AliceBlue"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ScrollBar}"> | |||
<Grid x:Name="Bg" Background="Red" SnapsToDevicePixels="true"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}"> | |||
<Track.DecreaseRepeatButton> | |||
<RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/> | |||
</Track.DecreaseRepeatButton> | |||
<Track.IncreaseRepeatButton> | |||
<RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/> | |||
</Track.IncreaseRepeatButton> | |||
<Track.Thumb> | |||
<Thumb Style="{StaticResource ScrollBarThumb}" /> | |||
</Track.Thumb> | |||
</Track> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsEnabled" Value="false"> | |||
<Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
</Style.Triggers> | |||
</Style> | |||
<!--#endregion--> | |||
<Style x:Key="CommonTextBox" TargetType="{x:Type TextBox}"> | |||
<Setter Property="Foreground" Value="Orange"/> | |||
<Setter Property="Background" Value="Transparent"/> | |||
@@ -17,12 +17,18 @@ | |||
<None Remove="Image\信息边框.png" /> | |||
<None Remove="Image\图层1.png" /> | |||
<None Remove="Image\图层2.png" /> | |||
<None Remove="Image\圆形按钮背景.png" /> | |||
<None Remove="Image\圆形按钮背景1.png" /> | |||
<None Remove="Image\圆形按钮背景2.png" /> | |||
<None Remove="Image\容器边框.png" /> | |||
<None Remove="Image\尺条框.png" /> | |||
<None Remove="Image\成功提示.png" /> | |||
<None Remove="Image\按钮背景.png" /> | |||
<None Remove="Image\文字背景1.png" /> | |||
<None Remove="Image\文字背景2.png" /> | |||
<None Remove="Image\方形.png" /> | |||
<None Remove="Image\方形背景.png" /> | |||
<None Remove="Image\方形背景3.png" /> | |||
<None Remove="Image\权限背景.png" /> | |||
<None Remove="Image\用户名边框.png" /> | |||
<None Remove="Image\用户名边框1.png" /> | |||
@@ -41,12 +47,18 @@ | |||
<Resource Include="Image\信息边框.png" /> | |||
<Resource Include="Image\图层1.png" /> | |||
<Resource Include="Image\图层2.png" /> | |||
<Resource Include="Image\圆形按钮背景.png" /> | |||
<Resource Include="Image\圆形按钮背景1.png" /> | |||
<Resource Include="Image\圆形按钮背景2.png" /> | |||
<Resource Include="Image\容器边框.png" /> | |||
<Resource Include="Image\尺条框.png" /> | |||
<Resource Include="Image\成功提示.png" /> | |||
<Resource Include="Image\按钮背景.png" /> | |||
<Resource Include="Image\文字背景1.png" /> | |||
<Resource Include="Image\文字背景2.png" /> | |||
<Resource Include="Image\方形.png" /> | |||
<Resource Include="Image\方形背景.png" /> | |||
<Resource Include="Image\方形背景3.png" /> | |||
<Resource Include="Image\权限背景.png" /> | |||
<Resource Include="Image\用户名边框.png" /> | |||
<Resource Include="Image\用户名边框1.png" /> | |||
@@ -61,6 +73,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPASmart.CustomResource\BPASmart.CustomResource.csproj" /> | |||
<ProjectReference Include="..\BPASmart.Model\BPASmart.Model.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" /> | |||
</ItemGroup> | |||
@@ -1,4 +1,5 @@ | |||
using System; | |||
using BPASmart.Model; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
@@ -9,5 +10,7 @@ namespace BPASmart.UserManagement.Globle | |||
public static class GlobleData | |||
{ | |||
public static UserManager ChangeUser = new UserManager(); | |||
public static UserManager EditUser = new UserManager(); | |||
} | |||
} |
@@ -0,0 +1,50 @@ | |||
<UserControl x:Class="BPASmart.UserManagement.MainControl" | |||
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:BPASmart.UserManagement" | |||
xmlns:view="clr-namespace:BPASmart.UserManagement.View" | |||
mc:Ignorable="d" | |||
d:DesignHeight="600" d:DesignWidth="1000"> | |||
<Grid > | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="200"/> | |||
<ColumnDefinition Width="81*"/> | |||
<ColumnDefinition Width="319*"/> | |||
</Grid.ColumnDefinitions> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40"/> | |||
<RowDefinition Height="*"/> | |||
</Grid.RowDefinitions> | |||
<Border Grid.RowSpan="2" Background="Transparent" BorderBrush="#1E90FF" BorderThickness="0,0,1,0"> | |||
<view:UserList/> | |||
</Border> | |||
<Border Grid.RowSpan="2" Grid.Column="1" Grid.ColumnSpan="2"> | |||
<Border.Background> | |||
<ImageBrush ImageSource="../Image/背景4.png"/> | |||
</Border.Background> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40"/> | |||
<RowDefinition Height="*"/> | |||
</Grid.RowDefinitions> | |||
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"> | |||
<Image Source="../Image/图层2.png" Width="100" Height="40"/> | |||
<Button HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10,0" Padding="10,3" FontSize="18" | |||
Content="注册新用户" Style="{DynamicResource ButtonStyle}" Click="NewUser_Click" /> | |||
<Image Source="../Image/图层2.png" Width="100"/> | |||
</StackPanel> | |||
<ContentControl Grid.Row="1" x:Name="mainContent" Background="Transparent" > | |||
</ContentControl> | |||
</Grid> | |||
</Border> | |||
</Grid> | |||
</UserControl> |
@@ -0,0 +1,54 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Reflection; | |||
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 BPASmart.UserManagement | |||
{ | |||
/// <summary> | |||
/// MainControl.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class MainControl : UserControl | |||
{ | |||
public MainControl() | |||
{ | |||
InitializeComponent(); | |||
ActionManage.GetInstance.Register(new Action<object>((o) => { | |||
if (o == null) | |||
{ | |||
return; | |||
} | |||
if (o == string.Empty) | |||
{ | |||
mainContent.Content = null; | |||
return; | |||
} | |||
if (o is string pageName) | |||
{ | |||
Type type = Type.GetType($"BPASmart.UserManagement.View.{pageName}"); | |||
if (type == null) { return; } | |||
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes); | |||
mainContent.Content = (FrameworkElement)cti.Invoke(null); | |||
} | |||
}), "ChangeMianContent"); | |||
} | |||
private void NewUser_Click(object sender, RoutedEventArgs e) | |||
{ | |||
ActionManage.GetInstance.Send("ChangeMianContent", "AddNewUser"); | |||
} | |||
} | |||
} |
@@ -66,47 +66,11 @@ | |||
</Grid> | |||
</Border> | |||
<Grid Grid.Row="1"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="200"/> | |||
<ColumnDefinition Width="81*"/> | |||
<ColumnDefinition Width="319*"/> | |||
</Grid.ColumnDefinitions> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40"/> | |||
<RowDefinition Height="*"/> | |||
</Grid.RowDefinitions> | |||
<Border Grid.RowSpan="2" Background="Transparent" BorderBrush="#1E90FF" BorderThickness="0,0,1,0"> | |||
<view:UserList/> | |||
</Border> | |||
<local:MainControl/> | |||
<Border Grid.RowSpan="2" Grid.Column="1" Grid.ColumnSpan="2"> | |||
<Border.Background> | |||
<ImageBrush ImageSource="../Image/背景4.png"/> | |||
</Border.Background> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40"/> | |||
<RowDefinition Height="*"/> | |||
</Grid.RowDefinitions> | |||
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"> | |||
<Image Source="../Image/图层2.png" Width="100" Height="40"/> | |||
<Button HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10,0" Padding="10,3" FontSize="18" | |||
Content="注册新用户" Style="{DynamicResource ButtonStyle}" Click="NewUser_Click" /> | |||
<Image Source="../Image/图层2.png" Width="100"/> | |||
</StackPanel> | |||
<ContentControl Grid.Row="1" x:Name="mainContent" Background="Transparent" > | |||
</ContentControl> | |||
</Grid> | |||
</Border> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
</Border> | |||
@@ -36,26 +36,6 @@ namespace BPASmart.UserManagement | |||
} | |||
}; | |||
ActionManage.GetInstance.Register(new Action<object>((o) => { | |||
if (o == null) | |||
{ | |||
return; | |||
} | |||
if(o == string.Empty) | |||
{ | |||
mainContent.Content = null; | |||
return; | |||
} | |||
if(o is string pageName) | |||
{ | |||
Type type = Type.GetType($"BPASmart.UserManagement.View.{pageName}"); | |||
if (type == null) { return; } | |||
ConstructorInfo cti = type.GetConstructor(System.Type.EmptyTypes); | |||
mainContent.Content = (FrameworkElement)cti.Invoke(null); | |||
} | |||
}), "ChangeMianContent"); | |||
} | |||
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) | |||
@@ -70,9 +50,6 @@ namespace BPASmart.UserManagement | |||
private void NewUser_Click(object sender, RoutedEventArgs e) | |||
{ | |||
ActionManage.GetInstance.Send("ChangeMianContent", "AddNewUser"); | |||
} | |||
} | |||
} |
@@ -4,15 +4,278 @@ | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmart.UserManagement.View" | |||
xmlns:vm="clr-namespace:BPASmart.UserManagement.ViewModel" | |||
mc:Ignorable="d" | |||
d:DesignHeight="450" d:DesignWidth="800" FontFamily="楷体"> | |||
<Border> | |||
<UserControl.DataContext> | |||
<vm:EditPowerViewModel/> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<Style x:Key="ItemContainer" TargetType="{x:Type ListBoxItem}"> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ListBoxItem}"> | |||
<Border x:Name="IconBorder" Background="Transparent" CornerRadius="4" BorderThickness="0"> | |||
<ContentPresenter /> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsSelected" Value="true"> | |||
<Setter TargetName="IconBorder" Property="BitmapEffect"> | |||
<Setter.Value> | |||
<OuterGlowBitmapEffect GlowColor="Transparent" GlowSize="5" /> | |||
</Setter.Value> | |||
</Setter> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</UserControl.Resources> | |||
<Border Margin="10,20"> | |||
<Border.Background> | |||
<ImageBrush ImageSource="../image/方形背景.png"/> | |||
<ImageBrush ImageSource="pack://application:,,,/BPASmart.CustomResource;component/Image/方形背景2.png"/> | |||
</Border.Background> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="18*"/> | |||
<RowDefinition Height="391*"/> | |||
</Grid.RowDefinitions> | |||
<TextBlock Text="权限编辑" | |||
FontSize="18" Foreground="#F0FFF0" | |||
HorizontalAlignment="Center" VerticalAlignment="Center" Width="72"/> | |||
<Grid Grid.Row="1"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="3*"/> | |||
<RowDefinition Height="40*"/> | |||
<RowDefinition Height="328*"/> | |||
</Grid.RowDefinitions> | |||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,2" | |||
HorizontalAlignment="Center" VerticalAlignment="Center"> | |||
<TextBlock Text="用户名:" Foreground="{DynamicResource commanTextblock}" FontSize="18" | |||
HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
<ComboBox Width="120" Margin="20,0" ItemsSource="{Binding UserNames}" SelectedItem="{Binding CurrentUserName}" FontSize="16" Foreground="{DynamicResource commanTextblock}" | |||
Style="{DynamicResource CommonCombox}"/> | |||
<Button Content="保存" Style="{DynamicResource CommonButton}" Width="100" FontSize="18" Command="{Binding SaveUserPowerCommand}" Margin="10,0"/> | |||
<Button Content="取消" Style="{DynamicResource CommonButton}" Width="100" FontSize="18" Command="{Binding CancelCommand}" Margin="10,0"/> | |||
</StackPanel> | |||
<Grid Grid.Row="2" Margin="5"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.15*"/> | |||
<ColumnDefinition Width="*"/> | |||
<ColumnDefinition Width="0.35*"/> | |||
<ColumnDefinition Width="*"/> | |||
<ColumnDefinition Width="0.15*"/> | |||
</Grid.ColumnDefinitions> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="14*"/> | |||
<RowDefinition Height="1*"/> | |||
</Grid.RowDefinitions> | |||
<!--#region 界面列表--> | |||
<Border Grid.Column="1" Margin="20,0,20,0"> | |||
<Border.Background> | |||
<ImageBrush ImageSource="../Image/方形背景3.png"/> | |||
</Border.Background> | |||
<ScrollViewer CanContentScroll="True" Template="{DynamicResource ScrollViewerControlTemplate1}" | |||
Width="auto" Margin="10" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> | |||
<ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}" | |||
ItemsSource="{Binding pageList}" > | |||
<ListBox.Template> | |||
<ControlTemplate> | |||
<StackPanel Background="Transparent" IsItemsHost="True"></StackPanel> | |||
</ControlTemplate> | |||
</ListBox.Template> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<Button Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Style="{DynamicResource ButtontextStyle}" | |||
Command="{Binding DataContext.AddPageCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}" | |||
CommandParameter="{Binding Name}"> | |||
<Border x:Name="leftborder" Width="130" HorizontalAlignment="Center" Margin="5"> | |||
<Border.Background> | |||
<ImageBrush ImageSource="../Image/文字背景2.png"/> | |||
</Border.Background> | |||
<TextBlock Text="{Binding Name}" Margin="8" | |||
FontSize="18" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
</Border> | |||
</Button> | |||
<DataTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Width" Value="160" TargetName="leftborder"/> | |||
</Trigger> | |||
</DataTemplate.Triggers> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</ScrollViewer> | |||
</Border> | |||
<!--#endregion--> | |||
<Grid Grid.Column="2"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<Button Width="80" Height="80" Command="{Binding AddAllPageCommand}"> | |||
<Button.Template> | |||
<ControlTemplate TargetType="{x:Type Button}"> | |||
<Border > | |||
<Grid> | |||
<StackPanel Orientation="Vertical" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" > | |||
<TextBlock Text="全部" FontSize="20" Foreground="{DynamicResource commanTextblock}"/> | |||
<TextBlock Text="添加" FontSize="20" Foreground="{DynamicResource commanTextblock}"/> | |||
</StackPanel> | |||
<Border> | |||
<Border.Background> | |||
<ImageBrush x:Name="image" ImageSource="../Image/圆形按钮背景2.png"> | |||
</ImageBrush> | |||
</Border.Background> | |||
<Border.Style> | |||
<Style TargetType="Border"> | |||
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/> | |||
<Setter Property="RenderTransform"> | |||
<Setter.Value> | |||
<TransformGroup> | |||
<RotateTransform/> | |||
</TransformGroup> | |||
</Setter.Value> | |||
</Setter> | |||
<Style.Triggers> | |||
<EventTrigger RoutedEvent="Loaded" > | |||
<EventTrigger.Actions> | |||
<BeginStoryboard x:Name="run1"> | |||
<Storyboard RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.Children[0].Angle"> | |||
<DoubleAnimation From="0" To="360" Duration="0:0:6"/> | |||
</Storyboard> | |||
</BeginStoryboard> | |||
<PauseStoryboard BeginStoryboardName="run1"/> | |||
</EventTrigger.Actions> | |||
</EventTrigger> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Trigger.EnterActions> | |||
<ResumeStoryboard BeginStoryboardName="run1"/> | |||
</Trigger.EnterActions> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="False"> | |||
<Trigger.EnterActions> | |||
<PauseStoryboard BeginStoryboardName="run1"/> | |||
</Trigger.EnterActions> | |||
</Trigger> | |||
</Style.Triggers> | |||
</Style> | |||
</Border.Style> | |||
</Border> | |||
</Grid> | |||
</Border> | |||
</ControlTemplate> | |||
</Button.Template> | |||
</Button> | |||
<Button Grid.Row="1" Width="80" Height="80" Command="{Binding DeleteAllPageCommand}"> | |||
<Button.Template> | |||
<ControlTemplate TargetType="{x:Type Button}"> | |||
<Border > | |||
<Grid> | |||
<StackPanel Orientation="Vertical" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" > | |||
<TextBlock Text="全部" FontSize="20" Foreground="{DynamicResource commanTextblock}"/> | |||
<TextBlock Text="移除" FontSize="20" Foreground="{DynamicResource commanTextblock}"/> | |||
</StackPanel> | |||
<Border x:Name="myborder"> | |||
<Border.Background> | |||
<ImageBrush x:Name="image" ImageSource="../Image/圆形按钮背景1.png"> | |||
</ImageBrush> | |||
</Border.Background> | |||
<Border.Style> | |||
<Style TargetType="Border"> | |||
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/> | |||
<Setter Property="RenderTransform"> | |||
<Setter.Value> | |||
<TransformGroup> | |||
<RotateTransform/> | |||
</TransformGroup> | |||
</Setter.Value> | |||
</Setter> | |||
<Style.Triggers> | |||
<EventTrigger RoutedEvent="Loaded" > | |||
<EventTrigger.Actions> | |||
<BeginStoryboard x:Name="run1"> | |||
<Storyboard RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.Children[0].Angle"> | |||
<DoubleAnimation From="360" To="0" Duration="0:0:6"/> | |||
</Storyboard> | |||
</BeginStoryboard> | |||
<PauseStoryboard BeginStoryboardName="run1"/> | |||
</EventTrigger.Actions> | |||
</EventTrigger> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Trigger.EnterActions> | |||
<ResumeStoryboard BeginStoryboardName="run1"/> | |||
</Trigger.EnterActions> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="False"> | |||
<Trigger.EnterActions> | |||
<PauseStoryboard BeginStoryboardName="run1" /> | |||
</Trigger.EnterActions> | |||
</Trigger> | |||
</Style.Triggers> | |||
</Style> | |||
</Border.Style> | |||
</Border> | |||
</Grid> | |||
</Border> | |||
</ControlTemplate> | |||
</Button.Template> | |||
</Button> | |||
</Grid> | |||
<!--#region 用户界面列表--> | |||
<Border Grid.Column="3" Margin="20,0,20,0"> | |||
<Border.Background> | |||
<ImageBrush ImageSource="../Image/方形背景3.png"/> | |||
</Border.Background> | |||
<ScrollViewer CanContentScroll="True" Template="{DynamicResource ScrollViewerControlTemplate1}" | |||
Width="auto" Margin="10" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> | |||
<ListBox Background="Transparent" ItemContainerStyle="{StaticResource ItemContainer}" FocusVisualStyle="{x:Null}" Width="auto" | |||
ItemsSource="{Binding userPageList}" > | |||
<ListBox.Template> | |||
<ControlTemplate> | |||
<StackPanel Background="Transparent" IsItemsHost="True"></StackPanel> | |||
</ControlTemplate> | |||
</ListBox.Template> | |||
<ListBox.ItemTemplate> | |||
<DataTemplate> | |||
<Button Background="Transparent" BorderBrush="Transparent" BorderThickness="0" Style="{DynamicResource ButtontextStyle}" | |||
Command="{Binding DataContext.DeletePageCommand, RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}" | |||
CommandParameter="{Binding Name}"> | |||
<Border x:Name="leftborder" Width="130" HorizontalAlignment="Center" Margin="5"> | |||
<Border.Background> | |||
<ImageBrush ImageSource="../Image/文字背景2.png"/> | |||
</Border.Background> | |||
<TextBlock Text="{Binding Name}" Margin="8" | |||
FontSize="18" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
</Border> | |||
</Button> | |||
<DataTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Width" Value="160" TargetName="leftborder"/> | |||
</Trigger> | |||
</DataTemplate.Triggers> | |||
</DataTemplate> | |||
</ListBox.ItemTemplate> | |||
</ListBox> | |||
</ScrollViewer> | |||
</Border> | |||
<!--#endregion--> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
</Border> | |||
</UserControl> |
@@ -1,4 +1,5 @@ | |||
using BPASmart.Model.用户; | |||
using BPASmart.Model; | |||
using BPASmart.Model; | |||
using BPASmartClient.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
@@ -0,0 +1,115 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmart.UserManagement.ViewModel | |||
{ | |||
[INotifyPropertyChanged] | |||
partial class EditPowerViewModel | |||
{ | |||
/// <summary> | |||
/// 全部页面 | |||
/// </summary> | |||
public ObservableCollection<pageName> pageList { get; set; } = new ObservableCollection<pageName>(); | |||
/// <summary> | |||
/// 用户权限页面 | |||
/// </summary> | |||
public ObservableCollection<pageName> userPageList { get; set; } = new ObservableCollection<pageName>(); | |||
public ObservableCollection<string> UserNames { get; set; } = new ObservableCollection<string>(); | |||
[ObservableProperty] | |||
private string _currentUserName; | |||
/// <summary> | |||
/// 保存 | |||
/// </summary> | |||
[RelayCommand] | |||
private void SaveUserPower() | |||
{ | |||
Globle.GlobleData.EditUser = null; | |||
ActionManage.GetInstance.Send("ChangeMianContent", string.Empty); | |||
} | |||
/// <summary> | |||
/// 取消 | |||
/// </summary> | |||
[RelayCommand] | |||
private void Cancel() | |||
{ | |||
ActionManage.GetInstance.Send("ChangeMianContent", string.Empty); | |||
} | |||
/// <summary> | |||
/// 添加全部界面 | |||
/// </summary> | |||
[RelayCommand] | |||
private void AddAllPage() | |||
{ | |||
userPageList.Clear(); | |||
foreach(var item in pageList) | |||
{ | |||
userPageList.Add(item); | |||
} | |||
} | |||
/// <summary> | |||
/// 删除全部界面 | |||
/// </summary> | |||
[RelayCommand] | |||
private void DeleteAllPage() | |||
{ | |||
userPageList.Clear(); | |||
} | |||
[RelayCommand] | |||
private void AddPage(object o) | |||
{ | |||
if (o == null) return; | |||
if (o is string materail) | |||
{ | |||
var res = pageList.FirstOrDefault(p => p.Name == materail); | |||
if (userPageList.FirstOrDefault(p => p.Name == res.Name) == null) | |||
{ | |||
userPageList.Add(res); | |||
} | |||
} | |||
} | |||
[RelayCommand] | |||
private void DeletePage(object o) | |||
{ | |||
if (o == null) return; | |||
if (o is string materail) | |||
{ | |||
var res = userPageList.FirstOrDefault(p => p.Name == materail); | |||
userPageList.Remove(res); | |||
} | |||
} | |||
public EditPowerViewModel() | |||
{ | |||
pageList.Add(new pageName { Name = "主界面" }); | |||
pageList.Add(new pageName { Name = "控制界面" }); | |||
pageList.Add(new pageName { Name = "调试界面" }); | |||
pageList.Add(new pageName { Name = "日志界面" }); | |||
pageList.Add(new pageName { Name = "参数界面"}); | |||
pageList.Add(new pageName { Name = "调试界面" }); | |||
pageList.Add(new pageName { Name = "日志界面" }); | |||
pageList.Add(new pageName { Name = "参数界面" }); | |||
foreach(var item in Json<LocalUser>.Data.UserManagers) | |||
{ | |||
UserNames.Add(item.UserName); | |||
} | |||
if (Globle.GlobleData.EditUser != null) | |||
{ | |||
CurrentUserName = Globle.GlobleData.EditUser.UserName; | |||
} | |||
} | |||
} | |||
public class pageName | |||
{ | |||
public string Name { get; set; } | |||
} | |||
} |
@@ -7,7 +7,7 @@ global using System.Collections.Generic; | |||
global using System.Linq; | |||
global using System.Text; | |||
global using System.Threading.Tasks; | |||
global using BPASmart.Model.用户; | |||
global using BPASmart.Model; | |||
namespace BPASmart.UserManagement.ViewModel | |||
{ | |||
@@ -1,4 +1,4 @@ | |||
using BPASmart.Model.用户; | |||
using BPASmart.Model; | |||
using BPASmart.UserManagement.View; | |||
using BPASmartClient.Helper; | |||
using System; | |||
@@ -54,6 +54,8 @@ namespace BPASmart.UserManagement.ViewModel | |||
{ | |||
if (userManagers.Contains(user)) | |||
{ | |||
Globle.GlobleData.EditUser = null; | |||
Globle.GlobleData.EditUser = user; | |||
ActionManage.GetInstance.Send("ChangeMianContent", "EditPower"); | |||
} | |||
@@ -128,7 +128,6 @@ namespace BPASmartClient.JXJFoodBigStation | |||
AssemblyName = "BPASmartClient.JXJFoodBigStation", | |||
ToggleWindowPath = "View.HardwareStatusView" | |||
}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
@@ -33,9 +33,9 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
public int AgvPickUpPosition { get; set; } | |||
/// <summary> | |||
/// 配方配料的状态 0:无意义 ,1:plc允许下发配方 2:上位机下发配方 3:plc接收到配方(配料中) 4:配料完成 | |||
/// 配方下发状态 =0:配方未下发 ,1:配方下发给plc ,2:plc成功接收配方 | |||
/// </summary> | |||
public int RecipeDosingStatus { get; set; } | |||
public int RecipeDosingStatus { get; set; } | |||
/// <summary> | |||
/// 是否处于手动下发配方 | |||
/// </summary> | |||
@@ -24,50 +24,44 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
} | |||
} | |||
/// <summary> | |||
/// 单个配料机配料完成 | |||
/// </summary> | |||
/// <param name="value"></param> | |||
public void SingleDosing(uint value) | |||
{ | |||
if (IsConnected) | |||
{ | |||
HK_PLC_S7.Write(HKPlcCommAddress.SingleStockBinLocationToPLC, value); | |||
HK_PLC_S7.Write(HKPlcCommAddress.SingleDosingFinishToPLC, (ushort)1); | |||
} | |||
} | |||
/// <summary> | |||
/// 复位plc允许接料信号 | |||
/// </summary> | |||
public void AllowDosingSignReset() | |||
{ | |||
HK_PLC_S7.Write(HKPlcCommAddress.IsAllowDosing,(ushort)0); | |||
} | |||
/// <summary> | |||
/// 复位plc到达某料仓信号 | |||
/// </summary> | |||
public void StockStateSignReset() | |||
{ | |||
HK_PLC_S7.Write(HKPlcCommAddress.StockState, (ushort)0); | |||
} | |||
/// <summary> | |||
/// 复位一个配方配料完成信号 | |||
/// </summary> | |||
public void RecipeDosingFinishReset() | |||
{ | |||
HK_PLC_S7.Write(HKPlcCommAddress.RecipeDosingFinish, (ushort)0); | |||
} | |||
/// <summary> | |||
/// 下发配方数据 | |||
/// </summary> | |||
/// <param name="BarrelNum">单个桶的编号</param> | |||
/// <param name="StockBinLocation">单个桶对应的料仓位置</param> | |||
public void StockBinPar(short[] Num, short[] Location,short[] Weight) | |||
public void StockBinPar(RecipeData recipe) | |||
{ | |||
if (IsConnected) | |||
{ | |||
HK_PLC_S7.Write<short[]>(HKPlcCommAddress.BarrelNumToPLC, Num); | |||
HK_PLC_S7.Write<short[]>(HKPlcCommAddress.StockBinLocationToPLC, Location); | |||
HK_PLC_S7.Write<short[]>(HKPlcCommAddress.WeightToPLC, Weight); | |||
if (recipe != null) | |||
{ | |||
for (int barrel = 1; barrel < 6; barrel++) | |||
{ | |||
for (int loc = 1; loc < 13; loc++) | |||
{ | |||
int index = Array.FindIndex(recipe.RawMaterial.ToArray(), p => p.RawMaterialBarrelNum == barrel && p.RawMaterialLocation == loc); | |||
if (barrel >= 3)//PLC没有3号桶的重量位置,故4,5号桶地址向前偏移48个位置 | |||
{ | |||
if (index != -1) | |||
{ | |||
HK_PLC_S7.Write<float>("MD" + 4120 + (loc - 1) * 4 + (barrel - 1 - 1) * 48, recipe.RawMaterial.ElementAt(index).RawMaterialWeight); | |||
} | |||
else//不存在的原料信息,重量写0 | |||
{ | |||
HK_PLC_S7.Write<float>("MD" + 4120 + (loc - 1) * 4 + (barrel - 1 - 1) * 48, 0); | |||
} | |||
} | |||
else | |||
{ | |||
if (index != -1) | |||
{ | |||
HK_PLC_S7.Write<float>("MD" + 4120 + (loc - 1) * 4 + (barrel - 1) * 48, recipe.RawMaterial.ElementAt(index).RawMaterialWeight); | |||
} | |||
else//不存在的原料信息,重量写0 | |||
{ | |||
HK_PLC_S7.Write<float>("MD" + 4120 + (loc - 1) * 4 + (barrel - 1) * 48, 0); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
} | |||
@@ -8,96 +8,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model.HK_PLC | |||
{ | |||
public class HKPlcCommAddress | |||
{ | |||
#region 海科PLC ==> 上位机 | |||
public static string HeartHealth { get; set; } = "M5000.0"; | |||
/// <summary> | |||
/// 是否允许配料 | |||
/// </summary> | |||
public static string IsAllowDosing { get; set; } = ""; | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
public static string StockBinLocation { get; set; } = ""; | |||
/// <summary> | |||
/// 当前料仓的状态(0:无意义,1:到达接料位置) | |||
/// </summary> | |||
public static string StockState { get; set; } = ""; | |||
#endregion | |||
#region 上位机 ==> 海科PLC | |||
/// <summary> | |||
/// 料仓位置(配置该配方,所需要多个原料桶,每个原料桶有多个料仓位置) | |||
/// </summary> | |||
public static string StockBinLocationToPLC { get; set; } = ""; | |||
/// <summary> | |||
/// 对应桶号 | |||
/// </summary> | |||
public static string BarrelNumToPLC { get; set; } = ""; | |||
/// <summary> | |||
/// 对应桶号 | |||
/// </summary> | |||
public static string WeightToPLC { get; set; } = ""; | |||
/// <summary> | |||
/// 当前配料机配料完成 | |||
/// </summary> | |||
public static string SingleDosingFinishToPLC { get; set; } = ""; | |||
/// <summary> | |||
/// 当前配料料仓的位置 | |||
/// </summary> | |||
public static string SingleStockBinLocationToPLC { get; set; } = ""; | |||
/// <summary> | |||
/// 配方配料完成 | |||
/// </summary> | |||
public static string RecipeDosingFinish { get; set; } = ""; | |||
#endregion | |||
#region AGV进出站 | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string DeliveryAGVApply { get; set; } = "M4002"; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string DeliveryAGVIsApply { get; set; } = "M5002"; | |||
/// <summary> | |||
/// Agv送货 进站顶升申请 | |||
/// </summary> | |||
public static string DeliveryAGVApplyJack { get; set; } = "M4004"; | |||
/// <summary> | |||
/// Agv送货 进站顶升申请 | |||
/// </summary> | |||
public static string DeliveryAGVIsApplyJack { get; set; } = "M5004"; | |||
/// <summary> | |||
/// Agv送货 送货完成 | |||
/// </summary> | |||
public static string DeliveryAGVFinsih { get; set; } = "M4005"; | |||
/// <summary> | |||
/// Agv送货 工位上有货架 | |||
/// </summary> | |||
public static string StationHaveCargo { get; set; } = "M5005"; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string PickAGVApply { get; set; } = "M4003"; | |||
/// <summary> | |||
/// Agv送货 进站申请 | |||
/// </summary> | |||
public static string PickAGVIsApply { get; set; } = "M5003"; | |||
/// <summary> | |||
/// Agv送货 取货架完成 | |||
/// </summary> | |||
public static string PickCargoAGVFinish { get; set; } = "M4006"; | |||
/// <summary> | |||
/// Agv送货 取料完成 | |||
/// </summary> | |||
public static string PickAGVFinish { get; set; } = "M5006"; | |||
/// <summary> | |||
/// 工位上是否有小车 | |||
/// </summary> | |||
public static string StationIsExistTray { get; set; } = "M4007"; | |||
#endregion | |||
public static string StationIsExistCar { get; set; } | |||
} | |||
} |
@@ -9,6 +9,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
public class LocalRecipeDataColl | |||
{ | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
public ObservableCollection<RecipeData> Recipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
} | |||
} |
@@ -21,7 +21,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
public static ProcessControl GetInstance => _Instance ?? (_Instance = new ProcessControl()); | |||
private ProcessControl() { } | |||
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
public SiemensDeviceStatus SiemensDevice = new SiemensDeviceStatus(); | |||
public HKDeviceStatus HKDevice = new HKDeviceStatus(); | |||
GVL_BigStation BigStation = new GVL_BigStation(); | |||
@@ -29,11 +29,11 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// <summary> | |||
/// 配方数据 | |||
/// </summary> | |||
public ObservableCollection<RemoteRecipeData> RemoteRecipes = new ObservableCollection<RemoteRecipeData>(); | |||
public ObservableCollection<RecipeData> RemoteRecipes = new ObservableCollection<RecipeData>(); | |||
/// <summary> | |||
/// 配方数据 | |||
/// </summary> | |||
public ObservableCollection<RemoteRecipeData> IssuedComplete = new ObservableCollection<RemoteRecipeData>(); | |||
public ObservableCollection<RecipeData> IssuedComplete = new ObservableCollection<RecipeData>(); | |||
/// <summary> | |||
/// 原料的名称和料仓的位置对应 | |||
/// </summary> | |||
@@ -52,74 +52,41 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
public RecipeRawMaterial RawMaterial; | |||
public void Init() | |||
{ | |||
ActionManage.GetInstance.Register(new Action<DL_Start_DB>((res) => | |||
ActionManage.GetInstance.Register(new Action<object>((res) => | |||
{ | |||
ObservableCollection<RawMaterial> RawMaterials = new ObservableCollection<RawMaterial>(); | |||
if (SiemensDevice.IsConnected) | |||
{ | |||
if (res != null) | |||
if (res != null && res is DL_Start_DB recipe) | |||
{ | |||
RawMaterials.Clear(); | |||
for (int i = 0; i < 15; i++) | |||
{ | |||
if (RawMaterialsNamePos.ContainsKey(res.RecipeName)) | |||
if (RawMaterialsNamePos.ContainsKey(recipe.RecipeName)) | |||
{ | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
RawMaterials.Add(new RawMaterial() | |||
{ | |||
RawMaterialName = res.Material[i].Material_Name, | |||
RawMaterialBarrelNum = res.Material[i].Material_BarrelNum, | |||
RawMaterialWeight = res.Material[i].Material_Weight, | |||
RawMaterialLocation = (int)RawMaterialsNamePos[res.Material[i].Material_Name] | |||
}); | |||
RawMaterialName = recipe.Material[i].Material_Name, | |||
RawMaterialBarrelNum = recipe.Material[i].Material_BarrelNum, | |||
RawMaterialWeight = recipe.Material[i].Material_Weight, | |||
RawMaterialLocation = (int)RawMaterialsNamePos[recipe.Material[i].Material_Name] | |||
}); | |||
} | |||
else | |||
{ | |||
//报警,配方的原料名称下发和设备不一致 | |||
} | |||
} | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
Json<RemoteRecipe>.Data.Recipes.Add(new RecipeData() | |||
{ | |||
RecipeName = res.RecipeName, | |||
RecipeCode = res.RecipeCode, | |||
RecipeName = recipe.RecipeName, | |||
RecipeCode = recipe.RecipeCode, | |||
RawMaterial = RawMaterials, | |||
TrayCode = res.TrayCode | |||
TrayCode = recipe.TrayCode | |||
}); | |||
} | |||
} | |||
}), "西门子下发配方", true); | |||
ActionManage.GetInstance.Register(new Action<RecipeModel>((res) => | |||
{ | |||
if (SiemensDevice.IsConnected) | |||
{ | |||
if (res != null) | |||
{ | |||
RawMaterials.Clear(); | |||
for (int i = 0; i < 15; i++) | |||
{ | |||
if (RawMaterialsNamePos.ContainsKey(res.Material[i].Material_Name)) | |||
{ | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
{ | |||
RawMaterialName = res.Material[i].Material_Name, | |||
RawMaterialBarrelNum = res.Material[i].Material_BarrelNum, | |||
RawMaterialWeight = res.Material[i].Material_Weight, | |||
RawMaterialLocation = (int)RawMaterialsNamePos[res.Material[i].Material_Name] | |||
}); | |||
} | |||
else | |||
{ | |||
//报警,配方的原料名称下发和设备不一致 | |||
} | |||
} | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
{ | |||
RecipeName = res.RecipeName, | |||
RecipeCode = res.RecipeCode, | |||
RawMaterial = RawMaterials, | |||
TrayCode = res.TrayCode | |||
}); | |||
} | |||
} | |||
}), "西门子下发配方", true); | |||
}), "SiemensSendRecipe", true); | |||
string HK_PLC_IP = ConfigurationManager.AppSettings["HKPlc_IP"]; | |||
string Siemens_PLC_IP = ConfigurationManager.AppSettings["Siemens_IP"]; | |||
try | |||
@@ -143,6 +110,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
//Json<RemoteRecipeDataColl>.Data.Recipes = TestData.GetInstance.Recipes;//添加测试数据 | |||
ThreadManage.GetInstance().StartLong(new Action(() => | |||
{ | |||
ReadPLCDeviceInfo(); | |||
ReceviceData(); | |||
RecipeInfoToHKPLC(); | |||
Thread.Sleep(10); | |||
@@ -240,8 +208,8 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
private void AgvGetInOut() | |||
{ | |||
//获取工位上是否有小车 | |||
SiemensDevice.Siemens_PLC_S7.Write(SiemensCommAddress.StationIsExistCar, (bool) | |||
HKDevice.HK_PLC_S7.Read<bool>(HKPlcCommAddress.StationIsExistTray)); | |||
SiemensDevice.Siemens_PLC_S7.Write<bool>(SiemensCommAddress.StationIsExistCar, (bool) | |||
HKDevice.HK_PLC_S7.Read<bool>("M4007.0")); | |||
//检测AGV到站信号 | |||
if (AGVToWorkStationQueue.Count > 0) | |||
{ | |||
@@ -254,7 +222,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
if (BigStation.AgvDeliveryPosition == 5) | |||
{ | |||
BigStation.AgvDeliveryPosition = 0; | |||
//AGVToWorkStationQueue.TryDequeue(out RecipeCode); | |||
} | |||
AGV_Pick(TrayLocation - 1); | |||
if (BigStation.AgvPickUpPosition == 3) | |||
@@ -269,7 +236,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
if (!BigStation.IsAllowManual && RemoteRecipes.Count == 0)//一个配方执行完成后,再获取配方数据 | |||
{ | |||
RemoteRecipes = Json<RemoteRecipeDataColl>.Data.Recipes; | |||
RemoteRecipes = Json<RemoteRecipe>.Data.Recipes; | |||
} | |||
else if (BigStation.IsAllowManual && RemoteRecipes.Count == 0) | |||
{ | |||
@@ -283,41 +250,36 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
RecipeQueue.Enqueue(data.RecipeCode); | |||
} | |||
} | |||
else | |||
{ | |||
RecipeQueue.Clear(); | |||
BigStation.RecipeDosingStatus = 0; | |||
} | |||
} | |||
short[] BarrelNum = new short[15]; | |||
short[] Location = new short[15]; | |||
short[] Weight = new short[15]; | |||
private void RecipeInfoToHKPLC() | |||
{ | |||
if (RecipeQueue.Count > 0) | |||
{ | |||
int index = Array.FindIndex(RemoteRecipes.ToArray(), p => p.RecipeCode == RecipeQueue.ElementAt(0)); | |||
if (index >= 0 && index <= RemoteRecipes.Count) | |||
if (index >= 0 && index < RemoteRecipes.Count) | |||
{ | |||
string code = RemoteRecipes.ElementAt(index).RecipeCode; | |||
if (HKDevice.HK_PLC_S7.Read<bool>("M5001.0") && BigStation.RecipeDosingStatus == 0)//配方1是否允许下发配发 | |||
int trayCode = RemoteRecipes.ElementAt(index).TrayCode; | |||
if (RTrig.GetInstance("M5001.0").Start(HKDevice.HK_PLC_S7.Read<bool>("M5001.0")) && BigStation.RecipeDosingStatus == 0)//配方1是否允许下发配发 | |||
{ | |||
MessageLog.GetInstance.ShowRunLog($"配方状态:{code}允许下发"); | |||
HKDevice.StockBinPar(RemoteRecipes.ElementAt(index)); | |||
HKDevice.HK_PLC_S7.Write<bool>("M4001.0", true);//配发下发完成,to plc | |||
HKDevice.HK_PLC_S7.Write<bool>("M5001.0", false);//复位允许下发配方1信号 | |||
BigStation.RecipeDosingStatus = 1; | |||
for (int i = 0; i < RemoteRecipes.ElementAt(index).RawMaterial.Count; i++) | |||
{ | |||
BarrelNum[i] = (short)RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialBarrelNum; | |||
Location[i] = (short)RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialLocation; | |||
Weight[i] = (short)RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialWeight; | |||
} | |||
HKDevice.StockBinPar(BarrelNum, Location, Weight); | |||
HKDevice.HK_PLC_S7.Write("M4001.0", 1);//配发下发完成,to plc | |||
HKDevice.HK_PLC_S7.Write("M5001.0", 0);//复位允许下发配方1信号 | |||
BigStation.RecipeDosingStatus = 2; | |||
MessageLog.GetInstance.ShowRunLog($"配方状态:{code}下发完成"); | |||
} | |||
if (HKDevice.HK_PLC_S7.Read<bool>("M5001.4") && BigStation.RecipeDosingStatus == 2) | |||
if (HKDevice.HK_PLC_S7.Read<bool>("M5001.4") && BigStation.RecipeDosingStatus == 1) | |||
{ | |||
BigStation.RecipeDosingStatus = 3; | |||
HKDevice.HK_PLC_S7.Write("M5001.4", 0);//复位允许下发配方1信号 | |||
BigStation.RecipeDosingStatus = 2; | |||
HKDevice.HK_PLC_S7.Write<bool>("M5001.4", false);// | |||
MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配方配料"); | |||
} | |||
if (BigStation.RecipeDosingStatus == 3) | |||
if (BigStation.RecipeDosingStatus == 2) | |||
{ | |||
for (int i = 0; i < 12; i++) | |||
{ | |||
@@ -325,12 +287,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
if (HKDevice.HK_PLC_S7.Read<bool>("M5008." + (i)))//根据配料完成信号, | |||
{ | |||
int a = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i); | |||
int a = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == (i+1)); | |||
if (a >= 0) | |||
{ | |||
int barrelNum = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(a).RawMaterialBarrelNum; | |||
string address = "MD" + 5060 + i * 4 + (barrelNum - 1) * 48; | |||
float weight = HKDevice.HK_PLC_S7.Read<float>(address); | |||
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(a).Laying_Off_Weight = HKDevice.HK_PLC_S7.Read<float>(address);//料仓配料完成后的出料重量 | |||
} | |||
} | |||
} | |||
@@ -343,21 +305,21 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
int barrelNum = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(a).RawMaterialBarrelNum; | |||
string address = "MD" + 5060 + i * 4 + (barrelNum - 1) * 48; | |||
float weight = HKDevice.HK_PLC_S7.Read<float>(address); | |||
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(a).Laying_Off_Weight = HKDevice.HK_PLC_S7.Read<float>(address); | |||
} | |||
} | |||
} | |||
} | |||
if (RTrig.GetInstance("StockState").Start(HKDevice.HK_PLC_S7.Read<bool>(HKPlcCommAddress.RecipeDosingFinish)) || true) | |||
if (RTrig.GetInstance("StockState").Start(HKDevice.HK_PLC_S7.Read<bool>("M5007.0"))) | |||
{ | |||
BigStation.RecipeDosingStatus = 4; | |||
BigStation.RecipeDosingStatus = 3; | |||
MessageLog.GetInstance.ShowRunLog($"配方状态:{code}配料完成"); | |||
HKDevice.RecipeDosingFinishReset(); | |||
HKDevice.HK_PLC_S7.Write<bool>("M5007.0",false); | |||
RecipeQueue.TryDequeue(out code); | |||
IssuedComplete.Add(RemoteRecipes.ElementAt(index));//将该配方添加到下 | |||
if (!BigStation.IsAllowManual) | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.RemoveAt(index);//制作完成,移除当前配方 | |||
Json<RemoteRecipe>.Data.Recipes.RemoveAt(index);//制作完成,移除当前配方 | |||
} | |||
else | |||
{ | |||
@@ -390,7 +352,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
if (HKDevice.IsConnected) | |||
{ | |||
GetSiemensStatus("", new Action<object>((obj) => | |||
GetHKStatus("", new Action<object>((obj) => | |||
{ | |||
if (obj is bool[] bools && bools.Length > 0) | |||
{ | |||
@@ -424,12 +386,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
if (SiemensDevice.IsConnected) | |||
{ | |||
SiemensDevice.Siemens_PLC_S7.Write(Address, Value); | |||
SiemensDevice.Siemens_PLC_S7.Write<object>(Address, Value); | |||
} | |||
} | |||
private void WriteHKPLC(string Address, object Value) | |||
{ | |||
HKDevice.HK_PLC_S7.Write(Address, Value); | |||
HKDevice.HK_PLC_S7.Write<object>(Address, Value); | |||
} | |||
private object ReadSiemens(string Address) | |||
{ | |||
@@ -1,92 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
public class DeviceAddress | |||
{ | |||
#region 源地址 | |||
///// <summary> | |||
///// 设备名称起始地址 | |||
///// </summary> | |||
//public static string DeviceName { get; set; } = "LW0"; | |||
///// <summary> | |||
///// 料仓重量反馈起始地址 | |||
///// </summary> | |||
//public static string WeightFeedback { get; set; } = "LW52";//LW204 | |||
///// <summary> | |||
///// 重量设置地址 | |||
///// </summary> | |||
//public static string WeightSet { get; set; } = "LW21";//LW200 | |||
///// <summary> | |||
///// 启动信号地址 | |||
///// </summary> | |||
//public static string Start { get; set; } = "LW20";//LW210 | |||
///// <summary> | |||
///// 下料重量反馈地址 | |||
///// </summary> | |||
//public static string CutWeightFeedback { get; set; } = "LW54";//LW202 | |||
///// <summary> | |||
///// 设备运行状态地址 | |||
///// </summary> | |||
//public static string RunStatus { get; set; } = "LW55";//LW206 | |||
///// <summary> | |||
///// 料仓的位置 | |||
///// </summary> | |||
//public static string Location { get; set; } = "LW53"; | |||
#endregion | |||
#region 上位机下发 | |||
/// <summary> | |||
/// 原料出料重量 | |||
/// </summary> | |||
public static string WeightSet { get; set; } = "LW11"; | |||
/// <summary> | |||
/// 启动开始配料 | |||
/// </summary> | |||
public static string Start { get; set; } = "LW12"; | |||
#endregion | |||
#region 上位机读取 | |||
/// <summary> | |||
/// 设备运行状态地址 | |||
/// </summary> | |||
public static string RunStatus { get; set; } = "LW50"; | |||
/// <summary> | |||
/// 报警字 | |||
/// </summary> | |||
public static string AlarmInfo { get; set; } = "LW51"; | |||
/// <summary> | |||
/// 原料名称 | |||
/// </summary> | |||
public static string DeviceName { get; set; } = "LW52"; | |||
/// <summary> | |||
/// 料仓的位置 | |||
/// </summary> | |||
public static string Location { get; set; } = "LW53"; | |||
/// <summary> | |||
/// 原料类型 | |||
/// </summary> | |||
public static string RawMaterialType { get; set; } = "LW54"; | |||
/// <summary> | |||
/// 出料完成信号 | |||
/// </summary> | |||
public static string OutRawMaterialFinish { get; set; } = "LW55"; | |||
/// <summary> | |||
/// 料仓重量反馈起始地址 | |||
/// </summary> | |||
public static string WeightFeedback { get; set; } = "LW56"; | |||
/// <summary> | |||
/// 下料重量反馈地址 | |||
/// </summary> | |||
public static string CutWeightFeedback { get; set; } = "LW57"; | |||
#endregion | |||
} | |||
} |
@@ -8,8 +8,8 @@ using BPASmartClient.JXJFoodBigStation.ViewModel; | |||
namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
public class LocaPar | |||
public class LocalRecipe | |||
{ | |||
public ObservableCollection<RecipeModel> Recipes { get; set; } = new ObservableCollection<RecipeModel>(); | |||
public ObservableCollection<RecipeData> Recipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
} | |||
} |
@@ -7,7 +7,7 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
public class RemoteRecipeRawMaterial :ObservableObject | |||
public class RawMaterial :ObservableObject | |||
{ | |||
private int _mIp; | |||
public int DeviceIp { get { return _mIp; } set { _mIp = value; }} | |||
@@ -27,8 +27,8 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// <summary> | |||
/// 需要原料重量 | |||
/// </summary> | |||
public double RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } | |||
private double _mRawMaterialWeight; | |||
public float RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } | |||
private float _mRawMaterialWeight; | |||
/// <summary> | |||
/// 实际的下料中重量 |
@@ -1,44 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
public class RawMaterialDeviceStatus | |||
{ | |||
/// <summary> | |||
/// 原料类型 | |||
/// 1:液体 | |||
/// 2:膏体 | |||
/// 3:粉体 | |||
/// </summary> | |||
public ushort RawMaterialType { get; set; } | |||
/// <summary> | |||
/// 料仓重量反馈 | |||
/// </summary> | |||
public float WeightFeedback { get; set; } | |||
/// <summary> | |||
/// 上限反馈 | |||
/// </summary> | |||
public bool UpLimitFeedback { get; set; } | |||
/// <summary> | |||
/// 下限反馈 | |||
/// </summary> | |||
public bool DownLimitFeedback { get; set; } | |||
/// <summary> | |||
/// 下料重量反馈 | |||
/// </summary> | |||
public float CutWeightFeedback { get; set; } | |||
/// <summary> | |||
/// 设备运行状态 | |||
/// </summary> | |||
public ushort RunStatus { get; set; } | |||
} | |||
} |
@@ -1,48 +0,0 @@ | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
/// <summary> | |||
/// 原料模块 | |||
/// </summary> | |||
public class RawMaterialModel : ObservableObject | |||
{ | |||
private int _mIp; | |||
public int DeviceIp { get { return _mIp; } set { _mIp = value; } } | |||
/// <summary> | |||
/// 原料名称 | |||
/// </summary> | |||
public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; } } | |||
private string _mRawMaterialName; | |||
/// <summary> | |||
/// 原料对应的桶号 | |||
/// </summary> | |||
public int RawMaterialBarrelNum { get { return _mRawMaterialBarrelNum; } set { _mRawMaterialBarrelNum = value; OnPropertyChanged(); } } | |||
private int _mRawMaterialBarrelNum; | |||
/// <summary> | |||
/// 需要原料重量 | |||
/// </summary> | |||
public double RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; OnPropertyChanged(); } } | |||
private double _mRawMaterialWeight; | |||
/// <summary> | |||
/// 实际的下料中重量 | |||
/// </summary> | |||
public float Laying_Off_Weight { get { return _mLaying_Off_Weight; } set { _mLaying_Off_Weight = value; } } | |||
private float _mLaying_Off_Weight; | |||
/// <summary> | |||
/// 原料对应料仓的位置/名称 | |||
/// </summary> | |||
public int RawMaterialLocation { get { return _mRawMaterialLocation; } set { _mRawMaterialLocation = value; OnPropertyChanged(); } } | |||
private int _mRawMaterialLocation; | |||
} | |||
} |
@@ -8,7 +8,7 @@ using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
public class RemoteRecipeData : ObservableObject | |||
public class RecipeData : ObservableObject | |||
{ | |||
/// <summary> | |||
/// 配方名称 | |||
@@ -31,7 +31,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
/// <summary> | |||
/// 原料数据 | |||
/// </summary> | |||
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterial { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
public ObservableCollection<RawMaterial> RawMaterial { get; set; } = new ObservableCollection<RawMaterial>(); | |||
} |
@@ -1,45 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
using BPASmartClient.JXJFoodBigStation.ViewModel; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
/// <summary> | |||
/// 配方模块 | |||
/// </summary> | |||
public class RecipeModel : ObservableObject | |||
{ | |||
/// <summary> | |||
/// 配方名称 | |||
/// </summary> | |||
public string RecipeName { get { return _mRecipeName; } set { _mRecipeName = value; OnPropertyChanged(); } } | |||
private string _mRecipeName; | |||
/// <summary> | |||
/// 配方ID | |||
/// </summary> | |||
public string RecipeCode { get { return _mRecipCode; } set { _mRecipCode = value; OnPropertyChanged(); } } | |||
private string _mRecipCode; | |||
/// <summary> | |||
/// 托盘编号 | |||
/// </summary> | |||
public int TrayCode { get { return _mTrayCode; } set { _mTrayCode = value; OnPropertyChanged(); } } | |||
private int _mTrayCode; | |||
[Newtonsoft.Json.JsonIgnore] | |||
public AutoResetEvent Are { get; set; } = new AutoResetEvent(false); | |||
/// <summary> | |||
/// 原料集合 | |||
/// </summary> | |||
public ObservableCollection<RawMaterialModel> RawMaterial { get; set; } = new ObservableCollection<RawMaterialModel>(); | |||
} | |||
} |
@@ -11,7 +11,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens | |||
/// <summary> | |||
/// 生产工单 | |||
/// </summary> | |||
public string Order_No; | |||
public string RecipeCode; | |||
/// <summary> | |||
/// 配料开始 | |||
/// </summary> | |||
@@ -0,0 +1,14 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Collections.ObjectModel; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model.Siemens | |||
{ | |||
public class RemoteRecipe | |||
{ | |||
public ObservableCollection<RecipeData> Recipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
} | |||
} |
@@ -26,44 +26,45 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens | |||
var res2 = this.Siemens_PLC_S7.ReadClass<DL_Finish_DB>(3); | |||
if (res != null && RTrig.GetInstance("RecipeTrig").Start(res.Ask_For_Send_Bit)) | |||
{ | |||
ActionManage.GetInstance.Send("西门子下发配方", res); | |||
res.Ask_For_Send_Bit = false; | |||
ActionManage.GetInstance.Send("SiemensSendRecipe", res); | |||
res.Ask_For_Send_Bit = false;//接受配方信号复位 | |||
res.Ack_Ask_For_Send_Bit = true;//配方接受完成 | |||
this.Siemens_PLC_S7.WriteClass<DL_Start_DB>(res, 1); | |||
} | |||
if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[0]").Start(res1.Allow_AGV_Put[0])) | |||
{ | |||
ActionManage.GetInstance.Send("AGV到工位1信号", res1); | |||
ActionManage.GetInstance.Send("AGVToStation1Sign", res1); | |||
res1.Allow_AGV_Put[0] = false; | |||
this.Siemens_PLC_S7.WriteClass<DL_Status_DB>(res1, 2); | |||
} | |||
if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[1]").Start(res1.Allow_AGV_Put[1])) | |||
{ | |||
ActionManage.GetInstance.Send("AGV到工位2信号", res1); | |||
ActionManage.GetInstance.Send("AGVToStation2Sign", res1); | |||
res1.Allow_AGV_Put[1] = false; | |||
this.Siemens_PLC_S7.WriteClass<DL_Status_DB>(res1, 2); | |||
} | |||
if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[2]").Start(res1.Allow_AGV_Put[2])) | |||
{ | |||
ActionManage.GetInstance.Send("AGV到工位3信号", res1); | |||
ActionManage.GetInstance.Send("AGVToStation3Sign", res1); | |||
res1.Allow_AGV_Put[2] = false; | |||
this.Siemens_PLC_S7.WriteClass<DL_Status_DB>(res1, 2); | |||
} | |||
if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[3]").Start(res1.Allow_AGV_Put[3])) | |||
{ | |||
ActionManage.GetInstance.Send("AGV到工位4信号", res1); | |||
ActionManage.GetInstance.Send("AGVToStation4Sign", res1); | |||
res1.Allow_AGV_Put[3] = false; | |||
this.Siemens_PLC_S7.WriteClass<DL_Status_DB>(res1, 2); | |||
} | |||
if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[4]").Start(res1.Allow_AGV_Put[4])) | |||
{ | |||
ActionManage.GetInstance.Send("AGV到工位5信号", res1); | |||
ActionManage.GetInstance.Send("AGVToStation5Sign", res1); | |||
res1.Allow_AGV_Put[4] = false; | |||
this.Siemens_PLC_S7.WriteClass<DL_Status_DB>(res1, 2); | |||
} | |||
if (res1 != null && RTrig.GetInstance("Allow_AGV_Put[5]").Start(res1.Allow_AGV_Put[5])) | |||
{ | |||
ActionManage.GetInstance.Send("AGV到工位6信号", res1); | |||
ActionManage.GetInstance.Send("AGVToStation6Sign", res1); | |||
res1.Allow_AGV_Put[5] = false; | |||
this.Siemens_PLC_S7.WriteClass<DL_Status_DB>(res1, 2); | |||
} | |||
@@ -13,40 +13,40 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
{ | |||
public volatile static TestData Instance; | |||
public static TestData GetInstance => Instance ?? (Instance = new TestData()); | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
public ObservableCollection<RecipeData> Recipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
public ObservableCollection<RawMaterial> RawMaterials { get; set; } = new ObservableCollection<RawMaterial>(); | |||
public TestData() | |||
{ | |||
string recipeName = "配方1"; | |||
string recipeCode = "10001"; | |||
int Traycode = 1; | |||
double RawmaterialWeight = 10; | |||
float RawmaterialWeight = 10; | |||
short RawMaterialbarrelNum = 1; | |||
int RawMaterialLocation = 5; | |||
double RawmaterialWeight1 = 20; | |||
float RawmaterialWeight1 = 20; | |||
short RawMaterialbarrelNum1 = 2; | |||
int RawMaterialLocation1 = 7; | |||
double RawmaterialWeight2 = 30; | |||
float RawmaterialWeight2 = 30; | |||
short RawMaterialbarrelNum2 = 3; | |||
int RawMaterialLocation2 = 9; | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
RawMaterials.Add(new RawMaterial() | |||
{ | |||
DeviceIp = RawMaterials.Count + 1, | |||
RawMaterialWeight = RawmaterialWeight, | |||
RawMaterialBarrelNum = RawMaterialbarrelNum, | |||
RawMaterialLocation = RawMaterialLocation | |||
}); | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
RawMaterials.Add(new RawMaterial() | |||
{ | |||
DeviceIp = RawMaterials.Count + 1, | |||
RawMaterialWeight = RawmaterialWeight1, | |||
RawMaterialBarrelNum = RawMaterialbarrelNum1, | |||
RawMaterialLocation = RawMaterialLocation1 | |||
}); | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
RawMaterials.Add(new RawMaterial() | |||
{ | |||
DeviceIp = RawMaterials.Count + 1, | |||
RawMaterialWeight = RawmaterialWeight2, | |||
@@ -54,7 +54,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
RawMaterialLocation = RawMaterialLocation2 | |||
}); | |||
Recipes.Add(new Model.RemoteRecipeData() | |||
Recipes.Add(new Model.RecipeData() | |||
{ | |||
RecipeName = recipeName, | |||
RecipeCode = recipeCode, | |||
@@ -67,32 +67,32 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
string recipeCode_2 = "20001"; | |||
int Traycode_2 = 3; | |||
double RawmaterialWeight_2 = 10; | |||
float RawmaterialWeight_2 = 10; | |||
short RawMaterialbarrelNum_2 = 1; | |||
int RawMaterialLocation_2 = 5; | |||
double RawmaterialWeight1_2 = 20; | |||
float RawmaterialWeight1_2 = 20; | |||
short RawMaterialbarrelNum1_2 = 2; | |||
int RawMaterialLocation1_2 = 7; | |||
double RawmaterialWeight2_2 = 30; | |||
float RawmaterialWeight2_2 = 30; | |||
short RawMaterialbarrelNum2_2 = 3; | |||
int RawMaterialLocation2_2 = 9; | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
RawMaterials.Add(new RawMaterial() | |||
{ | |||
DeviceIp = RawMaterials.Count + 1, | |||
RawMaterialWeight = RawmaterialWeight_2, | |||
RawMaterialBarrelNum = RawMaterialbarrelNum_2, | |||
RawMaterialLocation = RawMaterialLocation_2 | |||
}); | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
RawMaterials.Add(new RawMaterial() | |||
{ | |||
DeviceIp = RawMaterials.Count + 1, | |||
RawMaterialWeight = RawmaterialWeight1_2, | |||
RawMaterialBarrelNum = RawMaterialbarrelNum1_2, | |||
RawMaterialLocation = RawMaterialLocation1_2 | |||
}); | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
RawMaterials.Add(new RawMaterial() | |||
{ | |||
DeviceIp = RawMaterials.Count + 1, | |||
RawMaterialWeight = RawmaterialWeight2_2, | |||
@@ -100,7 +100,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model | |||
RawMaterialLocation = RawMaterialLocation2_2 | |||
}); | |||
Recipes.Add(new Model.RemoteRecipeData() | |||
Recipes.Add(new Model.RecipeData() | |||
{ | |||
RecipeName = recipeName_2, | |||
RecipeCode = recipeCode_2, | |||
@@ -374,7 +374,7 @@ | |||
<UniformGrid | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
Columns="8" | |||
Columns="6" | |||
Rows="1" /> | |||
</ItemsPanelTemplate> | |||
</ListView.ItemsPanel> | |||
@@ -384,25 +384,34 @@ | |||
<Border Margin="5" Background="Transparent"> | |||
<Grid Height="220"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
<RowDefinition /> | |||
<!--<RowDefinition Height="0.1*"/>--> | |||
</Grid.RowDefinitions> | |||
<!--<TextBox | |||
Margin="0,0,0,35" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Bottom" | |||
FontSize="25" | |||
Text="{Binding DeviceName}"> | |||
</TextBox>--> | |||
<TextBlock | |||
Margin="0,0,0,35" | |||
HorizontalAlignment="Center" | |||
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"> | |||
<Path x:Name="path" 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="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.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90"/> | |||
@@ -425,7 +434,7 @@ | |||
<StackPanel | |||
Grid.Row="1" | |||
Margin="0,25,0,0" | |||
Margin="0,5,0,0" | |||
HorizontalAlignment="Center" | |||
Orientation="Horizontal"> | |||
<TextBlock | |||
@@ -443,7 +452,7 @@ | |||
<StackPanel | |||
Grid.Row="1" | |||
Margin="0,70,0,0" | |||
Margin="0,45,0,0" | |||
HorizontalAlignment="Center" | |||
Orientation="Horizontal"> | |||
<TextBlock | |||
@@ -456,6 +465,18 @@ | |||
Text=" 号仓" /> | |||
</StackPanel> | |||
<Button Grid.Row="2" | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding DataContext.UpdateRawMaterName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}" | |||
CommandParameter="{Binding DeviceName}" | |||
Content="修改原料名称" | |||
FontSize="20" | |||
Panel.ZIndex="0" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Image | |||
Grid.RowSpan="2" | |||
Source="/BPASmartClient.CustomResource;component/Image/光柱.png" | |||
@@ -537,7 +558,7 @@ | |||
<UniformGrid | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
Columns="8" | |||
Columns="6" | |||
Rows="1" /> | |||
</ItemsPanelTemplate> | |||
</ListView.ItemsPanel> | |||
@@ -547,6 +568,7 @@ | |||
<Border Margin="5" Background="Transparent"> | |||
<Grid Height="220"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<RowDefinition/> | |||
<!--<RowDefinition Height="0.1*"/>--> | |||
@@ -585,7 +607,7 @@ | |||
</StackPanel> | |||
<StackPanel | |||
Grid.Row="1" | |||
Margin="0,25,0,0" | |||
Margin="0,5,0,0" | |||
HorizontalAlignment="Center" | |||
Orientation="Horizontal"> | |||
<TextBlock | |||
@@ -602,7 +624,7 @@ | |||
<StackPanel | |||
Grid.Row="1" | |||
Margin="0,70,0,0" | |||
Margin="0,45,0,0" | |||
HorizontalAlignment="Center" | |||
Orientation="Horizontal"> | |||
<TextBlock | |||
@@ -615,7 +637,15 @@ | |||
Foreground="#FF0084FF" | |||
Text=" 号仓" /> | |||
</StackPanel> | |||
<Button Grid.Row="2" | |||
Width="200" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding DataContext.UpdateRawMaterName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}" | |||
CommandParameter="{Binding DeviceName}" | |||
Content="修改原料名称" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}"></Button> | |||
<Image | |||
Grid.RowSpan="2" | |||
Source="/BPASmartClient.CustomResource;component/Image/光柱.png" | |||
@@ -40,7 +40,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
ErrorInfo = "设备名称不能为空"; | |||
return; | |||
} | |||
ActionManage.GetInstance.Send("UpdateDeviceName", DeviceName); | |||
ActionManage.GetInstance.Send("ChangeDeviceNameViewClose"); | |||
}); | |||
} | |||
@@ -10,6 +10,8 @@ using System.Windows; | |||
using BPASmartClient.Helper; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPASmartClient.JXJFoodBigStation.Model; | |||
using BPASmartClient.JXJFoodBigStation.View; | |||
using System.Windows.Forms; | |||
namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
@@ -17,17 +19,18 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
public HardwareStatusViewModel() | |||
{ | |||
for (int i = 0; i <8; i++) | |||
for (int i = 6; i > 0; i--) | |||
{ | |||
TopDeviceCurrentStatuses.Add(new DeviceCurrentStatus() | |||
{ | |||
DeviceName = i.ToString(), | |||
DeviceNum=i, | |||
RunStatus = false, | |||
RunStatus = true, | |||
Weight = new Random().Next(0, 100) | |||
}); | |||
} | |||
for (int i = 8; i < 16; i++) | |||
for (int i = 7; i < 13; i++) | |||
{ | |||
BottomDeviceCurrentStatuses.Add(new DeviceCurrentStatus() | |||
{ | |||
@@ -37,7 +40,6 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
Weight = new Random().Next(0, 100) | |||
}); | |||
} | |||
StartCommand = new RelayCommand<string>((deviceName) => { | |||
//PLC控制 | |||
@@ -74,11 +76,54 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
} | |||
} | |||
}); | |||
} | |||
UpdateRawMaterName = new RelayCommand<string>((deviceName) => | |||
{ | |||
ActionManage.GetInstance.CancelRegister("UpdateDeviceName"); | |||
ActionManage.GetInstance.Register(new Action<object>((res) => | |||
{ | |||
if (res != null && res is string newName) | |||
{ | |||
int cnt = Array.FindIndex(TopDeviceCurrentStatuses.ToArray(), p => p.DeviceName == deviceName); | |||
if (cnt >= 0) | |||
{ | |||
int index = Array.FindIndex(BottomDeviceCurrentStatuses.ToArray(), p => p.DeviceName == newName); | |||
int index1 = Array.FindIndex(TopDeviceCurrentStatuses.ToArray(), p => p.DeviceName == newName); | |||
if (index == -1 && index1 == -1) | |||
{ | |||
var obj = TopDeviceCurrentStatuses.FirstOrDefault(p => p.DeviceName == deviceName); | |||
obj.DeviceName = newName; | |||
} | |||
else | |||
{ | |||
System.Windows.Forms.MessageBox.Show("设备名称与其他名称冲突", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); | |||
} | |||
} | |||
else | |||
{ | |||
int index = Array.FindIndex(TopDeviceCurrentStatuses.ToArray(), p => p.DeviceName == newName); | |||
int index1 = Array.FindIndex(BottomDeviceCurrentStatuses.ToArray(), p => p.DeviceName == newName); | |||
if (index == -1 && index1 == -1) | |||
{ | |||
var obj = BottomDeviceCurrentStatuses.FirstOrDefault(p => p.DeviceName == deviceName); | |||
obj.DeviceName = newName; | |||
} | |||
else | |||
{ | |||
System.Windows.Forms.MessageBox.Show("设备名称与其他名称冲突", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); | |||
} | |||
} | |||
} | |||
}), "UpdateDeviceName"); | |||
ChangeDeviceNameView view = new ChangeDeviceNameView(); | |||
view.ShowDialog(); | |||
}); | |||
} | |||
public ObservableCollection<DeviceCurrentStatus> AllDeviceCurrentStatuses; | |||
public ObservableCollection<DeviceCurrentStatus> TopDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>(); | |||
public ObservableCollection<DeviceCurrentStatus> BottomDeviceCurrentStatuses { get; set; } = new ObservableCollection<DeviceCurrentStatus>(); | |||
public RelayCommand<string> UpdateRawMaterName { get; set; } | |||
public RelayCommand<string> StartCommand { get; set; } | |||
public RelayCommand<string> StopCommand { get; set; } | |||
@@ -20,7 +20,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is RecipeModel rm) | |||
if (o != null && o is RecipeData rm) | |||
{ | |||
RecipeName = rm.RecipeName; | |||
RecipeCode = rm.RecipeCode; | |||
@@ -36,23 +36,23 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
}), "RecipeInfo"); | |||
AddRecipe = new RelayCommand(() => { | |||
RawMaterialsInfo.Add(new RawMaterialModel()); | |||
RawMaterialsInfo.Add(new RawMaterial()); | |||
}); | |||
Comfirm = new RelayCommand(() => | |||
{ | |||
var bom= Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == RecipeCode); | |||
var bom= Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == RecipeCode); | |||
if (bom == null)//新配方 | |||
{ | |||
var name= Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipeName == RecipeName); | |||
var name= Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeName == RecipeName); | |||
if (name == null) | |||
{ | |||
go: | |||
string recipeCode = new Random().Next(10000, 99999).ToString(); | |||
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode); | |||
var res = Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode); | |||
if (res == null) | |||
{ | |||
Json<LocaPar>.Data.Recipes.Add(new RecipeModel { RecipeCode = recipeCode, RawMaterial= RawMaterialsInfo,RecipeName=RecipeName,TrayCode=TrayCode}); | |||
Json<LocaPar>.Save(); | |||
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial= RawMaterialsInfo,RecipeName=RecipeName,TrayCode=TrayCode}); | |||
Json<LocalRecipe>.Save(); | |||
} | |||
else | |||
{ | |||
@@ -74,24 +74,24 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
} | |||
bom.RecipeName = RecipeName; | |||
bom.TrayCode = TrayCode; | |||
Json<LocaPar>.Save(); | |||
Json<LocalRecipe>.Save(); | |||
ActionManage.GetInstance.Send("CloseRecipeInfosView"); | |||
} | |||
}); | |||
SaveAs = new RelayCommand(() => { | |||
var bom = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipeName == RecipeName); | |||
var rec = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == RecipeCode); | |||
var bom = Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeName == RecipeName); | |||
var rec = Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == RecipeCode); | |||
if (bom == null && rec != null)//配方名称更改 | |||
{ | |||
prop: string recipeCode = new Random().Next(10000, 99999).ToString();//配方唯一ID,后期根据实际要求更改 | |||
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode); | |||
var res = Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == recipeCode); | |||
if (res == null) | |||
{ | |||
Json<LocaPar>.Data.Recipes.Add(new RecipeModel { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode });//配方添加 | |||
Json<LocaPar>.Save(); | |||
Json<LocalRecipe>.Data.Recipes.Add(new RecipeData { RecipeCode = recipeCode, RawMaterial = RawMaterialsInfo, RecipeName = RecipeName, TrayCode = TrayCode });//配方添加 | |||
Json<LocalRecipe>.Save(); | |||
} | |||
else | |||
{ | |||
@@ -107,8 +107,7 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
}); | |||
RemoveRecipe = new RelayCommand<string>((materilaName) => { | |||
var res= RawMaterialsInfo.FirstOrDefault(p=>p.RawMaterialName==materilaName); | |||
var res = RawMaterialsInfo.FirstOrDefault(p => p.RawMaterialName == materilaName); | |||
if (res != null) | |||
RawMaterialsInfo.Remove(res); | |||
}); | |||
@@ -133,6 +132,6 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
public RelayCommand<string> RemoveRecipe { get; set; } | |||
public ObservableCollection<RawMaterialModel> RawMaterialsInfo { get; set; } = new ObservableCollection<RawMaterialModel>() ; | |||
public ObservableCollection<RawMaterial> RawMaterialsInfo { get; set; } = new ObservableCollection<RawMaterial>() ; | |||
} | |||
} |
@@ -23,18 +23,18 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
{ | |||
public class RecipeReceiveViewModel : ObservableObject | |||
{ | |||
public ObservableCollection<RawMaterialModel> RawMaterials { get; set; } = new ObservableCollection<RawMaterialModel>(); | |||
public ObservableCollection<RawMaterial> RawMaterials { get; set; } = new ObservableCollection<RawMaterial>(); | |||
public RecipeReceiveViewModel() | |||
{ | |||
Json<LocaPar>.Read(); | |||
Recipes = Json<LocaPar>.Data.Recipes; | |||
Json<LocalRecipe>.Read(); | |||
Recipes = Json<LocalRecipe>.Data.Recipes; | |||
DetailsCommand = new RelayCommand<object>((o) => | |||
{ | |||
if (o != null && o is string num) | |||
{ | |||
ActionManage.GetInstance.CancelRegister("RecipeInfo"); | |||
RecipeInfosView nrv = new RecipeInfosView(); | |||
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == num); | |||
var res = Json<LocalRecipe>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == num); | |||
ActionManage.GetInstance.Send("RecipeInfo", res); | |||
nrv.Show(); | |||
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}"); | |||
@@ -85,17 +85,17 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
//}); | |||
ClearAllRecipe = new RelayCommand(() => | |||
{ | |||
Json<LocaPar>.Data.Recipes.Clear(); | |||
Json<LocaPar>.Save(); | |||
Json<LocalRecipe>.Data.Recipes.Clear(); | |||
Json<LocalRecipe>.Save(); | |||
}); | |||
RemoveCommand = new RelayCommand<string>((recipeCode) => { | |||
var res = Recipes.FirstOrDefault(p=>p.RecipeCode==recipeCode); | |||
if(res!=null) | |||
if (res != null) | |||
{ | |||
Recipes.Remove(res); | |||
Json<LocaPar>.Save(); | |||
Json<LocalRecipe>.Save(); | |||
} | |||
}); | |||
@@ -109,6 +109,6 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
public RelayCommand<string> RemoveCommand { get; set; } | |||
public ObservableCollection<RecipeModel> Recipes { get; set; } = new ObservableCollection<RecipeModel>(); | |||
public ObservableCollection<RecipeData> Recipes { get; set; } = new ObservableCollection<RecipeData>(); | |||
} | |||
} |
@@ -14,19 +14,19 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
internal class RecipeSendDownViewModel:ObservableObject | |||
{ | |||
public ObservableCollection<RecipeModel> Recipes { get; set; } = Json<LocaPar>.Data.Recipes; | |||
public ObservableCollection<RecipeData> Recipes { get; set; } = Json<LocalRecipe>.Data.Recipes; | |||
/// <summary> | |||
/// 当前正在制作的配方 | |||
/// </summary> | |||
public static ObservableCollection<RawMaterialModel> recipeProcesses { get; set; } = new ObservableCollection<RawMaterialModel>(); | |||
public static ObservableCollection<RawMaterial> recipeProcesses { get; set; } = new ObservableCollection<RawMaterial>(); | |||
/// <summary> | |||
/// 等待制作的配方 | |||
/// </summary> | |||
public static ObservableCollection<RecipeModel> UserTreeWait { get; set; } = new ObservableCollection<RecipeModel>(); | |||
public static ObservableCollection<RecipeData> UserTreeWait { get; set; } = new ObservableCollection<RecipeData>(); | |||
/// <summary> | |||
/// 已完成的配方 | |||
/// </summary> | |||
public static ObservableCollection<RecipeModel> UserTreeCompelete { get; set; } = new ObservableCollection<RecipeModel>(); | |||
public static ObservableCollection<RecipeData> UserTreeCompelete { get; set; } = new ObservableCollection<RecipeData>(); | |||
public RelayCommand<string> StartCommand { get; set; } | |||
@@ -41,7 +41,6 @@ namespace BPASmartClient.JXJFoodBigStation.ViewModel | |||
ActionManage.GetInstance.Send("手动下发本地配方", res); | |||
} | |||
}); | |||
} | |||
} | |||
} |
@@ -73,11 +73,18 @@ namespace BPASmartClient.JXJFoodSmallStation | |||
}); | |||
RecipeManage.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "服务配方管理", | |||
SubMenuName = "本地配方管理", | |||
SubMenuPermission = new Permission[] { Permission.管理员 }, | |||
AssemblyName = "BPASmartClient.JXJFoodSmallStation", | |||
ToggleWindowPath = "View.RecipeReceiveView" | |||
}); | |||
RecipeManage.Add(new SubMenumodel() | |||
{ | |||
SubMenuName = "西门子配方管理", | |||
SubMenuPermission = new Permission[] { Permission.管理员 }, | |||
AssemblyName = "BPASmartClient.JXJFoodSmallStation", | |||
ToggleWindowPath = "View.SiemensRecipeReceiveView" | |||
}); | |||
MenuManage.GetInstance.menuModels.Add(new MenuModel() | |||
{ | |||
MainMenuIcon = "", | |||
@@ -26,7 +26,15 @@ | |||
<Page Update="View\DeviceListView.xaml"> | |||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | |||
</Page> | |||
<Page Update="View\NewRemoteRecipeView.xaml"> | |||
<Page Update="View\SiemensRecipeReceiveView.xaml"> | |||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | |||
<SubType>Designer</SubType> | |||
</Page> | |||
<Page Update="View\WindSendParView.xaml"> | |||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | |||
<SubType>Designer</SubType> | |||
</Page> | |||
<Page Update="View\NewLocalRecipeView.xaml"> | |||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | |||
<SubType>Designer</SubType> | |||
</Page> | |||
@@ -0,0 +1,13 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.GVL | |||
{ | |||
public class GVL | |||
{ | |||
public static bool IsUseLocalRecipe { get; set; } | |||
} | |||
} |
@@ -0,0 +1,117 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.GVL | |||
{ | |||
public class ReadSmallMaterial | |||
{ | |||
/// <summary> | |||
/// PLC到上位机心跳 | |||
/// </summary> | |||
public bool Heart { get; set; } | |||
public bool Agv1 { get; set; } | |||
public bool Agv2 { get; set; } | |||
public bool Agv3 { get; set; } | |||
public bool Agv4 { get; set; } | |||
public bool Agv5 { get; set; } | |||
public bool Agv6 { get; set; } | |||
/// <summary> | |||
/// 1#托盘工位占用 | |||
/// </summary> | |||
public bool Tray1BeOccupied { get; set; } | |||
/// <summary> | |||
/// 2#托盘工位占用 | |||
/// </summary> | |||
public bool Tray2BeOccupied { get; set; } | |||
/// <summary> | |||
/// 1#托盘工位配料完成 | |||
/// </summary> | |||
public bool Tray1MaterialFinish { get; set; } | |||
/// <summary> | |||
/// 2#托盘工位配料完成 | |||
/// </summary> | |||
public bool Tray2MaterialFinish { get; set; } | |||
/// <summary> | |||
/// 接收托盘1配方数据完成 | |||
/// </summary> | |||
public bool Tray1ReceiveFinish { get; set; } | |||
/// <summary> | |||
/// 接收托盘2配方数据完成 | |||
/// </summary> | |||
public bool Tray2ReceiveFinish { get; set; } | |||
public int Reserve1 { get; set; } | |||
public int Receive2 { get; set; } | |||
/// <summary> | |||
/// 托盘1_1#桶位置反馈 | |||
/// </summary> | |||
public float Tray1Barrel1Location { get; set; } | |||
/// <summary> | |||
/// 托盘1_2#桶位置反馈 | |||
/// </summary> | |||
public float Tray1Barrel2Location { get; set; } | |||
/// <summary> | |||
/// 托盘1_3#桶位置反馈 | |||
/// </summary> | |||
public float Tray1Barrel3Location { get; set; } | |||
/// <summary> | |||
/// 托盘1_4#桶位置反馈 | |||
/// </summary> | |||
public float Tray1Barrel4Location { get; set; } | |||
/// <summary> | |||
/// 托盘2_1#桶位置反馈 | |||
/// </summary> | |||
public float Tray2Barrel1Location { get; set; } | |||
/// <summary> | |||
/// 托盘2_2#桶位置反馈 | |||
/// </summary> | |||
public float Tray2Barrel2Location { get; set; } | |||
/// <summary> | |||
/// 托盘2_3#桶位置反馈 | |||
/// </summary> | |||
public float Tray2Barrel3Location { get; set; } | |||
/// <summary> | |||
/// 托盘2_4#桶位置反馈 | |||
/// </summary> | |||
public float Tray2Barrel4Location { get; set; } | |||
public int Reserve3 { get; set; } | |||
public int Receive4 { get; set; } | |||
/// <summary> | |||
/// 托盘1_1#桶允许配料 | |||
/// </summary> | |||
public float Tray1Barrel1AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘1_2#桶允许配料 | |||
/// </summary> | |||
public float Tray1Barrel2AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘1_3#桶允许配料 | |||
/// </summary> | |||
public float Tray1Barrel3AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘1_4#桶允许配料 | |||
/// </summary> | |||
public float Tray1Barrel4AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘2_1#桶允许配料 | |||
/// </summary> | |||
public float Tray2Barrel1AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘2_2#桶允许配料 | |||
/// </summary> | |||
public float Tray2Barrel2AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘2_3#桶允许配料 | |||
/// </summary> | |||
public float Tray2Barrel3AllowDosing { get; set; } | |||
/// <summary> | |||
/// 托盘2_4#桶允许配料 | |||
/// </summary> | |||
public float Tray2Barrel4AllowDosing { get; set; } | |||
} | |||
} |
@@ -0,0 +1,185 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.GVL | |||
{ | |||
public class WriteSmallMaterial | |||
{ | |||
/// <summary> | |||
/// PLC到上位机心跳 | |||
/// </summary> | |||
public bool Heart { get; set; } | |||
public bool Agv1 { get; set; } | |||
public bool Agv2 { get; set; } | |||
public bool Agv3 { get; set; } | |||
public bool Agv4{ get; set; } | |||
public bool Agv5 { get; set; } | |||
public bool Agv6 { get; set; } | |||
public bool Agv7 { get; set; } | |||
public bool Agv8 { get; set; } | |||
public bool Agv9 { get; set; } | |||
public bool Agv10 { get; set; } | |||
/// <summary> | |||
/// 下发配方到托盘1 | |||
/// </summary> | |||
public bool Tray1IssueRecipe { get; set; } | |||
/// <summary> | |||
/// 下发配方到托盘2 | |||
/// </summary> | |||
public bool Tray2IssueRecipe { get; set; } | |||
public int Reserve1 { get; set; } | |||
public int Receive2 { get; set; } | |||
public bool Tray1Barrel1IsDosing1; | |||
public bool Tray1Barrel1IsDosing2; | |||
public bool Tray1Barrel1IsDosing3; | |||
public bool Tray1Barrel1IsDosing4; | |||
public bool Tray1Barrel1IsDosing5; | |||
public bool Tray1Barrel1IsDosing6; | |||
public bool Tray1Barrel1IsDosing7; | |||
public bool Tray1Barrel1IsDosing8; | |||
public bool Tray1Barrel1IsDosing9; | |||
public bool Tray1Barrel1IsDosing10; | |||
public bool Tray1Barrel1IsDosing11; | |||
public bool Tray1Barrel1IsDosing12; | |||
public bool Tray1Barrel1IsDosing13; | |||
public bool Tray1Barrel1IsDosing14; | |||
public bool Tray1Barrel1IsDosing15; | |||
public bool Receive3; | |||
public bool Tray1Barrel2IsDosing1; | |||
public bool Tray1Barrel2IsDosing2; | |||
public bool Tray1Barrel2IsDosing3; | |||
public bool Tray1Barrel2IsDosing4; | |||
public bool Tray1Barrel2IsDosing5; | |||
public bool Tray1Barrel2IsDosing6; | |||
public bool Tray1Barrel2IsDosing7; | |||
public bool Tray1Barrel2IsDosing8; | |||
public bool Tray1Barrel2IsDosing9; | |||
public bool Tray1Barrel2IsDosing10; | |||
public bool Tray1Barrel2IsDosing11; | |||
public bool Tray1Barrel2IsDosing12; | |||
public bool Tray1Barrel2IsDosing13; | |||
public bool Tray1Barrel2IsDosing14; | |||
public bool Tray1Barrel2IsDosing15; | |||
public bool Receive4; | |||
public bool Tray1Barrel3IsDosing1; | |||
public bool Tray1Barrel3IsDosing2; | |||
public bool Tray1Barrel3IsDosing3; | |||
public bool Tray1Barrel3IsDosing4; | |||
public bool Tray1Barrel3IsDosing5; | |||
public bool Tray1Barrel3IsDosing6; | |||
public bool Tray1Barrel3IsDosing7; | |||
public bool Tray1Barrel3IsDosing8; | |||
public bool Tray1Barrel3IsDosing9; | |||
public bool Tray1Barrel3IsDosing10; | |||
public bool Tray1Barrel3IsDosing11; | |||
public bool Tray1Barrel3IsDosing12; | |||
public bool Tray1Barrel3IsDosing13; | |||
public bool Tray1Barrel3IsDosing14; | |||
public bool Tray1Barrel3IsDosing15; | |||
public bool Receive5; | |||
public bool Tray1Barrel4IsDosing1; | |||
public bool Tray1Barrel4IsDosing2; | |||
public bool Tray1Barrel4IsDosing3; | |||
public bool Tray1Barrel4IsDosing4; | |||
public bool Tray1Barrel4IsDosing5; | |||
public bool Tray1Barrel4IsDosing6; | |||
public bool Tray1Barrel4IsDosing7; | |||
public bool Tray1Barrel4IsDosing8; | |||
public bool Tray1Barrel4IsDosing9; | |||
public bool Tray1Barrel4IsDosing10; | |||
public bool Tray1Barrel4IsDosing11; | |||
public bool Tray1Barrel4IsDosing12; | |||
public bool Tray1Barrel4IsDosing13; | |||
public bool Tray1Barrel4IsDosing14; | |||
public bool Tray1Barrel4IsDosing15; | |||
public bool Receive6; | |||
public bool Tray2Barrel1IsDosing1; | |||
public bool Tray2Barrel1IsDosing2; | |||
public bool Tray2Barrel1IsDosing3; | |||
public bool Tray2Barrel1IsDosing4; | |||
public bool Tray2Barrel1IsDosing5; | |||
public bool Tray2Barrel1IsDosing6; | |||
public bool Tray2Barrel1IsDosing7; | |||
public bool Tray2Barrel1IsDosing8; | |||
public bool Tray2Barrel1IsDosing9; | |||
public bool Tray2Barrel1IsDosing10; | |||
public bool Tray2Barrel1IsDosing11; | |||
public bool Tray2Barrel1IsDosing12; | |||
public bool Tray2Barrel1IsDosing13; | |||
public bool Tray2Barrel1IsDosing14; | |||
public bool Tray2Barrel1IsDosing15; | |||
public bool Receive7; | |||
public bool Tray2Barrel2IsDosing1; | |||
public bool Tray2Barrel2IsDosing2; | |||
public bool Tray2Barrel2IsDosing3; | |||
public bool Tray2Barrel2IsDosing4; | |||
public bool Tray2Barrel2IsDosing5; | |||
public bool Tray2Barrel2IsDosing6; | |||
public bool Tray2Barrel2IsDosing7; | |||
public bool Tray2Barrel2IsDosing8; | |||
public bool Tray2Barrel2IsDosing9; | |||
public bool Tray2Barrel2IsDosing10; | |||
public bool Tray2Barrel2IsDosing11; | |||
public bool Tray2Barrel2IsDosing12; | |||
public bool Tray2Barrel2IsDosing13; | |||
public bool Tray2Barrel2IsDosing14; | |||
public bool Tray2Barrel2IsDosing15; | |||
public bool Receive8; | |||
public bool Tray2Barrel3IsDosing1; | |||
public bool Tray2Barrel3IsDosing2; | |||
public bool Tray2Barrel3IsDosing3; | |||
public bool Tray2Barrel3IsDosing4; | |||
public bool Tray2Barrel3IsDosing5; | |||
public bool Tray2Barrel3IsDosing6; | |||
public bool Tray2Barrel3IsDosing7; | |||
public bool Tray2Barrel3IsDosing8; | |||
public bool Tray2Barrel3IsDosing9; | |||
public bool Tray2Barrel3IsDosing10; | |||
public bool Tray2Barrel3IsDosing11; | |||
public bool Tray2Barrel3IsDosing12; | |||
public bool Tray2Barrel3IsDosing13; | |||
public bool Tray2Barrel3IsDosing14; | |||
public bool Tray2Barrel3IsDosing15; | |||
public bool Receive9; | |||
public bool Tray2Barrel4IsDosing1; | |||
public bool Tray2Barrel4IsDosing2; | |||
public bool Tray2Barrel4IsDosing3; | |||
public bool Tray2Barrel4IsDosing4; | |||
public bool Tray2Barrel4IsDosing5; | |||
public bool Tray2Barrel4IsDosing6; | |||
public bool Tray2Barrel4IsDosing7; | |||
public bool Tray2Barrel4IsDosing8; | |||
public bool Tray2Barrel4IsDosing9; | |||
public bool Tray2Barrel4IsDosing10; | |||
public bool Tray2Barrel4IsDosing11; | |||
public bool Tray2Barrel4IsDosing12; | |||
public bool Tray2Barrel4IsDosing13; | |||
public bool Tray2Barrel4IsDosing14; | |||
public bool Tray2Barrel4IsDosing15; | |||
public bool Receive10; | |||
public int Receive11; | |||
public bool StockIn1DosingFinish; | |||
public bool StockIn2DosingFinish; | |||
public bool StockIn3DosingFinish; | |||
public bool StockIn4DosingFinish; | |||
public bool StockIn5DosingFinish; | |||
public bool StockIn6DosingFinish; | |||
public bool StockIn7DosingFinish; | |||
public bool StockIn8DosingFinish; | |||
public bool StockIn9DosingFinish; | |||
public bool StockIn10DosingFinish; | |||
public bool StockIn11DosingFinish; | |||
public bool StockIn12DosingFinish; | |||
public bool StockIn13DosingFinish; | |||
public bool StockIn14DosingFinish; | |||
public bool StockIn15DosingFinish; | |||
public bool Receive12; | |||
} | |||
} |
@@ -21,7 +21,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
public static ProcessControl GetInstance => _Instance ?? (_Instance = new ProcessControl()); | |||
private ProcessControl() { } | |||
public ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
/// <summary> | |||
/// 配方数据 | |||
/// </summary> | |||
@@ -54,12 +53,12 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
RawMaterialsNamePos.Add(DeviceInquire.GetInstance.GetDevice(i).DeviceName, (short)DeviceInquire.GetInstance.GetDevice(i).deviceStatus.DeviceNum); | |||
} | |||
} | |||
} | |||
ActionManage.GetInstance.CancelRegister("SiemensRecipeRecive"); | |||
ActionManage.GetInstance.Register(new Action<object>((res) => | |||
{ | |||
ObservableCollection<RemoteRecipeRawMaterial> RawMaterials = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
if (SiemensDevice.IsConnected) | |||
{ | |||
if (res != null && res is XL_Start_DB recipe) | |||
@@ -96,7 +95,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
string Siemens_PLC_IP = ConfigurationManager.AppSettings["Siemens_IP"]; | |||
try | |||
{ | |||
HKDevice.HK_PLC_S7.Connect(S7.Net.CpuType.S71200, HK_PLC_IP); | |||
//HKDevice.HK_PLC_S7.Connect(S7.Net.CpuType.S71200, HK_PLC_IP); | |||
//SiemensDevice.Siemens_PLC_S7.Connect(S7.Net.CpuType.S71500, Siemens_PLC_IP); | |||
if (HKDevice.IsConnected) | |||
{ | |||
@@ -627,10 +626,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
{ | |||
//int decimalNum = Convert.ToInt32(loc.ToString().Substring(loc.ToString().IndexOf(".") + 1)); | |||
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); | |||
double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; | |||
float weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; | |||
if (loc_index >= 0) | |||
{ | |||
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start((uint)weight);//根据料仓编号 启动并写入每个原料重量 | |||
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start(weight);//根据料仓编号 启动并写入每个原料重量 | |||
SmallStation.StockInIsWork = (int)loc; | |||
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.0", false); | |||
} | |||
@@ -645,10 +644,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
if (res > 0 && res is float loc) | |||
{ | |||
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); | |||
double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; | |||
float weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; | |||
if (loc_index >= 0) | |||
{ | |||
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start((uint)weight);//启动并写入每个原料重量 | |||
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start(weight);//启动并写入每个原料重量 | |||
SmallStation.StockInIsWork = (int)loc; | |||
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.1", false); | |||
} | |||
@@ -663,10 +662,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
if (res > 0 && res is float loc) | |||
{ | |||
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); | |||
double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; | |||
float weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; | |||
if (loc_index >= 0) | |||
{ | |||
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start((uint)weight);//启动并写入每个原料重量 | |||
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start(weight);//启动并写入每个原料重量 | |||
SmallStation.StockInIsWork = (int)loc; | |||
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.2", false); | |||
} | |||
@@ -681,10 +680,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
if (res > 0 && res is float loc) | |||
{ | |||
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); | |||
double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; | |||
float weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; | |||
if (loc_index >= 0) | |||
{ | |||
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start((uint)weight);//启动并写入每个原料重量 | |||
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start(weight);//启动并写入每个原料重量 | |||
SmallStation.StockInIsWork = (int)loc; | |||
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.3", false); | |||
} | |||
@@ -5,9 +5,9 @@ using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.JXJFoodBigStation.Model.Siemens | |||
namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens | |||
{ | |||
public class RemoteRecipeDataColl | |||
internal class LocalRecipeDataColl | |||
{ | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>(); | |||
} |
@@ -23,8 +23,8 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// <summary> | |||
/// 需要原料重量 | |||
/// </summary> | |||
public double RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; } } | |||
private double _mRawMaterialWeight; | |||
public float RawMaterialWeight { get { return _mRawMaterialWeight; } set { _mRawMaterialWeight = value; } } | |||
private float _mRawMaterialWeight; | |||
/// <summary> | |||
/// 实际的下料中重量 | |||
@@ -35,8 +35,8 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
/// <summary> | |||
/// 料仓剩余重量 | |||
/// </summary> | |||
public double StockBinRemainingWeight { get { return _mStockBinRemainingWeight; } set { _mStockBinRemainingWeight = value; } } | |||
private double _mStockBinRemainingWeight; | |||
public float StockBinRemainingWeight { get { return _mStockBinRemainingWeight; } set { _mStockBinRemainingWeight = value; } } | |||
private float _mStockBinRemainingWeight; | |||
/// <summary> | |||
/// 原料对应料仓的位置 | |||
@@ -21,15 +21,15 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
string recipeCode = "10001"; | |||
int Traycode = 1; | |||
double RawmaterialWeight = 10; | |||
float RawmaterialWeight = 10; | |||
short RawMaterialbarrelNum = 1; | |||
int RawMaterialLocation = 5; | |||
double RawmaterialWeight1 = 20; | |||
float RawmaterialWeight1 = 20; | |||
short RawMaterialbarrelNum1 = 2; | |||
int RawMaterialLocation1 = 7; | |||
double RawmaterialWeight2 = 30; | |||
float RawmaterialWeight2 = 30; | |||
short RawMaterialbarrelNum2 = 3; | |||
int RawMaterialLocation2 = 9; | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
@@ -67,15 +67,15 @@ namespace BPASmartClient.JXJFoodSmallStation.Model | |||
string recipeCode_2 = "20001"; | |||
int Traycode_2 = 3; | |||
double RawmaterialWeight_2 = 10; | |||
float RawmaterialWeight_2 = 10; | |||
short RawMaterialbarrelNum_2 = 1; | |||
int RawMaterialLocation_2 = 5; | |||
double RawmaterialWeight1_2 = 20; | |||
float RawmaterialWeight1_2 = 20; | |||
short RawMaterialbarrelNum1_2 = 2; | |||
int RawMaterialLocation1_2 = 7; | |||
double RawmaterialWeight2_2 = 30; | |||
float RawmaterialWeight2_2 = 30; | |||
short RawMaterialbarrelNum2_2 = 3; | |||
int RawMaterialLocation2_2 = 9; | |||
RawMaterials.Add(new RemoteRecipeRawMaterial() | |||
@@ -1,5 +1,5 @@ | |||
<Window | |||
x:Class="BPASmartClient.JXJFoodSmallStation.View.NewRemoteRecipeView" | |||
x:Class="BPASmartClient.JXJFoodSmallStation.View.NewLocalRecipeView" | |||
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" | |||
@@ -8,7 +8,7 @@ | |||
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel" | |||
Title="NewRemoteRecipeView" | |||
Width="700" | |||
Height="450" | |||
Height="520" | |||
AllowsTransparency="True" | |||
Background="{x:Null}" | |||
Topmost="True" | |||
@@ -17,7 +17,7 @@ | |||
mc:Ignorable="d"> | |||
<Window.DataContext> | |||
<vm:NewRemoteRecipeViewModel /> | |||
<vm:NewLocalRecipeViewModel /> | |||
</Window.DataContext> | |||
<Window.Resources> | |||
@@ -52,14 +52,15 @@ | |||
</ResourceDictionary> | |||
</Window.Resources> | |||
<Border Name="br" BorderThickness="2" BorderBrush="#0CADF5"> | |||
<Border | |||
Name="br" | |||
BorderBrush="#0CADF5" | |||
BorderThickness="2"> | |||
<Border.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" /> | |||
<!--<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/弹窗2.png" />--> | |||
</Border.Background> | |||
<Grid Margin="10"> | |||
<!--<Grid.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" /> | |||
</Grid.Background>--> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40" /> | |||
<RowDefinition Height="40" /> | |||
@@ -73,40 +74,31 @@ | |||
</Grid.ColumnDefinitions> | |||
<StackPanel VerticalAlignment="Center" Grid.Column="0" Orientation="Horizontal"> | |||
<TextBlock | |||
Width="100" | |||
Margin="10,0,10,0" | |||
Background="Transparent" | |||
FontSize="20" | |||
Foreground="#FF2AB2E7" | |||
Text="配方名称:" /> | |||
Width="100" | |||
Margin="10,0,10,0" | |||
Background="Transparent" | |||
FontSize="20" | |||
Foreground="#FF2AB2E7" | |||
Text="配方名称:" /> | |||
<TextBox | |||
Width="120" | |||
Height="30" | |||
FontSize="16" | |||
Text="{Binding RecipeName}" /> | |||
<TextBlock | |||
Width="100" | |||
Margin="0,0,10,0" | |||
HorizontalAlignment="Right" | |||
Background="Transparent" | |||
FontSize="16" | |||
Foreground="Red" | |||
Text="{Binding ErrorInfo}" /> | |||
Width="120" | |||
Height="30" | |||
FontSize="16" | |||
Text="{Binding RecipeName}" /> | |||
</StackPanel> | |||
<WrapPanel VerticalAlignment="Center" Grid.Column="1"> | |||
<TextBlock | |||
Width="100" | |||
Margin="10,0,10,0" | |||
Background="Transparent" | |||
FontSize="20" | |||
Foreground="#FF2AB2E7" | |||
Text="配方编码:" /> | |||
Width="100" | |||
Margin="10,0,10,0" | |||
Background="Transparent" | |||
FontSize="20" | |||
Foreground="#FF2AB2E7" | |||
Text="配方编码:" /> | |||
<TextBox | |||
Width="120" | |||
Height="30" | |||
FontSize="16" | |||
Text="{Binding RecipeCode}" /> | |||
Width="120" | |||
Height="30" | |||
FontSize="16" | |||
Text="{Binding RecipeCode}" /> | |||
</WrapPanel> | |||
</Grid> | |||
<Grid Grid.Row="1"> | |||
@@ -116,43 +108,43 @@ | |||
</Grid.ColumnDefinitions> | |||
<WrapPanel VerticalAlignment="Center" Grid.Column="0"> | |||
<TextBlock | |||
Width="100" | |||
Margin="10,0,10,0" | |||
Background="Transparent" | |||
FontSize="20" | |||
Foreground="#FF2AB2E7" | |||
Text="托盘编号:" /> | |||
Width="100" | |||
Margin="10,0,10,0" | |||
Background="Transparent" | |||
FontSize="20" | |||
Foreground="#FF2AB2E7" | |||
Text="托盘编号:" /> | |||
<TextBox | |||
Width="120" | |||
Height="30" | |||
FontSize="16" | |||
Text="{Binding TrayNum}" /> | |||
Width="120" | |||
Height="30" | |||
FontSize="16" | |||
Text="{Binding TrayNum}" /> | |||
</WrapPanel> | |||
<WrapPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Column="1"> | |||
<Button | |||
Width="100" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding AddCommand}" | |||
Content="添加原料" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
Width="100" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding AddCommand}" | |||
Content="添加原料" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Width="100" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Command="{Binding SaveCommand}" | |||
Content="保存配方" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
Width="100" | |||
Height="40" | |||
Margin="5,0,10,0" | |||
Command="{Binding SaveCommand}" | |||
Content="保存配方" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Name ="Close" | |||
Width="100" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Content="取消" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
Name ="Close" | |||
Width="100" | |||
Height="40" | |||
Margin="5,0,5,0" | |||
Content="取消" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
</WrapPanel> | |||
</Grid> | |||
@@ -19,9 +19,9 @@ namespace BPASmartClient.JXJFoodSmallStation.View | |||
/// <summary> | |||
/// DeviceMaterialParView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class NewRemoteRecipeView : Window | |||
public partial class NewLocalRecipeView : Window | |||
{ | |||
public NewRemoteRecipeView() | |||
public NewLocalRecipeView() | |||
{ | |||
InitializeComponent(); | |||
this.Close.Click += (o, e) => { this.Close(); }; |
@@ -52,7 +52,9 @@ | |||
</ResourceDictionary> | |||
</Window.Resources> | |||
<Border Name="br" BorderThickness="1" > | |||
<Border Name="br" | |||
BorderBrush="#0CADF5" | |||
BorderThickness="1" > | |||
<Border.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/bg.png" /> | |||
</Border.Background> | |||
@@ -62,37 +64,40 @@ | |||
</Grid.RowDefinitions> | |||
<Grid Grid.Row="1"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="30" /> | |||
<RowDefinition Height="30" /> | |||
<RowDefinition Height="30" /> | |||
<RowDefinition Height="80" /> | |||
<RowDefinition /> | |||
<RowDefinition Height="40" /> | |||
</Grid.RowDefinitions> | |||
<WrapPanel> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方名称:" /> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeName}" /> | |||
</WrapPanel> | |||
<WrapPanel Grid.Row="1"> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方编号:" /> | |||
<TextBlock Grid.Row="1" Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeCode}" /> | |||
</WrapPanel> | |||
<WrapPanel Grid.Row="2"> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="托盘编号:" /> | |||
<TextBlock Grid.Row="1" Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding TrayCode}" /> | |||
</WrapPanel> | |||
<Grid Grid.Row="3"> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition></ColumnDefinition> | |||
<ColumnDefinition></ColumnDefinition> | |||
</Grid.ColumnDefinitions> | |||
<Grid.RowDefinitions> | |||
<RowDefinition></RowDefinition> | |||
<RowDefinition></RowDefinition> | |||
</Grid.RowDefinitions> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="9*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Grid.Row="0" HorizontalAlignment="Center">小料站</TextBlock> | |||
<WrapPanel> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方名称:" /> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeName}" /> | |||
</WrapPanel> | |||
<WrapPanel Grid.Column="1"> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方编号:" /> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeCode}" /> | |||
</WrapPanel> | |||
<WrapPanel Grid.Row="1"> | |||
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="托盘编号:" /> | |||
<TextBlock Grid.Row="1" Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding TrayCode}" /> | |||
</WrapPanel> | |||
<Button Grid.Column="1" Grid.Row="1" Width="100" Command="{Binding ReturnPage}" HorizontalAlignment="Left" Margin="10,0,0,0">返回</Button> | |||
</Grid> | |||
<Grid Grid.Row="3"> | |||
<Grid Grid.Column="1"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="20"></RowDefinition> | |||
<RowDefinition Height="9*"></RowDefinition> | |||
<RowDefinition></RowDefinition> | |||
</Grid.RowDefinitions> | |||
<Grid Grid.Row="0" > | |||
<Grid.ColumnDefinitions> | |||
@@ -100,12 +105,12 @@ | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="2*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock FontSize="16" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Top">原料桶号</TextBlock> | |||
<TextBlock FontSize="16" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top">原料位置</TextBlock> | |||
<TextBlock FontSize="16" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Top">原料位置</TextBlock> | |||
<TextBlock FontSize="16" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top">原料桶号</TextBlock> | |||
<TextBlock FontSize="16" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Top">原料重量</TextBlock> | |||
</Grid> | |||
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" > | |||
<ItemsControl ItemsSource="{Binding RawMaterialsInfo}" > | |||
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" > | |||
<ItemsControl ItemsSource="{Binding RawMaterialsInfo}" Width="548" > | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid x:Name="grb" Height="25" > | |||
@@ -114,8 +119,8 @@ | |||
<ColumnDefinition Width="2*"/> | |||
<ColumnDefinition Width="2*"/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RawMaterialBarrelNum}"></TextBlock> | |||
<TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RawMaterialLocation}"></TextBlock> | |||
<TextBlock Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RawMaterialLocation}"></TextBlock> | |||
<TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RawMaterialBarrelNum}"></TextBlock> | |||
<TextBlock Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RawMaterialWeight}"></TextBlock> | |||
</Grid> | |||
<DataTemplate.Triggers> | |||
@@ -129,9 +134,6 @@ | |||
</ScrollViewer> | |||
</Grid> | |||
</Grid> | |||
<Grid Grid.Row="4"> | |||
<Button Command="{Binding ReturnPage}" Width="200" >返回</Button> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
</Border> | |||
@@ -23,6 +23,7 @@ namespace BPASmartClient.JXJFoodSmallStation.View | |||
public RecipeInfosView() | |||
{ | |||
InitializeComponent(); | |||
this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); }; | |||
ActionManage.GetInstance.CancelRegister("CloseRecipeInfosView"); | |||
ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "CloseRecipeInfosView"); | |||
} | |||
@@ -48,11 +48,17 @@ | |||
<RowDefinition Height="50"/> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | |||
<!--<CheckBox | |||
Content="本地配方模拟" | |||
FontFamily="楷体" | |||
VerticalAlignment="Center" | |||
Foreground="Aqua" | |||
IsChecked="{Binding IsUseLocalRecipe}"/>--> | |||
<pry:IcoButton | |||
Width="140" | |||
Margin="10" | |||
HorizontalAlignment="Left" | |||
HorizontalAlignment="Right" | |||
Command="{Binding NewRecipe}" | |||
Content="自定义配方" | |||
FontSize="16" | |||
@@ -62,7 +68,7 @@ | |||
<pry:IcoButton | |||
Width="140" | |||
Margin="10" | |||
HorizontalAlignment="Left" | |||
HorizontalAlignment="Right" | |||
Command="{Binding NewSimulateRecipe}" | |||
Content="新建模拟配方" | |||
FontSize="16" | |||
@@ -74,7 +80,7 @@ | |||
Grid.Column="3" | |||
Width="140" | |||
Margin="10" | |||
HorizontalAlignment="Left" | |||
HorizontalAlignment="Right" | |||
Command="{Binding ClearAllRecipe}" | |||
Content="清除所有配方" | |||
FontSize="16" | |||
@@ -136,30 +142,42 @@ | |||
Foreground="#dd000000" | |||
Text="{Binding TrayCode}" /> | |||
</WrapPanel> | |||
<Grid | |||
Name="gr" | |||
Grid.Row="2" | |||
Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<pry:IcoButton | |||
Grid.Column="0" | |||
Width="{Binding ElementName=gr, Path=ActualWidth}" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
BorderThickness="0" | |||
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}" | |||
CommandParameter="{Binding RecipeCode}" | |||
Content="详情" | |||
Content="编辑" | |||
EnterBackground="#FF2AB2E7" | |||
Foreground="#dd000000" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
<pry:IcoButton | |||
Grid.Column="1" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
BorderThickness="0" | |||
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}" | |||
CommandParameter="{Binding RecipeCode}" | |||
Content="下发" | |||
EnterBackground="#FF2AB2E7" | |||
Foreground="#dd000000" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</Grid> | |||
</Grid> | |||
@@ -0,0 +1,150 @@ | |||
<UserControl | |||
x:Class="BPASmartClient.JXJFoodSmallStation.View.SiemensRecipeReceiveView" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel" | |||
d:DesignHeight="450" | |||
d:DesignWidth="800" | |||
mc:Ignorable="d"> | |||
<UserControl.Resources> | |||
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" /> | |||
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" /> | |||
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" /> | |||
<SolidColorBrush x:Key="CursorColor" Color="Aqua" /> | |||
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" /> | |||
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" /> | |||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontSize" Value="20" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />--> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
</Style> | |||
<Style x:Key="buttonStyle" TargetType="Button"> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="Foreground" Value="Aqua" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
</Style> | |||
</UserControl.Resources> | |||
<UserControl.DataContext> | |||
<vm:SiemensRecipeReceiveViewModel /> | |||
</UserControl.DataContext> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50"/> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> | |||
<pry:IcoButton | |||
Grid.Column="3" | |||
Width="140" | |||
Margin="10" | |||
HorizontalAlignment="Right" | |||
Command="{Binding ClearAllRecipe}" | |||
Content="清除所有配方" | |||
FontSize="16" | |||
Foreground="Aqua" | |||
IcoText="" | |||
IsEnabled="True" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</StackPanel> | |||
<ScrollViewer Grid.Row="1"> | |||
<ListView | |||
Margin="5" | |||
VerticalAlignment="Top" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
ItemsSource="{Binding Recipes}" | |||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> | |||
<ListView.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<UniformGrid | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
Columns="8" /> | |||
</ItemsPanelTemplate> | |||
</ListView.ItemsPanel> | |||
<ListView.ItemTemplate> | |||
<DataTemplate> | |||
<Border Margin="5" Background="LightSkyBlue"> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition /> | |||
<RowDefinition Height="0.25*" /> | |||
<RowDefinition Height="0.2*" /> | |||
</Grid.RowDefinitions> | |||
<Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" /> | |||
<WrapPanel Grid.Row="1"> | |||
<TextBlock | |||
Margin="2,0,0,0" | |||
Foreground="#dd000000" | |||
Text="名称:" /> | |||
<TextBlock | |||
Margin="2,0,0,0" | |||
Foreground="#dd000000" | |||
Text="{Binding RecipeName}" /> | |||
<TextBlock | |||
Margin="5,0,0,0" | |||
Foreground="#dd000000" | |||
Text="编号:" /> | |||
<TextBlock | |||
Margin="2,0,0,0" | |||
Foreground="#dd000000" | |||
Text="{Binding RecipeCode}" /> | |||
<TextBlock | |||
Margin="5,0,0,0" | |||
Foreground="#dd000000" | |||
Text="托盘号:" /> | |||
<TextBlock | |||
Margin="2,0,0,0" | |||
Foreground="#dd000000" | |||
Text="{Binding TrayCode}" /> | |||
</WrapPanel> | |||
<Grid | |||
Name="gr" | |||
Grid.Row="2" | |||
Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<pry:IcoButton | |||
Grid.Column="0" | |||
Width="{Binding ElementName=gr, Path=ActualWidth}" | |||
Height="{Binding ElementName=gr, Path=ActualHeight}" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
BorderThickness="0" | |||
Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}" | |||
CommandParameter="{Binding RecipeCode}" | |||
Content="详情" | |||
EnterBackground="#FF2AB2E7" | |||
Foreground="#dd000000" | |||
IcoText="" | |||
Style="{StaticResource IcoButtonStyle}" /> | |||
</Grid> | |||
</Grid> | |||
</Border> | |||
</DataTemplate> | |||
</ListView.ItemTemplate> | |||
</ListView> | |||
</ScrollViewer> | |||
</Grid> | |||
</UserControl> |
@@ -0,0 +1,29 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Reflection; | |||
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 BPASmartClient.JXJFoodSmallStation.View | |||
{ | |||
/// <summary> | |||
/// RecipeSettingsView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class SiemensRecipeReceiveView : UserControl | |||
{ | |||
public SiemensRecipeReceiveView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,370 @@ | |||
<UserControl | |||
x:Class="BPASmartClient.JXJFoodSmallStation.View.WindSendParView" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:con="clr-namespace:BPASmartClient.JXJFoodSmallStation.Converter" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.JXJFoodSmallStation.View" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel" | |||
d:DesignHeight="1080" | |||
d:DesignWidth="1920" | |||
mc:Ignorable="d"> | |||
<UserControl.DataContext> | |||
<vm:WindSendParViewModel /> | |||
</UserControl.DataContext> | |||
<UserControl.Resources> | |||
<SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" /> | |||
<!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />--> | |||
<SolidColorBrush x:Key="bordColor" Color="#332AB2E7" /> | |||
<con:DataTableRedundantConverter x:Key="tabConvert" /> | |||
<Style x:Key="RowRadioButtonStyle" TargetType="{x:Type RadioButton}"> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type RadioButton}"> | |||
<Border | |||
x:Name="NvaBor" | |||
Background="Transparent" | |||
BorderBrush="#FF2AB2E7" | |||
BorderThickness="0"> | |||
<ContentControl | |||
Margin="10,4" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
HorizontalContentAlignment="Center" | |||
VerticalContentAlignment="Center" | |||
Content="{TemplateBinding Content}" | |||
FontSize="16" /> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsChecked" Value="True"> | |||
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" /> | |||
<Setter TargetName="NvaBor" Property="BorderThickness" Value="0" /> | |||
</Trigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsChecked" Value="false" /> | |||
<Condition Property="IsMouseOver" Value="True" /> | |||
</MultiTrigger.Conditions> | |||
<MultiTrigger.Setters> | |||
<Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" /> | |||
</MultiTrigger.Setters> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="InputTextboxStyle" TargetType="TextBox"> | |||
<Setter Property="Margin" Value="5,0,0,0" /> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="Width" Value="150" /> | |||
<Setter Property="Height" Value="40" /> | |||
<Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="FontSize" Value="14" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
</Style> | |||
<Style x:Key="ControlButtonStyle" TargetType="Button"> | |||
<Setter Property="Margin" Value="0" /> | |||
<Setter Property="FontSize" Value="18" /> | |||
<Setter Property="Foreground" Value="#FFF53F62" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="VerticalContentAlignment" Value="Center" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="Button"> | |||
<Border | |||
Name="TitleBarBr" | |||
BorderBrush="#00c2f4" | |||
BorderThickness="0" | |||
CornerRadius="0" | |||
Opacity="0.8"> | |||
<ContentPresenter | |||
Margin="{TemplateBinding Margin}" | |||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" | |||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> | |||
<Border.Background> | |||
<ImageBrush | |||
ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png" | |||
Opacity="0.8" | |||
Stretch="Fill" /> | |||
</Border.Background> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="TitleBarBr" Property="Opacity" Value="1" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="TitleTextblockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="HorizontalAlignment" Value="Center" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="Foreground" Value="{StaticResource tabColor}" /> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontWeight" Value="SemiBold" /> | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid Margin="10"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="40" /> | |||
<RowDefinition Height="40" /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> | |||
<Button | |||
Width="150" | |||
Height="40" | |||
Margin="10,0,10,0" | |||
Command="{Binding AddCommand}" | |||
Content="添加原料参数" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
<Button | |||
Width="150" | |||
Height="40" | |||
Margin="10,0,10,0" | |||
Command="{Binding SaveCommand}" | |||
Content="保存参数" | |||
FontSize="20" | |||
Style="{StaticResource ImageButtonStyle}" /> | |||
</StackPanel> | |||
<!--#region 表格标题栏设置--> | |||
<Grid | |||
Grid.Row="1" | |||
Margin="0,10,0,0" | |||
Background="#ff0C255F"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock | |||
Grid.Column="0" | |||
Style="{StaticResource TitleTextblockStyle}" | |||
Text="原料名称" /> | |||
<Grid Grid.Column="1"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="慢加重量(g)" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock | |||
Grid.Column="2" | |||
Style="{StaticResource TitleTextblockStyle}" | |||
Text="提前关阀重量" /> | |||
<Grid Grid.Column="3"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="快加速度" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock | |||
Grid.Column="4" | |||
Style="{StaticResource TitleTextblockStyle}" | |||
Text="慢加速度" /> | |||
<Grid Grid.Column="5"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="伺服手动速度" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock | |||
Grid.Column="6" | |||
Style="{StaticResource TitleTextblockStyle}" | |||
Text="料仓上限重量" /> | |||
<Grid Grid.Column="7"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="料仓下限重量" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBlock | |||
Grid.Column="8" | |||
Style="{StaticResource TitleTextblockStyle}" | |||
Text="搅拌速度" /> | |||
<Grid Grid.Column="9"> | |||
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="功能操作" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<Border | |||
Grid.ColumnSpan="10" | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" /> | |||
</Grid> | |||
<!--#endregion--> | |||
<Grid Grid.Row="2"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl ItemsSource="{Binding deviceParModels}"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Name="gr" Height="30"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition /> | |||
</Grid.ColumnDefinitions> | |||
<TextBox | |||
Grid.Column="0" | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding MaterialName}" /> | |||
<Grid Grid.Column="1"> | |||
<TextBox | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding SlowlyAddWeight}" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBox | |||
Grid.Column="2" | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding PreCloseValveWeight}" /> | |||
<Grid Grid.Column="3"> | |||
<TextBox | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding RapidAcceleration}" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBox | |||
Grid.Column="4" | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding SlowAcceleration}" /> | |||
<Grid Grid.Column="5"> | |||
<TextBox | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding ServoManualSpeed}" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBox | |||
Grid.Column="6" | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding SiloUpperLimitWeight}" /> | |||
<Grid Grid.Column="7"> | |||
<TextBox | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding LowerLimitWeightOfSilo}" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<TextBox | |||
Grid.Column="8" | |||
Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}" | |||
Style="{StaticResource InputTextboxStyle}" | |||
Text="{Binding StirringSpeed}" /> | |||
<Grid Grid.Column="9"> | |||
<Button | |||
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding MaterialName}" | |||
Content="删除" | |||
FontSize="16" | |||
Style="{StaticResource ControlButtonStyle}" /> | |||
<Border | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,0" | |||
Cursor="SizeWE" /> | |||
</Grid> | |||
<Border | |||
Grid.ColumnSpan="10" | |||
BorderBrush="{StaticResource bordColor}" | |||
BorderThickness="1,0,1,1" /> | |||
</Grid> | |||
<DataTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" /> | |||
</Trigger> | |||
</DataTemplate.Triggers> | |||
</DataTemplate> | |||
</ItemsControl.ItemTemplate> | |||
</ItemsControl> | |||
</ScrollViewer> | |||
</Grid> | |||
</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 BPASmartClient.JXJFoodSmallStation.View | |||
{ | |||
/// <summary> | |||
/// DeviceMaterialParView.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class WindSendParView : UserControl | |||
{ | |||
public WindSendParView() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -15,10 +15,24 @@ using BPASmartClient.JXJFoodSmallStation.Model.Siemens; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
public class NewRemoteRecipeViewModel : ObservableObject | |||
public class NewLocalRecipeViewModel : ObservableObject | |||
{ | |||
public NewRemoteRecipeViewModel() | |||
public NewLocalRecipeViewModel() | |||
{ | |||
ActionManage.GetInstance.CancelRegister("LocalRecipeEdit"); | |||
ActionManage.GetInstance.Register(new Action<object>((o) => | |||
{ | |||
if (o != null && o is RemoteRecipeData rm) | |||
{ | |||
RecipeName = rm.RecipeName; | |||
RecipeCode = rm.RecipeCode; | |||
TrayNum = rm.TrayCode; | |||
foreach (var item in rm.RawMaterial) | |||
{ | |||
RawMaterial.Add(item); | |||
} | |||
} | |||
}), "LocalRecipeEdit"); | |||
RemoveCommand = new RelayCommand<object>((o) => | |||
{ | |||
var res = RawMaterial.FirstOrDefault(p => p.RawMaterialLocation == (int)o); | |||
@@ -35,6 +49,21 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
SaveCommand = new RelayCommand(() => | |||
{ | |||
if (RecipeName.Length < 0 || RecipeName == null) | |||
{ | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "错误", $"配方名称不能为空"); | |||
return; | |||
} | |||
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == RecipeCode); | |||
if (index >= 0) | |||
{ | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "错误", $"已经存在配方{RecipeCode}"); | |||
return; | |||
} | |||
if (TrayNum != 1 || TrayNum!=2) | |||
{ | |||
TrayNum = 1; | |||
} | |||
ObservableCollection<RemoteRecipeRawMaterial> RawMaterials = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
if (RawMaterial == null || RawMaterial.Count <= 0) | |||
{ | |||
@@ -59,7 +88,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
RawMaterialWeight = item.RawMaterialWeight, | |||
}); | |||
} | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
Json<LocalRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
{ | |||
RecipeName = RecipeName, | |||
RecipeCode = RecipeCode, | |||
@@ -78,7 +107,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
private string _mRecipeName = string.Empty; | |||
public int TrayNum { get { return _mTrayNum; } set { _mTrayNum = value; OnPropertyChanged(); } } | |||
private int _mTrayNum = 0; | |||
private int _mTrayNum = 1; | |||
public string ErrorInfo { get { return _mErrorInfo; } set { _mErrorInfo = value; OnPropertyChanged(); } } | |||
private string _mErrorInfo; |
@@ -25,9 +25,6 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
RecipeName = rm.RecipeName; | |||
RecipeCode = rm.RecipeCode; | |||
TrayCode = rm.TrayCode; | |||
//RawMaterialsInfo = rm.RawMaterial; | |||
//var rest = RawMaterialsInfo.GetHashCode(); | |||
foreach (var item in rm.RawMaterial) | |||
{ | |||
RawMaterialsInfo.Add(item); | |||
@@ -18,6 +18,7 @@ using System.Windows.Media; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.JXJFoodSmallStation.Model.Siemens; | |||
using BPASmartClient.JXJFoodSmallStation.Model.GVL; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
@@ -27,32 +28,35 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
public RecipeReceiveViewModel() | |||
{ | |||
//Json<LocaPar>.Read(); | |||
Recipes = Json<RemoteRecipeDataColl>.Data.Recipes; | |||
Recipes = Json<LocalRecipeDataColl>.Data.Recipes; | |||
NewRecipe = new RelayCommand(() => | |||
{ | |||
NewRemoteRecipeView NewRemoteRecipe = new NewRemoteRecipeView(); | |||
NewRemoteRecipe.ShowDialog(); | |||
NewLocalRecipeView NewLocalRecipe = new NewLocalRecipeView(); | |||
NewLocalRecipe.ShowDialog(); | |||
}); | |||
DetailsCommand = new RelayCommand<object>((o) => | |||
{ | |||
if (o != null && o is string num) | |||
if (o != null && o is string cnt) | |||
{ | |||
ActionManage.GetInstance.Send("CloseRecipeInfosView"); | |||
RecipeInfosView nrv = new RecipeInfosView(); | |||
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == num); | |||
ActionManage.GetInstance.Send("RecipeInfo", res); | |||
nrv.Show(); | |||
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}"); | |||
ActionManage.GetInstance.Send("CloseNewRemoteRecipeView"); | |||
NewLocalRecipeView nrv = new NewLocalRecipeView(); | |||
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
if (res != null) | |||
{ | |||
ActionManage.GetInstance.Send("LocalRecipeEdit", res); | |||
nrv.Show(); | |||
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}"); | |||
} | |||
} | |||
}); | |||
NewSimulateRecipe = new RelayCommand(() => | |||
{ | |||
//RawMaterials.Clear(); | |||
ObservableCollection<RemoteRecipeRawMaterial> RawMaterials = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
string recipeName = "配方" + (Json<RemoteRecipeDataColl>.Data.Recipes.Count + 1) + ""; | |||
string recipeName = "配方" + (Json<LocalRecipeDataColl>.Data.Recipes.Count + 1) + ""; | |||
go: | |||
string recipeCode = new Random().Next(1000, 9999).ToString(); | |||
foreach (var item in Json<RemoteRecipeDataColl>.Data.Recipes) | |||
foreach (var item in Json<LocalRecipeDataColl>.Data.Recipes) | |||
{ | |||
if (item.RecipeCode == recipeCode) | |||
{ | |||
@@ -76,10 +80,10 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
} | |||
} | |||
var res = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == recipeCode); | |||
var res = Array.FindIndex(Json<LocalRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == recipeCode); | |||
if (res < 0) | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
Json<LocalRecipeDataColl>.Data.Recipes.Add(new RemoteRecipeData() | |||
{ | |||
RecipeName = recipeName, | |||
RecipeCode = recipeCode, | |||
@@ -91,14 +95,13 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
}); | |||
ClearAllRecipe = new RelayCommand(() => | |||
{ | |||
Json<RemoteRecipeDataColl>.Data.Recipes.Clear(); | |||
Json<LocalRecipeDataColl>.Data.Recipes.Clear(); | |||
}); | |||
} | |||
} | |||
public RelayCommand<object> DetailsCommand { get; set; } | |||
public RelayCommand NewSimulateRecipe { get; set; } | |||
public RelayCommand NewSimulateRecipe { get;set; } | |||
public RelayCommand ClearAllRecipe { get; set; } | |||
public RelayCommand NewRecipe { get; set; } | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; }=new ObservableCollection<RemoteRecipeData>() { new RemoteRecipeData() { } }; | |||
} | |||
} |
@@ -0,0 +1,53 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System.Collections.Concurrent; | |||
using System.Collections.ObjectModel; | |||
using System.Windows; | |||
using BPASmartClient.Helper; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPASmartClient.JXJFoodSmallStation.Model; | |||
using BPASmartClient.JXJFoodSmallStation.View; | |||
using BPASmartClient.CustomResource.UserControls; | |||
using BPASmartClient.CustomResource.UserControls.Model; | |||
using BPASmartClient.CustomResource.UserControls.Enum; | |||
using System.Windows.Media; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.CustomResource.Pages.Model; | |||
using BPASmartClient.JXJFoodSmallStation.Model.Siemens; | |||
using BPASmartClient.JXJFoodSmallStation.Model.GVL; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
public class SiemensRecipeReceiveViewModel : ObservableObject | |||
{ | |||
//ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>(); | |||
public SiemensRecipeReceiveViewModel() | |||
{ | |||
Recipes = Json<RemoteRecipeDataColl>.Data.Recipes; | |||
DetailsCommand = new RelayCommand<object>((o) => | |||
{ | |||
if (o != null && o is string cnt) | |||
{ | |||
ActionManage.GetInstance.Send("CloseRecipeInfosView"); | |||
RecipeInfosView nrv = new RecipeInfosView(); | |||
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt); | |||
if (res != null) | |||
{ | |||
ActionManage.GetInstance.Send("RecipeInfo", res); | |||
nrv.Show(); | |||
MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}"); | |||
} | |||
} | |||
}); | |||
} | |||
public RelayCommand<object> DetailsCommand { get; set; } | |||
public RelayCommand ClearAllRecipe { get; set; } | |||
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } | |||
} | |||
} |
@@ -0,0 +1,69 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System.Collections.ObjectModel; | |||
using BPASmartClient.JXJFoodSmallStation.Model; | |||
using BPASmartClient.Helper; | |||
using Microsoft.Toolkit.Mvvm.Input; | |||
using BPASmartClient.CustomResource.UserControls.MessageShow; | |||
using BPASmartClient.CustomResource.UserControls; | |||
using System.Diagnostics; | |||
namespace BPASmartClient.JXJFoodSmallStation.ViewModel | |||
{ | |||
public class WindSendParViewModel : ObservableObject | |||
{ | |||
public WindSendParViewModel() | |||
{ | |||
deviceParModels = Json<DevicePar>.Data.deviceParModels; | |||
RemoveCommand = new RelayCommand<object>((o) => | |||
{ | |||
var res = deviceParModels.FirstOrDefault(p => p.MaterialName == o?.ToString()); | |||
if (res != null) deviceParModels.Remove(res); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{o.ToString()}:原料删除成功!"); | |||
}); | |||
AddCommand = new RelayCommand(() => { deviceParModels.Add(new DeviceParModel()); }); | |||
SaveCommand = new RelayCommand(() => | |||
{ | |||
if (deviceParModels == null || deviceParModels.Count <= 0) | |||
{ | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Warn, App.MainWindow, "警告", $"没有可保存的参数!"); | |||
return; | |||
} | |||
for (int i = 0; i < deviceParModels.Count; i++) | |||
{ | |||
if (deviceParModels.Where(p => p.MaterialName == deviceParModels.ElementAt(i).MaterialName)?.ToList()?.Count >= 2) | |||
deviceParModels.ElementAt(i).IsRedundant = true; | |||
else | |||
deviceParModels.ElementAt(i).IsRedundant = false; | |||
} | |||
if (deviceParModels.FirstOrDefault(p => p.IsRedundant == true) != null) | |||
{ | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "错误", $"原料名称冲突,请检查后重试!"); | |||
return; | |||
} | |||
deviceParModels.Where(P => P.MaterialName.Length <= 0)?.ToList()?.ForEach(item => | |||
{ | |||
Json<DevicePar>.Data.deviceParModels.Remove(item); | |||
}); | |||
Json<DevicePar>.Save(); | |||
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"原料参数保存成功!"); | |||
}); | |||
} | |||
public ObservableCollection<DeviceParModel> deviceParModels { get; set; } | |||
public RelayCommand<object> RemoveCommand { get; set; } | |||
public RelayCommand AddCommand { get; set; } | |||
public RelayCommand SaveCommand { get; set; } | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<ImplicitUsings>enable</ImplicitUsings> | |||
<Nullable>enable</Nullable> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPASmartClient.Device\BPASmartClient.Device.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,200 @@ | |||
using BPA.Message.Enum; | |||
using BPASmartClient.Device; | |||
using BPASmartClient.EventBus; | |||
using BPASmartClient.Model; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using static BPASmartClient.EventBus.EventBus; | |||
namespace BPASmartClient.MorkMOC | |||
{ | |||
public class Control_MorkMOC : BaseDevice | |||
{ | |||
GVL_MorkMOC morkMoc = new GVL_MorkMOC(); | |||
PolymerBatching polymerBatching = new PolymerBatching(); | |||
//放大倍数 | |||
const int expand = 10; | |||
public override DeviceClientType DeviceType => throw new NotImplementedException(); | |||
public override void DoMain() | |||
{ | |||
ServerInit(); | |||
DataParse(); | |||
} | |||
private void ServerInit() | |||
{ | |||
//物料信息 | |||
EventBus.EventBus.GetInstance().Subscribe<MaterialDeliveryEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) | |||
{ | |||
if (@event == null) return; | |||
if (@event is MaterialDeliveryEvent material) | |||
{ | |||
orderMaterialDelivery = material.orderMaterialDelivery; | |||
} | |||
}); | |||
//配方数据信息 | |||
EventBus.EventBus.GetInstance().Subscribe<RecipeBomEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) | |||
{ | |||
if (@event == null) return; | |||
if (@event is RecipeBomEvent recipe) | |||
{ | |||
recipeBoms = recipe.recipeBoms; | |||
} | |||
}); | |||
} | |||
private void DataParse() | |||
{ | |||
EventBus.EventBus.GetInstance().Subscribe<DoOrderEvent>(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) | |||
{ | |||
if (@event == null) return; | |||
if (@event is DoOrderEvent order) | |||
{ | |||
if (order.MorkOrder.GoodBatchings == null) return; | |||
OrderCount++; | |||
morkMoc.doOrderEvents.Add(order); | |||
OrderChange(order.MorkOrder.SuborderId, ORDER_STATUS.WAIT); | |||
DeviceProcessLogShow($"接收到{OrderCount}次订单"); | |||
Dictionary<int, int> OrderPushes = new Dictionary<int, int>(); | |||
foreach (var item in order.MorkOrder.GoodBatchings) | |||
{ | |||
var res = orderMaterialDelivery?.BatchingInfo?.FirstOrDefault(p => p.BatchingId == item.BatchingId); | |||
if (res != null) | |||
{ | |||
OrderPushes.TryAdd(int.Parse(res.BatchingLoc), item.BatchingCount); | |||
} | |||
} | |||
morkMoc.morkOrderPushes.Enqueue(new OrderLocInfo() | |||
{ | |||
GoodName = order.MorkOrder.GoodsName, | |||
SuborderId = order.MorkOrder.SuborderId, | |||
GoodPushes = OrderPushes | |||
}); | |||
} | |||
}); | |||
} | |||
/// <summary> | |||
/// 订单改变通知 | |||
/// </summary> | |||
/// <param name="subid"></param> | |||
/// <param name="oRDER_STATUS"></param> | |||
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS) | |||
{ | |||
var res = morkMoc.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid); | |||
string goodName = string.Empty; | |||
string SortNum = string.Empty; | |||
EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() | |||
{ | |||
SortNum = res.MorkOrder.SortNum.ToString(), | |||
GoodName = res.MorkOrder.GoodsName, | |||
Status = oRDER_STATUS, | |||
SubOrderId = res.MorkOrder.SuborderId, | |||
deviceClientType = DeviceType | |||
}); | |||
if (oRDER_STATUS == ORDER_STATUS.COMPLETED_COOK) morkMoc.doOrderEvents.Remove(res); | |||
} | |||
public override void MainTask() | |||
{ | |||
MakeProcess(); | |||
} | |||
/// <summary> | |||
/// 制作流程 | |||
/// </summary> | |||
private void MakeProcess() | |||
{ | |||
if (morkMoc.morkOrderPushes.Count > 0) | |||
{ | |||
if (morkMoc.morkOrderPushes.TryDequeue(out OrderLocInfo orderLoc)) | |||
{ | |||
// 第一步:设置每个仓的出料量 | |||
SetMaterialsWeight(orderLoc.GoodPushes); | |||
DeviceProcessLogShow("设置出料量完成"); | |||
//第二步:循环出料 | |||
OutMaterials(orderLoc.GoodPushes); | |||
DeviceProcessLogShow($"{orderLoc.GoodName}制作完成"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 设定出料重量 | |||
/// </summary> | |||
/// <param name="goodPushes"></param> | |||
private void SetMaterialsWeight(Dictionary<int,int> goodPushes) | |||
{ | |||
foreach(var good in goodPushes) | |||
{ | |||
WriteControl(polymerBatching.plcData[good.Key - 1].WeightVar, good.Value * expand); | |||
DeviceProcessLogShow($"{good.Key}号通道出料量:{good.Value}g"); | |||
Thread.Sleep(300); | |||
} | |||
} | |||
/// <summary> | |||
/// 循环出料 | |||
/// </summary> | |||
private void OutMaterials(Dictionary<int, int> goodPushes) | |||
{ | |||
foreach (var good in goodPushes) | |||
{ | |||
WriteControl(polymerBatching.plcData[good.Key - 1].StartUpVar, true); | |||
Thread.Sleep(3000);//写入PLC开启通道后 PLC会先把完成信号置0,等待出料完成后置1 | |||
while(!morkMoc.OutMaterailCompelete)//接收到完成信号后退出循环 | |||
{ | |||
Thread.Sleep(1000); | |||
//需要加入超时提示或处理 | |||
} | |||
DeviceProcessLogShow($"{good.Key}号通道出料完成"); | |||
} | |||
} | |||
public override void ReadData() | |||
{ | |||
GetStatus("M10.0", new Action<object>((obj) => | |||
{ | |||
if (obj is bool[] bools && bools.Length > 0 ) | |||
{ | |||
morkMoc.OutMaterailCompelete = bools[0]; | |||
} | |||
})); | |||
} | |||
public override void ResetProgram() | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
public override void SimOrder() | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
public override void Stop() | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
private void GetStatus(string key, Action<object> action) | |||
{ | |||
if (peripheralStatus.ContainsKey(key)) | |||
{ | |||
if (peripheralStatus[key] != null) | |||
{ | |||
action?.Invoke(peripheralStatus[key]); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
using BPASmartClient.Model; | |||
using System; | |||
using System.Collections.Concurrent; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.MorkMOC | |||
{ | |||
public class GVL_MorkMOC | |||
{ | |||
/// <summary> | |||
/// 订单队列 | |||
/// </summary> | |||
public ConcurrentQueue<OrderLocInfo> morkOrderPushes = new ConcurrentQueue<OrderLocInfo>(); | |||
/// <summary> | |||
/// 订单暂存列表 | |||
/// </summary> | |||
public List<DoOrderEvent> doOrderEvents { get; set; } = new List<DoOrderEvent>(); | |||
public bool OutMaterailCompelete = false; | |||
} | |||
} |
@@ -0,0 +1,16 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace BPASmartClient.MorkMOC | |||
{ | |||
public class OrderLocInfo | |||
{ | |||
public string SuborderId { get; set; } | |||
public ushort RecipeNumber { get; set; } | |||
public string GoodName { get; set; } | |||
public Dictionary<int, int> GoodPushes { get; set; } | |||
} | |||
} |
@@ -0,0 +1,52 @@ | |||
using BPASmartClient.Helper; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPASmartClient.MorkMOC | |||
{ | |||
public class PolymerBatching | |||
{ | |||
public List<PLCData> plcData = new List<PLCData>(); | |||
public PolymerBatching() | |||
{ | |||
plcData.Add(new PLCData { Positon = 1,WeightVar = "VW200", StartUpVar = "M4.0" }); | |||
plcData.Add(new PLCData { Positon = 2, WeightVar = "VW202", StartUpVar = "M4.1" }); | |||
plcData.Add(new PLCData { Positon = 3, WeightVar = "VW204", StartUpVar = "M4.2" }); | |||
plcData.Add(new PLCData { Positon = 4, WeightVar = "VW206", StartUpVar = "M4.3" }); | |||
plcData.Add(new PLCData { Positon = 5, WeightVar = "VW208", StartUpVar = "M4.4" }); | |||
plcData.Add(new PLCData { Positon = 6, WeightVar = "VW210", StartUpVar = "M4.5" }); | |||
plcData.Add(new PLCData { Positon = 7, WeightVar = "VW212", StartUpVar = "M4.6" }); | |||
plcData.Add(new PLCData { Positon = 8, WeightVar = "VW214", StartUpVar = "M4.7" }); | |||
plcData.Add(new PLCData { Positon = 9, WeightVar = "VW216", StartUpVar = "M5.0" }); | |||
plcData.Add(new PLCData { Positon = 10, WeightVar = "VW218", StartUpVar = "M5.1" }); | |||
plcData.Add(new PLCData { Positon = 11, WeightVar = "VW220", StartUpVar = "M5.2" }); | |||
plcData.Add(new PLCData { Positon = 12, WeightVar = "VW222", StartUpVar = "M5.3" }); | |||
plcData.Add(new PLCData { Positon = 13, WeightVar = "VW224", StartUpVar = "M5.4" }); | |||
plcData.Add(new PLCData { Positon = 14, WeightVar = "VW226", StartUpVar = "M5.5" }); | |||
} | |||
} | |||
public class PLCData | |||
{ | |||
/// <summary> | |||
/// 通道位置 | |||
/// </summary> | |||
public int Positon; | |||
/// <summary> | |||
/// PLC通道重量点位 | |||
/// </summary> | |||
public string WeightVar; | |||
/// <summary> | |||
/// PLC通道启动点位 | |||
/// </summary> | |||
public string StartUpVar; | |||
} | |||
} |
@@ -1656,7 +1656,7 @@ | |||
FontFamily="Fonts/#Quartz M" | |||
FontSize="20" | |||
Foreground="{DynamicResource ProgressBar.Progress.圆形蓝.Text}" | |||
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat=\{0\}%}" /> | |||
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0:f1}%}" /> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<EventTrigger RoutedEvent="Loaded"> | |||
@@ -1745,7 +1745,7 @@ | |||
FontFamily="Fonts/#Quartz M" | |||
FontSize="20" | |||
Foreground="{DynamicResource ProgressBar.Progress.圆形绿.Text}" | |||
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat=\{0\}%}" /> | |||
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0:f1}%}" /> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<EventTrigger RoutedEvent="Loaded"> | |||
@@ -1834,7 +1834,7 @@ | |||
FontFamily="Fonts/#Quartz M" | |||
FontSize="20" | |||
Foreground="{DynamicResource ProgressBar.Progress.圆形红.Text}" | |||
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat=\{0\}%}" /> | |||
Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0:f1}%}" /> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<EventTrigger RoutedEvent="Loaded"> | |||
@@ -1920,7 +1920,7 @@ | |||
FontFamily="{StaticResource Digital}" | |||
FontSize="12" | |||
Foreground="{DynamicResource Titleforeground}" | |||
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value, StringFormat={}百分比: {0} %}" | |||
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value, StringFormat={}百分比: {0:f2} %}" | |||
Visibility="Visible" /> | |||
<VisualStateManager.VisualStateGroups> | |||
<VisualStateGroup x:Name="CommonStates"> | |||
@@ -6,7 +6,7 @@ | |||
xmlns:local="clr-namespace:PermissionManagement" | |||
mc:Ignorable="d" | |||
Title="MainWindow" Height="450" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True" > | |||
<Grid Background=""> | |||
<Grid > | |||
</Grid> | |||
</Window> |
@@ -176,6 +176,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmart.UserManagement", " | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmart.PageLoad", "BPASmart.PageLoad\BPASmart.PageLoad.csproj", "{2DB084E8-B951-4D71-A203-FD0902EBA2C6}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmart.CustomResource", "BPASmart.CustomResource\BPASmart.CustomResource.csproj", "{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HK-Advertisement", "..\..\TEST\HK-Advertisement\HK-Advertisement.csproj", "{CE98BFD2-9D96-4AB4-A727-662BB341200C}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkMOC", "BPASmartClient.MorkMOC\BPASmartClient.MorkMOC.csproj", "{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.SmallBatchingSystem", "BPASmartClient.SmallBatchingSystem\BPASmartClient.SmallBatchingSystem.csproj", "{BA588F22-87FB-4124-AF62-CA8DC492ED7D}" | |||
EndProject | |||
Global | |||
@@ -1632,6 +1638,66 @@ Global | |||
{2DB084E8-B951-4D71-A203-FD0902EBA2C6}.Release|x64.Build.0 = Release|Any CPU | |||
{2DB084E8-B951-4D71-A203-FD0902EBA2C6}.Release|x86.ActiveCfg = Release|Any CPU | |||
{2DB084E8-B951-4D71-A203-FD0902EBA2C6}.Release|x86.Build.0 = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|ARM.Build.0 = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|ARM64.Build.0 = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|x64.Build.0 = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|x86.ActiveCfg = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Debug|x86.Build.0 = Debug|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|ARM.ActiveCfg = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|ARM.Build.0 = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|ARM64.ActiveCfg = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|ARM64.Build.0 = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|x64.ActiveCfg = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|x64.Build.0 = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|x86.ActiveCfg = Release|Any CPU | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3}.Release|x86.Build.0 = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|ARM.Build.0 = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|ARM64.Build.0 = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|x64.Build.0 = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|x86.ActiveCfg = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Debug|x86.Build.0 = Debug|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|ARM.ActiveCfg = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|ARM.Build.0 = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|ARM64.ActiveCfg = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|ARM64.Build.0 = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|x64.ActiveCfg = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|x64.Build.0 = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|x86.ActiveCfg = Release|Any CPU | |||
{CE98BFD2-9D96-4AB4-A727-662BB341200C}.Release|x86.Build.0 = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|ARM.Build.0 = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|ARM64.Build.0 = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|x64.Build.0 = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|x86.ActiveCfg = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Debug|x86.Build.0 = Debug|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|ARM.ActiveCfg = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|ARM.Build.0 = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|ARM64.ActiveCfg = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|ARM64.Build.0 = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|x64.ActiveCfg = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|x64.Build.0 = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|x86.ActiveCfg = Release|Any CPU | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2}.Release|x86.Build.0 = Release|Any CPU | |||
{BA588F22-87FB-4124-AF62-CA8DC492ED7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{BA588F22-87FB-4124-AF62-CA8DC492ED7D}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{BA588F22-87FB-4124-AF62-CA8DC492ED7D}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||
@@ -1734,6 +1800,8 @@ Global | |||
{06F30619-AD37-4CA0-838F-0431867E0932} = {CDC1E762-5E1D-4AE1-9DF2-B85761539086} | |||
{2DB084E8-B951-4D71-A203-FD0902EBA2C6} = {CDC1E762-5E1D-4AE1-9DF2-B85761539086} | |||
{BA588F22-87FB-4124-AF62-CA8DC492ED7D} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||
{E7CC45BF-7393-4BA7-A9AD-B1A1F5B265F3} = {CDC1E762-5E1D-4AE1-9DF2-B85761539086} | |||
{D5081D7B-3EBB-42C7-8FB9-A889870D08C2} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} | |||
EndGlobalSection | |||
GlobalSection(ExtensibilityGlobals) = postSolution | |||
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | |||