diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-15 19:44:35 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-12-15 19:44:35 +0200 |
| commit | 5ef0db61993e269caa1d1184ee0be2ae1c6ea393 (patch) | |
| tree | 395e07d0140b233e4d40fd0b5d037e0a01e75c27 /Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems | |
| parent | d92af8452acdde8595e16c379e8a17cd5d3efdbe (diff) | |
| download | Tango-5ef0db61993e269caa1d1184ee0be2ae1c6ea393.tar.gz Tango-5ef0db61993e269caa1d1184ee0be2ae1c6ea393.zip | |
Implemented power down by user and from embedded button.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems')
3 files changed, 89 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItem.cs new file mode 100644 index 000000000..c2bdc3926 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItem.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PMR.Power; +using Tango.PPC.Common.Notifications; + +namespace Tango.PPC.UI.AppBarItems +{ + public class PowerOffAppBarItem : AppBarItem + { + private StartPowerDownResponse _status; + public StartPowerDownResponse Status + { + get { return _status; } + set { _status = value; RaisePropertyChangedAuto(); } + } + + /// <summary> + /// Gets or sets the view type. + /// </summary> + public override Type ViewType + { + get + { + return typeof(PowerOffAppBarItemView); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml new file mode 100644 index 000000000..9a9f8e912 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml @@ -0,0 +1,30 @@ +<UserControl x:Class="Tango.PPC.UI.AppBarItems.PowerOffAppBarItemView" + 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.AppBarItems" + mc:Ignorable="d" + d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:PowerOffAppBarItem, IsDesignTimeCreatable=False}"> + <Grid> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Command="{Binding PressedCommand}" Padding="0"> + <StackPanel VerticalAlignment="Center"> + <TextBlock Text="{Binding Status.Message}" FontSize="{StaticResource TangoDefaultFontSize}" TextTrimming="CharacterEllipsis"></TextBlock> + <ProgressBar Maximum="100" Value="{Binding Status.ProgressPercentage}" Margin="0 10 0 5" Background="{StaticResource TangoGrayBrush}" Height="5" Foreground="{StaticResource TangoPrimaryAccentBrush}" BorderThickness="0" /> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left"> + + <Run Text="{Binding Status.ProgressPercentage}"></Run><Run>%</Run> + <Run>Completed</Run> + </TextBlock> + + <!--<TextBlock DockPanel.Dock="Right"> + <Run Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToTwoDigitsTimeConverter},FallbackValue=5}"></Run> + <Run FontSize="16" Text="{Binding MachineProvider.MachineOperator.RunningJobStatus.RemainingTime,Converter={StaticResource TimeSpanToLabelConverter},FallbackValue=min}"></Run> + </TextBlock>--> + </DockPanel> + </StackPanel> + </touch:TouchButton> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.xaml.cs new file mode 100644 index 000000000..fdd7bfc30 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/AppBarItems/PowerOffAppBarItemView.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.AppBarItems +{ + /// <summary> + /// Interaction logic for PowerOffAppBarItemView.xaml + /// </summary> + public partial class PowerOffAppBarItemView : UserControl + { + public PowerOffAppBarItemView() + { + InitializeComponent(); + } + } +} |
