Ejemplo n.º 1
0
        //расчёт места крушения
        private void Button_FD_Click(object sender, RoutedEventArgs e)
        {
            double AirspeedonAscent  = Convert.ToDouble(TextBox_AonA.Text);
            double AscentRate        = Convert.ToDouble(TextBox_AscR.Text);
            double TimeOfFlight      = Convert.ToDouble(TextBox_Tatof.Text);
            double AirspeedonDescent = Convert.ToDouble(TextBox_AonD.Text);
            double DescentRate       = Convert.ToDouble(TextBox_DisR.Text);
            double WindDirection     = Convert.ToDouble(TextBox_WBdegrees.Text) + 180;

            if (WindDirection > 360)
            {
                WindDirection -= 360;
            }
            double WindSpeed    = Convert.ToDouble(TextBox_WS.Text);
            double AscentRange  = AirspeedonAscent * TimeOfFlight;
            double DescentRange = Math.Round((TimeOfFlight * AscentRate) / DescentRate * AirspeedonDescent);
            double WindBlownRange;

            if (IsBoxChecked)
            {
                WindBlownRange = Math.Round(((TimeOfFlight * AscentRate / DescentRate) + TimeOfFlight) * WindSpeed);
                IsBoxChecked   = false;
            }
            else
            {
                WindBlownRange = Math.Round((TimeOfFlight * AscentRate) / DescentRate) * WindSpeed;
            }
            Label_FD.Content = "Ascent vector: " + AscentRange + "m " + Convert.ToDouble(TextBox_FPdegrees.Text) + "\n" + "Descent vector: " + DescentRange + "m" + Convert.ToDouble(TextBox_FPdegrees.Text) + "\n" + "Wind vector: " + WindBlownRange + "m" + WindDirection;

            //инициализация диалогового окна
            MapDialogBox dlg = new MapDialogBox();

            //
            dlg.Owner         = this;
            dlg.AscentVector  = AscentRange + DescentRange;
            dlg.AscentDegrees = Convert.ToInt32(TextBox_FPdegrees.Text);
            dlg.WindVector    = WindBlownRange;
            dlg.WindDirection = Convert.ToInt32(WindDirection);
            int Transfer;

            if (ComboBox_StartP.SelectedItem == RB_Firstposition)
            {
                Transfer = 1;
            }
            else if (ComboBox_StartP.SelectedItem == RB_Secondposition)
            {
                Transfer = 2;
            }
            else
            {
                Transfer = 3; //переменная для передачи значений ComboBox
            }
            dlg.Transfer = Transfer;
            dlg.ShowDialog();
        }
Ejemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.DialogWindow = ((WpfApp3_joystick.MapDialogBox)(target));

            #line 8 "..\..\MapDialogBox.xaml"
                this.DialogWindow.Loaded += new System.Windows.RoutedEventHandler(this.DialogWin_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.DialogGrid = ((System.Windows.Controls.Grid)(target));

            #line 9 "..\..\MapDialogBox.xaml"
                this.DialogGrid.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Mouse_Up);

            #line default
            #line hidden
                return;

            case 3:
                this.Image_FlightMap = ((System.Windows.Controls.Image)(target));
                return;

            case 4:
                this.Button_Cancel = ((System.Windows.Controls.Button)(target));

            #line 15 "..\..\MapDialogBox.xaml"
                this.Button_Cancel.Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.ComboBox_Position = ((System.Windows.Controls.ComboBox)(target));

            #line 16 "..\..\MapDialogBox.xaml"
                this.ComboBox_Position.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ComboBox_Position_SelectionChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.FirstSelection_RB = ((System.Windows.Controls.RadioButton)(target));

            #line 17 "..\..\MapDialogBox.xaml"
                this.FirstSelection_RB.Checked += new System.Windows.RoutedEventHandler(this.FirstSelection_RB_Checked);

            #line default
            #line hidden
                return;

            case 7:
                this.SecondSelection_RB = ((System.Windows.Controls.RadioButton)(target));

            #line 18 "..\..\MapDialogBox.xaml"
                this.SecondSelection_RB.Checked += new System.Windows.RoutedEventHandler(this.SecondSelection_RB_Checked);

            #line default
            #line hidden
                return;

            case 8:
                this.ThirdSelection_RB = ((System.Windows.Controls.RadioButton)(target));

            #line 19 "..\..\MapDialogBox.xaml"
                this.ThirdSelection_RB.Checked += new System.Windows.RoutedEventHandler(this.ThirdSelection_RB_Checked);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }