private void GameExportPathButton_Click(object sender, RoutedEventArgs e)
        {
            var ofd = new FolderPickerDialog()
            {
                Title = "Game Export Path"
            };

            ofd.ShowDialog();

            if (ofd.SelectedPath != string.Empty)
            {
                this.GameExportPathTextBox.Text = ofd.SelectedPath;
            }
        }
 private void SaveLayerStatisticsFiles()
 {
   var dlg = new FolderPickerDialog();
   if (dlg.ShowDialog() == true)
   {
     //remove wells without xy, remove intakes with missing values and then apply ObsInperiodfilter again because there can be wells with multiple intakes where only is acceptable
     var intakes = SortedAndFilteredWells.Where(w=>w.X!=0 & w.Y!=0).SelectMany(var => var.Intakes.Where(var2=>!var2.HasMissingdData())).Where(ObsInPeriodFilter);
     AsyncWithWait(()=> MsheInputFileWriters.WriteToLSInput(dlg.SelectedPath, intakes, Mshe, _periodFilter, _onlyRoFilter));
   }
 }
 private void SaveGMSExtractions()
 {
   var dlg = new FolderPickerDialog();
   dlg.Title = "Select a folder where the extraction input files for GMS will be saved";
   if (dlg.ShowDialog() == true)
   {
     AsyncWithWait(() => MsheInputFileWriters.WriteGMSExtraction(dlg.SelectedPath, SortedAndFilteredPlants, SelectionStartTime, SelectionEndTime));
   }
 }
 public void SaveExtractionPermits(int DistributionYear, int startYear, int endyear)
 {
   var dlg = new FolderPickerDialog();
   dlg.Title = "Select a folder where the extraction input files will be saved";
   if (dlg.ShowDialog() == true)
   {
     AsyncWithWait(() => MsheInputFileWriters.WriteExtractionDFS0Permits(dlg.SelectedPath, SortedAndFilteredPlants, DistributionYear, startYear, endyear));
   }
 }
 private void SaveDetailedTimeSeries()
 {
   var dlg = new FolderPickerDialog();
   if (dlg.ShowDialog() == true)
   {
     var intakes = SortedAndFilteredWells.SelectMany(var => var.Intakes);
     MsheInputFileWriters.WriteDetailedTimeSeriesText(dlg.SelectedPath, intakes, SelectionStartTime, SelectionEndTime);
     MsheInputFileWriters.WriteToDatFile(System.IO.Path.Combine(dlg.SelectedPath, "Timeseries.dat"), intakes, _periodFilter, _onlyRoFilter);
     AsyncWithWait(() => MsheInputFileWriters.WriteDetailedTimeSeriesDfs0(dlg.SelectedPath, intakes, _periodFilter, _onlyRoFilter));
   }
 }
 private void ExecuteSelectDestinationFolder(object obj)
 {
     var dlg = new FolderPickerDialog();
     if (dlg.ShowDialog() != true) return;
     _destinationPath = dlg.SelectedPath;
     PropertyChanged(this, new PropertyChangedEventArgs("DestinationPath"));
 }
 public void ExecuteSelectSourceFolder(object obj)
 {
     var dlg = new FolderPickerDialog();
     if (dlg.ShowDialog() != true) return;
     _sourcePath = dlg.SelectedPath;
     PropertyChanged(this, new PropertyChangedEventArgs("SourcePath"));
     UpdateFileLists();
 }
 private void buttonAddDir_Click(object sender, RoutedEventArgs e)
 {
     var pickedFolder = new FolderPickerDialog();
     try {
         if (pickedFolder.ShowDialog() == true) {
             string path = pickedFolder.SelectedPath;
             if (path == null)
                 throw new ActionException("No folder was chosen.", ActionType.Directory);
             //DirIdentity did = new DirIdentity(path.Substring(path.LastIndexOf('\\') + 1),
             //	null, path);
             DirectoryContents dcNew = new DirectoryContents(
                 path.Substring(path.LastIndexOf('\\') + 1), path);
             //path.Substring(path.LastIndexOf('\\') + 1), path, null, null, true);
             dcNew = local.ReadDirectoryContents(dcNew);
             foreach (DirectoryContents dc in Directories)
                 if (dc.Name.Equals(dcNew.Name) || dc.LocalPath.Equals(dcNew.LocalPath))
                     throw new ActionException("Folder already exists on this machine.",
                         ActionType.Directory);
             Directories.Add(dcNew);
             machine.Directories.Add(dcNew);
         }
     } catch (ActionException ex) {
         MessageBox.Show(ex.Message, ex.Title);
     }
 }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (button1.Content.ToString() == "Start")
            {
                if (!path)
                {
                    var dlg = new FolderPickerDialog();
                    if (dlg.ShowDialog() == true)
                    {
                        folder = dlg.SelectedPath;
                        path = true;
                    }
                }
                if (path & training)
                {
                    //startTraining();
                }
                else if (path & !training)
                {
                    startDemo();
                }
                if (path & capture)
                {
                    button1.Background = Brushes.Red;
                    button1.Content = "End";
                    index1 = KinectDiagnosticViewer.dt1.Rows.Count;
                    timeStamp = DateTime.Now.ToString();
                }
            }
            else
            {
                index2 = KinectDiagnosticViewer.dt1.Rows.Count;
                DataTable dt1 = KinectDiagnosticViewer.dt1.Copy();
                
                for (int i = (index1 + 1); i < index2-1; i++)
                {
                    for (int j = 0; j < 60; j++)
                    {
                        skelData.Add(dt1.Rows[i][j]);
                    }
                    kinectTilt.Add(dt1.Rows[i][60]);
                    gpVector.Add(dt1.Rows[i][61]);
                    gpVector.Add(dt1.Rows[i][62]);
                    gpVector.Add(dt1.Rows[i][63]);
                    gpVector.Add(dt1.Rows[i][64]);
                }
                if (!training)
                {
                    endDemo();
                }
                else
                {
                    endTraining();
                }

                createMatFile();

                button1.Background = Brushes.Green;
                button1.Content = "Start";

                skelData.Clear();
                gpVector.Clear();
                kinectTilt.Clear();
            }
            return;
        } //Change to 1 if you only want to view one at a time. Switching will be enabled.