Show the precise efforts instead of the rounded amount in hours
FEA: ItEr75S04BugFixing
This commit is contained in:
parent
b04d6b7ba1
commit
9555ab4645
6 changed files with 28 additions and 27 deletions
|
|
@ -43,23 +43,23 @@ public class LoadPeriod {
|
|||
|
||||
private final LoadLevel loadLevel;
|
||||
|
||||
private final int totalResourceWorkHours;
|
||||
private final String availableEffort;
|
||||
|
||||
private final int assignedHours;
|
||||
private final String assignedEffort;
|
||||
|
||||
public LoadPeriod(GanttDate start, GanttDate end,
|
||||
int totalResourceWorkHours, int assignedHours, LoadLevel loadLevel) {
|
||||
public LoadPeriod(GanttDate start, GanttDate end, String availableEffort,
|
||||
String assignedEffort, LoadLevel loadLevel) {
|
||||
Validate.notNull(start);
|
||||
Validate.notNull(end);
|
||||
Validate.notNull(loadLevel);
|
||||
Validate.notNull(totalResourceWorkHours);
|
||||
Validate.notNull(assignedHours);
|
||||
Validate.notNull(availableEffort);
|
||||
Validate.notNull(assignedEffort);
|
||||
Validate.isTrue(start.compareTo(end) <= 0);
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.loadLevel = loadLevel;
|
||||
this.totalResourceWorkHours = totalResourceWorkHours;
|
||||
this.assignedHours = assignedHours;
|
||||
this.availableEffort = availableEffort;
|
||||
this.assignedEffort = assignedEffort;
|
||||
}
|
||||
|
||||
public GanttDate getStart() {
|
||||
|
|
@ -113,11 +113,11 @@ public class LoadPeriod {
|
|||
return loadLevel;
|
||||
}
|
||||
|
||||
public int getTotalResourceWorkHours() {
|
||||
return totalResourceWorkHours;
|
||||
public String getAvailableEffort() {
|
||||
return availableEffort;
|
||||
}
|
||||
|
||||
public int getAssignedHours() {
|
||||
return assignedHours;
|
||||
public String getAssignedEffort() {
|
||||
return assignedEffort;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,9 +196,9 @@ public class ResourceLoadComponent extends XulElement {
|
|||
load = "";
|
||||
}
|
||||
result.setTooltiptext(load
|
||||
+ _("total work hours: {0}, assigned hours: {1}", loadPeriod
|
||||
.getTotalResourceWorkHours(), loadPeriod
|
||||
.getAssignedHours()));
|
||||
+ _("available effort: {0}, assigned effort: {1}",
|
||||
loadPeriod.getAvailableEffort(),
|
||||
loadPeriod.getAssignedEffort()));
|
||||
|
||||
result.setLeft(forCSS(getStartPixels(datesMapper, loadPeriod)));
|
||||
result.setWidth(forCSS(getWidthPixels(datesMapper, loadPeriod)));
|
||||
|
|
|
|||
|
|
@ -71,9 +71,9 @@ public class LoadPeriodTest {
|
|||
assignedHours, correctLoadLevel());
|
||||
}
|
||||
|
||||
private static final int totalHours = 100;
|
||||
private static final String totalHours = "100";
|
||||
|
||||
private static final int assignedHours = 40;
|
||||
private static final String assignedHours = "40";
|
||||
|
||||
private static LoadLevel correctLoadLevel() {
|
||||
return new LoadLevel(40);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class LoadTimelineTest {
|
|||
loadTimeLine = new LoadTimeLine(conceptName,
|
||||
Arrays.asList(new LoadPeriod(GanttDate
|
||||
.createFrom(new LocalDate(2009, 10, 5)), GanttDate
|
||||
.createFrom(new LocalDate(2009, 10, 11)), 100, 20,
|
||||
.createFrom(new LocalDate(2009, 10, 11)), "100", "20",
|
||||
new LoadLevel(20))), null);
|
||||
}
|
||||
|
||||
|
|
@ -80,10 +80,10 @@ public class LoadTimelineTest {
|
|||
public void aLoadTimelineSortsItsReceivedPeriods() {
|
||||
LoadPeriod l1 = new LoadPeriod(GanttDate.createFrom(new LocalDate(2009,
|
||||
10, 5)), GanttDate.createFrom(new LocalDate(2009, 10, 11)),
|
||||
100, 20, new LoadLevel(20));
|
||||
"100", "20", new LoadLevel(20));
|
||||
LoadPeriod l2 = new LoadPeriod(GanttDate.createFrom(new LocalDate(2009,
|
||||
5, 3)), GanttDate.createFrom(new LocalDate(2009, 6, 3)), 100,
|
||||
20, new LoadLevel(20));
|
||||
5, 3)), GanttDate.createFrom(new LocalDate(2009, 6, 3)), "100",
|
||||
"20", new LoadLevel(20));
|
||||
LoadTimeLine loadTimeLine = new LoadTimeLine("bla", Arrays.asList(l1,
|
||||
l2), null);
|
||||
|
||||
|
|
@ -96,10 +96,10 @@ public class LoadTimelineTest {
|
|||
public void theLoadPeriodsMustNotOverlap() {
|
||||
LoadPeriod l1 = new LoadPeriod(GanttDate.createFrom(new LocalDate(2009,
|
||||
10, 5)), GanttDate.createFrom(new LocalDate(2009, 10, 11)),
|
||||
100, 20, new LoadLevel(20));
|
||||
"100", "20", new LoadLevel(20));
|
||||
LoadPeriod l2 = new LoadPeriod(GanttDate.createFrom(new LocalDate(2009,
|
||||
5, 3)), GanttDate.createFrom(new LocalDate(2009, 10, 10)), 100,
|
||||
20, new LoadLevel(20));
|
||||
5, 3)), GanttDate.createFrom(new LocalDate(2009, 10, 10)),
|
||||
"100", "20", new LoadLevel(20));
|
||||
new LoadTimeLine("bla", Arrays.asList(l1, l2), null);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,8 @@ abstract class LoadPeriodGenerator {
|
|||
EffortDuration totalEffort = getTotalAvailableEffort();
|
||||
EffortDuration effortAssigned = getEffortAssigned();
|
||||
return new LoadPeriod(asGantt(start), asGantt(end),
|
||||
totalEffort.roundToHours(), effortAssigned.roundToHours(),
|
||||
totalEffort.toFormattedString(),
|
||||
effortAssigned.toFormattedString(),
|
||||
new LoadLevel(calculateLoadPercentage(totalEffort,
|
||||
effortAssigned)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1123,8 +1123,8 @@ class PeriodsBuilder {
|
|||
}
|
||||
if (finalStartDate.compareTo(finalEndDate) < 0) {
|
||||
toReturn.add(new LoadPeriod(finalStartDate, finalEndDate,
|
||||
loadPeriod.getTotalResourceWorkHours(),
|
||||
loadPeriod.getAssignedHours(), loadPeriod.getLoadLevel()));
|
||||
loadPeriod.getAvailableEffort(),
|
||||
loadPeriod.getAssignedEffort(), loadPeriod.getLoadLevel()));
|
||||
}
|
||||
}
|
||||
return toReturn;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue