Merge remote-tracking branch 'origin/master' into temperture

This commit is contained in:
LordGrey
2024-03-03 11:58:50 +01:00
67 changed files with 820 additions and 933 deletions

View File

@@ -113,6 +113,13 @@ public:
QString getGrabberName() const { return _grabberName; }
///
/// @brief Determine if the grabber is available.
///
/// @return true, on success (i.e. library is present), else false
///
virtual bool isAvailable() { return _isAvailable; }
public slots:
virtual void handleEvent(Event event) {}
@@ -168,10 +175,15 @@ protected:
// Device states
/// Is the device available?
bool _isAvailable;
/// Is the device enabled?
bool _isEnabled;
/// Is the device in error state and stopped?
bool _isDeviceInError;
};

View File

@@ -32,6 +32,14 @@ class GrabberWrapper : public QObject
{
Q_OBJECT
public:
static constexpr const char* GRABBERTYPE = "Base";
template<typename GrabberType>
static QSharedPointer<GrabberType> create(const QJsonDocument& config) {
return QSharedPointer<GrabberType>::create(config);
}
GrabberWrapper(const QString& grabberName, Grabber * ggrabber,int updateRate_Hz = DEFAULT_RATE_HZ);
~GrabberWrapper() override;
@@ -71,6 +79,11 @@ public:
///
virtual bool isActive() const;
virtual bool isAvailable() { return _isAvailable; }
QString getName() { return _grabberName; }
///
/// @brief Get active grabber name
/// @param hyperionInd The instance index
@@ -195,4 +208,6 @@ protected:
/// The image used for grabbing frames
Image<ColorRgb> _image;
bool _isAvailable;
};