Przeglądaj źródła

设备列表修改

样式分支
pry 2 lat temu
rodzic
commit
bf2aa5cede
11 zmienionych plików z 522 dodań i 11 usunięć
  1. +4
    -3
      BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml
  2. +0
    -2
      BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj
  3. +31
    -0
      BPASmartClient.SmallBatchingSystem/Converter/DataTableRedundantConverter.cs
  4. +17
    -0
      BPASmartClient.SmallBatchingSystem/Models/SiloInfoModel.cs
  5. +17
    -0
      BPASmartClient.SmallBatchingSystem/ViewModels/OutletManagementViewModel.cs
  6. +12
    -0
      BPASmartClient.SmallBatchingSystem/ViewModels/SiloManagementViewModel.cs
  7. +12
    -0
      BPASmartClient.SmallBatchingSystem/Views/OutletManagementView.xaml
  8. +28
    -0
      BPASmartClient.SmallBatchingSystem/Views/OutletManagementView.xaml.cs
  9. +370
    -0
      BPASmartClient.SmallBatchingSystem/Views/SiloManagementView.xaml
  10. +28
    -0
      BPASmartClient.SmallBatchingSystem/Views/SiloManagementView.xaml.cs
  11. +3
    -6
      DosingSystem/View/DeviceListView.xaml

+ 4
- 3
BPASmartClient.JXJFoodSmallStation/View/DeviceListView.xaml Wyświetl plik

@@ -57,10 +57,11 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
<!--<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="8" />
Columns="8" />-->
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

@@ -68,7 +69,7 @@
<DataTemplate>
<Border
Name="ShadowElement"
Width="200"
Width="180"
Height="150"
Margin="10"
VerticalAlignment="Top"


+ 0
- 2
BPASmartClient.SmallBatchingSystem/BPASmartClient.SmallBatchingSystem.csproj Wyświetl plik

@@ -9,8 +9,6 @@

<ItemGroup>
<Folder Include="Images\" />
<Folder Include="ViewModels\" />
<Folder Include="Views\" />
</ItemGroup>

<ItemGroup>


+ 31
- 0
BPASmartClient.SmallBatchingSystem/Converter/DataTableRedundantConverter.cs Wyświetl plik

@@ -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.SmallBatchingSystem.Converter
{
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();
}
}
}

+ 17
- 0
BPASmartClient.SmallBatchingSystem/Models/SiloInfoModel.cs Wyświetl plik

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;

namespace BPASmartClient.SmallBatchingSystem.Models
{
public class SiloInfoModel : ObservableObject
{
public SiloInfoModel()
{

}
}
}

+ 17
- 0
BPASmartClient.SmallBatchingSystem/ViewModels/OutletManagementViewModel.cs Wyświetl plik

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;

namespace BPASmartClient.SmallBatchingSystem.ViewModels
{
public class OutletManagementViewModel : ObservableObject
{
public OutletManagementViewModel()
{

}
}
}

+ 12
- 0
BPASmartClient.SmallBatchingSystem/ViewModels/SiloManagementViewModel.cs Wyświetl plik

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.SmallBatchingSystem.ViewModels
{
public class SiloManagementViewModel
{
}
}

+ 12
- 0
BPASmartClient.SmallBatchingSystem/Views/OutletManagementView.xaml Wyświetl plik

@@ -0,0 +1,12 @@
<UserControl x:Class="BPASmartClient.SmallBatchingSystem.Views.OutletManagementView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.SmallBatchingSystem.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>

+ 28
- 0
BPASmartClient.SmallBatchingSystem/Views/OutletManagementView.xaml.cs Wyświetl plik

@@ -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.SmallBatchingSystem.Views
{
/// <summary>
/// OutletManagementView.xaml 的交互逻辑
/// </summary>
public partial class OutletManagementView : UserControl
{
public OutletManagementView()
{
InitializeComponent();
}
}
}

+ 370
- 0
BPASmartClient.SmallBatchingSystem/Views/SiloManagementView.xaml Wyświetl plik

@@ -0,0 +1,370 @@
<UserControl
x:Class="BPASmartClient.SmallBatchingSystem.Views.SiloManagementView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.SmallBatchingSystem.Converter"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.SmallBatchingSystem.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.SmallBatchingSystem.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">

<UserControl.DataContext>
<vm:SiloManagementViewModel />
</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>

+ 28
- 0
BPASmartClient.SmallBatchingSystem/Views/SiloManagementView.xaml.cs Wyświetl plik

@@ -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.SmallBatchingSystem.Views
{
/// <summary>
/// SiloManagementView.xaml 的交互逻辑
/// </summary>
public partial class SiloManagementView : UserControl
{
public SiloManagementView()
{
InitializeComponent();
}
}
}

+ 3
- 6
DosingSystem/View/DeviceListView.xaml Wyświetl plik

@@ -57,10 +57,7 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="8" />
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

@@ -77,10 +74,10 @@
ClipToBounds="True"
CornerRadius="0">
<Border.Background>
<ImageBrush Stretch="Fill" ImageSource="/BPASmartClient.CustomResource;component/Image/蓝色背景.png" />
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/蓝色背景.png" Stretch="Fill" />
</Border.Background>

<Grid Margin="20 0">
<Grid Margin="20,0">

<!--<Grid.RowDefinitions>
<RowDefinition />


Ładowanie…
Anuluj
Zapisz