Free cookie consent management tool by TermsFeed Policy Generator

Changeset 908


Ignore:
Timestamp:
12/04/08 17:22:34 (15 years ago)
Author:
kgrading
Message:

implemented the Status method for the web interface (#401)

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Communication/ClientConsoleCommunicator.cs

    r843 r908  
    44using System.Text;
    55using HeuristicLab.Hive.Client.Communication.Interfaces;
    6 using HeuristicLab.Hive.Client.Communication.ClientConsole;
     6using HeuristicLab.Hive.Client.Communication.ClientConsole; 
    77
    88namespace HeuristicLab.Hive.Client.Communication {
  • trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager.cs

    r841 r908  
    2525using System.Text;
    2626using HeuristicLab.Hive.Contracts.BusinessObjects;
     27using HeuristicLab.Hive.Client.Communication.ClientConsole;
     28using HeuristicLab.Hive.Client.ExecutionEngine;
    2729
    2830namespace HeuristicLab.Hive.Client.Core {
     
    3335    private static ConfigurationManager instance = null;
    3436
    35     private ClientInfo clientInfo;
     37    public Core Core { get; set; }
     38    private ClientInfo clientInfo;   
    3639    private Guid guid;
    3740
     
    4245      return instance;
    4346    }
     47
     48   
    4449
    4550    /// <summary>
     
    5560      clientInfo.Memory = 1024;
    5661      clientInfo.Name = Environment.MachineName;
     62
    5763    }
    5864
    5965    public ClientInfo GetClientInfo() {
    6066      return clientInfo;         
     67    }
     68
     69    public StatusCommons GetStatusForClient() {
     70      StatusCommons st = new StatusCommons();
     71      st.ClientGuid = guid;
     72      st.ConnectedSince = clientInfo.Login;
     73      //This is just Temporary!
     74      st.JobsAborted = 0;
     75      st.JobsDone = 0;
     76      st.JobsFetched = 0;
     77      st.Status = StatusCommons.ClientStatusEnum.Connected;
     78
     79      Dictionary<long, Executor> engines = Core.GetExecutionEngines();
     80      foreach (KeyValuePair<long, Executor> kvp in engines) {
     81        Executor e = kvp.Value;
     82        st.Jobs.Add(new JobStatus { JobId = e.JobId, Progress = e.Progress, Since = e.CreationTime });
     83      }
     84      return st;     
    6185    }
    6286
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r901 r908  
    5656      ClientConsoleServer server = new ClientConsoleServer();
    5757      server.StartClientConsoleServer(new Uri("net.tcp://127.0.0.1:8000/ClientConsole/"));
     58
     59      ConfigurationManager manager = ConfigurationManager.GetInstance();
     60      manager.Core = this;
    5861
    5962      clientCommunicator = ServiceLocator.GetClientCommunicator();
     
    155158      }
    156159    }
     160
     161    public Dictionary<long, Executor> GetExecutionEngines() {
     162      return engines;
     163    }
    157164  }
    158165}
  • trunk/sources/HeuristicLab.Hive.Client.ExecutionEngine/Executor.cs

    r830 r908  
    3737    public MessageContainer.MessageType CurrentMessage { get; set; }
    3838    public MessageQueue Queue { get; set; }
     39    public double Progress {
     40      get {
     41        return Job.Progress;
     42      }
     43    }
    3944
    40     public void Start(byte[] serializedJob) {     
     45    public DateTime CreationTime { get; set; }
     46
     47    public void Start(byte[] serializedJob) {
     48      CreationTime = DateTime.Now;
    4149      Job = (IJob)PersistenceManager.RestoreFromGZip(serializedJob);
    4250      Job.JobStopped += new EventHandler(Job_JobStopped);
Note: See TracChangeset for help on using the changeset viewer.