<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             Width="1280"
             Height="620"
       Background="#B3B3B3"
             
             x:Class="DaireApplication.Diagnostics">
  <Grid RowDefinitions="*" Margin="0,5">
    <Grid Grid.Row="0" ColumnDefinitions="*,Auto,1.3*">
      <!--left col-->
      <Grid Grid.Column="0" RowDefinitions="0.9*,4.6*,Auto" Margin="0,0,5,0" HorizontalAlignment="Right" Background=""
            >
        <Grid Grid.Row="0" >

        </Grid>
        <!-- Right arrow -->
        <Grid Height="14" Width="50" VerticalAlignment="Bottom" Margin="-35,0,0,5">
          <Grid.Background>
            <ImageBrush  Source="/Assets/RightArrow.png"/>
          </Grid.Background>
        </Grid>
		  <StackPanel Grid.Row="1" Spacing="20">
			  <Border  Width="111" Height="290" CornerRadius="5" Padding="10,5"  VerticalAlignment="Top"  Background="#F9F9F9"
			  Margin="-45,0,0,0" >


				  <StackPanel Orientation="Vertical">
					  <!-- Top label -->
					  <TextBlock Text="SIGNALS"
								 Foreground="#A4A2A3"
								 FontSize="16.5"
								 HorizontalAlignment="Center"
                   />
					  <TextBlock Text="INPUTS"
								Foreground="#A4A2A3"
								FontSize="16.5"
								HorizontalAlignment="Center"
								Margin="0"
                   />

					  <StackPanel Orientation="Vertical" Spacing="7">
						  <!-- First row: ACTIVE -->

						  <Border Width="99" Height="33" Background="#E6E6E6" CornerRadius="5">
							  <Button Width="99" Height="33" Background="#E6E6E6" Padding="5">
								  <Grid RowDefinitions="*" >
									  <Grid Grid.Row="0" ColumnDefinitions="*,Auto" Classes="in" Tag="0">
										  <TextBlock
											Grid.Column="0"
											Text="PASSIVE"
											Foreground="#918f90"
											FontSize="19"
											FontWeight="Light"
											VerticalAlignment="Center"
                               >

										  </TextBlock>
										  <Border Grid.Column="1"
												 Width="5"
												  Height="27"
												  CornerRadius="1"
												 Background="#666666"
												 HorizontalAlignment="Right"/>

									  </Grid>
								  </Grid>
							  </Button>
						  </Border>


						  <!-- Second row: PASSIVE -->
						  <Border Width="99" Height="33" Background="#E6E6E6" CornerRadius="5">
							  <Button Width="99" Height="33" Background="#E6E6E6" Padding="5">
								  <Grid RowDefinitions="*" >
									  <Grid Grid.Row="0" ColumnDefinitions="*,Auto" Classes="in" Tag="1">
										  <TextBlock
											Grid.Column="0"
											Text="PASSIVE"
											Foreground="#918f90"
											FontSize="19"
											FontWeight="Light"
											VerticalAlignment="Center"
                               >

										  </TextBlock>
										  <Border Grid.Column="1"
												 Width="5"
												  Height="27"
												  CornerRadius="1"
												 Background="#666666"
												 HorizontalAlignment="Right"/>

									  </Grid>
								  </Grid>
							  </Button>
						  </Border>

						  <!-- Third row: PASSIVE -->
						  <Border Width="99" Height="33" Background="#E6E6E6" CornerRadius="5">
							  <Button Width="99" Height="33" Background="#E6E6E6" Padding="5">
								  <Grid RowDefinitions="*" >
									  <Grid Grid.Row="0" ColumnDefinitions="*,Auto" Classes="in" Tag="2">
										  <TextBlock
											Grid.Column="0"
											Text="PASSIVE"
											Foreground="#918f90"
											FontSize="19"
											FontWeight="Light"
											VerticalAlignment="Center"
                               >

										  </TextBlock>
										  <Border Grid.Column="1"
												 Width="5"
												  Height="27"
												  CornerRadius="1"
												 Background="#666666"
												 HorizontalAlignment="Right"/>

									  </Grid>
								  </Grid>
							  </Button>
						  </Border>

						  <!-- Fourth row: PASSIVE -->
						  <Border Width="99" Height="33" Background="#E6E6E6" CornerRadius="5">
							  <Button Width="99" Height="33" Background="#E6E6E6" Padding="5">
								  <Grid RowDefinitions="*" >
									  <Grid Grid.Row="0" ColumnDefinitions="*,Auto" Classes="in" Tag="3">
										  <TextBlock
											Grid.Column="0"
											Text="PASSIVE"
											Foreground="#918f90"
											FontSize="19"
											FontWeight="Light"
											VerticalAlignment="Center"
                               >

										  </TextBlock>
										  <Border Grid.Column="1"
												 Width="5"
												  Height="27"
												  CornerRadius="1"
												 Background="#666666"
												 HorizontalAlignment="Right"/>

									  </Grid>
								  </Grid>
							  </Button>
						  </Border>
						  <!-- Fifth row: ACTIVE -->
						  <Border Width="99" Height="33" Background="#E6E6E6" CornerRadius="5">
							  <Button Width="99" Height="33" Background="#E6E6E6" Padding="5">
								  <Grid RowDefinitions="*" >
									  <Grid Grid.Row="0" ColumnDefinitions="*,Auto" Classes="in" Tag="4">
										  <TextBlock
											Grid.Column="0"
											Text="PASSIVE"
											Foreground="#918f90"
											FontSize="19"
											FontWeight="Light"
											VerticalAlignment="Center"
                               >

										  </TextBlock>
										  <Border Grid.Column="1"
												 Width="5"
												  Height="27"
												  CornerRadius="1"
												 Background="#666666"
												 HorizontalAlignment="Right"/>

									  </Grid>
								  </Grid>
							  </Button>
						  </Border>

						  <!-- Sixth row: ACTIVE -->
						  <Border Width="99" Height="33" Background="#E6E6E6" CornerRadius="5">
							  <Button Width="99" Height="33" Background="#E6E6E6" Padding="5">
								  <Grid RowDefinitions="*" >
									  <Grid Grid.Row="0" ColumnDefinitions="*,Auto" Classes="in" Tag="5">
										  <TextBlock
											Grid.Column="0"
											Text="PASSIVE"
											Foreground="#918f90"
											FontSize="19"
											FontWeight="Light"
											VerticalAlignment="Center"
                               >

										  </TextBlock>
										  <Border Grid.Column="1"
												 Width="5"
												  Height="27"
												  CornerRadius="1"
												 Background="#666666"
												 HorizontalAlignment="Right"/>

									  </Grid>
								  </Grid>
							  </Button>
						  </Border>
					  </StackPanel>
				  </StackPanel>






			  </Border>



			  <Border Width="115" Height="210" Background="#f9f9f9" Margin="-40,0,0,0" CornerRadius="5" Padding="10">
				  <StackPanel Spacing="10">
					  <!--Resend Configration Btn-->
					  <Border Width="99" Height="33" Background="#E6E6E6" CornerRadius="5" VerticalAlignment="Top" >
						  <Button Width="99" Height="33" Padding="5" Content="RE-SEND"
								  FontSize="18" HorizontalContentAlignment="Center"
								  Foreground="White" Background="#008000" Click="ResendConfig">
						  </Button>
					  </Border>
					  <!--PID Setting Btn-->

					  <Border Width="99" Height="33" Background="#E6E6E6" CornerRadius="5" VerticalAlignment="Top" >
						  <Button Width="99" Height="33" Padding="0,5" Content="SETTINGS"
								  FontSize="18" HorizontalContentAlignment="Center"
								  Foreground="White" Background="#ff5555"
								  Click="showPidPopUp"
								  >
						  </Button>
					  </Border>
				  </StackPanel>
				  
				 

			  </Border>
			 

		  </StackPanel>
      
		  <Border
          Grid.Row="2"
          Width="195"
          Height="124"
          Background="#f9f9f9"
          CornerRadius="5"
          Margin="40,0,0,5" Padding="3,3,0,0">
          <StackPanel Orientation="Vertical" Spacing="2">
            <StackPanel Orientation="Horizontal" Spacing="3">
              <Border
                Width="28"
                Height="28"
                Background="#e6e6e6"
                PointerPressed="ChangeTempMode"
                Tag="t1"
                >
                <Button VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           FontSize="18"
                           FontWeight="Bold"
                           Foreground="#4d4d4d"
                        Background="Transparent"
                        Padding="0"
                        Click="ChangeTempMode"
                        Tag="t1"
                        >
                  M
                </Button>
              </Border>
              <Border Width="158"
                      Height="28"
                      Background="#e6e6e6"
                      Padding="10,2,7,0"
                      Tag="t1"
                      
                      PointerPressed="ShowNumberKeyBoard">
                <Grid RowDefinitions="*" >
                  <Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" x:Name="t1Container">
                    <TextBlock Grid.Column="0" FontSize="20" Foreground="#808080" >T-1 =</TextBlock>
                    <TextBlock x:Name="t1Text" Grid.Column="1" FontSize="20" Foreground="#808080">+0.0</TextBlock>
                    <TextBlock Grid.Column="2" FontSize="20" Foreground="#808080">°C</TextBlock>

                  </Grid>
                </Grid>
              </Border>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Spacing="3">
              <Border
                Width="28"
                Height="28"
                Background="#e6e6e6"
                PointerPressed="ChangeTempMode"
                Tag="t2">
                <Button VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           FontSize="18"
                           FontWeight="Bold"
                           Foreground="#4d4d4d"
                        Background="Transparent"
                        Padding="0"
                        Click="ChangeTempMode"
                        Tag="t2">
                  M
                </Button>
              </Border>
              <Border Width="158"
                      Height="28"
                      Background="#e6e6e6"
                      Padding="10,2,7,0"
                      Tag="t2"
                      
                      PointerPressed="ShowNumberKeyBoard">
                <Grid RowDefinitions="*">
                  <Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto"
                        x:Name="t2Container">
                    <TextBlock Grid.Column="0" FontSize="20" Foreground="#808080">T-2 =</TextBlock>
                    <TextBlock Grid.Column="1" FontSize="20" Foreground="#808080" x:Name="t2Text" >+0.0</TextBlock>
                    <TextBlock Grid.Column="2" FontSize="20" Foreground="#808080">°C</TextBlock>

                  </Grid>
                </Grid>
              </Border>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Spacing="3">
              <Border
                Width="28"
                Height="28"
                Background="#e6e6e6"
                PointerPressed="ChangeTempMode"
                Tag="t3">
                <Button VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           FontSize="18"
                           FontWeight="Bold"
                           Foreground="#4d4d4d"
                        Background="Transparent"
                        Padding="0"
                        Click="ChangeTempMode"
                        Tag="t3">
                  M
                </Button>
              </Border>
              <Border Width="158"
                      Height="28"
                      Background="#e6e6e6"
                      Padding="10,2,7,0"
                              Tag="t3"
                      
                      PointerPressed="ShowNumberKeyBoard">
                <Grid RowDefinitions="*">
                  <Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto"
                        x:Name="t3Container">
                    <TextBlock Grid.Column="0" FontSize="20" Foreground="#808080">T-3 =</TextBlock>
                    <TextBlock Grid.Column="1" FontSize="20" Foreground="#808080" x:Name="t3Text">+0.0</TextBlock>
                    <TextBlock Grid.Column="2" FontSize="20" Foreground="#808080">°C</TextBlock>

                  </Grid>
                </Grid>
              </Border>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Spacing="3">
              <Border
                Width="28"
                Height="28"
                Background="#e6e6e6"
                PointerPressed="ChangeTempMode"
                Tag="t4">
                <Button VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           FontSize="18"
                           FontWeight="Bold"
                           Foreground="#4d4d4d"
                        Background="Transparent"
                        Padding="0"
                        Click="ChangeTempMode"
                        Tag="t4">
                  M
                </Button>
              </Border>
              <Border Width="158"
                      Height="28"
                      Background="#e6e6e6"
                      Padding="10,2,7,0"
                              Tag="t4"
                      
                      PointerPressed="ShowNumberKeyBoard">
                <Grid RowDefinitions="*">
                  <Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto"
                        x:Name="t4Container">
                    <TextBlock Grid.Column="0" FontSize="20" Foreground="#808080">T-4 =</TextBlock>
                    <TextBlock Grid.Column="1" FontSize="20" Foreground="#808080" x:Name="t4Text">+0.0</TextBlock>
                    <TextBlock Grid.Column="2" FontSize="20" Foreground="#808080">°C</TextBlock>

                  </Grid>
                </Grid>
              </Border>
            </StackPanel>
          </StackPanel>
          
          
        </Border>

      </Grid>
      <!--Middel col-->
      <Grid Grid.Column="1" RowDefinitions="Auto,Auto,Auto" Margin="0,0,0,0">
        <!--first row in middel col-->
        <Grid Grid.Row="0"  ColumnDefinitions="*,1.07*">
          <Grid Grid.Column="0" ColumnDefinitions="*,1.1*">
            <Grid Grid.Column="0" >
              <Grid Height="50" Width="14" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,0,10">
                <Grid.Background>
                  <ImageBrush  Source="/Assets/UpArrow.png"/>
                </Grid.Background>
              </Grid>
            </Grid>
            <Grid Grid.Column="1">
              <StackPanel Orientation="Horizontal" Spacing="5">
                <!--Motore 1-->
                <Border CornerRadius="10" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="116" Height="73" Margin="3,0,0,0"  Background="#F9F9F9" Padding="0">



                  <StackPanel Spacing="2">
                    <!-- First row: ACTIVE -->
                    <Border
                            CornerRadius="4"
                            Padding="0"
                >
                      <Button Width="110" Height="32" Padding="0" Margin="2" HorizontalAlignment="Center" Background="#E6E6E6">
                        <Grid ColumnDefinitions="*,Auto"
                            VerticalAlignment="Center">
                          <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                            <TextBlock Foreground="#231F20" Text="Curr="
                            FontSize="18"
                            />
                            <TextBlock x:Name="curr1" Foreground="#AF196F" Text="0.0"
                              FontSize="18"/>
                            <TextBlock Foreground="#231F20" Text="A"
                              FontSize="18"/>
                          </StackPanel>

                        </Grid>
                      </Button>

                    </Border>

                    <!-- Second row: PASSIVE -->
                    <Border
                            CornerRadius="4"
                            Padding="0"
                >
                      <Button Width="110" Height="32" Padding="0" Margin="2" HorizontalAlignment="Center" Background="#E6E6E6" Click="motorClick">
                        <Grid ColumnDefinitions="*,Auto"
                            VerticalAlignment="Center" Classes="motorState" Tag="0">
                          <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-10,0,0" >
                            <TextBlock Foreground="#231F20" Text="MOT-1 "
                            FontSize="18"/>

                            <TextBlock Foreground="#231F20" Text="OFF"
                              FontSize="18"/>

                          </StackPanel>
                          <Border CornerRadius="5" Margin="0,0,0,-8"
                          Width="104" Height="5"
                          Background="#666666"
                          HorizontalAlignment="Center" VerticalAlignment="Bottom"/>

                        </Grid>
                      </Button>

                    </Border>


                  </StackPanel>





                </Border>
                <!--Motore 2-->
                <Border CornerRadius="10" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="116" Height="73" Margin="3,0,0,0" Background="#F9F9F9">



                  <StackPanel Spacing="2">
                    <!-- First row -->
                    <Border
                            CornerRadius="4"
                            Padding="0"
                >
                      <Button Width="110" Height="32" Padding="0" Margin="2" HorizontalAlignment="Center" Background="#E6E6E6">
                        <Grid ColumnDefinitions="*,Auto"
                            VerticalAlignment="Center">
                          <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                            <TextBlock Foreground="#231F20" Text="Curr="
                            FontSize="18"/>
                            <TextBlock x:Name="curr2" Foreground="#AF196F" Text="0.0"
                              FontSize="18"/>
                            <TextBlock Foreground="#231F20" Text="A"
                              FontSize="18"/>
                          </StackPanel>

                        </Grid>
                      </Button>

                    </Border>

                    <!-- Second row: PASSIVE -->
                    <Border
                            CornerRadius="4"
                            Padding="0"
                >
                      <Button Width="110" Height="32" Padding="0" Margin="2" HorizontalAlignment="Center" Background="#E6E6E6" Click="motorClick">
                        <Grid ColumnDefinitions="*,Auto"
                            VerticalAlignment="Center"  Classes="motorState" Tag="1">
                          <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-10,0,0">
                            <TextBlock Foreground="#231F20" Text="MOT-2 "
                            FontSize="18"/>

                            <TextBlock Foreground="#231F20" Text="OFF"
                              FontSize="18"/>

                          </StackPanel>
                          <Border CornerRadius="5" Margin="0,0,0,-8"
                          Width="104" Height="5"
                          Background="#666666"
                          HorizontalAlignment="Center" VerticalAlignment="Bottom"/>

                        </Grid>
                      </Button>

                    </Border>


                  </StackPanel>





                </Border>
              </StackPanel>

            </Grid>

          </Grid>
          <Grid Grid.Column="1" >
            <StackPanel Orientation="Horizontal">
              <Grid Height="50" Width="14" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,10,10">
                <Grid.Background>
                  <ImageBrush  Source="/Assets/UpArrow.png"/>
                </Grid.Background>
              </Grid>
              <Border Width="340" Height="82" Background="#F9F9F9" HorizontalAlignment="Left" CornerRadius="5" VerticalAlignment="Bottom" Padding="3,5,0,0">

                <StackPanel  Orientation="Vertical">
                  <!-- Top label -->
                  <TextBlock Text="HIGH VOLT OUTPUTS"
                             Foreground="#A4A2A3"
                             FontSize="17"
                             TextWrapping="Wrap"
                             HorizontalAlignment="Center"
                   />
                  <StackPanel Orientation="Horizontal" Spacing="9">
                    <!-- First row: ACTIVE -->
                    <Border
                            CornerRadius="4" >
                      <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6" Click="hvoClick">
                        <Grid RowDefinitions="*,Auto,Auto"
                            VerticalAlignment="Center" HorizontalAlignment="Center" Classes="hvo" Tag="0">
                          <TextBlock Grid.Row="0" FontSize="19"  Text="1" Foreground="#231F20"
                             VerticalAlignment="Top" HorizontalAlignment="Center"/>
                          <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                             VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                          <!-- Colored bar on the right -->
                          <Border Grid.Row="2"
                                  Width="32" Height="5"
                                  Background="#666666"
                                  HorizontalAlignment="Center"
                                  VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                        </Grid>
                      </Button>

                    </Border>

                    <!-- Second row: PASSIVE -->
                    <Border
                            CornerRadius="4" >
                      <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6" Click="hvoClick">
                        <Grid RowDefinitions="*,Auto,Auto"
                            VerticalAlignment="Center" HorizontalAlignment="Center" Classes="hvo" Tag="1">
                          <TextBlock Grid.Row="0" FontSize="19"  Text="2" Foreground="#231F20"
                             VerticalAlignment="Top" HorizontalAlignment="Center"/>
                          <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                             VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                          <!-- Colored bar on the right -->
                          <Border Grid.Row="2"
                                  Width="32" Height="5"
                                  Background="#666666"
                                  HorizontalAlignment="Center"
                                  VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                        </Grid>
                      </Button>

                    </Border>


                    <!-- Third row: PASSIVE -->
                    <Border
                          CornerRadius="4" >
                      <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6" Click="hvoClick">
                        <Grid RowDefinitions="*,Auto,Auto"
                            VerticalAlignment="Center" HorizontalAlignment="Center" Classes="hvo" Tag="2">
                          <TextBlock Grid.Row="0" FontSize="19"  Text="3" Foreground="#231F20"
                             VerticalAlignment="Top" HorizontalAlignment="Center"/>
                          <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                             VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                          <!-- Colored bar on the right -->
                          <Border Grid.Row="2"
                                  Width="32" Height="5"
                                  Background="#666666"
                                  HorizontalAlignment="Center"
                                  VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                        </Grid>
                      </Button>

                    </Border>

                    <!-- Fourth row: PASSIVE -->
                    <Border
                          CornerRadius="4" >
                      <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6" Click="hvoClick">
                        <Grid RowDefinitions="*,Auto,Auto"
                            VerticalAlignment="Center" HorizontalAlignment="Center" Classes="hvo" Tag="3">
                          <TextBlock Grid.Row="0" FontSize="19"  Text="4" Foreground="#231F20"
                             VerticalAlignment="Top" HorizontalAlignment="Center"/>
                          <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                             VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                          <!-- Colored bar on the right -->
                          <Border Grid.Row="2"
                                  Width="32" Height="5"
                                  Background="#666666"
                                  HorizontalAlignment="Center"
                                  VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                        </Grid>
                      </Button>

                    </Border>


                    <StackPanel Orientation="Horizontal" Margin="25,0,0,0" Spacing="33">
                      <!-- Fifth row: ACTIVE -->
                      <Border
                           CornerRadius="4" >
                        <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6" Click="hvoClick">
                          <Grid RowDefinitions="*,Auto,Auto"
                              VerticalAlignment="Center" HorizontalAlignment="Center" Classes="hvo" Tag="4">
                            <TextBlock Grid.Row="0" FontSize="19"  Text="5" Foreground="#231F20"
                               VerticalAlignment="Top" HorizontalAlignment="Center"/>
                            <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                               VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                            <!-- Colored bar on the right -->
                            <Border Grid.Row="2"
                                    Width="32" Height="5"
                                    Background="#666666"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                          </Grid>
                        </Button>

                      </Border>


                      <!-- Sixth row: ACTIVE -->
                      <Border
                                CornerRadius="4" >
                        <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6" Click="hvoClick">
                          <Grid RowDefinitions="*,Auto,Auto"
                              VerticalAlignment="Center" HorizontalAlignment="Center" Classes="hvo" Tag="5">
                            <TextBlock Grid.Row="0" FontSize="19"  Text="6" Foreground="#231F20"
                               VerticalAlignment="Top" HorizontalAlignment="Center"/>
                            <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                               VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                            <!-- Colored bar on the right -->
                            <Border Grid.Row="2"
                                    Width="32" Height="5"
                                    Background="#666666"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                          </Grid>
                        </Button>

                      </Border>

                    </StackPanel>

                  </StackPanel>



                </StackPanel>





              </Border>
            </StackPanel>

          </Grid>
        </Grid>
        <!--second row in middel col-->
        <Grid Grid.Row="1" Width="974" Height="392" ColumnDefinitions="*,10*">
          <Grid Grid.Column="0" RowDefinitions="0.21*,1.31*">
            <Grid Grid.Row="0"></Grid>
            <StackPanel Grid.Row="1" Spacing="30.8"  Height="215"   Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,5,0">
              <Ellipse Classes="in" Tag="0"  Width="10" Height="10" Fill="#666666"/>
              <Ellipse Classes="in" Tag="1"  Width="10" Height="10" Fill="#666666"/>
              <Ellipse Classes="in" Tag="2"  Width="10" Height="10" Fill="#666666" Margin="0,0,0,0"/>
              <Ellipse Classes="in" Tag="3"  Width="10" Height="10" Fill="#666666" Margin="0,0,0,0"/>
              <Ellipse Classes="in" Tag="4" Width="10" Height="10" Fill="#666666" Margin="0,0,0,0"/>
              <Ellipse Classes="in" Tag="5" Width="10" Height="10" Fill="#666666"/>
            </StackPanel>
          </Grid>
          <Grid Grid.Column="1" ColumnDefinitions="*,6*">
            <Grid Grid.Column="0"  Width="73" Height="40"  Margin="35,-30,0,0" VerticalAlignment="Center" HorizontalAlignment="Center">
              <StackPanel Orientation="Vertical" VerticalAlignment="Top">
                <TextBlock FontSize="18"  Foreground="White">T-Board</TextBlock>
                <StackPanel Orientation="Horizontal">
                  <TextBlock x:Name="internalTemp" FontSize="18" Foreground="White" Margin="6,0,0,0">0</TextBlock>
                  <TextBlock FontSize="18" Foreground="White" >°C</TextBlock>
                </StackPanel>
              </StackPanel>

            </Grid>
            <Grid Grid.Column="1" RowDefinitions="*,2.1*,*">
              <Grid Grid.Row="0" ></Grid>
              <Grid Grid.Row="1" RowDefinitions="*,*">
                <Grid Grid.Row="0" ColumnDefinitions="*,*,*" >
                  <Grid Grid.Column="0"   Width="130" Margin="20,0,0,15">
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Spacing="115">
                      <Ellipse Classes="motorState" Tag="0"  Width="10" Height="10" Fill="#666666"  />
                      <Ellipse Classes="motorState" Tag="1"  Width="10" Height="10" Fill="#666666"/>
                    </StackPanel>
                  </Grid>
                  <Grid Grid.Column="1"  Width="155"  Margin="-10,0,0,15" >
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Spacing="40">
                      <Ellipse Classes="hvo" Tag="0"  Width="10" Height="10" Fill="#666666" />
                      <Ellipse Classes="hvo" Tag="1"  Width="10" Height="10" Fill="#666666"/>
                      <Ellipse Classes="hvo" Tag="2"  Width="10" Height="10" Fill="#666666" Margin="-2,0,0,0"/>
                      <Ellipse Classes="hvo" Tag="3"  Width="10" Height="10" Fill="#666666" Margin="0,0,0,0"/>
                    </StackPanel>
                  </Grid>
                  <Grid Grid.Column="2" Width="" Margin="14,0,0,15" Background="" >
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Spacing="65">
                      <Ellipse Classes="hvo" Tag="4"  Width="10" Height="10" Fill="#666666"/>
                      <Ellipse Classes="hvo" Tag="5" Width="10" Height="10" Fill="#666666"/>
                    </StackPanel>
                  </Grid>
                </Grid>
                <Grid Grid.Row="1" ColumnDefinitions="*,2*">
                  <Grid Grid.Column="0" Background="">
                    <StackPanel Orientation="Vertical" VerticalAlignment="Bottom" Margin="20,0,0,0">
                      <TextBlock FontSize="18"  Foreground="White">T-Cooler</TextBlock>
                      <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="hsTemp" FontSize="18" Foreground="White" Margin="6,0,0,0">0</TextBlock>
                        <TextBlock FontSize="18" Foreground="White" >°C</TextBlock>
                      </StackPanel>
                    </StackPanel>
                  </Grid>
                  <Grid Grid.Column="1"  Background="">
                    <StackPanel Orientation="Horizontal" Margin="18,0,0,0" VerticalAlignment="Bottom" Spacing="40">
                      <Ellipse Classes="lvo" Tag="0" Width="10" Height="10" Fill="#666666"/>
                      <Ellipse Classes="lvo" Tag="1" Width="10" Height="10" Fill="#666666"/>
                      <Ellipse Classes="lvo" Tag="2" Width="10" Height="10" Fill="#666666"/>
                      <Ellipse Classes="lvo" Tag="3" Width="10" Height="10" Fill="#666666" Margin="-1,0,0,0"/>
                      <StackPanel  Margin="0,0,0,15" Orientation="Vertical" Spacing="5">
                        <Ellipse Classes="lvo" Tag="5" Width="10" Height="10" Fill="#666666"/>
                        <Ellipse Classes="lvo" Tag="4" Width="10" Height="10" Fill="#666666"/>
                      </StackPanel>
                      <StackPanel Margin="0,0,0,15" Orientation="Vertical" Spacing="5">
                        <Ellipse Classes="lvo" Tag="7" Width="10" Height="10" Fill="#666666"/>
                        <Ellipse Classes="lvo" Tag="6" Width="10" Height="10" Fill="#666666"/>
                      </StackPanel>
                      <StackPanel  Margin="0,0,0,15" Orientation="Vertical" Spacing="5">
                        <Ellipse Classes="lvo" Tag="9" Width="10" Height="10" Fill="#666666"/>
                        <Ellipse Classes="lvo" Tag="8" Width="10" Height="10" Fill="#666666"/>
                      </StackPanel>
          
                    </StackPanel>
                  </Grid>
                </Grid>
              </Grid>
              <Grid Grid.Row="2" ColumnDefinitions="*,*,1.1*" Background="">
                <Grid Background="" Grid.Column="2">
                  <Ellipse x:Name="extPowerLed" Classes="VDC" Margin="0,0,0,30" Width="10" Height="10" Fill="#666666"/>
                </Grid>
               
              </Grid>
            </Grid>
          </Grid>
          

          <Grid.Background >
            <ImageBrush  Source="/Assets/Board.png"/>
          </Grid.Background>

</Grid>
        <!--third row in middel col-->
        <Grid Grid.Row="2"  ColumnDefinitions="0.3*,2*,1.9*,0.1*" Margin="0,3,0,5">
          <Grid Grid.Column="0"  ></Grid>
          <Grid Grid.Column="1" ColumnDefinitions="*,*"  >

            <Grid Grid.Column="0" Height="50" Width="14" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="5,0,-40,0">
              <Grid.Background>
                <ImageBrush  Source="/Assets/RedUpArrow.png"/>
              </Grid.Background>
            </Grid>
            <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Top"
                        HorizontalAlignment="Right" Margin="0,0,0,0" Spacing="5">
				<StackPanel >
					<!--ANA 1-->
					<Border CornerRadius="10" VerticalAlignment="Top" HorizontalAlignment="Right" Width="146" Height="93" Margin="3,0,0,8" Background="#F9F9F9" Padding="5">



						<StackPanel Spacing="2">
							<!-- First row: ACTIVE -->
							<Border
									CornerRadius="4"
									Padding="0"
                        
                >
								<Button Width="140" Height="28" Padding="0" Margin="0" HorizontalAlignment="Center" Background="#E6E6E6">
									<Grid>
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="Auto"/>
											<ColumnDefinition Width="Auto"/>
											<ColumnDefinition Width="*"/>
										</Grid.ColumnDefinitions>
										<TextBlock Grid.Column="0" Foreground="#231F20" Text="AN-1 ="
							  FontSize="20" HorizontalAlignment="Center" Margin="5,0,0,0"/>
										<TextBlock x:Name="an1" Grid.Column="1" Text="0.0" FontSize="20" Foreground="#AF196F" HorizontalAlignment="Center"/>
										<TextBlock Grid.Column="2" Foreground="#231F20" Text="%" FontSize="20" HorizontalAlignment="Center"/>
									</Grid>
								</Button>

							</Border>

							<!-- Second row: PASSIVE -->
							<Border
									CornerRadius="4"
									Padding=""
                        
                >
								<Button Width="140" Height="28" Padding="0" Margin="0" HorizontalAlignment="Center" Background="#E6E6E6">
									<Grid>
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="Auto"/>
											<ColumnDefinition Width="Auto"/>
											<ColumnDefinition Width="*"/>
										</Grid.ColumnDefinitions>
										<TextBlock Grid.Column="0" Foreground="#231F20" Text="AN-2 ="
							  FontSize="20" HorizontalAlignment="Center" Margin="5,0,0,0"/>
										<TextBlock x:Name="an2"  Grid.Column="1" Text="0.0" FontSize="20" Foreground="#AF196F" HorizontalAlignment="Center"/>
										<TextBlock Grid.Column="2" Foreground="#231F20" Text="%" FontSize="20" HorizontalAlignment="Center"/>
									</Grid>
								</Button>

							</Border>
							<!-- Top label -->
							<TextBlock Text="ANALOG INPUTS"
									   Foreground="#918F90"
									   FontSize="16"
									   Margin="0,3,0,0"
									   HorizontalAlignment="Center"
                   />


						</StackPanel>





					</Border>
					<TextBlock FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" >Temps Control</TextBlock>
					<Grid Grid.Column="0"  Height="10" Width="191" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,0">
						<Grid.Background>
							<ImageBrush  Source="/Assets/TempArrow.png"/>
						</Grid.Background>
					</Grid>
				</StackPanel>
  
              <!--T-1,2,3,4-->
              <Border CornerRadius="10" VerticalAlignment="Top" HorizontalAlignment="Left" Width="164" Height="124" Margin="3,0,0,0" Background="#F9F9F9" Padding="2">



                <StackPanel Spacing="-2">
                  <!-- First row: ACTIVE -->
                  <Border
                          CornerRadius="4"
                          Padding=""
                >
                    <Button Width="158" Height="28" Padding="5,0,2,0" Margin="2" HorizontalAlignment="Center" Background="#E6E6E6">
                      <Grid RowDefinitions="Auto">
                        <Grid Grid.Row="0" >
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                          </Grid.ColumnDefinitions>
                          <StackPanel Grid.Column="0" Orientation="Horizontal">
                            <TextBlock  Foreground="#231F20" Text="T-1 =" FontSize="20" HorizontalAlignment="Center" Margin="5,0,0,0"/>
                            <TextBlock x:Name="t1"   Text="0.0" FontSize="20" Foreground="#AF196F" HorizontalAlignment="Center"/>
                          </StackPanel>

                          <TextBlock Grid.Column="1" Foreground="#231F20" Text="°C" FontSize="20" HorizontalAlignment="Center"/>
                        </Grid>

                      </Grid>
                    </Button>

                  </Border>

                  <!-- Second row: PASSIVE -->
                  <Border
                          CornerRadius="4"
                          Padding=""
                >
                    <Button Width="158" Height="28" Padding="5,0,2,0" Margin="2" HorizontalAlignment="Center" Background="#E6E6E6">
                      <Grid RowDefinitions="Auto">
                        <Grid Grid.Row="0" >
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                          </Grid.ColumnDefinitions>
                          <StackPanel Grid.Column="0" Orientation="Horizontal">
                            <TextBlock   Foreground="#231F20" Text="T-2 =" FontSize="20" HorizontalAlignment="Center" Margin="5,0,0,0"/>
                            <TextBlock x:Name="t2" Text="0.0" FontSize="20" Foreground="#AF196F" HorizontalAlignment="Center"/>
                          </StackPanel>

                          <TextBlock Grid.Column="1" Foreground="#231F20" Text="°C" FontSize="20" HorizontalAlignment="Center"/>
                        </Grid>

                      </Grid>

                    </Button>


                  </Border>

                  <!-- third row: PASSIVE -->
                  <Border
                          CornerRadius="4"
                          Padding=""
                >
                    <Button Width="158" Height="28" Padding="5,0,2,0" Margin="2" HorizontalAlignment="Center" Background="#E6E6E6">
                      <Grid RowDefinitions="Auto">
                        <Grid Grid.Row="0" >
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                          </Grid.ColumnDefinitions>
                          <StackPanel Grid.Column="0" Orientation="Horizontal">
                            <TextBlock  Foreground="#231F20" Text="T-3 =" FontSize="20" HorizontalAlignment="Center" Margin="5,0,0,0"/>
                            <TextBlock x:Name="t3" Text="0.0" FontSize="20" Foreground="#AF196F" HorizontalAlignment="Center"/>
                          </StackPanel>

                          <TextBlock Grid.Column="1" Foreground="#231F20" Text="°C" FontSize="20" HorizontalAlignment="Center"/>
                        </Grid>

                      </Grid>

                    </Button>

                  </Border>
                  <!-- fourth row: PASSIVE -->
                  <Border
                          CornerRadius="4"
                          Padding=""
                >
                    <Button Width="158" Height="28" Padding="5,0,2,0" Margin="2" HorizontalAlignment="Center" Background="#E6E6E6">
                      <Grid RowDefinitions="Auto">
                        <Grid Grid.Row="0" >
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                          </Grid.ColumnDefinitions>
                          <StackPanel Grid.Column="0" Orientation="Horizontal">
                            <TextBlock  Foreground="#231F20" Text="T-4 =" FontSize="20" HorizontalAlignment="Center" Margin="5,0,0,0"/>
                            <TextBlock x:Name="t4" Text="0.0" FontSize="20" Foreground="#AF196F" HorizontalAlignment="Center"/>
                          </StackPanel>

                          <TextBlock Grid.Column="1" Foreground="#231F20" Text="°C" FontSize="20" HorizontalAlignment="Center"/>
                        </Grid>

                      </Grid>

                    </Button>
                  </Border>



                </StackPanel>





              </Border>

              <Grid Height="50" Width="14" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,5,0">
          
              </Grid>
            </StackPanel>
           

          </Grid>
          <Grid  Grid.Column="2" RowDefinitions="*"  >
            <Grid Grid.Row="0"  ColumnDefinitions="Auto,*,*">
              <Grid Grid.Column="0">
                <Border Grid.Column="0" Width="343" Height="95" Background="#F9F9F9" HorizontalAlignment="Left" CornerRadius="5" VerticalAlignment="Top" Padding="2"
                      Margin="0,0,5,0">
                  <Grid RowDefinitions="*" >
                    <Grid Grid.Row="0" ColumnDefinitions="Auto,Auto">
                      <StackPanel Grid.Column="0" Margin="0,0,8,0">
                        <StackPanel Orientation="Horizontal" Spacing="10" >
                          <!-- First row: ACTIVE -->
                          <Border
                                         CornerRadius="4" >
                            <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6" Click="lvoClick">
                              <Grid RowDefinitions="*,Auto,Auto"
                                  VerticalAlignment="Center" HorizontalAlignment="Center" Classes="lvo" Tag="0">
                                <TextBlock Grid.Row="0" FontSize="19"  Text="1" Foreground="#231F20"
                                   VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border Grid.Row="2"
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                              </Grid>
                            </Button>

                          </Border>
                          <!-- Second row: PASSIVE -->
                          <Border
                              CornerRadius="4" >
                            <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6" Click="lvoClick">
                              <Grid RowDefinitions="*,Auto,Auto"
                                  VerticalAlignment="Center" HorizontalAlignment="Center" Classes="lvo" Tag="1">
                                <TextBlock Grid.Row="0" FontSize="19"  Text="2" Foreground="#231F20"
                                   VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border Grid.Row="2"
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                              </Grid>
                            </Button>

                          </Border>

                          <!-- third row: PASSIVE -->
                          <Border
                               CornerRadius="4" >
                            <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6"  Click="lvoClick">
                              <Grid RowDefinitions="*,Auto,Auto"
                                  VerticalAlignment="Center" HorizontalAlignment="Center" Classes="lvo" Tag="2">
                                <TextBlock Grid.Row="0" FontSize="19"  Text="3" Foreground="#231F20"
                                   VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border Grid.Row="2"
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                              </Grid>
                            </Button>

                          </Border>

                          <!-- Fourth row: PASSIVE -->
                          <Border
                                    CornerRadius="4" >
                            <Button Width="40" Height="54" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6"  Click="lvoClick">
                              <Grid RowDefinitions="*,Auto,Auto"
                                  VerticalAlignment="Center" HorizontalAlignment="Center" Classes="lvo" Tag="3">
                                <TextBlock Grid.Row="0" FontSize="19"  Text="4" Foreground="#231F20"
                                   VerticalAlignment="Top" HorizontalAlignment="Center"/>
                                <TextBlock Grid.Row="1" FontSize="19" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border Grid.Row="2"
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>


                              </Grid>
                            </Button>

                          </Border>


                        </StackPanel>

                        <!-- Bottom label -->
                        <TextBlock Text="LOW VOLT OUTPUTS"
                                   Foreground="#A4A2A3"
                                   FontSize="17"
                                   TextWrapping="Wrap"
                                   HorizontalAlignment="Left"
                                   Margin="6,6,0,0"
                   />
                      </StackPanel>

                      <StackPanel Orientation="Horizontal" Grid.Column="1" Spacing="9">
                        <!-- Fifth row: ACTIVE -->
                        <StackPanel Spacing="3">
                          <Border
                                               CornerRadius="4" >
                            <Button Width="40" Height="44" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6"  Click="lvoClick">
                              <StackPanel Orientation="Vertical" Spacing="-3" Classes="lvo" Tag="5">
                                <TextBlock   FontSize="19"  Text="6" Foreground="#231F20"
                 HorizontalAlignment="Center"/>
                                <TextBlock   FontSize="15.7" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-3,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border 
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>
                              </StackPanel>
                    
                            </Button>

                          </Border>
                          <Border
                                               CornerRadius="4" >
                            <Button Width="40" Height="44" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6"  Click="lvoClick">
                              <StackPanel Orientation="Vertical" Spacing="-3" Classes="lvo" Tag="4">
                                <TextBlock   FontSize="19"  Text="5" Foreground="#231F20"
                 HorizontalAlignment="Center"/>
                                <TextBlock   FontSize="15.7" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-3,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>
                              </StackPanel>

                            </Button>

                          </Border>
                        </StackPanel>




                        <!-- Sixth row: ACTIVE -->
                        <StackPanel Spacing="3" >
                          <Border
                                               CornerRadius="4" >
                            <Button Width="40" Height="44" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6"  Click="lvoClick">
                              <StackPanel Orientation="Vertical" Spacing="-3" Classes="lvo" Tag="7">
                                <TextBlock   FontSize="19"  Text="8" Foreground="#231F20"
                 HorizontalAlignment="Center"/>
                                <TextBlock   FontSize="15.7" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-3,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>
                              </StackPanel>

                            </Button>

                          </Border>
                          <Border
                                               CornerRadius="4" >
                            <Button Width="40" Height="44" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6"  Click="lvoClick">
                              <StackPanel Orientation="Vertical" Spacing="-3" Classes="lvo" Tag="6">
                                <TextBlock   FontSize="19"  Text="7" Foreground="#231F20"
                 HorizontalAlignment="Center"/>
                                <TextBlock   FontSize="15.7" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-3,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>
                              </StackPanel>

                            </Button>

                          </Border>
                        </StackPanel>
                        <!-- Seventh row: ACTIVE -->
                        <StackPanel Spacing="3" >
                          <Border
                                               CornerRadius="4" >
                            <Button Width="40" Height="44" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6"  Click="lvoClick">
                              <StackPanel Orientation="Vertical" Spacing="-3" Classes="lvo" Tag="9">
                                <TextBlock   FontSize="19"  Text="10" Foreground="#231F20"
                 HorizontalAlignment="Center"/>
                                <TextBlock   FontSize="15.7" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-3,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>
                              </StackPanel>

                            </Button>

                          </Border>
                          <Border
                                               CornerRadius="4" >
                            <Button Width="40" Height="44" Padding="0" HorizontalAlignment="Center" Background="#E6E6E6"  Click="lvoClick">
                              <StackPanel Orientation="Vertical" Spacing="-3" Classes="lvo" Tag="8">
                                <TextBlock   FontSize="19"  Text="9" Foreground="#231F20"
                 HorizontalAlignment="Center"/>
                                <TextBlock   FontSize="15.7" Text="OFF" Foreground="#231F20"
                                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,-3,0,0"/>
                                <!-- Colored bar on the right -->
                                <Border
                                        Width="32" Height="5"
                                        Background="#666666"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Bottom" CornerRadius="5" Margin="0,0,0,0"/>
                              </StackPanel>

                            </Button>

                          </Border>
                        </StackPanel>

                      </StackPanel>
                    </Grid>
                    <StackPanel  Orientation="Vertical">

                      <StackPanel Orientation="Horizontal" Spacing="7">




                      </StackPanel>




                    </StackPanel>


                  </Grid>





                </Border>
              </Grid>
              <Grid Grid.Column="1"   Margin="0,0,0,0">
                <Border Grid.Column="1"  Width="91" Height="82" Background="#F9F9F9" VerticalAlignment="Top"
                    CornerRadius="5" Padding="4,0"
                      Margin="0,0,0,0">
                  <StackPanel Orientation="Vertical" Spacing="0">
                    <StackPanel Orientation="Horizontal" Spacing="5" Margin="0,0,0,0">

                      <TextBlock x:Name="ExtPwr" Text="0" FontSize="20" Foreground="#AF196F" HorizontalAlignment="Center" Margin="3,0,0,0"/>
                      <TextBlock  Foreground="#231F20" Text="VDC" FontSize="20" HorizontalAlignment="Center" Margin="0,0,0,0"/>
                    </StackPanel>
                    <!-- Bottom text -->
                    <StackPanel Orientation="Vertical" Spacing="-5">
                      <TextBlock Text="EXTERNAL"
                               Foreground="#918f90"
                               FontSize="16"
                               TextWrapping="Wrap"
                               HorizontalAlignment="Center"
                   />
                      <TextBlock Text="POWER"
                               Foreground="#918f90"
                               FontSize="16"
                               TextWrapping="Wrap"
                               HorizontalAlignment="Center"
                   />
                      <TextBlock Text="VOLTAGE"
                               Foreground="#918f90"
                               FontSize="16"
                               TextWrapping="Wrap"
                               HorizontalAlignment="Center"
                   />
                    </StackPanel>

                  </StackPanel>
                </Border>
              </Grid>
              <Grid Grid.Column="2" Margin="0,0,25,0">
                <Grid Grid.Column="2" Height="50" Width="14" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="5,0,0,0">
                  <Grid.Background>
                    <ImageBrush  Source="/Assets/RedUpArrow.png"/>
                  </Grid.Background>
                </Grid>
              </Grid>

            </Grid>
       
            
            
         

          </Grid>
          <Grid Grid.Column="3" >

          </Grid>
        </Grid>
      </Grid>
      <!--right col-->
      <Grid Grid.Column="2" 
            RowDefinitions="0.9*,3*,*">
        <Grid Grid.Row="0" ></Grid>
        <Grid Grid.Row="1" >
          <StackPanel Orientation="Vertical" VerticalAlignment="Top" Spacing="5">
            <!-- Right arrow -->
            <Grid Height="14" Width="50"   Margin="0,0,0,0">
              <Grid.Background>
                <ImageBrush  Source="/Assets/LeftArrow.png"/>
              </Grid.Background>
            </Grid>
            <!--Power Input-->
            <Border  CornerRadius="5" VerticalAlignment="Top" Width="147" Height="125" Margin="3,0,0,0" Padding="0" Background="#F9F9F9">
              <StackPanel>
                <!-- Top label -->
                <TextBlock Text="POWER INPUT"
                           Foreground="#A4A2A3"
                           FontSize="17"
                           TextWrapping="Wrap"
                           HorizontalAlignment="Center"
                         
                   />
                <StackPanel Spacing="5">
                  <!-- First row: ACTIVE -->
                  <Border
                    Width="141" Height="52"
                          CornerRadius="4"
                          Background="#E6E6E6"
                    Padding="5,0,0,0"
                >
                    <Button Width="141" Height="52" Padding="0,0,5,0" Margin="0" HorizontalAlignment="Center" Background="Transparent">
                      <Grid RowDefinitions="*,*,*">
                        <Grid Grid.Row="0">
                          <Grid>
                            <Grid.ColumnDefinitions>
                              <ColumnDefinition Width="Auto"/>
                              <ColumnDefinition Width="*"/>
                              <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Foreground="#231F20" Text="VAC Ph1: " FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0"/>
                            <TextBlock x:Name="ph1" Grid.Column="1" Text="0" FontSize="16.5" Foreground="#AF196F" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="2" Foreground="#231F20" Text="V" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                          </Grid>
                        </Grid>
                        <Grid Grid.Row="1">
                          <Grid>
                            <Grid.ColumnDefinitions>
                              <ColumnDefinition Width="Auto"/>
                              <ColumnDefinition Width="*"/>
                              <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Foreground="#231F20" Text="VAC Ph2:" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0"/>
                            <TextBlock x:Name="ph2" Grid.Column="1" Text="0" FontSize="16.5" Foreground="#AF196F" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="2" Foreground="#231F20" Text="V" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                          </Grid>
                        </Grid>
                        <Grid Grid.Row="2">
                          <Grid>
                            <Grid.ColumnDefinitions>
                              <ColumnDefinition Width="Auto"/>
                              <ColumnDefinition Width="*"/>
                              <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Foreground="#231F20" Text="VAC Ph3:" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0"/>
                            <TextBlock x:Name="ph3" Grid.Column="1" Text="0" FontSize="16.5" Foreground="#AF196F" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="2" Foreground="#231F20" Text="V" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                          </Grid>
                        </Grid>
                      </Grid>

                    </Button>

                  </Border>

                  <!-- Second row: ACTIVE -->
                  <Border
                    Width="141" Height="20"
                          CornerRadius="4"
                          Background="#E6E6E6"
                    Padding="5,0,0,0"
                >
                    <StackPanel Orientation="Vertical" Spacing="-8">
                      <Button Width="141" Height="20" Padding="0,0,5,0" Margin="" HorizontalAlignment="Center"  Background="Transparent">
                        <Grid>
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                          </Grid.ColumnDefinitions>
                          <TextBlock Grid.Column="0" Foreground="#231F20" Text="I-Neutral:" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0"/>
                          <TextBlock x:Name="i_nut" Grid.Column="1" Text="0.0" FontSize="16.5" Foreground="#AF196F" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                          <TextBlock Grid.Column="2" Foreground="#231F20" Text="A" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Grid>
                      </Button>
                    </StackPanel>
                  </Border>
                  <!-- third row: ACTIVE -->
                  <Border
                    Width="141" Height="20"
                          CornerRadius="4"
                          Background="#E6E6E6"
                    Padding="5,0,0,0"
                >
                    <StackPanel Orientation="Vertical" Spacing="-8">
                      <Button Width="141" Height="20" Padding="0,0,3,0" Margin="" HorizontalAlignment="Center" Background="Transparent">
                        <Grid>
                          <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                          </Grid.ColumnDefinitions>
                          <TextBlock Grid.Column="0" Foreground="#231F20" Text="Grid Freq:" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0"/>
                          <TextBlock x:Name="gridFreq" Grid.Column="1" Text="0.0" FontSize="16.5" Foreground="#AF196F" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                          <TextBlock Grid.Column="2" Foreground="#231F20" Text="Hz" FontSize="16.5" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Grid>
                      </Button>
                    </StackPanel>
                  </Border>

                </StackPanel>
              </StackPanel>








            </Border>
            <!--Error Falgs-->
            <Border  CornerRadius="5" VerticalAlignment="Top" Width="148" Height="211" BorderBrush="#FE3636" BorderThickness="1" Margin="3,0,0,0" Padding="3,5,3,1" Background="#F9F9F9">
              <Grid ColumnDefinitions="*">
                <Grid Grid.Column="0" RowDefinitions="*,Auto">
                  <Grid Grid.Row="0">
                    <StackPanel Orientation="Vertical" >
                      <!-- Top label -->
                      <TextBlock Text="BOARD FLAGS"
                                 FontSize="17"
                                 Foreground="#FE3636"
                                 HorizontalAlignment="Center"
                   />
                      <StackPanel Spacing="2" Orientation="Vertical">
                        <!-- First row: ACTIVE -->
                        <Border
                          Width="141" Height="36"
                                CornerRadius="4"
                                Background="#E6E6E6"
                          Padding="5,0,0,0"
                >
                          <StackPanel Orientation="Vertical" Spacing="-8">
                            <Button Width="141" Height="36" Padding="0" Margin="0" HorizontalAlignment="Center" Background="Transparent">
                              <Grid RowDefinitions="*,*">
                                <Grid Grid.Row="0">
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto"/>
                                      <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="ComPort1" Foreground="#020202"
                                  VerticalAlignment="Center" FontSize="17"/>
                                    <Rectangle
                                      Classes="flag" Tag="1"
                                      Grid.Column="1" RadiusX="4" RadiusY="4" Width="12" Height="12" Fill="#666666" HorizontalAlignment="Right" Margin="0,0,5,0"  ></Rectangle>
                                  </Grid>
                                </Grid>
                                <Grid Grid.Row="1">
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto"/>
                                      <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="ComPort2" Foreground="#020202"
                                  VerticalAlignment="Center" FontSize="17"/>
                                    <Rectangle  Classes="flag" Tag="2" Grid.Column="1" RadiusX="4" RadiusY="4" Width="12" Height="12" Fill="#666666" HorizontalAlignment="Right" Margin="0,0,5,0"  ></Rectangle>
                                  </Grid>
                                </Grid>
                              </Grid>

                            </Button>
                          </StackPanel>
                        </Border>

                        <!-- Second row: ACTIVE -->
                        <Border
                          Width="141" Height="20"
                                CornerRadius="4"
                                Background="#E6E6E6"
                          Padding="5,0,0,0"
                >
                          <StackPanel Orientation="Vertical" Spacing="-8">
                            <Button Width="141" Height="20" Padding="0" Margin="0" HorizontalAlignment="Center" Background="Transparent">
                              <Grid RowDefinitions="*">
                                <Grid Grid.Row="0">
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto"/>
                                      <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="NoExtPower" Foreground="#020202"
                                  VerticalAlignment="Center" FontSize="17"/>
                                    <Rectangle  Classes="flag"  Tag="3"  Grid.Column="1" RadiusX="4" RadiusY="4" Width="12" Height="12" Fill="#666666" HorizontalAlignment="Right" Margin="0,0,5,0"  ></Rectangle>
                                  </Grid>
                                </Grid>
                              </Grid>

                            </Button>

                          </StackPanel>
                        </Border>
                        <!-- third row: ACTIVE -->
                        <Border
                          Width="141" Height="36"
                                CornerRadius="4"
                                Background="#E6E6E6"
                          Padding="5,0,0,0"
                          x:Name="phaseContainer">
                          <StackPanel Orientation="Vertical" Spacing="-8">
                            <Button Width="141" Height="36" Padding="0" Margin="0" HorizontalAlignment="Center" Background="Transparent">
                              <Grid RowDefinitions="*,*">
                                <Grid Grid.Row="0">
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto"/>
                                      <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="PhaseSequ" Foreground="#020202"
                                  VerticalAlignment="Center" FontSize="17"/>
                                    <Rectangle  Classes="flag"  Tag="4" Grid.Column="1" RadiusX="4" RadiusY="4" Width="12" Height="12" Fill="#666666" HorizontalAlignment="Right" Margin="0,0,5,0"  ></Rectangle>
                                  </Grid>
                                </Grid>
                                <Grid Grid.Row="1">
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto"/>
                                      <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="PhaseLack" Foreground="#020202"
                                  VerticalAlignment="Center" FontSize="17"/>
                                    <Rectangle  Classes="flag"  Tag="5" Grid.Column="1" RadiusX="4" RadiusY="4" Width="12" Height="12" Fill="#666666" HorizontalAlignment="Right" Margin="0,0,5,0"  ></Rectangle>
                                  </Grid>
                                </Grid>
                              </Grid>

                            </Button>
                          </StackPanel>
                        </Border>
                        <!-- forth row: ACTIVE -->
                        <Border
                          Width="141" Height="52"
                                CornerRadius="4"
                                Background="#E6E6E6"
                          Padding="5,0,0,0"
                >
                          <StackPanel Orientation="Vertical" Spacing="-8">
                            <Button Width="141" Height="52" Padding="0" Margin="0" HorizontalAlignment="Center" Background="Transparent">
                              <Grid RowDefinitions="*,*,*">
                                <Grid Grid.Row="0">
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto"/>
                                      <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="HiCurrNeut" Foreground="#020202"
                                  VerticalAlignment="Center" FontSize="17"/>
                                    <Rectangle  Classes="flag"  Tag="6" Grid.Column="1" RadiusX="4" RadiusY="4" Width="12" Height="12" Fill="#666666" HorizontalAlignment="Right" Margin="0,0,5,0"  ></Rectangle>
                                  </Grid>
                                </Grid>
                                <Grid Grid.Row="1">
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto"/>
                                      <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="HiCurrMot1" Foreground="#020202"
                                  VerticalAlignment="Center" FontSize="17"/>
                                    <Rectangle  Classes="flag"  Tag="7" Grid.Column="1" RadiusX="4" RadiusY="4" Width="12" Height="12" Fill="#666666" HorizontalAlignment="Right" Margin="0,0,5,0"  ></Rectangle>
                                  </Grid>
                                </Grid>
                                <Grid Grid.Row="2">
                                  <Grid>
                                    <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="Auto"/>
                                      <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="HiCurrMot2" Foreground="#020202"
                                  VerticalAlignment="Center" FontSize="17"/>
                                    <Rectangle  Classes="flag"  Tag="8" Grid.Column="1" RadiusX="4" RadiusY="4" Width="12" Height="12" Fill="#666666" HorizontalAlignment="Right" Margin="0,0,5,0"  ></Rectangle>
                                  </Grid>
                                </Grid>
                              </Grid>

                            </Button>
                          </StackPanel>
                        </Border>
                      </StackPanel>
              

                    </StackPanel>
                  </Grid>
                  <Grid Grid.Row="1" >
                    <!--Rest Button-->
                    <Button Width="141" Height="20" Content="RESET ERRORS" Background="#FF5555" Padding="0,0,0,0"
                VerticalAlignment="Center"
                            FontSize="16"
                HorizontalContentAlignment="Center"
                            VerticalContentAlignment="Center"
                            Foreground="#FFFFFF" Click="resetErrorClick">
                      <Button.Styles>
                        <Style Selector="Button:pointerover /template/ContentPresenter">
                          <Setter Property="Foreground" Value="#FFFFFF"></Setter>
                          <Setter Property="Background" Value="#FF0000"></Setter>

                        </Style>
                      </Button.Styles>

                      <TextBlock FontSize="16" >RESET ERRORS</TextBlock>
                    </Button>
                  </Grid>
                </Grid>
              </Grid>
              








            </Border>
          </StackPanel>



        </Grid>
        <Grid Grid.Row="2" >
          <Border 
            Background="#f9f9f9"
            CornerRadius="5"
            Width="148"
            Height="51"
            BorderBrush="#008000"
            BorderThickness="1.5"
            Padding="5"
            VerticalAlignment="Top"
            Margin="3,0,0,0">
            <StackPanel>
              <TextBlock
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Foreground="#ff0000"
                FontSize="16"
                FontWeight="Medium">CALIP. Not Done</TextBlock>
              <Button
                Width="141"
                Height="20"
                Background="#008000"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                HorizontalContentAlignment="Center"
                VerticalContentAlignment="Center"
                Foreground="#ffffff"
                FontSize="15.5"
                Padding="0"
                Content="CALIPRATE">
                
              </Button>
            </StackPanel>
          </Border>
        </Grid>
      </Grid>
    </Grid>



    <!-- Overlay Background for Calibration Popup -->
    <Border x:Name="calibrationPopupOverlay" Background="#80000000" Grid.RowSpan="3" IsVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ZIndex="99"  PointerPressed="">
      <!-- Popup User Control -->

      <!-- Module for Name Entry -->
      <Grid  PointerPressed="" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20" IsVisible="True">
        <Border Background="White" CornerRadius="10" Padding="10" BorderThickness="1"  ZIndex="101" BorderBrush="#CCC">
          <StackPanel Spacing="5">
            <!-- Label for Text Input -->
            <!-- Label -->

            <TextBlock Text="Calibration Done/Not Done"
                 FontSize="20"
                 FontWeight="Bold"
                 Foreground="#ff0000"
                       HorizontalAlignment="Center"
                 Margin="0,0,0,8" />
            <Grid RowDefinitions="*" Background="Red">
              <Grid Grid.Row="0" ColumnDefinitions="Auto,Auto">
                <!--col 1-->
                <Grid Grid.Column="0" Background="Yellow" RowDefinitions="*,*" Margin="5" >
                  <Grid Grid.Row="0" >
                    <StackPanel Orientation="Horizontal" Spacing="5">
                      <TextBlock VerticalAlignment="Center"
                                 FontSize="20"
                                 Foreground="#ff0000" Margin="0,0,5,0">Temp Max:</TextBlock>
                      <Button Width="50"
                              Height="50"
                              Background="#E6E6E6"
                              HorizontalContentAlignment="Center"
                              VerticalContentAlignment="Center"
                              FontSize="20"
                               Padding="0">
                        1
                      </Button>
                      <Button Width="50"
                           Height="50"
                           Background="#E6E6E6"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           FontSize="20"
                         Padding="0">
                        2
                      </Button>
                      <Button Width="50"
                           Height="50"
                           Background="#E6E6E6"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           FontSize="20"
                               Padding="0">
                        3
                      </Button>
                      <Button Width="50"
                           Height="50"
                           Background="#E6E6E6"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           FontSize="20"
                               Padding="0">
                        4
                      </Button>
                      <Button Width="50"
                           Height="50"
                           Background="#E6E6E6"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           FontSize="20"
                              Padding="0">
                        ALL
                      </Button>
                    </StackPanel>

                  </Grid>
                  <Grid Grid.Row="1" >
                    <StackPanel Orientation="Horizontal" Spacing="5">
                      <TextBlock VerticalAlignment="Center"
                                 FontSize="20"
                                 
Foreground="#0000aa"                                  Margin="0,0,12,0">Temp Min:</TextBlock>
                      <Button Width="50"
                              Height="50"
                              Background="#E6E6E6"
                              HorizontalContentAlignment="Center"
                              VerticalContentAlignment="Center"
                              FontSize="20"
                               Padding="0">
                        1
                      </Button>
                      <Button Width="50"
                           Height="50"
                           Background="#E6E6E6"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           FontSize="20"
                         Padding="0">
                        2
                      </Button>
                      <Button Width="50"
                           Height="50"
                           Background="#E6E6E6"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           FontSize="20"
                               Padding="0">
                        3
                      </Button>
                      <Button Width="50"
                           Height="50"
                           Background="#E6E6E6"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           FontSize="20"
                               Padding="0">
                        4
                      </Button>
                      <Button Width="50"
                           Height="50"
                           Background="#E6E6E6"
                           HorizontalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           FontSize="20"
                              Padding="0">
                        ALL
                      </Button>
                    </StackPanel>
                  </Grid>
                </Grid>
                <!--col 2-->
                <Grid Grid.Column="1" >
                  <StackPanel HorizontalAlignment="Center"
                              VerticalAlignment="Center"
Width="130">
           
                    <TextBlock 
                      FontSize="20"                           Margin="0,0,11,0"
                      HorizontalAlignment="Center">Currents</TextBlock>
                    <TextBlock 
                      FontSize="20"
                                                 Margin="0,0,11,0"
                      HorizontalAlignment="Center"
>Calibration:</TextBlock>
                    
                    <Button Width="50"
                              Height="50"
                              Background="#E6E6E6"
                              HorizontalContentAlignment="Center"
                              VerticalContentAlignment="Center"
                            HorizontalAlignment="Center"
                              FontSize="20"
                               Padding="0"
                            Margin="0,0,10,0">
                      1
                    </Button>
                  </StackPanel>
                 
                </Grid>
              </Grid>
            </Grid>

            <!-- Button Panel -->
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="10">
              <!-- Close Button -->
              <Button
                      Content="Close"
                      FontSize="16"
                      Padding="10,5"
                      Background="Gray"
                      Foreground="White"
                 Click="">
                <Button.Styles>
                  <Style Selector="Button.SpecialButtonStyle:pointerover /template/ContentPresenter">
                    <Setter Property="Background" Value="Gray"/>
                    <Setter Property="Foreground" Value="White"/>
                  </Style>
                </Button.Styles>
              </Button>
            </StackPanel>
          </StackPanel>
        </Border>
      </Grid>
    </Border>

    <!--number keyBoard-->
    <Border x:Name="keyBoardPopup"
         Background="#80000000"
         HorizontalAlignment="Stretch"
         VerticalAlignment="Stretch"
         IsVisible="False"
         ZIndex="50"
         PointerPressed="OnPopupOverlayPointerPressed">
      <Grid MaxWidth="500" MaxHeight="500" HorizontalAlignment="Center" VerticalAlignment="Center"
            Margin="0,0,0,0"
            PointerPressed="InnerPopupPointerPressed">
        <Border x:Name="PopupControl"
                BorderThickness="2"
                CornerRadius="10"
                Padding="10"
                PointerPressed="InnerPopupPointerPressed">
          <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Spacing="10">
            <!-- Popup Content (Keypad etc.) -->
            <Grid IsVisible="True">
              <Grid.Styles>
                <Style Selector="Button">
                  <Setter Property="Background" Value="White"/>
                  <Setter Property="CornerRadius" Value="20"/>
                  <Setter Property="Width" Value="100"/>
                  <Setter Property="Height" Value="100"/>
                  <Setter Property="FontSize" Value="50"/>
                  <Setter Property="Foreground" Value="Black"/>
                  <Setter Property="VerticalContentAlignment" Value="Center"/>
                  <Setter Property="HorizontalContentAlignment" Value="Center"/>
                </Style>
                <Style Selector="Button:pointerover /template/ContentPresenter">
                  <Setter Property="Foreground" Value="Black"/>
                  <Setter Property="Background" Value="White"/>
                  <Setter Property="CornerRadius" Value="20"/>
                  <Setter Property="RenderTransform" Value="scale(1.11)"/>
                </Style>
              </Grid.Styles>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
              </Grid.RowDefinitions>
              <Grid Grid.Row="1" Margin="10">
                <Grid.RowDefinitions>
                  <RowDefinition Height="1*"/>
                  <RowDefinition Height="1*"/>
                  <RowDefinition Height="1*"/>
                  <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="1*"/>
                  <ColumnDefinition Width="1*"/>
                  <ColumnDefinition Width="1*"/>
                  <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <!-- Keypad Buttons -->
                <Button Content="1" Grid.Row="0" Grid.Column="0" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="2" Grid.Row="0" Grid.Column="1" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="3" Grid.Row="0" Grid.Column="2" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="4" Grid.Row="1" Grid.Column="0" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="5" Grid.Row="1" Grid.Column="1" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="6" Grid.Row="1" Grid.Column="2" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="7" Grid.Row="2" Grid.Column="0" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="8" Grid.Row="2" Grid.Column="1" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="9" Grid.Row="2" Grid.Column="2" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button Content="BACK" Grid.Row="3" Grid.Column="0" FontSize="20" Background="#D3D3D3" Margin="5" Click="OnBackClick"/>
                <Button Content="0" Grid.Row="3" Grid.Column="1" FontSize="24" Background="White" Margin="5" Click="OnKeyClick"/>
                <Button x:Name="enterBtn" Content="ENTER" Grid.Row="3" Grid.Column="2" FontSize="20" Background="#A4275D" Foreground="White" Margin="5" Click="EnterClick"/>
                <Button Content="-" Grid.Row="3" Grid.Column="3" FontSize="50" Background="White" Foreground="Black" 
                         Margin="5" Click="OnKeyClick"/>
                <Button Content="+" Grid.Row="2" Grid.Column="3" FontSize="50" Background="White" Foreground="Black"
                         Margin="5" Click="OnKeyClick"/>
                <Button Content="." Grid.Row="1" Grid.Column="3" FontSize="50" Background="White" Foreground="Black"
                        Margin="5" Click="OnKeyClick"/>
              </Grid>
            </Grid>
          </StackPanel>
        </Border>
      </Grid>
    </Border>


	  <!-- Overlay Background for Delet Popup -->
	  <Border x:Name="innerPidPopupOverlay" Background="#80000000" Grid.RowSpan="3" IsVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ZIndex="99"  PointerPressed="OnIgnoreInnerPidPopupOverlayPointerPressed">
		  <!-- Popup User Control -->

		  <!-- Module for Name Entry -->
		  <Grid  PointerPressed="InnerPopupPointerPressed" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="20" IsVisible="True">
			  <Border Background="White" CornerRadius="10" Padding="20" BorderThickness="1"  ZIndex="101" BorderBrush="#CCC">
				  <StackPanel Spacing="15">
					  <!-- Label for Text Input -->
					  <!-- Label -->

					  <TextBlock x:Name="header" Tag="0" Text="PID T-1  FACTORS"
						   FontSize="20"
						   FontWeight="Bold"
						   Foreground="#A4275D"
						   Margin="0,0,0,8" />
					  <StackPanel Spacing="5" Margin="0,0,0,30">
                          <!-- Add button styles at the top of the StackPanel -->
              <StackPanel.Styles>
                <Style Selector="Button.circleButton">
                  <Setter Property="Width" Value="32"/>
                  <Setter Property="Height" Value="32"/>
                  <Setter Property="Background" Value="#E6E6E6"/>
                  <Setter Property="BorderThickness" Value="0"/>
                  <Setter Property="CornerRadius" Value="16"/>
                  <Setter Property="Foreground" Value="#af196f"/>
                  <Setter Property="FontSize" Value="25"/>
                  <Setter Property="FontWeight" Value="Normal"/>
                  <Setter Property="HorizontalContentAlignment" Value="Center"/>
                  <Setter Property="VerticalContentAlignment" Value="Center"/>
                  <Setter Property="Padding" Value="0"/>
                  <Setter Property="Template">
                    <ControlTemplate>
                      <Border Background="{TemplateBinding Background}"
                              BorderBrush="{TemplateBinding BorderBrush}"
                              BorderThickness="{TemplateBinding BorderThickness}"
                              CornerRadius="{TemplateBinding CornerRadius}">
                        <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
                          <TextBlock Text="{TemplateBinding Content}"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center"
                                   FontSize="{TemplateBinding FontSize}"
                                   Foreground="{TemplateBinding Foreground}"
                                   FontWeight="{TemplateBinding FontWeight}"
                                   TextAlignment="Center"
                                   Margin="0,0,0,2"/>
                        </Grid>
                      </Border>
                    </ControlTemplate>
                  </Setter>
                </Style>
              </StackPanel.Styles>

              <!-- KP Control -->
              <StackPanel Orientation="Horizontal">
                <TextBlock Text="KP: " 
                          FontSize="16"
                          FontWeight="Bold"
                          Foreground="#333"
                          Margin="5,0"/>
                <TextBlock FontSize="16" 
                          FontWeight="Bold" 
                          x:Name="kpSliderValue"  
                          Margin="0,0,0,0" 
                          Foreground="Black"
                          MinWidth="30"
                          TextAlignment="Left">0</TextBlock>
              </StackPanel>

              <Grid ColumnDefinitions="Auto,*,Auto" Margin="5,0">
                <Button Grid.Column="0"
                    Content="–"
                    Classes="circleButton"
                    Click="KpMinusClick"
                    x:Name="kpMinusBtn"/>
                
                <Slider Grid.Column="1" 
                    x:Name="kpSlider" 
                    Minimum="0" 
                    Maximum="100"
                    TickFrequency="1"
                    IsSnapToTickEnabled="True"
                    Margin="10,0"
                    ValueChanged="KpSliderValueChanged"/>
                
                <Button Grid.Column="2"
                    Content="+"
                    Classes="circleButton"
                    Click="KpPlusClick"
                    x:Name="kpPlusBtn"/>
              </Grid>

              <!-- KI Control -->
              <StackPanel Orientation="Horizontal">
                <TextBlock Text="KI: " 
                          FontSize="16"
                          FontWeight="Bold"
                          Foreground="#333"
                          Margin="5,0"/>
                <TextBlock FontSize="16" 
                          FontWeight="Bold" 
                          x:Name="kiSliderValue"  
                          Margin="0,0,0,0" 
                          Foreground="Black"
                          MinWidth="30"
                          TextAlignment="Left">0</TextBlock>
              </StackPanel>

              <Grid ColumnDefinitions="Auto,*,Auto" Margin="5,0">
                <Button Grid.Column="0"
                    Content="–"
                    Classes="circleButton"
                    Click="KiMinusClick"
                    x:Name="kiMinusBtn"/>
                
                <Slider Grid.Column="1" 
                    x:Name="kiSlider" 
                    Minimum="0" 
                    Maximum="100"
                    TickFrequency="1"
                    IsSnapToTickEnabled="True"
                    Margin="10,0"
                    ValueChanged="KiSliderValueChanged"/>
                
                <Button Grid.Column="2"
                    Content="+"
                    Classes="circleButton"
                    Click="KiPlusClick"
                    x:Name="kiPlusBtn"/>
              </Grid>

              <!-- KD Control -->
              <StackPanel Orientation="Horizontal">
                <TextBlock Text="KD: " 
                          FontSize="16"
                          FontWeight="Bold"
                          Foreground="#333"
                          Margin="5,0"/>
                <TextBlock FontSize="16" 
                          FontWeight="Bold" 
                          x:Name="kdSliderValue"  
                          Margin="0,0,0,0" 
                          Foreground="Black"
                          MinWidth="30"
                          TextAlignment="Left">0</TextBlock>
              </StackPanel>

              <Grid ColumnDefinitions="Auto,*,Auto" Margin="5,0">
                <Button Grid.Column="0"
                    Content="–"
                    Classes="circleButton"
                    Click="KdMinusClick"
                    x:Name="kdMinusBtn"/>
                
                <Slider Grid.Column="1" 
                    x:Name="kdSlider" 
                    Minimum="0" 
                    Maximum="100"
                    TickFrequency="1"
                    IsSnapToTickEnabled="True"
                    Margin="10,0"
                    ValueChanged="KdSliderValueChanged"/>
                
                <Button Grid.Column="2"
                    Content="+"
                    Classes="circleButton"
                    Click="KdPlusClick"
                    x:Name="kdPlusBtn"/>
              </Grid>

              <!-- KL Control -->
              <StackPanel Orientation="Horizontal">
                <TextBlock Text="KL: " 
                          FontSize="16"
                          FontWeight="Bold"
                          Foreground="#333"
                          Margin="5,0"/>
                <TextBlock FontSize="16" 
                          FontWeight="Bold" 
                          x:Name="klSliderValue"  
                          Margin="0,0,0,0" 
                          Foreground="Black"
                          MinWidth="30"
                          TextAlignment="Left">0</TextBlock>
              </StackPanel>

              <Grid ColumnDefinitions="Auto,*,Auto" Margin="5,0">
                <Button Grid.Column="0"
                    Content="–"
                    Classes="circleButton"
                    Click="KlMinusClick"
                    x:Name="klMinusBtn"/>
                
                <Slider Grid.Column="1" 
                    x:Name="klSlider" 
                    Minimum="0" 
                    Maximum="100"
                    TickFrequency="1"
                    IsSnapToTickEnabled="True"
                    Margin="10,0"
                    ValueChanged="KlSliderValueChanged"/>
                
                <Button Grid.Column="2"
                    Content="+"
                    Classes="circleButton"
                    Click="KlPlusClick"
                    x:Name="klPlusBtn"/>
              </Grid>

              <TextBlock Text="PID Activation Threshold (°C)"
		 FontSize="16"
		 FontWeight="Bold"
		 Foreground="#333"
		 Margin="5,0"
              />
			  <Border  Name="heatConRangeBorder" >
				  <TextBox Name="heatConRange"
						   KeyUp="OnKeyUp"></TextBox>
			  </Border>
			  <TextBlock Text="Fast Cooling Threshold (°C)"
		  FontSize="16"
		  FontWeight="Bold"
		  Foreground="#333"
		  Margin="5,0"
              />
			  <Border  Name="fcThresholdBorder" >
				  <TextBox Name="fcThreshold"
						   KeyUp="OnKeyUp"></TextBox>
			  </Border>
            </StackPanel>





					  <!-- Button Panel -->
					  <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Spacing="10" Margin="0,-45,0,0">
						  <!-- yes Button -->
						  <Button
							x:Name="okBtn"
								  Content="OK"
								  FontSize="16"
								  Padding="10,5"
								  Click="YesBtnClick"
								  Width="75"
								  Foreground="White"
								  HorizontalContentAlignment="Center">
							  <Button.Background>
								  <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
									  <GradientStop Color="#A4275D" Offset="0" />
									  <GradientStop Color="#A4275D" Offset="1" />
								  </LinearGradientBrush>
							  </Button.Background>
							  <Button.Styles>
								  <Style Selector="Button.SpecialButtonStyle:pointerover /template/ContentPresenter">
									  <Setter Property="Background" Value="#A4275D"/>
									  <Setter Property="Foreground" Value="White"/>
								  </Style>
							  </Button.Styles>

						  </Button>
						  <!-- No Button -->
						  <Button
								  Content="Cancel"
								  FontSize="16"
								  Padding="10,5"
								  Background="Gray"
								  Foreground="White"
								  Width="75"
							 Click="OnIgnoreInnerPidPopupOverlayPointerPressed">
							  <Button.Styles>
								  <Style Selector="Button.SpecialButtonStyle:pointerover /template/ContentPresenter">
									  <Setter Property="Background" Value="Gray"/>
									  <Setter Property="Foreground" Value="White"/>
								  </Style>
							  </Button.Styles>
						  </Button>
					  </StackPanel>
				  </StackPanel>
			  </Border>
		  </Grid>
	  </Border>

	  <!-- Overlay Background for Delet Popup -->
	  <Border x:Name="pidPopupOverlay" Background="#80000000" Grid.RowSpan="3" IsVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ZIndex="99"  PointerPressed="OnIgnorePidPopupOverlayPointerPressed">
		  <!-- Popup User Control -->

		  <!-- Module for Name Entry -->
		  <Grid  PointerPressed="InnerPopupPointerPressed" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20" IsVisible="True">
			  <Border Background="White" CornerRadius="10" Padding="20" BorderThickness="1"  ZIndex="101" BorderBrush="#CCC">
				  <StackPanel Spacing="15">
					  <!-- Label for Text Input -->
					  <!-- Label -->


					  <TextBlock x:Name="pidHeader" Text="Choose PID FACTOR"
						   FontSize="20"
						   FontWeight="Bold"
						   Foreground="#A4275D"
						   HorizontalAlignment="Center"
						   Margin="0,0,0,8" />
					  <StackPanel Spacing="15">

						  <Border
							   Width="210"
							   Height="40"
							   Background="#e6e6e6"
							   CornerRadius="5" Padding="5">

							  <Button
							   Padding="0"
							   Grid.Column="0"
							   FontSize="22.5"
							   Foreground="#231f20"
							   HorizontalAlignment="Center"
							   Background="Transparent"
							   Content="T-1 SETTINGS"
							   Tag="1"
							   Click="showInnerPid">
							  </Button>
						  </Border>
						  <Border
											 Width="210"
											 Height="40"
											 Background="#e6e6e6"
											 CornerRadius="5" Padding="5">

							  <Button
							   Padding="0"
							   Grid.Column="0"
							   FontSize="22.5"
							   Foreground="#231f20"
							   HorizontalAlignment="Center"
							   Background="Transparent"
							   Tag="2"
							   Content="T-2 SETTINGS"
							   Click="showInnerPid">
							  </Button>
						  </Border>
						  <Border
							   Width="210"
							   Height="40"
							   Background="#e6e6e6"
							   CornerRadius="5" Padding="5">

							  <Button
							   Padding="0"
							   Grid.Column="0"
							   FontSize="22.5"
							   Foreground="#231f20"
							   HorizontalAlignment="Center"
							   Background="Transparent"
							   Tag="3"
							   Content="T-3 SETTINGS"
							   Click="showInnerPid">
							  </Button>

						  </Border>
						  <Border
							   Width="210"
							   Height="40"
							   Background="#e6e6e6"
							   CornerRadius="5" Padding="5">

							  <Button
							   Padding="0"
							   Grid.Column="0"
							   FontSize="22.5"
							   Foreground="#231f20"
							   HorizontalAlignment="Center"
							   Background="Transparent"
							   Tag="4"
							   Content="T-4 SETTINGS"
							   Click="showInnerPid">
							  </Button>
						  </Border>
					  </StackPanel>





					  <!-- Button Panel -->

				  </StackPanel>
			  </Border>
		  </Grid>
	  </Border>


  </Grid>

</UserControl>
