Added fan speed percentage

This commit is contained in:
Ilya Zlobintsev
2020-10-25 13:01:50 +02:00
parent 2e90d54686
commit e958bebfe0
3 changed files with 5 additions and 2 deletions
+3
View File
@@ -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,
}
}
+1 -1
View File
@@ -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
View File
@@ -163,7 +163,7 @@ fn build_ui(application: &gtk::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)
});