-
Notifications
You must be signed in to change notification settings - Fork 317
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
[WriteState] minor fix with the time attribute, default values #776
Conversation
modules/SofaExporter/WriteState.inl
Outdated
@@ -47,7 +47,7 @@ WriteState::WriteState() | |||
, d_writeV( initData(&d_writeV, false, "writeV", "flag enabling output of V vector")) | |||
, d_writeF( initData(&d_writeF, false, "writeF", "flag enabling output of F vector")) | |||
, d_time( initData(&d_time, helper::vector<double>(0), "time", "set time to write outputs (by default export at t=0)")) | |||
, d_period( initData(&d_period, 0.0, "period", "period between outputs")) | |||
, d_period( initData(&d_period, this->getContext()->getDt(), "period", "period between outputs")) |
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.
is this default initialization really working ?
if not, this should definitely go in the init() function
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 know this initialization may seem strange but it works.
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.
It can go in the init too, but then the isSet() method called on period returns true.
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.
that's a good point that you do. And the value is correctly initialized ? (using the specified time step value)
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.
Well ... I let Olivier answer :)
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.
My bad. Actually, we saw with Damien that "this->getContext()->getDt()" before the context is really defined returns always 0.01, no matter what the real dt is! I tested it with dt=0.01 so I thought this was working fine. I will fix this now!
Alright, the initialization of the period is back to a less funky way! |
Hello, |
Yes, I just wanted to give it a try by tonight, if I don't have the time, we can merge it. |
[ci-build][with-scene-tests] |
Small fix, correcting the check for the multiplicity between "time" and dt, as well as putting period to dt by default if nothing is given by the user.
Set back to the default behavior : periodic export activated
This PR:
Reviewers will merge only if all these checks are true.