mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2026-08-18 17:04:42 -05:00
Added fan speed percentage
This commit is contained in:
@@ -50,6 +50,7 @@ pub struct GpuInfo {
|
||||
pub link_speed: String,
|
||||
pub link_width: u8,
|
||||
pub vulkan_info: VulkanInfo,
|
||||
pub max_fan_speed: i32,
|
||||
}
|
||||
|
||||
impl GpuController {
|
||||
@@ -150,6 +151,7 @@ impl GpuController {
|
||||
|
||||
|
||||
let vulkan_info = GpuController::get_vulkan_info(&model_id);
|
||||
let max_fan_speed = self.hw_mon.fan_max_speed;
|
||||
|
||||
GpuInfo {
|
||||
gpu_vendor: vendor,
|
||||
@@ -164,6 +166,7 @@ impl GpuController {
|
||||
link_speed,
|
||||
link_width,
|
||||
vulkan_info,
|
||||
max_fan_speed,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ pub enum HWMonError {
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct HWMon {
|
||||
hwmon_path: PathBuf,
|
||||
fan_max_speed: i32,
|
||||
pub fan_max_speed: i32,
|
||||
fan_control: Arc<AtomicBool>,
|
||||
fan_curve: Arc<RwLock<BTreeMap<i32, f64>>>,
|
||||
}
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ fn build_ui(application: >k::Application) {
|
||||
|
||||
gpu_power_text_buffer.set_text(&format!("{}/{}W", gpu_stats.power_avg, gpu_stats.power_max));
|
||||
|
||||
fan_speed_text_buffer.set_text(&format!("{}RPM", gpu_stats.fan_speed));
|
||||
fan_speed_text_buffer.set_text(&format!("{}RPM({}%)", gpu_stats.fan_speed, (gpu_stats.fan_speed as f64 / gpu_info.max_fan_speed as f64 * 100 as f64) as i32));
|
||||
|
||||
glib::Continue(true)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user