Changeset 186 in flair-src for trunk/lib/FlairCore/src
- Timestamp:
- Jun 23, 2017, 5:33:03 PM (7 years ago)
- Location:
- trunk/lib/FlairCore/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/FrameworkManager.cpp
r123 r186 81 81 for (vector<const Object *>::iterator it = Childs()->begin(); 82 82 it < Childs()->end(); it++) { 83 // Printf("child %i %s 84 // %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str()); 83 //Printf("child %i %s %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str()); 85 84 if ((*it)->ObjectType() == "Thread") { 86 85 if (*it != pimpl_) { … … 102 101 for (vector<const Object *>::iterator it = Childs()->begin(); 103 102 it < Childs()->end(); it++) { 104 // Printf("child %i %s 105 // %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str()); 103 //Printf("child %i %s %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str()); 106 104 if ((*it)->ObjectType() == "IODevice") { 107 105 // Printf("del\n"); … … 122 120 // permet de garder l'uicom pour notifer des destructions 123 121 while (Childs()->size() != 0) { 124 // Printf("child %i %s 125 // %s\n",Childs()->size(),Childs()->back()->ObjectName().c_str(),Childs()->back()->ObjectType().c_str()); 122 //Printf("child %i %s %s\n",Childs()->size(),Childs()->back()->ObjectName().c_str(),Childs()->back()->ObjectType().c_str()); 126 123 if (Childs()->back() != NULL) 127 124 delete Childs()->back(); … … 135 132 void FrameworkManager::SetupConnection(string address, uint16_t port,Time watchdogTimeout, 136 133 size_t rcv_buf_size) { 137 pimpl_->SetupConnection(address, port, rcv_buf_size);134 pimpl_->SetupConnection(address, port, watchdogTimeout,rcv_buf_size); 138 135 } 139 136 -
trunk/lib/FlairCore/src/FrameworkManager_impl.cpp
r137 r186 239 239 gcs_watchdog = new Watchdog( 240 240 this, std::bind(&FrameworkManager_impl::ConnectionLost, this), 241 (Time)1000000000);241 watchdogTimeout); 242 242 gcs_watchdog->Start(); 243 243 } -
trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp
r167 r186 22 22 #include <Euler.h> 23 23 #include <Quaternion.h> 24 #include <math.h> 24 25 25 26 using std::string; … … 41 42 OneAxisRotation_impl::~OneAxisRotation_impl() {} 42 43 43 // compute rotation of each axis through ComputeRotation(Vector3D& vector)44 44 void OneAxisRotation_impl::ComputeRotation(Quaternion &quat) const { 45 Vector3Df rot = Vector3Df(quat.q1, quat.q2, quat.q3); 46 ComputeRotation(rot); 47 quat.q1 = rot.x; 48 quat.q2 = rot.y; 49 quat.q3 = rot.z; 45 Quaternion rot; 46 switch (rot_axe->CurrentIndex()) { 47 case 0: 48 rot=Quaternion(cosf(Euler::ToRadian(rot_value->Value()/2)),sinf(Euler::ToRadian(rot_value->Value()/2)), 0,0); 49 break; 50 case 1: 51 rot=Quaternion(cosf(Euler::ToRadian(rot_value->Value()/2)),0,sinf(Euler::ToRadian(rot_value->Value()/2)),0); 52 break; 53 case 2: 54 rot=Quaternion(cosf(Euler::ToRadian(rot_value->Value()/2)),0,0,sinf(Euler::ToRadian(rot_value->Value()/2))); 55 break; 56 } 57 quat=quat*rot; 50 58 } 51 59 -
trunk/lib/FlairCore/src/Thread_impl.cpp
r133 r186 57 57 this->priority = priority; 58 58 period = 100 * 1000 * 1000; // 100ms par defaut 59 min_ jitter= 1000 * 1000 * 1000;60 max_ jitter= 0;61 mean_ jitter= 0;59 min_latency = 1000 * 1000 * 1000; 60 max_latency = 0; 61 mean_latency = 0; 62 62 last = 0; 63 63 cpt = 0; … … 234 234 next_time += period; 235 235 #endif 236 Compute Jitter(GetTime());236 ComputeLatency(GetTime()); 237 237 } 238 238 … … 324 324 { 325 325 #ifndef __XENO__ 326 //if(last!=0)326 if(last!=0) 327 327 #endif 328 328 { Printf("Thread::%s :\n", self->ObjectName().c_str()); } … … 346 346 #endif 347 347 if (last != 0) { 348 Printf(" min jitter (ns): %lld\n", min_jitter);349 Printf(" max jitter (ns): %lld\n", max_jitter);350 Printf(" jitter moy (ns): %lld\n", mean_jitter/ cpt);348 Printf(" min latency (ns): %lld\n", min_latency); 349 Printf(" max latency (ns): %lld\n", max_latency); 350 Printf(" latency moy (ns): %lld\n", mean_latency / cpt); 351 351 Printf(" itertions: %lld\n", cpt); 352 352 } … … 370 370 } 371 371 372 void Thread_impl::Compute Jitter(Time time) {372 void Thread_impl::ComputeLatency(Time time) { 373 373 Time diff, delta; 374 374 diff = time - last; … … 384 384 return; 385 385 386 if (delta > max_ jitter)387 max_ jitter= delta;388 if (delta < min_ jitter)389 min_ jitter= delta;390 mean_ jitter+= delta;386 if (delta > max_latency) 387 max_latency = delta; 388 if (delta < min_latency) 389 min_latency = delta; 390 mean_latency += delta; 391 391 cpt++; 392 392 393 // Printf("Thread::%s jittermoy (ns):394 // %lld\n",self->ObjectName().c_str(),mean_ jitter/cpt);393 // Printf("Thread::%s latency moy (ns): 394 // %lld\n",self->ObjectName().c_str(),mean_latency/cpt); 395 395 } 396 396 -
trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h
r122 r186 44 44 ~FrameworkManager_impl(); 45 45 void SetupConnection(std::string address, uint16_t port,flair::core::Time watchdogTimeout, 46 size_t rcv_buf_size = 10000);46 size_t rcv_buf_size); 47 47 void SetupUserInterface(std::string xml_file); 48 48 void SetupLogger(std::string log_path); -
trunk/lib/FlairCore/src/unexported/Thread_impl.h
r139 r186 55 55 flair::core::ConditionVariable *cond; 56 56 uint8_t priority; 57 flair::core::Time max_ jitter, min_jitter, mean_jitter;57 flair::core::Time max_latency, min_latency, mean_latency; 58 58 flair::core::Time last; 59 59 uint64_t cpt; … … 62 62 bool is_suspended; 63 63 void PrintStats(void); 64 void Compute Jitter(flair::core::Time time);64 void ComputeLatency(flair::core::Time time); 65 65 #ifdef __XENO__ 66 66 RT_TASK task_rt;
Note:
See TracChangeset
for help on using the changeset viewer.