1 | // *********************************************************************
|
---|
2 | //
|
---|
3 | // created: 2015/10/26
|
---|
4 | // filename: AdditionComponent.h
|
---|
5 | //
|
---|
6 | // author: Gerald Dherbomez
|
---|
7 | // Copyright Heudiasyc (c) UMR UTC/CNRS 7253
|
---|
8 | //
|
---|
9 | // license: CECILL-C
|
---|
10 | //
|
---|
11 | // version: $Id: $
|
---|
12 | //
|
---|
13 | // brief: Pacpus template component header file
|
---|
14 | //
|
---|
15 | // *********************************************************************
|
---|
16 |
|
---|
17 |
|
---|
18 | #ifndef __AdditionComponent_h__
|
---|
19 | #define __AdditionComponent_h__
|
---|
20 |
|
---|
21 | #include <Pacpus/kernel/PacpusLibConfig.h>
|
---|
22 | #include <Pacpus/kernel/ComponentBase.h>
|
---|
23 | #include <Pacpus/kernel/InputOutputInterface.h>
|
---|
24 | #include <Pacpus/kernel/DbiteFile.h>
|
---|
25 | #include <QTimer>
|
---|
26 |
|
---|
27 | namespace pacpus
|
---|
28 | {
|
---|
29 |
|
---|
30 | class PACPUSLIB_API AdditionComponent
|
---|
31 | : public QObject
|
---|
32 | , public ComponentBase
|
---|
33 | {
|
---|
34 | Q_OBJECT
|
---|
35 |
|
---|
36 | public:
|
---|
37 | // Specific constructor for pacpus component
|
---|
38 | AdditionComponent(QString name);
|
---|
39 | ~AdditionComponent();
|
---|
40 |
|
---|
41 | // 3 inherited virtual pure methods
|
---|
42 | virtual void startActivity();
|
---|
43 | virtual void stopActivity();
|
---|
44 | virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
|
---|
45 |
|
---|
46 | virtual void addInputs();
|
---|
47 | virtual void addOutputs();
|
---|
48 |
|
---|
49 | private slots:
|
---|
50 | void produceOutput();
|
---|
51 |
|
---|
52 | private:
|
---|
53 | // Add here your private variables
|
---|
54 | double valueToAdd_;
|
---|
55 | double valueToSend_;
|
---|
56 | bool initiator_;
|
---|
57 | QTimer timer_;
|
---|
58 | void processInput(const double& value);
|
---|
59 |
|
---|
60 | // Declaration of an output
|
---|
61 | OutputInterface<double, AdditionComponent>* out1_;
|
---|
62 |
|
---|
63 |
|
---|
64 | }; // end class AdditionComponent
|
---|
65 |
|
---|
66 | } // end namespace pacpus
|
---|
67 |
|
---|
68 | #endif
|
---|