Torc  0.1
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
TorcInput Class Referenceabstract

#include <torcinput.h>

Inheritance diagram for TorcInput:
[legend]

Public Types

enum  Type {
  Unknown = 0, Temperature, pH, Switch,
  PWM, Button, Started, Integer,
  MaxType
}
 

Public Slots

void SubscriberDeleted (QObject *Subscriber)
 
void SetValue (double Value) override
 Update the inputs value. More...
 
void SetValid (bool Valid) final
 
double GetOperatingRangeMin (void)
 
double GetOperatingRangeMax (void)
 
bool GetOutOfRangeLow (void)
 
bool GetOutOfRangeHigh (void)
 
- 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 OutOfRangeLowChanged (bool Value)
 
void OutOfRangeHighChanged (bool Value)
 
- Signals inherited from TorcDevice
void ValidChanged (bool Valid)
 
void ValueChanged (double Value)
 

Public Member Functions

 TorcInput (TorcInput::Type Type, double Value, double RangeMinimum, double RangeMaximum, const QString &ModelId, const QVariantMap &Details)
 
virtual TorcInput::Type GetType (void)=0
 
virtual void Start (void) override
 
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
 

Protected Member Functions

virtual ~TorcInput ()=default
 
- Protected Member Functions inherited from TorcDevice
virtual ~TorcDevice ()
 
- Protected Member Functions inherited from TorcHTTPService
void HandleSubscriberDeleted (QObject *Subscriber)
 

Properties

double operatingRangeMin
 
double operatingRangeMax
 
bool outOfRangeLow
 
bool outOfRangeHigh
 
- Properties inherited from TorcDevice
bool valid
 

Additional Inherited Members

- Static Public Member Functions inherited from TorcReferenceCounter
static void EventLoopEnding (bool Ending)
 
- 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
 

Detailed Description

Definition at line 14 of file torcinput.h.

Member Enumeration Documentation

Enumerator
Unknown 
Temperature 
pH 
Switch 
PWM 
Button 
Started 
Integer 
MaxType 

Definition at line 24 of file torcinput.h.

Constructor & Destructor Documentation

TorcInput::TorcInput ( TorcInput::Type  Type,
double  Value,
double  RangeMinimum,
double  RangeMaximum,
const QString &  ModelId,
const QVariantMap &  Details 
)

Definition at line 40 of file torcinput.cpp.

virtual TorcInput::~TorcInput ( )
protectedvirtualdefault

Member Function Documentation

double TorcInput::GetOperatingRangeMax ( void  )
slot

Definition at line 159 of file torcinput.cpp.

double TorcInput::GetOperatingRangeMin ( void  )
slot

Definition at line 153 of file torcinput.cpp.

bool TorcInput::GetOutOfRangeHigh ( void  )
slot

Definition at line 172 of file torcinput.cpp.

bool TorcInput::GetOutOfRangeLow ( void  )
slot

Definition at line 165 of file torcinput.cpp.

virtual TorcInput::Type TorcInput::GetType ( void  )
pure virtual
QString TorcInput::GetUIName ( void  )
overridevirtual

Reimplemented from TorcHTTPService.

Definition at line 73 of file torcinput.cpp.

void TorcInput::OutOfRangeHighChanged ( bool  Value)
signal
void TorcInput::OutOfRangeLowChanged ( bool  Value)
signal
void TorcInput::SetValid ( bool  Valid)
finalslot

Definition at line 143 of file torcinput.cpp.

void TorcInput::SetValue ( double  Value)
overrideslot

Update the inputs value.

This will update both value and valueScaled and emit change signals iff necessary.

Definition at line 90 of file torcinput.cpp.

void TorcInput::Start ( void  )
overridevirtual
void TorcInput::SubscriberDeleted ( QObject *  Subscriber)
slot

Definition at line 81 of file torcinput.cpp.

Property Documentation

double TorcInput::operatingRangeMax
read

Definition at line 19 of file torcinput.h.

double TorcInput::operatingRangeMin
read

Definition at line 18 of file torcinput.h.

bool TorcInput::outOfRangeHigh
read

Definition at line 21 of file torcinput.h.

bool TorcInput::outOfRangeLow
read

Definition at line 20 of file torcinput.h.


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