#ifndef CAMERAS_H #define CAMERAS_H #include #include #include #include #include #include #include #include #include #include "profile.h" #include "camera.h" class Cameras : public QObject { Q_OBJECT static constexpr const char* GROUP = "Cameras"; private: uvosled* led_; bool free_ = false; bool disable_ = false; double exposrueTime_ = 1.0/60.0; uint64_t blockCaptureId_ = 0; LightingSetup lighting_; std::vector> cameras_; std::vector images_; QTimer ledTimer; QTimer cameraFailureTimer; bool lightFor(const LightingSetup& lighting, double time); private slots: void imageRecived(Camera::Image img); void finishAddCamera(std::shared_ptr camera); void lightOff(); signals: void cameraRemoved(std::shared_ptr camera); void cameraAdded(std::shared_ptr camera); void newImages(std::vector images); void enableCapture(bool enable); public slots: bool setExposureTime(double exposureTime); void trigger(); bool start(); bool stop(); bool setFree(bool free); void setLighting(const LightingSetup& lighting) {lighting_ = lighting;} void reloadCameras(); public: Cameras(uvosled* led = nullptr); ~Cameras(); bool setCameras(const std::vector& descriptions); bool addCamera(const cam::Camera::Description& desc); void setSetup(const std::vector& setups); std::vector getCameras(); std::shared_ptr getCamera(size_t id); size_t numCameras(){return cameras_.size();} void clear(); double getMeanTemp(); void load(QSettings& settings); void store(QSettings& settings); void disable(bool disable); }; #endif // CAMERAS_H