diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-02-15 15:29:13 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-02-15 15:29:13 +0200 |
| commit | 8a4a7818428d7b203cb28082c720c74831b2165f (patch) | |
| tree | a36bc4d90eb0cf418dd69c00af73863edc63998e /Software/Visual_Studio/FSE/Tango.FSE.Common | |
| parent | 1ee675bdcc0d0234f452c58fddd4024bbb0c2d8e (diff) | |
| parent | a27ffb17e0ab28c994234346d2bc93e85da710d2 (diff) | |
| download | Tango-8a4a7818428d7b203cb28082c720c74831b2165f.tar.gz Tango-8a4a7818428d7b203cb28082c720c74831b2165f.zip | |
Merged Light Inks To software !
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.Common')
6 files changed, 102 insertions, 2 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineView.xaml index 8d375cc6d..c82b5b460 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineView.xaml @@ -53,7 +53,7 @@ <Rectangle Stroke="Gray" HorizontalAlignment="Left" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> </Grid>--> - <UniformGrid Width="310" Canvas.Top="295" Canvas.Left="420" TextElement.Foreground="#252525" Rows="1" Columns="8" TextElement.FontSize="9"> + <UniformGrid Width="310" Canvas.Top="295" Canvas.Left="420" TextElement.Foreground="#252525" Rows="1" Columns="10" TextElement.FontSize="9"> <TextBlock HorizontalAlignment="Center">1</TextBlock> <TextBlock HorizontalAlignment="Center">2</TextBlock> <TextBlock HorizontalAlignment="Center">3</TextBlock> @@ -62,6 +62,8 @@ <TextBlock HorizontalAlignment="Center">6</TextBlock> <TextBlock HorizontalAlignment="Center">7</TextBlock> <TextBlock HorizontalAlignment="Center">8</TextBlock> + <TextBlock HorizontalAlignment="Center">9</TextBlock> + <TextBlock HorizontalAlignment="Center">10</TextBlock> </UniformGrid> <Grid x:Name="gridIds" Width="310" Height="195" Canvas.Top="314" Canvas.Left="420"> @@ -75,7 +77,7 @@ </ListBox.ItemContainerStyle> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <UniformGrid Columns="8"></UniformGrid> + <UniformGrid Columns="10"></UniformGrid> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeDescriptionConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeDescriptionConverter.cs new file mode 100644 index 000000000..2636e9588 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeDescriptionConverter.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.BL.Entities; +using Tango.Core.DI; + +namespace Tango.FSE.Common.Converters +{ + public class EventTypeDescriptionConverter : EventTypeTitleConverter + { + protected override string GetText(EventType evType, Machine machine) + { + return evType.GetEventText(EventType.EventTextType.Description, machine); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeTechnicalDescriptionConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeTechnicalDescriptionConverter.cs new file mode 100644 index 000000000..f9d741424 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeTechnicalDescriptionConverter.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.BL.Entities; +using Tango.Core.DI; + +namespace Tango.FSE.Common.Converters +{ + public class EventTypeTechnicalDescriptionConverter : EventTypeTitleConverter + { + protected override string GetText(EventType evType, Machine machine) + { + return evType.GetEventText(EventType.EventTextType.TechnicalDescription, machine); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeTitleConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeTitleConverter.cs new file mode 100644 index 000000000..5aed80ec7 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Converters/EventTypeTitleConverter.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.BL.Entities; +using Tango.Core.DI; +using Tango.FSE.Common.Connection; + +namespace Tango.FSE.Common.Converters +{ + public class EventTypeTitleConverter : IValueConverter + { + private static IMachineProvider _machineProvider; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (_machineProvider == null) + { + _machineProvider = TangoIOC.Default.GetInstance<IMachineProvider>(); + } + + EventType evType = value as EventType; + + if (evType != null) + { + if (_machineProvider != null) + { + return GetText(evType, _machineProvider.Machine); + } + else + { + return GetText(evType, null); + } + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + protected virtual String GetText(EventType evType, Machine machine) + { + return evType.GetEventText(EventType.EventTextType.Title, machine); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml index 54f8e5d63..e37f48821 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Converters.xaml @@ -49,4 +49,7 @@ <localConverters:LiquidTypeToShortNameConverter x:Key="LiquidTypeToShortNameConverter" /> <converters:IsEqualConverter x:Key="IsEqualConverter" /> <converters:IsNotConverter x:Key="IsNotConverter" /> + <localConverters:EventTypeTitleConverter x:Key="EventTypeTitleConverter" /> + <localConverters:EventTypeDescriptionConverter x:Key="EventTypeDescriptionConverter" /> + <localConverters:EventTypeTechnicalDescriptionConverter x:Key="EventTypeTechnicalDescriptionConverter" /> </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 9a43bb5fb..ce56e2daf 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -182,6 +182,9 @@ <Compile Include="Controls\ToggleIconButton.cs" /> <Compile Include="Converters\DateTimeUtcHumanizeConverter.cs" /> <Compile Include="Converters\DoubleToChartValuesConverter.cs" /> + <Compile Include="Converters\EventTypeTechnicalDescriptionConverter.cs" /> + <Compile Include="Converters\EventTypeDescriptionConverter.cs" /> + <Compile Include="Converters\EventTypeTitleConverter.cs" /> <Compile Include="Converters\FilePathToIconConverter.cs" /> <Compile Include="Converters\JobProgressToPositionConverter.cs" /> <Compile Include="Converters\LiquidTypeToShortNameConverter.cs" /> |
