Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/16 17:13:50 (8 years ago)
Author:
jlodewyc
Message:

#2582 Parameter changing busy, save file, download file and email on pass reset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Jobs/FileOpeningService.cs

    r13740 r13827  
    11using HeuristicLab.Clients.Hive.WebJobManager.ViewModels;
     2using HeuristicLab.Common;
     3using HeuristicLab.Optimization;
    24using Microsoft.AspNet.Hosting;
     5using Microsoft.AspNet.Mvc;
    36using System;
    47using System.Collections.Generic;
     8using System.IO;
    59using System.Linq;
    610using System.Threading;
     
    4145            vm = new FileOpeningViewModel();
    4246            Job = new RefreshableJob();
     47
    4348            Job.Job.Name = "init";
    4449           
     
    7580            return null;
    7681        }
     82        public void SaveToFile(string file)
     83        {
     84            if(vm != null)
     85            {
     86                var uploads = Path.Combine(env.WebRootPath, "uploads", weblog.getServiceLocator(UserId).getHiveServiceClient().ClientCredentials.UserName.UserName,
     87                    "HiveChanged");
     88                Directory.CreateDirectory(uploads);
     89                var cont = Job.HiveTasks.First().ItemTask.Item;
     90                if (!file.EndsWith(".hl"))
     91                    file += ".hl";
     92                var fileloc = uploads + "\\" + file;
     93                if(cont is Experiment)
     94                    ContentManager.Save((Experiment)cont, fileloc, false);
     95                else if(cont is BatchRun)
     96                    ContentManager.Save((BatchRun)cont, fileloc, false);
     97                else if(cont is Algorithm)
     98                {
     99                    IAlgorithm t = (IAlgorithm)Job.HiveTasks.First().ItemTask.Item;
     100                    ContentManager.Save((IStorableContent)t, fileloc, false);
     101                }
     102                 
     103            }
     104        }
     105       
    77106    }
    78107}
Note: See TracChangeset for help on using the changeset viewer.