Torc
0.1
|
A network output that mimics the behaviour of a mechanical push button. More...
#include <torcnetworkbuttonoutput.h>
Public Slots | |
void | SetValue (double Value) override |
Toggle the value of the button. More... | |
Public Slots inherited from TorcSwitchOutput | |
virtual void | SetValue (double Value) override |
Public Slots inherited from TorcOutput | |
void | SubscriberDeleted (QObject *Subscriber) |
Public Slots inherited from TorcDevice | |
virtual void | SetValue (double Value) |
virtual void | SetValid (bool Valid) |
bool | GetValid (void) |
double | GetValue (void) |
double | GetDefaultValue (void) |
QString | GetModelId (void) |
QString | GetUniqueId (void) |
QString | GetUserName (void) |
QString | GetUserDescription (void) |
Signals | |
void | Pushed (void) |
Signals inherited from TorcDevice | |
void | ValidChanged (bool Valid) |
void | ValueChanged (double Value) |
Public Member Functions | |
TorcNetworkButtonOutput (double Default, const QVariantMap &Details) | |
~TorcNetworkButtonOutput ()=default | |
QStringList | GetDescription (void) override |
TorcOutput::Type | GetType (void) override |
Public Member Functions inherited from TorcNetworkSwitchOutput | |
TorcNetworkSwitchOutput (double Default, const QVariantMap &Details) | |
virtual | ~TorcNetworkSwitchOutput ()=default |
Public Member Functions inherited from TorcSwitchOutput | |
TorcSwitchOutput (double Value, const QString &ModelId, const QVariantMap &Details) | |
virtual | ~TorcSwitchOutput ()=default |
QStringList | GetDescription (void) override |
TorcOutput::Type | GetType (void) override |
Public Member Functions inherited from TorcOutput | |
TorcOutput (TorcOutput::Type Type, double Value, const QString &ModelId, const QVariantMap &Details) | |
TorcOutput (TorcOutput::Type Type, double Value, const QString &ModelId, const QVariantMap &Details, QObject *Output, const QMetaObject &MetaObject, const QString &Blacklist=QStringLiteral("")) | |
virtual | ~TorcOutput ()=default |
bool | HasOwner (void) |
bool | SetOwner (QObject *Owner) |
QString | GetUIName (void) override |
Public Member Functions inherited from TorcReferenceCounter | |
TorcReferenceCounter (void) | |
virtual | ~TorcReferenceCounter (void)=default |
void | UpRef (void) |
virtual bool | DownRef (void) |
bool | IsShared (void) |
Public Member Functions inherited from TorcHTTPService | |
TorcHTTPService (QObject *Parent, const QString &Signature, const QString &Name, const QMetaObject &MetaObject, const QString &Blacklist=QStringLiteral("")) | |
virtual | ~TorcHTTPService () |
void | ProcessHTTPRequest (const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request) override |
QVariantMap | ProcessRequest (const QString &Method, const QVariant &Parameters, QObject *Connection, bool Authenticated) override |
QString | GetMethod (int Index) |
QVariant | GetProperty (int Index) |
Get the value of a given property. More... | |
QVariantMap | GetServiceDetails (void) |
Return a QVariantMap describing the services methods and properties. More... | |
virtual QString | GetPresentationURL (void) |
Public Member Functions inherited from TorcHTTPHandler | |
TorcHTTPHandler (const QString &Signature, const QString &Name) | |
virtual | ~TorcHTTPHandler () |
QString | Signature (void) const |
bool | GetRecursive (void) const |
QString | Name (void) const |
Additional Inherited Members | |
Public Types inherited from TorcOutput | |
enum | Type { Unknown = 0, Temperature, pH, Switch, PWM, Button, Camera, Integer, MaxType } |
Static Public Member Functions inherited from TorcReferenceCounter | |
static void | EventLoopEnding (bool Ending) |
Protected Member Functions inherited from TorcOutput | |
virtual void | Graph (QByteArray *Data) |
Protected Member Functions inherited from TorcDevice | |
virtual | ~TorcDevice () |
Protected Member Functions inherited from TorcHTTPService | |
void | HandleSubscriberDeleted (QObject *Subscriber) |
Static Protected Member Functions inherited from TorcHTTPHandler | |
static bool | MethodIsAuthorised (TorcHTTPRequest &Request, int Allowed) |
Check the current request is authorised and set the authentication header if not. More... | |
static void | HandleOptions (TorcHTTPRequest &Request, int Allowed) |
static void | HandleFile (TorcHTTPRequest &Request, const QString &Filename, int Cache) |
Protected Attributes inherited from TorcDevice | |
double | value |
double | defaultValue |
QString | modelId |
QString | uniqueId |
QString | userName |
QString | userDescription |
QMutex | lock |
bool | wasInvalid |
Protected Attributes inherited from TorcReferenceCounter | |
QAtomicInt | m_refCount |
Protected Attributes inherited from TorcHTTPService | |
QReadWriteLock | m_httpServiceLock |
Protected Attributes inherited from TorcHTTPHandler | |
QString | m_signature |
bool | m_recursive |
QString | m_name |
Static Protected Attributes inherited from TorcDevice | |
static QHash< QString, TorcDevice * > * | gDeviceList = new QHash<QString,TorcDevice*>() |
static QMutex * | gDeviceListLock = new QMutex(QMutex::Recursive) |
Static Protected Attributes inherited from TorcReferenceCounter | |
static bool | m_eventLoopEnding = false |
Properties inherited from TorcDevice | |
bool | valid |
A network output that mimics the behaviour of a mechanical push button.
A traditional push button will toggle from low to high to low (or high to low to high) as it is pressed and released. This behaviour is mimicked.
Most useful in shadowing a 'real' pushbutton to give a network equivalent for dual control or for triggering other actions - usually in conjunction with the 'toggle' type control.
Definition at line 10 of file torcnetworkbuttonoutput.h.
TorcNetworkButtonOutput::TorcNetworkButtonOutput | ( | double | Default, |
const QVariantMap & | Details | ||
) |
Definition at line 40 of file torcnetworkbuttonoutput.cpp.
|
default |
|
overridevirtual |
Reimplemented from TorcNetworkSwitchOutput.
Definition at line 53 of file torcnetworkbuttonoutput.cpp.
|
overridevirtual |
Implements TorcOutput.
Definition at line 58 of file torcnetworkbuttonoutput.cpp.
|
signal |
|
overrideslot |
Toggle the value of the button.
The input value is ignored, the current value is toggled and the timer started to revert the value to its original state after a small period of time. This mimics the actions of a real, mechanical push button for consistency with those devices.
Definition at line 69 of file torcnetworkbuttonoutput.cpp.