linuxcpu.h 1.16 KB
Newer Older
1 2 3
#ifndef LINUXCPU_H
#define LINUXCPU_H

David Redondo's avatar
David Redondo committed
4 5 6
struct sensors_chip_name;
struct sensors_feature;

David Redondo's avatar
David Redondo committed
7 8
#include "cpu.h"
#include "usagecomputer.h"
David Redondo's avatar
David Redondo committed
9

10 11 12 13 14 15 16 17 18 19 20

class TemperatureSensor : public SensorProperty {
public:
    TemperatureSensor(const QString &id, SensorObject *parent);
    void setFeature(const sensors_chip_name * const chipName, const sensors_feature * const feature);
    void update();
private:
    const sensors_chip_name * m_sensorChipName;
    int m_temperatureSubfeature;
};

21 22 23
class LinuxCpuObject : public CpuObject
{
public:
David Redondo's avatar
David Redondo committed
24
    LinuxCpuObject(const QString &id, const QString &name, SensorContainer *parent, double frequency = 0);
25

David Redondo's avatar
David Redondo committed
26
    void update(unsigned long long system, unsigned long long user, unsigned long long wait, unsigned long long idle);
27
    TemperatureSensor* temperatureSensor();
28
private:
29
    void makeSensors() override;
David Redondo's avatar
David Redondo committed
30
    UsageComputer m_usageComputer;
31
    TemperatureSensor *m_temperatureSensor;
32 33
};

David Redondo's avatar
David Redondo committed
34
class LinuxAllCpusObject : public AllCpusObject {
35
public:
David Redondo's avatar
David Redondo committed
36 37
    using AllCpusObject::AllCpusObject;
    void update(unsigned long long system, unsigned long long user, unsigned long long wait, unsigned long long idle);
38
private:
David Redondo's avatar
David Redondo committed
39
    UsageComputer m_usageComputer;
40 41 42
};

#endif