Changeset 10 in pacpustutorials


Ignore:
Timestamp:
Oct 28, 2015, 2:41:15 PM (9 years ago)
Author:
DHERBOMEZ Gérald
Message:

update tutorials

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • solutions/project_exercises/plugin_exercise_1/component_message/MessageComponent.cpp

    r9 r10  
    2525////////////////////////////////////////////////////////////////////////////////
    2626/// Construct the factory
    27 ComponentFactory<MessageComponent> sFactory("MessageComponent");
     27static ComponentFactory<MessageComponent> sFactory("MessageComponent");
     28
    2829
    2930
     
    3536  : ComponentBase(name)
    3637{
    37   count_ = 0;
     38  counter_ = 0;
    3839}
    3940
     
    5758  // out1_ = getTypedOutput<int, MessageComponent>("value");
    5859
    59   count_ = 0;
    6060  connect(&timer_, SIGNAL(timeout()), this, SLOT(display()));
    6161  timer_.start(period_ * 1000); // start a timer, param in msec
     62  LOG_INFO("timer started with the period " << period_ << " sec");
    6263
    6364}
     
    7172{
    7273  timer_.stop();
     74  LOG_INFO("timer stopped");
    7375}
    7476
     
    99101void MessageComponent::display()
    100102{
    101   LOG_INFO(count_ << ": message from component " << name());
    102   count++
     103  LOG_INFO(counter_ << ": message from component " << name());
     104  counter_++;
    103105}
    104106
  • solutions/project_exercises/plugin_exercise_1/component_message/MessageComponent.h

    r9 r10  
    5555    QTimer timer_;
    5656    float period_;
    57     int count_;
     57    int counter_;
    5858
    5959  private slots:
  • template/component_template/ComponentTemplate.cpp

    r9 r10  
    2525////////////////////////////////////////////////////////////////////////////////
    2626/// Construct the factory
    27 ComponentFactory<ComponentTemplate> sFactory("ComponentTemplate");
     27static ComponentFactory<ComponentTemplate> sFactory("ComponentTemplate");
    2828
    2929
Note: See TracChangeset for help on using the changeset viewer.