Skip to content

Commit 4dbfeb0

Browse files
committed
Working Concept
1 parent d8a7333 commit 4dbfeb0

18 files changed

+586
-14
lines changed

AttitudeIndicator.sln

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AttitudeIndicator", "Attitu
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDPListener", "UDPListener\UDPListener.csproj", "{17758E9B-CFF7-4640-A078-4E730B46E2A3}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AttitudeIndicatorDisplay", "AttitudeIndicatorDisplay\AttitudeIndicatorDisplay.csproj", "{B1DF9DD3-F092-4FC2-8A59-3969B8706D66}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +23,10 @@ Global
2123
{17758E9B-CFF7-4640-A078-4E730B46E2A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
2224
{17758E9B-CFF7-4640-A078-4E730B46E2A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
2325
{17758E9B-CFF7-4640-A078-4E730B46E2A3}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{B1DF9DD3-F092-4FC2-8A59-3969B8706D66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{B1DF9DD3-F092-4FC2-8A59-3969B8706D66}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{B1DF9DD3-F092-4FC2-8A59-3969B8706D66}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{B1DF9DD3-F092-4FC2-8A59-3969B8706D66}.Release|Any CPU.Build.0 = Release|Any CPU
2430
EndGlobalSection
2531
GlobalSection(SolutionProperties) = preSolution
2632
HideSolutionNode = FALSE

AttitudeIndicator/AttitudeIndicator.csproj

+7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
<Generator>MSBuild:Compile</Generator>
6262
<SubType>Designer</SubType>
6363
</ApplicationDefinition>
64+
<Compile Include="AttitudeIndicatorControl.xaml.cs">
65+
<DependentUpon>AttitudeIndicatorControl.xaml</DependentUpon>
66+
</Compile>
6467
<Compile Include="EulerAnglesDisplay.xaml.cs">
6568
<DependentUpon>EulerAnglesDisplay.xaml</DependentUpon>
6669
</Compile>
@@ -76,6 +79,10 @@
7679
<Compile Include="ViewModels\SerialCommunicationViewModel.cs" />
7780
<Compile Include="ViewModels\SerialMessageProcessor.cs" />
7881
<Compile Include="ViewModels\UdpBroadcast.cs" />
82+
<Page Include="AttitudeIndicatorControl.xaml">
83+
<SubType>Designer</SubType>
84+
<Generator>MSBuild:Compile</Generator>
85+
</Page>
7986
<Page Include="EulerAnglesDisplay.xaml">
8087
<SubType>Designer</SubType>
8188
<Generator>MSBuild:Compile</Generator>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<UserControl x:Class="AttitudeIndicator.AttitudeIndicatorControl"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:AttitudeIndicator"
7+
mc:Ignorable="d"
8+
d:DesignHeight="200" d:DesignWidth="200">
9+
<Grid>
10+
11+
<Ellipse Margin="30" >
12+
<Ellipse.Fill>
13+
<SolidColorBrush Color="LightGray" Opacity="0.5"/>
14+
</Ellipse.Fill>
15+
</Ellipse>
16+
17+
<Grid x:Name="MainCircle" >
18+
<Grid.LayoutTransform>
19+
<RotateTransform Angle="{Binding Phi}" CenterX="0.5" CenterY="0.5"/>
20+
</Grid.LayoutTransform>
21+
22+
<Canvas x:Name="HorizontCanvas" />
23+
24+
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
25+
<Line VerticalAlignment="Center" X1="0" X2="20" Stroke="Black" StrokeThickness="3" />
26+
<Line VerticalAlignment="Center" X1="40" X2="60" Stroke="Black" StrokeThickness="3" />
27+
</Grid>
28+
29+
30+
</Grid>
31+
</Grid>
32+
</UserControl>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace AttitudeIndicator
17+
{
18+
/// <summary>
19+
/// Interaktionslogik für AttitudeIndicatorControl.xaml
20+
/// </summary>
21+
public partial class AttitudeIndicatorControl : UserControl
22+
{
23+
public AttitudeIndicatorControl()
24+
{
25+
InitializeComponent();
26+
27+
28+
}
29+
30+
31+
32+
33+
34+
35+
protected override void OnRender(DrawingContext drawingContext)
36+
{
37+
base.OnRender(drawingContext);
38+
39+
this.HorizontCanvas.Children.Clear();
40+
41+
var col = Brushes.Black;
42+
43+
44+
var ln = new Line() { X1 = 10, X2 = 100, Y1 = 50, Y2 = 50, Fill=col};
45+
46+
this.HorizontCanvas.Children.Add(ln);
47+
48+
49+
}
50+
51+
52+
53+
54+
55+
}
56+
}

AttitudeIndicator/EulerAnglesDisplay.xaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
<ColumnDefinition Width="*"/>
2121
</Grid.ColumnDefinitions>
2222

23-
<TextBlock Text="Pitch" Margin="1" Grid.Row="0" />
23+
<TextBlock Text="Yaw" Margin="1" Grid.Row="0" />
2424
<TextBlock Text="&#x03C8; :" FontSize="25" HorizontalAlignment="Stretch" TextBlock.TextAlignment="Center" Grid.Row="1"/>
2525
<TextBlock Text="{Binding Psi, StringFormat=N2}" VerticalAlignment="Center" FontSize="25" Grid.Column="1" Grid.Row="1"/>
2626

2727

28-
<TextBlock Text="Roll" Margin="1" Grid.Row="2"/>
28+
<TextBlock Text="Pitch" Margin="1" Grid.Row="2"/>
2929
<TextBlock Text="&#x03D1; :" FontSize="25" HorizontalAlignment="Stretch" TextBlock.TextAlignment="Center" Grid.Row="3"/>
3030
<TextBlock Text="{Binding Theta, StringFormat=N2}" VerticalAlignment="Center" FontSize="25" Grid.Column="1" Grid.Row="3"/>
3131

32-
<TextBlock Text="Yaw" Margin="1" Grid.Row="4"/>
32+
<TextBlock Text="Roll" Margin="1" Grid.Row="4"/>
3333
<TextBlock Text="&#x03C6; :" FontSize="25" HorizontalAlignment="Stretch" TextBlock.TextAlignment="Center" Grid.Row="5"/>
3434
<TextBlock Text="{Binding Phi, StringFormat=N2}" VerticalAlignment="Center" FontSize="25" Grid.Column="1" Grid.Row="5"/>
3535

AttitudeIndicator/MainWindow.xaml

+21-10
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,23 @@
77
xmlns:h="http://helix-toolkit.org/wpf"
88
mc:Ignorable="d"
99
xmlns:fa="http://schemas.fontawesome.io/icons/"
10-
Title="Attitude Indicator - Mechatronik Labor 2019" Height="450" Width="800">
10+
Title="Attitude Indicator - Mechatronik Labor 2019" Height="550" Width="800">
1111
<Grid>
1212
<Grid.ColumnDefinitions>
13+
<ColumnDefinition Width="300"/>
1314
<ColumnDefinition Width="*"/>
1415
<ColumnDefinition Width="200"/>
1516
</Grid.ColumnDefinitions>
1617

17-
<h:HelixViewport3D Grid.ColumnSpan="2" ModelUpDirection="0 0 1" ViewCubeHorizontalPosition="Left">
18+
<h:HelixViewport3D Grid.ColumnSpan="3" ModelUpDirection="0 0 1" ViewCubeHorizontalPosition="Left" >
19+
<h:HelixViewport3D.DefaultCamera>
20+
<PerspectiveCamera Position="-14,10,10" LookDirection="14,-10,-10" UpDirection="0,0,1" />
21+
</h:HelixViewport3D.DefaultCamera>
22+
1823
<h:DefaultLights/>
1924

2025

26+
2127
<!--<h:CombinedManipulator/>-->
2228

2329
<h:FileModelVisual3D x:Name="Plane" Source="../../Resouces/Blackbird.obj" >
@@ -74,7 +80,7 @@
7480
</h:CoordinateSystemVisual3D.Transform>
7581
</h:CoordinateSystemVisual3D>
7682

77-
<h:GridLinesVisual3D Width="8" Length="8" MinorDistance="1" MajorDistance="1" Thickness="0.01"/>
83+
<h:GridLinesVisual3D Width="10" Length="10" MinorDistance="1" MajorDistance="1" Thickness="0.01"/>
7884
<!--<h:CoordinateSystemVisual3D/>-->
7985

8086

@@ -89,18 +95,23 @@
8995

9096
</h:HelixViewport3D>
9197

98+
<local:AttitudeIndicatorControl Height="200" Width="200" VerticalAlignment="Top" Margin="20"/>
99+
92100

93-
<StackPanel Grid.Column="1" >
101+
<StackPanel Grid.Column="2" >
94102

95103
<Border Style="{StaticResource LightBorder}">
96-
<StackPanel Orientation="Horizontal" DataContext="{Binding SerialDataConnection}" >
97-
<ComboBox Width="120" Margin="3" SelectedItem="{Binding SelectedPortName}" ItemsSource="{Binding PortList}">
104+
<StackPanel>
105+
<TextBlock>Serial Connection</TextBlock>
106+
<StackPanel Orientation="Horizontal" DataContext="{Binding SerialDataConnection}" >
107+
<ComboBox Width="120" Margin="3" SelectedItem="{Binding SelectedPortName}" ItemsSource="{Binding PortList}">
98108

99-
</ComboBox>
109+
</ComboBox>
100110

101-
<ToggleButton DockPanel.Dock="Top" Height="29" Padding="2" IsChecked="{Binding Connected}">
102-
<fa:ImageAwesome Icon="LifeSaver" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Spin="{Binding Connected}" SpinDuration="4"/>
103-
</ToggleButton>
111+
<ToggleButton DockPanel.Dock="Top" Height="29" Padding="2" IsChecked="{Binding Connected}">
112+
<fa:ImageAwesome Icon="LifeSaver" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Spin="{Binding Connected}" SpinDuration="4"/>
113+
</ToggleButton>
114+
</StackPanel>
104115
</StackPanel>
105116
</Border>
106117

AttitudeIndicatorDisplay/App.config

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>

AttitudeIndicatorDisplay/App.xaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="AttitudeIndicatorDisplay.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:AttitudeIndicatorDisplay"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

AttitudeIndicatorDisplay/App.xaml.cs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace AttitudeIndicatorDisplay
10+
{
11+
/// <summary>
12+
/// Interaktionslogik für "App.xaml"
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{B1DF9DD3-F092-4FC2-8A59-3969B8706D66}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>AttitudeIndicatorDisplay</RootNamespace>
10+
<AssemblyName>AttitudeIndicatorDisplay</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.Data" />
40+
<Reference Include="System.Xml" />
41+
<Reference Include="Microsoft.CSharp" />
42+
<Reference Include="System.Core" />
43+
<Reference Include="System.Xml.Linq" />
44+
<Reference Include="System.Data.DataSetExtensions" />
45+
<Reference Include="System.Net.Http" />
46+
<Reference Include="System.Xaml">
47+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
48+
</Reference>
49+
<Reference Include="WindowsBase" />
50+
<Reference Include="PresentationCore" />
51+
<Reference Include="PresentationFramework" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<ApplicationDefinition Include="App.xaml">
55+
<Generator>MSBuild:Compile</Generator>
56+
<SubType>Designer</SubType>
57+
</ApplicationDefinition>
58+
<Page Include="MainWindow.xaml">
59+
<Generator>MSBuild:Compile</Generator>
60+
<SubType>Designer</SubType>
61+
</Page>
62+
<Compile Include="App.xaml.cs">
63+
<DependentUpon>App.xaml</DependentUpon>
64+
<SubType>Code</SubType>
65+
</Compile>
66+
<Compile Include="MainWindow.xaml.cs">
67+
<DependentUpon>MainWindow.xaml</DependentUpon>
68+
<SubType>Code</SubType>
69+
</Compile>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<Compile Include="Properties\AssemblyInfo.cs">
73+
<SubType>Code</SubType>
74+
</Compile>
75+
<Compile Include="Properties\Resources.Designer.cs">
76+
<AutoGen>True</AutoGen>
77+
<DesignTime>True</DesignTime>
78+
<DependentUpon>Resources.resx</DependentUpon>
79+
</Compile>
80+
<Compile Include="Properties\Settings.Designer.cs">
81+
<AutoGen>True</AutoGen>
82+
<DependentUpon>Settings.settings</DependentUpon>
83+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
84+
</Compile>
85+
<EmbeddedResource Include="Properties\Resources.resx">
86+
<Generator>ResXFileCodeGenerator</Generator>
87+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
88+
</EmbeddedResource>
89+
<None Include="Properties\Settings.settings">
90+
<Generator>SettingsSingleFileGenerator</Generator>
91+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
92+
</None>
93+
</ItemGroup>
94+
<ItemGroup>
95+
<None Include="App.config" />
96+
</ItemGroup>
97+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
98+
</Project>
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Window x:Class="AttitudeIndicatorDisplay.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:AttitudeIndicatorDisplay"
7+
mc:Ignorable="d"
8+
Title="MainWindow" Height="450" Width="800">
9+
<Grid>
10+
<Grid.ColumnDefinitions>
11+
<ColumnDefinition Width="2*"/>
12+
<ColumnDefinition Width="1*"/>
13+
</Grid.ColumnDefinitions>
14+
15+
<StackPanel Grid.Column="1">
16+
<Slider />
17+
<Slider />
18+
<Slider />
19+
</StackPanel>
20+
21+
</Grid>
22+
</Window>

0 commit comments

Comments
 (0)