read temperature via S.M.A.R.T and display

This commit is contained in:
2022-08-24 16:00:18 +02:00
parent 7dfa805044
commit 2df5ceb0c8
6 changed files with 54 additions and 7 deletions

View File

@ -44,11 +44,13 @@ private:
uint32_t u32ErrorCount = 0U;
uint32_t u32PowerOnHours = 0U; //in hours
uint32_t u32PowerCycles = 0U;
uint32_t u32Temperature = 0U; //in Fahrenheit, just kidding: degree Celsius
time_t u32Timestamp = 0U; //unix timestamp for detecting a frozen drive
double d32TaskPercentage = 0U; //in percent for Shred (1 to 100)
time_t u32TimestampTaskStart = 0U; //unix timestamp for duration of an action
time_t u32TaskDuration = 0U; //time needed to complete the task
private:
void setTimestamp();
@ -68,6 +70,7 @@ public:
uint32_t getErrorCount(void);
uint32_t getPowerOnHours(void); //in hours
uint32_t getPowerCycles(void);
uint32_t getTemperature(void); //in Fahrenheit, just kidding: degree Celsius
void checkFrozenDrive(void);
void setDriveSMARTData( string modelFamily,
@ -76,12 +79,14 @@ public:
uint64_t capacity,
uint32_t errorCount,
uint32_t powerOnHours,
uint32_t powerCycles);
uint32_t powerCycles,
uint32_t temperature);
string sCapacityToText();
string sErrorCountToText();
string sPowerOnHoursToText();
string sPowerCyclesToText();
string sTemperatureToText();
void setTaskPercentage(double d32TaskPercentage);
double getTaskPercentage(void);

View File

@ -27,6 +27,7 @@ private:
static void parseErrorCount(string sLine);
static void parsePowerOnHours(string sLine);
static void parsePowerCycle(string sLine);
static void parseTemperature(string sLine);
static string modelFamily;
static string modelName;
@ -35,6 +36,7 @@ private:
static uint32_t errorCount;
static uint32_t powerOnHours;
static uint32_t powerCycle;
static uint32_t temperature;
};
#endif // SMART_H_

View File

@ -56,7 +56,7 @@ private:
static WINDOW *createOverViewWindow( int iXSize, int iYSize);
static WINDOW *createDetailViewWindow( int iXSize, int iYSize, int iXStart, Drive drive);
static WINDOW *overwriteDetailViewWindow( int iXSize, int iYSize, int iXStart);
static WINDOW *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart, int iListIndex, string sModelFamily, string sSerial, string sCapacity, string sState, string sTime, string sSpeed, bool bSelected);
static WINDOW *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart, int iListIndex, string sModelFamily, string sSerial, string sCapacity, string sState, string sTime, string sSpeed, string sTemp, bool bSelected);
static WINDOW *createSystemStats(int iXSize, int iYSize, int iXStart, int iYStart);
static WINDOW *createMenuView(int iXSize, int iYSize, int iXStart, int iYStart, struct MenuState menustate);
static WINDOW *createDialog(int iXSize, int iYSize, int iXStart, int iYStart, string selectedTask, string optionA, string optionB);