Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
a80b9437
Commit
a80b9437
authored
3 years ago
by
terry-norbraten
Browse files
Options
Downloads
Patches
Plain Diff
[Terry N.] turns out we need to cast NPS time from long to int
parent
4cf0cb0e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src-generated/edu/nps/moves/dis7/pdus/DisTime.java
+4
-5
4 additions, 5 deletions
src-generated/edu/nps/moves/dis7/pdus/DisTime.java
with
4 additions
and
5 deletions
src-generated/edu/nps/moves/dis7/pdus/DisTime.java
+
4
−
5
View file @
a80b9437
...
@@ -124,7 +124,6 @@ public class DisTime
...
@@ -124,7 +124,6 @@ public class DisTime
* Fix to bitshift by mvormelch.
* Fix to bitshift by mvormelch.
* @return DIS time units, get absolute timestamp
* @return DIS time units, get absolute timestamp
*/
*/
public
int
getDisAbsoluteTimestamp
()
{
public
int
getDisAbsoluteTimestamp
()
{
int
val
=
this
.
getDisTimeUnitsSinceTopOfHour
();
int
val
=
this
.
getDisTimeUnitsSinceTopOfHour
();
val
=
(
val
<<
1
)
|
ABSOLUTE_TIMESTAMP_MASK
;
// always flip the lsb to 1
val
=
(
val
<<
1
)
|
ABSOLUTE_TIMESTAMP_MASK
;
// always flip the lsb to 1
...
@@ -148,7 +147,7 @@ public class DisTime
...
@@ -148,7 +147,7 @@ public class DisTime
* as long as you're not working on New Year's Eve.
* as long as you're not working on New Year's Eve.
* @return a timestamp in hundredths of a second since the start of the year
* @return a timestamp in hundredths of a second since the start of the year
*/
*/
public
long
getNpsTimestamp
()
{
public
int
getNpsTimestamp
()
{
// set calendar object to current time
// set calendar object to current time
long
currentTime
=
System
.
currentTimeMillis
();
// UTC milliseconds since 1970
long
currentTime
=
System
.
currentTimeMillis
();
// UTC milliseconds since 1970
calendar
.
setTimeInMillis
(
currentTime
);
calendar
.
setTimeInMillis
(
currentTime
);
...
@@ -166,7 +165,7 @@ public class DisTime
...
@@ -166,7 +165,7 @@ public class DisTime
long
diff
=
currentTime
-
startOfYear
;
long
diff
=
currentTime
-
startOfYear
;
diff
/=
10
;
// milliseconds to hundredths of a second
diff
/=
10
;
// milliseconds to hundredths of a second
return
diff
;
return
(
int
)
diff
;
}
}
/**
/**
...
@@ -186,10 +185,10 @@ public class DisTime
...
@@ -186,10 +185,10 @@ public class DisTime
* Consult the Wikipedia page on <a href="https://en.wikipedia.org/wiki/Unix_time">Unix time</a> for the gory details
* Consult the Wikipedia page on <a href="https://en.wikipedia.org/wiki/Unix_time">Unix time</a> for the gory details
* @return seconds since 1970
* @return seconds since 1970
*/
*/
public
long
getUnixTimestamp
()
{
public
int
getUnixTimestamp
()
{
long
t
=
System
.
currentTimeMillis
();
long
t
=
System
.
currentTimeMillis
();
t
/=
1000
l
;
// NB: integer division, convert milliseconds to seconds
t
/=
1000
l
;
// NB: integer division, convert milliseconds to seconds
return
t
;
return
(
int
)
t
;
}
}
/**
/**
* Convert timestamp value to string for logging and diagnostics
* Convert timestamp value to string for logging and diagnostics
...
...
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