diff options
| author | Comment <tim@gray.(none)> | 2014-02-11 23:46:05 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2014-02-11 23:46:05 +0000 |
| commit | d537803422b5832d1b4a2f3fde6fae8704448638 (patch) | |
| tree | 4b4b1f4d695d90cf4eea5257fb8c7edf8865d578 /rotord/src/rotor.cpp | |
| parent | 98deb07854e39eee7861278b3a319b3a0edfb3c8 (diff) | |
fixed analytics
Diffstat (limited to 'rotord/src/rotor.cpp')
| -rw-r--r-- | rotord/src/rotor.cpp | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp index b31e2ce..cbfad2b 100644 --- a/rotord/src/rotor.cpp +++ b/rotord/src/rotor.cpp @@ -86,18 +86,6 @@ Node_factory::Node_factory(){ add_type("slider",new Slider(),category["UI"]); } -double Signal_input::get_time_used(){ - if (connection){ - return ((Signal_node*)connection)->get_time_used(); - } - return 0.0; -} -double Signal_input::get_time_taken(){ - if (connection){ - return ((Signal_node*)connection)->time_taken; - } - return 0.0; -} bool Signal_input::connect(Node* source) { connection=dynamic_cast<Signal_node*>(source); if (connection) return true; @@ -109,18 +97,6 @@ double Signal_input::get(const Time_spec& time){ //gets input and updates variab } else return 0.0; } -double Image_input::get_time_used(){ - if (connection){ - return ((Image_node*)connection)->get_time_used(); - } - return 0.0; -} -double Image_input::get_time_taken(){ - if (connection){ - return ((Image_node*)connection)->time_taken; - } - return 0.0; -} bool Image_input::connect(Node* source) { connection=dynamic_cast<Image_node*>(source); if (connection) return true; @@ -128,7 +104,13 @@ bool Image_input::connect(Node* source) { } Image* Image_input::get(const Frame_spec& time){ //gets input and updates variable if (connection){ - return (((Image_node*)connection)->get_image_output(time)); + struct timeval begin_time; + gettimeofday(&begin_time, NULL); + Image* im=(((Image_node*)connection)->get_image_output(time)); + struct timeval end_time; + gettimeofday(&end_time, NULL); + time_taken=((end_time.tv_sec-begin_time.tv_sec) + ((end_time.tv_usec-begin_time.tv_usec)/1000000.0)); + return im; } else return nullptr; } |
