-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address comments for PR #57 #59
Conversation
@@ -158,7 +158,9 @@ public void init(ServletConfig oConfig) | |||
protected void doGet(HttpServletRequest oRequest, HttpServletResponse oResponse) | |||
throws ServletException, IOException | |||
{ | |||
long lNow = System.currentTimeMillis(); | |||
Object timeObj = this.getServletContext().getAttribute(TimeSource.class.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be replaced with the following :
long lNow = TimeSource.getInstance().currentTimeMillis();
@@ -449,7 +451,9 @@ private void addControl(HttpServletRequest oReq, HttpServletResponse oRes) | |||
{ | |||
try | |||
{ | |||
long lNow = System.currentTimeMillis() - 10; | |||
Object timeObj = this.getServletContext().getAttribute(TimeSource.class.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
long lNow =TimeSource.currentTimeMillis();
@@ -561,7 +565,9 @@ private void saveEdit(HttpServletRequest oReq, HttpServletResponse oRes) | |||
{ | |||
try | |||
{ | |||
long lNow = System.currentTimeMillis(); | |||
Object timeObj = this.getServletContext().getAttribute(TimeSource.class.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above
m_oTs.m_lSimTime = lStep; | ||
} | ||
LOGGER.debug(String.format("seq: %d timestep: %d timesource: %d", lSeq, lStep, m_oTs.currentTimeMillis())); | ||
this.getServletContext().setAttribute(TimeSource.class.getName(), m_oTs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to call setAttribute here. We are already setting the value of this member variable.
Also I think we should write a set method for TimeSource which throws an exception when not in simulation mode and maybe a warning when we are setting time backwards. What do you think
<description>OPTIONAL: Network port for simulation ambassador. Leave undefined for normal time operation.</description> | ||
<param-name>ambassadorPort</param-name> | ||
<param-value>1617</param-value> | ||
</init-param> | ||
|
||
<init-param> | ||
<description>REQUIRED: Only needed if ambassador address is defined. URL where ambassador sends time sync messages.</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is optional now right
Changes reflected in #57 |
PR Details
Description
This PR is to address some comments left on PR: #57.
Below is the list of comments to be addressed:
Related GitHub Issue
NA
Related Jira Key
NA
Motivation and Context
NA
How Has This Been Tested?
NA
Types of changes
Checklist: