Documents > BPS V2 C++ API
BpsSignals Class Reference

Signals interface. More...

#include <bpssignals.h>

List of all members.

Signals

void error (const QString &aMessage)
 Combined failure signal from setOutputsError() and readInputsError().
void ok ()
 Combined success signal from setOutputsOk() and readInputsOk().
void readInputsError (const QString &aMessage)
 Signal emitted after reading the inputs with readInputs() has failed.
void readInputsOk (const BpsSignalsMap &aInputs)
 Signal emitted after reading the inputs wit readInputs() has completed successfully.
void setOutputsError (const QString &aMessage)
 Signal emitted after setting the outputs with setOutputs() has failed.
void setOutputsOk (const BpsSignalsMap &aOutputs)
 Signal emitted after setting the outputs with setOutputs() has completed successfully.

Public Member Functions

 BpsSignals (QObject *aParent=0)
QMap< QString, QString > config () const
virtual int inputsCount () const =0
virtual int outputsCount () const =0
virtual void readInputs ()=0
 Request to read the inputs.
void setConfig (const QMap< QString, QString > &aConfig)
 Set the signals configuration.
virtual void setOutputs (const BpsSignalsMap &aOutputs)=0
 Request to set outputs on/off.
virtual ~BpsSignals ()
 Virtual default destructor.

Detailed Description

Signals interface.

Signals interfaces operate similar as a thread, where commands are given by request calls, and results are returned as signals. Background operations are however implemented with QTimer, so the requesting thread must have an event queue. Overlapped requests are not supported, subsequent requests should be made only after the previous has been answered by a signal.


Constructor & Destructor Documentation

BpsSignals::BpsSignals ( QObject *  aParent = 0)
Parameters:
[in]aParentThe parent object.

Member Function Documentation

QMap<QString,QString> BpsSignals::config ( ) const
Returns:
The signals configuration with lowercase keys, and trimmed keys and values.
See also:
Bps::lowerKeyStringMap().
void BpsSignals::error ( const QString &  aMessage) [signal]

Combined failure signal from setOutputsError() and readInputsError().

Parameters:
[in]aMessageInformation about the failure reason (for example "Timeout", "Device not open" etc.)
virtual int BpsSignals::inputsCount ( ) const [pure virtual]
Returns:
Number of inputs supported.
virtual int BpsSignals::outputsCount ( ) const [pure virtual]
Returns:
Number of outputs supported.
virtual void BpsSignals::readInputs ( ) [pure virtual]

Request to read the inputs.

The result is reported by the inputs signal.

void BpsSignals::readInputsError ( const QString &  aMessage) [signal]

Signal emitted after reading the inputs with readInputs() has failed.

Parameters:
[in]aMessageThe error message to display.
void BpsSignals::readInputsOk ( const BpsSignalsMap aInputs) [signal]

Signal emitted after reading the inputs wit readInputs() has completed successfully.

Parameters:
[in]aInputsMap of the logical input numbers and states (true = on, false = off).
void BpsSignals::setConfig ( const QMap< QString, QString > &  aConfig)

Set the signals configuration.

This should be done before making requests.

Parameters:
[in]aConfigThe signals configuration, usually the values in Central System Settings/Terminals/TERMINAL/Packlines/LINENO/Scales.
virtual void BpsSignals::setOutputs ( const BpsSignalsMap aOutputs) [pure virtual]

Request to set outputs on/off.

Parameters:
[in]aOutputsMap of the logical output numbers and states to set (true = on, false = off). Outputs not listed in the map are left unchanged.
void BpsSignals::setOutputsError ( const QString &  aMessage) [signal]

Signal emitted after setting the outputs with setOutputs() has failed.

Parameters:
[in]aMessageThe error message to display.
void BpsSignals::setOutputsOk ( const BpsSignalsMap aOutputs) [signal]

Signal emitted after setting the outputs with setOutputs() has completed successfully.

Parameters:
[in]aOutputsMap of the logical output numbers and states hey are set now (true = on, false = off).

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