The QKnx3BitControlled class is a datapoint type with a control part. 更多...
头: | #include <QKnx3BitControlled> |
qmake: | QT += knx |
继承: | QKnxFixedSizeDatapointType |
继承者: |
enum | NumberOfIntervals { Break, One, Two, Four, Eight, …, ThirtyTwo } |
QKnx3BitControlled (bool control , QKnx3BitControlled::NumberOfIntervals n ) | |
QKnx3BitControlled () | |
bool | controlBit () const |
QKnx3BitControlled::NumberOfIntervals | numberOfIntervals () const |
void | setControlBit (bool value ) |
bool | setNumberOfIntervals (QKnx3BitControlled::NumberOfIntervals n ) |
virtual bool | isValid () const override |
QKnx3BitControlled (int subType , bool control , QKnx3BitControlled::NumberOfIntervals n ) |
This is a fixed size datapoint type with the length of 1 byte, though only 4 bits are used by the actual implementation.
Of the 4 bits, 3 bits are reserved for the step code and 1 bit for the control part. The step code allows for the calculation of the number of intervals, so that
numberOfIntervals
() 等于
2^(step code -1)
.
To set this datapoint type, the control and the NumberOfIntervals have to be set.
另请参阅 QKnxDatapointType and Qt KNX Datapoint Type Classes .
This enum type holds the allowed number of intervals for the datapoint type.
常量 | 值 |
---|---|
QKnx3BitControlled::Break
|
0x00
|
QKnx3BitControlled::One
|
0x01
|
QKnx3BitControlled::Two
|
0x02
|
QKnx3BitControlled::Four
|
0x04
|
QKnx3BitControlled::Eight
|
0x08
|
QKnx3BitControlled::Sixteen
|
0x10
|
QKnx3BitControlled::ThirtyTwo
|
0x20
|
[protected]
QKnx3BitControlled::
QKnx3BitControlled
(
int
subType
,
bool
control
,
QKnx3BitControlled::NumberOfIntervals
n
)
Creates a fixed size datapoint type with subtype subType , control control , and number of intervals n .
Creates a fixed size datapoint type with the control control and the number of intervals n .
Creates a fixed size datapoint type with the control part set to
false
and the number of intervals set to
Break
.
Returns the control stored in the datapoint type.
另请参阅 setControlBit ().
[override virtual]
bool
QKnx3BitControlled::
isValid
() const
重实现: QKnxDatapointType::isValid () const.
Returns the number of intervals stored in the datapoint type.
另请参阅 setNumberOfIntervals ().
Sets the control part of the datapoint type to value .
If the value is outside the allowed range, returns
false
and does not set the value.
另请参阅 controlBit ().
Sets the number of intervals to n .
If the value is outside the allowed range, returns
false
and does not set the value.
另请参阅 numberOfIntervals ().