diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-06-20 11:46:02 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2024-06-20 11:46:02 +0300 |
| commit | 0460a54eb73a3943a9d363e7cce38b8d9009bc4b (patch) | |
| tree | 6e0423ffa358d6a562764f99d110df1623f47a1a /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs | |
| parent | 7b0ed51c91baf1257fce45699221a0f1a096ce72 (diff) | |
| download | Tango-0460a54eb73a3943a9d363e7cce38b8d9009bc4b.tar.gz Tango-0460a54eb73a3943a9d363e7cce38b8d9009bc4b.zip | |
Jerrycan change impl.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs')
3 files changed, 127 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceView.xaml new file mode 100644 index 000000000..5485db720 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceView.xaml @@ -0,0 +1,45 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.JerricanReplaceView" + 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:JerricanReplaceViewVM, IsDesignTimeCreatable=False}"> + <Grid Margin="20"> + <DockPanel> + <Grid DockPanel.Dock="Bottom"> + <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton> + <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">OK</touch:TouchButton> + </Grid> + <StackPanel DockPanel.Dock="Top" Margin="0 0 0 0"> + <TextBlock Visibility="{Binding IsOpenedManually,Converter={StaticResource BooleanToVisibilityInverseConverter}}" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="{StaticResource TangoHeaderFontSize}"><Run Text="{Binding IDSPack.LiquidType.Name}"></Run> ink container change detected</TextBlock> + <TextBlock Visibility="{Binding IsOpenedManually,Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="{StaticResource TangoHeaderFontSize}"><Run Text="{Binding IDSPack.LiquidType.Name}"></Run> ink container level</TextBlock> + + <Border BorderBrush="{StaticResource TangoLightBorderBrush}" HorizontalAlignment="Left" BorderThickness="1" CornerRadius="30" Height="150" Width="60" Margin="0 20 0 0"> + <Border CornerRadius="0 0 30 30" Height="80" VerticalAlignment="Bottom" Background="{Binding IDSPack.LiquidType,Converter={StaticResource LiquidTypeToBrushConverter}}"> + <TextBlock HorizontalAlignment="Center" Margin="0 -50 0 0">?</TextBlock> + </Border> + </Border> + + <TextBlock Margin="0 20 0 0" HorizontalAlignment="Left" TextWrapping="Wrap"> How much ink is in the inserted container?</TextBlock> + + <touch:TouchRadioButton IsChecked="{Binding ViewMode,Mode=TwoWay,Converter={StaticResource EnumToBooleanConverter},ConverterParameter='Full'}" Margin="0 20 0 0" Content="5L (new)" /> + + <touch:TouchRadioButton IsChecked="{Binding ViewMode,Mode=TwoWay,Converter={StaticResource EnumToBooleanConverter},ConverterParameter='Reinserted'}" Margin="0 10 0 0" Content="No Change (reinserted)" /> + + <StackPanel Orientation="Horizontal" Margin="0 10 0 0"> + <touch:TouchRadioButton VerticalAlignment="Center" x:Name="radioCustom" Foreground="{StaticResource TangoDarkForegroundBrush}" IsChecked="{Binding ViewMode,Mode=TwoWay,Converter={StaticResource EnumToBooleanConverter},ConverterParameter='Custom'}"> + <TextBlock>Custom (L):</TextBlock> + </touch:TouchRadioButton> + <touch:TouchNumericUpDownConrol IsEnabled="{Binding ElementName=radioCustom,Path=IsChecked}" Margin="20 0 0 0" FontSize="{StaticResource TangoDefaultFontSize}" MinValue="0.5" MaxValue="5" Step="0.5" Value="{Binding LitersInserted,Mode=TwoWay}" ></touch:TouchNumericUpDownConrol> + </StackPanel> + + </StackPanel> + <Grid> + + </Grid> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceView.xaml.cs new file mode 100644 index 000000000..d7223a54a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.UI.Dialogs +{ + /// <summary> + /// Interaction logic for SpoolReplaceView.xaml + /// </summary> + public partial class JerricanReplaceView : UserControl + { + public JerricanReplaceView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceViewVM.cs new file mode 100644 index 000000000..44874b8d6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/JerricanReplaceViewVM.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public enum JerricanReplaceViewMode + { + Reinserted, + Full, + Custom + } + + public class JerricanReplaceViewVM : DialogViewVM + { + public bool IsOpenedManually { get; set; } + + private JerricanReplaceViewMode _mode; + public JerricanReplaceViewMode ViewMode + { + get { return _mode; } + set + { + _mode = value; RaisePropertyChangedAuto(); + if (_mode == JerricanReplaceViewMode.Full) + { + LitersInserted = 5; + } + } + } + + private double _litersInserted; + public double LitersInserted + { + get { return _litersInserted; } + set + { + _litersInserted = value; + RaisePropertyChangedAuto(); + } + } + + public IdsPack IDSPack { get; set; } + + public JerricanReplaceViewVM() + { + LitersInserted = 5; + } + } +} |
