Skip to content

Commit

Permalink
Change Plot to verify tracking rates. Also removed all WindowChrome r…
Browse files Browse the repository at this point in the history
…eferences. New version number.
  • Loading branch information
rmorgan001 committed Mar 29, 2022
1 parent 16ce4ed commit 4f758ae
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 58 deletions.
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<Trademark>GS Server</Trademark>
<NeutralLanguage>en</NeutralLanguage>
<Copyright>Copyright © GreenSwamp Software 2019-2022</Copyright>
<AssemblyVersion>1.0.4.3</AssemblyVersion>
<FileVersion>1.0.4.3</FileVersion>
<ProductVersion>1.0.4.3</ProductVersion>
<Version>1.0.4.3</Version>
<AssemblyVersion>1.0.4.4</AssemblyVersion>
<FileVersion>1.0.4.4</FileVersion>
<ProductVersion>1.0.4.4</ProductVersion>
<Version>1.0.4.4</Version>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions GS.ChartViewer/Controls/WindowTitleBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<Label Content="{Binding Version}" VerticalAlignment="Center" Foreground="{DynamicResource PrimaryHueLightBrush}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="5 0">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{DynamicResource PrimaryHueMidBrush}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MinimizeWindowCommand}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{DynamicResource PrimaryHueMidBrush}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MinimizeWindowCommand}" >
<md:PackIcon Kind="WindowMinimize" VerticalAlignment="Center" Width="25" Height="25" Foreground="{DynamicResource PrimaryHueLightBrush}" />
</Button>
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MaximizeWindowCommand}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MaximizeWindowCommand}" >
<md:PackIcon Kind="WindowMaximize" VerticalAlignment="Center" Width="25" Height="25" Foreground="{StaticResource PrimaryHueLightBrush}" />
</Button>
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{DynamicResource PrimaryHueMidBrush}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding ClickCloseAppCommand}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{DynamicResource PrimaryHueMidBrush}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding ClickCloseAppCommand}" >
<md:PackIcon Kind="Power" VerticalAlignment="Center" Width="25" Height="25" Foreground="{DynamicResource PrimaryHueLightBrush}" />
</Button>
</StackPanel>
Expand Down
16 changes: 2 additions & 14 deletions GS.ChartViewer/Main/MainWindowV.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,21 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" TextElement.FontSize="14" ResizeMode="CanResizeWithGrip" WindowStyle="None"
xmlns:properties="clr-namespace:GS.ChartViewer.Properties"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" TextElement.FontSize="14" ResizeMode="CanResizeWithGrip" WindowStyle="None" AllowsTransparency="True" xmlns:properties="clr-namespace:GS.ChartViewer.Properties"
xmlns:controls="clr-namespace:GS.ChartViewer.Controls"
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:Interactions="http://schemas.microsoft.com/xaml/behaviors"
xmlns:shared="clr-namespace:GS.Shared;assembly=GS.Shared"
xmlns:enums="clr-namespace:LiveCharts.Geared;assembly=LiveCharts.Geared"
xmlns:main="clr-namespace:GS.ChartViewer.Main"
xmlns:domain1="clr-namespace:GS.Shared.Domain;assembly=GS.Shared"
Closed="MainWindow_OnClosed" TextOptions.TextFormattingMode="Display"
WindowState="{Binding WindowState, Source={x:Static properties:ChartViewer.Default}, Mode=TwoWay}"
xmlns:domain1="clr-namespace:GS.Shared.Domain;assembly=GS.Shared" Closed="MainWindow_OnClosed" TextOptions.TextFormattingMode="Display" ContentRendered="MainWindow_OnContentRendered" WindowState="{Binding WindowState, Source={x:Static properties:ChartViewer.Default}, Mode=TwoWay}"
Height="{Binding WindowHeight, Source={x:Static properties:ChartViewer.Default}, Mode=TwoWay}"
Width="{Binding WindowWidth, Source={x:Static properties:ChartViewer.Default}, Mode=TwoWay}"
Left="{Binding WindowLeft, Source={x:Static properties:ChartViewer.Default}, Mode=TwoWay}"
Top="{Binding WindowTop, Source={x:Static properties:ChartViewer.Default}, Mode=TwoWay}"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}" Title="GS LogView" FontSize="13" d:DataContext="{d:DesignInstance main:MainWindowVM}">
<WindowChrome.WindowChrome>
<WindowChrome
ResizeBorderThickness="6"
CaptionHeight="30"
CornerRadius="5,5,5,5"
GlassFrameThickness="0">
</WindowChrome>
</WindowChrome.WindowChrome>
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
<Style TargetType="{x:Type ScrollBar}">
Expand Down
5 changes: 5 additions & 0 deletions GS.ChartViewer/Main/MainWindowV.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,10 @@ private void Dispose(bool disposing)
//}
}
#endregion

private void MainWindow_OnContentRendered(object sender, EventArgs e)
{
MouseLeftButtonDown += delegate { DragMove(); };
}
}
}
10 changes: 5 additions & 5 deletions GS.Server/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public App()
{
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve;

// overloaded mutex constructor which outs a boolean
// telling if the mutex is new or not.
// overloaded mutex constructor which outs a boolean telling if the mutex is new or not.
// see http://msdn.microsoft.com/en-us/library/System.Threading.Mutex.aspx
_mutex = new Mutex(true, MutexName, out createdNew);
if (createdNew) return;
Expand Down Expand Up @@ -80,16 +79,17 @@ private void Application_DispatcherUnhandledException(object sender, System.Wind
{
DispatcherUnhandledException -= Application_DispatcherUnhandledException;
WriteException(e.Exception);
MessageBox.Show("An unexpected error has occurred within GSS. Error details have been logged and GSS will now close.", "Application Error", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("An unexpected error has occurred within GSS. Error details have been logged and GSS will now close. " + e.Exception.Message , "Application Error", MessageBoxButton.OK, MessageBoxImage.Error);
e.Handled = true;
this.Shutdown();
}

void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
AppDomain.CurrentDomain.UnhandledException -= CurrentDomain_UnhandledException;
WriteException((Exception)e.ExceptionObject);
MessageBox.Show("An unexpected error has occurred within GSS. Error details have been logged and GSS will now close.", "Application Error", MessageBoxButton.OK, MessageBoxImage.Error);
var ex = (Exception)e.ExceptionObject;
WriteException(ex);
MessageBox.Show("An unexpected error has occurred within GSS. Error details have been logged and GSS will now close." + ex.Message, "Application Error", MessageBoxButton.OK, MessageBoxImage.Error);
this.Shutdown();
}

Expand Down
8 changes: 4 additions & 4 deletions GS.Server/Controls/WindowTitleBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</Grid.ColumnDefinitions>
<DockPanel Grid.Column="0" Dock="Left" Background="{Binding MountTypeColor}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="5,0,0,0">
<CheckBox WindowChrome.IsHitTestVisibleInChrome="True" IsChecked="{Binding TopMost}" >
<CheckBox IsChecked="{Binding TopMost}" >
<CheckBox.Resources>
<!-- ReSharper disable once Xaml.RedundantResource Unchecked state-->
<SolidColorBrush x:Key="MaterialDesignCheckBoxOff" Color="{StaticResource Primary900Foreground}" />
Expand All @@ -30,14 +30,14 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Text="{StaticResource titleApps}" Foreground="{StaticResource PrimaryHueLightBrush}"/>
<TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Text="{Binding AppCount}" Foreground="{StaticResource PrimaryHueLightBrush}"/>
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MinimizeWindowCommand}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MinimizeWindowCommand}">
<md:PackIcon Kind="WindowMinimize" VerticalAlignment="Center" Width="25" Height="25" Foreground="{StaticResource PrimaryHueLightBrush}" />
</Button>
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MaximizeWindowCommand}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MaximizeWindowCommand}">
<md:PackIcon Kind="WindowMaximize" VerticalAlignment="Center" Width="25" Height="25" Foreground="{StaticResource PrimaryHueLightBrush}" />
</Button>
<md:DialogHost HorizontalAlignment="Left" VerticalAlignment="Bottom" CloseOnClickAway="True" IsOpen="{Binding IsCloseDialogOpen}" DialogContent="{Binding CloseContent}">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{StaticResource PrimaryHueLightBrush}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding OpenCloseDialogCommand}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{StaticResource PrimaryHueLightBrush}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding OpenCloseDialogCommand}">
<md:PackIcon Kind="Power" VerticalAlignment="Center" Width="25" Height="25" Foreground="{StaticResource PrimaryHueLightBrush}" />
</Button>
</md:DialogHost>
Expand Down
8 changes: 4 additions & 4 deletions GS.Server/Controls/WindowTitleBarBasic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</Grid.ColumnDefinitions>
<DockPanel Grid.Column="0" Dock="Left">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="5,0,0,0">
<CheckBox WindowChrome.IsHitTestVisibleInChrome="True" IsChecked="{Binding TopMost}">
<CheckBox IsChecked="{Binding TopMost}">
<CheckBox.Resources>
<!-- ReSharper disable once Xaml.RedundantResource Unchecked state-->
<SolidColorBrush x:Key="MaterialDesignCheckBoxOff" Color="{StaticResource Primary900Foreground}" />
Expand All @@ -26,13 +26,13 @@
</DockPanel>
<DockPanel Grid.Column="1" Dock="Right">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MinimizeWindowCommand}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MinimizeWindowCommand}">
<md:PackIcon Kind="WindowMinimize" VerticalAlignment="Center" Width="25" Height="25" Foreground="{StaticResource PrimaryHueLightBrush}" />
</Button>
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MaximizeWindowCommand}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding MaximizeWindowCommand}" >
<md:PackIcon Kind="WindowMaximize" VerticalAlignment="Center" Width="25" Height="25" Foreground="{StaticResource PrimaryHueLightBrush}" />
</Button>
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding OpenCloseWindowCmd}" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Width="30" Height="30" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}" Command="{Binding OpenCloseWindowCmd}">
<md:PackIcon Kind="Power" VerticalAlignment="Center" Width="25" Height="25" Foreground="{StaticResource PrimaryHueLightBrush}" />
</Button>
</StackPanel>
Expand Down
2 changes: 1 addition & 1 deletion GS.Server/Main/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</Grid.RowDefinitions>
<controls:WindowTitleBar Grid.Row="0"/>
<controls:TabBar Grid.Row="1"/>
<Grid Grid.Row="2" Background="{DynamicResource MaterialDesignPaper}">
<Grid Grid.Row="2" Background="{DynamicResource MaterialDesignPaper}">
<ContentControl Content="{Binding CurrentPageViewModel}"/>
</Grid>
</Grid>
Expand Down
1 change: 0 additions & 1 deletion GS.Server/Main/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ private void StartOnTop()

private void MainWindow_OnContentRendered(object sender, EventArgs e)
{
// Topmost = Properties.Server.Default.StartOnTop;
Memory.FlushMemory();
SetOnScreen(this);
MouseLeftButtonDown += delegate { DragMove(); };
Expand Down
6 changes: 3 additions & 3 deletions GS.Server/Plot/PlotV.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
</wpf:Axis>
</wpf:CartesianChart.AxisY>
</wpf:CartesianChart>
<ListView Grid.Row="1" BorderThickness="0" Opacity="1" HorizontalAlignment="Left" Margin="130,30,0,0" Name="ListView1" VerticalAlignment="Top" ItemsSource="{Binding TitleItems}">
<ListView Grid.Row="1" BorderThickness="0" Opacity="1" HorizontalAlignment="Left" Margin="110,10,0,0" Name="ListView1" VerticalAlignment="Top" ItemsSource="{Binding TitleItems}">
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonUp">
<b:InvokeCommandAction Command="{Binding ClickPlotSeriesCmd}" CommandParameter="{Binding ElementName=ListView1, Path=SelectedItem}" />
Expand All @@ -151,8 +151,8 @@
<ListView.ItemTemplate>
<DataTemplate DataType="plot:TitleItem">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=TitleName}" Foreground="{Binding Path=Fill}" FontSize="18" />
<TextBlock Text="{Binding Path=Value}" Foreground="{Binding Path=Fill}" FontSize="18" Margin="5,0,0,0" />
<TextBlock Text="{Binding Path=TitleName}" Foreground="{Binding Path=Fill}" FontSize="25" Opacity=".5" />
<TextBlock Text="{Binding Path=Value}" Foreground="{Binding Path=Fill}" FontSize="25" Opacity=".5" Margin="10,0,0,0" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
Expand Down
9 changes: 7 additions & 2 deletions GS.Server/Plot/PlotVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private void ProcessValues1(MonitorEntry entry)
var tspan = lpoint.DateTime - fpoint.DateTime;
var vspan = Math.Abs(lpoint.Value - fpoint.Value);
var rate = vspan / raStepsPerSecond / Math.Abs(tspan.TotalSeconds);
item.Value = Numbers.TruncateD(rate, 3);
item.Value = Numbers.TruncateD(rate, 4);
}
}
break;
Expand Down Expand Up @@ -218,7 +218,7 @@ private void ProcessValues2(MonitorEntry entry)
var tspan = lpoint.DateTime - fpoint.DateTime;
var vspan = Math.Abs(lpoint.Value - fpoint.Value);
var rate = vspan / decStepsPerSecond / Math.Abs(tspan.TotalSeconds);
item.Value = Numbers.TruncateD(rate, 3);
item.Value = Numbers.TruncateD(rate, 4);
}
}
break;
Expand Down Expand Up @@ -737,6 +737,11 @@ private void ClearValues()
{
Values1?.Clear();
Values2?.Clear();

foreach (var item in TitleItems)
{
item.Value = double.NaN;
}
}

#endregion
Expand Down
Loading

0 comments on commit 4f758ae

Please sign in to comment.