Skip to content

Commit

Permalink
UserControls coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
tomershay100 committed Apr 15, 2021
1 parent 687ca12 commit 09cdf98
Show file tree
Hide file tree
Showing 7 changed files with 269 additions and 226 deletions.
213 changes: 110 additions & 103 deletions UserControls/Gauges.xaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<UserControl x:Class="DesktopApp.UserControls.Gauges"
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:local="clr-namespace:DesktopApp.UserControls" xmlns:gauge="clr-namespace:CircularGauge;assembly=CircularGauge"
mc:Ignorable="d"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:gauge="clr-namespace:CircularGauge;assembly=CircularGauge"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="460">
<Grid Height="500" Width="460" VerticalAlignment="Top" HorizontalAlignment="Left" RenderTransformOrigin="0.517,0.09">
<Grid Height="500" Width="460" VerticalAlignment="Top" HorizontalAlignment="Left"
RenderTransformOrigin="0.517,0.09">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="182*" />
<ColumnDefinition Width="193*" />
Expand All @@ -17,106 +18,112 @@
<RowDefinition Height="1*" />
</Grid.RowDefinitions>

<gauge:CircularGaugeControl x:Name="myGauge1" Grid.Column="1" Grid.Row="1"
Radius="80"
ScaleRadius="55"
ScaleStartAngle="120"
ScaleSweepAngle="300"
PointerLength="38"
PointerCapRadius="30"
MinValue="0"
MaxValue="360"
MajorDivisionsCount="10"
MinorDivisionsCount="5"
CurrentValue="{Binding VM_Yaw}"
RangeIndicatorThickness="0"
RangeIndicatorRadius="0"
RangeIndicatorLightOffset="80"
ScaleLabelRadius="40"
ScaleLabelSize="35,12"
ScaleLabelFontSize="10"
ScaleLabelForeground="Black"
MajorTickSize="9,2"
MinorTickSize="3,1"
MajorTickColor="Black"
MinorTickColor="Black"
GaugeBackgroundColor ="#AAC9CE"
PointerThickness ="13"
DialTextOffset="50"
DialText="YAW"
DialTextColor="Black" Margin="0,6,0,160" Grid.RowSpan="2">
</gauge:CircularGaugeControl>
<gauge:CircularGaugeControl Grid.Column="1" Grid.Row="1"
Radius="80"
ScaleRadius="55"
ScaleStartAngle="120"
ScaleSweepAngle="300"
PointerLength="38"
PointerCapRadius="30"
MinValue="0"
MaxValue="360"
MajorDivisionsCount="10"
MinorDivisionsCount="5"
CurrentValue="{Binding VM_Yaw}"
RangeIndicatorThickness="0"
RangeIndicatorRadius="0"
RangeIndicatorLightOffset="80"
ScaleLabelRadius="40"
ScaleLabelSize="35,12"
ScaleLabelFontSize="10"
ScaleLabelForeground="Black"
MajorTickSize="9,2"
MinorTickSize="3,1"
MajorTickColor="Black"
MinorTickColor="Black"
GaugeBackgroundColor="#AAC9CE"
PointerThickness="13"
DialTextOffset="50"
DialText="YAW"
DialTextColor="Black" Margin="0,6,0,160" Grid.RowSpan="2" />

<gauge:CircularGaugeControl x:Name="myGauge2" Grid.Column="0" Grid.Row="1"
Radius="80"
ScaleRadius="55"
ScaleStartAngle="120"
ScaleSweepAngle="300"
PointerLength="38"
PointerCapRadius="30"
MinValue="0"
MaxValue="360"
MajorDivisionsCount="10"
MinorDivisionsCount="5"
CurrentValue="{Binding VM_Roll}"
RangeIndicatorThickness="0"
RangeIndicatorRadius="0"
RangeIndicatorLightOffset="80"
ScaleLabelRadius="45"
ScaleLabelSize="35,12"
ScaleLabelFontSize="10"
ScaleLabelForeground="Black"
MajorTickSize="9,2"
MinorTickSize="3,1"
MajorTickColor="Black"
MinorTickColor="Black"
GaugeBackgroundColor ="#AAC9CE"
PointerThickness ="16"
DialTextOffset="50"
DialText="ROLL"
DialTextColor="Black" Margin="0,6,0,161" Grid.RowSpan="2">
</gauge:CircularGaugeControl>
<gauge:CircularGaugeControl Grid.Column="0" Grid.Row="1"
Radius="80"
ScaleRadius="55"
ScaleStartAngle="120"
ScaleSweepAngle="300"
PointerLength="38"
PointerCapRadius="30"
MinValue="0"
MaxValue="360"
MajorDivisionsCount="10"
MinorDivisionsCount="5"
CurrentValue="{Binding VM_Roll}"
RangeIndicatorThickness="0"
RangeIndicatorRadius="0"
RangeIndicatorLightOffset="80"
ScaleLabelRadius="45"
ScaleLabelSize="35,12"
ScaleLabelFontSize="10"
ScaleLabelForeground="Black"
MajorTickSize="9,2"
MinorTickSize="3,1"
MajorTickColor="Black"
MinorTickColor="Black"
GaugeBackgroundColor="#AAC9CE"
PointerThickness="16"
DialTextOffset="50"
DialText="ROLL"
DialTextColor="Black" Margin="0,6,0,161" Grid.RowSpan="2" />

<gauge:CircularGaugeControl x:Name="myGauge3" Grid.Column="0" Grid.Row="1"
Radius="80"
ScaleRadius="55"
ScaleStartAngle="120"
ScaleSweepAngle="300"
PointerLength="38"
PointerCapRadius="30"
MinValue="0"
MaxValue="360"
MajorDivisionsCount="10"
MinorDivisionsCount="5"
CurrentValue="{Binding VM_Pitch}"
RangeIndicatorThickness="0"
RangeIndicatorRadius="0"
RangeIndicatorLightOffset="80"
ScaleLabelRadius="45"
ScaleLabelSize="35,12"
ScaleLabelFontSize="10"
ScaleLabelForeground="Black"
MajorTickSize="9,2"
MinorTickSize="3,1"
MajorTickColor="Black"
MinorTickColor="Black"
GaugeBackgroundColor ="#AAC9CE"
PointerThickness ="16"
DialTextOffset="50"
DialText="PITCH"
DialTextColor="Black" Margin="92,158,101,8" Grid.RowSpan="2" Grid.ColumnSpan="2">
</gauge:CircularGaugeControl>
<gauge:CircularGaugeControl Grid.Column="0" Grid.Row="1"
Radius="80"
ScaleRadius="55"
ScaleStartAngle="120"
ScaleSweepAngle="300"
PointerLength="38"
PointerCapRadius="30"
MinValue="0"
MaxValue="360"
MajorDivisionsCount="10"
MinorDivisionsCount="5"
CurrentValue="{Binding VM_Pitch}"
RangeIndicatorThickness="0"
RangeIndicatorRadius="0"
RangeIndicatorLightOffset="80"
ScaleLabelRadius="45"
ScaleLabelSize="35,12"
ScaleLabelFontSize="10"
ScaleLabelForeground="Black"
MajorTickSize="9,2"
MinorTickSize="3,1"
MajorTickColor="Black"
MinorTickColor="Black"
GaugeBackgroundColor="#AAC9CE"
PointerThickness="16"
DialTextOffset="50"
DialText="PITCH"
DialTextColor="Black" Margin="92,158,101,8" Grid.RowSpan="2" Grid.ColumnSpan="2" />

<Canvas Grid.Column="1" Margin="0,-12,0,12">
<Image Source="pack://application:,,,/Resources/cloud.png" Height="135" Canvas.Left="40" Width="142" Canvas.Top="2"/>
<Label x:Name ="directionLable" Content="Direction" FontWeight="Bold" FontSize="16" Canvas.Left="70" Canvas.Top="78" Height="29" Width="81"/>
<TextBlock Canvas.Left="78" FontSize="14" Canvas.Top="61" Text="{Binding VM_Direction}" TextAlignment="Center" TextWrapping="Wrap" Width="64" Background="Transparent" Height="26"/>
<Image Source="pack://application:,,,/Resources/cloud.png" Height="134" Canvas.Left="-180" Width="142" Canvas.Top="2"/>
<Label x:Name ="alimeterLable" Content="Alimeter" FontWeight="Bold" FontSize="16" Canvas.Left="-150" Canvas.Top="78" Height="28" Width="81"/>
<TextBlock Canvas.Left="-142" FontSize="14" Canvas.Top="61" Text="{Binding VM_Alimeter}" TextAlignment="Center" TextWrapping="Wrap" Width="64" Background="Transparent" Height="26"/>
<Image Source="pack://application:,,,/Resources/cloud.png" Height="135" Canvas.Left="-66" Canvas.Top="71" Width="142"/>
<Label x:Name ="airSpeedLable" Content="Air Speed" FontWeight="Bold" FontSize="16" Canvas.Left="-36" Canvas.Top="147" Height="29" Width="81"/>
<TextBlock Canvas.Left="-28" FontSize="14" Canvas.Top="130" Text="{Binding VM_AirSpeed}" TextAlignment="Center" TextWrapping="Wrap" Width="64" Background="Transparent" Height="26"/>
<Canvas Grid.Row="0" Grid.Column="1" Margin="0,-12,0,12">
<Image Source="pack://application:,,,/Resources/cloud.png" Height="135" Canvas.Left="40" Width="142"
Canvas.Top="2" />
<Label Content="Direction" FontWeight="Bold" FontSize="16" Canvas.Left="70" Canvas.Top="78" Height="29"
Width="81" />
<TextBlock Canvas.Left="78" FontSize="14" Canvas.Top="61" Text="{Binding VM_Direction}"
TextAlignment="Center" TextWrapping="Wrap" Width="64" Background="Transparent" Height="26" />
<Image Source="pack://application:,,,/Resources/cloud.png" Height="134" Canvas.Left="-180" Width="142"
Canvas.Top="2" />
<Label Content="Alimeter" FontWeight="Bold" FontSize="16" Canvas.Left="-150" Canvas.Top="78" Height="28"
Width="81" />
<TextBlock Canvas.Left="-142" FontSize="14" Canvas.Top="61" Text="{Binding VM_Alimeter}"
TextAlignment="Center" TextWrapping="Wrap" Width="64" Background="Transparent" Height="26" />
<Image Source="pack://application:,,,/Resources/cloud.png" Height="135" Canvas.Left="-66" Canvas.Top="71"
Width="142" />
<Label Content="Air Speed" FontWeight="Bold" FontSize="16" Canvas.Left="-36" Canvas.Top="147" Height="29"
Width="81" />
<TextBlock Canvas.Left="-28" FontSize="14" Canvas.Top="130" Text="{Binding VM_AirSpeed}"
TextAlignment="Center" TextWrapping="Wrap" Width="64" Background="Transparent" Height="26" />
</Canvas>
</Grid>
</UserControl>
</UserControl>
15 changes: 2 additions & 13 deletions UserControls/Gauges.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
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;
using System.Windows.Controls;

namespace DesktopApp.UserControls
{
Expand All @@ -23,4 +12,4 @@ public Gauges()
InitializeComponent();
}
}
}
}
41 changes: 25 additions & 16 deletions UserControls/GraphsUC.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<UserControl x:Class="DesktopApp.UserControls.GraphsUC"
<UserControl x:Class="DesktopApp.UserControls.GraphsUc"
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:local="clr-namespace:DesktopApp.UserControls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:oxy="http://oxyplot.org/wpf"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="650" d:DesignWidth="921">
<Grid>
<ListBox x:Name="columnsName" ItemsSource="{Binding VM_AllFeatures}" SelectedItem="{Binding VM_Curr_Column}" HorizontalAlignment="Left" Height="393" Margin="10,10,0,0" VerticalAlignment="Top" Width="181"/>
<ListBox x:Name="ColumnsName" ItemsSource="{Binding VM_AllFeatures}" SelectedItem="{Binding VM_CurrColumn}"
HorizontalAlignment="Left" Height="393" Margin="10,10,0,0" VerticalAlignment="Top" Width="181" />
<oxy:Plot x:Name="Graph" Margin="200,33,371,389">
<oxy:Plot.Series>
<oxy:LineSeries ItemsSource="{Binding VM_CurrentDataPoints}" />
Expand All @@ -19,19 +19,28 @@
<oxy:LineSeries ItemsSource="{Binding VM_CorrelatedDataPoints}" />
</oxy:Plot.Series>
</oxy:Plot>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="230,3,0,0" TextWrapping="Wrap" Text="{Binding VM_Curr_Column}" VerticalAlignment="Top" Width="312" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="592,0,0,0" TextWrapping="Wrap" Text="{Binding VM_Correlated_column}" VerticalAlignment="Top" Width="311" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="230,3,0,0" TextWrapping="Wrap"
Text="{Binding VM_CurrColumn}" VerticalAlignment="Top" Width="312" FontSize="20" />
<TextBlock HorizontalAlignment="Left" Height="30" Margin="592,0,0,0" TextWrapping="Wrap"
Text="{Binding VM_CorrelatedColumn}" VerticalAlignment="Top" Width="311" FontSize="20" />
<oxy:Plot x:Name="MultiGraph" Margin="200,266,371,11">
<oxy:Plot.Series>
<oxy:LineSeries ItemsSource="{Binding VM_LinearReg}"/>
<oxy:LineSeries ItemsSource="{Binding VM_MultiDataPoints}" Color="Transparent" MarkerFill="SteelBlue" MarkerType="Circle" />
<oxy:LineSeries ItemsSource="{Binding VM_LastMultiDataPoints}" Color="Transparent" MarkerFill="DeepPink" MarkerType="Circle" />
<oxy:LineSeries ItemsSource="{Binding VM_LinearReg}" />
<oxy:LineSeries ItemsSource="{Binding VM_MultiDataPoints}" Color="Transparent" MarkerFill="SteelBlue"
MarkerType="Circle" />
<oxy:LineSeries ItemsSource="{Binding VM_LastMultiDataPoints}" Color="Transparent"
MarkerFill="DeepPink" MarkerType="Circle" />
</oxy:Plot.Series>
</oxy:Plot>
<Button x:Name="DLLFile" Content="Upload DLL File" HorizontalAlignment="Left" Height="48" Margin="10,560,0,0" VerticalAlignment="Top" Width="181" Click="DLLFile_Click" FontSize="20"/>
<Button x:Name="DllFile" Content="Upload DLL File" HorizontalAlignment="Left" Height="48" Margin="10,560,0,0"
VerticalAlignment="Top" Width="181" Click="DLLFile_Click" FontSize="20" />
<oxy:PlotView Model="{Binding VM_DllPlotModel}" Margin="550,330,10,11" />
<TextBlock HorizontalAlignment="Left" Height="59" Margin="582,266,0,0" TextWrapping="Wrap" Text="{Binding VM_DllTitle}" VerticalAlignment="Top" Width="329" FontSize="15"/>
<ListBox x:Name="AnomaliesPoints" ItemsSource="{Binding VM_DllAnomaiesList}" HorizontalAlignment="Left" Height="107" Margin="10,448,0,0" VerticalAlignment="Top" Width="181" SelectionChanged="AnomaliesPoints_SelectionChanged"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="10,408,0,0" TextWrapping="Wrap" Text="Anomalies List" VerticalAlignment="Top" Width="181" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="59" Margin="582,266,0,0" TextWrapping="Wrap"
Text="{Binding VM_DllTitle}" VerticalAlignment="Top" Width="329" FontSize="15" />
<ListBox x:Name="AnomaliesPoints" ItemsSource="{Binding VM_DllAnomaliesList}" HorizontalAlignment="Left"
Height="107" Margin="10,448,0,0" VerticalAlignment="Top" Width="181"
SelectionChanged="AnomaliesPoints_SelectionChanged" />
<TextBlock HorizontalAlignment="Left" Height="35" Margin="10,408,0,0" TextWrapping="Wrap" Text="Anomalies List"
VerticalAlignment="Top" Width="181" FontSize="20" />
</Grid>
</UserControl>
</UserControl>
Loading

0 comments on commit 09cdf98

Please sign in to comment.