PageRenderTime 27ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/CommonVisionBlox/commonVisionBlox.h

https://bitbucket.org/itom/plugins
C Header | 114 lines | 62 code | 29 blank | 23 comment | 0 complexity | 31c8a59250208c69d118df9dae128819 MD5 | raw file
  1. /* ********************************************************************
  2. Plugin "CommonVisionBlox" for itom software
  3. URL: http://www.bitbucket.org/itom/plugins
  4. Copyright (C) 2014, Institut fuer Technische Optik, Universitaet Stuttgart
  5. This file is part of a plugin for the measurement software itom.
  6. This itom-plugin is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU Library General Public Licence as published by
  8. the Free Software Foundation; either version 2 of the Licence, or (at
  9. your option) any later version.
  10. itom and its plugins are distributed in the hope that it will be useful, but
  11. WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
  13. General Public Licence for more details.
  14. You should have received a copy of the GNU Library General Public License
  15. along with itom. If not, see <http://www.gnu.org/licenses/>.
  16. *********************************************************************** */
  17. #ifndef CVB_H
  18. #define CVB_H
  19. #include "common/addInGrabber.h"
  20. #include <iCVCImg.h>
  21. #include <iCVCDriver.h>
  22. #include <iCVCUtilities.h>
  23. #include <iCVGenApi.h>
  24. #include <CVCError.h>
  25. #include <qsharedpointer.h>
  26. #include <QTimerEvent>
  27. //----------------------------------------------------------------------------------------------------------------------------------
  28. class CommonVisionBlox : public ito::AddInGrabber
  29. {
  30. Q_OBJECT
  31. protected:
  32. ~CommonVisionBlox();
  33. CommonVisionBlox();
  34. ito::RetVal retrieveData(ito::DataObject *externalDataObject = NULL);
  35. void dockWidgetVisibilityChanged(bool visible);
  36. //ito::RetVal checkData(ito::DataObject *externalDataObject = NULL);
  37. public:
  38. friend class CVBInterface;
  39. const ito::RetVal showConfDialog(void);
  40. int hasConfDialog(void) { return 0; }; //!< indicates that this plugin has got a configuration dialog
  41. private:
  42. enum sections { integration_time = 0x0001,
  43. roi = 0x0002,
  44. gain = 0x0032,
  45. offset = 0x0064,
  46. all = integration_time | roi | gain | offset};
  47. ito::RetVal checkError(const cvbres_t &code, const char *prefix = NULL) const;
  48. IMG m_hCamera;
  49. NODEMAP m_hNodeMap;
  50. ito::RetVal m_acquisitionRetVal;
  51. bool m_isGrabbing;
  52. ito::RetVal synchronize(const sections &what = all);
  53. ito::RetVal getParamInt(const char *name, cvbint64_t &value);
  54. ito::RetVal getParamFloat(const char *name, double &value);
  55. ito::RetVal getParamBool(const char *name, bool &value);
  56. ito::RetVal getParamString(const char *name, QByteArray &value);
  57. ito::RetVal getParamFloatInfo(const char *name, ito::DoubleMeta &meta, const double &scale = 1.0);
  58. ito::RetVal getParamIntInfo(const char *name, ito::IntMeta &meta);
  59. ito::RetVal setParamInt(const char *name, const cvbint64_t &value);
  60. ito::RetVal setParamFloat(const char *name, const double &value);
  61. ito::RetVal setParamBool(const char *name, const bool &value);
  62. ito::RetVal setParamString(const char *name, const char* value);
  63. ito::RetVal getParamEnumerationInfo(const char *name, ito::StringMeta &meta);
  64. bool nodeExists(const char *name) const;
  65. void checkStatus();
  66. ito::RetVal scan_for_cameras();
  67. QMap<QByteArray, QByteArray> m_nameConverter;
  68. signals:
  69. public slots:
  70. ito::RetVal getParam(QSharedPointer<ito::Param> val, ItomSharedSemaphore *waitCond = NULL);
  71. ito::RetVal setParam(QSharedPointer<ito::ParamBase> val, ItomSharedSemaphore *waitCond = NULL);
  72. ito::RetVal init(QVector<ito::ParamBase> *paramsMand, QVector<ito::ParamBase> *paramsOpt, ItomSharedSemaphore *waitCond = NULL);
  73. ito::RetVal close(ItomSharedSemaphore *waitCond);
  74. ito::RetVal startDevice(ItomSharedSemaphore *waitCond);
  75. ito::RetVal stopDevice(ItomSharedSemaphore *waitCond);
  76. ito::RetVal acquire(const int trigger, ItomSharedSemaphore *waitCond = NULL);
  77. ito::RetVal getVal(void *dObj, ItomSharedSemaphore *waitCond);
  78. ito::RetVal copyVal(void *vpdObj, ItomSharedSemaphore *waitCond);
  79. };
  80. //----------------------------------------------------------------------------------------------------------------------------------
  81. #endif // CVB_H