Beispiel #1
0
        private void btn_openApp_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Process objProcess = new Process();
                //Ask user for path
                string path = this.pathTextBox.Text;
                objProcess.StartInfo.FileName         = path;
                objProcess.StartInfo.WorkingDirectory = path.Substring(0, path.LastIndexOf('\\'));

                string playBackPath = path.Substring(0, path.LastIndexOf("\\bin"));
                playBackPath += "\\data\\Protocol\\playback_small.xml";


                //string playBackPath = path + "\\data\\Protocol";
                //File.Copy(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "playback_small.xml"), System.IO.Path.Combine(playBackPath, "playback_small.xml"));
                //File.Delete("playback_small.xml");

                //Run app with arguments
                objProcess.StartInfo.ArgumentList.Add("--generic=socket,in,10,127.0.0.1,5400,tcp,playback_small");
                objProcess.StartInfo.ArgumentList.Add("--fdm=null");
                objProcess.Start();



                PlaybackScreen w = new PlaybackScreen(playBackPath);

                w.Show();
                this.Close();
            }
            catch (Exception) //Probably wrong path
            {
                pathTextBox.Text = "ERROR: Could not open app from given path, please try again.";
            }
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window_flighgear = ((FlightSimulator.PlaybackScreen)(target));

            #line 8 "..\..\..\PlayControllerView.xaml"
                this.window_flighgear.Closing += new System.ComponentModel.CancelEventHandler(this.window_flightgear_closing);

            #line default
            #line hidden
                return;

            case 2:
                this.btn_open = ((System.Windows.Controls.Button)(target));

            #line 18 "..\..\..\PlayControllerView.xaml"
                this.btn_open.Click += new System.Windows.RoutedEventHandler(this.btn_open_click);

            #line default
            #line hidden
                return;

            case 3:
                this.btn_back = ((System.Windows.Controls.Button)(target));

            #line 20 "..\..\..\PlayControllerView.xaml"
                this.btn_back.Click += new System.Windows.RoutedEventHandler(this.btn_back_click);

            #line default
            #line hidden
                return;

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

            #line 22 "..\..\..\PlayControllerView.xaml"
                this.btn_play.Click += new System.Windows.RoutedEventHandler(this.btn_play_click);

            #line default
            #line hidden
                return;

            case 5:
                this.btn_foward = ((System.Windows.Controls.Button)(target));

            #line 24 "..\..\..\PlayControllerView.xaml"
                this.btn_foward.Click += new System.Windows.RoutedEventHandler(this.btn_foward_click);

            #line default
            #line hidden
                return;

            case 6:
                this.btn_pause = ((System.Windows.Controls.Button)(target));

            #line 26 "..\..\..\PlayControllerView.xaml"
                this.btn_pause.Click += new System.Windows.RoutedEventHandler(this.btn_pause_click);

            #line default
            #line hidden
                return;

            case 7:
                this.slider_timesteps = ((System.Windows.Controls.Slider)(target));

            #line 28 "..\..\..\PlayControllerView.xaml"
                this.slider_timesteps.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.label_display_time = ((System.Windows.Controls.Label)(target));
                return;

            case 9:
                this.txtbox_change_speed = ((System.Windows.Controls.TextBox)(target));

            #line 30 "..\..\..\PlayControllerView.xaml"
                this.txtbox_change_speed.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtbox_change_speed_TextChanged);

            #line default
            #line hidden

            #line 30 "..\..\..\PlayControllerView.xaml"
                this.txtbox_change_speed.KeyDown += new System.Windows.Input.KeyEventHandler(this.txtbox_change_speed_pressed);

            #line default
            #line hidden
                return;

            case 10:
                this.slider_rudder = ((System.Windows.Controls.Slider)(target));
                return;

            case 11:
                this.slider_throttle = ((System.Windows.Controls.Slider)(target));
                return;

            case 12:
                this.label_altimeter_name = ((System.Windows.Controls.Label)(target));
                return;

            case 13:
                this.label_roll_name = ((System.Windows.Controls.Label)(target));
                return;

            case 14:
                this.label_pitch_name = ((System.Windows.Controls.Label)(target));
                return;

            case 15:
                this.label_heading_deg_name = ((System.Windows.Controls.Label)(target));
                return;

            case 16:
                this.label_airspeed_name = ((System.Windows.Controls.Label)(target));
                return;

            case 17:
                this.label_yaw_name = ((System.Windows.Controls.Label)(target));
                return;

            case 18:
                this.label_altimeter = ((System.Windows.Controls.Label)(target));
                return;

            case 19:
                this.label_roll = ((System.Windows.Controls.Label)(target));
                return;

            case 20:
                this.label_pitch = ((System.Windows.Controls.Label)(target));
                return;

            case 21:
                this.label_heading_deg = ((System.Windows.Controls.Label)(target));
                return;

            case 22:
                this.label_airspeed = ((System.Windows.Controls.Label)(target));
                return;

            case 23:
                this.label_yaw = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window_flighgear = ((FlightSimulator.PlaybackScreen)(target));

            #line 10 "..\..\..\PlayControllerView.xaml"
                this.window_flighgear.Closing += new System.ComponentModel.CancelEventHandler(this.window_flightgear_closing);

            #line default
            #line hidden
                return;

            case 2:
                this.btn_open_train = ((System.Windows.Controls.Button)(target));

            #line 23 "..\..\..\PlayControllerView.xaml"
                this.btn_open_train.Click += new System.Windows.RoutedEventHandler(this.btn_open_train_click);

            #line default
            #line hidden
                return;

            case 3:
                this.btn_open_test = ((System.Windows.Controls.Button)(target));

            #line 25 "..\..\..\PlayControllerView.xaml"
                this.btn_open_test.Click += new System.Windows.RoutedEventHandler(this.btn_open_test_click);

            #line default
            #line hidden
                return;

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

            #line 27 "..\..\..\PlayControllerView.xaml"
                this.btn_back.Click += new System.Windows.RoutedEventHandler(this.btn_back_click);

            #line default
            #line hidden
                return;

            case 5:
                this.btn_play = ((System.Windows.Controls.Button)(target));

            #line 31 "..\..\..\PlayControllerView.xaml"
                this.btn_play.Click += new System.Windows.RoutedEventHandler(this.btn_play_click);

            #line default
            #line hidden
                return;

            case 6:
                this.btn_foward = ((System.Windows.Controls.Button)(target));

            #line 35 "..\..\..\PlayControllerView.xaml"
                this.btn_foward.Click += new System.Windows.RoutedEventHandler(this.btn_foward_click);

            #line default
            #line hidden
                return;

            case 7:
                this.btn_pause = ((System.Windows.Controls.Button)(target));

            #line 39 "..\..\..\PlayControllerView.xaml"
                this.btn_pause.Click += new System.Windows.RoutedEventHandler(this.btn_pause_click);

            #line default
            #line hidden
                return;

            case 8:
                this.slider_timesteps = ((System.Windows.Controls.Slider)(target));

            #line 43 "..\..\..\PlayControllerView.xaml"
                this.slider_timesteps.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 9:
                this.label_display_time = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.txtbox_change_speed = ((System.Windows.Controls.TextBox)(target));

            #line 45 "..\..\..\PlayControllerView.xaml"
                this.txtbox_change_speed.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtbox_change_speed_TextChanged);

            #line default
            #line hidden

            #line 45 "..\..\..\PlayControllerView.xaml"
                this.txtbox_change_speed.KeyDown += new System.Windows.Input.KeyEventHandler(this.txtbox_change_speed_pressed);

            #line default
            #line hidden
                return;

            case 11:
                this.slider_rudder = ((System.Windows.Controls.Slider)(target));
                return;

            case 12:
                this.slider_throttle = ((System.Windows.Controls.Slider)(target));
                return;

            case 13:
                this.JoystickBigCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 14:
                this.CanvasLittleEllipse = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 15:
                this.JoystickLittleCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 16:
                this.JoystickLittleEllipse = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 17:
                this.EllipseTransform = ((System.Windows.Media.TranslateTransform)(target));
                return;

            case 18:
                this.parameterList = ((System.Windows.Controls.ListBox)(target));

            #line 76 "..\..\..\PlayControllerView.xaml"
                this.parameterList.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.parameterList_selectionChanged);

            #line default
            #line hidden
                return;

            case 19:
                this.anomaliesGraph = ((OxyPlot.Wpf.Plot)(target));
                return;

            case 20:
                this.btn_load_dll = ((System.Windows.Controls.Button)(target));

            #line 93 "..\..\..\PlayControllerView.xaml"
                this.btn_load_dll.Click += new System.Windows.RoutedEventHandler(this.btn_load_dll_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.anomalies_lb = ((System.Windows.Controls.ListBox)(target));

            #line 94 "..\..\..\PlayControllerView.xaml"
                this.anomalies_lb.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.anomalies_lb_change);

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