123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- <UserControl
- x:Class="ShakerManger.View.ShakerInfoView"
- 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:data="clr-namespace:Shaker.Model;assembly=Shaker"
- xmlns:gif="https://github.com/XamlAnimatedGif/XamlAnimatedGif"
- xmlns:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerManger.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:oxy="http://oxyplot.org/wpf"
- xmlns:oxyplot="http://oxyplot.org/skiawpf"
- xmlns:system="clr-namespace:System;assembly=mscorlib"
- xmlns:vm="clr-namespace:ShakerManger.ViewModel"
- d:DataContext="{d:DesignInstance {x:Type vm:ShakerControlViewModel}}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
- <UserControl.Resources>
- <vm:BindingProxy x:Key="GridVisibility" Data="{x:Static system:Boolean.FalseString}" />
- </UserControl.Resources>
- <Viewbox Margin="4" Stretch="Fill">
- <Grid
- Grid.Row="0"
- Width="960"
- Height="460">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="0.45*" />
- <ColumnDefinition Width="0.35*" />
- </Grid.ColumnDefinitions>
- <Image
- MaxWidth="260"
- gif:AnimationBehavior.AutoStart="{Binding AutoStart}"
- gif:AnimationBehavior.RepeatBehavior="{Binding RepeatBehavior}"
- gif:AnimationBehavior.SourceUri="{Binding GifPath}">
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Loaded">
- <hc:SetPropertyAction
- PropertyName="Image"
- PropertyValue="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Image}}"
- TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Image}, Path=DataContext}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Image>
- <GroupBox
- Grid.Row="0"
- Grid.Column="1"
- hc:TitleElement.Background="{StaticResource EmbellishBrush}"
- hc:TitleElement.Foreground="{StaticResource MainBrush}"
- hc:TitleElement.MinHeight="40"
- Background="Transparent"
- BorderBrush="Gray"
- BorderThickness="1"
- FontSize="26"
- FontWeight="Bold"
- Foreground="{StaticResource MainBrush}"
- Header="输出"
- Style="{StaticResource GroupBoxTab}">
- <Grid TextBlock.Foreground="{StaticResource EmbellishBrush}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Line
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Stroke="Gray"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=ActualHeight}" />
- <Line
- Grid.Row="1"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Stroke="Gray"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=ActualHeight}" />
- <Line
- Grid.Row="0"
- Grid.ColumnSpan="2"
- VerticalAlignment="Bottom"
- Stroke="Gray"
- StrokeThickness="1"
- X1="0"
- X2="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=ActualWidth}"
- Y1="0"
- Y2="0" />
- <StackPanel
- Grid.Column="0"
- VerticalAlignment="Center"
- Orientation="Vertical">
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Viewbox
- Width="24"
- Height="24"
- Stretch="Fill">
- <Path
- Data="{StaticResource CurrentGeometry}"
- Fill="{StaticResource EmbellishBrush}"
- Stretch="Fill" />
- </Viewbox>
- <TextBlock
- Margin="4,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- FontWeight="Normal">
- <Run Text="{Binding AnalogNames[1]}" />
- <Run Text="{Binding Units[1], StringFormat=({0})}" />
- </TextBlock>
- </StackPanel>
- <TextBlock
- Margin="4,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="50"
- Foreground="Green"
- Text="{Binding CurrentData.OutputCurrent, StringFormat={}{0:0000}}" />
- </StackPanel>
- <StackPanel
- Grid.Column="1"
- VerticalAlignment="Center"
- Orientation="Vertical">
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Viewbox
- Width="24"
- Height="24"
- Stretch="Fill">
- <Path
- Data="{StaticResource VoltageGeometry}"
- Fill="{StaticResource EmbellishBrush}"
- Stretch="Fill" />
- </Viewbox>
- <TextBlock
- Margin="4,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- FontWeight="Normal">
- <Run Text="{Binding AnalogNames[2]}" />
- <Run Text="{Binding Units[2], StringFormat=({0})}" />
- </TextBlock>
- </StackPanel>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="50"
- Foreground="Green"
- Text="{Binding CurrentData.OutputVoltage, StringFormat={}{0:0000}}" />
- </StackPanel>
- <StackPanel
- Grid.Row="1"
- Grid.Column="0"
- VerticalAlignment="Center"
- Orientation="Vertical">
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Viewbox
- Width="24"
- Height="24"
- Stretch="Fill">
- <Path
- Data="{StaticResource CurrentGeometry}"
- Fill="{StaticResource EmbellishBrush}"
- Stretch="Fill" />
- </Viewbox>
- <TextBlock
- Margin="4,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- FontWeight="Normal">
- <Run Text="{Binding AnalogNames[3]}" />
- <Run Text="{Binding Units[3], StringFormat=({0})}" />
- </TextBlock>
- </StackPanel>
- <TextBlock
- Margin="4,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="50"
- Foreground="Green"
- Text="{Binding CurrentData.ExcitationCurrent, StringFormat={}{0:0000}}" />
- </StackPanel>
- <StackPanel
- Grid.Row="1"
- Grid.Column="1"
- VerticalAlignment="Center"
- Orientation="Vertical">
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Viewbox
- Width="24"
- Height="24"
- Stretch="Fill">
- <Path
- Data="{StaticResource VoltageGeometry}"
- Fill="{StaticResource EmbellishBrush}"
- Stretch="Fill" />
- </Viewbox>
- <TextBlock
- Margin="4,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- FontWeight="Normal">
- <Run Text="{Binding AnalogNames[5]}" />
- <Run Text="{Binding Units[5], StringFormat=({0})}" />
- </TextBlock>
- </StackPanel>
- <TextBlock
- Margin="4,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- FontSize="50"
- Foreground="Green"
- Text="{Binding CurrentData.ExcitationCurrent, StringFormat={}{0:0000}}" />
- </StackPanel>
- </Grid>
- </GroupBox>
- <GroupBox
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.Column="2"
- Margin="4,0,0,0"
- hc:TitleElement.Background="{StaticResource EmbellishBrush}"
- hc:TitleElement.Foreground="{StaticResource LableBrush}"
- hc:TitleElement.MinHeight="40"
- Background="Transparent"
- BorderBrush="Gray"
- BorderThickness="1"
- FontSize="26"
- FontWeight="Black"
- Foreground="{StaticResource MainBrush}"
- Style="{StaticResource GroupBoxTab}">
- <GroupBox.Header>
- <Grid Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=GroupBox}, Path=ActualWidth}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="50" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.Column="0"
- Grid.ColumnSpan="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="功放控制" />
- </Grid>
- </GroupBox.Header>
- <Grid Margin="4,0,0,0" TextBlock.FontWeight="Normal">
- <Grid.RowDefinitions>
- <RowDefinition Height="0.3*" />
- <RowDefinition Height="0.3*" />
- <RowDefinition Height="0.4*" />
- </Grid.RowDefinitions>
- <StackPanel
- Grid.Row="0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal"
- TextBlock.FontSize="16">
- <Button
- Width="120"
- Height="48"
- hc:IconElement.Geometry="{StaticResource StartGeometry}"
- hc:IconElement.Height="20"
- hc:IconElement.Width="20"
- Content="打开增益">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource HasIconButton}">
- <Style.Setters>
- <Setter Property="IsEnabled">
- <Setter.Value>
- <MultiBinding
- Converter="{StaticResource MultiBoolConverter}"
- Mode="OneWay">
- <Binding Path="GainSwitchEnabled" />
- <Binding Converter="{StaticResource Boolean2BooleanReConverter}" Path="GainSwitch" />
- </MultiBinding>
- </Setter.Value>
- </Setter>
- </Style.Setters>
- </Style>
- </Button.Style>
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Click">
- <hc:ExInvokeCommandAction Command="{Binding GainSwitchCommand}" CommandParameter="{x:Static system:Boolean.TrueString}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Button>
- <Button
- Width="120"
- Height="48"
- Margin="20,0,0,0"
- hc:IconElement.Geometry="{StaticResource StopGeometry}"
- hc:IconElement.Height="20"
- hc:IconElement.Width="20"
- Content="关闭增益">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource HasIconButton}">
- <Style.Setters>
- <Setter Property="IsEnabled">
- <Setter.Value>
- <MultiBinding
- Converter="{StaticResource MultiBoolConverter}"
- Mode="OneWay">
- <Binding Path="GainSwitchEnabled" />
- <Binding Path="GainSwitch" />
- </MultiBinding>
- </Setter.Value>
- </Setter>
- </Style.Setters>
- </Style>
- </Button.Style>
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Click">
- <hc:ExInvokeCommandAction Command="{Binding GainSwitchCommand}" CommandParameter="{x:Static system:Boolean.FalseString}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Button>
- </StackPanel>
- <hc:BulletCheckBox
- Width="120"
- Height="48"
- BorderBrush="{StaticResource AuxiliaryBrush}"
- CheckedText="开"
- IsChecked="{Binding GainSwitch}"
- IsEnabled="{Binding GainSwitchEnabled, Mode=OneWay}"
- Text="关"
- Visibility="Collapsed">
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Click">
- <hc:ExInvokeCommandAction Command="{Binding GainSwitchCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=hc:BulletCheckBox}, Path=IsChecked}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </hc:BulletCheckBox>
- <Slider
- Grid.Row="1"
- Width="240"
- Height="48"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- hc:BorderElement.CornerRadius="6,0,0,6"
- BorderBrush="Gray"
- BorderThickness="1"
- FontSize="{StaticResource TextFontSize}"
- Interval="1"
- IsEnabled="{Binding GainEnabled, Mode=OneWay}"
- IsMoveToPointEnabled="True"
- IsSnapToTickEnabled="True"
- Maximum="100"
- Minimum="0"
- Template="{DynamicResource SliderStyle}"
- TickFrequency="1"
- Value="{Binding Gain}">
- <Slider.Background>
- <LinearGradientBrush>
- <GradientStop Offset="1" Color="#00FA00" />
- <GradientStop Offset="0" Color="Green" />
- </LinearGradientBrush>
- </Slider.Background>
- </Slider>
- <UniformGrid
- Grid.Row="2"
- VerticalAlignment="Center"
- Columns="3">
- <Button
- Width="{StaticResource PowerAmplifierButtonSize}"
- Height="{StaticResource PowerAmplifierButtonSize}"
- Margin="0,10,0,0"
- Padding="0"
- hc:IconElement.Geometry="{StaticResource StartGeometry}"
- Command="{Binding StartCommand}"
- Cursor="Hand"
- IsEnabled="{Binding StartEnabled}"
- Tag="{StaticResource LightEmbellishBrush}"
- ToolTip="启动">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
- <Setter Property="Foreground" Value="{StaticResource EmbellishBrush}" />
- </Style>
- </Button.Style>
- </Button>
- <Button
- Width="{StaticResource PowerAmplifierButtonSize}"
- Height="{StaticResource PowerAmplifierButtonSize}"
- Margin="0,10,0,0"
- Padding="0"
- hc:IconElement.Geometry="{StaticResource StopGeometry}"
- Command="{Binding StopCommand}"
- Cursor="Hand"
- IsEnabled="{Binding StopEnabled}"
- Tag="{StaticResource LightEmbellishBrush}"
- ToolTip="停止">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
- <Setter Property="Foreground" Value="{StaticResource EmbellishBrush}" />
- </Style>
- </Button.Style>
- </Button>
- <Button
- Width="{StaticResource PowerAmplifierButtonSize}"
- Height="{StaticResource PowerAmplifierButtonSize}"
- Margin="0,10,0,0"
- Padding="0"
- hc:IconElement.Geometry="{StaticResource ResetGeometry}"
- Command="{Binding ResetCommand}"
- Cursor="Hand"
- IsEnabled="{Binding ResetEnabled}"
- Tag="{StaticResource LightEmbellishBrush}"
- ToolTip="报警复位">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
- <Setter Property="Foreground" Value="{StaticResource EmbellishBrush}" />
- </Style>
- </Button.Style>
- </Button>
- </UniformGrid>
- </Grid>
- </GroupBox>
- </Grid>
- </Viewbox>
- </UserControl>
|