Changeset 1590


Ignore:
Timestamp:
04/17/09 12:43:37 (12 years ago)
Author:
aleitner
Message:

fixed bug on Snapshot-view (#569)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs

    r1581 r1590  
    6868    }
    6969
     70
     71    #region Backgroundworker
    7072    /// <summary>
    7173    /// event on Ticker
     
    8385    }
    8486
    85     private int CapacityRam(int noCores, int freeCores) {
    86       return (((noCores - freeCores) / noCores) * 100);
    87     }
     87    #endregion
    8888
    8989    /// <summary>
     
    107107              item = new ListViewItem(ci.Name, 3, lvg);
    108108            } else {
    109                             int percentageUsage = CapacityRam(ci.NrOfCores, ci.NrOfFreeCores);
     109              int percentageUsage = CapacityRam(ci.NrOfCores, ci.NrOfFreeCores);
    110110              int usage = 0;
    111111              if ((percentageUsage >= 0) && (percentageUsage <= 25)) {
     
    301301      }
    302302      if (currentJob.State != State.offline) {
    303         GetSnapshotList();
     303        lvSnapshots.Items.Clear();
     304        if (currentJob.State == State.finished)
     305          GetSnapshotList();
    304306        lvSnapshots.Visible = true;
    305307      } else {
     
    313315          RefreshJob(change);
    314316        } else if (change.Types == Type.Client) {
    315          RefreshClient(change);
     317          RefreshClient(change);
    316318        } else if (change.Types == Type.ClientGroup) {
    317319          RefreshClientGroup(change);
     
    534536        return true;
    535537      } else return false;
     538    }
     539
     540    private int CapacityRam(int noCores, int freeCores) {
     541      int capacity = ((noCores - freeCores) / noCores) * 100;
     542      System.Diagnostics.Debug.WriteLine(capacity);
     543      return capacity;
    536544    }
    537545
     
    621629            found = true;
    622630            if (job.State != State.offline) {
    623               if ((!IsEqual(job.Client, jobold.Client)) || (job.State != jobold.State) 
     631              if ((!IsEqual(job.Client, jobold.Client)) || (job.State != jobold.State)
    624632                   || (job.Percentage != jobold.Percentage)) {
    625633                changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Update, Position = i });
     
    658666
    659667      lvSnapshots.Items.Clear();
    660       IJobManager jobManager =
    661         ServiceLocator.GetJobManager();
     668      IJobManager jobManager = ServiceLocator.GetJobManager();
     669
    662670      ResponseObject<JobResult> jobRes = jobManager.GetLastJobResultOf(currentJob.Id, false);
     671
     672      // iterate threw all snapshots if method is implemented
     673
    663674      ListViewItem curSnapshot = new ListViewItem(jobRes.Obj.Client.Name);
    664675      double percentage = jobRes.Obj.Percentage * 100;
     
    666677      curSnapshot.SubItems.Add(jobRes.Obj.timestamp.ToString());
    667678      lvSnapshots.Items.Add(curSnapshot);
    668 
    669 
    670679    }
    671680
    672681    #endregion
    673 
    674 
    675682
    676683  }
Note: See TracChangeset for help on using the changeset viewer.