Remove factor actor
This commit is contained in:
parent
e52de7de50
commit
ad75b0974b
11 changed files with 15 additions and 441 deletions
|
|
@ -55,8 +55,6 @@ set(SHINTERFACE_CORE_SOURCES
|
||||||
|
|
||||||
src/actors/actor.h
|
src/actors/actor.h
|
||||||
src/actors/actor.cpp
|
src/actors/actor.cpp
|
||||||
src/actors/factoractor.h
|
|
||||||
src/actors/factoractor.cpp
|
|
||||||
src/actors/polynomalactor.h
|
src/actors/polynomalactor.h
|
||||||
src/actors/polynomalactor.cpp
|
src/actors/polynomalactor.cpp
|
||||||
src/actors/sensoractor.h
|
src/actors/sensoractor.h
|
||||||
|
|
@ -151,8 +149,6 @@ add_executable(smartvos
|
||||||
src/ui/sensorsettingsdialog.h
|
src/ui/sensorsettingsdialog.h
|
||||||
src/ui/sensorsettingsdialog.cpp
|
src/ui/sensorsettingsdialog.cpp
|
||||||
|
|
||||||
src/ui/actorwidgets/factoractorwidget.h
|
|
||||||
src/ui/actorwidgets/factoractorwidget.cpp
|
|
||||||
src/ui/actorwidgets/polynomalactorwidget.h
|
src/ui/actorwidgets/polynomalactorwidget.h
|
||||||
src/ui/actorwidgets/polynomalactorwidget.cpp
|
src/ui/actorwidgets/polynomalactorwidget.cpp
|
||||||
src/ui/actorwidgets/sensoractorwidget.h
|
src/ui/actorwidgets/sensoractorwidget.h
|
||||||
|
|
@ -184,7 +180,6 @@ target_sources(smartvos
|
||||||
src/ui/itemsettingsdialog.ui
|
src/ui/itemsettingsdialog.ui
|
||||||
src/ui/actorsettingsdialog.ui
|
src/ui/actorsettingsdialog.ui
|
||||||
src/ui/sensorsettingsdialog.ui
|
src/ui/sensorsettingsdialog.ui
|
||||||
src/ui/actorwidgets/factoractorwidget.ui
|
|
||||||
src/ui/actorwidgets/polynomalactorwidget.ui
|
src/ui/actorwidgets/polynomalactorwidget.ui
|
||||||
src/ui/actorwidgets/sensoractorwidget.ui
|
src/ui/actorwidgets/sensoractorwidget.ui
|
||||||
src/ui/actorwidgets/timeractorwidget.ui
|
src/ui/actorwidgets/timeractorwidget.ui
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
#include "timeractor.h"
|
#include "timeractor.h"
|
||||||
#include "regulator.h"
|
#include "regulator.h"
|
||||||
#include "polynomalactor.h"
|
#include "polynomalactor.h"
|
||||||
#include "factoractor.h"
|
|
||||||
|
|
||||||
Actor::Actor(QObject *parent): Item(QRandomGenerator::global()->generate(), "", 0, parent)
|
Actor::Actor(QObject *parent): Item(QRandomGenerator::global()->generate(), "", 0, parent)
|
||||||
{
|
{
|
||||||
|
|
@ -111,7 +110,6 @@ std::shared_ptr<Actor> Actor::createActor(const QString& type)
|
||||||
else if(type == "Timer") actor = std::shared_ptr<Actor>(new TimerActor());
|
else if(type == "Timer") actor = std::shared_ptr<Actor>(new TimerActor());
|
||||||
else if(type == "Regulator") actor = std::shared_ptr<Actor>(new Regulator());
|
else if(type == "Regulator") actor = std::shared_ptr<Actor>(new Regulator());
|
||||||
else if(type == "Polynomal") actor = std::shared_ptr<Actor>(new PolynomalActor());
|
else if(type == "Polynomal") actor = std::shared_ptr<Actor>(new PolynomalActor());
|
||||||
else if(type == "MultiFactor") actor = std::shared_ptr<Actor>(new MultiFactorActor());
|
|
||||||
else if(type == "Actor") actor = std::shared_ptr<Actor>(new Actor());
|
else if(type == "Actor") actor = std::shared_ptr<Actor>(new Actor());
|
||||||
return actor;
|
return actor;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
#include "factoractor.h"
|
|
||||||
|
|
||||||
MultiFactorActor::MultiFactorActor(Actor* factorActor, const uint preCancleMin, QObject *parent):
|
|
||||||
Actor(parent),
|
|
||||||
factorActor_(factorActor),
|
|
||||||
preCancleMin_(preCancleMin)
|
|
||||||
{
|
|
||||||
activationTime.setMSecsSinceEpoch(0);
|
|
||||||
if(factorActor)
|
|
||||||
connect(factorActor, &Actor::sigItemUpdate, this, &MultiFactorActor::factorActorSlot);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MultiFactorActor::factorActorSlot(ItemUpdateRequest update)
|
|
||||||
{
|
|
||||||
if(update.payload.getValue() == factorDirection)
|
|
||||||
{
|
|
||||||
activationTime = QDateTime::currentDateTime();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MultiFactorActor::enactValue(uint8_t value)
|
|
||||||
{
|
|
||||||
if(value)
|
|
||||||
{
|
|
||||||
QDateTime current = QDateTime::currentDateTime();
|
|
||||||
if(current.addSecs(-preCancleMin_*60) > activationTime )
|
|
||||||
{
|
|
||||||
performAction();
|
|
||||||
}
|
|
||||||
exausted = true;
|
|
||||||
for(size_t i = 0; i < getActors().size(); ++i) if(!getActors()[i]->isExausted())
|
|
||||||
exausted = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MultiFactorActor::getName() const
|
|
||||||
{
|
|
||||||
if(name_.size() > 0) return name_;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QString string;
|
|
||||||
string = "Multi Factor \"" + (factorActor_ ? factorActor_->getName() : "NULL") + "\"";
|
|
||||||
return string;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MultiFactorActor::setFactorActor(std::shared_ptr<Actor> factorActor)
|
|
||||||
{
|
|
||||||
factorActor_=factorActor;
|
|
||||||
connect(factorActor_.get(), &Actor::sigItemUpdate, this, &MultiFactorActor::factorActorSlot);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MultiFactorActor::store(QJsonObject &json)
|
|
||||||
{
|
|
||||||
json["Type"] = "MultiFactor";
|
|
||||||
Actor::store(json);
|
|
||||||
json["PreCancleMinutes"] = static_cast<int>(preCancleMin_);
|
|
||||||
json["FactorDirection"] = factorDirection;
|
|
||||||
QJsonObject factorActorObject;
|
|
||||||
if(factorActor_)
|
|
||||||
{
|
|
||||||
factorActor_->store(factorActorObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MultiFactorActor::load(const QJsonObject &json, bool preserve)
|
|
||||||
{
|
|
||||||
Actor::load(json, preserve);
|
|
||||||
preCancleMin_ = static_cast<uint>(json["PreCancleMinutes"].toInt(10));
|
|
||||||
factorDirection = json["FacotorDirection"].toBool(true);
|
|
||||||
if(json["FactorActor"].isObject())
|
|
||||||
{
|
|
||||||
factorActor_ = Actor::loadActor(json["FactorActor"].toObject());
|
|
||||||
}
|
|
||||||
if(factorActor_)
|
|
||||||
{
|
|
||||||
connect(factorActor_.get(), &Actor::sigItemUpdate, this, &MultiFactorActor::factorActorSlot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
#ifndef REMINDERACTOR_H
|
|
||||||
#define REMINDERACTOR_H
|
|
||||||
|
|
||||||
#include <QDateTime>
|
|
||||||
#include "actor.h"
|
|
||||||
|
|
||||||
class MultiFactorActor: public Actor
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
std::shared_ptr<Actor> factorActor_;
|
|
||||||
QDateTime activationTime;
|
|
||||||
uint preCancleMin_;
|
|
||||||
|
|
||||||
bool factorDirection = true;
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
void factorActorSlot(ItemUpdateRequest update);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
virtual void enactValue(uint8_t value) override;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
MultiFactorActor(Actor* FactorActor = nullptr, const uint preCancleMin = 10, QObject *parent = nullptr);
|
|
||||||
|
|
||||||
virtual QString getName() const override;
|
|
||||||
|
|
||||||
void setFactorActor(std::shared_ptr<Actor> factorActor);
|
|
||||||
std::shared_ptr<Actor> getFactorActor()
|
|
||||||
{
|
|
||||||
return factorActor_;
|
|
||||||
}
|
|
||||||
void setFactorDirection(const bool direction)
|
|
||||||
{
|
|
||||||
factorDirection = direction;
|
|
||||||
}
|
|
||||||
bool getFactorDirection()
|
|
||||||
{
|
|
||||||
return factorDirection;
|
|
||||||
}
|
|
||||||
uint getPreCancleTime()
|
|
||||||
{
|
|
||||||
return preCancleMin_;
|
|
||||||
}
|
|
||||||
void setPreCancleTime(uint minutes)
|
|
||||||
{
|
|
||||||
preCancleMin_ = minutes;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~MultiFactorActor() {}
|
|
||||||
|
|
||||||
virtual void store(QJsonObject& json) override;
|
|
||||||
virtual void load(const QJsonObject& json, bool preserve) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // REMINDERACTOR_H
|
|
||||||
|
|
@ -59,16 +59,6 @@ ActorSettingsDialog::ActorSettingsDialog(std::shared_ptr<PolynomalActor> actor,
|
||||||
ui->vertlayout->addWidget(widget);
|
ui->vertlayout->addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
ActorSettingsDialog::ActorSettingsDialog(std::shared_ptr<MultiFactorActor> actor, QWidget *parent) :
|
|
||||||
QDialog(parent),
|
|
||||||
actor_(actor),
|
|
||||||
ui(new Ui::ActorSettingsDialog)
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
widget = new FactorActorWidget(actor, this);
|
|
||||||
ui->vertlayout->addWidget(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
ActorSettingsDialog::ActorSettingsDialog(std::shared_ptr<Actor> actor, QWidget *parent) :
|
ActorSettingsDialog::ActorSettingsDialog(std::shared_ptr<Actor> actor, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
actor_(actor),
|
actor_(actor),
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
#include "actorwidgets/timeractorwidget.h"
|
#include "actorwidgets/timeractorwidget.h"
|
||||||
#include "actorwidgets/regulatorwdiget.h"
|
#include "actorwidgets/regulatorwdiget.h"
|
||||||
#include "actorwidgets/polynomalactorwidget.h"
|
#include "actorwidgets/polynomalactorwidget.h"
|
||||||
#include "actorwidgets/factoractorwidget.h"
|
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
@ -31,7 +30,6 @@ public:
|
||||||
ActorSettingsDialog(std::shared_ptr<Regulator> actor, QWidget *parent = nullptr);
|
ActorSettingsDialog(std::shared_ptr<Regulator> actor, QWidget *parent = nullptr);
|
||||||
ActorSettingsDialog(std::shared_ptr<TimerActor> actor, QWidget *parent = nullptr);
|
ActorSettingsDialog(std::shared_ptr<TimerActor> actor, QWidget *parent = nullptr);
|
||||||
ActorSettingsDialog(std::shared_ptr<PolynomalActor> actor, QWidget *parent = nullptr);
|
ActorSettingsDialog(std::shared_ptr<PolynomalActor> actor, QWidget *parent = nullptr);
|
||||||
ActorSettingsDialog(std::shared_ptr<MultiFactorActor> actor, QWidget *parent = nullptr);
|
|
||||||
ActorSettingsDialog(std::shared_ptr<Actor> actor, QWidget *parent);
|
ActorSettingsDialog(std::shared_ptr<Actor> actor, QWidget *parent);
|
||||||
~ActorSettingsDialog();
|
~ActorSettingsDialog();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
#include "factoractorwidget.h"
|
|
||||||
#include "ui_factoractorwidget.h"
|
|
||||||
#include "../actorsettingsdialog.h"
|
|
||||||
|
|
||||||
FactorActorWidget::FactorActorWidget(std::shared_ptr<MultiFactorActor> actor, QWidget *parent) :
|
|
||||||
QWidget(parent),
|
|
||||||
actor_(actor),
|
|
||||||
ui(new Ui::FactorActorWidget)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
ui->comboBox->setCurrentText(actor_->getFactorDirection() ? "True" : "False");
|
|
||||||
ui->spinBox->setValue(actor_->getPreCancleTime());
|
|
||||||
if(actor_->getFactorActor()) ui->label_FactorActor->setText(actor_->getFactorActor()->getName());
|
|
||||||
connect(ui->pushButton, &QPushButton::clicked, this, &FactorActorWidget::createFactorActor);
|
|
||||||
connect(ui->comboBox_Direcion, &QComboBox::currentTextChanged, this, &FactorActorWidget::setDirection);
|
|
||||||
connect(ui->spinBox, qOverload<int>(&QSpinBox::valueChanged), this, &FactorActorWidget::setPreCancleTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
FactorActorWidget::~FactorActorWidget()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FactorActorWidget::createFactorActor()
|
|
||||||
{
|
|
||||||
ActorSettingsDialog* dialog = nullptr;
|
|
||||||
std::shared_ptr<Actor> actor = nullptr;
|
|
||||||
|
|
||||||
if(ui->comboBox->currentText() == "Alarm")
|
|
||||||
{
|
|
||||||
std::shared_ptr<AlarmTime> alarm = std::shared_ptr<AlarmTime>(new AlarmTime);
|
|
||||||
actor = alarm;
|
|
||||||
dialog = new ActorSettingsDialog(alarm, this);
|
|
||||||
}
|
|
||||||
else if(ui->comboBox->currentText() == "Sensor")
|
|
||||||
{
|
|
||||||
std::shared_ptr<SensorActor> sensorActor = std::shared_ptr<SensorActor>(new SensorActor());
|
|
||||||
actor = sensorActor;
|
|
||||||
dialog = new ActorSettingsDialog(sensorActor, this);
|
|
||||||
}
|
|
||||||
else if(ui->comboBox->currentText() == "Timer" )
|
|
||||||
{
|
|
||||||
std::shared_ptr<TimerActor> timerActor = std::shared_ptr<TimerActor>(new TimerActor());
|
|
||||||
actor = timerActor;
|
|
||||||
dialog = new ActorSettingsDialog(timerActor, this);
|
|
||||||
}
|
|
||||||
else if(ui->comboBox->currentText() == "Regulator")
|
|
||||||
{
|
|
||||||
std::shared_ptr<Regulator> regulator = std::shared_ptr<Regulator>(new Regulator());
|
|
||||||
actor = regulator;
|
|
||||||
dialog = new ActorSettingsDialog(regulator, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(ui->comboBox->currentText() == "Polynomal")
|
|
||||||
{
|
|
||||||
std::shared_ptr<PolynomalActor> polynomalActor = std::shared_ptr<PolynomalActor>(new PolynomalActor());
|
|
||||||
actor = polynomalActor;
|
|
||||||
dialog = new ActorSettingsDialog(polynomalActor, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(dialog != nullptr)
|
|
||||||
{
|
|
||||||
dialog->setParent(this);
|
|
||||||
dialog->show();
|
|
||||||
if(dialog->exec() == QDialog::Accepted)
|
|
||||||
{
|
|
||||||
actor_->setFactorActor(actor);
|
|
||||||
ui->label_FactorActor->setText(actor->getName());
|
|
||||||
}
|
|
||||||
delete dialog;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FactorActorWidget::setDirection(const QString& type)
|
|
||||||
{
|
|
||||||
if(type == "True") actor_->setFactorDirection(true);
|
|
||||||
else actor_->setFactorDirection(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FactorActorWidget::setPreCancleTime(int time)
|
|
||||||
{
|
|
||||||
actor_->setPreCancleTime(time);
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
#ifndef FACTORACTORWIDGET_H
|
|
||||||
#define FACTORACTORWIDGET_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include "../../actors/factoractor.h"
|
|
||||||
|
|
||||||
namespace Ui
|
|
||||||
{
|
|
||||||
class FactorActorWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
class FactorActorWidget : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
std::shared_ptr<MultiFactorActor> actor_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit FactorActorWidget(std::shared_ptr<MultiFactorActor> actor, QWidget *parent = nullptr);
|
|
||||||
~FactorActorWidget();
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void createFactorActor();
|
|
||||||
void setDirection(const QString& direction);
|
|
||||||
void setPreCancleTime(int time);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::FactorActorWidget *ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // FACTORACTORWIDGET_H
|
|
||||||
|
|
@ -1,136 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>FactorActorWidget</class>
|
|
||||||
<widget class="QWidget" name="FactorActorWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>395</width>
|
|
||||||
<height>169</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QComboBox" name="comboBox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Sensor</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Polynomal</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Alarm</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Timer</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Regulator</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QLabel" name="label_FactorActor">
|
|
||||||
<property name="text">
|
|
||||||
<string>None</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Create Factor</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Factor Direciton:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="QComboBox" name="comboBox_Direcion">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>True</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>False</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Current Factor:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Factor time tollerance</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="spinBox">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>10000</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Min</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
#include "../actors/sensoractor.h"
|
#include "../actors/sensoractor.h"
|
||||||
#include "../actors/timeractor.h"
|
#include "../actors/timeractor.h"
|
||||||
#include "../actors/regulator.h"
|
#include "../actors/regulator.h"
|
||||||
#include "../actors/factoractor.h"
|
|
||||||
#include "../items/messageitem.h"
|
#include "../items/messageitem.h"
|
||||||
#include "../items/systemitem.h"
|
#include "../items/systemitem.h"
|
||||||
#include "itemsettingswidgets/messageitemsettingswidget.h"
|
#include "itemsettingswidgets/messageitemsettingswidget.h"
|
||||||
|
|
@ -152,12 +151,7 @@ void ItemSettingsDialog::addActor()
|
||||||
dialog = new ActorSettingsDialog(polynomalActor, this);
|
dialog = new ActorSettingsDialog(polynomalActor, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(ui->comboBox->currentText() == "Multi Factor")
|
|
||||||
{
|
|
||||||
std::shared_ptr<MultiFactorActor> polynomalActor = std::shared_ptr<MultiFactorActor>(new MultiFactorActor);
|
|
||||||
actor = polynomalActor;
|
|
||||||
dialog = new ActorSettingsDialog(polynomalActor, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(dialog != nullptr)
|
if(dialog != nullptr)
|
||||||
|
|
@ -194,7 +188,6 @@ void ItemSettingsDialog::editActor()
|
||||||
std::shared_ptr<SensorActor> sensorActor = std::dynamic_pointer_cast<SensorActor>(actor);
|
std::shared_ptr<SensorActor> sensorActor = std::dynamic_pointer_cast<SensorActor>(actor);
|
||||||
std::shared_ptr<TimerActor> timerActor = std::dynamic_pointer_cast<TimerActor>(actor);
|
std::shared_ptr<TimerActor> timerActor = std::dynamic_pointer_cast<TimerActor>(actor);
|
||||||
std::shared_ptr<PolynomalActor> polynomalActor = std::dynamic_pointer_cast<PolynomalActor>(actor);
|
std::shared_ptr<PolynomalActor> polynomalActor = std::dynamic_pointer_cast<PolynomalActor>(actor);
|
||||||
std::shared_ptr<MultiFactorActor> factorActor = std::dynamic_pointer_cast<MultiFactorActor>(actor);
|
|
||||||
|
|
||||||
ActorSettingsDialog* dialog;
|
ActorSettingsDialog* dialog;
|
||||||
|
|
||||||
|
|
@ -208,8 +201,6 @@ void ItemSettingsDialog::editActor()
|
||||||
dialog = new ActorSettingsDialog(timerActor, this);
|
dialog = new ActorSettingsDialog(timerActor, this);
|
||||||
else if(polynomalActor)
|
else if(polynomalActor)
|
||||||
dialog = new ActorSettingsDialog(polynomalActor, this);
|
dialog = new ActorSettingsDialog(polynomalActor, this);
|
||||||
else if(factorActor)
|
|
||||||
dialog = new ActorSettingsDialog(factorActor, this);
|
|
||||||
else
|
else
|
||||||
dialog = new ActorSettingsDialog(actor, this);
|
dialog = new ActorSettingsDialog(actor, this);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,14 @@
|
||||||
<string>Item Settings</string>
|
<string>Item Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../../resources.qrc">
|
<iconset>
|
||||||
<normaloff>:/images/UVOSicon.bmp</normaloff>:/images/UVOSicon.bmp</iconset>
|
<normaloff>:/images/UVOSicon.bmp</normaloff>:/images/UVOSicon.bmp</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
<property name="fieldGrowthPolicy">
|
<property name="fieldGrowthPolicy">
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
<enum>QFormLayout::FieldGrowthPolicy::AllNonFixedFieldsGrow</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
<string>Name:</string>
|
<string>Name:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -48,13 +48,13 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="layoutDirection">
|
<property name="layoutDirection">
|
||||||
<enum>Qt::LeftToRight</enum>
|
<enum>Qt::LayoutDirection::LeftToRight</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>TextLabel</string>
|
<string>TextLabel</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -87,19 +87,19 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableWidget" name="tableWidget">
|
<widget class="QTableWidget" name="tableWidget">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::Shape::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalScrollBarPolicy">
|
<property name="verticalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
<enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="horizontalScrollBarPolicy">
|
<property name="horizontalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="autoScroll">
|
<property name="autoScroll">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::NoEditTriggers</set>
|
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="tabKeyNavigation">
|
<property name="tabKeyNavigation">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
|
@ -111,13 +111,13 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="showGrid">
|
<property name="showGrid">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="gridStyle">
|
<property name="gridStyle">
|
||||||
<enum>Qt::SolidLine</enum>
|
<enum>Qt::PenStyle::SolidLine</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="cornerButtonEnabled">
|
<property name="cornerButtonEnabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
|
@ -214,11 +214,6 @@
|
||||||
<string>Timer</string>
|
<string>Timer</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Multi Factor</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
@ -239,18 +234,16 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::StandardButton::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources/>
|
||||||
<include location="../../resources.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue