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

#include <torctimercontrol.h>

Inheritance diagram for TorcTimerControl:
[legend]

Public Types

enum  TimerType {
  UnknownTimerType, Custom, Minutely, Hourly,
  Daily, Weekly, SingleShot
}
 
- Public Types inherited from TorcControl
enum  Type { Logic, Timer, Transition }
 

Public Slots

void TimerTimeout (void)
 
bool event (QEvent *Event) override
 
- 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)
 

Public Member Functions

 TorcTimerControl (const QString &Type, const QVariantMap &Details)
 
 ~TorcTimerControl ()
 
TorcControl::Type GetType (void) const override
 
QStringList GetDescription (void) override
 
bool Validate (void) override
 
void Start (void) override
 Initialise the timer. More...
 
bool AllowInputs (void) const override
 Timers cannot have inputs. More...
 
quint64 TimeSinceLastTransition (void)
 
TorcTimerControl::TimerType GetTimerType (void) const
 
- Public Member Functions inherited from TorcControl
virtual bool IsPassthrough (void)
 Only certain logic controls can be passthrough. 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 QString TimerTypeToString (TorcTimerControl::TimerType Type)
 
static TorcTimerControl::TimerType StringToTimerType (const QString &Type)
 
- 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

- 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 11 of file torctimercontrol.h.

Member Enumeration Documentation

Enumerator
UnknownTimerType 
Custom 
Minutely 
Hourly 
Daily 
Weekly 
SingleShot 

Definition at line 16 of file torctimercontrol.h.

Constructor & Destructor Documentation

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

Definition at line 68 of file torctimercontrol.cpp.

TorcTimerControl::~TorcTimerControl ( )

Definition at line 249 of file torctimercontrol.cpp.

Member Function Documentation

bool TorcTimerControl::AllowInputs ( void  ) const
overridevirtual

Timers cannot have inputs.

Reimplemented from TorcControl.

Definition at line 343 of file torctimercontrol.cpp.

bool TorcTimerControl::event ( QEvent *  Event)
overrideslot

Definition at line 348 of file torctimercontrol.cpp.

QStringList TorcTimerControl::GetDescription ( void  )
overridevirtual

Reimplemented from TorcDevice.

Definition at line 259 of file torctimercontrol.cpp.

TorcTimerControl::TimerType TorcTimerControl::GetTimerType ( void  ) const

Definition at line 536 of file torctimercontrol.cpp.

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

Implements TorcControl.

Definition at line 254 of file torctimercontrol.cpp.

void TorcTimerControl::Start ( void  )
override

Initialise the timer.

Note
Timers are configured and presented with second accuracy but we use milliseconds internally.

Definition at line 324 of file torctimercontrol.cpp.

TorcTimerControl::TimerType TorcTimerControl::StringToTimerType ( const QString &  Type)
static

Definition at line 54 of file torctimercontrol.cpp.

void TorcTimerControl::TimerTimeout ( void  )
slot

Definition at line 373 of file torctimercontrol.cpp.

QString TorcTimerControl::TimerTypeToString ( TorcTimerControl::TimerType  Type)
static

Definition at line 38 of file torctimercontrol.cpp.

quint64 TorcTimerControl::TimeSinceLastTransition ( void  )

Definition at line 541 of file torctimercontrol.cpp.

bool TorcTimerControl::Validate ( void  )
overridevirtual

Reimplemented from TorcControl.

Definition at line 270 of file torctimercontrol.cpp.


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