feature/ipc_mgsqueue_printer (#57)
closes #56 Co-authored-by: localhorst <localhorst@mosad.xyz> Reviewed-on: #57
This commit is contained in:
parent
6f5e0584bf
commit
8938fe5047
|
@ -23,6 +23,11 @@ Use [Etcher](https://www.balena.io/etcher/#download) or `dd` to create an bootab
|
||||||
* `git submodule update`
|
* `git submodule update`
|
||||||
* `make release`
|
* `make release`
|
||||||
|
|
||||||
|
## Enable Label Printer ##
|
||||||
|
|
||||||
|
Just install [reHDDPrinter](https://git.mosad.xyz/localhorst/reHDDPrinter).
|
||||||
|
No further settings needed.
|
||||||
|
|
||||||
## Create Standalone with Debian 11
|
## Create Standalone with Debian 11
|
||||||
|
|
||||||
Instructions how to create a standalone machine that boots directly to reHDD. This is aimed for production use, like several drives a day shredding.
|
Instructions how to create a standalone machine that boots directly to reHDD. This is aimed for production use, like several drives a day shredding.
|
||||||
|
|
|
@ -33,9 +33,9 @@ public:
|
||||||
|
|
||||||
bool bWasShredded = false; //all shred iterations done
|
bool bWasShredded = false; //all shred iterations done
|
||||||
bool bWasChecked = false; //all shred iterations and optional checking done
|
bool bWasChecked = false; //all shred iterations and optional checking done
|
||||||
bool bWasDeleteted = false;
|
bool bWasDeleted = false;
|
||||||
bool bIsOffline = false;
|
bool bIsOffline = false;
|
||||||
uint32_t u32DriveChecksumAferShredding = 0U;
|
uint32_t u32DriveChecksumAfterShredding = 0U;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
string sPath;
|
string sPath;
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
/**
|
||||||
|
* @file printer.h
|
||||||
|
* @brief Send drive data to printer service using ipc msg queue
|
||||||
|
* @author Hendrik Schutter
|
||||||
|
* @date 24.11.2022
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PRINTER_H_
|
||||||
|
#define PRINTER_H_
|
||||||
|
|
||||||
|
#include "reHDD.h"
|
||||||
|
|
||||||
|
#include <sys/ipc.h>
|
||||||
|
#include <sys/msg.h>
|
||||||
|
|
||||||
|
#define STR_BUFFER_SIZE 64U
|
||||||
|
#define IPC_MSG_QUEUE_KEY 0x1B11193C0
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char caDriveIndex[STR_BUFFER_SIZE];
|
||||||
|
char caDriveHours[STR_BUFFER_SIZE];
|
||||||
|
char caDriveCycles[STR_BUFFER_SIZE];
|
||||||
|
char caDriveErrors[STR_BUFFER_SIZE];
|
||||||
|
char caDriveShredTimestamp[STR_BUFFER_SIZE];
|
||||||
|
char caDriveShredDuration[STR_BUFFER_SIZE];
|
||||||
|
char caDriveCapacity[STR_BUFFER_SIZE];
|
||||||
|
char caDriveState[STR_BUFFER_SIZE];
|
||||||
|
char caDriveModelFamily[STR_BUFFER_SIZE];
|
||||||
|
char caDriveModelName[STR_BUFFER_SIZE];
|
||||||
|
char caDriveSerialnumber[STR_BUFFER_SIZE];
|
||||||
|
char caDriveReHddVersion[STR_BUFFER_SIZE];
|
||||||
|
|
||||||
|
} t_driveData;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
long msg_queue_type;
|
||||||
|
t_driveData driveData;
|
||||||
|
} t_msgQueueData;
|
||||||
|
|
||||||
|
|
||||||
|
class Printer
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
public:
|
||||||
|
static Printer* getPrinter();
|
||||||
|
void print(Drive* drive);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static bool instanceFlag;
|
||||||
|
static Printer *single;
|
||||||
|
int msqid;
|
||||||
|
Printer();
|
||||||
|
~Printer();
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
#endif // PRINTER_H_
|
|
@ -8,7 +8,7 @@
|
||||||
#ifndef REHDD_H_
|
#ifndef REHDD_H_
|
||||||
#define REHDD_H_
|
#define REHDD_H_
|
||||||
|
|
||||||
#define REHDD_VERSION "V1.0.0"
|
#define REHDD_VERSION "V1.1.0"
|
||||||
|
|
||||||
// Drive handling Settings
|
// Drive handling Settings
|
||||||
#define WORSE_HOURS 19200 //mark drive if at this limit or beyond
|
#define WORSE_HOURS 19200 //mark drive if at this limit or beyond
|
||||||
|
@ -64,6 +64,7 @@ using namespace std;
|
||||||
#include "shred.h"
|
#include "shred.h"
|
||||||
#include "delete.h"
|
#include "delete.h"
|
||||||
#include "tui.h"
|
#include "tui.h"
|
||||||
|
#include "printer.h"
|
||||||
#include "logger/logger.h"
|
#include "logger/logger.h"
|
||||||
|
|
||||||
extern Logger* logging;
|
extern Logger* logging;
|
||||||
|
@ -90,7 +91,7 @@ private:
|
||||||
static void filterIgnoredDrives(list <Drive>* plistDrives);
|
static void filterIgnoredDrives(list <Drive>* plistDrives);
|
||||||
static void filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNewDrives);
|
static void filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNewDrives);
|
||||||
static void addSMARTData(list <Drive>* plistDrives);
|
static void addSMARTData(list <Drive>* plistDrives);
|
||||||
static void ThreadScannDevices();
|
static void ThreadScanDevices();
|
||||||
static void ThreadUserInput();
|
static void ThreadUserInput();
|
||||||
static void ThreadShred(Drive* const pDrive);
|
static void ThreadShred(Drive* const pDrive);
|
||||||
static void ThreadDelete();
|
static void ThreadDelete();
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define CHUNK_SIZE 1024*1024*32 //amount of bytes that are overwritten at once --> 32MB
|
#define CHUNK_SIZE 1024*1024*32 //amount of bytes that are overwritten at once --> 32MB
|
||||||
#define TFNG_DATA_SIZE CHUNK_SIZE //amount of bytes used by tfng
|
#define TFNG_DATA_SIZE CHUNK_SIZE //amount of bytes used by tfng
|
||||||
|
|
||||||
//#define DEMO_DRIVE_SIZE 1024*1024*256L // 256MB
|
#define DEMO_DRIVE_SIZE 1024*1024*256L // 256MB
|
||||||
//#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB
|
//#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB
|
||||||
//#define DEMO_DRIVE_SIZE 5*1024*1024*1024L // 5GB
|
//#define DEMO_DRIVE_SIZE 5*1024*1024*1024L // 5GB
|
||||||
//#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB
|
//#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB
|
||||||
|
|
|
@ -182,7 +182,7 @@ void Drive::checkFrozenDrive(void)
|
||||||
if((u32localtime - this->u32Timestamp) >= (FROZEN_TIMEOUT*60) && (this->u32Timestamp > 0) && (this->getTaskPercentage() < 100.0))
|
if((u32localtime - this->u32Timestamp) >= (FROZEN_TIMEOUT*60) && (this->u32Timestamp > 0) && (this->getTaskPercentage() < 100.0))
|
||||||
{
|
{
|
||||||
Logger::logThis()->warning("Drive Frozen: " + this->getModelName() + " " + this->getSerial());
|
Logger::logThis()->warning("Drive Frozen: " + this->getModelName() + " " + this->getSerial());
|
||||||
this->bWasDeleteted = false;
|
this->bWasDeleted = false;
|
||||||
this->bWasShredded = false;
|
this->bWasShredded = false;
|
||||||
this->state = Drive::FROZEN;
|
this->state = Drive::FROZEN;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,6 @@ Logger* Logger::single = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief create new logger instance
|
* \brief create new logger instance
|
||||||
* \param path to log file
|
|
||||||
* \param struct with data
|
|
||||||
* \return instance of Logger
|
* \return instance of Logger
|
||||||
*/
|
*/
|
||||||
Logger::Logger()
|
Logger::Logger()
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
/**
|
||||||
|
* @file printer.cpp
|
||||||
|
* @brief Send drive data to printer service using ipc msg queue
|
||||||
|
* @author Hendrik Schutter
|
||||||
|
* @date 24.11.2022
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../include/reHDD.h"
|
||||||
|
|
||||||
|
bool Printer::instanceFlag = false;
|
||||||
|
Printer* Printer::single = NULL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief create new Printer instance
|
||||||
|
* \param path to log file
|
||||||
|
* \param struct with data
|
||||||
|
* \return instance of Printer
|
||||||
|
*/
|
||||||
|
Printer::Printer()
|
||||||
|
{
|
||||||
|
if (-1 == (this->msqid = msgget((key_t)IPC_MSG_QUEUE_KEY, IPC_CREAT | 0666)))
|
||||||
|
{
|
||||||
|
Logger::logThis()->error("Printer: Create mgs queue failed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief deconstructor
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
Printer::~Printer()
|
||||||
|
{
|
||||||
|
instanceFlag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief send data to msg queue
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
void Printer::print(Drive* drive)
|
||||||
|
{
|
||||||
|
t_msgQueueData msgQueueData;
|
||||||
|
msgQueueData.msg_queue_type = 1;
|
||||||
|
|
||||||
|
sprintf(msgQueueData.driveData.caDriveIndex, "%i",42); //TODO: get from tui
|
||||||
|
sprintf(msgQueueData.driveData.caDriveState, "shredded");
|
||||||
|
strcpy(msgQueueData.driveData.caDriveModelFamily, drive->getModelFamily().c_str());
|
||||||
|
strcpy(msgQueueData.driveData.caDriveModelName, drive->getModelName().c_str());
|
||||||
|
sprintf(msgQueueData.driveData.caDriveCapacity, "%li", drive->getCapacity());
|
||||||
|
strcpy(msgQueueData.driveData.caDriveSerialnumber, drive->getSerial().c_str());
|
||||||
|
sprintf(msgQueueData.driveData.caDriveHours, "%i",drive->getPowerOnHours());
|
||||||
|
sprintf(msgQueueData.driveData.caDriveCycles, "%i",drive->getPowerCycles());
|
||||||
|
sprintf(msgQueueData.driveData.caDriveErrors, "%i",drive->getErrorCount());
|
||||||
|
sprintf(msgQueueData.driveData.caDriveShredTimestamp, "%li",drive->getActionStartTimestamp());
|
||||||
|
sprintf(msgQueueData.driveData.caDriveShredDuration, "%li",drive->getTaskDuration());
|
||||||
|
sprintf(msgQueueData.driveData.caDriveReHddVersion, REHDD_VERSION);
|
||||||
|
|
||||||
|
if (-1 == msgsnd(this->msqid, &msgQueueData, sizeof(t_msgQueueData) - sizeof(long), 0))
|
||||||
|
{
|
||||||
|
Logger::logThis()->error("Printer: Send mgs queue failed!");
|
||||||
|
}else{
|
||||||
|
Logger::logThis()->info("Printer: print triggered - Drive: " + drive->getSerial());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief return a instance of the printer
|
||||||
|
* \return printer obj
|
||||||
|
*/
|
||||||
|
Printer* Printer::getPrinter()
|
||||||
|
{
|
||||||
|
if (!instanceFlag)
|
||||||
|
{
|
||||||
|
single = new Printer(); //create new obj
|
||||||
|
instanceFlag = true;
|
||||||
|
return single;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return single; //return existing obj
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,7 @@ static std::mutex mxDrives;
|
||||||
|
|
||||||
list <Drive> listNewDrives; //store found drives that are updated every 5sec
|
list <Drive> listNewDrives; //store found drives that are updated every 5sec
|
||||||
|
|
||||||
static list <Drive> listDrives; //stores all drive data from scann thread
|
static list <Drive> listDrives; //stores all drive data from scan thread
|
||||||
|
|
||||||
TUI *ui;
|
TUI *ui;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ void reHDD::app_logic(void)
|
||||||
pipe(fdNewDrivesInformPipe);
|
pipe(fdNewDrivesInformPipe);
|
||||||
pipe(fdShredInformPipe);
|
pipe(fdShredInformPipe);
|
||||||
|
|
||||||
thread thDevices(ThreadScannDevices); //start thread that scanns for drives
|
thread thDevices(ThreadScanDevices); //start thread that scans for drives
|
||||||
thread thUserInput(ThreadUserInput); //start thread that reads user input
|
thread thUserInput(ThreadUserInput); //start thread that reads user input
|
||||||
thread thCheckFrozenDrives(ThreadCheckFrozenDrives); //start thread that checks timeout for drives
|
thread thCheckFrozenDrives(ThreadCheckFrozenDrives); //start thread that checks timeout for drives
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ Drive* reHDD::getSelectedDrive()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void reHDD::ThreadScannDevices()
|
void reHDD::ThreadScanDevices()
|
||||||
{
|
{
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
|
@ -221,7 +221,7 @@ void reHDD::ThreadDelete()
|
||||||
getSelectedDrive()->setActionStartTimestamp(); //save timestamp at start of deleting
|
getSelectedDrive()->setActionStartTimestamp(); //save timestamp at start of deleting
|
||||||
Delete::deleteDrive(getSelectedDrive()); //blocking, no thread
|
Delete::deleteDrive(getSelectedDrive()); //blocking, no thread
|
||||||
getSelectedDrive()->state = Drive::TaskState::NONE; //delete finished
|
getSelectedDrive()->state = Drive::TaskState::NONE; //delete finished
|
||||||
getSelectedDrive()->bWasDeleteted = true;
|
getSelectedDrive()->bWasDeleted = true;
|
||||||
Logger::logThis()->info("Finished delete for: " + getSelectedDrive()->getModelName() + "-" + getSelectedDrive()->getSerial());
|
Logger::logThis()->info("Finished delete for: " + getSelectedDrive()->getModelName() + "-" + getSelectedDrive()->getSerial());
|
||||||
ui->updateTUI(&listDrives, u8SelectedEntry);
|
ui->updateTUI(&listDrives, u8SelectedEntry);
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ void reHDD::ThreadDelete()
|
||||||
void reHDD::filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNewDrives)
|
void reHDD::filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNewDrives)
|
||||||
{
|
{
|
||||||
list <Drive>::iterator itOld; //Iterator for current (old) drive list
|
list <Drive>::iterator itOld; //Iterator for current (old) drive list
|
||||||
list <Drive>::iterator itNew; //Iterator for new drive list that was created from to scann thread
|
list <Drive>::iterator itNew; //Iterator for new drive list that was created from to scan thread
|
||||||
|
|
||||||
//remove offline old drives from previously run
|
//remove offline old drives from previously run
|
||||||
for (itOld = plistOldDrives->begin(); itOld != plistOldDrives->end();)
|
for (itOld = plistOldDrives->begin(); itOld != plistOldDrives->end();)
|
||||||
|
@ -263,9 +263,9 @@ void reHDD::filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNew
|
||||||
//copy new smart data to existing drive
|
//copy new smart data to existing drive
|
||||||
itOld->setDriveSMARTData(itNew->getModelFamily(), itNew->getModelName(), itNew->getSerial(), itNew->getCapacity(), itNew->getErrorCount(), itNew->getPowerOnHours(), itNew->getPowerCycles(), itNew->getTemperature());
|
itOld->setDriveSMARTData(itNew->getModelFamily(), itNew->getModelName(), itNew->getSerial(), itNew->getCapacity(), itNew->getErrorCount(), itNew->getPowerOnHours(), itNew->getPowerCycles(), itNew->getTemperature());
|
||||||
#ifdef LOG_LEVEL_HIGH
|
#ifdef LOG_LEVEL_HIGH
|
||||||
Logger::logThis()->info("Delete new drive, because allready attached: " + itNew->getModelName());
|
Logger::logThis()->info("Delete new drive, because already attached: " + itNew->getModelName());
|
||||||
#endif
|
#endif
|
||||||
itNew = plistNewDrives->erase(itNew); //This drive is allready attached, remove from new list
|
itNew = plistNewDrives->erase(itNew); //This drive is already attached, remove from new list
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -334,15 +334,15 @@ void reHDD::searchDrives(list <Drive>* plistDrives)
|
||||||
*/
|
*/
|
||||||
void reHDD::filterIgnoredDrives(list <Drive>* plistDrives)
|
void reHDD::filterIgnoredDrives(list <Drive>* plistDrives)
|
||||||
{
|
{
|
||||||
list<tuple<string>> vtlIgnoredDevices; //store drives from ingnore file
|
list<tuple<string>> vtlIgnoredDevices; //store drives from ignore file
|
||||||
ifstream input( "ignoreDrives.conf" ); //read ingnore file
|
ifstream input( "ignoreDrives.conf" ); //read ignore file
|
||||||
|
|
||||||
for(string sLine; getline( input, sLine );)
|
for(string sLine; getline( input, sLine );)
|
||||||
{
|
{
|
||||||
//Logger::logThis()->info("read uuid: " + sLine);
|
//Logger::logThis()->info("read uuid: " + sLine);
|
||||||
vtlIgnoredDevices.emplace_back(sLine); //add found path and uuid from ignore file to vector
|
vtlIgnoredDevices.emplace_back(sLine); //add found path and uuid from ignore file to vector
|
||||||
}
|
}
|
||||||
//loop through found entries in ingnore file
|
//loop through found entries in ignore file
|
||||||
for(auto row : vtlIgnoredDevices)
|
for(auto row : vtlIgnoredDevices)
|
||||||
{
|
{
|
||||||
list <Drive>::iterator it;
|
list <Drive>::iterator it;
|
||||||
|
|
|
@ -182,15 +182,15 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
|
||||||
#ifdef ZERO_CHECK
|
#ifdef ZERO_CHECK
|
||||||
drive->state=Drive::CHECK_ACTIVE;
|
drive->state=Drive::CHECK_ACTIVE;
|
||||||
Logger::logThis()->info("Check-Task started - Drive: " + drive->getModelName() + "-" + drive->getSerial() + " @" + address.str());
|
Logger::logThis()->info("Check-Task started - Drive: " + drive->getModelName() + "-" + drive->getSerial() + " @" + address.str());
|
||||||
drive->u32DriveChecksumAferShredding = uiCalcChecksum(driveFileDiscr, drive, ipSignalFd);
|
drive->u32DriveChecksumAfterShredding = uiCalcChecksum(driveFileDiscr, drive, ipSignalFd);
|
||||||
#ifdef LOG_LEVEL_HIGH
|
#ifdef LOG_LEVEL_HIGH
|
||||||
if (drive->u32DriveChecksumAferShredding != 0)
|
if (drive->u32DriveChecksumAferShredding != 0)
|
||||||
{
|
{
|
||||||
Logger::logThis()->info("Shred-Task: Checksum not zero: " + to_string(drive->u32DriveChecksumAferShredding) + " - Drive: " + drive->getSerial());
|
Logger::logThis()->info("Shred-Task: Checksum not zero: " + to_string(drive->u32DriveChecksumAfterShredding) + " - Drive: " + drive->getSerial());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Logger::logThis()->info("Shred-Task: Checksum zero: " + to_string(drive->u32DriveChecksumAferShredding) + " - Drive: " + drive->getSerial());
|
Logger::logThis()->info("Shred-Task: Checksum zero: " + to_string(drive->u32DriveChecksumAfterShredding) + " - Drive: " + drive->getSerial());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -202,6 +202,7 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
|
||||||
{
|
{
|
||||||
drive->state= Drive::NONE;
|
drive->state= Drive::NONE;
|
||||||
drive->setTaskPercentage(0.0);
|
drive->setTaskPercentage(0.0);
|
||||||
|
Printer::getPrinter()->print(drive);
|
||||||
Logger::logThis()->info("Finished shred/check for: " + drive->getModelName() + "-" + drive->getSerial());
|
Logger::logThis()->info("Finished shred/check for: " + drive->getModelName() + "-" + drive->getSerial());
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
18
src/tui.cpp
18
src/tui.cpp
|
@ -128,7 +128,7 @@ void TUI::updateTUI(list <Drive>* plistDrives, uint8_t u8SelectedEntry)
|
||||||
case Drive::NONE:
|
case Drive::NONE:
|
||||||
case Drive::SHRED_SELECTED:
|
case Drive::SHRED_SELECTED:
|
||||||
case Drive::DELETE_SELECTED:
|
case Drive::DELETE_SELECTED:
|
||||||
if (it->bWasDeleteted)
|
if (it->bWasDeleted)
|
||||||
{
|
{
|
||||||
sState = "DELETED"; //mark drive as deleted previously
|
sState = "DELETED"; //mark drive as deleted previously
|
||||||
}
|
}
|
||||||
|
@ -148,9 +148,9 @@ void TUI::updateTUI(list <Drive>* plistDrives, uint8_t u8SelectedEntry)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ZERO_CHECK
|
#ifdef ZERO_CHECK
|
||||||
if(bSelectedEntry && it->bWasChecked && (it->u32DriveChecksumAferShredding != 0U))
|
if(bSelectedEntry && it->bWasChecked && (it->u32DriveChecksumAfterShredding != 0U))
|
||||||
{
|
{
|
||||||
dialog=createZeroChecksumWarning(70, 16, ((u16StdscrX)-(int)(u16StdscrX/2)-20),(int)(u16StdscrY/2)-8, it->getPath(), it->getModelFamily(), it->getModelName(), it->getSerial(), it->u32DriveChecksumAferShredding);
|
dialog=createZeroChecksumWarning(70, 16, ((u16StdscrX)-(int)(u16StdscrX/2)-20),(int)(u16StdscrY/2)-8, it->getPath(), it->getModelFamily(), it->getModelName(), it->getSerial(), it->u32DriveChecksumAfterShredding);
|
||||||
wrefresh(dialog);
|
wrefresh(dialog);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -275,7 +275,7 @@ WINDOW* TUI::createDetailViewWindow( int iXSize, int iYSize, int iXStart, Drive
|
||||||
centerTitle(newWindow, title.c_str());
|
centerTitle(newWindow, title.c_str());
|
||||||
|
|
||||||
string sPath = "Path: " +drive.getPath();
|
string sPath = "Path: " +drive.getPath();
|
||||||
string sModelFamlily = "ModelFamily: " + drive.getModelFamily();
|
string sModelFamily = "ModelFamily: " + drive.getModelFamily();
|
||||||
string sModelName = "ModelName: " + drive.getModelName();
|
string sModelName = "ModelName: " + drive.getModelName();
|
||||||
string sCapacity = "Capacity: " + drive.sCapacityToText();
|
string sCapacity = "Capacity: " + drive.sCapacityToText();
|
||||||
string sSerial = "Serial: " + drive.getSerial();
|
string sSerial = "Serial: " + drive.getSerial();
|
||||||
|
@ -286,7 +286,7 @@ WINDOW* TUI::createDetailViewWindow( int iXSize, int iYSize, int iXStart, Drive
|
||||||
uint16_t u16Line = 2;
|
uint16_t u16Line = 2;
|
||||||
|
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sPath.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sPath.c_str());
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sModelFamlily.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sModelFamily.c_str());
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sModelName.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sModelName.c_str());
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sCapacity.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sCapacity.c_str());
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sSerial.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sSerial.c_str());
|
||||||
|
@ -315,7 +315,7 @@ WINDOW* TUI::overwriteDetailViewWindow( int iXSize, int iYSize, int iXStart)
|
||||||
string sLine03 = "Available under GPL 3.0";
|
string sLine03 = "Available under GPL 3.0";
|
||||||
string sLine04 = "https://git.mosad.xyz/localhorst/reHDD";
|
string sLine04 = "https://git.mosad.xyz/localhorst/reHDD";
|
||||||
string sLine05 = "Delete: Wipe format table - this is NOT secure";
|
string sLine05 = "Delete: Wipe format table - this is NOT secure";
|
||||||
string sLine06 = "Shred: Overwite drive " + to_string(SHRED_ITERATIONS) + " iterations - this is secure";
|
string sLine06 = "Shred: Overwrite drive " + to_string(SHRED_ITERATIONS) + " iterations - this is secure";
|
||||||
|
|
||||||
uint16_t u16Line = 5;
|
uint16_t u16Line = 5;
|
||||||
|
|
||||||
|
@ -544,7 +544,7 @@ WINDOW* TUI::createZeroChecksumWarning(int iXSize, int iYSize, int iXStart, int
|
||||||
string sLine01 = "Please detach this drive and check it manually:";
|
string sLine01 = "Please detach this drive and check it manually:";
|
||||||
string sShredChecksum = "After shredding the checksum was: " + to_string(u32Checksum);
|
string sShredChecksum = "After shredding the checksum was: " + to_string(u32Checksum);
|
||||||
string sLinePath = "Path: " +sPath;
|
string sLinePath = "Path: " +sPath;
|
||||||
string sLineModelFamlily = "ModelFamily: " + sModelFamily;
|
string sLineModelFamily = "ModelFamily: " + sModelFamily;
|
||||||
string sLineModelName = "ModelName: " + sModelName;
|
string sLineModelName = "ModelName: " + sModelName;
|
||||||
string sLineSerial = "Serial: " + sSerial;
|
string sLineSerial = "Serial: " + sSerial;
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ WINDOW* TUI::createZeroChecksumWarning(int iXSize, int iYSize, int iXStart, int
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sLine01.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sLine01.c_str());
|
||||||
u16Line++;
|
u16Line++;
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sLinePath.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sLinePath.c_str());
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sLineModelFamlily.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sLineModelFamily.c_str());
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sLineModelName.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sLineModelName.c_str());
|
||||||
mvwaddstr(newWindow,u16Line++, 3, sLineSerial.c_str());
|
mvwaddstr(newWindow,u16Line++, 3, sLineSerial.c_str());
|
||||||
u16Line++;
|
u16Line++;
|
||||||
|
@ -695,7 +695,7 @@ WINDOW* TUI::createSmartWarning(int iXSize, int iYSize, int iXStart, int iYStart
|
||||||
|
|
||||||
if(u32ErrorCount > 0)
|
if(u32ErrorCount > 0)
|
||||||
{
|
{
|
||||||
string sLineTmp = "S.M.A.R.T. erros detected: " + to_string(u32ErrorCount);
|
string sLineTmp = "S.M.A.R.T. errors detected: " + to_string(u32ErrorCount);
|
||||||
mvwaddstr(newWindow,u16Line++, (iXSize/2)-(sLine01.size()/2), sLineTmp.c_str());
|
mvwaddstr(newWindow,u16Line++, (iXSize/2)-(sLine01.size()/2), sLineTmp.c_str());
|
||||||
u16Line++;
|
u16Line++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue