PowerSupplyChannelControl.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <UserControl x:Class="CyberX8_Themes.UserControls.PowerSupplyChannelControl"
  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="clr-namespace:CyberX8_Themes.UserControls"
  7. xmlns:control="clr-namespace:MECF.Framework.UI.Core.Control;assembly=MECF.Framework.UI.Core"
  8. xmlns:converters="clr-namespace:CyberX8_Themes.Converters"
  9. mc:Ignorable="d" x:Name="self"
  10. d:DesignHeight="300" d:DesignWidth="600">
  11. <UserControl.Resources>
  12. <converters:BoolToColor x:Key="boolToColor"/>
  13. <converters:BoolToBool x:Key="boolToBool"/>
  14. </UserControl.Resources>
  15. <Grid>
  16. <GroupBox Header="{Binding ElementName=self,Path= ModuleName}">
  17. <Grid>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="40"></RowDefinition>
  20. <RowDefinition Height="40"></RowDefinition>
  21. <RowDefinition Height="40"></RowDefinition>
  22. <RowDefinition Height="40"></RowDefinition>
  23. <RowDefinition Height="40"></RowDefinition>
  24. <RowDefinition Height="40"></RowDefinition>
  25. <RowDefinition Height="40"></RowDefinition>
  26. <RowDefinition/>
  27. </Grid.RowDefinitions>
  28. <Grid.ColumnDefinitions>
  29. <ColumnDefinition Width="260"></ColumnDefinition>
  30. <ColumnDefinition Width="300"></ColumnDefinition>
  31. <ColumnDefinition />
  32. </Grid.ColumnDefinitions>
  33. <Ellipse Grid.Row="0" Width="16" Height="16" Fill="{Binding ElementName=self,Path=Connected, Converter={StaticResource boolToColor}}"
  34. Stroke="Silver" HorizontalAlignment="Left" Margin="39,12,0,12"/>
  35. <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="{Binding ElementName=self,Path=MetalCellSideName}" Width="120" Height="30" FontSize="16" VerticalContentAlignment="Center"></Label>
  36. <Grid Grid.Row="1" Grid.Column="0" IsEnabled="{Binding ElementName=self,Path=Connected}">
  37. <Ellipse Width="16" Height="16" Fill="{Binding ElementName=self,Path=OutputEnabled, Converter={StaticResource boolToColor}}"
  38. Stroke="Silver" HorizontalAlignment="Left" Margin="39,12,0,12"/>
  39. <Button Style="{StaticResource SysBtnStyle}" Content="Enable" Click="Enable_Click" Width="60" Height="25"
  40. IsEnabled="{Binding ElementName=self,Path=OutputEnabled,Converter={StaticResource boolToBool}}" HorizontalAlignment="Left"
  41. Margin="74,8,0,8"></Button>
  42. <Button Style="{StaticResource SysBtnStyle}" Grid.Row="1" Content="Disable" Click="Disable_Click" Width="60" Height="25"
  43. IsEnabled="{Binding ElementName=self,Path=OutputEnabled}" HorizontalAlignment="Left" Margin="159,8,0,7"></Button>
  44. </Grid>
  45. <Label Grid.Row="2" Grid.Column="0" Content="Status" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="16,0,0,0"></Label>
  46. <TextBlock Grid.Row="2" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=PowerStatus}" Background="Black"
  47. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  48. <Label Grid.Row="2" Grid.Column="1" Content="Run Model" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="16,0,0,0"></Label>
  49. <TextBlock Grid.Row="2" Grid.Column="1" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=PowerRunModel}" Background="Black"
  50. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  51. <Grid Grid.Row="3" Grid.Column="0" IsEnabled="{Binding ElementName=self,Path=Connected}">
  52. <Label Grid.Row="3" Grid.Column="0" Content="Set Point" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="12,0,0,0"></Label>
  53. <control:NumbericTextBox Grid.Row="3" Width="70" Margin="0,8,30,7" Height="25" Value="{Binding ElementName=self,Path=InputSetPoint,StringFormat={}{0:F3},Mode=TwoWay}" HorizontalAlignment="Center"
  54. ></control:NumbericTextBox>
  55. <Button Style="{StaticResource SysBtnStyle}" Grid.Row="3" Content="Set" Click="SetPoint_Click" Width="40" Height="25" HorizontalAlignment="Left"
  56. Margin="160,8,0,7" IsEnabled="{Binding ElementName=self,Path=OutputEnabled,Converter={StaticResource boolToBool}}"></Button>
  57. </Grid>
  58. <Label Grid.Row="4" Grid.Column="0" Content="Set Point" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="12,0,0,0"></Label>
  59. <TextBlock Grid.Row="4" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=SetPoint,StringFormat=\{0:F3\},Mode=TwoWay}" Background="Black"
  60. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  61. <TextBlock Grid.Row="4" Margin="160,0,0,0" Width="40" Text="A" Background="Black" Foreground="Lime" FontWeight="Bold" VerticalAlignment="Center"
  62. FontSize="16" HorizontalAlignment="Left"/>
  63. <Label Grid.Row="5" Grid.Column="0" Content="Current" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="12,0,0,0"></Label>
  64. <TextBlock Grid.Row="5" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=Current,StringFormat=\{0:F3\},Mode=TwoWay}" Background="Black"
  65. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  66. <TextBlock Grid.Row="5" Margin="160,0,0,0" Width="40" Text="A" Background="Black" Foreground="Lime" FontWeight="Bold" VerticalAlignment="Center"
  67. FontSize="16" HorizontalAlignment="Left"/>
  68. <Label Grid.Row="6" Grid.Column="0" Content="Voltage" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="12,0,0,0"></Label>
  69. <TextBlock Grid.Row="6" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=Voltage,StringFormat=\{0:F3\},Mode=TwoWay}" Background="Black"
  70. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  71. <TextBlock Grid.Row="6" Margin="160,0,0,0" Width="40" Text="V" Background="Black" Foreground="Lime" FontWeight="Bold" VerticalAlignment="Center"
  72. FontSize="16" HorizontalAlignment="Left"/>
  73. <Grid Grid.Row="1" Grid.Column="1" IsEnabled="{Binding ElementName=self,Path=Connected}">
  74. <TextBlock Width="70" Text="{Binding PowerControl, ElementName=self}" Background="Black"
  75. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="14,0,0,0"/>
  76. <Button Style="{StaticResource SysBtnStyle}" Content="Local" Click="Local_Click" Width="60" Height="25"
  77. HorizontalAlignment="Left" Margin="184,8,0,7"></Button>
  78. <Button Style="{StaticResource SysBtnStyle}" Content="Remote" Click="Remote_Click" Width="60" Height="25"
  79. HorizontalAlignment="Left" Margin="101,8,0,7"></Button>
  80. </Grid>
  81. <GroupBox Grid.Row="3" Grid.Column="1" Grid.RowSpan="4" Header="Step" IsEnabled="{Binding ElementName=self,Path=Connected}">
  82. <Grid>
  83. <Grid.RowDefinitions>
  84. <RowDefinition Height="35"></RowDefinition>
  85. <RowDefinition Height="35"></RowDefinition>
  86. <RowDefinition Height="35"></RowDefinition>
  87. <RowDefinition Height="35"></RowDefinition>
  88. <RowDefinition/>
  89. </Grid.RowDefinitions>
  90. <local:PowerSupplierStepControl Grid.Row="0" Current="{Binding ElementName=self,Path=Step1Data.Current,Mode=TwoWay}"
  91. Hour="{Binding ElementName=self,Path=Step1Data.Hour,Mode=TwoWay}" Minute="{Binding ElementName=self,Path=Step1Data.Minute,Mode=TwoWay}"
  92. Second="{Binding ElementName=self,Path=Step1Data.Second,Mode=TwoWay}" MicroSecond="{Binding ElementName=self,Path=Step1Data.Microsecond,Mode=TwoWay}"></local:PowerSupplierStepControl>
  93. <local:PowerSupplierStepControl Grid.Row="1" Current="{Binding ElementName=self,Path=Step2Data.Current,Mode=TwoWay}"
  94. Hour="{Binding ElementName=self,Path=Step2Data.Hour,Mode=TwoWay}" Minute="{Binding ElementName=self,Path=Step2Data.Minute,Mode=TwoWay}"
  95. Second="{Binding ElementName=self,Path=Step2Data.Second,Mode=TwoWay}" MicroSecond="{Binding ElementName=self,Path=Step2Data.Microsecond,Mode=TwoWay}"></local:PowerSupplierStepControl>
  96. <local:PowerSupplierStepControl Grid.Row="2" Current="{Binding ElementName=self,Path=Step3Data.Current,Mode=TwoWay}"
  97. Hour="{Binding ElementName=self,Path=Step3Data.Hour,Mode=TwoWay}" Minute="{Binding ElementName=self,Path=Step3Data.Minute,Mode=TwoWay}"
  98. Second="{Binding ElementName=self,Path=Step3Data.Second,Mode=TwoWay}" MicroSecond="{Binding ElementName=self,Path=Step3Data.Microsecond,Mode=TwoWay}"></local:PowerSupplierStepControl>
  99. <Button Style="{StaticResource SysBtnStyle}" Grid.Row="3" Content="Start" Click="Start_Click" Width="60" Height="25"
  100. HorizontalAlignment="Left" Margin="59,5,0,5"></Button>
  101. <Button Style="{StaticResource SysBtnStyle}" Grid.Row="3" Content="Abort" Click="Abort_Click" Width="60" Height="25"
  102. HorizontalAlignment="Left" Margin="168,5,0,5"></Button>
  103. </Grid>
  104. </GroupBox>
  105. </Grid>
  106. </GroupBox>
  107. </Grid>
  108. </UserControl>