PufStationPositionControl.xaml 6.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <UserControl
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="CyberX8_Themes.UserControls"
  7. xmlns:converters="clr-namespace:CyberX8_Themes.Converters"
  8. xmlns:customControls="clr-namespace:CyberX8_Themes.CustomControls"
  9. xmlns:Control="clr-namespace:MECF.Framework.UI.Core.Control;assembly=MECF.Framework.UI.Core"
  10. x:Class="CyberX8_Themes.UserControls.PufStationPositionControl"
  11. mc:Ignorable="d" x:Name="self"
  12. d:DesignHeight="210" d:DesignWidth="400" IsVisibleChanged="IsControlVisibleChanged">
  13. <UserControl.Resources>
  14. <converters:BoolToColor x:Key="boolToColor"/>
  15. </UserControl.Resources>
  16. <Grid>
  17. <GroupBox Header="{Binding ModuleTitle, ElementName=self}" Background="{DynamicResource Table_BD_Title}" BorderBrush="DarkGray">
  18. <Grid>
  19. <Grid.RowDefinitions>
  20. <RowDefinition Height="40"/>
  21. <RowDefinition Height="40"/>
  22. <RowDefinition Height="40"/>
  23. <RowDefinition Height="40"/>
  24. <RowDefinition Height="40"/>
  25. <RowDefinition/>
  26. </Grid.RowDefinitions>
  27. <Grid.ColumnDefinitions>
  28. <ColumnDefinition Width="150"/>
  29. <ColumnDefinition Width="115"/>
  30. <ColumnDefinition Width="120"/>
  31. </Grid.ColumnDefinitions>
  32. <ComboBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="7,2" ItemsSource="{Binding ElementName=self,Path=ModuleItemSource}" SelectedItem="{Binding ElementName=self,Path=ModuleSelectedItem,Mode=TwoWay}"/>
  33. <WrapPanel Grid.Row="0" Grid.Column="2" >
  34. <Label Height="40" Content="At Station" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  35. <Ellipse Margin="5,0" Width="16" Height="16" Fill="{Binding IsAtStation, Converter={StaticResource boolToColor}, ElementName=self}" Stroke="Silver"/>
  36. </WrapPanel>
  37. <Label Grid.Row="1" Grid.Column="0" Content="Saved Position" VerticalAlignment="Center" Margin="5" FontSize="16" FontWeight="Bold"/>
  38. <WrapPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="0,0,5,0">
  39. <TextBlock Width="60" Text="{Binding SavedPosition, ElementName=self, StringFormat=\{0:F2\},Mode=TwoWay}" Background="Black" Foreground="Lime" FontSize="16" FontWeight="Bold"/>
  40. <TextBlock Margin="2,0" Width="45" Text="deg" Background="Black" Foreground="Lime" FontSize="16" FontWeight="Bold"/>
  41. </WrapPanel>
  42. <Button Style="{StaticResource SysBtnStyle}" Content="Goto Saved Pos" Grid.Column="3" Grid.Row="1" Height="30" Width="100" Click="GotoSavedPos_Click"/>
  43. <Label Grid.Row="2" Grid.Column="0" Content="Current Position" VerticalAlignment="Center" Margin="5" FontSize="16" FontWeight="Bold"/>
  44. <WrapPanel Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="0,0,5,0">
  45. <TextBlock Width="60" Text="{Binding CurrentPosition, ElementName=self, StringFormat=\{0:F2\},Mode=TwoWay}" Background="Black" Foreground="Lime" FontSize="16" FontWeight="Bold"/>
  46. <TextBlock Margin="2,0" Width="45" Text="deg" Background="Black" Foreground="Lime" FontSize="16" FontWeight="Bold"/>
  47. </WrapPanel>
  48. <Button Style="{StaticResource SysBtnStyle}" Content="Save Motor Pos" Grid.Column="3" Grid.Row="2" Width="100" Height="30" Click="MotorPos_Click"/>
  49. <customControls:PathButton Grid.Row="3" Grid.Column="0" PathData="{StaticResource Ico_LeftDbArrow}" DefaultFillBrush="White" Click="LeftCommand_Click" Width="40" Height="30" Margin="100,5,10,5" />
  50. <WrapPanel Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" Margin="0,0,5,0">
  51. <Control:NumbericUpDown Height="30" Width="60" Value="{Binding ElementName=self,Path=DegValue,Mode=TwoWay}" IncrementValue="{Binding ElementName=self,Path=IncrementValue}"/>
  52. <TextBlock Margin="2,0" Width="45" Height="22" Text="deg" Background="Black" Foreground="Lime" FontSize="16" FontWeight="Bold"/>
  53. </WrapPanel>
  54. <customControls:PathButton Grid.Row="3" Grid.Column="2" PathData="{StaticResource Ico_RightDbArrow}" DefaultFillBrush="White" Click="RightCommand_Click" Width="40" Height="30" Margin="10,5,70,5" />
  55. <WrapPanel Grid.Row="4" Grid.Column="1" VerticalAlignment="Center" Margin="0,0,5,0"/>
  56. <WrapPanel Grid.Row="4" Grid.Column="0" >
  57. <Label Height="40" Content="Motor On" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  58. <Ellipse Margin="5,0" Width="16" Height="16" Fill="{Binding ElementName=self,Path=IsMotorOn, Converter={StaticResource boolToColor}}" Stroke="Silver"/>
  59. </WrapPanel>
  60. <WrapPanel Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" >
  61. <Label Height="40" Content="Station" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  62. <Label Height="40" Content="{Binding ElementName=self,Path=CurrentStation}" Foreground="DarkBlue" FontWeight="Bold" VerticalContentAlignment="Center" HorizontalContentAlignment="Left"
  63. VerticalAlignment="Center" HorizontalAlignment="Center" Width="160"/>
  64. </WrapPanel>
  65. </Grid>
  66. </GroupBox>
  67. </Grid>
  68. </UserControl>