| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391 |
- <UserControl x:Class="OHV.Module.Interactivity.PopUp.DriveServoView"
- 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:OHV.Module.Interactivity.PopUp"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d"
- Width="1130"
- Height="700"
- Background="#455a64">
- <prism:Dialog.WindowStyle>
- <Style TargetType="Window">
- <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterScreen" />
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="AllowsTransparency" Value="True"/>
- <Setter Property="ResizeMode" Value="NoResize"/>
- <Setter Property="WindowStyle" Value="None"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="BorderBrush" Value="{DynamicResource BorderSolidNormal}"/>
- <Setter Property="Template" Value="{DynamicResource WindowTemplateKey}"/>
- <!--<Style.Triggers>
- <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
- <Setter Property="Template" Value="{StaticResource WindowTemplateKey}"/>
- </Trigger>
- </Style.Triggers>-->
- </Style>
- </prism:Dialog.WindowStyle>
- <UserControl.Resources>
- <Style x:Key="MaterialDesignDataGridRowHeader" TargetType="{x:Type DataGridRowHeader}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type DataGridRowHeader}">
- <Grid MinWidth="24">
- <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
- <StackPanel Orientation="Horizontal">
- <ContentPresenter RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
- <Control SnapsToDevicePixels="false" Template="{Binding ValidationErrorTemplate, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}" Visibility="{Binding (Validation.HasError), Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"/>
- </StackPanel>
- </Border>
- <Thumb x:Name="PART_TopHeaderGripper" Style="{StaticResource MaterialDesignGridRowHeaderGripper}" VerticalAlignment="Top"/>
- <Thumb x:Name="PART_BottomHeaderGripper" Style="{StaticResource MaterialDesignGridRowHeaderGripper}" VerticalAlignment="Bottom"/>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition Width="130"/>
- <ColumnDefinition Width="130"/>
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0" Margin="15"
- Background="#37474f">
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <!--Position Data Grid View-->
- <Grid Grid.Row="0">
- <DataGrid
- Margin="15"
- ItemsSource="{Binding POS}"
- CanUserSortColumns="True"
- CanUserAddRows="False"
- Background="{x:Null}"
- Width="auto"
- Height="auto"
- BorderBrush="#FF00FFD3"
- BorderThickness="1"
- SelectedItem="{Binding SelectedRow1}">
- <DataGrid.ColumnHeaderStyle>
- <Style TargetType="DataGridColumnHeader">
- <Setter Property="BorderBrush" Value="#FF00FFD3"/>
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="FontSize" Value="20"/>
- <Setter Property="HorizontalAlignment" Value="Center"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- </Style>
- </DataGrid.ColumnHeaderStyle>
- <DataGrid.CellStyle>
- <Style TargetType="DataGridCell">
- <Setter Property="TextBlock.TextAlignment" Value="Center"/>
- <Setter Property="TextBlock.FontStretch" Value="UltraExpanded"/>
- <Setter Property="TextBlock.VerticalAlignment" Value="Center"/>
- <Setter Property="BorderBrush" Value="Black"/>
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="FontSize" Value="15"/>
- <Setter Property="Width" Value="161"/>
- <Setter Property="Height" Value="50"/>
- </Style>
- </DataGrid.CellStyle>
- </DataGrid>
- </Grid>
- <!--Axis Grid View-->
- <Grid Grid.Row="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Border Margin="0,5,163,5" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.RowSpan="4" Grid.Column="2"/>
- <Border Margin="161,5,2,3" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.RowSpan="2" Grid.Column="2" Grid.Row="2"/>
- <Border Margin="161,0,10,78" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Column="2" Grid.ColumnSpan="3" Grid.Row="2"/>
- <Border Margin="33,-2,34,82" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Column="2" Grid.ColumnSpan="3" Grid.RowSpan="2"/>
- <Button Grid.Column="0" Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" Height="auto"
- Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="MaterialDesignRaisedButton with Round Corners">
- <StackPanel>
- <TextBlock HorizontalAlignment="Center"><Run Text="Target"/></TextBlock>
- <TextBlock HorizontalAlignment="Center"><Run Text="Pos"/></TextBlock>
- </StackPanel>
- </Button>
- <Button Grid.Column="0" Grid.Row="2" HorizontalAlignment="Stretch" Margin="5" Height="auto"
- Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="MaterialDesignRaisedButton with Round Corners">
- <StackPanel>
- <TextBlock HorizontalAlignment="Center"><Run Text="Current"/></TextBlock>
- <TextBlock HorizontalAlignment="Center"><Run Text="Pos"/></TextBlock>
- </StackPanel>
- </Button>
- <Button Grid.Column="0" Grid.Row="3" HorizontalAlignment="Stretch" Margin="5" Height="auto"
- Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="MaterialDesignRaisedButton with Round Corners">
- <StackPanel>
- <TextBlock HorizontalAlignment="Center"><Run Text="Difference"/></TextBlock>
- <TextBlock HorizontalAlignment="Center"><Run Text="Pos"/></TextBlock>
- </StackPanel>
- </Button>
- <Button Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" Margin="5" Height="auto"
- Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="MaterialDesignRaisedButton with Round Corners"
- Command="{Binding SelectAxisCommand}"
- CommandParameter="Left">
- <TextBlock><Run Text="Drive1"/></TextBlock>
- </Button>
- <Button Background="{x:Null}" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" Height="auto"
- Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="MaterialDesignRaisedButton with Round Corners">
- <Button.InputBindings>
- <MouseBinding Gesture="LeftClick" Command="{Binding KeyInTargetPosCommand}" CommandParameter="Left"/>
- </Button.InputBindings>
- <TextBlock><Run Text="{Binding TargetPosDrive, StringFormat=0.000, FallbackValue=0.000}"/></TextBlock>
- </Button>
- <Button Background="{x:Null}" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch" Margin="5" Height="auto"
- Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="MaterialDesignRaisedButton with Round Corners">
- <TextBlock><Run Text="{Binding CurrentDrive, StringFormat=0.000, FallbackValue=0.000}"/></TextBlock>
- </Button>
- <Button Background="{x:Null}" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Stretch" Margin="5" Height="auto"
- Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="MaterialDesignRaisedButton with Round Corners">
- <TextBlock><Run Text="{Binding DifferenceDrive, StringFormat=0.000, FallbackValue=0.000}"/></TextBlock>
- </Button>
- <!--Steering Dir Front-->
- <Button Grid.Column="3" Margin="10"
- Grid.Row="2"
- HorizontalAlignment="Stretch"
- Height="Auto"
- BorderBrush="Gray"
- BorderThickness="2"
- Command="{Binding SelectedDirection}"
- CommandParameter="Front">
- <StackPanel>
- <!--<materialDesign:PackIcon Kind="SubdirectoryArrowLeft" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
- <TextBlock Text="Steering" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- <TextBlock Text="Front" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <!--Steering Dir Back-->
- <Button Grid.Column="4" Margin="10"
- Grid.Row="2"
- HorizontalAlignment="Stretch"
- Height="Auto"
- BorderBrush="Gray"
- BorderThickness="2"
- Command="{Binding SelectedDirection}"
- CommandParameter="Back">
- <StackPanel>
- <!--<materialDesign:PackIcon Kind="SubdirectoryArrowLeft" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
- <TextBlock Text="Steering" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- <TextBlock Text="Back" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <Button Grid.Column="3" Margin="3"
- Grid.Row="3"
- HorizontalAlignment="Stretch"
- Height="Auto"
- BorderBrush="Gray"
- BorderThickness="2"
- Command="{Binding SteeringCWCommand}"
- CommandParameter="CW">
- <StackPanel>
- <materialDesign:PackIcon Kind="SubdirectoryArrowLeft" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
- <TextBlock Text="Steering CW" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <Button Grid.Column="4" Margin="3"
- Grid.Row="3"
- HorizontalAlignment="Stretch"
- Height="Auto"
- BorderBrush="Gray"
- BorderThickness="2"
- Command="{Binding SteeringCCWCommand}"
- CommandParameter="CCW">
- <StackPanel>
- <materialDesign:PackIcon Kind="SubdirectoryArrowRight" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
- <TextBlock Text="Steering CCW" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <!--Jog Button-->
- <RepeatButton
- Margin="5"
- Grid.Row="0"
- Grid.Column="2"
- HorizontalAlignment="Right"
- Width="120"
- Height="auto"
- Command="{Binding JogCommand}" CommandParameter="-">
- <StackPanel>
- <materialDesign:PackIcon Kind="ArrowLeftBoldCircleOutline" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="30" Width="auto"/>
- <TextBlock><Run Text="Jog(-)"/></TextBlock>
- </StackPanel>
- </RepeatButton>
- <Button
- Margin="5"
- Grid.Row="0"
- Grid.Column="3"
- HorizontalAlignment="Center"
- Height="auto"
- Command="{Binding JogVelPopupCommand}" CommandParameter="-">
- <StackPanel>
- <TextBlock HorizontalAlignment="Center"><Run Text="Jog Velocity"/></TextBlock>
- <TextBlock HorizontalAlignment="Center"><Run Text="{Binding JogVelocity, StringFormat={}{0:0.000}, FallbackValue=0.000}"/></TextBlock>
- </StackPanel>
- </Button>
- <RepeatButton
- Margin="5"
- Grid.Row="0"
- Grid.Column="4"
- HorizontalAlignment="Left"
- Width="120"
- Height="auto"
- Command="{Binding JogCommand}" CommandParameter="+">
- <StackPanel>
- <materialDesign:PackIcon Kind="ArrowRightBoldCircleOutline" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="30" Width="auto"/>
- <TextBlock><Run Text="Jog(+)"/></TextBlock>
- </StackPanel>
- </RepeatButton>
- </Grid>
- <!--Steering Control-->
- <Grid Grid.Row="2">
- </Grid>
- </Grid>
- <!--Sub Drive Menu-->
- <Grid Grid.Column="1" Background="#263238">
- <StackPanel>
- <Button Margin="7, 20" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2"
- Command="{Binding PositionAddCommand}">
- <StackPanel>
- <!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
- <TextBlock Text="Add" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <Button Margin="7, 20" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2"
- Command="{Binding PositionDeleteCommand}">
- <StackPanel>
- <!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
- <TextBlock Text="Delete" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <Button Margin="7, 20" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2"
- Command="{Binding PositionSaveCommand}">
- <StackPanel>
- <!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
- <TextBlock Text="Save" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <!--Move TO / Current To Target-->
- <Button Margin="7, 50" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2"
- Command="{Binding MoveToCommand}">
- <StackPanel>
- <!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
- <TextBlock Text="Move To" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <Button Margin="7,0" HorizontalAlignment="Stretch" Height="60" BorderBrush="Gray" BorderThickness="2"
- Command="{Binding CurrentToTargetCommand}">
- <StackPanel>
- <!--<materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>-->
- <TextBlock Text="Current To" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- <TextBlock Text="Target" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- </StackPanel>
- </Grid>
- <!--Right Drive Menu-->
- <Grid Grid.Column="2" Background="#263238">
- <Border Margin="1" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
- <StackPanel>
- <Button Margin="5" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" Command="{Binding ServoOnCommand}">
- <StackPanel>
- <materialDesign:PackIcon Kind="PowerSettings" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
- <TextBlock Text="Servo On" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <Button Margin="5" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" Command="{Binding ServoOffCommand}">
- <StackPanel>
- <materialDesign:PackIcon Kind="PowerPlugOff" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
- <TextBlock Text="Servo Off" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <Button Margin="5" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" Command="{Binding FaultResetCommand}">
- <StackPanel>
- <materialDesign:PackIcon Kind="CircleArrows" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
- <TextBlock Text="Fault Reset" VerticalAlignment="Stretch" HorizontalAlignment="Center"/>
- </StackPanel>
- </Button>
- <Button Margin="5" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" Command="{Binding OriginCommand}">
- <StackPanel>
- <materialDesign:PackIcon Kind="Origin" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
- <TextBlock Text="Origin" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
- </StackPanel>
- </Button>
- <Button Margin="5" HorizontalAlignment="Stretch" Height="Auto" BorderBrush="Gray" BorderThickness="2" Command="{Binding CloseDialogCommand}" CommandParameter="true">
- <StackPanel>
- <materialDesign:PackIcon Kind="ExitToApp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
- <TextBlock Text="Close" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
- </StackPanel>
- </Button>
- </StackPanel>
- </Grid>
- </Grid>
- </UserControl>
|