PowerSupplyChannelControl.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <UserControl x:Class="PunkHPX8_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:PunkHPX8_Themes.UserControls"
  7. xmlns:control="clr-namespace:MECF.Framework.UI.Core.Control;assembly=MECF.Framework.UI.Core"
  8. xmlns:converters="clr-namespace:PunkHPX8_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" Content="{Binding ElementName=self,Path=MetalCellSideName}" Width="120" Height="30" FontSize="16" VerticalContentAlignment="Center"></Label>
  36. <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="Grade" Width="50" Height="30" VerticalContentAlignment="Center" Margin="0,0,50,0"></Label>
  37. <Grid Grid.Row="1" Grid.Column="0" IsEnabled="{Binding ElementName=self,Path=Connected}">
  38. <Ellipse Width="16" Height="16" Fill="{Binding ElementName=self,Path=OutputEnabled, Converter={StaticResource boolToColor}}"
  39. Stroke="Silver" HorizontalAlignment="Left" Margin="39,12,0,12"/>
  40. <Button Style="{StaticResource SysBtnStyle}" Content="Enable" Click="Enable_Click" Width="60" Height="25"
  41. IsEnabled="{Binding ElementName=self,Path=OutputEnabled,Converter={StaticResource boolToBool}}" HorizontalAlignment="Left"
  42. Margin="74,8,0,8"></Button>
  43. <Button Style="{StaticResource SysBtnStyle}" Grid.Row="1" Content="Disable" Click="Disable_Click" Width="60" Height="25"
  44. IsEnabled="{Binding ElementName=self,Path=OutputEnabled}" HorizontalAlignment="Left" Margin="159,8,0,7"></Button>
  45. </Grid>
  46. <Label Grid.Row="2" Grid.Column="0" Content="Status" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="16,0,0,0"></Label>
  47. <TextBlock Grid.Row="2" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=PowerStatus}" Background="Black"
  48. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  49. <Label Grid.Row="2" Grid.Column="1" Content="Run Model" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="16,0,0,0"></Label>
  50. <TextBlock Grid.Row="2" Grid.Column="1" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=PowerRunModel}" Background="Black"
  51. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  52. <Grid Grid.Row="3" Grid.Column="0" IsEnabled="{Binding ElementName=self,Path=Connected}">
  53. <Label Grid.Row="3" Grid.Column="0" Content="Set Point" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="12,0,0,0"></Label>
  54. <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"
  55. ></control:NumbericTextBox>
  56. <TextBlock Grid.Row="3" Margin="160,0,0,0" Width="40" Text="A" Background="Black" Foreground="Lime" FontWeight="Bold" VerticalAlignment="Center"
  57. FontSize="16" HorizontalAlignment="Left"/>
  58. <Button Style="{StaticResource SysBtnStyle}" Grid.Row="3" Content="Set" Click="SetPoint_Click" Width="40" Height="25" HorizontalAlignment="Left"
  59. Margin="210,8,0,7" IsEnabled="{Binding ElementName=self,Path=OutputEnabled,Converter={StaticResource boolToBool}}"></Button>
  60. </Grid>
  61. <Label Grid.Row="4" Grid.Column="0" Content="Set Point" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="12,0,0,0"></Label>
  62. <TextBlock Grid.Row="4" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=SetPoint,StringFormat=\{0:F3\},Mode=TwoWay}" Background="Black"
  63. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  64. <TextBlock Grid.Row="4" Margin="160,0,0,0" Width="40" Text="A" Background="Black" Foreground="Lime" FontWeight="Bold" VerticalAlignment="Center"
  65. FontSize="16" HorizontalAlignment="Left"/>
  66. <Label Grid.Row="5" Grid.Column="0" Content="Current" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="12,0,0,0"></Label>
  67. <TextBlock Grid.Row="5" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=Current,StringFormat=\{0:F3\},Mode=TwoWay}" Background="Black"
  68. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  69. <TextBlock Grid.Row="5" Margin="160,0,0,0" Width="40" Text="A" Background="Black" Foreground="Lime" FontWeight="Bold" VerticalAlignment="Center"
  70. FontSize="16" HorizontalAlignment="Left"/>
  71. <Label Grid.Row="6" Grid.Column="0" Content="Voltage" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="12,0,0,0"></Label>
  72. <TextBlock Grid.Row="6" Width="70" Margin="0,0,30,0" Text="{Binding ElementName=self,Path=Voltage,StringFormat=\{0:F3\},Mode=TwoWay}" Background="Black"
  73. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  74. <TextBlock Grid.Row="6" Margin="160,0,0,0" Width="40" Text="V" Background="Black" Foreground="Lime" FontWeight="Bold" VerticalAlignment="Center"
  75. FontSize="16" HorizontalAlignment="Left"/>
  76. <Grid Grid.Row="1" Grid.Column="1" IsEnabled="{Binding ElementName=self,Path=Connected}">
  77. <TextBlock Width="70" Text="{Binding PowerControl, ElementName=self}" Background="Black"
  78. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="14,0,0,0"/>
  79. <Button Style="{StaticResource SysBtnStyle}" Content="Local" Click="Local_Click" Width="60" Height="25"
  80. HorizontalAlignment="Left" Margin="184,8,0,7"></Button>
  81. <Button Style="{StaticResource SysBtnStyle}" Content="Remote" Click="Remote_Click" Width="60" Height="25"
  82. HorizontalAlignment="Left" Margin="101,8,0,7"></Button>
  83. </Grid>
  84. <Grid Grid.Row="0" Grid.Column="1" IsEnabled="{Binding ElementName=self,Path=Connected}">
  85. <TextBlock Width="70" Text="{Binding PowerGrade, ElementName=self}" Background="Black"
  86. Foreground="Lime" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="14,0,0,0"/>
  87. <Button Style="{StaticResource SysBtnStyle}" Content="High" Click="High_Click" Width="50" Height="25"
  88. HorizontalAlignment="Left" Margin="231,8,0,7"></Button>
  89. <Button Style="{StaticResource SysBtnStyle}" Content="Middle" Click="Middle_Click" Width="50" Height="25"
  90. HorizontalAlignment="Left" Margin="164,8,0,7"></Button>
  91. <Button Style="{StaticResource SysBtnStyle}" Content="Low" Click="Low_Click" Width="50" Height="25"
  92. HorizontalAlignment="Left" Margin="101,8,0,7"></Button>
  93. </Grid>
  94. <GroupBox Grid.Row="3" Grid.Column="1" Grid.RowSpan="4" Header="Step" IsEnabled="{Binding ElementName=self,Path=Connected}">
  95. <Grid>
  96. <Grid.RowDefinitions>
  97. <RowDefinition Height="35"></RowDefinition>
  98. <RowDefinition Height="35"></RowDefinition>
  99. <RowDefinition Height="35"></RowDefinition>
  100. <RowDefinition Height="35"></RowDefinition>
  101. <RowDefinition/>
  102. </Grid.RowDefinitions>
  103. <local:PowerSupplierStepControl Grid.Row="0" Current="{Binding ElementName=self,Path=Step1Data.Current,Mode=TwoWay}"
  104. Hour="{Binding ElementName=self,Path=Step1Data.Hour,Mode=TwoWay}" Minute="{Binding ElementName=self,Path=Step1Data.Minute,Mode=TwoWay}"
  105. Second="{Binding ElementName=self,Path=Step1Data.Second,Mode=TwoWay}" MicroSecond="{Binding ElementName=self,Path=Step1Data.Microsecond,Mode=TwoWay}"></local:PowerSupplierStepControl>
  106. <local:PowerSupplierStepControl Grid.Row="1" Current="{Binding ElementName=self,Path=Step2Data.Current,Mode=TwoWay}"
  107. Hour="{Binding ElementName=self,Path=Step2Data.Hour,Mode=TwoWay}" Minute="{Binding ElementName=self,Path=Step2Data.Minute,Mode=TwoWay}"
  108. Second="{Binding ElementName=self,Path=Step2Data.Second,Mode=TwoWay}" MicroSecond="{Binding ElementName=self,Path=Step2Data.Microsecond,Mode=TwoWay}"></local:PowerSupplierStepControl>
  109. <local:PowerSupplierStepControl Grid.Row="2" Current="{Binding ElementName=self,Path=Step3Data.Current,Mode=TwoWay}"
  110. Hour="{Binding ElementName=self,Path=Step3Data.Hour,Mode=TwoWay}" Minute="{Binding ElementName=self,Path=Step3Data.Minute,Mode=TwoWay}"
  111. Second="{Binding ElementName=self,Path=Step3Data.Second,Mode=TwoWay}" MicroSecond="{Binding ElementName=self,Path=Step3Data.Microsecond,Mode=TwoWay}"></local:PowerSupplierStepControl>
  112. <Button Style="{StaticResource SysBtnStyle}" Grid.Row="3" Content="Start" Click="Start_Click" Width="60" Height="25"
  113. HorizontalAlignment="Left" Margin="59,5,0,5"></Button>
  114. <Button Style="{StaticResource SysBtnStyle}" Grid.Row="3" Content="Abort" Click="Abort_Click" Width="60" Height="25"
  115. HorizontalAlignment="Left" Margin="168,5,0,5"></Button>
  116. </Grid>
  117. </GroupBox>
  118. </Grid>
  119. </GroupBox>
  120. </Grid>
  121. </UserControl>