feat(ui): 实现全卡堆叠趋势与单页资源进程布局
This commit is contained in:
@@ -10,7 +10,18 @@ import Foundation
|
||||
precondition(CPUTemperatureMonitor.decodeSensorNumber(type: 0, bytes: []) == nil)
|
||||
precondition(FanMetrics.validRPM(0) == 0)
|
||||
for value in [Double.nan, .infinity, -1, 30_001] { precondition(FanMetrics.validRPM(value) == nil) }
|
||||
print("PASS: fan decoding, invalid RPM and static indicator data")
|
||||
for (rpm, speed) in [(1.0,90.0), (1999,90), (2000,180), (3999,180), (4000,300), (5999,300), (6000,450)] {
|
||||
precondition(FanRotation.speed(rpm: rpm, reducedMotion: false) == speed)
|
||||
precondition(FanRotation.speed(rpm: rpm, reducedMotion: true) == 0)
|
||||
}
|
||||
var rotation = FanRotation()
|
||||
rotation.update(rpm: 1000, reducedMotion: false, at: 10)
|
||||
precondition(rotation.angle(at: 11) == 90)
|
||||
rotation.update(rpm: 3000, reducedMotion: false, at: 11)
|
||||
precondition(rotation.angle(at: 11) == 90 && rotation.angle(at: 12) == 270)
|
||||
rotation.update(rpm: 0, reducedMotion: false, at: 12)
|
||||
precondition(rotation.angle(at: 100) == 270)
|
||||
print("PASS: fan decoding, invalid RPM, historical speed boundaries and continuous phase")
|
||||
print("Live fan RPM:", CPUTemperatureMonitor().sampleFans() as Any)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user