From 339f39f235bbe7991898dfc70d3aee77ace9357b Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 14 Dec 2002 14:37:40 +0000 Subject: [PATCH] Change time counter to a double. Add a variable which can allow us to track long term rate stats to verify we are hitting the requested hz. --- src/Network/protocol.cxx | 3 ++- src/Network/protocol.hxx | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Network/protocol.cxx b/src/Network/protocol.cxx index be4883ecf..e505bd5d5 100644 --- a/src/Network/protocol.cxx +++ b/src/Network/protocol.cxx @@ -29,7 +29,8 @@ FGProtocol::FGProtocol() : hz(0.0), - count_down(0), + count_down(0.0), + count(0), enabled(false) { } diff --git a/src/Network/protocol.hxx b/src/Network/protocol.hxx index 4b73d1893..f02ef5755 100644 --- a/src/Network/protocol.hxx +++ b/src/Network/protocol.hxx @@ -42,7 +42,8 @@ class FGProtocol { private: double hz; - int count_down; + double count_down; + long count; SGProtocolDir dir; @@ -69,9 +70,12 @@ public: inline double get_hz() const { return hz; } inline void set_hz( double t ) { hz = t; } - inline int get_count_down() const { return count_down; } - inline void set_count_down( int c ) { count_down = c; } - inline void dec_count_down( int c ) { count_down -= c; } + inline double get_count_down() const { return count_down; } + inline void set_count_down( double c ) { count_down = c; } + inline void inc_count_down( double amt ) { count_down += amt; } + inline void dec_count_down( double amt ) { count_down -= amt; } + inline void inc_count() { count++; } + inline long get_count() { return count; } virtual bool gen_message(); virtual bool parse_message(); -- 2.39.5