1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-27 17:07:44 +00:00

delete core.rs

This commit is contained in:
RGBCube 2025-06-04 18:59:04 +03:00
parent ee7ea6b86d
commit 1283e5be14
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
2 changed files with 3 additions and 52 deletions

View file

@ -1,51 +0,0 @@
pub struct SystemInfo {
// Overall system details
pub cpu_model: String,
}
pub struct CpuCoreInfo {
// Per-core data
pub core_id: u32,
pub temperature_celsius: Option<f32>,
}
pub struct CpuGlobalInfo {
// System-wide CPU settings
pub epp: Option<String>, // Energy Performance Preference
pub epb: Option<String>, // Energy Performance Bias
pub average_temperature_celsius: Option<f32>, // Average temperature across all cores
}
pub struct BatteryInfo {
// Battery status (AC connected, charging state, capacity, power rate, charge start/stop thresholds if available).
pub name: String,
pub ac_connected: bool,
pub charging_state: Option<String>, // e.g., "Charging", "Discharging", "Full"
pub capacity_percent: Option<u8>,
pub power_rate_watts: Option<f32>, // positive for charging, negative for discharging
pub charge_start_threshold: Option<u8>,
pub charge_stop_threshold: Option<u8>,
}
pub struct SystemLoad {
// System load averages.
pub load_avg_1min: f32,
pub load_avg_5min: f32,
pub load_avg_15min: f32,
}
pub struct SystemReport {
// Now combine all the above for a snapshot of the system state.
pub system_info: SystemInfo,
pub cpu_cores: Vec<CpuCoreInfo>,
pub cpu_global: CpuGlobalInfo,
pub batteries: Vec<BatteryInfo>,
pub system_load: SystemLoad,
pub timestamp: std::time::SystemTime, // so we know when the report was generated
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum OperationalMode {
Powersave,
Performance,
}

View file

@ -10,7 +10,7 @@ use std::{
use anyhow::Context; use anyhow::Context;
use crate::config; use crate::{config, system};
/// Calculate the idle time multiplier based on system idle time. /// Calculate the idle time multiplier based on system idle time.
/// ///
@ -254,6 +254,8 @@ pub fn run(config: config::DaemonConfig) -> anyhow::Result<()> {
}) })
.context("failed to set Ctrl-C handler")?; .context("failed to set Ctrl-C handler")?;
let mut system = system::System::new()?;
while !cancelled.load(Ordering::SeqCst) {} while !cancelled.load(Ordering::SeqCst) {}
log::info!("exiting..."); log::info!("exiting...");