You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.0 KiB

4 years ago
#ifndef REGISTER_H
#define REGISTER_H
#include "model/hardware/core/register/Field.h"
#include "model/hardware/device/SonoDevice.h"
class Register
{
private:
virtual void prepareData(quint32)
{
}
virtual void receiveData(void)
{
}
4 years ago
quint32 cumulativeValue;
4 years ago
protected:
quint32 _bar;
quint32 _offset;
quint32 _baseOffset;
4 years ago
quint32 _arrayLength;
4 years ago
quint32 _value;
4 years ago
bool _isUpdated;
4 years ago
QList<Field*> _fields;
4 years ago
SonoDevice* _device;
4 years ago
public:
//Constructor for general Registers: single and array
Register(quint8 bar, quint32 offset, SonoDevice* device, quint32 arrayLength = 0);
virtual ~Register();
4 years ago
quint32 getValue();
void setValue(quint32 value);
4 years ago
void changeOffset(quint32 offset);
quint32 getCurrentOffset(void) const;
4 years ago
bool isUpdated();
4 years ago
void clearCumulative(void);
void update();
void updateLong();
4 years ago
void updateArray(bool isVariable = false, quint16 arrayLength = 0);
void updateArrayLong(quint8 interval, quint32 arrayLength, bool _isCumulative=false);
4 years ago
void sync();
void syncArray();
4 years ago
};
#endif //REGISTER_H