Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2287 - 1
///============================================================================
2
/// MKLiveView 
3
/// Copyright © 2016 Steph
4
/// 
5
///This file is part of MKLiveView.
6
///
7
///MKLiveView is free software: you can redistribute it and/or modify
8
///it under the terms of the GNU General Public License as published by
9
///the Free Software Foundation, either version 3 of the License, or
10
///(at your option) any later version.
11
///
12
///MKLiveView is distributed in the hope that it will be useful,
13
///but WITHOUT ANY WARRANTY; without even the implied warranty of
14
///MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
///GNU General Public License for more details.
16
///
17
///You should have received a copy of the GNU General Public License
18
///along with cssRcon.  If not, see <http://www.gnu.org/licenses/>.
19
///
20
///============================================================================
21
///Credits:
22
///
23
/// The code of the artificial horizon is an idea of 'Anders' and was discussed here:
24
/// http://stackoverflow.com/questions/6161351/creating-an-advanced-hud 
25
/// 
26
///============================================================================
27
/// DISCLAIMER
28
/// ===========
29
/// 
30
/// I created this software with my best knowledge and belief.
31
/// 
32
/// IN NO EVENT, UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, 
33
/// SHALL I, OR ANY PERSON BE LIABLE FOR ANY LOSS, EXPENSE OR DAMAGE, 
34
/// OF ANY TYPE OR NATURE ARISING OUT OF THE USE OF, 
35
/// OR INABILITY TO USE THIS SOFTWARE OR PROGRAM, 
36
/// INCLUDING, BUT NOT LIMITED TO, CLAIMS, SUITS OR CAUSES OF ACTION 
37
/// INVOLVING ALLEGED INFRINGEMENT OF COPYRIGHTS, 
38
/// PATENTS, TRADEMARKS, TRADE SECRETS, OR UNFAIR COMPETITION.
39
/// 
40
/// This means: use it & have fun (but @ Your own risk...)
41
/// ===========================================================================
42
 
43
using System.Windows.Controls;
44
 
45
namespace MKLiveView.ArtificialHorizon
46
{
47
    /// <summary>
48
    /// Interaktionslogik für ArtificialHorizon.xaml
49
    /// </summary>
50
    public partial class ArtificialHorizon : UserControl
51
    {
52
        double roll = 0;
53
        double pitch = 0;
54
        public ArtificialHorizon()
55
        {
56
            InitializeComponent();
57
        }
58
 
59
        public double Roll
60
        {
61
            set
62
            {
63
                roll = -value;
64
                RollAngle.Angle = roll;
65
            }
66
            get
67
            {
68
                return -roll;
69
            }
70
        }
71
 
72
        public double Pitch
73
        {
74
            set
75
            {
76
                pitch = -value * (double)60 / (double)90;
77
                PitchAngle.Y = pitch;
78
            }
79
            get
80
            {
81
                return -pitch * 90 / 60;
82
            }
83
        }
84
        public double rotate
85
        {
86
            set { Rotate.Angle = value; }
87
            get { return Rotate.Angle; }
88
        }
89
        public double rotateHome
90
        {
91
            set { RotateHome.Angle = value; }
92
            get { return RotateHome.Angle; }
93
        }
94
    }
95
}