Torc  0.1
Public Types | Public Member Functions | Static Public Member Functions | List of all members
TorcLogicControl Class Reference

#include <torclogiccontrol.h>

Inheritance diagram for TorcLogicControl:
[legend]

Public Types

enum  Operation {
  UnknownLogicType, Passthrough, Equal, LessThan,
  GreaterThan, LessThanOrEqual, GreaterThanOrEqual, Any,
  All, None, Average, Toggle,
  Invert, Maximum, Minimum, Multiply,
  RunningAverage, RunningMax, RunningMin
}
 
- Public Types inherited from TorcControl
enum  Type { Logic, Timer, Transition }
 

Public Member Functions

 TorcLogicControl (const QString &Type, const QVariantMap &Details)
 
 ~TorcLogicControl ()=default
 
bool Validate (void) override
 
TorcControl::Type GetType (void) const override
 
QStringList GetDescription (void) override
 
bool IsPassthrough (void) override
 Only certain logic controls can be passthrough. More...
 
- Public Member Functions inherited from TorcControl
virtual bool AllowInputs (void) const
 Most controls have an input side. More...
 
bool IsKnownInput (const QString &Input) const
 
bool IsKnownOutput (const QString &Output) const
 
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
 

Static Public Member Functions

static TorcLogicControl::Operation StringToOperation (const QString &Operation)
 
- Static Public Member Functions inherited from TorcControl
static bool ParseTimeString (const QString &Time, int &Days, int &Hours, int &Minutes, int &Seconds, quint64 &DurationInSeconds)
 Parse a Torc time string into days, hours, minutes and, if present, seconds. More...
 
static QString DurationToString (int Days, quint64 Duration)
 
- Static Public Member Functions inherited from TorcReferenceCounter
static void EventLoopEnding (bool Ending)
 

Additional Inherited Members

- Public Slots inherited from TorcControl
void SubscriberDeleted (QObject *Subscriber)
 
void InputValueChanged (double Value)
 
void InputValidChanged (bool Valid)
 
- Public Slots inherited from TorcDevice
bool GetValid (void)
 
double GetValue (void)
 
double GetDefaultValue (void)
 
QString GetModelId (void)
 
QString GetUniqueId (void)
 
QString GetUserName (void)
 
QString GetUserDescription (void)
 
- Signals inherited from TorcDevice
void ValidChanged (bool Valid)
 
void ValueChanged (double Value)
 
- Protected Member Functions inherited from TorcControl
 TorcControl (TorcControl::Type Type, const QVariantMap &Details)
 
virtual ~TorcControl ()=default
 
void Graph (QByteArray *Data)
 Add this control to the state graph. More...
 
bool Finish (void)
 Finish setup of the control. More...
 
void InputValidChangedPriv (QObject *Input, bool Valid)
 
void CheckInputValues (void)
 
void SetValue (double Value) override
 
void SetValid (bool Valid) override
 
bool CheckForCircularReferences (const QString &UniqueId, const QString &Path) const
 
- 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 TorcControl
bool m_parsed
 
bool m_validated
 
QStringList m_inputList
 
QStringList m_outputList
 
QMap< QObject *, QString > m_inputs
 
QMap< QObject *, QString > m_outputs
 
QMap< QObject *, double > m_inputValues
 
QMap< QObject *, double > m_lastInputValues
 
QMap< QObject *, bool > m_inputValids
 
bool m_allInputsValid
 
- 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
 

Detailed Description

Definition at line 8 of file torclogiccontrol.h.

Member Enumeration Documentation

Enumerator
UnknownLogicType 
Passthrough 
Equal 
LessThan 
GreaterThan 
LessThanOrEqual 
GreaterThanOrEqual 
Any 
All 
None 
Average 
Toggle 
Invert 
Maximum 
Minimum 
Multiply 
RunningAverage 
RunningMax 
RunningMin 

Definition at line 12 of file torclogiccontrol.h.

Constructor & Destructor Documentation

TorcLogicControl::TorcLogicControl ( const QString &  Type,
const QVariantMap &  Details 
)

Definition at line 73 of file torclogiccontrol.cpp.

TorcLogicControl::~TorcLogicControl ( )
default

Member Function Documentation

QStringList TorcLogicControl::GetDescription ( void  )
overridevirtual

Reimplemented from TorcDevice.

Definition at line 154 of file torclogiccontrol.cpp.

TorcControl::Type TorcLogicControl::GetType ( void  ) const
overridevirtual

Implements TorcControl.

Definition at line 149 of file torclogiccontrol.cpp.

bool TorcLogicControl::IsPassthrough ( void  )
overridevirtual

Only certain logic controls can be passthrough.

Reimplemented from TorcControl.

Definition at line 230 of file torclogiccontrol.cpp.

TorcLogicControl::Operation TorcLogicControl::StringToOperation ( const QString &  Operation)
static

Definition at line 29 of file torclogiccontrol.cpp.

bool TorcLogicControl::Validate ( void  )
overridevirtual

Reimplemented from TorcControl.

Definition at line 251 of file torclogiccontrol.cpp.


The documentation for this class was generated from the following files: