copy newer S.M.A.R.T. values to existing drive

This commit is contained in:
2022-08-24 16:11:36 +02:00
parent 2df5ceb0c8
commit 69fd10207d
3 changed files with 30 additions and 25 deletions

View File

@ -14,41 +14,41 @@ string Drive::getPath(void)
string Drive::getModelFamily(void)
{
return sModelFamily;
return sSmartData.sModelFamily;
}
string Drive::getModelName(void)
{
return sModelName;
return sSmartData.sModelName;
}
string Drive::getSerial(void)
{
return sSerial;
return sSmartData.sSerial;
}
uint64_t Drive::getCapacity(void)
{
return u64Capacity;
return sSmartData.u64Capacity;
}
uint32_t Drive::getErrorCount(void)
{
return u32ErrorCount;
return sSmartData.u32ErrorCount;
}
uint32_t Drive::getPowerOnHours(void)
{
return u32PowerOnHours;
return sSmartData.u32PowerOnHours;
}
uint32_t Drive::getPowerCycles(void)
{
return u32PowerCycles;
return sSmartData.u32PowerCycles;
}
uint32_t Drive::getTemperature(void)
{
return u32Temperature;
return sSmartData.u32Temperature;
}
string Drive::sCapacityToText()
@ -124,6 +124,7 @@ double Drive::getTaskPercentage(void)
* \param uint32_t errorCount
* \param uint32_t powerOnHours
* \param uint32_t powerCycle
* \param uint32_t temperature
* \return void
*/
void Drive::setDriveSMARTData( string modelFamily,
@ -135,15 +136,14 @@ void Drive::setDriveSMARTData( string modelFamily,
uint32_t powerCycle,
uint32_t temperature)
{
this->sModelFamily = modelFamily;
sModelName = modelName;
sSerial = serial;
u64Capacity = capacity;
u32ErrorCount = errorCount;
u32PowerOnHours = powerOnHours;
u32PowerCycles = powerCycle;
u32Temperature = temperature;
this->sSmartData.sModelFamily = modelFamily;
this->sSmartData.sModelName = modelName;
this->sSmartData.sSerial = serial;
this->sSmartData.u64Capacity = capacity;
this->sSmartData.u32ErrorCount = errorCount;
this->sSmartData.u32PowerOnHours = powerOnHours;
this->sSmartData.u32PowerCycles = powerCycle;
this->sSmartData.u32Temperature = temperature;
}
void Drive::setTimestamp()