Sfoglia il codice sorgente

图像及点位增加

reconfiguration
lyw 4 mesi fa
parent
commit
c96daf99b3
6 ha cambiato i file con 299 aggiunte e 16 eliminazioni
  1. +20
    -1
      BPASmartClient.Academy/Converter/DeviceCtrlConvert.cs
  2. +11
    -0
      BPASmartClient.Academy/Model/DeviceCtrl.cs
  3. +5
    -0
      BPASmartClient.Academy/Model/Simens_PLC.cs
  4. +149
    -15
      BPASmartClient.Academy/View/DeviceMotionView.xaml
  5. +86
    -0
      BPASmartClient.Academy/View/RetortTank.xaml
  6. +28
    -0
      BPASmartClient.Academy/View/RetortTank.xaml.cs

+ 20
- 1
BPASmartClient.Academy/Converter/DeviceCtrlConvert.cs Vedi File

@@ -72,7 +72,7 @@ namespace BPASmartClient.Academy.Converter
return MotorColor.Gray;
}
}
else
else if(parameter.ToString()=="4")
{
if (value is bool)
{
@@ -91,6 +91,25 @@ namespace BPASmartClient.Academy.Converter
return new SolidColorBrush(Color.FromRgb(255, 255, 255));
}
}
else
{
if (value is bool)
{
bool value_get = (bool)value;
if (value_get)
{
return -1;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)


+ 11
- 0
BPASmartClient.Academy/Model/DeviceCtrl.cs Vedi File

@@ -34,5 +34,16 @@ namespace BPASmartClient.Academy.Model
private bool _vx104 = false;
public bool VX105 { get { return _vx100; } set { _vx100 = value; OnPropertyChanged(); } }
private bool _vx105 = false;

public bool VX106 { get { return _vx106; } set { _vx106 = value; OnPropertyChanged(); } }
private bool _vx106 = false;
public bool VX107 { get { return _vx107; } set { _vx107 = value; OnPropertyChanged(); } }
private bool _vx107 = false;
public bool VX108 { get { return _vx108; } set { _vx108 = value; OnPropertyChanged(); } }
private bool _vx108 = false;
public bool VX109 { get { return _vx109; } set { _vx109 = value; OnPropertyChanged(); } }
private bool _vx109 = false;
public bool VX110 { get { return _vx110; } set { _vx110 = value; OnPropertyChanged(); } }
private bool _vx110 = false;
}
}

+ 5
- 0
BPASmartClient.Academy/Model/Simens_PLC.cs Vedi File

@@ -68,6 +68,11 @@ namespace BPASmartClient.Academy.Model
deviceCtrl.VX103 = siemens.Read<bool>("V2000.6").Content;
deviceCtrl.VX104 = siemens.Read<bool>("V2000.7").Content;
deviceCtrl.VX105 = siemens.Read<bool>("V2001.0").Content;
deviceCtrl.VX106 = siemens.Read<bool>("V2001.1").Content;
deviceCtrl.VX107 = siemens.Read<bool>("V2001.2").Content;
deviceCtrl.VX108 = siemens.Read<bool>("V2001.3").Content;
deviceCtrl.VX109 = siemens.Read<bool>("V2001.4").Content;
deviceCtrl.VX110 = siemens.Read<bool>("V2001.5").Content;
heart = siemens.Read<bool>("V1003.7").Content;
Thread.Sleep(100);
}


+ 149
- 15
BPASmartClient.Academy/View/DeviceMotionView.xaml Vedi File

@@ -7,7 +7,7 @@
xmlns:local="clr-namespace:BPASmartClient.Academy.View"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:oxy ="http://oxyplot.org/wpf"
xmlns:oxy="http://oxyplot.org/wpf"
xmlns:vm="clr-namespace:BPASmartClient.Academy.ViewModel"
d:DesignHeight="450"
d:DesignWidth="800"
@@ -384,6 +384,7 @@
Width="30"
Direction="{Binding DeviceStatus.VX101, Converter={StaticResource deviceConvert}, ConverterParameter=1}"
Fill="{Binding DeviceStatus.VX101, Converter={StaticResource deviceConvert}, ConverterParameter=2}"
LineWidth="13"
Speed="10" />
<bpa:PipeLineV
Canvas.Left="336"
@@ -471,7 +472,7 @@
Canvas.Left="200"
Canvas.Top="175"
Width="65"
Height="150">
Height="220">
<bpa:MotorTwo
Width="40"
Height="30"
@@ -491,11 +492,14 @@
Width="40"
Height="30"
Margin="0,0,0,-3" />
<bpa:JAR Width="65" Height="65" />
<local:RetortTank
Width="65"
Height="120"
Margin="0,4,0,0" />
<bpa:HandValve
Width="45"
Width="48"
Height="65"
Margin="0,-20,-12,0"
Margin="0,-24,-14,0"
RenderTransformOrigin="0.5,0.5">
<bpa:HandValve.RenderTransform>
<TransformGroup>
@@ -510,8 +514,126 @@



<bpa:PipeLineV Margin="418,58,362,194" Direction="0" />
<bpa:PipeLineH Width="65" Margin="333,276,402,154" />
<bpa:PipeLineH
Width="95"
Height="12"
Margin="265,278,402,154"
Direction="1"
LineWidth="2" />
<bpa:PipeLineTL
Width="24"
Height="24"
Margin="360,266,402,154"
Direction="-1"
LineWidth="7"
Speed="10" />
<bpa:PipeLineV
Width="12"
Height="40"
Margin="372,226,402,154"
Direction="1"
LineWidth="2" />
<bpa:HandValve
x:Name="VX107"
Width="35"
Height="35"
Margin="365,232,402,154"
RenderTransformOrigin="0.5,0.5">
<bpa:HandValve.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="0.926" ScaleY="1.08" />
<SkewTransform />
<RotateTransform Angle="90" />
<TranslateTransform />
</TransformGroup>
</bpa:HandValve.RenderTransform>
</bpa:HandValve>
<bpa:PipeLineV
Width="12"
Height="40"
Margin="345,290,402,154"
Direction="1"
LineWidth="2" />
<bpa:HandValve
x:Name="VX110"
Width="35"
Height="35"
Margin="338,296,402,154"
RenderTransformOrigin="0.5,0.5">
<bpa:HandValve.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="0.926" ScaleY="1.08" />
<SkewTransform />
<RotateTransform Angle="90" />
<TranslateTransform />
</TransformGroup>
</bpa:HandValve.RenderTransform>
</bpa:HandValve>


<bpa:PipeLineH
Width="95"
Height="12"
Margin="105,278,402,154"
LineWidth="2" />
<bpa:PipeLineTR
Width="24"
Height="24"
Margin="81,266,402,154"
LineWidth="7"
Speed="10" />
<bpa:PipeLineV
Width="12"
Height="30"
Margin="81,236,402,154"
LineWidth="2" />
<bpa:HandValve
x:Name="VX108"
Width="35"
Height="35"
Margin="65,236,402,154"
RenderTransformOrigin="0.5,0.5">
<bpa:HandValve.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="0.926" ScaleY="1.08" />
<SkewTransform />
<RotateTransform Angle="270" />
<TranslateTransform />
</TransformGroup>
</bpa:HandValve.RenderTransform>
</bpa:HandValve>
<bpa:PipeLineV
Width="12"
Height="40"
Margin="105,290,402,154"
LineWidth="2" />
<bpa:HandValve
x:Name="VX109"
Width="35"
Height="35"
Margin="89,290,402,154"
RenderTransformOrigin="0.5,0.5">
<bpa:HandValve.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="0.926" ScaleY="1.08" />
<SkewTransform />
<RotateTransform Angle="270" />
<TranslateTransform />
</TransformGroup>
</bpa:HandValve.RenderTransform>
</bpa:HandValve>

<bpa:PipeLineH
Width="65"
Height="8"
Margin="607,68,402,154"
LineWidth="2" />
<bpa:HandValve
x:Name="VX106"
Width="30"
Height="20"
Margin="617,58,402,154"
RenderTransformOrigin="0.5,0.5" />


<bpa:PipeLineH Width="65" Margin="458,19,277,411" />
@@ -533,7 +655,7 @@
</Canvas>
</Viewbox>
</Grid>
<Grid Margin="10,2,10,10">
<Grid Margin="7,2,12,10">
<Grid.Background>
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/背景边框4.png" />
</Grid.Background>
@@ -586,6 +708,9 @@
FontSize="20"
Foreground="White"
Text="开关控制:" />
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" >
</ScrollViewer>
<WrapPanel HorizontalAlignment="Stretch" Orientation="Horizontal">
<StackPanel
Margin="5,2"
@@ -923,7 +1048,6 @@
<UniformGrid Grid.Row="1" Columns="5">
<StackPanel Orientation="Vertical">
<lvc:CartesianChart
Height="270"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
@@ -1232,19 +1356,29 @@
</Grid>

<Grid
Visibility="Collapsed"
x:Name="chartGrid"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="White">
Background="White"
Visibility="Collapsed">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<oxy:PlotView x:Name="chartView" PanCursor="Hand" Foreground="Black" Margin="5" Background="Transparent" >
</oxy:PlotView>
<Button Click="Button_Click" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Content="退出" Height=" 40" Width="120"/>
<oxy:PlotView
x:Name="chartView"
Margin="5"
Background="Transparent"
Foreground="Black"
PanCursor="Hand" />
<Button
Grid.Column="1"
Width="120"
Height=" 40"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Click="Button_Click"
Content="退出" />
</Grid>
</Grid>
</UserControl>

+ 86
- 0
BPASmartClient.Academy/View/RetortTank.xaml Vedi File

@@ -0,0 +1,86 @@
<UserControl
x:Class="BPASmartClient.Academy.View.RetortTank"
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.Academy.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Viewbox Stretch="Uniform">
<Grid Background="Transparent">
<Path StrokeThickness="0.5">
<Path.Data>
<GeometryGroup>
<PathGeometry>
<PathFigure StartPoint="0,0">
<LineSegment Point="0,100" />
<LineSegment Point="100,100" />
<LineSegment Point="100,0" />
</PathFigure>
</PathGeometry>
<PathGeometry>
<PathFigure StartPoint="0,0">
<BezierSegment
Point1="0,0"
Point2="50,-30"
Point3="100,0" />
</PathFigure>
</PathGeometry>
<PathGeometry>
<PathFigure StartPoint="0,100">
<LineSegment Point="35,130" />
<LineSegment Point="65,130" />
<LineSegment Point="100,100" />
</PathFigure>
</PathGeometry>
<PathGeometry>
<PathFigure StartPoint="35,160">
<LineSegment Point="35,130"/>
<LineSegment Point="65,130"/>
<LineSegment Point="65,160"/>
</PathFigure>
</PathGeometry>
<PathGeometry>
<PathFigure StartPoint="35,160">
<BezierSegment Point1="35,160" Point2="50,180" Point3="65,160"/>
</PathFigure>
</PathGeometry>
</GeometryGroup>

</Path.Data>
<Path.Fill>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0" Color="#FF808285" />
<GradientStop Offset="0.5" Color="#FFF6F6F6" />
<GradientStop Offset="1" Color="#FF808285" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Path.Fill>
</Path>
<Path
Width="100"
Height="2.5"
VerticalAlignment="Top"
Data="F1M0.002,2.995L94.916,2.995 94.916,5.36200000000001 0.002,5.36200000000001z"
Fill="#FFD9D9D9"
Stretch="Fill" />
<Path
Width="100"
Height="2.5"
Margin="0,31,0,0"
Data="F1M0.002,2.995L94.916,2.995 94.916,5.36200000000001 0.002,5.36200000000001z"
Fill="#FFD9D9D9"
Stretch="Fill" />
<Path
Width="32"
Height="2.5"
Margin="0,90,0,0"
Data="F1M0.002,2.995L94.916,2.995 94.916,5.36200000000001 0.002,5.36200000000001z"
Fill="#FFD9D9D9"
Stretch="Fill" />
</Grid>
</Viewbox>
</UserControl>

+ 28
- 0
BPASmartClient.Academy/View/RetortTank.xaml.cs Vedi File

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

Caricamento…
Annulla
Salva