Free cookie consent management tool by TermsFeed Policy Generator

Changeset 944


Ignore:
Timestamp:
12/10/08 14:48:49 (15 years ago)
Author:
kgrading
Message:

finished implementation for #425

Location:
trunk/sources
Files:
4 added
7 edited

Legend:

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

    r932 r944  
    5858
    5959    public void Connect(String serverIP, int serverPort) {
    60       if(!(this.ServerIP == serverIP) && !(this.ServerPort == ServerPort))
     60      if(this.ServerIP != serverIP || this.ServerPort != ServerPort)
    6161        ServerChanged(this, new EventArgs());
    6262      this.ServerIP = serverIP;
    63       this.ServerPort = serverPort;
     63      this.ServerPort = serverPort;     
    6464      Connect();
    6565    }
  • trunk/sources/HeuristicLab.Hive.Client.Core/ClientConsoleService/ClientConsoleCommunicator.cs

    r932 r944  
    2020
    2121    public void SetConnection(ConnectionContainer container) {
     22      ConfigManager.Instance.SetServerIPAndPort(container);
    2223      WcfService.Instance.Connect(container.IPAdress, container.Port);
    2324    }
  • trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager/ConfigManager.cs

    r932 r944  
    2828using HeuristicLab.Hive.Client.Core.ClientConsoleService;
    2929using HeuristicLab.Hive.Client.Communication;
     30using HeuristicLab.Hive.Client.Core.Properties;
    3031
    3132namespace HeuristicLab.Hive.Client.Core.ConfigurationManager {
     
    5354      //retrive GUID from XML file, or burn in hell. as in hell. not heaven.
    5455      //this won't work this way. We need a plugin for XML Handling.     
    55       hardwareInfo = new ClientInfo();
    56       hardwareInfo.ClientId = Guid.NewGuid();
     56      hardwareInfo = new ClientInfo();     
     57
     58      if (Settings.Default.Guid == Guid.Empty)
     59        hardwareInfo.ClientId = Guid.NewGuid();
     60      else
     61        hardwareInfo.ClientId = Settings.Default.Guid;
     62     
    5763      hardwareInfo.NrOfCores = Environment.ProcessorCount;
    5864      hardwareInfo.Memory = 1024;
     
    6268    public ClientInfo GetClientInfo() {
    6369      return hardwareInfo;         
     70    }
     71
     72    public ConnectionContainer GetServerIPAndPort() {
     73      ConnectionContainer cc = new ConnectionContainer();
     74      cc.IPAdress = Settings.Default.ServerIP;
     75      cc.Port = Settings.Default.ServerPort;
     76      return cc;
     77    }
     78
     79    public void SetServerIPAndPort(ConnectionContainer cc) {
     80      Settings.Default.ServerIP = cc.IPAdress;
     81      Settings.Default.ServerPort = cc.Port;
    6482    }
    6583
     
    82100      return st;     
    83101    }
    84 
    85     public void Loggedin() {
    86       if (hardwareInfo == null) {
    87         hardwareInfo = new ClientInfo();
    88       }
    89       hardwareInfo.Login = DateTime.Now;
    90     }
    91102  }
    92103}
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r932 r944  
    6262
    6363      wcfService = WcfService.Instance;
    64       wcfService.Connect("10.20.53.1", 9000);
    65 
     64      ConnectionContainer cc = ConfigManager.Instance.GetServerIPAndPort();
     65      if (cc.IPAdress == String.Empty || cc.Port == 0) {
     66        wcfService.Connect("10.20.53.3", 9000);
     67      }
    6668      wcfService.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(wcfService_LoginCompleted);
    6769      wcfService.PullJobCompleted += new EventHandler<PullJobCompletedEventArgs>(wcfService_PullJobCompleted);
     
    136138    void wcfService_LoginCompleted(object sender, LoginCompletedEventArgs e) {
    137139      if (e.Result.Success) {
    138         Logging.GetInstance().Info(this.ToString(), "Login completed to Hive Server @ " + DateTime.Now);
    139         ConfigManager.Instance.Loggedin();       
     140        Logging.GetInstance().Info(this.ToString(), "Login completed to Hive Server @ " + DateTime.Now);       
    140141      } else
    141142        Logging.GetInstance().Error(this.ToString(), e.Result.StatusMessage);
  • trunk/sources/HeuristicLab.Hive.Client.Core/HeuristicLab.Hive.Client.Core.csproj

    r932 r944  
    8383    <Compile Include="Heartbeat.cs" />
    8484    <Compile Include="Properties\AssemblyInfo.cs" />
     85    <Compile Include="Properties\Settings.Designer.cs">
     86      <AutoGen>True</AutoGen>
     87      <DesignTimeSharedInput>True</DesignTimeSharedInput>
     88      <DependentUpon>Settings.settings</DependentUpon>
     89    </Compile>
     90    <Compile Include="Settings.cs" />
    8591  </ItemGroup>
    8692  <ItemGroup>
     93    <None Include="app.config" />
    8794    <None Include="HeuristicLab.snk" />
    8895    <None Include="Properties\AssemblyInfo.frame" />
     96    <None Include="Properties\Settings.settings">
     97      <Generator>PublicSettingsSingleFileGenerator</Generator>
     98      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     99    </None>
    89100  </ItemGroup>
    90101  <ItemGroup>
  • trunk/sources/HeuristicLab.sln

    r921 r944  
    931931    {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.CEDMA Debug|x86.ActiveCfg = Debug|x86
    932932    {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     933    {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Debug|Any CPU.Build.0 = Debug|Any CPU
    933934    {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Debug|x86.ActiveCfg = Debug|x86
    934935    {8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Debug|x86.Build.0 = Debug|x86
  • trunk/sources/HeuristicLab/MergeConfigs.cmd

    r856 r944  
    11ConfigMerger "%SolutionDir%\HeuristicLab.PluginInfrastructure\%Outdir%\HeuristicLab.PluginInfrastructure.dll.config" "HeuristicLab.exe.config"
    22ConfigMerger "%SolutionDir%\HeuristicLab.PluginInfrastructure.GUI\%Outdir%\HeuristicLab.PluginInfrastructure.GUI.dll.config" "HeuristicLab.exe.config"
     3ConfigMerger "%SolutionDir%\HeuristicLab.Hive.Client.Core\%Outdir%\HeuristicLab.Hive.Client.Core-3.2.dll.config" "HeuristicLab.exe.config"
Note: See TracChangeset for help on using the changeset viewer.