Selaa lähdekoodia

配料系统修改

master
pry 2 vuotta sitten
vanhempi
commit
7aa7d92bde
11 muutettua tiedostoa jossa 716 lisäystä ja 186 poistoa
  1. +6
    -0
      BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj
  2. +31
    -0
      BPASmartClient.CustomResource/Converters/DataTableRedundantConverter.cs
  3. BIN
     
  4. +285
    -74
      BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml
  5. +157
    -0
      BPASmartClient.CustomResource/RecDictionarys/GlobalDataTableStyle.xaml
  6. BIN
     
  7. +15
    -8
      BPASmartClient.CustomResource/UserControls/ConveyBelt2.xaml
  8. +1
    -0
      BPASmartClient.S7Net/EntityClassResolution.cs
  9. +215
    -103
      DosingSystem/View/HardwareStatusView.xaml
  10. +5
    -0
      DosingSystem/ViewModel/HardwareStatusViewModel.cs
  11. +1
    -1
      FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs

+ 6
- 0
BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj Näytä tiedosto

@@ -200,6 +200,7 @@
<None Remove="Image\组 8.png" />
<None Remove="Image\组合边框1.1.png" />
<None Remove="Image\组合边框1.png" />
<None Remove="Image\组合边框2.1.png" />
<None Remove="Image\维护.png" />
<None Remove="Image\背景.png" />
<None Remove="Image\背景2.png" />
@@ -360,6 +361,7 @@
<Resource Include="Image\组 8.png" />
<Resource Include="Image\组合边框1.1.png" />
<Resource Include="Image\组合边框1.png" />
<Resource Include="Image\组合边框2.1.png" />
<Resource Include="Image\背景2.png" />
<Resource Include="Image\背景3.jpg" />
<Resource Include="Image\背景框.png" />
@@ -548,4 +550,8 @@
<Resource Include="Image\黑菠萝科技.png" />
</ItemGroup>

<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>

</Project>

+ 31
- 0
BPASmartClient.CustomResource/Converters/DataTableRedundantConverter.cs Näytä tiedosto

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace BPASmartClient.CustomResource.Converters
{
public class DataTableRedundantConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value != null && value is bool bit)
{
if (bit)
return new SolidColorBrush(Color.FromArgb(255, 245, 63, 98));
else
return new SolidColorBrush(Color.FromArgb(255, 42, 178, 231));
}
return default;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}


+ 285
- 74
BPASmartClient.CustomResource/Pages/View/UserManagerView.xaml Näytä tiedosto

@@ -1,54 +1,67 @@
<UserControl x:Class="BPASmartClient.CustomResource.Pages.View.UserManagerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
Width="1400"
Height="900"
Background="{x:Null}"
mc:Ignorable="d">
<UserControl
x:Class="BPASmartClient.CustomResource.Pages.View.UserManagerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
Width="1400"
Height="900"
Background="{x:Null}"
mc:Ignorable="d">
<UserControl.DataContext>
<vm:UserManagerViewModel/>
<vm:UserManagerViewModel />
</UserControl.DataContext>
<UserControl.Resources>
<Style x:Key="CommonTextBlockStyle" TargetType="TextBlock">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#B1E8FF"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<!--<Style x:Key="CommonTextBlockStyle" TargetType="TextBlock">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="#B1E8FF" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="TextBlock.FontSize" Value="13" />
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="#87CEFA"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content.Text}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="#87CEFA" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content.Text}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<!--HorizontalAlignment 可以设置内容展示位置-->
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center"
Margin="{TemplateBinding Padding}"/>
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
SnapsToDevicePixels="True">
-->
<!-- HorizontalAlignment 可以设置内容展示位置 -->
<!--
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value=".56"/>
<Setter Property="Opacity" Value=".56" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="DataGridRow">
<Setter Property="FontSize" Value="16"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,5"/>
<Style TargetType="DataGridRow">
<Setter Property="FontSize" Value="16" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="0,5" />
<Style.Triggers>
<!-- 隔行换色 -->
-->
<!-- 隔行换色 -->
<!--
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="Transparent" />
</Trigger>
@@ -68,7 +81,7 @@
<Setter Property="Foreground" Value="#ddd" />
<Setter Property="FontSize" Value="26" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridColumnHeader">
@@ -77,12 +90,27 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center"
HorizontalAlignment="Center" />
<Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill"
Grid.Column="0" Width="8" Height="6" Fill="Transparent" Margin="0,0,50,0"
VerticalAlignment="Center" RenderTransformOrigin="1,1" />
<Rectangle Width="1" Fill="#87CEFA" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
<ContentPresenter
Margin="0,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<Path
x:Name="SortArrow"
Grid.Column="0"
Width="8"
Height="6"
Margin="0,0,50,0"
VerticalAlignment="Center"
Data="M0,0 L1,0 0.5,1 z"
Fill="Transparent"
RenderTransformOrigin="1,1"
Stretch="Fill"
Visibility="Collapsed" />
<Rectangle
Grid.ColumnSpan="1"
Width="1"
HorizontalAlignment="Right"
Fill="#87CEFA" />
</Grid>

</ControlTemplate>
@@ -91,80 +119,263 @@
<Setter Property="Height" Value="25" />
</Style>
<Style x:Key="datagridButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Foreground" Value="#1874CD"/>
<Setter Property="FontSize" Value="18"/>
</Style>
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Foreground" Value="#1874CD" />
<Setter Property="FontSize" Value="18" />
</Style>-->


<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalDataTableStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>


</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<!--<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
<RowDefinition Height="100"/>
</Grid.RowDefinitions>-->

<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="用户管理" FontSize="28" Style="{DynamicResource CommonTextBlockStyle}"/>
<DataGrid Grid.Row="1" Margin="30" AutoGenerateColumns="False" RowHeight="35" ItemsSource="{Binding userManager}"
Background="Transparent"
FrozenColumnCount="1"
VerticalAlignment="Top"
IsReadOnly="True"
CanUserResizeColumns="False" CanUserResizeRows="False" SelectionMode="Single"
CanUserReorderColumns="False" AlternationCount="2" RowHeaderWidth="0" CanUserAddRows="False">

<!--<TextBlock Text="用户管理" FontSize="28" Style="{DynamicResource CommonTextBlockStyle}"/>-->
<!--<DataGrid
Grid.Row="1"
Margin="30"
VerticalAlignment="Top"
AlternationCount="2"
AutoGenerateColumns="False"
Background="Transparent"
CanUserAddRows="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
FrozenColumnCount="1"
IsReadOnly="True"
ItemsSource="{Binding userManager}"
RowHeaderWidth="0"
RowHeight="35"
SelectionMode="Single"
Visibility="Hidden">
<DataGrid.Columns>
<DataGridTemplateColumn Header="用户名" Width="200">
<DataGridTemplateColumn Width="200" Header="用户名">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding UserName}" FontSize="20" Foreground="White"/>
<TextBlock
FontSize="20"
Foreground="White"
Text="{Binding UserName}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="最后登录时间" Width="300" >
<DataGridTemplateColumn Width="300" Header="最后登录时间">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding LastLogInTime}" FontSize="20" Foreground="White"/>
<TextBlock
FontSize="20"
Foreground="White"
Text="{Binding LastLogInTime}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="权限" Width="250">
<DataGridTemplateColumn Width="250" Header="权限">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="权限" Style="{DynamicResource datagridButton}"
Command="{Binding DataContext.EditUserConfigCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid},Path=SelectedItem}"/>
<Button
Command="{Binding DataContext.EditUserConfigCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
Content="权限"
Style="{DynamicResource datagridButton}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="重置密码" Width="250">
<DataGridTemplateColumn Width="250" Header="重置密码">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="重置密码" Style="{DynamicResource datagridButton}" Command="{Binding DataContext.ChangePasswardCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid},Path=SelectedItem}"/>
<Button
Command="{Binding DataContext.ChangePasswardCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
Content="重置密码"
Style="{DynamicResource datagridButton}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="删除" Width="*">
<DataGridTemplateColumn Width="*" Header="删除">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="删除" Style="{DynamicResource datagridButton}"
Command="{Binding DataContext.DeleteUserCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid},Path=SelectedItem}"/>
<Button
Command="{Binding DataContext.DeleteUserCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}, Path=SelectedItem}"
Content="删除"
Style="{DynamicResource datagridButton}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<Button Grid.Row="2"

</DataGrid>-->


<!--#region 列表-->
<!--#region 表格标题栏设置-->
<Grid
Grid.Row="1"
Margin="0,10,0,0"
Background="#ff0C255F">

<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>


<TextBlock
Grid.Column="0"
Style="{StaticResource TitleTextblockStyle}"
Text="用户名" />

<Grid Grid.Column="1">
<TextBlock Style="{StaticResource TitleTextblockStyle}" Text="最后登录时间" />
<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="删除" />

<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 userManager}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Name="gr" Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
Foreground="{StaticResource tabColor}"
Style="{StaticResource DisiableTextblockStyle}"
Text="{Binding UserName}" />

<Grid Grid.Column="1">
<TextBlock
Foreground="{StaticResource tabColor}"
Style="{StaticResource DisiableTextblockStyle}"
Text="{Binding LastLogInTime}" />
<Border
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0"
Cursor="SizeWE" />
</Grid>

<Button
Grid.Column="2"
Command="{Binding DataContext.EditUserConfigCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="权限"
Foreground="{StaticResource tabColor}"
Style="{StaticResource ControlButtonStyle}" />

<Grid Grid.Column="3">
<Button
Command="{Binding DataContext.ChangePasswardCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="重置密码"
Style="{StaticResource ControlButtonStyle}" />
<Border
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0"
Cursor="SizeWE" />
</Grid>

<Button
Grid.Column="4"
Command="{Binding DataContext.DeleteUserCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
CommandParameter="{Binding}"
Content="删除"
Style="{StaticResource RemoveButtonStyle}" />

<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>
<!--#endregion-->

<Button
Width="200"
Height="50"
Margin="10,0"
HorizontalAlignment="Right"
Command="{Binding AddNewUserCommand}"
Content="添加新用户"
FontSize="24"
Style="{StaticResource ImageButtonStyle}" />

<!--<Button Grid.Row="2"
Height="50" Width="200"
Background="#009DFF"
BorderThickness="0"
Command="{Binding AddNewUserCommand}"
Content="添加新用户"
FontSize="24"
Foreground="White" />
Foreground="White" />-->
</Grid>
</UserControl>

+ 157
- 0
BPASmartClient.CustomResource/RecDictionarys/GlobalDataTableStyle.xaml Näytä tiedosto

@@ -0,0 +1,157 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters">
<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="RemoveButtonStyle" 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="ControlButtonStyle" TargetType="Button">
<Setter Property="Margin" Value="0" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="#00c2f4" />
<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/组合边框2.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>

<Style x:Key="DisiableTextblockStyle" 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="楷体" />
</Style>

</ResourceDictionary>


+ 15
- 8
BPASmartClient.CustomResource/UserControls/ConveyBelt2.xaml Näytä tiedosto

@@ -12,6 +12,7 @@
<Viewbox HorizontalAlignment="Center" VerticalAlignment="Center">

<Canvas
Background="Transparent"
Width="{Binding ElementName=br, Path=ActualWidth}"
Height="{Binding ElementName=br, Path=ActualHeight}"
Margin="5">
@@ -25,9 +26,10 @@
RadiusY="1">
<Rectangle.Fill>
<LinearGradientBrush>
<GradientStop Offset="0" Color="LightGray" />
<GradientStop Offset="0.5" Color="White" />
<GradientStop Offset="1" Color="LightGray" />
<GradientStop Offset="0" Color="#00BEFA" />
<GradientStop Offset="0.3" Color="#ddd" />
<GradientStop Offset="0.7" Color="#ddd" />
<GradientStop Offset="1" Color="#00BEFA" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
@@ -41,9 +43,13 @@
RadiusY="1">
<Rectangle.Fill>
<LinearGradientBrush>
<GradientStop Offset="0" Color="LightGray" />
<!--<GradientStop Offset="0" Color="LightGray" />
<GradientStop Offset="0.5" Color="White" />
<GradientStop Offset="1" Color="LightGray" />
<GradientStop Offset="1" Color="LightGray" />-->
<GradientStop Offset="0" Color="#00BEFA" />
<GradientStop Offset="0.3" Color="#ddd" />
<GradientStop Offset="0.7" Color="#ddd" />
<GradientStop Offset="1" Color="#00BEFA" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
@@ -55,9 +61,10 @@
StrokeThickness="20">
<Path.Stroke>
<LinearGradientBrush>
<GradientStop Offset="0" Color="SlateGray" />
<GradientStop Offset="0.5" Color="White" />
<GradientStop Offset="1" Color="SlateGray" />
<GradientStop Offset="0" Color="#00BEFA" />
<GradientStop Offset="0.3" Color="#ddd" />
<GradientStop Offset="0.7" Color="#ddd" />
<GradientStop Offset="1" Color="#00BEFA" />
</LinearGradientBrush>
</Path.Stroke>
</Path>


+ 1
- 0
BPASmartClient.S7Net/EntityClassResolution.cs Näytä tiedosto

@@ -45,6 +45,7 @@ namespace BPASmartClient.S7Net
numBytes += 8.0;
break;
case "String":
//numBytes += 256.0;
numBytes += 256.0;
break;
default:


+ 215
- 103
DosingSystem/View/HardwareStatusView.xaml Näytä tiedosto

@@ -18,9 +18,9 @@

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.6*" />
<RowDefinition Height="0.8*" />
<RowDefinition />
<RowDefinition Height="0.6*" />
<RowDefinition Height="0.8*" />
</Grid.RowDefinitions>

<!--#region 顶部料仓-->
@@ -46,61 +46,56 @@
<ListView.ItemTemplate>
<DataTemplate>
<Border Margin="5" Background="Transparent">
<Grid Height="220">
<Grid Height="270" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition Height="0.6*" />
</Grid.RowDefinitions>

<!--<TextBlock
Margin="0,0,0,35"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
FontSize="25"
Foreground="#ffccd61f"
Text="{Binding DeviceName}" />-->

<StackPanel
Grid.Row="1"
Margin="0,2,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding Weight}" />
<StackPanel Grid.Row="1">
<StackPanel
Grid.Row="1"
Margin="0,2,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding Weight}" />

<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text=" kg" />
</StackPanel>
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text=" kg" />
</StackPanel>

<StackPanel
Grid.Row="1"
Margin="0,28,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding DeviceNum}" />
<StackPanel
Grid.Row="1"
Margin="0,2,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding DeviceNum}" />

<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text=" 号仓" />
</StackPanel>

<TextBlock
Grid.Row="1"
Margin="0,2,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
Foreground="#FF0084FF"
Text=" 号仓" />
</StackPanel>
Text="{Binding DeviceName}" />

<TextBlock
Grid.Row="1"
Margin="0,50,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding DeviceName}" />
</StackPanel>

<StackPanel Grid.Row="2" Orientation="Horizontal">
<StackPanel>
@@ -117,6 +112,7 @@
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="16"
Foreground="#00c2f4"
Text="仓盖控制" />
</StackPanel>
@@ -136,6 +132,7 @@
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="16"
Foreground="#00c2f4"
Text="出料控制" />
</StackPanel>
@@ -148,38 +145,35 @@
Stretch="Fill"
Visibility="{Binding IsOpen, Converter={StaticResource BoolToVisibilityConvert}}" />

<Grid Height="45" Margin="20,-30,20,0">
<Image Source="/BPASmartClient.CustomResource;component/Image/荧光/29.png" Visibility="{Binding IsLayOff, Converter={StaticResource BoolToVisibilityConvert}}" />

<Image
Grid.RowSpan="2"
Source="/BPASmartClient.CustomResource;component/Image/光柱.png"
Stretch="Fill" />

<Grid
Name="WeightGr"
Height="45"
Margin="20,-30,20,0">
<Grid.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/荧光/蓝色提示框.png" />
</Grid.Background>
<!--<TextBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
Foreground="#00c2f4"
Text="{Binding DeviceName}" />-->

<TextBox
Name="outName"
Width="160"
Height="45"
Margin="-3,-2,0,0"
Width="{Binding ElementName=WeightGr, Path=ActualWidth}"
Height="{Binding ElementName=WeightGr, Path=ActualHeight}"
Margin="0,-2,0,0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Background="Transparent"
BorderThickness="0"
CaretBrush="#009dff"
FontSize="20"
Style="{StaticResource TextBoxStyle}"
Text="{Binding RecipeName}" />
Foreground="#009dff"
Text="{Binding Weight}" />

</Grid>
<!--<Image Height="45" Stretch="Fill" Margin="20 -30 20 0" Source="/BPASmartClient.CustomResource;component/Image/荧光/蓝色提示框.png" />-->



<Image Source="/BPASmartClient.CustomResource;component/Image/荧光/29.png" Visibility="{Binding IsLayOff, Converter={StaticResource BoolToVisibilityConvert}}" />

<Image
Grid.RowSpan="2"
Source="/BPASmartClient.CustomResource;component/Image/光柱.png"
Stretch="Fill" />

</Grid>
</Border>
</DataTemplate>
@@ -188,8 +182,12 @@
</Grid>
<!--#endregion-->

<Grid x:Name="gr" Grid.Row="1">
<pry:ConveyorBelt
<!--#region 输送带-->
<Grid
x:Name="gr"
Grid.Row="1"
Background="Transparent">
<!--<pry:ConveyorBelt
Grid.Row="1"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
@@ -199,8 +197,46 @@
StrokeBrush="#00BEFA"
StrokeDashArray="1.5 1.5"
StrokeFillBrush="#00BEFA"
StrokeThickness="2" />
StrokeThickness="2" />-->

<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<pry:ConveyBelt2
Grid.RowSpan="4"
Margin="-12,0,10,0"
BeltDashThickess="50"
BeltHeight="{Binding ElementName=gr, Path=ActualHeight}"
BeltWidth="{Binding ElementName=gr, Path=ActualWidth}"
IsRun="{Binding ConveyerBeltWork}" />

<StackPanel
Grid.Row="1"
Margin="20,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Orientation="Horizontal">
<TextBlock
Margin="0,0,5,0"
FontSize="20"
Foreground="#00c2f4"
Text="输送带控制" />
<ToggleButton
Width="80"
Height="30"
Margin="5,0,5,0"
Background="Transparent"
FontSize="20"
IsChecked="{Binding ConveyerBeltWork}"
Style="{StaticResource SwitchToggleButtonStyle}" />
</StackPanel>

</Grid>
<!--#endregion-->

<!--#region 底部料仓-->
<Grid Grid.Row="2">
@@ -223,58 +259,134 @@
<ListView.ItemTemplate>
<DataTemplate>
<Border Margin="5" Background="Transparent">
<Grid Height="220">
<Grid Height="270" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition Height="0.6*" />
</Grid.RowDefinitions>

<TextBlock
Margin="0,0,0,35"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
FontSize="25"
Foreground="#ffccd61f"
Text="{Binding DeviceName}" />

<StackPanel
Grid.Row="1"
Margin="0,25,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding Weight}" />
<StackPanel Grid.Row="1">
<StackPanel
Grid.Row="1"
Margin="0,2,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding Weight}" />

<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text=" kg" />
</StackPanel>

<StackPanel
Grid.Row="1"
Margin="0,2,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding DeviceNum}" />

<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text=" 号仓" />
</StackPanel>

<TextBlock
Grid.Row="1"
Margin="0,2,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
Foreground="#FF0084FF"
Text=" kg" />
Text="{Binding DeviceName}" />

</StackPanel>

<StackPanel Grid.Row="2" Orientation="Horizontal">
<StackPanel>
<ToggleButton
Width="80"
Height="30"
Margin="5,0,5,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="Transparent"
FontSize="20"
IsChecked="{Binding IsOpen}"
Style="{StaticResource SwitchToggleButtonStyle}" />
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="16"
Foreground="#00c2f4"
Text="仓盖控制" />
</StackPanel>

<StackPanel
Grid.Row="1"
Margin="0,70,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text="{Binding DeviceNum}" />

<TextBlock
FontSize="20"
Foreground="#FF0084FF"
Text=" 号仓" />
<StackPanel>
<ToggleButton
Width="80"
Height="30"
Margin="5,0,5,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="Transparent"
FontSize="20"
IsChecked="{Binding IsLayOff}"
Style="{StaticResource SwitchToggleButtonStyle}" />
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="16"
Foreground="#00c2f4"
Text="出料控制" />
</StackPanel>

</StackPanel>

<Image
Margin="20,30,20,0"
Source="/BPASmartClient.CustomResource;component/Image/荧光/矩形发光.png"
Stretch="Fill"
Visibility="{Binding IsOpen, Converter={StaticResource BoolToVisibilityConvert}}" />

<Image Source="/BPASmartClient.CustomResource;component/Image/荧光/29.png" Visibility="{Binding IsLayOff, Converter={StaticResource BoolToVisibilityConvert}}" />

<Image
Grid.RowSpan="2"
Source="/BPASmartClient.CustomResource;component/Image/光柱.png"
Stretch="Fill" />

<Grid
Name="WeightGr"
Height="45"
Margin="20,-30,20,0">
<Grid.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/荧光/蓝色提示框.png" />
</Grid.Background>
<TextBox
Name="outName"
Width="{Binding ElementName=WeightGr, Path=ActualWidth}"
Height="{Binding ElementName=WeightGr, Path=ActualHeight}"
Margin="0,-2,0,0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Background="Transparent"
BorderThickness="0"
CaretBrush="#009dff"
FontSize="20"
Foreground="#009dff"
Text="{Binding Weight}" />

</Grid>
</Grid>
</Border>
</DataTemplate>


+ 5
- 0
DosingSystem/ViewModel/HardwareStatusViewModel.cs Näytä tiedosto

@@ -24,5 +24,10 @@ namespace BPASmartClient.DosingSystem.ViewModel
public ObservableCollection<DeviceCurrentStatus> TopDeviceCurrentStatuses { get; set; }

public ObservableCollection<DeviceCurrentStatus> BottomDeviceCurrentStatuses { get; set; }


public bool ConveyerBeltWork { get { return _mConveyerBeltWork; } set { _mConveyerBeltWork = value; OnPropertyChanged(); } }
private bool _mConveyerBeltWork;

}
}

+ 1
- 1
FryPot_DosingSystem/ViewModel/FlowProcessSetViewModel.cs Näytä tiedosto

@@ -52,7 +52,7 @@ namespace FryPot_DosingSystem.ViewModel
if (recipeName != null)
{
currentRecipeName = recipeName.ToString();
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.FlowProcess.RecipeName == recipeName.ToString());
var res = Json<RecipeManage>.Data.Recipes.FirstOrDefault(p => p.FlowProcess?.RecipeName == recipeName?.ToString());
if (res != null && res is NewRecipeModel recipe) //编辑已有工艺
{
foreach (var item in recipe.materialCollection)


Ladataan…
Peruuta
Tallenna