You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
836 B
21 lines
836 B
import { DeviceCapability } from './DeviceCapability';
|
|
import { THERMAL_PROFILE, ThermalTierConfig, ThermalTierId } from './thermal-profile.json';
|
|
|
|
/** Boot 读取:与 MemoryProfile 同 tier(DeviceCapability),驱动帧率与预载预算 */
|
|
export class ThermalProfile {
|
|
private static _resolved = false;
|
|
private static _config: ThermalTierConfig = THERMAL_PROFILE.tiers[THERMAL_PROFILE.defaultTier];
|
|
|
|
static resolve(): void {
|
|
if (this._resolved) return;
|
|
this._resolved = true;
|
|
DeviceCapability.resolve();
|
|
const tier = DeviceCapability.memoryTier as ThermalTierId;
|
|
this._config = THERMAL_PROFILE.tiers[tier] ?? THERMAL_PROFILE.tiers[THERMAL_PROFILE.defaultTier];
|
|
}
|
|
|
|
static get current(): ThermalTierConfig {
|
|
this.resolve();
|
|
return this._config;
|
|
}
|
|
}
|
|
|