CuteHMI - Data Acquisition (CuteHMI.DataAcquisition.0)
EventWriter.hpp
1 #ifndef H_EXTENSIONS_CUTEHMI_DATAACQUISITION_0_INCLUDE_CUTEHMI_DATAACQUISITION_EVENTWRITER_HPP
2 #define H_EXTENSIONS_CUTEHMI_DATAACQUISITION_0_INCLUDE_CUTEHMI_DATAACQUISITION_EVENTWRITER_HPP
3 
4 #include "internal/common.hpp"
5 #include "internal/EventCollective.hpp"
6 #include "AbstractWriter.hpp"
7 
8 #include <cutehmi/services/Serviceable.hpp>
9 
10 namespace cutehmi {
11 namespace dataacquisition {
12 
13 class CUTEHMI_DATAACQUISITION_API EventWriter:
14  public AbstractWriter
15 {
16  Q_OBJECT
17 
18  public:
19  EventWriter(QObject * parent = nullptr);
20 
21  virtual std::unique_ptr<ServiceStatuses> configureStarting(QState * starting) override;
22 
23  virtual std::unique_ptr<ServiceStatuses> configureStarted(QState * active, const QState * idling, const QState * yielding) override;
24 
25  virtual std::unique_ptr<ServiceStatuses> configureStopping(QState * stopping) override;
26 
27  virtual std::unique_ptr<ServiceStatuses> configureBroken(QState * broken) override;
28 
29  virtual std::unique_ptr<ServiceStatuses> configureRepairing(QState * repairing) override;
30 
31  virtual std::unique_ptr<ServiceStatuses> configureEvacuating(QState * evacuating) override;
32 
33  virtual std::unique_ptr<QAbstractTransition> transitionToStarted() const override;
34 
35  virtual std::unique_ptr<QAbstractTransition> transitionToStopped() const override;
36 
37  virtual std::unique_ptr<QAbstractTransition> transitionToBroken() const override;
38 
39  virtual std::unique_ptr<QAbstractTransition> transitionToYielding() const override;
40 
41  virtual std::unique_ptr<QAbstractTransition> transitionToIdling() const override;
42 
43  private slots:
44  void onSchemaChanged();
45 
46  void insertEvent(TagValue * tag);
47 
48  void connectTagSignals();
49 
50  void disconnectTagSignals();
51 
52  private:
53  std::unique_ptr<services::Serviceable::ServiceStatuses> configureStartingOrRepairing(QState * parent);
54 
55  struct Members
56  {
57  internal::EventCollective dbCollective;
58  };
59 
60  MPtr<Members> m;
61 };
62 
63 }
64 }
65 
66 #endif
67 
68 //(c)C: Copyright © 2020, Michał Policht <michal@policht.pl>. All rights reserved.
69 //(c)C: This file is a part of CuteHMI.
70 //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
71 //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
72 //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see <https://www.gnu.org/licenses/>.
QState
cutehmi::dataacquisition::EventWriter
Definition: EventWriter.hpp:13
cutehmi::MPtr< Members >
QObject
cutehmi
cutehmi::dataacquisition::internal::EventCollective
Definition: EventCollective.hpp:16
cutehmi::dataacquisition::TagValue
Tag value.
Definition: TagValue.hpp:15
cutehmi::dataacquisition::AbstractWriter
Abstract database writer.
Definition: AbstractWriter.hpp:19
std::unique_ptr