@@ -0,0 +1,83 @@ | |||
<UserControl | |||
x:Class="BPASmartClient.CustomResource.UserControls.Bottle" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
d:DesignHeight="200" | |||
d:DesignWidth="70" | |||
mc:Ignorable="d"> | |||
<Border BorderThickness="0"> | |||
<Viewbox> | |||
<Canvas Width="70" Height="200"> | |||
<Ellipse | |||
Width="70" | |||
Height="18" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
Fill="#97e8f4" | |||
StrokeThickness="0" /> | |||
<Rectangle | |||
Canvas.Top="10" | |||
Width="70" | |||
Height="160" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Top" | |||
Stroke="Black" | |||
StrokeThickness="0"> | |||
<Rectangle.Fill> | |||
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> | |||
<GradientStop Color="#FF97E8F4" /> | |||
<GradientStop Offset="1" Color="#FF97E8F4" /> | |||
<GradientStop Offset="0.45" Color="#FEFFFFFF" /> | |||
<GradientStop Offset="0.55" Color="#FEF9F9F9" /> | |||
</LinearGradientBrush> | |||
</Rectangle.Fill> | |||
</Rectangle> | |||
<Border | |||
Canvas.Left="14" | |||
Canvas.Top="188" | |||
Width="42" | |||
Height="12" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
Background="DimGray" | |||
BorderThickness="0" /> | |||
<Path | |||
Canvas.Left="0.5" | |||
Canvas.Top="172.334" | |||
Width="69" | |||
Height="15" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Top" | |||
Data="M0,167 L13.833,187.83301 56.201249,187.83301 70,167" | |||
Fill="#FFD8D35B" | |||
Stretch="Fill" | |||
StrokeThickness="0" /> | |||
<Ellipse | |||
Canvas.Left="-0.5" | |||
Canvas.Top="161" | |||
Width="71" | |||
Height="18" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Top" | |||
Fill="#FFD8D35B" | |||
Stroke="#FF636242" | |||
StrokeThickness="0.5" /> | |||
<Rectangle | |||
Name="refile" | |||
Canvas.Bottom="30" | |||
Width="70" | |||
Height="0" | |||
HorizontalAlignment="Center" | |||
VerticalAlignment="Center" | |||
Fill="#FFD8D35B" | |||
Stroke="Black" | |||
StrokeThickness="0" /> | |||
</Canvas> | |||
</Viewbox> | |||
</Border> | |||
</UserControl> |
@@ -0,0 +1,56 @@ | |||
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.CustomResource.UserControls | |||
{ | |||
/// <summary> | |||
/// Bottle.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class Bottle : UserControl | |||
{ | |||
public Bottle() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |||
{ | |||
(d as Bottle)?.Refresh(); | |||
} | |||
private void Refresh() | |||
{ | |||
double height = LinearConvert(CurrentValue, 160F, 0F, 100F, 0F); | |||
refile.Height = height; | |||
} | |||
private double LinearConvert(double IntputValue, double OSH, double OSL, double ISH, double ISL) | |||
{ | |||
if (IntputValue >= ISH) return OSH; | |||
if (IntputValue <= ISL) return OSL; | |||
return (IntputValue - ISL) * (OSH - OSL) / (ISH - ISL) + OSL; | |||
} | |||
public double CurrentValue | |||
{ | |||
get { return (double)GetValue(CurrentValueProperty); } | |||
set { SetValue(CurrentValueProperty, value); } | |||
} | |||
public static readonly DependencyProperty CurrentValueProperty = | |||
DependencyProperty.Register("CurrentValue", typeof(double), typeof(Bottle), | |||
new PropertyMetadata(0.0, new PropertyChangedCallback(OnPropertyChanged))); | |||
} | |||
} |
@@ -0,0 +1,81 @@ | |||
<UserControl | |||
x:Class="BPASmartClient.CustomResource.UserControls.ConveyorBelt" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
d:DesignHeight="300" | |||
d:DesignWidth="800" | |||
mc:Ignorable="d"> | |||
<UserControl.Resources> | |||
<Storyboard x:Key="Left" RepeatBehavior="Forever"> | |||
<DoubleAnimation | |||
Storyboard.TargetName="mp" | |||
Storyboard.TargetProperty="StrokeDashOffset" | |||
From="0" | |||
To="100" | |||
Duration="0:0:20" /> | |||
</Storyboard> | |||
<Storyboard x:Key="Right" RepeatBehavior="Forever"> | |||
<DoubleAnimation | |||
Storyboard.TargetName="mp" | |||
Storyboard.TargetProperty="StrokeDashOffset" | |||
From="0" | |||
To="-100" | |||
Duration="0:0:20" /> | |||
</Storyboard> | |||
</UserControl.Resources> | |||
<Grid Name="cav"> | |||
<Viewbox Width="auto" Height="auto"> | |||
<Canvas Width="{Binding ElementName=cav, Path=ActualWidth}" Height="{Binding ElementName=cav, Path=ActualHeight}"> | |||
<Path | |||
Name="mp" | |||
Margin="0" | |||
Stroke="{Binding StrokeFillBrush, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" | |||
StrokeDashArray="{Binding StrokeDashArray, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" | |||
StrokeThickness="{Binding ConveyorBeltWidth, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" /> | |||
<Path | |||
Name="cb" | |||
Fill="Transparent" | |||
Stroke="{Binding StrokeBrush, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" | |||
StrokeThickness="{Binding StrokeThickness, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" /> | |||
</Canvas> | |||
</Viewbox> | |||
<VisualStateManager.VisualStateGroups> | |||
<VisualStateGroup> | |||
<VisualState Name="Left"> | |||
<Storyboard x:Name="sb" RepeatBehavior="Forever"> | |||
<DoubleAnimation | |||
Storyboard.TargetName="mp" | |||
Storyboard.TargetProperty="StrokeDashOffset" | |||
From="0" | |||
To="100" | |||
Duration="0:0:20" /> | |||
</Storyboard> | |||
</VisualState> | |||
<VisualState Name="Right"> | |||
<Storyboard RepeatBehavior="Forever"> | |||
<DoubleAnimation | |||
Storyboard.TargetName="mp" | |||
Storyboard.TargetProperty="StrokeDashOffset" | |||
From="0" | |||
To="-100" | |||
Duration="0:0:20" /> | |||
</Storyboard> | |||
</VisualState> | |||
<VisualState Name="Stop" /> | |||
</VisualStateGroup> | |||
</VisualStateManager.VisualStateGroups> | |||
</Grid> | |||
</UserControl> |
@@ -0,0 +1,137 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
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.Animation; | |||
using System.Windows.Media.Imaging; | |||
using System.Windows.Navigation; | |||
using System.Windows.Shapes; | |||
namespace BPASmartClient.CustomResource.UserControls | |||
{ | |||
/// <summary> | |||
/// ConveyorBelt.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class ConveyorBelt : UserControl | |||
{ | |||
public ConveyorBelt() | |||
{ | |||
InitializeComponent(); | |||
this.SizeChanged += ConveyorBelt_SizeChanged; | |||
} | |||
private void ConveyorBelt_SizeChanged(object sender, SizeChangedEventArgs e) | |||
{ | |||
//传送带外边框绘制 | |||
PathGeometry geometry = new PathGeometry(); | |||
PathFigure pathFigure = new PathFigure(); | |||
pathFigure.StartPoint = new Point(this.Height / 2, 0); | |||
pathFigure.Segments.Add(new ArcSegment(new Point(this.Height / 2, this.Height), new Size(this.Height / 2, this.Height / 2), 0, false, SweepDirection.Counterclockwise, true)); | |||
pathFigure.Segments.Add(new LineSegment(new Point(this.Width, this.Height), true)); | |||
pathFigure.Segments.Add(new LineSegment(new Point(this.Width, this.Height - ConveyorBeltWidth), true)); | |||
double innerCircle = (this.Height - (ConveyorBeltWidth * 2)) / 2;//内圆半径 | |||
pathFigure.Segments.Add(new LineSegment(new Point(ConveyorBeltWidth + innerCircle, this.Height - ConveyorBeltWidth), true)); | |||
pathFigure.Segments.Add(new ArcSegment(new Point(ConveyorBeltWidth + innerCircle, ConveyorBeltWidth), new Size(innerCircle, innerCircle), 0, false, SweepDirection.Clockwise, true)); | |||
pathFigure.Segments.Add(new LineSegment(new Point(this.Width, ConveyorBeltWidth), true)); | |||
pathFigure.Segments.Add(new LineSegment(new Point(this.Width, 0), true)); | |||
pathFigure.Segments.Add(new LineSegment(new Point(this.Height / 2, 0), true)); | |||
geometry.Figures.Add(pathFigure); | |||
this.cb.Data = geometry; | |||
//传送带内部皮带绘制 | |||
PathGeometry geometry1 = new PathGeometry(); | |||
PathFigure pathFigure1 = new PathFigure(); | |||
pathFigure1.StartPoint = new Point(this.Width, ConveyorBeltWidth / 2); | |||
double innerCircle1 = (this.Height - ConveyorBeltWidth) / 2;//内圆半径 | |||
pathFigure1.Segments.Add(new LineSegment(new Point(innerCircle1 + ConveyorBeltWidth / 2, ConveyorBeltWidth / 2), true)); | |||
pathFigure1.Segments.Add(new ArcSegment(new Point(innerCircle1 + ConveyorBeltWidth / 2, this.Height - ConveyorBeltWidth / 2), new Size(innerCircle1, innerCircle1), 0, false, SweepDirection.Counterclockwise, true)); | |||
pathFigure1.Segments.Add(new LineSegment(new Point(this.Width, this.Height - ConveyorBeltWidth / 2), true)); | |||
geometry1.Figures.Add(pathFigure1); | |||
this.mp.Data = geometry1; | |||
} | |||
private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |||
{ | |||
(d as ConveyorBelt)?.Refursh(); | |||
} | |||
private void Refursh() | |||
{ | |||
if (Direction == 1) VisualStateManager.GoToState(this, "Left", false); | |||
else if (Direction == 2) VisualStateManager.GoToState(this, "Right", false); | |||
else VisualStateManager.GoToState(this, "Stop", false); | |||
} | |||
public DoubleCollection StrokeDashArray | |||
{ | |||
get { return (DoubleCollection)GetValue(StrokeDashArrayProperty); } | |||
set { SetValue(StrokeDashArrayProperty, value); } | |||
} | |||
public static readonly DependencyProperty StrokeDashArrayProperty = | |||
DependencyProperty.Register("StrokeDashArray", typeof(DoubleCollection), typeof(ConveyorBelt), | |||
new PropertyMetadata(default, new PropertyChangedCallback(OnPropertyChanged))); | |||
public double ConveyorBeltWidth | |||
{ | |||
get { return (double)GetValue(ConveyorBeltWidthProperty); } | |||
set { SetValue(ConveyorBeltWidthProperty, value); } | |||
} | |||
public static readonly DependencyProperty ConveyorBeltWidthProperty = | |||
DependencyProperty.Register("ConveyorBeltWidth", typeof(double), typeof(ConveyorBelt), | |||
new PropertyMetadata(50.0, new PropertyChangedCallback(OnPropertyChanged))); | |||
public Brush StrokeFillBrush | |||
{ | |||
get { return (Brush)GetValue(StrokeFillBrushProperty); } | |||
set { SetValue(StrokeFillBrushProperty, value); } | |||
} | |||
public static readonly DependencyProperty StrokeFillBrushProperty = | |||
DependencyProperty.Register("StrokeFillBrush", typeof(Brush), typeof(ConveyorBelt), | |||
new PropertyMetadata(Brushes.LightBlue, new PropertyChangedCallback(OnPropertyChanged))); | |||
public Brush StrokeBrush | |||
{ | |||
get { return (Brush)GetValue(StrokeBrushProperty); } | |||
set { SetValue(StrokeBrushProperty, value); } | |||
} | |||
public static readonly DependencyProperty StrokeBrushProperty = | |||
DependencyProperty.Register("StrokeBrush", typeof(Brush), typeof(ConveyorBelt), | |||
new PropertyMetadata(Brushes.LightBlue, new PropertyChangedCallback(OnPropertyChanged))); | |||
public double StrokeThickness | |||
{ | |||
get { return (double)GetValue(StrokeThicknessProperty); } | |||
set { SetValue(StrokeThicknessProperty, value); } | |||
} | |||
public static readonly DependencyProperty StrokeThicknessProperty = | |||
DependencyProperty.Register("StrokeThickness", typeof(double), typeof(ConveyorBelt), | |||
new PropertyMetadata(1.0, new PropertyChangedCallback(OnPropertyChanged))); | |||
public int Direction | |||
{ | |||
get { return (int)GetValue(DirectionProperty); } | |||
set { SetValue(DirectionProperty, value); } | |||
} | |||
public static readonly DependencyProperty DirectionProperty = | |||
DependencyProperty.Register("Direction", typeof(int), typeof(ConveyorBelt), | |||
new PropertyMetadata(0, new PropertyChangedCallback(OnPropertyChanged))); | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
<UserControl | |||
x:Class="BPASmartClient.CustomResource.UserControls.MotorBottle" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
d:DesignHeight="500" | |||
d:DesignWidth="700" | |||
mc:Ignorable="d"> | |||
<Grid> | |||
<Viewbox> | |||
<Canvas Width="700" Height="500"> | |||
<local:Bottle | |||
Canvas.Left="608" | |||
Canvas.Top="-11" | |||
Width="84" | |||
Height="298" /> | |||
<local:DosingSystem | |||
Height="336" | |||
Margin="-75,202,-75,0" | |||
VerticalAlignment="Top" /> | |||
</Canvas> | |||
</Viewbox> | |||
</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.CustomResource.UserControls | |||
{ | |||
/// <summary> | |||
/// MotorBottle.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class MotorBottle : UserControl | |||
{ | |||
public MotorBottle() | |||
{ | |||
InitializeComponent(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,63 @@ | |||
<UserControl | |||
x:Class="BPASmartClient.CustomResource.UserControls.Pipeline" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
d:DesignHeight="30" | |||
d:DesignWidth="800" | |||
mc:Ignorable="d"> | |||
<Grid> | |||
<Border CornerRadius="{Binding CapRadius, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"> | |||
<Border.Background> | |||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> | |||
<GradientStop Offset="0.8" Color="#FFCBCBCB" /> | |||
<GradientStop Offset="0.5" Color="White" /> | |||
<GradientStop Offset="0.1" Color="#FFCBCBCB" /> | |||
</LinearGradientBrush> | |||
</Border.Background> | |||
<Border Name="border" Margin="3"> | |||
<Line | |||
Name="liquidLine" | |||
VerticalAlignment="Center" | |||
Opacity="0.3" | |||
Stretch="Fill" | |||
Stroke="{Binding LiquidColor, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" | |||
StrokeDashArray="2,3" | |||
StrokeDashCap="Round" | |||
StrokeEndLineCap="Round" | |||
StrokeStartLineCap="Round" | |||
StrokeThickness="{Binding ElementName=border, Path=ActualHeight}" | |||
X1="0" | |||
X2="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}" | |||
Y1="0" | |||
Y2="0" /> | |||
</Border> | |||
</Border> | |||
<VisualStateManager.VisualStateGroups> | |||
<VisualStateGroup> | |||
<VisualState Name="WEFlowState"> | |||
<Storyboard RepeatBehavior="Forever"> | |||
<DoubleAnimation | |||
Storyboard.TargetName="liquidLine" | |||
Storyboard.TargetProperty="StrokeDashOffset" | |||
From="0" | |||
To="5" | |||
Duration="0:0:1" /> | |||
</Storyboard> | |||
</VisualState> | |||
<VisualState Name="EWFlowState"> | |||
<Storyboard RepeatBehavior="Forever"> | |||
<DoubleAnimation | |||
Storyboard.TargetName="liquidLine" | |||
Storyboard.TargetProperty="StrokeDashOffset" | |||
From="0" | |||
To="-5" | |||
Duration="0:0:1" /> | |||
</Storyboard> | |||
</VisualState> | |||
</VisualStateGroup> | |||
</VisualStateManager.VisualStateGroups> | |||
</Grid> | |||
</UserControl> |
@@ -0,0 +1,59 @@ | |||
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.CustomResource.UserControls | |||
{ | |||
/// <summary> | |||
/// Pipeline.xaml 的交互逻辑 | |||
/// </summary> | |||
public partial class Pipeline : UserControl | |||
{ | |||
public Pipeline() | |||
{ | |||
InitializeComponent(); | |||
} | |||
private int _direction = 1; | |||
/// <summary> | |||
/// 液体流向,接受1和2两个值 | |||
/// </summary> | |||
public int Direction | |||
{ | |||
get { return _direction; } | |||
set | |||
{ | |||
_direction = value; | |||
VisualStateManager.GoToState(this, value == 1 ? "WEFlowState" : "EWFlowState", false); | |||
} | |||
} | |||
public Brush LiquidColor | |||
{ | |||
get { return (Brush)GetValue(LiquidColorProperty); } | |||
set { SetValue(LiquidColorProperty, value); } | |||
} | |||
public static readonly DependencyProperty LiquidColorProperty = | |||
DependencyProperty.Register("LiquidColor", typeof(Brush), typeof(Pipeline), new PropertyMetadata(Brushes.Orange)); | |||
public int CapRadius | |||
{ | |||
get { return (int)GetValue(CapRadiusProperty); } | |||
set { SetValue(CapRadiusProperty, value); } | |||
} | |||
public static readonly DependencyProperty CapRadiusProperty = | |||
DependencyProperty.Register("CapRadius", typeof(int), typeof(Pipeline), new PropertyMetadata(5)); | |||
} | |||
} |
@@ -27,12 +27,13 @@ namespace BPASmartClient.DosingSystem | |||
DataInit(); | |||
MainView mv = new MainView(); | |||
LoginView lv = new LoginView(); | |||
var res = lv.ShowDialog(); | |||
if (res != null && res == true) | |||
mv.Show(); | |||
else | |||
mv.Close(); | |||
mv.Show(); | |||
//LoginView lv = new LoginView(); | |||
//var res = lv.ShowDialog(); | |||
//if (res != null && res == true) | |||
// mv.Show(); | |||
//else | |||
// mv.Close(); | |||
} | |||
@@ -8,8 +8,8 @@ | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel" | |||
d:DesignHeight="450" | |||
d:DesignWidth="800" | |||
d:DesignHeight="1080" | |||
d:DesignWidth="1920" | |||
mc:Ignorable="d"> | |||
<UserControl.DataContext> | |||
@@ -17,6 +17,218 @@ | |||
</UserControl.DataContext> | |||
<Grid> | |||
<pry:DosingSystem/> | |||
<UniformGrid Columns="10"> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="90" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
</UniformGrid> | |||
<Grid x:Name="gr" Grid.Row="1"> | |||
<pry:ConveyorBelt | |||
Grid.Row="1" | |||
Width="{Binding ElementName=gr, Path=ActualWidth}" | |||
Height="{Binding ElementName=gr,Path=ActualHeight}" | |||
Margin="0 0 400 0" | |||
ConveyorBeltWidth="70" | |||
Direction="1" | |||
StrokeBrush="Red" | |||
StrokeDashArray="1.5 1.5" | |||
StrokeFillBrush="Red" | |||
StrokeThickness="2" /> | |||
</Grid> | |||
<UniformGrid Grid.Row="2" Columns="10"> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="270" /> | |||
<ScaleTransform ScaleX="-1" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="270" /> | |||
<ScaleTransform ScaleX="-1" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="270" /> | |||
<ScaleTransform ScaleX="-1" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="270" /> | |||
<ScaleTransform ScaleX="-1" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="270" /> | |||
<ScaleTransform ScaleX="-1" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="270" /> | |||
<ScaleTransform ScaleX="-1" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="270" /> | |||
<ScaleTransform ScaleX="-1" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
<pry:MotorBottle | |||
Width="150" | |||
Height="100" | |||
RenderTransformOrigin="0.5,0.5"> | |||
<pry:MotorBottle.RenderTransform> | |||
<TransformGroup> | |||
<RotateTransform Angle="270" /> | |||
<ScaleTransform ScaleX="-1" /> | |||
</TransformGroup> | |||
</pry:MotorBottle.RenderTransform> | |||
</pry:MotorBottle> | |||
</UniformGrid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="0.5*"/> | |||
<RowDefinition /> | |||
<RowDefinition Height="0.5*"/> | |||
</Grid.RowDefinitions> | |||
</Grid> | |||
</UserControl> |
@@ -44,13 +44,13 @@ | |||
</Style> | |||
</UserControl.Resources> | |||
<Grid> | |||
<Grid Margin="20"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl ItemsSource="{Binding Recipes}"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Height="150" VerticalAlignment="Top"> | |||
<Grid Margin="0 0 0 50" Height="150" VerticalAlignment="Top"> | |||
<Border | |||
Name="ShadowElement" | |||
Height="150" | |||
@@ -68,9 +68,9 @@ | |||
</Border> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="auto" /> | |||
<ColumnDefinition Width="200" /> | |||
<ColumnDefinition /> | |||
<ColumnDefinition Width="auto" /> | |||
<ColumnDefinition Width="100" /> | |||
</Grid.ColumnDefinitions> | |||
<Grid Margin="20,0,0,0"> | |||
@@ -86,6 +86,7 @@ | |||
Grid.Row="1" | |||
Width="80" | |||
Height="30" | |||
Background="#00BEFA" | |||
HorizontalAlignment="Left" | |||
Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}" | |||
CommandParameter="{Binding RecipeName}" | |||
@@ -22,7 +22,7 @@ | |||
<Style x:Key="TextBlockStyle" TargetType="TextBlock"> | |||
<Setter Property="FontFamily" Value="楷体" /> | |||
<Setter Property="FontSize" Value="16" /> | |||
<Setter Property="FontSize" Value="20" /> | |||
<Setter Property="Background" Value="Transparent" /> | |||
<!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />--> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
@@ -108,6 +108,22 @@ namespace BPASmartClient.DosingSystem.ViewModel | |||
static NewRecipeViewModel() | |||
{ | |||
RawMaterialNames.Clear(); | |||
RawMaterialNames.Add("乳化剂"); | |||
RawMaterialNames.Add("酶制剂"); | |||
RawMaterialNames.Add("增味剂"); | |||
RawMaterialNames.Add("营养强化剂"); | |||
RawMaterialNames.Add("抗结剂"); | |||
RawMaterialNames.Add("消泡剂"); | |||
RawMaterialNames.Add("膨松剂"); | |||
RawMaterialNames.Add("防腐剂"); | |||
RawMaterialNames.Add("着色剂"); | |||
RawMaterialNames.Add("甜味剂"); | |||
RawMaterialNames.Add("酸味剂"); | |||
RawMaterialNames.Add("增白剂"); | |||
RawMaterialNames.Add("香料"); | |||
RawMaterialNames.Add("抗氧化剂"); | |||
RawMaterialNames.Add("使用香料"); | |||
RawMaterialNames.Add("增稠剂"); | |||
} | |||
private string RecipCode = string.Empty; | |||