ICF 3.1.1.10
Technical documentation of ICF Libraries
CTriggerParamsComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QVector>
11
12// ICF includes
15#include <iprm/IOptionsList.h>
17#include <isig/ITriggerParams.h>
18
19
20namespace isig
21{
22
23
29 virtual public isig::ITriggerParams,
30 virtual public iprm::ISelectionParam,
31 virtual protected iprm::IOptionsList
32{
33public:
35
37
38 I_BEGIN_COMPONENT(CTriggerParamsComp);
39 I_REGISTER_INTERFACE(isig::ITriggerParams);
40 I_REGISTER_INTERFACE(iprm::ISelectionParam);
41 I_REGISTER_INTERFACE(iser::ISerializable);
42 I_ASSIGN(m_triggerConstraintsCompPtr, "Constraints", "Describing allowed parameter state, typically implemented in camera component", false, "Constraints");
43 I_ASSIGN(m_triggerModeAttrPtr, "TriggerMode", "Set trigger mode:\n\t0 - None\n\t1 - Continuous\n\t2 - Rising edge\n\t3 - Falling edge\n\t4 - Positive level\n\t5 - Negative level\n\t6 - Software", true, 0);
44 I_ASSIGN(m_triggersCountAttrPtr, "TriggersCount", "Set number of triggers executed in the continuous mode", true, -1);
45 I_END_COMPONENT;
46
47 // reimplemented (isig::ITriggerParams)
49 int GetTriggerMode() const override;
50 void SetTriggerMode(int triggerMode) override;
51 int GetTriggersCount() const override;
52 void SetTriggersCount(int triggersCount) override;
53
54 // reimplemented (iprm::ISelectionParam)
56 QByteArray GetSelectedOptionId() const override;
57 int GetSelectedOptionIndex() const override;
58 bool SetSelectedOptionIndex(int index) override;
59 iprm::ISelectionParam* GetSubselection(int index) const override;
60
61 // reimplemented (iser::ISerializable)
62 bool Serialize(iser::IArchive& archive) override;
63
64protected:
66
67 // reimplemented (iprm::IOptionsList)
68 int GetOptionsFlags() const override;
69 int GetOptionsCount() const override;
70 QString GetOptionName(int index) const override;
71 QString GetOptionDescription(int index) const override;
72 QByteArray GetOptionId(int index) const override;
73 bool IsOptionEnabled(int index) const override;
74
75 // reimplemented (icomp::CComponentBase)
76 void OnComponentCreated() override;
77
78private:
79 int m_triggerMode;
80
81 int m_triggersCount;
82
83 struct SelectionEntry
84 {
85 QString name;
86 QString description;
87 int triggerMode;
88 };
89 typedef QVector<SelectionEntry> SelectionList;
90 SelectionList m_selectionList;
91
92 I_REF(isig::ITriggerConstraints, m_triggerConstraintsCompPtr);
93 I_ATTR(int, m_triggerModeAttrPtr);
94 I_ATTR(int, m_triggersCountAttrPtr);
95};
96
97
98} // namespace isig
99
100
Base class for component implementation.
Constraints of selection from set of possibilities.
Interface allowing to select single option from list of options.
Represent input/output persistence archive.
Definition IArchive.h:34
Common class for all classes which objects can be archived or restored from archive.
Implementation of standard trigger parameters set.
int GetTriggerMode() const override
Get trigger mode.
QByteArray GetOptionId(int index) const override
Get option ID.
void SetTriggerMode(int triggerMode) override
Set trigger mode.
QByteArray GetSelectedOptionId() const override
Get selected ID.
iprm::ISelectionParam * GetSubselection(int index) const override
Get subselection for specified option.
bool SetSelectedOptionIndex(int index) override
Set index of selected option.
bool IsOptionEnabled(int index) const override
Return true if the option is enabled and can be selected.
int GetOptionsFlags() const override
Get constraints flags.
void SetTriggersCount(int triggersCount) override
Set the number of triggers in the TM_CONTINUOUS mode.
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
int GetOptionsCount() const override
Get number of managed options.
int GetSelectedOptionIndex() const override
Get selected index.
const iprm::IOptionsList * GetSelectionConstraints() const override
Get constraints of this parameter.
QString GetOptionDescription(int index) const override
Get human readable description for a option with the index index.
icomp::CComponentBase BaseClass
int GetTriggersCount() const override
Get the number of triggers in the TM_CONTINUOUS mode.
const ITriggerConstraints * GetTriggerConstraints() const override
Get constraints describing supported parameter states.
QString GetOptionName(int index) const override
Get name of specified option.
void OnComponentCreated() override
Interface for the signal trigger contstraints.
Interface for hardware trigger parameters.
Contains interfaces and implementations of signal processing.

© Witold Gantzke and Kirill Lepskiy