itom
Loading...
Searching...
No Matches
addInGrabber.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität Stuttgart, Germany
6
7 This file is part of itom and its software development toolkit (SDK).
8
9 itom is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public Licence as published by
11 the Free Software Foundation; either version 2 of the Licence, or (at
12 your option) any later version.
13
14 In addition, as a special exception, the Institut für Technische
15 Optik (ITO) gives you certain additional rights.
16 These rights are described in the ITO LGPL Exception version 1.0,
17 which can be found in the file LGPL_EXCEPTION.txt in this package.
18
19 itom is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22 General Public Licence for more details.
23
24 You should have received a copy of the GNU Library General Public License
25 along with itom. If not, see <http://www.gnu.org/licenses/>.
26*********************************************************************** */
27
28#ifndef ADDINGRABBER_H
29#define ADDINGRABBER_H
30
31#include "addInInterface.h"
32
33#include "../DataObject/dataobj.h"
34#include "sharedStructuresQt.h"
35#include "sharedStructures.h"
36
37#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC) //only moc this file in itomCommonQtLib but not in other libraries or executables linking against this itomCommonQtLib
38
39namespace ito
40{
41 class AddInGrabberPrivate;
42
43 class ITOMCOMMONQT_EXPORT AddInGrabber : public ito::AddInDataIO
44 {
45 Q_OBJECT
46
47 private:
49
56
58
59 protected:
60 void timerEvent (QTimerEvent *event);
63
72 virtual ito::RetVal checkData(ito::DataObject *externalDataObject = NULL);
73
75
82 virtual ito::RetVal retrieveData(ito::DataObject *externalDataObject = NULL) = 0;
83
84 ito::RetVal sendDataToListeners(int waitMS);
86 inline int grabberStartedCount() { return m_started; }
89 inline void incGrabberStarted()
90 {
91 m_started++;
92 if(m_started == 1)
93 {
94 runStatusChanged(true); //now, the device is started -> check if any listener is connected and if so start the auto grabbing timer (if flag is true, too)
95 }
96 }
99 inline void decGrabberStarted()
100 {
101 m_started--;
102 if(m_started == 0)
103 {
104 runStatusChanged(false); //now, the device is stopped -> stop any possibly started auto grabbing listener
105 }
106 }
107
109 inline void setGrabberStarted(int value)
110 {
111 m_started = value;
112 runStatusChanged( value > 0 );
114
115 ito::DataObject m_data;
117 public:
118 AddInGrabber();
120
121 };
122} //end namespace ito
123
124#endif //#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC)
125
126#endif
base class for all dataIO plugin classes
Definition addInInterface.h:662
Inherit from AddInGrabber if you write a camera/grabber plugin. Please call the constructor of AddInG...
Definition addInGrabber.h:44
int grabberStartedCount()
Definition addInGrabber.h:86
virtual ito::RetVal retrieveData(ito::DataObject *externalDataObject=NULL)=0
implement this method in your camera plugin. In this method the image is grabbed and stored in the m_...
int m_started
counter indicating how many times startDevice has been called
Definition addInGrabber.h:55
Definition addInGrabber.cpp:36
dataObject contains a n-dimensional matrix
Definition dataobj.h:591
Class for managing status values (like errors or warning)
Definition retVal.h:54
Definition apiFunctionsGraph.cpp:40