diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-10-12 16:54:21 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-10-12 16:54:21 +0300 |
| commit | 28f7a6f566c4e951d3d40c449813fce0c7460ca7 (patch) | |
| tree | 7ea0e25c802b3086ddf28a374884f1a72c463e9e /Software/Visual_Studio/Utilities/Tango.MachineEM.UI | |
| parent | af99d6cf60267ea8c92c7610b16565104a5b6aed (diff) | |
| download | Tango-28f7a6f566c4e951d3d40c449813fce0c7460ca7.tar.gz Tango-28f7a6f566c4e951d3d40c449813fce0c7460ca7.zip | |
IMplemented emulator ink filling status.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.MachineEM.UI')
4 files changed, 100 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Controls/InkFillingStatusView.xaml b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Controls/InkFillingStatusView.xaml new file mode 100644 index 000000000..22468a052 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Controls/InkFillingStatusView.xaml @@ -0,0 +1,51 @@ +<UserControl x:Class="Tango.MachineEM.UI.Controls.InkFillingStatusView" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:fa="http://schemas.fontawesome.io/icons/" + xmlns:ifs="clr-namespace:Tango.PMR.IFS;assembly=Tango.PMR" + xmlns:diagnostics="clr-namespace:Tango.PMR.Diagnostics;assembly=Tango.PMR" + xmlns:vm="clr-namespace:Tango.MachineEM.UI.ViewModels" + xmlns:local="clr-namespace:Tango.MachineEM.UI.Views" + mc:Ignorable="d" + d:DesignHeight="400" Width="500" Foreground="Gainsboro" d:DataContext="{d:DesignInstance Type=ifs:InkFillingStatus, IsDesignTimeCreatable=False}" > + + <UserControl.Resources> + <converters:BooleanInverseConverter x:Key="BooleanInverseConverter"></converters:BooleanInverseConverter> + <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> + </UserControl.Resources> + <Grid> + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5"> + <ItemsControl ItemsSource="{Binding CartridgesStatuses}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Border BorderBrush="DimGray" BorderThickness="1" Margin="0 5" Padding="5" CornerRadius="5"> + <StackPanel> + <DockPanel> + <TextBlock> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Text" Value="Waste"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Cartridge.Slot}" Value="Ink"> + <Setter Property="Text" Value="Ink"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + <TextBlock Margin="5 0 0 0" Text="{Binding Cartridge.Index}"></TextBlock> + </DockPanel> + <ComboBox Margin="0 5 0 0" ItemsSource="{Binding Source={x:Type ifs:CartridgeState},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding State,Mode=TwoWay}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox> + <Slider Margin="0 5 0 0" Minimum="0" MaxHeight="100" Value="{Binding ProgressPercentage}"></Slider> + </StackPanel> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Controls/InkFillingStatusView.xaml.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Controls/InkFillingStatusView.xaml.cs new file mode 100644 index 000000000..575e12210 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Controls/InkFillingStatusView.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +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.MachineEM.UI.Controls +{ + /// <summary> + /// Interaction logic for MainView.xaml + /// </summary> + public partial class InkFillingStatusView : UserControl + { + public InkFillingStatusView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj index bce166287..705194057 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Tango.MachineEM.UI.csproj @@ -80,10 +80,17 @@ <Compile Include="..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Compile Include="Controls\InkFillingStatusView.xaml.cs"> + <DependentUpon>InkFillingStatusView.xaml</DependentUpon> + </Compile> <Compile Include="ViewModels\MainViewVM.cs" /> <Compile Include="Views\MainView.xaml.cs"> <DependentUpon>MainView.xaml</DependentUpon> </Compile> + <Page Include="Controls\InkFillingStatusView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="MainWindow.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -193,7 +200,7 @@ </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml index 62bacd6d2..73a14b5b1 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml @@ -3,6 +3,7 @@ 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:controls="clr-namespace:Tango.MachineEM.UI.Controls" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" @@ -81,7 +82,7 @@ </Button> <ToggleButton Style="{StaticResource AccentedSquareButtonStyle}" BorderThickness="0" x:Name="toggleLevels" Height="45" Margin="5"> <StackPanel Orientation="Horizontal"> - <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">STATUS</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">MACHINE STATUS</TextBlock> <fa:ImageAwesome Icon="ChevronDown" Width="16" Foreground="White"></fa:ImageAwesome> </StackPanel> </ToggleButton> @@ -135,6 +136,16 @@ </StackPanel> </Border> </Popup> + + <ToggleButton Style="{StaticResource AccentedSquareButtonStyle}" BorderThickness="0" x:Name="toggleIFS" Height="45" Margin="5"> + <StackPanel Orientation="Horizontal"> + <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">INK FILLING STATUS</TextBlock> + <fa:ImageAwesome Icon="ChevronDown" Width="16" Foreground="White"></fa:ImageAwesome> + </StackPanel> + </ToggleButton> + <Popup IsOpen="{Binding ElementName=toggleIFS,Path=IsChecked}" StaysOpen="True" PlacementTarget="{Binding ElementName=toggleIFS}" Placement="Bottom"> + <controls:InkFillingStatusView Height="300" Width="210" DataContext="{Binding Emulator.InkFillingStatus}" /> + </Popup> <!--BUTTONS HERE--> <Button Padding="10 0 0 0" Margin="5" Height="45" HorizontalContentAlignment="Left" Style="{StaticResource AccentedSquareButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding AbortJobCommand}"> |
