2023-12-15 08:14:17 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
namespace _20230724_MBJC_upperpc.Views
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2023-12-23 03:35:57 +00:00
|
|
|
|
/// InitialView.xaml 的交互逻辑
|
2023-12-15 08:14:17 +00:00
|
|
|
|
/// </summary>
|
2023-12-23 03:35:57 +00:00
|
|
|
|
public partial class InitialView : UserControl
|
2023-12-15 08:14:17 +00:00
|
|
|
|
{
|
2024-01-22 09:48:13 +00:00
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
|
/// 翻滚角
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float Roll_Angle
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (float)this.GetValue(Roll_AngleProperty); }
|
|
|
|
|
|
set { this.SetValue(Roll_AngleProperty, value); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty Roll_AngleProperty = DependencyProperty.Register("Roll_Angle", typeof(float), typeof(InitialView), new PropertyMetadata(default(float), new PropertyChangedCallback(OnPropertyChanged)));
|
|
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
|
/// 俯仰角
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float Pitch_Angle
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (float)this.GetValue(Pitch_AngleProperty); }
|
|
|
|
|
|
set { this.SetValue(Pitch_AngleProperty, value); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty Pitch_AngleProperty = DependencyProperty.Register("Pitch_Angle", typeof(float), typeof(InitialView), new PropertyMetadata(default(float), new PropertyChangedCallback(OnPropertyChanged)));
|
|
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
|
/// 航向角
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public float Heading_Angle
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (float)this.GetValue(Heading_AngleProperty); }
|
|
|
|
|
|
set { this.SetValue(Heading_AngleProperty, value); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty Heading_AngleProperty = DependencyProperty.Register("Heading_Angle", typeof(float), typeof(InitialView), new PropertyMetadata(default(float), new PropertyChangedCallback(OnPropertyChanged)));
|
|
|
|
|
|
|
|
|
|
|
|
public static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
(d as InitialView).Refresh();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-23 03:35:57 +00:00
|
|
|
|
public InitialView()
|
2023-12-15 08:14:17 +00:00
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
2024-01-22 09:48:13 +00:00
|
|
|
|
|
|
|
|
|
|
private void Refresh()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Rotate_X.Text = "俯仰角:" + Pitch_Angle.ToString() + "°";
|
|
|
|
|
|
this.Rotate_Y.Text = "航向角:" + Heading_Angle.ToString() + "°";
|
|
|
|
|
|
this.Rotate_Z.Text = "翻滚角:" + Roll_Angle.ToString() + "°";
|
|
|
|
|
|
}
|
2023-12-15 08:14:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|