【发布时间】:2017-08-03 14:54:30
【问题描述】:
我可以访问 UWP 的电池 API,并且可以显示与系统百分比相同的当前电池百分比。但是,我想知道 windows 如何计算充满电的时间?
我对电子学中的公式和计量单位知之甚少。
我查找了不同的公式,但它们再次使用了我不理解的单位,我真的不明白 Battery 类给了我什么。
我的最大值 -> 64250 MilliWattHours 评分 -> 8516
所以 64250/8516 = ~7.544 大约是 7.5 分钟,在这种情况下,Windows UI 是错误的?
Windows 报告还剩 5 分钟
所以这里有一些代码:
if (report.Status == BatteryStatus.Charging)
{
var report = sender.GetReport(); //<-- where sender is Type<Battery>
//(double)TryGetValue(report.FullChargeCapacityInMilliwattHours)
//(double)TryGetValue(report.ChargeRateInMilliwatts) <-- I don't understand how to use this with the max value of the battery to get the rate at which is is charging per Hr, Min, etc.
var rate = //Formula goes here
var remainingTime = DateTime.Now;
}
【问题讨论】: