ICF 3.1.1.10
Technical documentation of ICF Libraries
CCameraMultiplexerComp.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// ICF includes
10#include <iprm/IOptionsList.h>
12#include <imod/TModelWrap.h>
14
15
16namespace icam
17{
18
19
26{
27public:
29
30 I_BEGIN_COMPONENT(CCameraMultiplexerComp);
31 I_REGISTER_INTERFACE(IBitmapAcquisition);
32 I_REGISTER_INTERFACE(iproc::IProcessor);
33 I_REGISTER_SUBELEMENT(CameraList);
34 I_REGISTER_SUBELEMENT_INTERFACE(CameraList, iprm::IOptionsList, ExtractCameraList);
35 I_REGISTER_SUBELEMENT_INTERFACE(CameraList, istd::IChangeable, ExtractCameraList);
36 I_REGISTER_SUBELEMENT_INTERFACE(CameraList, imod::IModel, ExtractCameraList);
37 I_ASSIGN_MULTI_0(m_cameraListCompPtr, "Cameras", "List of cameras used for snap", true);
38 I_ASSIGN_MULTI_0(m_cameraIdsAttrPtr, "CameraIds", "List of camera IDs", true);
39 I_ASSIGN_MULTI_0(m_cameraNamesAttrPtr, "CameraNames", "List of camera names", true);
40 I_ASSIGN(m_sourceSelectionParamIdAttrPtr, "CameraSelectorId", "ID of the source camera selector parameter in the supplier's parameter set", true, "CameraSelectorId");
41 I_ASSIGN(m_cameraManagerParamIdAttrPtr, "CameraManagerParamId", "ID of the camera parameter manager in the supplier's parameter set", true, "CameraManagerParamId");
42 I_ASSIGN(m_parameterSetCompPtr, "ParamsSet", "Parameter set for camera selection", true, "ParamsSet");
43 I_END_COMPONENT;
44
46
47 // reimplemented (iipr::IBitmapAcquisition)
48 istd::CIndex2d GetBitmapSize(const iprm::IParamsSet* paramsPtr) const override;
49
50 // reimplemented (iproc::IProcessor)
51 int GetProcessorState(const iprm::IParamsSet* paramsPtr) const override;
52 virtual bool AreParamsAccepted(
53 const iprm::IParamsSet* paramsPtr,
54 const istd::IPolymorphic* inputPtr,
55 const istd::IChangeable* outputPtr) const override;
56 void InitProcessor(const iprm::IParamsSet* paramsPtr, bool doReset) override;
58 const iprm::IParamsSet* paramsPtr,
59 const istd::IPolymorphic* inputPtr,
60 istd::IChangeable* outputPtr,
61 bool allowAsync = false,
62 iproc::IProgressManager* progressManagerPtr = nullptr) override;
63
64private:
65 class CameraList: virtual public iprm::IOptionsList
66 {
67 public:
68 CameraList();
69
70 void SetParent(CCameraMultiplexerComp* parentPtr);
71
72 // reimplemented (iprm::IOptionsList)
73 int GetOptionsFlags() const override;
74 int GetOptionsCount() const override;
75 QString GetOptionName(int index) const override;
76 QString GetOptionDescription(int index) const override;
77 QByteArray GetOptionId(int index) const override;
78 bool IsOptionEnabled(int index) const override;
79
80 private:
81 CCameraMultiplexerComp* m_parentPtr;
82 };
83
84 template <class InterfaceType>
85 static InterfaceType* ExtractCameraList(CCameraMultiplexerComp& component)
86 {
87 return &component.m_cameraList;
88 }
89
90 int GetSelectedIndex() const;
91 const iprm::IParamsSet* GetWorkingParamsSet(const iprm::IParamsSet* paramsPtr) const;
92 IBitmapAcquisition* GetSelectedCamera() const;
93
94private:
95 I_MULTIREF(IBitmapAcquisition, m_cameraListCompPtr);
96 I_MULTIATTR(QByteArray, m_cameraIdsAttrPtr);
97 I_MULTITEXTATTR(m_cameraNamesAttrPtr);
98 I_ATTR(QByteArray, m_sourceSelectionParamIdAttrPtr);
99 I_ATTR(QByteArray, m_cameraManagerParamIdAttrPtr);
100 I_REF(iprm::IParamsSet, m_parameterSetCompPtr);
101
102 imod::TModelWrap<CameraList> m_cameraList;
103};
104
105
106} // namespace icam
107
This component allows image acquisition based on a camera selection.
int GetProcessorState(const iprm::IParamsSet *paramsPtr) const override
Get state of this processor for processing of specified parameters.
istd::CIndex2d GetBitmapSize(const iprm::IParamsSet *paramsPtr) const override
Get size of acquired bitmap for specified parameters.
virtual bool AreParamsAccepted(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, const istd::IChangeable *outputPtr) const override
Check if specified parameter set is accepted for this processor.
virtual iproc::CTaskState DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, bool allowAsync=false, iproc::IProgressManager *progressManagerPtr=nullptr) override
Do synchronized processing.
void InitProcessor(const iprm::IParamsSet *paramsPtr, bool doReset) override
Init processor and give him all or part of parameters.
Bitmap acquisition processor.
Base class for component implementation.
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
This model wrapper provides a simple connection between a concrete istd::IChangeable implementation a...
Definition TModelWrap.h:28
Constraints of selection from set of possibilities.
Set of general parameters.
Definition IParamsSet.h:29
Represent state of asynchronous operation.
Definition CTaskState.h:28
Interface for all synchrone and asynchrone processors with "push data" model.
Definition IProcessor.h:26
Consume information about progress of some process.
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:25
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Contains interfaces, implementations and components of image acquisition and processing.

© Witold Gantzke and Kirill Lepskiy