diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-10-10 16:55:44 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-10-10 16:55:44 +0300 |
| commit | 79eb19cbd10785a7dbc972bc0b26817932237419 (patch) | |
| tree | e36176fc94ce6f26efc89b006d7e6faf7e4398cb /Software/Visual_Studio/MachineStudio/Modules | |
| parent | df9197240ba5a643ce1599f36b7e3dd34aad6a60 (diff) | |
| download | Tango-79eb19cbd10785a7dbc972bc0b26817932237419.tar.gz Tango-79eb19cbd10785a7dbc972bc0b26817932237419.zip | |
Sign-out works !
Fixed issue where color conversion was busy while not in research module but research module in job view.
Added new RealTimeGraphX !
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
27 files changed, 345 insertions, 123 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj index 87751f871..6c94271a2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.ColorLab</RootNamespace> <AssemblyName>Tango.MachineStudio.ColorLab</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index 33090a640..45749a6b5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -494,7 +494,7 @@ namespace Tango.MachineStudio.ColorLab.ViewModels if (LiquidsCalibrationData == null || _prevent_inverse_conversion) return; //TODO: This is temporary because of out of range volumes. - if (LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > 200) + if (LiquidVolumes.Where(x => x.IdsPack.IdsPackFormula.Code == IdsPackFormulas.StandardColor.ToInt32()).Sum(x => x.Volume) > 100) { IsVolumesOutOfRange = true; return; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj index 393c4e491..e719464f8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.DB</RootNamespace> <AssemblyName>Tango.MachineStudio.DB</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj index 23c664067..7c1ffc843 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Tango.MachineStudio.DataCapture.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.DataCapture</RootNamespace> <AssemblyName>Tango.MachineStudio.DataCapture</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj index e4382bd5c..dca470eed 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.Developer</RootNamespace> <AssemblyName>Tango.MachineStudio.Developer</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 6c3e31325..1b9720335 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -782,7 +782,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { while (true) { - if (!_disable_gamut_check && IsJobVisible && ActiveJob != null && ActiveJob.Segments != null) + if (!_disable_gamut_check && IsJobVisible && IsVisible && ActiveJob != null && ActiveJob.Segments != null) { try { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj index 89942c6d6..6f65b40c0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Tango.MachineStudio.HardwareDesigner.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.HardwareDesigner</RootNamespace> <AssemblyName>Tango.MachineStudio.HardwareDesigner</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj index f3318f275..b81ba731d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.Logging</RootNamespace> <AssemblyName>Tango.MachineStudio.Logging</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_5q2jsctg_wpftmp.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_5q2jsctg_wpftmp.csproj index d17694b46..f6fa01ae7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_5q2jsctg_wpftmp.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging_5q2jsctg_wpftmp.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.Logging</RootNamespace> <AssemblyName>Tango.MachineStudio.Logging</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj index 05331290b..3fa7c60cf 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.MachineDesigner</RootNamespace> <AssemblyName>Tango.MachineStudio.MachineDesigner</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config index bd3d48f6d..24aec371a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/App.config @@ -41,6 +41,14 @@ <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> </assemblyBinding> </runtime> </configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj index 8d3f0cce2..64501b4fc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.RML</RootNamespace> <AssemblyName>Tango.MachineStudio.RML</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj index cb4985dd9..ea332221e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Tango.MachineStudio.Stubs.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.Stubs</RootNamespace> <AssemblyName>Tango.MachineStudio.Stubs</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj index e8df35ba8..e76e9b81f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.Synchronization</RootNamespace> <AssemblyName>Tango.MachineStudio.Synchronization</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/DecimalPlacesToStringFormatConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/DecimalPlacesToStringFormatConverter.cs new file mode 100644 index 000000000..a0f6863e6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Converters/DecimalPlacesToStringFormatConverter.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.Technician.Converters +{ + public class DecimalPlacesToStringFormatConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null) + { + return $"F{int.Parse(value.ToString())}"; + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml index dcba1e77b..22fd8eaa8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.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:localConverters="clr-namespace:Tango.MachineStudio.Technician.Converters" xmlns:controls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" @@ -14,6 +15,7 @@ <UserControl.Resources> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter> <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + <localConverters:DecimalPlacesToStringFormatConverter x:Key="DecimalPlacesToStringFormatConverter"/> <!--Theme--> <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush> @@ -30,14 +32,7 @@ <!--Content--> <Grid> <!--<Viewbox Stretch="Fill">--> - <controls:RealTimeGraphMultiControl x:Name="InnerGraph" UseAutoRange="{Binding UseAutoRange}" IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}" x:FieldModifier="public" EnableToolBar="False" SensorName="{Binding TechMonitor.Description}" SensorUnits="{Binding TechMonitor.Units}"> - <controls:RealTimeGraphMultiControl.Style> - <Style TargetType="controls:RealTimeGraphMultiControl"> - <Setter Property="Minimum" Value="{Binding Min,Mode=TwoWay}"></Setter> - <Setter Property="Maximum" Value="{Binding Max,Mode=TwoWay}"></Setter> - </Style> - </controls:RealTimeGraphMultiControl.Style> - </controls:RealTimeGraphMultiControl> + <controls:RealTimeGraphControl x:Name="InnerGraph" IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}" x:FieldModifier="public" DisplayName="{Binding TechMonitor.Description}" DisplayUnits="{Binding TechMonitor.Units}" StringFormat="{Binding DecimalPlaces,Converter={StaticResource DecimalPlacesToStringFormatConverter}}" /> <!--</Viewbox>--> </Grid> <!--Content--> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml index a9eb9e9f4..ca2481de6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" + xmlns:localConverters="clr-namespace:Tango.MachineStudio.Technician.Converters" xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors" @@ -14,6 +15,7 @@ <UserControl.Resources> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter> <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + <localConverters:DecimalPlacesToStringFormatConverter x:Key="DecimalPlacesToStringFormatConverter"/> <!--Theme--> <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush> @@ -30,13 +32,8 @@ <!--Content--> <Grid> <!--<Viewbox Stretch="Fill">--> - <controls:RealTimeGraphControl x:Name="InnerGraph" UseAutoRange="{Binding UseAutoRange}" IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}" x:FieldModifier="public" EnableToolBar="False" SensorName="{Binding TechMonitor.Description}" Color="{Binding Color,Mode=OneWay}" SensorUnits="{Binding TechMonitor.Units}"> - <controls:RealTimeGraphControl.Style> - <Style TargetType="controls:RealTimeGraphControl"> - <Setter Property="Minimum" Value="{Binding Min,Mode=TwoWay}"></Setter> - <Setter Property="Maximum" Value="{Binding Max,Mode=TwoWay}"></Setter> - </Style> - </controls:RealTimeGraphControl.Style> + <controls:RealTimeGraphControl x:Name="InnerGraph" IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}" x:FieldModifier="public" DisplayName="{Binding TechMonitor.Description}" DisplayUnits="{Binding TechMonitor.Units}" StringFormat="{Binding DecimalPlaces,Converter={StaticResource DecimalPlacesToStringFormatConverter}}"> + </controls:RealTimeGraphControl> <!--</Viewbox>--> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml index 2f5e677c4..8a3c7c25f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml @@ -16,6 +16,7 @@ <UserControl.Resources> <converters:MonitorsToMultiChannleMonitorsConverter x:Key="MonitorsToMultiChannleMonitorsConverter" /> <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + <converters:SecondsToTimeSpanConverter x:Key="SecondsToTimeSpanConverter" /> <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> @@ -34,6 +35,16 @@ <GroupBox Header="GRAPH" Margin="0 10 0 0"> <StackPanel> + <StackPanel Margin="0 10 0 0"> + <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold" Foreground="Gray"> + <Run>FIFO CAPACITY:</Run> + <Run Text="{Binding Duration,Converter={StaticResource SecondsToTimeSpanConverter},Mode=OneWay,StringFormat='hh\\:mm\\:ss'}"></Run> + </TextBlock> + <Slider Margin="0 5 0 0" Minimum="1" Maximum="3600" TickFrequency="1" IsSnapToTickEnabled="True" Value="{Binding Duration}"></Slider> + + <TextBlock FontSize="10" Margin="0 20 0 0">Decimal Places</TextBlock> + <mahapps:NumericUpDown Background="Transparent" Margin="0 5 0 0" HasDecimals="False" Minimum="0" Maximum="4" Value="{Binding DecimalPlaces}" HorizontalContentAlignment="Center" Foreground="Gray" /> + </StackPanel> <StackPanel Margin="0 10" IsEnabled="{Binding UseAutoRange,Converter={StaticResource BooleanInverseConverter}}"> <UniformGrid Columns="2" Margin="0 5 0 0" IsEnabled="{Binding UseMinMax}"> <StackPanel Margin="0 0 5 0"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml index 4acbd2fc1..a9d341b01 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml @@ -16,6 +16,7 @@ <UserControl.Resources> <converters:MonitorsToSingleChannleMonitorsConverter x:Key="MonitorsToSingleChannleMonitorsConverter" /> <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" /> + <converters:SecondsToTimeSpanConverter x:Key="SecondsToTimeSpanConverter" /> <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> @@ -34,6 +35,16 @@ <GroupBox Header="GRAPH" Margin="0 10 0 0"> <StackPanel> + <StackPanel Margin="0 10 0 0"> + <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold" Foreground="Gray"> + <Run>FIFO CAPACITY:</Run> + <Run Text="{Binding Duration,Converter={StaticResource SecondsToTimeSpanConverter},Mode=OneWay,StringFormat='hh\\:mm\\:ss'}"></Run> + </TextBlock> + <Slider Margin="0 5 0 0" Minimum="1" Maximum="3600" TickFrequency="1" IsSnapToTickEnabled="True" Value="{Binding Duration}"></Slider> + + <TextBlock FontSize="10" Margin="0 20 0 0">Decimal Places</TextBlock> + <mahapps:NumericUpDown Background="Transparent" Margin="0 5 0 0" HasDecimals="False" Minimum="0" Maximum="4" Value="{Binding DecimalPlaces}" HorizontalContentAlignment="Center" Foreground="Gray" /> + </StackPanel> <StackPanel Margin="0 10" IsEnabled="{Binding UseAutoRange,Converter={StaticResource BooleanInverseConverter}}"> <UniformGrid Columns="2" Margin="0 5 0 0" IsEnabled="{Binding UseMinMax}"> <StackPanel Margin="0 0 5 0"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj index 9bba3b43f..c507b84f6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.Technician</RootNamespace> <AssemblyName>Tango.MachineStudio.Technician</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> @@ -103,6 +103,7 @@ <Compile Include="..\..\..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Compile Include="Converters\DecimalPlacesToStringFormatConverter.cs" /> <Compile Include="Converters\MonitorsToMultiChannleMonitorsConverter.cs" /> <Compile Include="Converters\MonitorsToSingleChannleMonitorsConverter.cs" /> <Compile Include="Converters\SecondsToGraphPointsConverter.cs" /> @@ -251,6 +252,7 @@ <Compile Include="PropertiesTemplates\SingleGraphTemplate.xaml.cs"> <DependentUpon>SingleGraphTemplate.xaml</DependentUpon> </Compile> + <Compile Include="TechGraphController.cs" /> <Compile Include="TechItems\BlowerItem.cs" /> <Compile Include="TechItems\BreakSensorItem.cs" /> <Compile Include="TechItems\ControllerItem.cs" /> @@ -500,6 +502,14 @@ <Project>{b9ae25d6-be35-492f-9079-21a7f3e6f7cc}</Project> <Name>RealTimeGraphEx</Name> </ProjectReference> + <ProjectReference Include="..\..\..\SideChains\RealTimeGraphX.WPF\RealTimeGraphX.WPF.csproj"> + <Project>{99d233c5-fee7-418e-9c25-d4584cb52e28}</Project> + <Name>RealTimeGraphX.WPF</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\SideChains\RealTimeGraphX\RealTimeGraphX.csproj"> + <Project>{6d55a3b8-46d3-493a-a143-aebd2b98d683}</Project> + <Name>RealTimeGraphX</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Tango.BL\Tango.BL.csproj"> <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> <Name>Tango.BL</Name> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechGraphController.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechGraphController.cs new file mode 100644 index 000000000..28c75f79f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechGraphController.cs @@ -0,0 +1,29 @@ +using RealTimeGraphX; +using RealTimeGraphX.DataPoints; +using RealTimeGraphX.Renderers; +using RealTimeGraphX.WPF.DataSeries; +using RealTimeGraphX.WPF.Painters; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Technician +{ + public class TechGraphController : GraphControllerBase<WpfDataSeries, TimeSpanDataPoint, DoubleDataPoint> + { + public TechGraphController(int refreshRate = 50) + { + var renderer = new GraphScrollingRenderer<WpfDataSeries, TimeSpanDataPoint, DoubleDataPoint>() + { + RefreshRate = TimeSpan.FromMilliseconds(refreshRate) + }; + + var painter = new WpfScrollingGraphPainter(); + + ConnectOutput(renderer); + renderer.ConnectOutput(painter); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs index a935ee5a6..377738d09 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MultiGraphItem.cs @@ -1,4 +1,5 @@ -using System; +using RealTimeGraphX.DataPoints; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -41,24 +42,38 @@ namespace Tango.MachineStudio.Technician.TechItems _techMonitor = value; RaisePropertyChangedAuto(); - if (_techMonitor != old && Editor != null) - { - Editor.InnerGraph.InnerGraph.MaxPoints = GraphsHelper.GetMaxPoints(TechMonitor.PointsPerFrame); - Editor.InnerGraph.InvalidateGraph(); - } - ItemGuid = value != null ? value.Guid : null; TechName = _techMonitor != null ? _techMonitor.Description : null; } } + private MultiGraphElementEditor _editor; /// <summary> /// Gets or sets the item editor. /// </summary> [XmlIgnore] - public MultiGraphElementEditor Editor { get; set; } + public MultiGraphElementEditor Editor + { + get { return _editor; } + set + { + _editor = value; + SetEditorSettings(); + } + } + private int _duration; + public int Duration + { + get { return _duration; } + set + { + _duration = value; + RaisePropertyChangedAuto(); + SetEditorSettings(); + } + } private double _min; /// <summary> /// Gets or sets the minimum graph value. @@ -66,7 +81,11 @@ namespace Tango.MachineStudio.Technician.TechItems public double Min { get { return _min; } - set { _min = value; RaisePropertyChangedAuto(); } + set + { + _min = value; RaisePropertyChangedAuto(); + SetEditorSettings(); + } } private double _max; @@ -76,7 +95,11 @@ namespace Tango.MachineStudio.Technician.TechItems public double Max { get { return _max; } - set { _max = value; RaisePropertyChangedAuto(); } + set + { + _max = value; RaisePropertyChangedAuto(); + SetEditorSettings(); + } } private bool _useAutoRange; @@ -86,7 +109,21 @@ namespace Tango.MachineStudio.Technician.TechItems public bool UseAutoRange { get { return _useAutoRange; } - set { _useAutoRange = value; RaisePropertyChangedAuto(); } + set + { + _useAutoRange = value; RaisePropertyChangedAuto(); + SetEditorSettings(); + } + } + + private int _decimalPlaces; + /// <summary> + /// Gets or sets the decimal places of y-axis. + /// </summary> + public int DecimalPlaces + { + get { return _decimalPlaces; } + set { _decimalPlaces = value; RaisePropertyChangedAuto(); } } private bool _isPaused; @@ -100,11 +137,7 @@ namespace Tango.MachineStudio.Technician.TechItems set { _isPaused = value; RaisePropertyChangedAuto(); - - if (Editor != null) - { - Editor.InnerGraph.Controller.IsPaused = _isPaused; - } + SetEditorSettings(); } } @@ -144,6 +177,9 @@ namespace Tango.MachineStudio.Technician.TechItems /// </summary> public MultiGraphItem() : base() { + _useAutoRange = true; + DecimalPlaces = 1; + _duration = 10; _timer = new DispatcherTimer(); _timer.Tick += _timer_Tick; _timer.Interval = TimeSpan.FromSeconds(1); @@ -173,6 +209,20 @@ namespace Tango.MachineStudio.Technician.TechItems }); } + private void SetEditorSettings() + { + if (Editor != null) + { + var controller = Editor.InnerGraph.Controller; + + controller.Range.MaximumX = new TimeSpanDataPoint(TimeSpan.FromSeconds(_duration)); + controller.Range.MinimumY = new DoubleDataPoint(_min); + controller.Range.MaximumY = new DoubleDataPoint(_max); + controller.Range.AutoY = _useAutoRange; + controller.IsPaused = _isPaused; + } + } + private void OnTechMonitorChanged() { if (TechMonitor != null) @@ -233,6 +283,8 @@ namespace Tango.MachineStudio.Technician.TechItems cloned.Min = Min; cloned.Max = Max; cloned.UseAutoRange = UseAutoRange; + cloned.Duration = Duration; + cloned.DecimalPlaces = DecimalPlaces; return cloned; } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs index 87d971233..808dadb68 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/SingleGraphItem.cs @@ -1,6 +1,8 @@ -using System; +using RealTimeGraphX.DataPoints; +using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using System.Windows.Media; @@ -42,12 +44,6 @@ namespace Tango.MachineStudio.Technician.TechItems _techMonitor = value; RaisePropertyChangedAuto(); - if (_techMonitor != old && Editor != null) - { - Editor.InnerGraph.InnerGraph.MaxPoints = GraphsHelper.GetMaxPoints(TechMonitor.PointsPerFrame); - Editor.InnerGraph.InvalidateGraph(); - } - ItemGuid = value != null ? value.Guid : null; TechName = _techMonitor != null ? _techMonitor.Description : null; @@ -55,11 +51,32 @@ namespace Tango.MachineStudio.Technician.TechItems } } + private SingleGraphElementEditor _editor; /// <summary> /// Gets or sets the item editor. /// </summary> [XmlIgnore] - public SingleGraphElementEditor Editor { get; set; } + public SingleGraphElementEditor Editor + { + get { return _editor; } + set + { + _editor = value; + SetEditorSettings(); + } + } + + private int _duration; + public int Duration + { + get { return _duration; } + set + { + _duration = value; + RaisePropertyChangedAuto(); + SetEditorSettings(); + } + } private double _min; /// <summary> @@ -68,7 +85,11 @@ namespace Tango.MachineStudio.Technician.TechItems public double Min { get { return _min; } - set { _min = value; RaisePropertyChangedAuto(); } + set + { + _min = value; RaisePropertyChangedAuto(); + SetEditorSettings(); + } } private double _max; @@ -78,7 +99,11 @@ namespace Tango.MachineStudio.Technician.TechItems public double Max { get { return _max; } - set { _max = value; RaisePropertyChangedAuto(); } + set + { + _max = value; RaisePropertyChangedAuto(); + SetEditorSettings(); + } } private bool _useAutoRange; @@ -88,7 +113,21 @@ namespace Tango.MachineStudio.Technician.TechItems public bool UseAutoRange { get { return _useAutoRange; } - set { _useAutoRange = value; RaisePropertyChangedAuto(); } + set + { + _useAutoRange = value; RaisePropertyChangedAuto(); + SetEditorSettings(); + } + } + + private int _decimalPlaces; + /// <summary> + /// Gets or sets the decimal places of y-axis. + /// </summary> + public int DecimalPlaces + { + get { return _decimalPlaces; } + set { _decimalPlaces = value; RaisePropertyChangedAuto(); } } private bool _isPaused; @@ -102,11 +141,7 @@ namespace Tango.MachineStudio.Technician.TechItems set { _isPaused = value; RaisePropertyChangedAuto(); - - if (Editor != null) - { - Editor.InnerGraph.Controller.IsPaused = _isPaused; - } + SetEditorSettings(); } } @@ -146,6 +181,9 @@ namespace Tango.MachineStudio.Technician.TechItems /// </summary> public SingleGraphItem() : base() { + _useAutoRange = true; + DecimalPlaces = 1; + _duration = 10; _timer = new DispatcherTimer(); _timer.Tick += _timer_Tick; _timer.Interval = TimeSpan.FromSeconds(1); @@ -175,6 +213,21 @@ namespace Tango.MachineStudio.Technician.TechItems }); } + private void SetEditorSettings() + { + if (Editor != null) + { + var controller = Editor.InnerGraph.Controller; + + controller.Range.MaximumX = new TimeSpanDataPoint(TimeSpan.FromSeconds(_duration)); + controller.Range.MinimumY = new DoubleDataPoint(_min); + controller.Range.MaximumY = new DoubleDataPoint(_max); + controller.Range.AutoY = _useAutoRange; + controller.IsPaused = _isPaused; + controller.DataSeriesCollection[0].Stroke = Color; + } + } + private void _timer_Tick(object sender, EventArgs e) { RecordingTime = DateTime.Now - _recording_start_time; @@ -235,7 +288,19 @@ namespace Tango.MachineStudio.Technician.TechItems cloned.Min = Min; cloned.Max = Max; cloned.UseAutoRange = UseAutoRange; + cloned.Duration = Duration; + cloned.DecimalPlaces = DecimalPlaces; return cloned; } + + protected override void RaisePropertyChanged(string propName) + { + base.RaisePropertyChanged(propName); + + if (propName == nameof(Color)) + { + SetEditorSettings(); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs index 6fa00ae0a..54fbc8175 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs @@ -181,7 +181,7 @@ namespace Tango.MachineStudio.Technician.TechItems set { _color = value; - RaisePropertyChangedAuto(); + RaisePropertyChanged(nameof(Color)); _colorNumber = ColorHelper.ColorToInteger(value); } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index 2ca5aa43b..1e1638928 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -35,6 +35,9 @@ using Tango.MachineStudio.Technician.Helpers; using Tango.MachineStudio.Technician.Models; using Tango.Logging; using Microsoft.WindowsAPICodePack.Dialogs; +using RealTimeGraphX; +using RealTimeGraphX.WPF.DataSeries; +using RealTimeGraphX.DataPoints; namespace Tango.MachineStudio.Technician.ViewModels { @@ -47,8 +50,8 @@ namespace Tango.MachineStudio.Technician.ViewModels { private List<PropertyInfo> _diagnoticsMonitorsDataProperties; private IDiagnosticsFrameProvider _diagnosticsFrameProvider; - private Dictionary<SingleGraphItem, GraphController> _singleControllers; - private Dictionary<MultiGraphItem, GraphMultiController> _multiControllers; + private Dictionary<SingleGraphItem, TechGraphController> _singleControllers; + private Dictionary<MultiGraphItem, TechGraphController> _multiControllers; private static object _elementsLock = new object(); private String _lastTechProjectFile; private INotificationProvider _notification; @@ -62,6 +65,8 @@ namespace Tango.MachineStudio.Technician.ViewModels private List<SingleTechRecordingData> _single_monitors_recordings; private List<MultiTechRecordingData> _multi_monitors_recordings; + private DateTime _start_time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); + private DateTime _last_time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); #region Properties @@ -290,8 +295,8 @@ namespace Tango.MachineStudio.Technician.ViewModels _notification = notificationProvider; _eventLogger = eventLogger; - _singleControllers = new Dictionary<SingleGraphItem, GraphController>(); - _multiControllers = new Dictionary<MultiGraphItem, GraphMultiController>(); + _singleControllers = new Dictionary<SingleGraphItem, TechGraphController>(); + _multiControllers = new Dictionary<MultiGraphItem, TechGraphController>(); AvailableTechItems = TechItem.GetAvailableTechItems().ToObservableCollection(); SelectedTechItem = AvailableTechItems.FirstOrDefault(); _diagnoticsMonitorsDataProperties = typeof(DiagnosticsMonitors).GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); @@ -376,6 +381,10 @@ namespace Tango.MachineStudio.Technician.ViewModels /// <param name="data">The data.</param> private void PopulateDiagnosticsData(StartDiagnosticsResponse data) { + TimeSpan delta_base = DateTime.Now - _start_time; + double delta_mili = (DateTime.Now - _last_time).TotalMilliseconds; + _last_time = DateTime.Now; + if (DateTime.Now > _lastDiagnosticsResponseUpdate.AddMilliseconds(MIN_DIAGNOSTICS_UPDATE_MILI)) { CurrentDiagnosticsResponse = data; @@ -451,20 +460,21 @@ namespace Tango.MachineStudio.Technician.ViewModels if (prop != null) { - GraphController controller = null; + TechGraphController controller = null; if (_singleControllers.TryGetValue(graphItem, out controller)) { var points = GetDataArray(graphItem.TechMonitor, prop.GetValue(data.Monitors)); - int maxPoints = (int)(_diagnosticsFrameProvider.FrameRate * GraphsDurationSeconds * points.Count); + List<TimeSpanDataPoint> times = new List<TimeSpanDataPoint>(); + var dPoints = points.Select(x => new DoubleDataPoint(x)).ToList(); - InvokeUI(() => + for (int i = 0; i < points.Count; i++) { - graphItem.Editor.InnerGraph.InnerGraph.MaxPoints = maxPoints; - }); + times.Add(delta_base.Add(TimeSpan.FromMilliseconds((delta_mili / points.Count) * i))); + } - controller.PushData(points); + controller.PushData(times, dPoints); var _graph_recording = _single_graphs_recordings.SingleOrDefault(x => x.Tag == graphItem); if (_graph_recording != null) @@ -482,7 +492,7 @@ namespace Tango.MachineStudio.Technician.ViewModels if (prop != null) { - GraphMultiController controller = null; + TechGraphController controller = null; if (_multiControllers.TryGetValue(graphItem, out controller)) { @@ -490,15 +500,23 @@ namespace Tango.MachineStudio.Technician.ViewModels if (points.Count > 0) { - int maxPoints = (int)(_diagnosticsFrameProvider.FrameRate * GraphsDurationSeconds * points[0].Count); + List<TimeSpanDataPoint> times = new List<TimeSpanDataPoint>(); + var dPoints = points.Select(x => new List<DoubleDataPoint>(x.Select(y => new DoubleDataPoint(y)))).ToList(); - InvokeUI(() => + for (int i = 0; i < points[0].Count; i++) { - graphItem.Editor.InnerGraph.InnerGraph.MaxPoints = maxPoints; - }); - } + times.Add(delta_base.Add(TimeSpan.FromMilliseconds((delta_mili / points[0].Count) * i))); + } + + List<List<TimeSpanDataPoint>> timesMat = new List<List<TimeSpanDataPoint>>(); - controller.PushData(points); + for (int i = 0; i < controller.DataSeriesCollection.Count; i++) + { + timesMat.Add(times); + } + + controller.PushData(timesMat, dPoints); + } var _graph_recording = _multi_graph_recordings.SingleOrDefault(x => x.Tag == graphItem); if (_graph_recording != null) @@ -624,15 +642,15 @@ namespace Tango.MachineStudio.Technician.ViewModels /// </summary> protected virtual void OnDisableRenderingChanged() { - foreach (var controller in _singleControllers) - { - controller.Value.ChangeRenderMode(!DisableRendering); - } + //foreach (var controller in _singleControllers) + //{ + // controller.Value.ChangeRenderMode(!DisableRendering); + //} - foreach (var controller in _multiControllers) - { - controller.Value.ChangeRenderMode(!DisableRendering); - } + //foreach (var controller in _multiControllers) + //{ + // controller.Value.ChangeRenderMode(!DisableRendering); + //} } #endregion @@ -956,36 +974,38 @@ namespace Tango.MachineStudio.Technician.ViewModels { var graphItem = element.HostedElement as SingleGraphItem; var editor = element as SingleGraphElementEditor; - graphItem.Editor = editor; - editor.InnerGraph.InnerGraph.MaxPoints = GraphsHelper.GetMaxPoints(graphItem.TechMonitor.PointsPerFrame); - GraphController controller = new GraphController(); + TechGraphController controller = new TechGraphController(); + controller.AddDataSeries(new WpfDataSeries() + { + Stroke = Colors.DodgerBlue, + }); editor.InnerGraph.Controller = controller; + graphItem.Editor = editor; + _singleControllers.Add(graphItem, controller); } else if (element is MultiGraphElementEditor) { var graphItem = element.HostedElement as MultiGraphItem; var editor = element as MultiGraphElementEditor; - editor.InnerGraph.InnerGraph.MaxPoints = GraphsHelper.GetMaxPoints(graphItem.TechMonitor.PointsPerFrame); - graphItem.Editor = editor; - - GraphMultiController controller = new GraphMultiController(); + TechGraphController controller = new TechGraphController(500); for (int i = 0; i < graphItem.TechMonitor.ChannelCount; i++) { - controller.AddSeries(new RealTimeGraphEx.DataSeries.DataYSeries() + controller.AddDataSeries(new WpfDataSeries() { - UseFillAndStroke = true, + Stroke = ColorHelper.GetRandomColor(), Name = graphItem.TechMonitor.Name.First() + (i + 1).ToString(), - Stroke = new SolidColorBrush(ColorHelper.GetRandomColor()), }); } editor.InnerGraph.Controller = controller; + graphItem.Editor = editor; + _multiControllers.Add(graphItem, controller); } else if (element is MotorElementEditor) @@ -1300,12 +1320,21 @@ namespace Tango.MachineStudio.Technician.ViewModels /// <param name="editor">The editor.</param> private void InitSingleGraphitem(SingleGraphItem item, SingleGraphElementEditor editor) { - editor.InnerGraph.InnerGraph.MaxPoints = GraphsHelper.GetMaxPoints(item.TechMonitor.PointsPerFrame); - item.Editor = editor; + TechGraphController controller = new TechGraphController(); + controller.Range.AutoY = true; + controller.Range.MinimumY = item.TechMonitor.Min; + controller.Range.MaximumY = item.TechMonitor.Max; + controller.Range.MaximumX = TimeSpan.FromSeconds(10); + + controller.AddDataSeries(new WpfDataSeries() + { + Stroke = Colors.DodgerBlue, + }); - GraphController controller = new GraphController(); editor.InnerGraph.Controller = controller; + item.Editor = editor; + _singleControllers.Add(item, controller); item.RecordingStarted += () => @@ -1350,23 +1379,25 @@ namespace Tango.MachineStudio.Technician.ViewModels /// <param name="editor">The editor.</param> private void InitMultiGraphItem(MultiGraphItem item, MultiGraphElementEditor editor) { - editor.InnerGraph.InnerGraph.MaxPoints = GraphsHelper.GetMaxPoints(item.TechMonitor.PointsPerFrame); - item.Editor = editor; - - GraphMultiController controller = new GraphMultiController(); + TechGraphController controller = new TechGraphController(500); + controller.Range.AutoY = true; + controller.Range.MinimumY = item.TechMonitor.Min; + controller.Range.MaximumY = item.TechMonitor.Max; + controller.Range.MaximumX = TimeSpan.FromSeconds(10); for (int i = 0; i < item.TechMonitor.ChannelCount; i++) { - controller.AddSeries(new RealTimeGraphEx.DataSeries.DataYSeries() + controller.AddDataSeries(new WpfDataSeries() { - UseFillAndStroke = true, + Stroke = ColorHelper.GetRandomColor(), Name = item.TechMonitor.Name.First() + (i + 1).ToString(), - Stroke = new SolidColorBrush(ColorHelper.GetRandomColor()), }); } editor.InnerGraph.Controller = controller; + item.Editor = editor; + _multiControllers.Add(item, controller); item.RecordingStarted += () => diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml index ac207fc55..2168018d1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml @@ -280,21 +280,6 @@ </StackPanel> <Grid Grid.Row="1"> - - <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Width="275" Margin="0 15 30 0"> - <TextBlock HorizontalAlignment="Center" FontWeight="SemiBold" Foreground="Gray"> - <Run>GRAPHS FIFO CAPACITY:</Run> - <Run Text="{Binding TempGraphsDurationSeconds,Converter={StaticResource SecondsToTimeSpanConverter},Mode=OneWay,StringFormat='hh\\:mm\\:ss'}"></Run> - </TextBlock> - <Slider Margin="0 5 0 0" Minimum="1" Maximum="3600" Value="{Binding TempGraphsDurationSeconds}"> - <i:Interaction.Triggers> - <i:EventTrigger EventName="PreviewMouseUp"> - <i:InvokeCommandAction Command="{Binding UpdateGraphsDurationCommand}"></i:InvokeCommandAction> - </i:EventTrigger> - </i:Interaction.Triggers> - </Slider> - </StackPanel> - <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="20 0 0 0"> <ListBox ItemContainerStyle="{StaticResource basicListBoxItem}" ItemsSource="{Binding AvailableTechItems}" SelectedItem="{Binding SelectedTechItem,Mode=TwoWay}" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj index 48fe2b34c..5c0ff937c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Tango.MachineStudio.UsersAndRoles.csproj @@ -8,7 +8,7 @@ <OutputType>library</OutputType> <RootNamespace>Tango.MachineStudio.UsersAndRoles</RootNamespace> <AssemblyName>Tango.MachineStudio.UsersAndRoles</AssemblyName> - <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> |
