mirror of
https://github.com/nasa/trick.git
synced 2024-12-24 07:16:41 +00:00
include freeze time tics in calculation for websocket data intervals (#1296)
This commit is contained in:
parent
ade5932e87
commit
866c21d5a5
@ -16,7 +16,6 @@ class CannonSimObject : public Trick::SimObject {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CANNON cannon ;
|
CANNON cannon ;
|
||||||
int foo;
|
|
||||||
CannonSimObject() {
|
CannonSimObject() {
|
||||||
("default_data") cannon_default_data( &cannon ) ;
|
("default_data") cannon_default_data( &cannon ) ;
|
||||||
("initialization") cannon_init( &cannon ) ;
|
("initialization") cannon_init( &cannon ) ;
|
||||||
|
@ -41,7 +41,7 @@ VariableServerSession::~VariableServerSession() {
|
|||||||
(The specified period between messages).
|
(The specified period between messages).
|
||||||
*/
|
*/
|
||||||
void VariableServerSession::marshallData() {
|
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 )) {
|
if ( cyclicSendEnabled && ( simulation_time_tics >= nextTime )) {
|
||||||
stageValues();
|
stageValues();
|
||||||
nextTime = (simulation_time_tics - (simulation_time_tics % intervalTimeTics) + intervalTimeTics);
|
nextTime = (simulation_time_tics - (simulation_time_tics % intervalTimeTics) + intervalTimeTics);
|
||||||
@ -170,7 +170,7 @@ void VariableServerSession::addVariable(char* vname){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VariableServerSession::stageValues() {
|
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;
|
std::vector<VariableServerVariable*>::iterator it;
|
||||||
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) {
|
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) {
|
||||||
(*it)->stageValue();
|
(*it)->stageValue();
|
||||||
|
Loading…
Reference in New Issue
Block a user