Ejemplo n.º 1
0
        /// <summary>
        /// this function loads the .dll after clicking the related button.
        /// </summary>
        /// <param name="sender"> the sender object </param>
        /// <param name="e"> the event args </param>
        private void LoadDLL_Click(object sender, RoutedEventArgs e)
        {
            // Asks the user to upload a DLL file
            OpenFileDialog openFile = new OpenFileDialog
            {
                Filter = "Dynamic Linking Library File (*.dll)|*.dll"
            };

            // Update the path in the TextBox
            if (openFile.ShowDialog() == true)
            {
                this.dllPath = System.IO.Path.GetFullPath(openFile.FileName);
            }
            UserControls.Children.Remove(graphs);
            graphs = new UserControls.Graph(csvFilePath, DataModel.Instance.ColNames, this.dllPath)
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Left
            };
            Grid.SetColumn(graphs, 0);
            Grid.SetRow(graphs, 1);
            Grid.SetColumnSpan(graphs, 2);
            Grid.SetRowSpan(graphs, 2);
            UserControls.Children.Add(graphs);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// CTOR of InspectorWindow
 /// </summary>
 /// <param name="vm"> model of FlightGear </param>
 /// <param name="csvFilePath"> the csv file to load </param>
 /// <param name="dllPath"> a .dll file which detects anomalies </param>
 public InspectorWindow(FGViewModel vm, string csvFilePath, string dllPath)
 {
     InitializeComponent();
     this.vm          = vm;
     this.dllPath     = dllPath;
     this.csvFilePath = csvFilePath;
     // add a new graphs user control
     graphs = new UserControls.Graph(csvFilePath, DataModel.Instance.ColNames, this.dllPath)
     {
         VerticalAlignment   = VerticalAlignment.Center,
         HorizontalAlignment = HorizontalAlignment.Left
     };
     Grid.SetColumn(graphs, 0);
     Grid.SetRow(graphs, 1);
     Grid.SetColumnSpan(graphs, 2);
     Grid.SetRowSpan(graphs, 2);
     UserControls.Children.Add(graphs);
 }