diff --git a/DiskInfo/DiskInfoLib.Test/main.cpp b/DiskInfo/DiskInfoLib.Test/main.cpp index bb4f23c..52bcaef 100644 --- a/DiskInfo/DiskInfoLib.Test/main.cpp +++ b/DiskInfo/DiskInfoLib.Test/main.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include #include #include @@ -25,7 +25,12 @@ int main() for (auto const& obj : info1.Attributes()) { auto attr = obj.as(); - std::wcout << attr.Id.data() << "\t" << attr.Name.data() << '\t' << attr.RawValue.data() << '\n'; + std::wcout + << attr.Id.data() << "\t" + << attr.Name.data() << '\t' + << attr.RawValue.data() << '\t' + << attr.Current.data() <<'\t' + << attr.Worst.data() << '\n'; } auto tData1 = info1.TemperatureData(); diff --git a/DiskInfo/DiskInfoLib/AtaSmartInfo.cpp b/DiskInfo/DiskInfoLib/AtaSmartInfo.cpp index dc7f58a..2ae682a 100644 --- a/DiskInfo/DiskInfoLib/AtaSmartInfo.cpp +++ b/DiskInfo/DiskInfoLib/AtaSmartInfo.cpp @@ -328,6 +328,8 @@ namespace winrt::DiskInfoLibWinRT::implementation attr.RawValue = rawValue; attr.Threshold = std::format(L"{:0>2X}", threshold.ThresholdValue); + attr.Current = std::to_wstring(static_cast(original.Attribute[j].CurrentValue)).data(); + attr.Worst = std::to_wstring(static_cast(original.Attribute[j].WorstValue)).data(); Attributes().Append(winrt::box_value(attr)); } diff --git a/DiskInfo/DiskInfoLib/AtaSmartInfo.idl b/DiskInfo/DiskInfoLib/AtaSmartInfo.idl index 2350f69..45f20be 100644 --- a/DiskInfo/DiskInfoLib/AtaSmartInfo.idl +++ b/DiskInfo/DiskInfoLib/AtaSmartInfo.idl @@ -13,11 +13,12 @@ namespace DiskInfoLibWinRT //对应SMART_ATTRIBUTE struct SmartAttribute { - String Id; String Name; String RawValue; String Threshold; + String Current; + String Worst; };