Files
ember-tune-rs/src/engine/formatters/throttled.rs
2026-02-26 13:37:04 +01:00

39 lines
752 B
Rust

pub struct ThrottledConfig {
pub pl1_limit: f32,
pub pl2_limit: f32,
pub trip_temp: f32,
}
pub struct ThrottledTranslator;
impl ThrottledTranslator {
pub fn generate_conf(config: &ThrottledConfig) -> String {
format!(
r#"[GENERAL]
# Generated by FerroTherm Optimizer
# Physical Sweet Spot found at {pl1:.1}W
[BATTERY]
Update_Interval_ms: 3000
PL1_Tdp_W: {pl1:.0}
PL1_Duration_s: 28
PL2_Tdp_W: {pl2:.0}
PL2_Duration_s: 0.002
Trip_Temp_C: {trip:.0}
[AC]
Update_Interval_ms: 1000
PL1_Tdp_W: {pl1:.0}
PL1_Duration_s: 28
PL2_Tdp_W: {pl2:.0}
PL2_Duration_s: 0.002
Trip_Temp_C: {trip:.0}
"#,
pl1 = config.pl1_limit,
pl2 = config.pl2_limit,
trip = config.trip_temp
)
}
}