Index: /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs =================================================================== --- /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs (revision 13713) +++ /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Controllers/JobController.cs (revision 13714) @@ -59,5 +59,5 @@ { HiveClientWeb.Instance.Refresh(); - + vm.userJobs = HiveClientWeb.Instance.Jobs.ToList(); foreach(var j in vm.userJobs) @@ -69,5 +69,7 @@ } vm.selectedJob.RefreshAutomatically = true; - HiveClientWeb.LoadJob(vm.selectedJob); + HiveClientWeb.LoadJob(vm.selectedJob); + FileOpeningService.Instance.NewModel(); + FileOpeningService.Instance.Job = vm.selectedJob; ViewBag.Title = vm.selectedJob.Job.Name + " - Jobs"; return View("Index", vm); Index: /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/JobUpdaterHub.cs =================================================================== --- /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/JobUpdaterHub.cs (revision 13713) +++ /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/JobUpdaterHub.cs (revision 13714) @@ -1,7 +1,10 @@ -using Microsoft.AspNet.SignalR; +using HeuristicLab.Clients.Hive.WebJobManager.Services; +using Microsoft.AspNet.SignalR; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using HeuristicLab.Clients.Hive.WebJobManager.Services; namespace HeuristicLab.Clients.Hive.WebJobManager @@ -11,7 +14,7 @@ private RefreshableJob Job; - public void initConnection(RefreshableJob j) + public void initConnection() { - Job = j; + Job = FileOpeningService.Instance.Job; } public void sendUpdate() @@ -19,4 +22,31 @@ Clients.All.sendUpdate(); } + public void updateAll() + { + FileOpeningService.Instance.refreshJob(); + Job = FileOpeningService.Instance.Job; + + foreach (var t in Job.HiveTasks) + { + looperTasks(t); + } + Clients.All.requestDone(); + + } + private void looperTasks(HiveTask task) + { + try + { + JsonSerializerSettings settings = new JsonSerializerSettings(); + settings.ContractResolver = new JsonTaskResolver(); + var json = JsonConvert.SerializeObject(task.Task, settings); + Clients.All.processData(task.Task.Id,json ); + foreach (var t in task.ChildHiveTasks) + { + looperTasks(t); + } + } + catch (JsonSerializationException e) { } + } } } Index: /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/FileOpeningService.cs =================================================================== --- /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/FileOpeningService.cs (revision 13713) +++ /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/FileOpeningService.cs (revision 13714) @@ -38,4 +38,9 @@ Job.HiveTasks.Add(vm.SelectedTask); } + public void refreshJob() + { + // HiveClientWeb.Instance.Refresh(); + HiveClientWeb.LoadJob(Job); + } public RefreshableJob AddCurrentModelToHive() Index: /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/JsonTaskResolver.cs =================================================================== --- /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/JsonTaskResolver.cs (revision 13714) +++ /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/JsonTaskResolver.cs (revision 13714) @@ -0,0 +1,40 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; + +namespace HeuristicLab.Clients.Hive.WebJobManager.Services +{ + public class JsonTaskResolver : DefaultContractResolver + { + protected override JsonProperty CreateProperty(MemberInfo member, + MemberSerialization memberSerialization) + { + JsonProperty property = base.CreateProperty(member, memberSerialization); + if (property.PropertyName == "ItemImage" || + property.PropertyName == "Parameters" || + property.PropertyName == "OperatorGraph" || + property.PropertyName == "DistanceMatrix" || + property.PropertyName == "Operators" || + property.PropertyName == "Engine" || + property.PropertyName == "ActualValue" || + property.PropertyName == "CurrentScope" || + property.PropertyName == "Problems" || + property.PropertyName == "Random" || + property.PropertyName == "Optimizer" || + property.PropertyName == "Optimizers" || + property.PropertyName == "Problem" || + property.PropertyName == "NestedOptimizers") + { + property.ShouldSerialize = instanceOfProblematic => false; + } + + return property; + } + } + +} Index: /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml =================================================================== --- /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml (revision 13713) +++ /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/Index.cshtml (revision 13714) @@ -88,9 +88,10 @@ -
@Model.algo.Description
Index: /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRunSmall.cshtml =================================================================== --- /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRunSmall.cshtml (revision 13713) +++ /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_BatchRunSmall.cshtml (revision 13714) @@ -22,7 +22,13 @@Index: /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_ExperimentSmall.cshtml =================================================================== --- /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_ExperimentSmall.cshtml (revision 13713) +++ /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/OpenFilePartials/_ExperimentSmall.cshtml (revision 13714) @@ -20,5 +20,7 @@
Children: @Model.exp.Optimizers.Count
Index: /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_AlgTask.cshtml =================================================================== --- /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_AlgTask.cshtml (revision 13713) +++ /branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Views/Job/SelectedJobPartials/_AlgTask.cshtml (revision 13714) @@ -1,12 +1,15 @@ @model HeuristicLab.Clients.Hive.WebJobManager.Models.HiveTaskContainer @using Newtonsoft.Json; -Last update @Model.hiveTask.Task.LastTaskDataUpdate | -State: @Model.hiveTask.Task.State | ++ + | ++ + |
@Model.hiveTask.Task.ExecutionTime executed | ++ + | Created: @Model.hiveTask.Task.DateCreated | |
Statelogs: @Model.hiveTask.Task.StateLog.Count | ++ | + + |
Last update @Model.hiveTask.Task.LastTaskDataUpdate | -State: @Model.hiveTask.Task.State | ++ + | ++ + |
@Model.hiveTask.Task.ExecutionTime executed | ++ + | Created: @Model.hiveTask.Task.DateCreated | -|
@@ -54,13 +62,24 @@ data-onstyle="success" /> | -Statelogs: @Model.hiveTask.Task.StateLog.Count | ++ + |