124 lines
5.9 KiB
XML
124 lines
5.9 KiB
XML
<UserControl x:Class="CtrEditor.ObjetosSim.ucHydTank"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:CtrEditor.ObjetosSim"
|
|
xmlns:vm="clr-namespace:CtrEditor.ObjetosSim"
|
|
mc:Ignorable="d">
|
|
|
|
<!-- DataContext se establece desde el objeto padre -->
|
|
|
|
<Canvas RenderTransformOrigin="0,0">
|
|
<Canvas.RenderTransform>
|
|
<TransformGroup>
|
|
<ScaleTransform />
|
|
<SkewTransform />
|
|
<RotateTransform Angle="{Binding Angulo}" />
|
|
<TranslateTransform />
|
|
</TransformGroup>
|
|
</Canvas.RenderTransform>
|
|
|
|
<!-- Contenedor principal del tanque -->
|
|
<Grid Width="{Binding Tamano, Converter={StaticResource MeterToPixelConverter}}"
|
|
Height="{Binding Tamano, Converter={StaticResource MeterToPixelConverter}, ConverterParameter=1.4}">
|
|
|
|
<!-- Fondo del tanque (contenedor vacío) -->
|
|
<Rectangle x:Name="rectTankContainer"
|
|
Fill="#FFE6E6E6"
|
|
Stroke="#FF606060"
|
|
StrokeThickness="3"
|
|
RadiusX="8"
|
|
RadiusY="8">
|
|
<Rectangle.Effect>
|
|
<DropShadowEffect Color="Gray" ShadowDepth="3" Opacity="0.5"/>
|
|
</Rectangle.Effect>
|
|
</Rectangle>
|
|
|
|
<!-- Marco interno del tanque -->
|
|
<Rectangle Fill="Transparent"
|
|
Stroke="#FF404040"
|
|
StrokeThickness="1"
|
|
RadiusX="6"
|
|
RadiusY="6"
|
|
Margin="6"/>
|
|
|
|
<!-- Nivel del líquido -->
|
|
<Rectangle x:Name="rectFluidLevel"
|
|
Fill="{Binding ColorButton_oculto}"
|
|
Stroke="DarkBlue"
|
|
StrokeThickness="1.5"
|
|
RadiusX="4"
|
|
RadiusY="4"
|
|
VerticalAlignment="Bottom"
|
|
Opacity="0.85"
|
|
Margin="8">
|
|
<Rectangle.Height>
|
|
<MultiBinding Converter="{StaticResource TankLevelToHeightConverter}">
|
|
<Binding Path="FillPercentage"/>
|
|
<Binding Path="Tamano" Converter="{StaticResource MeterToPixelConverter}" ConverterParameter="1.2"/>
|
|
</MultiBinding>
|
|
</Rectangle.Height>
|
|
</Rectangle>
|
|
|
|
<!-- Información central del tanque -->
|
|
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Border Background="#AA000000" CornerRadius="4" Padding="6,4">
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<!-- Nivel y porcentaje -->
|
|
<TextBlock Foreground="White" FontSize="10" HorizontalAlignment="Center">
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0:F2}m ({1:F0}%)">
|
|
<Binding Path="CurrentLevel"/>
|
|
<Binding Path="FillPercentage"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<!-- Volumen -->
|
|
<TextBlock Text="{Binding CurrentVolume, StringFormat='{}{0:F0}L'}"
|
|
Foreground="LightCyan" FontSize="8" HorizontalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- Indicadores superiores -->
|
|
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="4,4,0,0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Nombre del tanque -->
|
|
<Border Grid.Row="0" Background="#FF4169E1" CornerRadius="3" Padding="3,2">
|
|
<TextBlock Text="{Binding Nombre}"
|
|
Foreground="White" FontSize="8" FontWeight="Bold"/>
|
|
</Border>
|
|
|
|
<!-- Tipo de fluido -->
|
|
<Border Grid.Row="1" Background="#FF006400" CornerRadius="3" Padding="3,2" Margin="0,2,0,0">
|
|
<TextBlock Text="{Binding FluidDescription}"
|
|
Foreground="White" FontSize="7" FontWeight="Bold"/>
|
|
</Border>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<!-- Panel de información detallado -->
|
|
<Grid Canvas.Top="{Binding Tamano, Converter={StaticResource MeterToPixelConverter}, ConverterParameter=1.5}"
|
|
Width="{Binding Tamano, Converter={StaticResource MeterToPixelConverter}}">
|
|
|
|
<Border Background="#AA000000" CornerRadius="5" Margin="0,4,0,0" Padding="4">
|
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
|
|
<!-- Fila 1: Presión y Flujo -->
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,2">
|
|
<TextBlock Text="{Binding CurrentPressure, StringFormat='{}{0:F2} bar'}"
|
|
Foreground="White" Background="Blue" Padding="2" Margin="1" FontSize="7"/>
|
|
<TextBlock Text="{Binding CurrentFlow, StringFormat='{}{0:F3} m³/s'}"
|
|
Foreground="White" Background="Green" Padding="2" Margin="1" FontSize="7"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
</Canvas>
|
|
|
|
</UserControl>
|