Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15494


Ignore:
Timestamp:
12/06/17 11:08:20 (6 years ago)
Author:
bburlacu
Message:

#2829: Add option to select the save path for the downloaded jobs. Automatically remove duplicate datasets when the job is saved in a single file. Add button to manually list hive jobs.

Location:
trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain.csproj

    r15342 r15494  
    5353      <SpecificVersion>False</SpecificVersion>
    5454      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
     55      <Private>False</Private>
     56    </Reference>
     57    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     58      <SpecificVersion>False</SpecificVersion>
     59      <HintPath>..\..\..\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
    5560      <Private>False</Private>
    5661    </Reference>
  • trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.Designer.cs

    r15342 r15494  
    3030      this.logView = new HeuristicLab.Core.Views.LogView();
    3131      this.oneFileCheckBox = new System.Windows.Forms.CheckBox();
     32      this.label2 = new System.Windows.Forms.Label();
     33      this.outputDirectoryTextBox = new System.Windows.Forms.TextBox();
     34      this.browseOutputPathButton = new System.Windows.Forms.Button();
     35      this.listJobsButton = new System.Windows.Forms.Button();
    3236      this.SuspendLayout();
    3337      //
     
    5357      //
    5458      this.downloadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    55       this.downloadButton.Location = new System.Drawing.Point(698, 38);
     59      this.downloadButton.Location = new System.Drawing.Point(753, 82);
    5660      this.downloadButton.Name = "downloadButton";
    57       this.downloadButton.Size = new System.Drawing.Size(132, 23);
     61      this.downloadButton.Size = new System.Drawing.Size(77, 23);
    5862      this.downloadButton.TabIndex = 3;
    5963      this.downloadButton.Text = "Download";
     
    6872      this.logView.Caption = "Log View";
    6973      this.logView.Content = null;
    70       this.logView.Location = new System.Drawing.Point(15, 67);
     74      this.logView.Location = new System.Drawing.Point(15, 110);
    7175      this.logView.Name = "logView";
    7276      this.logView.ReadOnly = false;
    73       this.logView.Size = new System.Drawing.Size(815, 368);
     77      this.logView.Size = new System.Drawing.Size(815, 325);
    7478      this.logView.TabIndex = 4;
    7579      //
     
    7983      this.oneFileCheckBox.Checked = true;
    8084      this.oneFileCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
    81       this.oneFileCheckBox.Location = new System.Drawing.Point(15, 44);
     85      this.oneFileCheckBox.Location = new System.Drawing.Point(15, 88);
    8286      this.oneFileCheckBox.Name = "oneFileCheckBox";
    8387      this.oneFileCheckBox.Size = new System.Drawing.Size(102, 17);
     
    8690      this.oneFileCheckBox.UseVisualStyleBackColor = true;
    8791      //
     92      // label2
     93      //
     94      this.label2.AutoSize = true;
     95      this.label2.Location = new System.Drawing.Point(15, 44);
     96      this.label2.Name = "label2";
     97      this.label2.Size = new System.Drawing.Size(85, 13);
     98      this.label2.TabIndex = 6;
     99      this.label2.Text = "Output directory:";
     100      //
     101      // outputDirectoryTextBox
     102      //
     103      this.outputDirectoryTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     104            | System.Windows.Forms.AnchorStyles.Right)));
     105      this.outputDirectoryTextBox.Location = new System.Drawing.Point(152, 38);
     106      this.outputDirectoryTextBox.Name = "outputDirectoryTextBox";
     107      this.outputDirectoryTextBox.Size = new System.Drawing.Size(595, 20);
     108      this.outputDirectoryTextBox.TabIndex = 7;
     109      //
     110      // browseOutputPathButton
     111      //
     112      this.browseOutputPathButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     113      this.browseOutputPathButton.Location = new System.Drawing.Point(753, 37);
     114      this.browseOutputPathButton.Name = "browseOutputPathButton";
     115      this.browseOutputPathButton.Size = new System.Drawing.Size(75, 22);
     116      this.browseOutputPathButton.TabIndex = 8;
     117      this.browseOutputPathButton.Text = "Browse";
     118      this.browseOutputPathButton.UseVisualStyleBackColor = true;
     119      this.browseOutputPathButton.Click += new System.EventHandler(this.browseOutputPathButton_Click);
     120      //
     121      // listJobsButton
     122      //
     123      this.listJobsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     124      this.listJobsButton.Location = new System.Drawing.Point(670, 82);
     125      this.listJobsButton.Name = "listJobsButton";
     126      this.listJobsButton.Size = new System.Drawing.Size(77, 23);
     127      this.listJobsButton.TabIndex = 9;
     128      this.listJobsButton.Text = "List Jobs";
     129      this.listJobsButton.UseVisualStyleBackColor = true;
     130      this.listJobsButton.Click += new System.EventHandler(this.listJobsButton_Click);
     131      //
    88132      // HiveDrainMainWindow
    89133      //
     
    91135      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    92136      this.ClientSize = new System.Drawing.Size(842, 447);
     137      this.Controls.Add(this.listJobsButton);
     138      this.Controls.Add(this.browseOutputPathButton);
     139      this.Controls.Add(this.outputDirectoryTextBox);
     140      this.Controls.Add(this.label2);
    93141      this.Controls.Add(this.oneFileCheckBox);
    94142      this.Controls.Add(this.logView);
     
    112160    private HeuristicLab.Core.Views.LogView logView;
    113161    private System.Windows.Forms.CheckBox oneFileCheckBox;
     162    private System.Windows.Forms.Label label2;
     163    private System.Windows.Forms.TextBox outputDirectoryTextBox;
     164    private System.Windows.Forms.Button browseOutputPathButton;
     165    private System.Windows.Forms.Button listJobsButton;
    114166  }
    115167}
  • trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/HiveDrainMainWindow.cs

    r15346 r15494  
    3232      downloadButton.Enabled = false;
    3333
    34       JobDownloader jobDownloader = new JobDownloader(Environment.CurrentDirectory, pattern, Log, oneFileCheckBox.Checked);
     34      var directory = outputDirectoryTextBox.Text;
     35
     36      if (string.IsNullOrEmpty(directory))
     37        directory = Environment.CurrentDirectory;
     38
     39      JobDownloader jobDownloader = new JobDownloader(directory, pattern, Log, oneFileCheckBox.Checked);
    3540      task = new System.Threading.Tasks.Task(jobDownloader.Start);
    3641      task.ContinueWith(x => { Log.LogMessage("All tasks written, quitting."); EnableButton(); }, TaskContinuationOptions.OnlyOnRanToCompletion);
     
    5257      }
    5358    }
     59
     60    private void browseOutputPathButton_Click(object sender, EventArgs e) {
     61      var path = string.Empty;
     62
     63      var dialog = new FolderBrowserDialog {
     64        RootFolder = Environment.SpecialFolder.MyComputer
     65      };
     66
     67      if (dialog.ShowDialog() == DialogResult.OK) {
     68        path = dialog.SelectedPath;
     69      }
     70
     71      if (!string.IsNullOrEmpty(path))
     72        outputDirectoryTextBox.Text = path;
     73    }
     74
     75    private void listJobsButton_Click(object sender, EventArgs e) {
     76      ListHiveJobs();
     77    }
    5478  }
    5579}
  • trunk/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/JobTaskOneFileDownloader.cs

    r15350 r15494  
    2929using HeuristicLab.Core;
    3030using HeuristicLab.Optimization;
     31using HeuristicLab.Problems.DataAnalysis;
    3132
    3233namespace HeuristicLab.HiveDrain {
     
    7071
    7172      var allTasks = HiveServiceLocator.Instance.CallHiveService(s => s.GetLightweightJobTasksWithoutStateLog(ParentJob.Id));
    72       var totalJobCount = allTasks.Count();
     73      var totalJobCount = allTasks.Count;
    7374      var optimizers = new List<IOptimizer>();
    7475      var finishedCount = -1;
     
    114115      }
    115116      if (storable != null) {
     117        // remove duplicate datasets
     118        log.LogMessage("Removing duplicate datasets...");
     119        DatasetUtil.RemoveDuplicateDatasets(storable);
     120
    116121        log.LogMessage(string.Format("Save job as {0}", RootLocation));
    117122        ContentManager.Save(storable, RootLocation, true);
Note: See TracChangeset for help on using the changeset viewer.