Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
Horizon Simulation Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redmine-legacy
Horizon Simulation Framework
Commits
9a3b7d13
Commit
9a3b7d13
authored
Dec 07, 2011
by
Simon Tenbusch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[sequencechart]
- fixed a bug in critical path visualization
parent
92b45026
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
17 deletions
+46
-17
ide/org.omnetpp.sequencechart/src/org/omnetpp/sequencechart/widgets/SequenceChart.java
.../src/org/omnetpp/sequencechart/widgets/SequenceChart.java
+46
-17
No files found.
ide/org.omnetpp.sequencechart/src/org/omnetpp/sequencechart/widgets/SequenceChart.java
View file @
9a3b7d13
...
...
@@ -3236,15 +3236,19 @@ public class SequenceChart
int
currentLineWidth
=
0
;
boolean
changedLineStyleForCriticalPath
=
false
;
if
(
sequenceChartFacade
.
IMessageDependency_isReuse
(
messageDependencyPtr
)
&&
!
showOtherMessageReuses
)
if
(
sequenceChartFacade
.
IMessageDependency_isReuse
(
messageDependencyPtr
)
&&
!
showOtherMessageReuses
)
{
return
false
;
}
if
(
sequenceChartFacade
.
IMessageDependency_isSelfMessageReuse
(
messageDependencyPtr
)
&&
!
showSelfMessageReuses
)
return
false
;
if
(
sequenceChartFacade
.
IMessageDependency_isSelfMessageReuse
(
messageDependencyPtr
)
&&
!
showSelfMessageReuses
)
{
return
false
;
}
// events may be omitted from the log
if
(
causeEventPtr
==
0
||
consequenceEventPtr
==
0
)
if
(
causeEventPtr
==
0
||
consequenceEventPtr
==
0
)
{
return
false
;
}
// cache message dependency state
long
beginSendEntryPtr
=
sequenceChartFacade
.
IMessageDependency_getBeginSendEntry
(
messageDependencyPtr
);
...
...
@@ -3317,8 +3321,9 @@ public class SequenceChart
}
// at least one of the events must be in range or we don't draw anything
if
(
x1
==
invalid
&&
x2
==
invalid
)
return
false
;
if
(
x1
==
invalid
&&
x2
==
invalid
)
{
return
false
;
}
// line color and style depends on message kind
if
(
graphics
!=
null
)
{
...
...
@@ -3333,7 +3338,7 @@ public class SequenceChart
}
// change line style if critical path should be visualized
if
(
showCriticalPath
&&
graphics
!=
null
)
{
if
(
showCriticalPath
&&
graphics
!=
null
&&
(
showMessageSends
||
showSelfMessages
)
)
{
boolean
causeOnPath
=
sequenceChartFacade
.
isOnCriticalPath
(
sequenceChartFacade
.
IEvent_getEvent
(
causeEventPtr
));
boolean
consequenceOnPath
=
sequenceChartFacade
.
isOnCriticalPath
(
sequenceChartFacade
.
IEvent_getEvent
(
consequenceEventPtr
));
if
(
causeOnPath
&&
consequenceOnPath
)
{
...
...
@@ -3349,8 +3354,10 @@ public class SequenceChart
// test if self-message
if
(
y1
==
y2
)
{
// FIXME: this filters out non self messages too, e.g. filtered and returns to same module
if
(!
showSelfMessages
)
if
(!
showSelfMessages
)
{
resetGraphicsFromCriticalPath
(
graphics
,
changedLineStyleForCriticalPath
,
currentLineWidth
,
currentForegroundColor
);
return
false
;
}
long
eventNumberDelta
=
messageId
+
consequenceEventNumber
-
causeEventNumber
;
int
numberOfPossibleEllipseHeights
=
Math
.
max
(
1
,
(
int
)
Math
.
round
((
getAxisSpacing
()
-
fontHeight
)
/
(
fontHeight
+
10
)));
...
...
@@ -3370,8 +3377,10 @@ public class SequenceChart
if
(
showMessageNames
)
drawMessageDependencyLabel
(
graphics
,
messageDependencyPtr
,
x1
,
y1
,
2
,
-
fontHeight
);
}
else
else
{
resetGraphicsFromCriticalPath
(
graphics
,
changedLineStyleForCriticalPath
,
currentLineWidth
,
currentForegroundColor
);
return
lineContainsPoint
(
x1
,
y1
,
x2
,
y2
,
fitX
,
fitY
,
tolerance
);
}
}
else
{
boolean
showArrowHeads
=
this
.
showArrowHeads
;
...
...
@@ -3394,9 +3403,12 @@ public class SequenceChart
if
(
isFilteredMessageDependency
)
drawFilteredMessageDependencySign
(
graphics
,
x1
,
ym
,
x2
,
ym
);
}
else
else
{
resetGraphicsFromCriticalPath
(
graphics
,
changedLineStyleForCriticalPath
,
currentLineWidth
,
currentForegroundColor
);
return
lineContainsPoint
(
x1
,
ym
,
xm
,
ym
,
fitX
,
fitY
,
tolerance
)
||
halfEllipseContainsPoint
(
1
,
x1
,
x2
,
y1
,
halfEllipseHeight
,
fitX
,
fitY
,
tolerance
);
}
}
// consequence is too far away
else
if
(
x2
==
invalid
)
{
...
...
@@ -3420,9 +3432,12 @@ public class SequenceChart
showArrowHeads
=
false
;
}
else
else
{
resetGraphicsFromCriticalPath
(
graphics
,
changedLineStyleForCriticalPath
,
currentLineWidth
,
currentForegroundColor
);
return
lineContainsPoint
(
xm
,
ym
,
x2
,
ym
,
fitX
,
fitY
,
tolerance
)
||
halfEllipseContainsPoint
(
0
,
x1
,
x2
,
y1
,
halfEllipseHeight
,
fitX
,
fitY
,
tolerance
);
}
}
// both events are close enough
else
{
...
...
@@ -3436,8 +3451,10 @@ public class SequenceChart
if
(
isFilteredMessageDependency
)
drawFilteredMessageDependencySign
(
graphics
,
x1
,
ym
,
x2
,
ym
);
}
else
else
{
resetGraphicsFromCriticalPath
(
graphics
,
changedLineStyleForCriticalPath
,
currentLineWidth
,
currentForegroundColor
);
return
halfEllipseContainsPoint
(-
1
,
x1
,
x2
,
y1
,
halfEllipseHeight
,
fitX
,
fitY
,
tolerance
);
}
}
if
(
showArrowHeads
)
{
...
...
@@ -3469,8 +3486,10 @@ public class SequenceChart
}
}
else
{
if
(!
showMessageSends
)
return
false
;
if
(!
showMessageSends
)
{
resetGraphicsFromCriticalPath
(
graphics
,
changedLineStyleForCriticalPath
,
currentLineWidth
,
currentForegroundColor
);
return
false
;
}
int
y
=
(
y2
+
y1
)
/
2
;
Color
arrowHeadFillColor
=
null
;
...
...
@@ -3545,8 +3564,11 @@ public class SequenceChart
}
}
if
(
graphics
==
null
)
if
(
graphics
==
null
)
{
resetGraphicsFromCriticalPath
(
graphics
,
changedLineStyleForCriticalPath
,
currentLineWidth
,
currentForegroundColor
);
return
lineContainsPoint
(
x1
,
y1
,
x2
,
y2
,
fitX
,
fitY
,
tolerance
);
}
if
(
graphics
!=
null
&&
isFilteredMessageDependency
)
drawFilteredMessageDependencySign
(
graphics
,
x1
,
y1
,
x2
,
y2
);
...
...
@@ -3570,13 +3592,20 @@ public class SequenceChart
// when fitting we should have already returned
Assert
.
isTrue
(
graphics
!=
null
);
resetGraphicsFromCriticalPath
(
graphics
,
changedLineStyleForCriticalPath
,
currentLineWidth
,
currentForegroundColor
);
return
false
;
}
/*
* Resets the graphic line style. Only called from within drawOrFitMessageDependency
*/
private
void
resetGraphicsFromCriticalPath
(
Graphics
graphics
,
boolean
changedLineStyleForCriticalPath
,
int
currentLineWidth
,
Color
currentForegroundColor
)
{
// reset line style
if
(
changedLineStyleForCriticalPath
&&
graphics
!=
null
)
{
graphics
.
setLineWidth
(
currentLineWidth
);
graphics
.
setForegroundColor
(
currentForegroundColor
);
}
return
false
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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