Major wip refactor

Allow running without gui
Remove serialPortMultiplexer broadcast use
Add TcpServer and TcpClient
Introduce the concept of an item source
This commit is contained in:
Carl Philipp Klemm 2026-03-01 14:39:27 +01:00
parent cbeb8d49a7
commit 6d742e60db
38 changed files with 928 additions and 825 deletions

View file

@ -16,16 +16,15 @@ protected:
uint32_t itemId_;
public:
ItemData(uint32_t itemIdIn = QRandomGenerator::global()->generate(), QString name = "Item", uint8_t value = 0);
inline bool operator==(const ItemData& in) const
{
return itemId_==in.itemId_;
return itemId_ == in.itemId_;
}
inline bool operator!=(const ItemData& in) const
{
return itemId_!=in.itemId_;
return itemId_ != in.itemId_;
}
uint32_t id() const;
@ -33,6 +32,8 @@ public:
void setName(QString name);
uint8_t getValue() const;
virtual QString getName() const;
virtual void store(QJsonObject& json);
virtual void load(const QJsonObject& json, const bool preserve = false);
};
@ -44,20 +45,15 @@ private:
bool override_ = false;
public:
static bool secondaryFlag;
signals:
void valueChanged(uint8_t value);
void updated(ItemData data);
private slots:
virtual void actorSetValue(uint8_t value);
public slots:
virtual void setValue(uint8_t value);
void setValue(uint8_t value);
public:
@ -80,5 +76,10 @@ public:
virtual void store(QJsonObject& json);
virtual void load(const QJsonObject& json, const bool preserve = false);
static std::shared_ptr<Item> loadItem(const QJsonObject& json);
protected:
virtual void enactValue(uint8_t value);
};