Temp: Display: support better temperature value formatting

Fix #737
This commit is contained in:
李通洲
2024-02-26 10:46:13 +08:00
parent 1c87693867
commit a0c47204bb
10 changed files with 227 additions and 51 deletions
+4 -2
View File
@@ -102,6 +102,8 @@ void ffPrintPhysicalDisk(FFPhysicalDiskOptions* options)
}
else
{
FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate();
ffParseTemperature(dev->temperature, &tempStr);
if (dev->type & FF_PHYSICALDISK_TYPE_READWRITE)
readOnlyType = "Read-write";
ffParseSize(dev->size, &buffer);
@@ -115,7 +117,7 @@ void ffPrintPhysicalDisk(FFPhysicalDiskOptions* options)
{FF_FORMAT_ARG_TYPE_STRING, removableType},
{FF_FORMAT_ARG_TYPE_STRING, readOnlyType},
{FF_FORMAT_ARG_TYPE_STRBUF, &dev->revision},
{FF_FORMAT_ARG_TYPE_DOUBLE, &dev->temperature},
{FF_FORMAT_ARG_TYPE_DOUBLE, &tempStr},
});
}
++index;
@@ -263,7 +265,7 @@ void ffPrintPhysicalDiskHelpFormat(void)
"Device kind (Removable or Fixed)",
"Device kind (Read-only or Read-write)",
"Product revision",
"Device temperature",
"Device temperature (formatted)",
});
}