[Bug #1080] Fixed issue with Montecarlo method when critical path has more than 10 tasks.
* Force render for tasks that are in pages not been active. * Moved out of long operation percentages validation. * Setting properly active page when some percentage is not valid. FEA: ItEr74S04BugFixing
This commit is contained in:
parent
35adfb3222
commit
939aa1f14a
1 changed files with 11 additions and 1 deletions
|
|
@ -114,6 +114,7 @@ public class MonteCarloController extends GenericForwardComposer {
|
|||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
validateRowsPercentages();
|
||||
IBackGroundOperation<IDesktopUpdate> operation = new IBackGroundOperation<IDesktopUpdate>() {
|
||||
|
||||
@Override
|
||||
|
|
@ -130,7 +131,6 @@ public class MonteCarloController extends GenericForwardComposer {
|
|||
try {
|
||||
updatesEmitter.doUpdate(disableButton(true));
|
||||
int iterations = getIterations();
|
||||
validateRowsPercentages();
|
||||
final Map<LocalDate, BigDecimal> monteCarloData = monteCarloModel
|
||||
.calculateMonteCarlo(getSelectedCriticalPath(),
|
||||
iterations,
|
||||
|
|
@ -169,6 +169,9 @@ public class MonteCarloController extends GenericForwardComposer {
|
|||
private void validateRowsPercentages() {
|
||||
Intbox intbox;
|
||||
|
||||
int page = 0;
|
||||
int counter = 0;
|
||||
|
||||
Rows rows = gridCriticalPathTasks.getRows();
|
||||
for (Object each : rows.getChildren()) {
|
||||
Row row = (Row) each;
|
||||
|
|
@ -184,9 +187,15 @@ public class MonteCarloController extends GenericForwardComposer {
|
|||
sum += intbox.getValue();
|
||||
|
||||
if (sum != 100) {
|
||||
gridCriticalPathTasks.setActivePage(page);
|
||||
throw new WrongValueException(row,
|
||||
_("Percentages should sum 100"));
|
||||
}
|
||||
|
||||
counter++;
|
||||
if (counter % gridCriticalPathTasks.getPageSize() == 0) {
|
||||
page++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -275,6 +284,7 @@ public class MonteCarloController extends GenericForwardComposer {
|
|||
}
|
||||
if (gridCriticalPathTasks.getRowRenderer() == null) {
|
||||
gridCriticalPathTasks.setRowRenderer(gridCriticalPathTasksRender);
|
||||
gridCriticalPathTasks.renderAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue