Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
ec1e844f
Commit
ec1e844f
authored
Sep 16, 2017
by
Simon Barner
Browse files
- Active workaround for "null" ResourceSchedule hyperperiod
parent
603c2bb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.schedule.ui/trunk/src/org/fortiss/af3/schedule/ui/ganttchartview/ScheduleViewGraphModel.java
View file @
ec1e844f
...
...
@@ -26,12 +26,15 @@ import static org.fortiss.af3.schedule.ui.ganttchartview.ScheduleModelElementToD
import
static
org
.
fortiss
.
af3
.
schedule
.
ui
.
ganttchartview
.
ScheduleModelElementToDraw
.
drawScheduleModelElement
;
import
static
org
.
fortiss
.
af3
.
schedule
.
ui
.
ganttchartview
.
ScheduleViewColors
.
getColor
;
import
static
org
.
fortiss
.
af3
.
schedule
.
ui
.
ganttchartview
.
ScheduleViewLayoutData
.
DIAGRAM_OFFSET_Y
;
import
static
org
.
fortiss
.
af3
.
schedule
.
utils
.
MathUtils
.
lcmBigDecimalCollection
;
import
static
org
.
fortiss
.
af3
.
schedule
.
utils
.
ScheduleUtils
.
TOLERANCE
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.swt.SWT
;
...
...
@@ -133,14 +136,15 @@ public class ScheduleViewGraphModel {
BigDecimal
roundOffset
=
BigDecimal
.
ZERO
;
BigDecimal
schedulePeriod
=
ScheduleUtils
.
getHyperPeriod
(
schedule
);
// if(schedulePeriod == null) {
// schedulePeriod =
// lcmBigDecimalCollection(
// schedule.getResourceAllocationList().stream()
// .map(r -> ScheduleUtils.getPeriod(r))
// .filter(p -> p != null).collect(Collectors.toList()),
// TOLERANCE);
// }
// TODO Check whether to remove this workaround
if
(
schedulePeriod
==
null
)
{
schedulePeriod
=
lcmBigDecimalCollection
(
schedule
.
getResourceAllocationList
().
stream
()
.
map
(
r
->
ScheduleUtils
.
getPeriod
(
r
))
.
filter
(
p
->
p
!=
null
).
collect
(
Collectors
.
toList
()),
TOLERANCE
);
}
if
(
schedulePeriod
!=
null
&&
schedulePeriod
.
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
{
while
(
roundOffset
.
compareTo
(
scheduleModel
.
getMajorFrame
())
==
-
1
)
{
for
(
ResourceAllocation
resourceAllocation
:
schedule
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment