Last change
on this file since 13696 was
13696,
checked in by jlodewyc, 8 years ago
|
#2582 Recursive views for Experiments and batch runs. Distribute child tasks start
|
File size:
1.8 KB
|
Line | |
---|
1 | using HeuristicLab.Clients.Hive.WebJobManager.ViewModels;
|
---|
2 | using Microsoft.AspNet.Hosting;
|
---|
3 | using System;
|
---|
4 | using System.Collections.Generic;
|
---|
5 | using System.Linq;
|
---|
6 | using System.Threading;
|
---|
7 | using System.Threading.Tasks;
|
---|
8 |
|
---|
9 | namespace HeuristicLab.Clients.Hive.WebJobManager.Services
|
---|
10 | {
|
---|
11 | public class FileOpeningService
|
---|
12 | {
|
---|
13 | public RefreshableJob Job { get; set; }
|
---|
14 | public FileOpeningViewModel vm { get; set; }
|
---|
15 | public IHostingEnvironment env { get; set; }
|
---|
16 | private static FileOpeningService instance;
|
---|
17 | public static FileOpeningService Instance
|
---|
18 | {
|
---|
19 | get
|
---|
20 | {
|
---|
21 | if (instance == null)
|
---|
22 | {
|
---|
23 | instance = new FileOpeningService();
|
---|
24 | }
|
---|
25 | return instance;
|
---|
26 | }
|
---|
27 | }
|
---|
28 | public void NewModel()
|
---|
29 | {
|
---|
30 | vm = new FileOpeningViewModel();
|
---|
31 | Job = new RefreshableJob();
|
---|
32 | Job.Job.Name = "init";
|
---|
33 |
|
---|
34 | }
|
---|
35 | public void setTasks()
|
---|
36 | {
|
---|
37 |
|
---|
38 | Job.HiveTasks.Add(vm.SelectedTask);
|
---|
39 | }
|
---|
40 |
|
---|
41 | public RefreshableJob AddCurrentModelToHive()
|
---|
42 | {
|
---|
43 | if (vm != null)
|
---|
44 | {
|
---|
45 |
|
---|
46 |
|
---|
47 |
|
---|
48 | HiveServiceLocatorWebManagerService serv = (HiveServiceLocatorWebManagerService)HiveServiceLocatorWebManagerService.Instance;
|
---|
49 | //job.Job.Id = serv.getHiveServiceClient().AddJob(job.Job);
|
---|
50 | // job.Job = serv.getHiveServiceClient().GetJob(job.Job.Id);
|
---|
51 |
|
---|
52 | HiveClientWeb.CurrentEnv = env;
|
---|
53 | HiveClientWeb.Instance.Refresh();
|
---|
54 | HiveClientWeb.StartJob((ex) => { throw ex; }, Job, CancellationToken.None);
|
---|
55 | return Job;
|
---|
56 | }
|
---|
57 | return null;
|
---|
58 | }
|
---|
59 | }
|
---|
60 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.