Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlatools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlatools
Commits
bd246333
Commit
bd246333
authored
Jan 8, 2018
by
Markus Alexander Kuppe
Browse files
Options
Downloads
Patches
Plain Diff
Show elapsed time in coverage result table instead of absolute
wall-clock time. [Feature][Toolbox]
parent
02d61452
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.lamport.tla.toolbox.tool.tlc.ui/src/org/lamport/tla/toolbox/tool/tlc/ui/editor/page/ResultPage.java
+23
-7
23 additions, 7 deletions
...mport/tla/toolbox/tool/tlc/ui/editor/page/ResultPage.java
with
23 additions
and
7 deletions
org.lamport.tla.toolbox.tool.tlc.ui/src/org/lamport/tla/toolbox/tool/tlc/ui/editor/page/ResultPage.java
+
23
−
7
View file @
bd246333
...
...
@@ -9,6 +9,7 @@ import java.util.Hashtable;
import
java.util.List
;
import
java.util.TimeZone
;
import
java.util.Vector
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.locks.Lock
;
import
java.util.concurrent.locks.ReentrantLock
;
...
...
@@ -104,6 +105,7 @@ public class ResultPage extends BasicFormPage implements ITLCModelLaunchDataPres
private
SourceViewer
progressOutput
;
private
SourceViewer
expressionEvalResult
;
private
SourceViewer
expressionEvalInput
;
private
long
startTimestamp
;
private
Text
startTimestampText
;
// startTime is provided by the TLCModelLaunchDataProvider's getStartTime()
// method.
...
...
@@ -180,8 +182,8 @@ public class ResultPage extends BasicFormPage implements ITLCModelLaunchDataPres
ResultPage
.
this
.
expressionEvalResult
.
getTextWidget
().
setText
(
dataProvider
.
getCalcOutput
());
break
;
case
START_TIME:
final
long
startTimestamp
=
dataProvider
.
getStartTimestamp
();
if
(
startTimestamp
<
0
)
{
ResultPage
.
this
.
startTimestamp
=
dataProvider
.
getStartTimestamp
();
if
(
ResultPage
.
this
.
startTimestamp
<
0
)
{
// Leave the starttime text empty on a negative
// timestamp. A negative one indicates that the
// model has never been checked. See Long.MIN_VALUE in
...
...
@@ -189,7 +191,7 @@ public class ResultPage extends BasicFormPage implements ITLCModelLaunchDataPres
ResultPage
.
this
.
startTimestampText
.
setText
(
""
);
break
;
}
ResultPage
.
this
.
startTimestampText
.
setText
(
new
Date
(
startTimestamp
).
toString
());
ResultPage
.
this
.
startTimestampText
.
setText
(
new
Date
(
ResultPage
.
this
.
startTimestamp
).
toString
());
ResultPage
.
this
.
startTime
=
dataProvider
.
getStartTime
();
break
;
case
END_TIME:
...
...
@@ -378,6 +380,7 @@ public class ResultPage extends BasicFormPage implements ITLCModelLaunchDataPres
return
;
}
this
.
startTimestampText
.
setText
(
""
);
this
.
startTimestamp
=
0
;
this
.
startTime
=
0
;
this
.
finishTimestampText
.
setText
(
""
);
this
.
tlcModeText
.
setText
(
""
);
...
...
@@ -787,7 +790,7 @@ public class ResultPage extends BasicFormPage implements ITLCModelLaunchDataPres
}
});
this
.
stateSpace
.
setLabelProvider
(
new
StateSpaceLabelProvider
());
this
.
stateSpace
.
setLabelProvider
(
new
StateSpaceLabelProvider
(
this
));
getSite
().
setSelectionProvider
(
this
.
stateSpace
);
return
statespaceComposite
;
}
...
...
@@ -893,8 +896,12 @@ public class ResultPage extends BasicFormPage implements ITLCModelLaunchDataPres
public
final
static
int
COL_DISTINCT
=
3
;
public
final
static
int
COL_LEFT
=
4
;
private
static
final
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
// $NON-NLS-1$
private
boolean
doHighlight
=
false
;
private
final
ResultPage
resultPage
;
public
StateSpaceLabelProvider
(
ResultPage
resultPage
)
{
this
.
resultPage
=
resultPage
;
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
...
...
@@ -934,7 +941,7 @@ public class ResultPage extends BasicFormPage implements ITLCModelLaunchDataPres
StateSpaceInformationItem
item
=
(
StateSpaceInformationItem
)
element
;
switch
(
columnIndex
)
{
case
COL_TIME:
return
sdf
.
format
(
item
.
getTime
());
return
format
Interval
(
resultPage
.
startTimestamp
,
item
.
getTime
()
.
getTime
());
case
COL_DIAMETER:
if
(
item
.
getDiameter
()
>=
0
)
{
...
...
@@ -994,6 +1001,15 @@ public class ResultPage extends BasicFormPage implements ITLCModelLaunchDataPres
public
void
unsetHighlightUnexplored
()
{
doHighlight
=
false
;
}
private
static
String
formatInterval
(
final
long
firstTS
,
final
long
secondTS
)
{
final
long
interval
=
secondTS
-
firstTS
;
final
long
hr
=
TimeUnit
.
MILLISECONDS
.
toHours
(
interval
);
final
long
min
=
TimeUnit
.
MILLISECONDS
.
toMinutes
(
interval
-
TimeUnit
.
HOURS
.
toMillis
(
hr
));
final
long
sec
=
TimeUnit
.
MILLISECONDS
.
toSeconds
(
interval
-
TimeUnit
.
HOURS
.
toMillis
(
hr
)
-
TimeUnit
.
MINUTES
.
toMillis
(
min
));
return
String
.
format
(
"%02d:%02d:%02d"
,
hr
,
min
,
sec
);
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment