mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Gold linker, CCache, Stats, LGTM
- Increases linker performance under Linux builds by using Gold linker, if available - ccache is used if available - removed statistic class (Stats.cpp) from project due to the missing result (sorry @Brindosch) - add LGTM bandges for code analysis overview Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
@@ -46,7 +46,7 @@ public slots:
|
||||
void setImage(const Image<ColorRgb> & image);
|
||||
|
||||
/// process and push new log messages from logger (if enabled)
|
||||
void incommingLogMessage(Logger::T_LOG_MESSAGE);
|
||||
void incommingLogMessage(const Logger::T_LOG_MESSAGE&);
|
||||
|
||||
signals:
|
||||
///
|
||||
|
@@ -45,7 +45,7 @@ public:
|
||||
/// @param[out] resultMsg The feedback message
|
||||
/// @return True on success else false
|
||||
///
|
||||
const bool saveEffect(const QJsonObject& obj, QString& resultMsg);
|
||||
bool saveEffect(const QJsonObject& obj, QString& resultMsg);
|
||||
|
||||
///
|
||||
/// @brief Delete an effect by name.
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
/// @param[out] resultMsg The message on error
|
||||
/// @return True on success else false
|
||||
///
|
||||
const bool deleteEffect(const QString& effectName, QString& resultMsg);
|
||||
bool deleteEffect(const QString& effectName, QString& resultMsg);
|
||||
|
||||
///
|
||||
/// @brief Get all init data of the running effects and stop them
|
||||
|
@@ -33,7 +33,7 @@ public:
|
||||
/// @param[out] resultMsg The feedback message
|
||||
/// @return True on success else false
|
||||
///
|
||||
const bool saveEffect(const QJsonObject& obj, QString& resultMsg);
|
||||
bool saveEffect(const QJsonObject& obj, QString& resultMsg);
|
||||
|
||||
///
|
||||
/// @brief Delete an effect by name.
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
/// @param[out] resultMsg The message on error
|
||||
/// @return True on success else false
|
||||
///
|
||||
const bool deleteEffect(const QString& effectName, QString& resultMsg);
|
||||
bool deleteEffect(const QString& effectName, QString& resultMsg);
|
||||
|
||||
public slots:
|
||||
///
|
||||
|
@@ -70,7 +70,7 @@ private:
|
||||
/// @brief Setup a new capture display, will free the previous one
|
||||
/// @return True on success, false if no display is found
|
||||
///
|
||||
const bool setupDisplay();
|
||||
bool setupDisplay();
|
||||
|
||||
///
|
||||
/// @brief Is called whenever we need new screen dimension calculations based on window geometry
|
||||
|
@@ -84,12 +84,12 @@ public:
|
||||
///
|
||||
/// @brief get current resulting height of image (after crop)
|
||||
///
|
||||
virtual const int getImageWidth() { return _width; };
|
||||
virtual int getImageWidth() { return _width; };
|
||||
|
||||
///
|
||||
/// @brief get current resulting width of image (after crop)
|
||||
///
|
||||
virtual const int getImageHeight() { return _height; };
|
||||
virtual int getImageHeight() { return _height; };
|
||||
|
||||
///
|
||||
/// @brief Prevent the real capture implementation from capturing if disabled
|
||||
|
@@ -168,7 +168,7 @@ public:
|
||||
/// @param[out] resultMsg The feedback message
|
||||
/// @return True on success else false
|
||||
///
|
||||
const bool saveEffect(const QJsonObject& obj, QString& resultMsg);
|
||||
bool saveEffect(const QJsonObject& obj, QString& resultMsg);
|
||||
|
||||
///
|
||||
/// @brief Delete an effect by name.
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
/// @param[out] resultMsg The message on error
|
||||
/// @return True on success else false
|
||||
///
|
||||
const bool deleteEffect(const QString& effectName, QString& resultMsg);
|
||||
bool deleteEffect(const QString& effectName, QString& resultMsg);
|
||||
|
||||
/// Get the list of available effects
|
||||
/// @return The list of available effects
|
||||
@@ -282,7 +282,7 @@ public slots:
|
||||
/// @param clearEffect Should be true when NOT called from an effect
|
||||
/// @return True on success, false when priority is not found
|
||||
///
|
||||
const bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int timeout_ms = -1, const bool& clearEffect = true);
|
||||
bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int timeout_ms = -1, const bool& clearEffect = true);
|
||||
|
||||
///
|
||||
/// @brief Update the current image of a priority (prev registered with registerInput())
|
||||
@@ -293,14 +293,14 @@ public slots:
|
||||
/// @param clearEffect Should be true when NOT called from an effect
|
||||
/// @return True on success, false when priority is not found
|
||||
///
|
||||
const bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1, const bool& clearEffect = true);
|
||||
bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1, const bool& clearEffect = true);
|
||||
|
||||
///
|
||||
/// @brief Set the given priority to inactive
|
||||
/// @param priority The priority
|
||||
/// @return True on success false if not found
|
||||
///
|
||||
const bool setInputInactive(const quint8& priority);
|
||||
bool setInputInactive(const quint8& priority);
|
||||
|
||||
///
|
||||
/// Writes a single color to all the leds for the given time and priority
|
||||
@@ -336,7 +336,7 @@ public slots:
|
||||
/// @param[in] priority The priority channel
|
||||
/// @return True on success else false (not found)
|
||||
///
|
||||
const bool clear(int priority);
|
||||
bool clear(int priority);
|
||||
|
||||
///
|
||||
/// @brief Clears all priority channels. This will switch the leds off until a new priority is written.
|
||||
|
@@ -57,8 +57,8 @@ namespace hyperion
|
||||
///
|
||||
unsigned height() const;
|
||||
|
||||
const unsigned horizontalBorder() const { return _horizontalBorder; };
|
||||
const unsigned verticalBorder() const { return _verticalBorder; };
|
||||
unsigned horizontalBorder() { return _horizontalBorder; };
|
||||
unsigned verticalBorder() { return _verticalBorder; };
|
||||
|
||||
///
|
||||
/// Determines the mean-color for each led using the mapping the image given
|
||||
@@ -96,9 +96,9 @@ namespace hyperion
|
||||
|
||||
// Iterate each led and compute the mean
|
||||
auto led = ledColors.begin();
|
||||
for (auto ledColors = _colorsMap.begin(); ledColors != _colorsMap.end(); ++ledColors, ++led)
|
||||
for (auto colors = _colorsMap.begin(); colors != _colorsMap.end(); ++colors, ++led)
|
||||
{
|
||||
const ColorRgb color = calcMeanColor(image, *ledColors);
|
||||
const ColorRgb color = calcMeanColor(image, *colors);
|
||||
*led = color;
|
||||
}
|
||||
}
|
||||
|
@@ -151,7 +151,7 @@ public:
|
||||
/// @param timeout_ms The new timeout (defaults to -1 endless)
|
||||
/// @return True on success, false when priority is not found
|
||||
///
|
||||
const bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms = -1);
|
||||
bool setInput(const int priority, const std::vector<ColorRgb>& ledColors, int64_t timeout_ms = -1);
|
||||
|
||||
///
|
||||
/// @brief Update the current image of a priority (prev registered with registerInput())
|
||||
@@ -160,14 +160,14 @@ public:
|
||||
/// @param timeout_ms The new timeout (defaults to -1 endless)
|
||||
/// @return True on success, false when priority is not found
|
||||
///
|
||||
const bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1);
|
||||
bool setInputImage(const int priority, const Image<ColorRgb>& image, int64_t timeout_ms = -1);
|
||||
|
||||
///
|
||||
/// @brief Set the given priority to inactive
|
||||
/// @param priority The priority
|
||||
/// @return True on success false if not found
|
||||
///
|
||||
const bool setInputInactive(const quint8& priority);
|
||||
bool setInputInactive(const quint8& priority);
|
||||
|
||||
///
|
||||
/// Clears the specified priority channel and update _currentPriority on success
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
/// @param[in] priority The priority of the channel to clear
|
||||
/// @return True if priority has been cleared else false (not found)
|
||||
///
|
||||
const bool clearInput(const uint8_t priority);
|
||||
bool clearInput(const uint8_t priority);
|
||||
|
||||
///
|
||||
/// Clears all priority channels
|
||||
|
@@ -34,7 +34,7 @@ public:
|
||||
/// @param correct If true will correct json against schema before save
|
||||
/// @return True on success else false
|
||||
///
|
||||
const bool saveSettings(QJsonObject config, const bool& correct = false);
|
||||
bool saveSettings(QJsonObject config, const bool& correct = false);
|
||||
|
||||
///
|
||||
/// @brief get a single setting json from config
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
|
||||
void setEnable(bool enable);
|
||||
bool enabled() { return _enabled; };
|
||||
const int getLatchTime() { return _latchTime_ms; };
|
||||
int getLatchTime() { return _latchTime_ms; };
|
||||
|
||||
inline bool componentState() { return enabled(); };
|
||||
|
||||
|
@@ -28,7 +28,7 @@ public:
|
||||
/// @brief Start SSDP
|
||||
/// @return false if already running or bind failure
|
||||
///
|
||||
const bool start();
|
||||
bool start();
|
||||
|
||||
///
|
||||
/// @brief Stop SSDP
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
_pixels(new Pixel_T[other._width * other._height + 1]),
|
||||
_endOfPixels(_pixels + other._width * other._height)
|
||||
{
|
||||
memcpy(_pixels, other._pixels, other._width * other._height * sizeof(Pixel_T));
|
||||
memcpy(_pixels, other._pixels, (long) other._width * other._height * sizeof(Pixel_T));
|
||||
}
|
||||
|
||||
// Define assignment operator in terms of the copy constructor
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
//
|
||||
ssize_t size() const
|
||||
{
|
||||
return _width * _height * sizeof(Pixel_T);
|
||||
return (ssize_t) _width * _height * sizeof(Pixel_T);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@@ -86,7 +86,7 @@ public:
|
||||
QVector<Logger::T_LOG_MESSAGE>* getLogMessageBuffer() { return &_logMessageBuffer; };
|
||||
|
||||
public slots:
|
||||
void handleNewLogMessage(Logger::T_LOG_MESSAGE);
|
||||
void handleNewLogMessage(const Logger::T_LOG_MESSAGE&);
|
||||
|
||||
signals:
|
||||
void newLogMessage(Logger::T_LOG_MESSAGE);
|
||||
|
@@ -11,7 +11,7 @@ namespace NetUtils {
|
||||
/// @param log The logger of the caller to print
|
||||
/// @return True on success else false
|
||||
///
|
||||
static const bool portAvailable(quint16& port, Logger* log)
|
||||
static bool portAvailable(quint16& port, Logger* log)
|
||||
{
|
||||
const quint16 prevPort = port;
|
||||
QTcpServer server;
|
||||
|
@@ -1,45 +0,0 @@
|
||||
// qt includes
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
#include <QUrl>
|
||||
#include <QUrlQuery>
|
||||
#include <QTimer>
|
||||
|
||||
// hyperion includes
|
||||
#include <utils/Logger.h>
|
||||
#include <hyperion/Hyperion.h>
|
||||
|
||||
class Stats : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Stats();
|
||||
static Stats* getInstance() { return instance; };
|
||||
static Stats* instance;
|
||||
|
||||
void handleDataUpdate(const QJsonObject& config);
|
||||
|
||||
private:
|
||||
friend class HyperionDaemon;
|
||||
Stats(const QJsonObject& config);
|
||||
~Stats();
|
||||
|
||||
private:
|
||||
Logger* _log;
|
||||
Hyperion* _hyperion;
|
||||
QString _hash = "";
|
||||
QByteArray _ba;
|
||||
QNetworkRequest _req;
|
||||
QNetworkAccessManager _mgr;
|
||||
|
||||
bool trigger(bool set = false);
|
||||
|
||||
private slots:
|
||||
void initialExec();
|
||||
void sendHTTP();
|
||||
void sendHTTPp();
|
||||
void resolveReply(QNetworkReply *reply);
|
||||
|
||||
};
|
@@ -29,7 +29,7 @@ public:
|
||||
quint16 getPort() { return _port; };
|
||||
|
||||
/// check if server has been inited
|
||||
const bool isInited() { return _inited; };
|
||||
bool isInited() { return _inited; };
|
||||
|
||||
///
|
||||
/// @brief Set a new description, if empty the description is NotFound for clients
|
||||
|
Reference in New Issue
Block a user