started to use the UI
This commit is contained in:
@ -37,6 +37,8 @@ public:
|
||||
uint32_t powerOnHours,
|
||||
uint32_t powerCycles);
|
||||
|
||||
string sCapacityToText();
|
||||
|
||||
private:
|
||||
string sPath;
|
||||
string sModelFamily;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <mutex>
|
||||
#include <sys/select.h>
|
||||
#include<algorithm>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
using namespace std;
|
||||
@ -30,8 +31,8 @@ using namespace std;
|
||||
#include "drive.h"
|
||||
#include "smart.h"
|
||||
#include "wipe.h"
|
||||
//#include "tui.h"
|
||||
//#include "tui_data.h"
|
||||
#include "tui.h"
|
||||
|
||||
|
||||
template <typename T, typename I> T* iterator_to_pointer(I i)
|
||||
{
|
||||
@ -53,21 +54,14 @@ private:
|
||||
vector <Drive> vecDrives; //stores all drive data
|
||||
|
||||
static void searchDrives(vector <Drive>* pvecDrives);
|
||||
|
||||
static void printDrives(vector <Drive>* pvecDrives);
|
||||
|
||||
|
||||
static void filterIgnoredDrives(vector <Drive>* pvecDrives);
|
||||
|
||||
|
||||
static void addSMARTData(vector <Drive>* pvecDrives);
|
||||
|
||||
static void ThreadScannDevices();
|
||||
|
||||
|
||||
void filterNewDrives(vector <Drive>* pvecOldDrives, vector <Drive>* pvecNewDrives);
|
||||
|
||||
|
||||
TUI *ui;
|
||||
|
||||
|
||||
|
||||
|
@ -24,18 +24,23 @@ public:
|
||||
|
||||
TUI(void);
|
||||
|
||||
void initTUI();
|
||||
|
||||
void updateTUI(TUI_DATA data);
|
||||
|
||||
static void initTUI();
|
||||
|
||||
void updateTUI(vector <Drive>* pvecDrives);
|
||||
|
||||
private:
|
||||
static string sCpuUsage;
|
||||
static string sRamUsage;
|
||||
static string sLocalTime;
|
||||
|
||||
void centerTitle(WINDOW *pwin, const char * title);
|
||||
|
||||
|
||||
WINDOW *detailview;
|
||||
WINDOW *overview;
|
||||
vector <WINDOW *> vWinDriveEntries;
|
||||
|
||||
static void centerTitle(WINDOW *pwin, const char * title);
|
||||
static WINDOW *createOverViewWindow( int iXSize, int iYSize);
|
||||
static WINDOW *createDetailViewWindow( int iXSize, int iYSize, int iXStart);
|
||||
static WINDOW *createEntryWindow(int iXSize, int iYSize, int iXStart, int iYStart,string sModelFamily, string sModelName, string sCapacity);
|
||||
};
|
||||
|
||||
#endif // TUI_H_
|
@ -1,45 +0,0 @@
|
||||
/**
|
||||
* @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