include freeze time tics in calculation for websocket data intervals (#1296)

This commit is contained in:
Scott Fennell 2022-06-28 17:20:50 -05:00 committed by GitHub
parent ade5932e87
commit 866c21d5a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -16,7 +16,6 @@ class CannonSimObject : public Trick::SimObject {
public:
CANNON cannon ;
int foo;
CannonSimObject() {
("default_data") cannon_default_data( &cannon ) ;
("initialization") cannon_init( &cannon ) ;

View File

@ -41,7 +41,7 @@ VariableServerSession::~VariableServerSession() {
(The specified period between messages).
*/
void VariableServerSession::marshallData() {
long long simulation_time_tics = exec_get_time_tics();
long long simulation_time_tics = exec_get_time_tics() + exec_get_freeze_time_tics();
if ( cyclicSendEnabled && ( simulation_time_tics >= nextTime )) {
stageValues();
nextTime = (simulation_time_tics - (simulation_time_tics % intervalTimeTics) + intervalTimeTics);
@ -170,7 +170,7 @@ void VariableServerSession::addVariable(char* vname){
}
void VariableServerSession::stageValues() {
stageTime = (double)exec_get_time_tics() / exec_get_time_tic_value();
stageTime = (double)(exec_get_time_tics() + exec_get_freeze_time_tics()) / exec_get_time_tic_value();
std::vector<VariableServerVariable*>::iterator it;
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) {
(*it)->stageValue();