Changeset 150 in flair-src for trunk/lib/FlairSensorActuator/src
- Timestamp:
- Mar 1, 2017, 2:37:00 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/SimuCamera.cpp
r144 r150 37 37 : Thread(getFrameworkManager(), name, priority), 38 38 Camera(name, width, height, cvimage::Type::Format::BGR) { 39 data_rate =40 new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 200, 1, 50);39 // data_rate = 40 // new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 200, 1, 50); 41 41 42 42 buf_size = width * height * channels; … … 47 47 ostringstream dev_name; 48 48 dev_name << "simu_cam_" << dev_id; 49 shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), buf_size );49 shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), buf_size, SharedMem::Type::producerConsumer); 50 50 } 51 51 … … 53 53 uint16_t height, uint8_t channels, uint32_t dev_id) 54 54 : Thread(parent, name, 0), Camera(parent,name) { 55 data_rate = NULL;55 // data_rate = NULL; 56 56 57 57 ostringstream dev_name; 58 58 dev_name << "simu_cam_" << dev_id; 59 59 shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), 60 width * height * channels );60 width * height * channels, SharedMem::Type::producerConsumer); 61 61 } 62 62 … … 67 67 68 68 void SimuCamera::Run(void) { 69 if (data_rate == NULL) {70 Thread::Err("not applicable for simulation part.\n");71 return;72 }69 // if (data_rate == NULL) { 70 // Thread::Err("not applicable for simulation part.\n"); 71 // return; 72 // } 73 73 74 SetPeriodUS((uint32_t)(1000000. / data_rate->Value())); 74 // SetPeriodUS((uint32_t)(1000000. / data_rate->Value())); 75 shmem->ReaderReady(); 75 76 76 77 while (!ToBeStopped()) { 77 WaitPeriod();78 // WaitPeriod(); 78 79 79 if (data_rate->ValueChanged() == true) {80 SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));81 }80 // if (data_rate->ValueChanged() == true) { 81 // SetPeriodUS((uint32_t)(1000000. / data_rate->Value())); 82 // } 82 83 83 84 output->GetMutex();
Note:
See TracChangeset
for help on using the changeset viewer.