stated to implement threading
This commit is contained in:
@ -46,6 +46,11 @@ private:
|
||||
uint32_t u32ErrorCount = 0U;
|
||||
uint32_t u32PowerOnHours = 0U; //in hours
|
||||
uint32_t u32PowerCycles = 0U;
|
||||
uint32_t u32ShredPercentage = 0U; //in percent
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // DRIVE_H_
|
@ -15,12 +15,17 @@
|
||||
#include <vector>
|
||||
#include <time.h>
|
||||
#include <chrono>
|
||||
#include <curses.h>
|
||||
#include <thread>
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "drive.h"
|
||||
#include "smart.h"
|
||||
#include "wipe.h"
|
||||
//#include "tui.h"
|
||||
//#include "tui_data.h"
|
||||
|
||||
template <typename T, typename I> T* iterator_to_pointer(I i)
|
||||
{
|
||||
@ -40,9 +45,16 @@ private:
|
||||
vector <Drive> vecDrives; //stores all drive data
|
||||
|
||||
void searchDrives(vector <Drive>* pvecDrives);
|
||||
|
||||
void printDrives(vector <Drive>* pvecDrives);
|
||||
void filterIgnoredDrives(vector <Drive>* pvecDrives);
|
||||
void addSMARTData(vector <Drive>* pvecDrives);
|
||||
|
||||
static void ThreadDevices();
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
41
include/tui.h
Normal file
41
include/tui.h
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file tui.h
|
||||
* @brief display user interface
|
||||
* @author hendrik schutter
|
||||
* @date 03.08.2020
|
||||
*/
|
||||
|
||||
#ifndef TUI_H_
|
||||
#define TUI_H_
|
||||
|
||||
#include "reHDD.h"
|
||||
|
||||
#define COLOR_AREA_STDSCR 1
|
||||
#define COLOR_AREA_OVERVIEW 2
|
||||
#define COLOR_AREA_ENTRY 3
|
||||
|
||||
#define COLOR_GRAY 8
|
||||
|
||||
class TUI
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
TUI(void);
|
||||
|
||||
void initTUI();
|
||||
|
||||
void updateTUI(TUI_DATA data);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
void centerTitle(WINDOW *pwin, const char * title);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // TUI_H_
|
45
include/tui_data.h
Normal file
45
include/tui_data.h
Normal file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @file tui_data.h
|
||||
* @brief ui model data
|
||||
* @author hendrik schutter
|
||||
* @date 03.08.2020
|
||||
*/
|
||||
|
||||
#ifndef TUI_DATA_H_
|
||||
#define TUI_DATA_H_
|
||||
|
||||
#include "reHDD.h"
|
||||
|
||||
#define COLOR_AREA_STDSCR 1
|
||||
#define COLOR_AREA_OVERVIEW 2
|
||||
#define COLOR_AREA_ENTRY 3
|
||||
|
||||
#define COLOR_GRAY 8
|
||||
|
||||
|
||||
class TUI_DATA
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
|
||||
TUI_DATA(vector <Drive>* pvecDrives);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
string sCpuUsage;
|
||||
string sRamUsage;
|
||||
string sLocalTime;
|
||||
|
||||
};
|
||||
|
||||
#endif // TUI_DATA_H_
|
Reference in New Issue
Block a user