diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-16 18:22:47 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-16 18:22:47 +0300 |
| commit | b9ff3e2b899b22090b5d206c1f95189aa7fd7ecb (patch) | |
| tree | 2e2851d21fbf8304ff2ada7e3089c342547dd95d /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common | |
| parent | 62600b93f932aa2751d6f0c00f4699a7eb2d7c7b (diff) | |
| download | Tango-b9ff3e2b899b22090b5d206c1f95189aa7fd7ecb.tar.gz Tango-b9ff3e2b899b22090b5d206c1f95189aa7fd7ecb.zip | |
New Settings Library.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common')
7 files changed, 112 insertions, 79 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml index 2f43869d5..fc36b28d3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphControl.xaml @@ -18,36 +18,32 @@ <ResourceDictionary Source="pack://application:,,,/RealTimeGraphEx;component/Resources/Resources.xaml"></ResourceDictionary> <ResourceDictionary Source="../Resources/MaterialDesign.xaml"></ResourceDictionary> - <ResourceDictionary> - <Style TargetType="ContentControl" x:Key="graphContent"> - <Style.Setters> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> - <Grid MouseEnter="Graph_MouseEnter" MouseLeave="Graph_MouseLeave" ClipToBounds="True"> - <ContentControl Content="{Binding}"></ContentControl> - <Grid Opacity="0.8" HorizontalAlignment="Stretch" VerticalAlignment="Top" ClipToBounds="True" Height="35" Margin="0 -35 0 0"> - <StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Right" VerticalAlignment="Top"> - <Button Margin="0 0 5 0" Click="OnGraphFullScreen" ToolTip="Full Screen" Width="24" Height="24" BorderBrush="Transparent" Background="{StaticResource AccentColorBrush}" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" > - <materialDesign:PackIcon Kind="Fullscreen" HorizontalAlignment="Right" Width="20" Height="20" Foreground="{StaticResource WhiteBrush}" /> - </Button> - <Button Click="OnGraphRemove" ToolTip="Remove" Width="24" Height="24" BorderBrush="Transparent" Background="#FF7777" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" > - <materialDesign:PackIcon Kind="CloseCircle" HorizontalAlignment="Right" Width="20" Height="20" Foreground="{StaticResource WhiteBrush}" /> - </Button> - </StackPanel> - </Grid> - </Grid> - </DataTemplate> - </Setter.Value> - </Setter> - </Style.Setters> - </Style> - </ResourceDictionary> - - <ResourceDictionary> - <converters:SecondsToGraphPointsConverter x:Key="secondsToPoints"></converters:SecondsToGraphPointsConverter> - </ResourceDictionary> - </ResourceDictionary.MergedDictionaries> + <ResourceDictionary> + <Style TargetType="ContentControl" x:Key="graphContent"> + <Style.Setters> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <Grid MouseEnter="Graph_MouseEnter" MouseLeave="Graph_MouseLeave" ClipToBounds="True"> + <ContentControl Content="{Binding}"></ContentControl> + <Grid Opacity="0.8" HorizontalAlignment="Stretch" VerticalAlignment="Top" ClipToBounds="True" Height="35" Margin="0 -35 0 0"> + <StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Right" VerticalAlignment="Top"> + <Button Margin="0 0 5 0" Click="OnGraphFullScreen" ToolTip="Full Screen" Width="24" Height="24" BorderBrush="Transparent" Background="{StaticResource AccentColorBrush}" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" > + <materialDesign:PackIcon Kind="Fullscreen" HorizontalAlignment="Right" Width="20" Height="20" Foreground="{StaticResource WhiteBrush}" /> + </Button> + <Button Click="OnGraphRemove" ToolTip="Remove" Width="24" Height="24" BorderBrush="Transparent" Background="#FF7777" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" > + <materialDesign:PackIcon Kind="CloseCircle" HorizontalAlignment="Right" Width="20" Height="20" Foreground="{StaticResource WhiteBrush}" /> + </Button> + </StackPanel> + </Grid> + </Grid> + </DataTemplate> + </Setter.Value> + </Setter> + </Style.Setters> + </Style> + </ResourceDictionary> + </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </UserControl.Resources> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml index 5548c452e..657cc2683 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/RealTimeGraphMultiControl.xaml @@ -18,36 +18,32 @@ <ResourceDictionary Source="pack://application:,,,/RealTimeGraphEx;component/Resources/Resources.xaml"></ResourceDictionary> <ResourceDictionary Source="../Resources/MaterialDesign.xaml"></ResourceDictionary> - <ResourceDictionary> - <Style TargetType="ContentControl" x:Key="graphContent"> - <Style.Setters> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> - <Grid MouseEnter="Graph_MouseEnter" MouseLeave="Graph_MouseLeave" ClipToBounds="True"> - <ContentControl Content="{Binding}"></ContentControl> - <Grid Opacity="0.8" HorizontalAlignment="Stretch" VerticalAlignment="Top" ClipToBounds="True" Height="35" Margin="0 -35 0 0"> - <StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Right" VerticalAlignment="Top"> - <Button Margin="0 0 5 0" Click="OnGraphFullScreen" ToolTip="Full Screen" Width="24" Height="24" BorderBrush="Transparent" Background="{StaticResource AccentColorBrush}" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" > - <materialDesign:PackIcon Kind="Fullscreen" HorizontalAlignment="Right" Width="20" Height="20" Foreground="{StaticResource WhiteBrush}" /> - </Button> - <Button Click="OnGraphRemove" ToolTip="Remove" Width="24" Height="24" BorderBrush="Transparent" Background="#FF7777" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" > - <materialDesign:PackIcon Kind="CloseCircle" HorizontalAlignment="Right" Width="20" Height="20" Foreground="{StaticResource WhiteBrush}" /> - </Button> - </StackPanel> - </Grid> - </Grid> - </DataTemplate> - </Setter.Value> - </Setter> - </Style.Setters> - </Style> - </ResourceDictionary> - - <ResourceDictionary> - <converters:SecondsToGraphPointsConverter x:Key="secondsToPoints"></converters:SecondsToGraphPointsConverter> - </ResourceDictionary> - </ResourceDictionary.MergedDictionaries> + <ResourceDictionary> + <Style TargetType="ContentControl" x:Key="graphContent"> + <Style.Setters> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <Grid MouseEnter="Graph_MouseEnter" MouseLeave="Graph_MouseLeave" ClipToBounds="True"> + <ContentControl Content="{Binding}"></ContentControl> + <Grid Opacity="0.8" HorizontalAlignment="Stretch" VerticalAlignment="Top" ClipToBounds="True" Height="35" Margin="0 -35 0 0"> + <StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Right" VerticalAlignment="Top"> + <Button Margin="0 0 5 0" Click="OnGraphFullScreen" ToolTip="Full Screen" Width="24" Height="24" BorderBrush="Transparent" Background="{StaticResource AccentColorBrush}" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" > + <materialDesign:PackIcon Kind="Fullscreen" HorizontalAlignment="Right" Width="20" Height="20" Foreground="{StaticResource WhiteBrush}" /> + </Button> + <Button Click="OnGraphRemove" ToolTip="Remove" Width="24" Height="24" BorderBrush="Transparent" Background="#FF7777" Style="{StaticResource MaterialDesignFloatingActionAccentButton}" > + <materialDesign:PackIcon Kind="CloseCircle" HorizontalAlignment="Right" Width="20" Height="20" Foreground="{StaticResource WhiteBrush}" /> + </Button> + </StackPanel> + </Grid> + </Grid> + </DataTemplate> + </Setter.Value> + </Setter> + </Style.Setters> + </Style> + </ResourceDictionary> + </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </UserControl.Resources> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs index 53e832eb5..80e54d143 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/GraphsHelper.cs @@ -21,8 +21,10 @@ namespace Tango.MachineStudio.Common.Helpers { try { - double seconds = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsDuration; - double pullRate = SettingsManager.Default.MachineStudio.TechnicianModule.GraphsPullingInterval; + var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>(); + + double seconds = settings.GraphsViewDurationSeconds; + double pullRate = settings.DiagnosticsResponseIntervalMilli; return (int)(((pullRate * pointsPerFrame * 10 * seconds) * (10 / pullRate)) * 0.65); } catch (Exception) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/OutlookHelper.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/OutlookHelper.cs deleted file mode 100644 index 58138b625..000000000 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Helpers/OutlookHelper.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.MachineStudio.Common.Helpers -{ - public static class OutlookHelper - { - - } -} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs new file mode 100644 index 000000000..b12d9a580 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Logging; +using Tango.Settings; + +namespace Tango.MachineStudio.Common +{ + public class MachineStudioSettings : SettingsBase + { + /// <summary> + /// Gets or sets the last login email. + /// </summary> + public String LastLoginEmail { get; set; } + + /// <summary> + /// Gets or sets the last login password. + /// </summary> + public String LastLoginPassword { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to save the user credentials. + /// </summary> + public bool RememberMe { get; set; } + + /// <summary> + /// Gets or sets the last virtual machine serial number. + /// </summary> + public String LastVirtualMachineSerialNumber { get; set; } + + /// <summary> + /// Gets or sets the update service address. + /// </summary> + public String UpdateServiceAddress { get; set; } + + /// <summary> + /// Gets or sets the logging categories. + /// </summary> + public List<LogCategory> LoggingCategories { get; set; } + + /// <summary> + /// Initializes a new instance of the <see cref="MachineStudio"/> class. + /// </summary> + public MachineStudioSettings() + { + LoggingCategories = new List<LogCategory>(); + UpdateServiceAddress = "http://twine01/MachineStudioUpdateService/MachineStudioUpdateService.svc"; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index df1ee23dc..a635e17ed 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -90,17 +90,17 @@ </Compile> <Compile Include="Controls\TableGrid.cs" /> <Compile Include="Converters\PermissionToVisibilityConverter.cs" /> - <Compile Include="Converters\SecondsToGraphPointsConverter.cs" /> + <None Include="Converters\SecondsToGraphPointsConverter.cs" /> <Compile Include="Diagnostics\DefaultDiagnosticsFrameProvider.cs" /> <Compile Include="Diagnostics\IDiagnosticsFrameProvider.cs" /> <Compile Include="EventLogging\DefaultEventLogger.cs" /> <Compile Include="EventLogging\IEventLogger.cs" /> <Compile Include="ExtensionMethods\CommonDialogExtensions.cs" /> <Compile Include="ExtensionMethods\TangoIOCExtensions.cs" /> - <Compile Include="Helpers\OutlookHelper.cs" /> <Compile Include="Html\IHtmlPresenter.cs" /> - <Compile Include="Helpers\GraphsHelper.cs" /> + <None Include="Helpers\GraphsHelper.cs" /> <Compile Include="IStudioViewModel.cs" /> + <Compile Include="MachineStudioSettings.cs" /> <Compile Include="Messages\MachineConnectionChangedMessage.cs" /> <Compile Include="Notifications\BarItem.cs" /> <Compile Include="Notifications\DialogViewVM.cs" /> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UpdateServiceHelper.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UpdateServiceHelper.cs index 87b974b99..2194ec5cf 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UpdateServiceHelper.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/UpdateServiceHelper.cs @@ -23,7 +23,7 @@ namespace Tango.MachineStudio.Common.Update binding.ReaderQuotas.MaxArrayLength = 6553600; binding.ReaderQuotas.MaxBytesPerRead = 6553600; - return new ChannelFactory<IMachineStudioUpdateService>(binding, SettingsManager.Default.MachineStudio.UpdateServiceAddress); + return new ChannelFactory<IMachineStudioUpdateService>(binding, SettingsManager.Default.GetOrCreate<MachineStudioSettings>().UpdateServiceAddress); } } } |
