Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/17/16 16:52:10 (8 years ago)
Author:
jlodewyc
Message:

#2582 Implement graphs(Pie and line per task) + live job overview with SignalR

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/JobUpdaterHub.cs

    r13712 r13714  
    1 using Microsoft.AspNet.SignalR;
     1using HeuristicLab.Clients.Hive.WebJobManager.Services;
     2using Microsoft.AspNet.SignalR;
     3using Newtonsoft.Json;
    24using System;
    35using System.Collections.Generic;
    46using System.Linq;
    57using System.Threading.Tasks;
     8using HeuristicLab.Clients.Hive.WebJobManager.Services;
    69
    710namespace HeuristicLab.Clients.Hive.WebJobManager
     
    1114        private RefreshableJob Job;
    1215
    13         public void initConnection(RefreshableJob j)
     16        public void initConnection()
    1417        {
    15             Job = j;
     18            Job = FileOpeningService.Instance.Job;
    1619        }
    1720        public void sendUpdate()
     
    1922            Clients.All.sendUpdate();
    2023        }
     24        public void updateAll()
     25        {
     26            FileOpeningService.Instance.refreshJob();
     27            Job = FileOpeningService.Instance.Job;
     28           
     29            foreach (var t in Job.HiveTasks)
     30            {
     31                looperTasks(t);
     32            }
     33            Clients.All.requestDone();
     34
     35        }
     36        private void looperTasks(HiveTask task)
     37        {
     38            try
     39            {
     40                JsonSerializerSettings settings = new JsonSerializerSettings();
     41                settings.ContractResolver = new JsonTaskResolver();
     42                var json = JsonConvert.SerializeObject(task.Task, settings);
     43                Clients.All.processData(task.Task.Id,json );
     44                foreach (var t in task.ChildHiveTasks)
     45                {
     46                    looperTasks(t);
     47                }
     48            }
     49            catch (JsonSerializationException e) { }
     50        }
    2151    }
    2252}
Note: See TracChangeset for help on using the changeset viewer.