Changeset 10 in pacpustutorials
- Timestamp:
- Oct 28, 2015, 2:41:15 PM (9 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
solutions/project_exercises/plugin_exercise_1/component_message/MessageComponent.cpp
r9 r10 25 25 //////////////////////////////////////////////////////////////////////////////// 26 26 /// Construct the factory 27 ComponentFactory<MessageComponent> sFactory("MessageComponent"); 27 static ComponentFactory<MessageComponent> sFactory("MessageComponent"); 28 28 29 29 30 … … 35 36 : ComponentBase(name) 36 37 { 37 count _ = 0;38 counter_ = 0; 38 39 } 39 40 … … 57 58 // out1_ = getTypedOutput<int, MessageComponent>("value"); 58 59 59 count_ = 0;60 60 connect(&timer_, SIGNAL(timeout()), this, SLOT(display())); 61 61 timer_.start(period_ * 1000); // start a timer, param in msec 62 LOG_INFO("timer started with the period " << period_ << " sec"); 62 63 63 64 } … … 71 72 { 72 73 timer_.stop(); 74 LOG_INFO("timer stopped"); 73 75 } 74 76 … … 99 101 void MessageComponent::display() 100 102 { 101 LOG_INFO(count _ << ": message from component " << name());102 count ++103 LOG_INFO(counter_ << ": message from component " << name()); 104 counter_++; 103 105 } 104 106 -
solutions/project_exercises/plugin_exercise_1/component_message/MessageComponent.h
r9 r10 55 55 QTimer timer_; 56 56 float period_; 57 int count _;57 int counter_; 58 58 59 59 private slots: -
template/component_template/ComponentTemplate.cpp
r9 r10 25 25 //////////////////////////////////////////////////////////////////////////////// 26 26 /// Construct the factory 27 ComponentFactory<ComponentTemplate> sFactory("ComponentTemplate");27 static ComponentFactory<ComponentTemplate> sFactory("ComponentTemplate"); 28 28 29 29
Note:
See TracChangeset
for help on using the changeset viewer.