mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b2726f3a67 | |||
| 663f87d5e2 | |||
| 377bb4d6ad | |||
| 98e60db2da | |||
| 11ac46df11 | |||
| 05bec93644 | |||
| c77e7cf1ce | |||
| d30f7dc2ea | |||
| 759606fca3 | |||
| 25ed8bdeed | |||
| de61a15b7a | |||
| 16700e55f4 | |||
| 5833a011ce | |||
| 62577ee0e4 | |||
| dac35996b1 | |||
| 5c2bcad7c6 | |||
| 81f6c18a24 | |||
| bcc3d42789 | |||
| 36c34cb3dd | |||
| 9b82b875f1 | |||
| bddccc696f | |||
| 51e9f10087 | |||
| 911ff8690e | |||
| 25823dc6b7 | |||
| cba8e1a473 |
@@ -2,6 +2,34 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [v6.1.2]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Try a slightly different tact to fix charge control slider
|
||||||
|
|
||||||
|
## [v6.1.1]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Fix aura data matching
|
||||||
|
- Fix charge control slider
|
||||||
|
|
||||||
|
## [v6.1.0]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Update deps
|
||||||
|
- Add support for G513RC RGB modes
|
||||||
|
- Many UI fixes
|
||||||
|
- Fixes to PPT settings in UI
|
||||||
|
|
||||||
|
## [v6.1.0-rc7]
|
||||||
|
|
||||||
|
- Refactor PPT handling more:
|
||||||
|
1. Per profile, per-ac/dc
|
||||||
|
2. Do not apply unless group is enabled
|
||||||
|
3. Better reset/disable handling
|
||||||
|
4. Selecting a profile defaults PPT to off/disabled
|
||||||
|
- Bugfix: prevent an AniMe thread async deadlock
|
||||||
|
|
||||||
## [v6.1.0-rc6]
|
## [v6.1.0-rc6]
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
Generated
+1119
-495
File diff suppressed because it is too large
Load Diff
+8
-7
@@ -1,5 +1,5 @@
|
|||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "6.1.0-rc6"
|
version = "6.1.2"
|
||||||
rust-version = "1.82"
|
rust-version = "1.82"
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -43,7 +43,8 @@ dirs = "^4.0"
|
|||||||
smol = "^2.0"
|
smol = "^2.0"
|
||||||
mio = "0.8.11"
|
mio = "0.8.11"
|
||||||
|
|
||||||
zbus = "5.1"
|
futures-util = "0.3.31"
|
||||||
|
zbus = "5.1.1"
|
||||||
logind-zbus = { version = "5.0.0" } #, default-features = false, features = ["non_blocking"] }
|
logind-zbus = { version = "5.0.0" } #, default-features = false, features = ["non_blocking"] }
|
||||||
|
|
||||||
serde = { version = "^1.0", features = ["serde_derive"] }
|
serde = { version = "^1.0", features = ["serde_derive"] }
|
||||||
@@ -65,26 +66,26 @@ gif = "^0.12.0"
|
|||||||
|
|
||||||
versions = "6.2"
|
versions = "6.2"
|
||||||
|
|
||||||
notify-rust = { version = "4.11.0", features = ["z", "async"] }
|
notify-rust = { version = "4.11.4", features = ["z", "async"] }
|
||||||
|
|
||||||
sg = { git = "https://github.com/flukejones/sg-rs.git" }
|
sg = { git = "https://github.com/flukejones/sg-rs.git" }
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
# thin = 57s, asusd = 9.0M
|
# thin = 57s, asusd = 9.0M
|
||||||
# fat = 72s, asusd = 6.4M
|
# fat = 72s, asusd = 6.4M
|
||||||
lto = "fat"
|
lto = "thin"
|
||||||
debug = false
|
debug = false
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
codegen-units = 1
|
# codegen-units = 1
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
opt-level = 1
|
opt-level = 1
|
||||||
codegen-units = 16
|
# codegen-units = 1
|
||||||
|
|
||||||
[profile.dev.package."*"]
|
[profile.dev.package."*"]
|
||||||
opt-level = 1
|
opt-level = 1
|
||||||
codegen-units = 16
|
# codegen-units = 1
|
||||||
|
|
||||||
[profile.bench]
|
[profile.bench]
|
||||||
debug = false
|
debug = false
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ See the [rog-aura readme](./rog-aura/README.md) for more details.
|
|||||||
|
|
||||||
## Discord
|
## Discord
|
||||||
|
|
||||||
[](https://discord.gg/z8y99XqPb7)
|
[](https://discord.gg/B8GftRW2Hd)
|
||||||
|
|
||||||
## SUPPORTED LAPTOPS
|
## SUPPORTED LAPTOPS
|
||||||
|
|
||||||
|
|||||||
+11
-3
@@ -74,7 +74,15 @@ fn main() {
|
|||||||
println!("\nError: {e}\n");
|
println!("\nError: {e}\n");
|
||||||
print_info();
|
print_info();
|
||||||
}) {
|
}) {
|
||||||
let asusd_version = platform_proxy.version().unwrap();
|
let asusd_version = platform_proxy
|
||||||
|
.version()
|
||||||
|
.map_err(|e| {
|
||||||
|
error!(
|
||||||
|
"Could not get asusd version: {e:?}\nIs asusd.service running? {}",
|
||||||
|
check_service("asusd")
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.unwrap();
|
||||||
if asusd_version != self_version {
|
if asusd_version != self_version {
|
||||||
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
||||||
return;
|
return;
|
||||||
@@ -273,8 +281,8 @@ fn do_parsed(
|
|||||||
}
|
}
|
||||||
|
|
||||||
println!("\nExtra help can be requested on any command or subcommand:");
|
println!("\nExtra help can be requested on any command or subcommand:");
|
||||||
println!(" asusctl led-mode --help");
|
println!(" asusctl aura --help");
|
||||||
println!(" asusctl led-mode static --help");
|
println!(" asusctl aura static --help");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ pub struct SlashCommand {
|
|||||||
pub help: bool,
|
pub help: bool,
|
||||||
#[options(help = "Enable the Slash Ledbar")]
|
#[options(help = "Enable the Slash Ledbar")]
|
||||||
pub enable: bool,
|
pub enable: bool,
|
||||||
#[options(help = "Ddisable the Slash Ledbar")]
|
#[options(help = "Disable the Slash Ledbar")]
|
||||||
pub disable: bool,
|
pub disable: bool,
|
||||||
#[options(short = "l", meta = "", help = "Set brightness value <0-255>")]
|
#[options(short = "l", meta = "", help = "Set brightness value <0-255>")]
|
||||||
pub brightness: Option<u8>,
|
pub brightness: Option<u8>,
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ tokio.workspace = true
|
|||||||
log.workspace = true
|
log.workspace = true
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
|
|
||||||
|
futures-util.workspace = true
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
logind-zbus.workspace = true
|
logind-zbus.workspace = true
|
||||||
|
|
||||||
|
|||||||
+109
-52
@@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use ::zbus::export::futures_util::lock::Mutex;
|
|
||||||
use config_traits::StdConfig;
|
use config_traits::StdConfig;
|
||||||
|
use futures_util::lock::Mutex;
|
||||||
use log::{debug, error, info};
|
use log::{debug, error, info};
|
||||||
use rog_platform::asus_armoury::{AttrValue, Attribute, FirmwareAttribute, FirmwareAttributes};
|
use rog_platform::asus_armoury::{AttrValue, Attribute, FirmwareAttribute, FirmwareAttributes};
|
||||||
use rog_platform::platform::{PlatformProfile, RogPlatform};
|
use rog_platform::platform::{PlatformProfile, RogPlatform};
|
||||||
@@ -66,32 +66,43 @@ impl AsusArmouryAttribute {
|
|||||||
&mut self,
|
&mut self,
|
||||||
signal_ctxt: SignalEmitter<'static>
|
signal_ctxt: SignalEmitter<'static>
|
||||||
) -> Result<(), RogError> {
|
) -> Result<(), RogError> {
|
||||||
use zbus::export::futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
|
|
||||||
let ctrl = self.clone();
|
|
||||||
let name = self.name();
|
let name = self.name();
|
||||||
match self.attr.get_watcher() {
|
macro_rules! watch_value_notify {
|
||||||
Ok(watch) => {
|
($attr_str:expr, $fn_prop_changed:ident) => {
|
||||||
let name = <&str>::from(name);
|
match self.attr.get_watcher($attr_str) {
|
||||||
tokio::spawn(async move {
|
Ok(watch) => {
|
||||||
let mut buffer = [0; 32];
|
let name = <&str>::from(name);
|
||||||
watch
|
let ctrl = self.clone();
|
||||||
.into_event_stream(&mut buffer)
|
let sig = signal_ctxt.clone();
|
||||||
.unwrap()
|
tokio::spawn(async move {
|
||||||
.for_each(|_| async {
|
let mut buffer = [0; 32];
|
||||||
debug!("{} changed", name);
|
watch
|
||||||
ctrl.current_value_changed(&signal_ctxt).await.ok();
|
.into_event_stream(&mut buffer)
|
||||||
})
|
.unwrap()
|
||||||
.await;
|
.for_each(|_| async {
|
||||||
});
|
debug!("{} changed", name);
|
||||||
}
|
ctrl.$fn_prop_changed(&sig).await.ok();
|
||||||
Err(e) => info!(
|
})
|
||||||
"inotify watch failed: {}. You can ignore this if your device does not support \
|
.await;
|
||||||
the feature",
|
});
|
||||||
e
|
}
|
||||||
)
|
Err(e) => info!(
|
||||||
|
"inotify watch failed: {}. You can ignore this if your device does not \
|
||||||
|
support the feature",
|
||||||
|
e
|
||||||
|
)
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "current_value", "default_value", "min_value", "max_value"
|
||||||
|
watch_value_notify!("current_value", current_value_changed);
|
||||||
|
watch_value_notify!("default_value", default_value_changed);
|
||||||
|
watch_value_notify!("min_value", min_value_changed);
|
||||||
|
watch_value_notify!("max_value", max_value_changed);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,15 +124,18 @@ impl crate::Reloadable for AsusArmouryAttribute {
|
|||||||
} else {
|
} else {
|
||||||
&self.config.lock().await.dc_profile_tunings
|
&self.config.lock().await.dc_profile_tunings
|
||||||
};
|
};
|
||||||
if let Some(tunings) = config.get(&profile) {
|
if let Some(tuning) = config.get(&profile) {
|
||||||
if let Some(tune) = tunings.get(&self.name()) {
|
if tuning.enabled {
|
||||||
self.attr
|
if let Some(tune) = tuning.group.get(&self.name()) {
|
||||||
.set_current_value(&AttrValue::Integer(*tune))
|
self.attr
|
||||||
.map_err(|e| {
|
.set_current_value(&AttrValue::Integer(*tune))
|
||||||
error!("Could not set value: {e:?}");
|
.map_err(|e| {
|
||||||
e
|
error!("Could not set {} value: {e:?}", self.attr.name());
|
||||||
})?;
|
self.attr.base_path_exists();
|
||||||
info!("Set {} to {:?}", self.attr.name(), tune);
|
e
|
||||||
|
})?;
|
||||||
|
info!("Set {} to {:?}", self.attr.name(), tune);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,12 +205,20 @@ impl AsusArmouryAttribute {
|
|||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
let mut config = self.config.lock().await;
|
let mut config = self.config.lock().await;
|
||||||
let tunings = config.select_tunings(power_plugged == 1, profile);
|
let tuning = config.select_tunings(power_plugged == 1, profile);
|
||||||
if let Some(tune) = tunings.get_mut(&self.name()) {
|
if let Some(tune) = tuning.group.get_mut(&self.name()) {
|
||||||
if let AttrValue::Integer(i) = self.attr.default_value() {
|
if let AttrValue::Integer(i) = self.attr.default_value() {
|
||||||
*tune = *i;
|
*tune = *i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if tuning.enabled {
|
||||||
|
self.attr
|
||||||
|
.set_current_value(self.attr.default_value())
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Could not set value: {e:?}");
|
||||||
|
e
|
||||||
|
})?;
|
||||||
|
}
|
||||||
config.write();
|
config.write();
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -236,6 +258,28 @@ impl AsusArmouryAttribute {
|
|||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn current_value(&self) -> fdo::Result<i32> {
|
async fn current_value(&self) -> fdo::Result<i32> {
|
||||||
|
if self.name().is_ppt() {
|
||||||
|
let profile: PlatformProfile = self.platform.get_platform_profile()?.into();
|
||||||
|
let power_plugged = self
|
||||||
|
.power
|
||||||
|
.get_online()
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Could not get power status: {e:?}");
|
||||||
|
e
|
||||||
|
})
|
||||||
|
.unwrap_or_default();
|
||||||
|
let mut config = self.config.lock().await;
|
||||||
|
let tuning = config.select_tunings(power_plugged == 1, profile);
|
||||||
|
if let Some(tune) = tuning.group.get(&self.name()) {
|
||||||
|
return Ok(*tune);
|
||||||
|
} else if let AttrValue::Integer(i) = self.attr.default_value() {
|
||||||
|
return Ok(*i);
|
||||||
|
}
|
||||||
|
return Err(fdo::Error::Failed(
|
||||||
|
"Could not read current value".to_string()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
if let Ok(AttrValue::Integer(i)) = self.attr.current_value() {
|
if let Ok(AttrValue::Integer(i)) = self.attr.current_value() {
|
||||||
return Ok(i);
|
return Ok(i);
|
||||||
}
|
}
|
||||||
@@ -246,16 +290,8 @@ impl AsusArmouryAttribute {
|
|||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn set_current_value(&mut self, value: i32) -> fdo::Result<()> {
|
async fn set_current_value(&mut self, value: i32) -> fdo::Result<()> {
|
||||||
self.attr
|
|
||||||
.set_current_value(&AttrValue::Integer(value))
|
|
||||||
.map_err(|e| {
|
|
||||||
error!("Could not set value: {e:?}");
|
|
||||||
e
|
|
||||||
})?;
|
|
||||||
|
|
||||||
if self.name().is_ppt() {
|
if self.name().is_ppt() {
|
||||||
let profile: PlatformProfile = self.platform.get_platform_profile()?.into();
|
let profile: PlatformProfile = self.platform.get_platform_profile()?.into();
|
||||||
|
|
||||||
let power_plugged = self
|
let power_plugged = self
|
||||||
.power
|
.power
|
||||||
.get_online()
|
.get_online()
|
||||||
@@ -264,16 +300,32 @@ impl AsusArmouryAttribute {
|
|||||||
e
|
e
|
||||||
})
|
})
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let mut config = self.config.lock().await;
|
|
||||||
let tunings = config.select_tunings(power_plugged == 1, profile);
|
|
||||||
|
|
||||||
if let Some(tune) = tunings.get_mut(&self.name()) {
|
let mut config = self.config.lock().await;
|
||||||
|
let tuning = config.select_tunings(power_plugged == 1, profile);
|
||||||
|
|
||||||
|
if let Some(tune) = tuning.group.get_mut(&self.name()) {
|
||||||
*tune = value;
|
*tune = value;
|
||||||
} else {
|
} else {
|
||||||
tunings.insert(self.name(), value);
|
tuning.group.insert(self.name(), value);
|
||||||
debug!("Set tuning config for {} = {:?}", self.attr.name(), value);
|
debug!("Store tuning config for {} = {:?}", self.attr.name(), value);
|
||||||
|
}
|
||||||
|
if tuning.enabled {
|
||||||
|
self.attr
|
||||||
|
.set_current_value(&AttrValue::Integer(value))
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Could not set value: {e:?}");
|
||||||
|
e
|
||||||
|
})?;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
self.attr
|
||||||
|
.set_current_value(&AttrValue::Integer(value))
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Could not set value: {e:?}");
|
||||||
|
e
|
||||||
|
})?;
|
||||||
|
|
||||||
let has_attr = self
|
let has_attr = self
|
||||||
.config
|
.config
|
||||||
.lock()
|
.lock()
|
||||||
@@ -309,9 +361,10 @@ pub async fn start_attributes_zbus(
|
|||||||
conn: &Connection,
|
conn: &Connection,
|
||||||
platform: RogPlatform,
|
platform: RogPlatform,
|
||||||
power: AsusPower,
|
power: AsusPower,
|
||||||
|
attributes: FirmwareAttributes,
|
||||||
config: Arc<Mutex<Config>>
|
config: Arc<Mutex<Config>>
|
||||||
) -> Result<(), RogError> {
|
) -> Result<(), RogError> {
|
||||||
for attr in FirmwareAttributes::new().attributes() {
|
for attr in attributes.attributes() {
|
||||||
let mut attr = AsusArmouryAttribute::new(
|
let mut attr = AsusArmouryAttribute::new(
|
||||||
attr.clone(),
|
attr.clone(),
|
||||||
platform.clone(),
|
platform.clone(),
|
||||||
@@ -338,9 +391,13 @@ pub async fn set_config_or_default(
|
|||||||
for attr in attrs.attributes().iter() {
|
for attr in attrs.attributes().iter() {
|
||||||
let name: FirmwareAttribute = attr.name().into();
|
let name: FirmwareAttribute = attr.name().into();
|
||||||
if name.is_ppt() {
|
if name.is_ppt() {
|
||||||
let tunings = config.select_tunings(power_plugged, profile);
|
let tuning = config.select_tunings(power_plugged, profile);
|
||||||
|
if !tuning.enabled {
|
||||||
|
debug!("Tuning group is not enabled, skipping");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(tune) = tunings.get(&name) {
|
if let Some(tune) = tuning.group.get(&name) {
|
||||||
attr.set_current_value(&AttrValue::Integer(*tune))
|
attr.set_current_value(&AttrValue::Integer(*tune))
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
error!("Failed to set {}: {e}", <&str>::from(name));
|
error!("Failed to set {}: {e}", <&str>::from(name));
|
||||||
@@ -354,13 +411,13 @@ pub async fn set_config_or_default(
|
|||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
if let AttrValue::Integer(i) = default {
|
if let AttrValue::Integer(i) = default {
|
||||||
tunings.insert(name, *i);
|
tuning.group.insert(name, *i);
|
||||||
info!(
|
info!(
|
||||||
"Set default tuning config for {} = {:?}",
|
"Set default tuning config for {} = {:?}",
|
||||||
<&str>::from(name),
|
<&str>::from(name),
|
||||||
i
|
i
|
||||||
);
|
);
|
||||||
config.write();
|
// config.write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-12
@@ -8,7 +8,8 @@ use std::sync::Arc;
|
|||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
|
|
||||||
use config_traits::StdConfig;
|
use config_traits::StdConfig;
|
||||||
use log::{error, info, warn};
|
use futures_util::lock::Mutex;
|
||||||
|
use log::{debug, error, info, warn};
|
||||||
use rog_anime::usb::{
|
use rog_anime::usb::{
|
||||||
pkt_flush, pkt_set_brightness, pkt_set_enable_display, pkt_set_enable_powersave_anim,
|
pkt_flush, pkt_set_brightness, pkt_set_enable_display, pkt_set_enable_powersave_anim,
|
||||||
pkts_for_init, Brightness
|
pkts_for_init, Brightness
|
||||||
@@ -16,7 +17,6 @@ use rog_anime::usb::{
|
|||||||
use rog_anime::{ActionData, AnimeDataBuffer, AnimePacketType};
|
use rog_anime::{ActionData, AnimeDataBuffer, AnimePacketType};
|
||||||
use rog_platform::hid_raw::HidRaw;
|
use rog_platform::hid_raw::HidRaw;
|
||||||
use rog_platform::usb_raw::USBRaw;
|
use rog_platform::usb_raw::USBRaw;
|
||||||
use tokio::sync::{Mutex, MutexGuard};
|
|
||||||
|
|
||||||
use self::config::{AniMeConfig, AniMeConfigCached};
|
use self::config::{AniMeConfig, AniMeConfigCached};
|
||||||
use crate::error::RogError;
|
use crate::error::RogError;
|
||||||
@@ -51,7 +51,7 @@ impl AniMe {
|
|||||||
|
|
||||||
/// Will fail if something is already holding the config lock
|
/// Will fail if something is already holding the config lock
|
||||||
async fn do_init_cache(&mut self) {
|
async fn do_init_cache(&mut self) {
|
||||||
if let Ok(mut config) = self.config.try_lock() {
|
if let Some(mut config) = self.config.try_lock() {
|
||||||
if let Err(e) = self.cache.init_from_config(&config, config.anime_type) {
|
if let Err(e) = self.cache.init_from_config(&config, config.anime_type) {
|
||||||
error!(
|
error!(
|
||||||
"Trying to cache the Anime Config failed, will reset to default config: {e:?}"
|
"Trying to cache the Anime Config failed, will reset to default config: {e:?}"
|
||||||
@@ -59,6 +59,8 @@ impl AniMe {
|
|||||||
config.rename_file_old();
|
config.rename_file_old();
|
||||||
*config = AniMeConfig::new();
|
*config = AniMeConfig::new();
|
||||||
config.write();
|
config.write();
|
||||||
|
} else {
|
||||||
|
debug!("Initialised AniMe cache");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error!("AniMe Matrix could not init cache")
|
error!("AniMe Matrix could not init cache")
|
||||||
@@ -70,11 +72,9 @@ impl AniMe {
|
|||||||
self.do_init_cache().await;
|
self.do_init_cache().await;
|
||||||
let pkts = pkts_for_init();
|
let pkts = pkts_for_init();
|
||||||
self.write_bytes(&pkts[0]).await?;
|
self.write_bytes(&pkts[0]).await?;
|
||||||
self.write_bytes(&pkts[1]).await
|
self.write_bytes(&pkts[1]).await?;
|
||||||
}
|
debug!("Succesfully initialised AniMe matrix display");
|
||||||
|
Ok(())
|
||||||
pub async fn lock_config(&self) -> MutexGuard<AniMeConfig> {
|
|
||||||
self.config.lock().await
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn write_bytes(&self, message: &[u8]) -> Result<(), RogError> {
|
pub async fn write_bytes(&self, message: &[u8]) -> Result<(), RogError> {
|
||||||
@@ -176,7 +176,7 @@ impl AniMe {
|
|||||||
return Ok(true); // Do safe exit
|
return Ok(true); // Do safe exit
|
||||||
}
|
}
|
||||||
let inner = inner.clone();
|
let inner = inner.clone();
|
||||||
tokio::task::spawn_local(async move {
|
tokio::task::spawn(async move {
|
||||||
inner
|
inner
|
||||||
.write_data_buffer(frame)
|
.write_data_buffer(frame)
|
||||||
.await
|
.await
|
||||||
@@ -227,10 +227,11 @@ impl AniMe {
|
|||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
}
|
}
|
||||||
|
// A write can block for many milliseconds so lets not hold the config lock for
|
||||||
|
// the same period
|
||||||
|
let enabled = inner.config.lock().await.builtin_anims_enabled;
|
||||||
inner
|
inner
|
||||||
.write_bytes(&pkt_set_enable_powersave_anim(
|
.write_bytes(&pkt_set_enable_powersave_anim(enabled))
|
||||||
inner.config.lock().await.builtin_anims_enabled
|
|
||||||
))
|
|
||||||
.await
|
.await
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
warn!("rog_anime::run_animation:callback {}", err);
|
warn!("rog_anime::run_animation:callback {}", err);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
|
|
||||||
use config_traits::StdConfig;
|
use config_traits::StdConfig;
|
||||||
use log::{error, warn};
|
use log::{debug, error, warn};
|
||||||
use logind_zbus::manager::ManagerProxy;
|
use logind_zbus::manager::ManagerProxy;
|
||||||
use rog_anime::usb::{
|
use rog_anime::usb::{
|
||||||
pkt_set_brightness, pkt_set_builtin_animations, pkt_set_enable_display,
|
pkt_set_brightness, pkt_set_builtin_animations, pkt_set_enable_display,
|
||||||
@@ -51,8 +51,11 @@ impl AniMeZbus {
|
|||||||
.object_server()
|
.object_server()
|
||||||
.at(path.clone(), self)
|
.at(path.clone(), self)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| error!("Couldn't add server at path: {path}, {e:?}"))
|
.map_err(|e| {
|
||||||
.ok();
|
error!("Couldn't add server at path: {path}, {e:?}");
|
||||||
|
e
|
||||||
|
})?;
|
||||||
|
debug!("start_tasks was successful");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,7 +81,7 @@ impl AniMeZbus {
|
|||||||
/// Set base brightness level
|
/// Set base brightness level
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn brightness(&self) -> Brightness {
|
async fn brightness(&self) -> Brightness {
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
return config.display_brightness;
|
return config.display_brightness;
|
||||||
}
|
}
|
||||||
Brightness::Off
|
Brightness::Off
|
||||||
@@ -110,7 +113,7 @@ impl AniMeZbus {
|
|||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn builtins_enabled(&self) -> bool {
|
async fn builtins_enabled(&self) -> bool {
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
return config.builtin_anims_enabled;
|
return config.builtin_anims_enabled;
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
@@ -155,7 +158,7 @@ impl AniMeZbus {
|
|||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn builtin_animations(&self) -> Animations {
|
async fn builtin_animations(&self) -> Animations {
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
return config.builtin_anims;
|
return config.builtin_anims;
|
||||||
}
|
}
|
||||||
Animations::default()
|
Animations::default()
|
||||||
@@ -188,7 +191,7 @@ impl AniMeZbus {
|
|||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn enable_display(&self) -> bool {
|
async fn enable_display(&self) -> bool {
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
return config.display_enabled;
|
return config.display_enabled;
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
@@ -211,7 +214,7 @@ impl AniMeZbus {
|
|||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn off_when_unplugged(&self) -> bool {
|
async fn off_when_unplugged(&self) -> bool {
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
return config.off_when_unplugged;
|
return config.off_when_unplugged;
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
@@ -238,7 +241,7 @@ impl AniMeZbus {
|
|||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn off_when_suspended(&self) -> bool {
|
async fn off_when_suspended(&self) -> bool {
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
return config.off_when_suspended;
|
return config.off_when_suspended;
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
@@ -254,7 +257,7 @@ impl AniMeZbus {
|
|||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn off_when_lid_closed(&self) -> bool {
|
async fn off_when_lid_closed(&self) -> bool {
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
return config.off_when_lid_closed;
|
return config.off_when_lid_closed;
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
@@ -440,50 +443,60 @@ impl crate::CtrlTask for AniMeZbus {
|
|||||||
|
|
||||||
impl crate::Reloadable for AniMeZbus {
|
impl crate::Reloadable for AniMeZbus {
|
||||||
async fn reload(&mut self) -> Result<(), RogError> {
|
async fn reload(&mut self) -> Result<(), RogError> {
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
let AniMeConfig {
|
||||||
let anim = &config.builtin_anims;
|
builtin_anims_enabled,
|
||||||
// Set builtins
|
builtin_anims,
|
||||||
if config.builtin_anims_enabled {
|
display_enabled,
|
||||||
self.0
|
display_brightness,
|
||||||
.write_bytes(&pkt_set_builtin_animations(
|
off_when_lid_closed,
|
||||||
anim.boot, anim.awake, anim.sleep, anim.shutdown
|
off_when_unplugged,
|
||||||
))
|
..
|
||||||
.await?;
|
} = *self.0.config.lock().await;
|
||||||
}
|
|
||||||
// Builtins enabled or na?
|
// Set builtins
|
||||||
|
if builtin_anims_enabled {
|
||||||
self.0
|
self.0
|
||||||
.set_builtins_enabled(config.builtin_anims_enabled, config.display_brightness)
|
.write_bytes(&pkt_set_builtin_animations(
|
||||||
|
builtin_anims.boot,
|
||||||
|
builtin_anims.awake,
|
||||||
|
builtin_anims.sleep,
|
||||||
|
builtin_anims.shutdown
|
||||||
|
))
|
||||||
.await?;
|
.await?;
|
||||||
|
}
|
||||||
|
// Builtins enabled or na?
|
||||||
|
self.0
|
||||||
|
.set_builtins_enabled(builtin_anims_enabled, display_brightness)
|
||||||
|
.await?;
|
||||||
|
|
||||||
let manager = get_logind_manager().await;
|
let manager = get_logind_manager().await;
|
||||||
let lid_closed = manager.lid_closed().await.unwrap_or_default();
|
let lid_closed = manager.lid_closed().await.unwrap_or_default();
|
||||||
let power_plugged = manager.on_external_power().await.unwrap_or_default();
|
let power_plugged = manager.on_external_power().await.unwrap_or_default();
|
||||||
|
|
||||||
let turn_off = (lid_closed && config.off_when_lid_closed)
|
let turn_off =
|
||||||
|| (!power_plugged && config.off_when_unplugged);
|
(lid_closed && off_when_lid_closed) || (!power_plugged && off_when_unplugged);
|
||||||
|
self.0
|
||||||
|
.write_bytes(&pkt_set_enable_display(!turn_off))
|
||||||
|
.await
|
||||||
|
.map_err(|err| {
|
||||||
|
warn!("create_sys_event_tasks::reload {}", err);
|
||||||
|
})
|
||||||
|
.ok();
|
||||||
|
|
||||||
|
if turn_off || !display_enabled {
|
||||||
|
self.0.write_bytes(&pkt_set_enable_display(false)).await?;
|
||||||
|
// early return so we don't run animation thread
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
if !builtin_anims_enabled && !self.0.cache.boot.is_empty() {
|
||||||
self.0
|
self.0
|
||||||
.write_bytes(&pkt_set_enable_display(!turn_off))
|
.write_bytes(&pkt_set_enable_powersave_anim(false))
|
||||||
.await
|
.await
|
||||||
.map_err(|err| {
|
|
||||||
warn!("create_sys_event_tasks::reload {}", err);
|
|
||||||
})
|
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
if turn_off || !config.display_enabled {
|
let action = self.0.cache.boot.clone();
|
||||||
self.0.write_bytes(&pkt_set_enable_display(false)).await?;
|
self.0.run_thread(action, true).await;
|
||||||
// early return so we don't run animation thread
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
if !config.builtin_anims_enabled && !self.0.cache.boot.is_empty() {
|
|
||||||
self.0
|
|
||||||
.write_bytes(&pkt_set_enable_powersave_anim(false))
|
|
||||||
.await
|
|
||||||
.ok();
|
|
||||||
|
|
||||||
let action = self.0.cache.boot.clone();
|
|
||||||
self.0.run_thread(action, true).await;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use config::AuraConfig;
|
use config::AuraConfig;
|
||||||
use config_traits::StdConfig;
|
use config_traits::StdConfig;
|
||||||
|
use futures_util::lock::{Mutex, MutexGuard};
|
||||||
use log::info;
|
use log::info;
|
||||||
use rog_aura::keyboard::{AuraLaptopUsbPackets, LedUsbPackets};
|
use rog_aura::keyboard::{AuraLaptopUsbPackets, LedUsbPackets};
|
||||||
use rog_aura::usb::{AURA_LAPTOP_LED_APPLY, AURA_LAPTOP_LED_SET};
|
use rog_aura::usb::{AURA_LAPTOP_LED_APPLY, AURA_LAPTOP_LED_SET};
|
||||||
use rog_aura::{AuraDeviceType, AuraEffect, LedBrightness, PowerZones, AURA_LAPTOP_LED_MSG_LEN};
|
use rog_aura::{AuraDeviceType, AuraEffect, LedBrightness, PowerZones, AURA_LAPTOP_LED_MSG_LEN};
|
||||||
use rog_platform::hid_raw::HidRaw;
|
use rog_platform::hid_raw::HidRaw;
|
||||||
use rog_platform::keyboard_led::KeyboardBacklight;
|
use rog_platform::keyboard_led::KeyboardBacklight;
|
||||||
use tokio::sync::{Mutex, MutexGuard};
|
|
||||||
|
|
||||||
use crate::error::RogError;
|
use crate::error::RogError;
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ impl AuraZbus {
|
|||||||
// entirely possible to deadlock here, so use try instead of lock()
|
// entirely possible to deadlock here, so use try instead of lock()
|
||||||
// let ctrl = self.0.lock().await;
|
// let ctrl = self.0.lock().await;
|
||||||
// Ok(config.current_mode)
|
// Ok(config.current_mode)
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
Ok(config.current_mode)
|
Ok(config.current_mode)
|
||||||
} else {
|
} else {
|
||||||
Err(ZbErr::Failed("Aura control couldn't lock self".to_string()))
|
Err(ZbErr::Failed("Aura control couldn't lock self".to_string()))
|
||||||
@@ -140,7 +140,7 @@ impl AuraZbus {
|
|||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn led_mode_data(&self) -> Result<AuraEffect, ZbErr> {
|
async fn led_mode_data(&self) -> Result<AuraEffect, ZbErr> {
|
||||||
// entirely possible to deadlock here, so use try instead of lock()
|
// entirely possible to deadlock here, so use try instead of lock()
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
let mode = config.current_mode;
|
let mode = config.current_mode;
|
||||||
match config.builtins.get(&mode) {
|
match config.builtins.get(&mode) {
|
||||||
Some(effect) => Ok(effect.clone()),
|
Some(effect) => Ok(effect.clone()),
|
||||||
|
|||||||
+19
-10
@@ -8,11 +8,11 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use dmi_id::DMIID;
|
use dmi_id::DMIID;
|
||||||
use futures_lite::future::block_on;
|
use futures_lite::future::block_on;
|
||||||
|
use futures_util::lock::Mutex;
|
||||||
use log::{debug, error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use mio::{Events, Interest, Poll, Token};
|
use mio::{Events, Interest, Poll, Token};
|
||||||
use rog_platform::error::PlatformError;
|
use rog_platform::error::PlatformError;
|
||||||
use rog_platform::hid_raw::HidRaw;
|
use rog_platform::hid_raw::HidRaw;
|
||||||
use tokio::sync::Mutex;
|
|
||||||
use udev::{Device, MonitorBuilder};
|
use udev::{Device, MonitorBuilder};
|
||||||
use zbus::zvariant::{ObjectPath, OwnedObjectPath};
|
use zbus::zvariant::{ObjectPath, OwnedObjectPath};
|
||||||
use zbus::Connection;
|
use zbus::Connection;
|
||||||
@@ -319,11 +319,17 @@ impl DeviceManager {
|
|||||||
if let DeviceHandle::AniMe(anime) = dev_type.clone() {
|
if let DeviceHandle::AniMe(anime) = dev_type.clone() {
|
||||||
let path = dbus_path_for_anime();
|
let path = dbus_path_for_anime();
|
||||||
let ctrl = AniMeZbus::new(anime);
|
let ctrl = AniMeZbus::new(anime);
|
||||||
ctrl.start_tasks(connection, path.clone()).await.unwrap();
|
if ctrl
|
||||||
devices.push(AsusDevice {
|
.start_tasks(connection, path.clone())
|
||||||
device: dev_type,
|
.await
|
||||||
dbus_path: path
|
.map_err(|e| error!("Failed to start tasks: {e:?}, not adding this device"))
|
||||||
});
|
.is_ok()
|
||||||
|
{
|
||||||
|
devices.push(AsusDevice {
|
||||||
|
device: dev_type,
|
||||||
|
dbus_path: path
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info!("Tested device was not AniMe Matrix");
|
info!("Tested device was not AniMe Matrix");
|
||||||
@@ -364,7 +370,9 @@ impl DeviceManager {
|
|||||||
|
|
||||||
pub async fn new(connection: Connection) -> Result<Self, RogError> {
|
pub async fn new(connection: Connection) -> Result<Self, RogError> {
|
||||||
let conn_copy = connection.clone();
|
let conn_copy = connection.clone();
|
||||||
let devices = Arc::new(Mutex::new(Self::find_all_devices(&conn_copy).await));
|
let devices = Self::find_all_devices(&conn_copy).await;
|
||||||
|
info!("Found {} valid devices on startup", devices.len());
|
||||||
|
let devices = Arc::new(Mutex::new(devices));
|
||||||
let manager = Self {
|
let manager = Self {
|
||||||
_dbus_connection: connection
|
_dbus_connection: connection
|
||||||
};
|
};
|
||||||
@@ -372,8 +380,6 @@ impl DeviceManager {
|
|||||||
// TODO: The /sysfs/ LEDs don't cause events, so they need to be manually
|
// TODO: The /sysfs/ LEDs don't cause events, so they need to be manually
|
||||||
// checked for and added
|
// checked for and added
|
||||||
|
|
||||||
// detect all plugged in aura devices (eventually)
|
|
||||||
// only USB devices are detected for here
|
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
let mut monitor = MonitorBuilder::new()?.listen()?;
|
let mut monitor = MonitorBuilder::new()?.listen()?;
|
||||||
let mut poll = Poll::new()?;
|
let mut poll = Poll::new()?;
|
||||||
@@ -420,7 +426,10 @@ impl DeviceManager {
|
|||||||
{
|
{
|
||||||
index
|
index
|
||||||
} else {
|
} else {
|
||||||
warn!("No device for dbus path: {path:?}");
|
if dev_prop_matches(&event.device(), "ID_VENDOR_ID", "0b05")
|
||||||
|
{
|
||||||
|
warn!("No device for dbus path: {path:?}");
|
||||||
|
}
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
info!("removing: {path:?}");
|
info!("removing: {path:?}");
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use config::ScsiConfig;
|
use config::ScsiConfig;
|
||||||
|
use futures_util::lock::{Mutex, MutexGuard};
|
||||||
use rog_scsi::{AuraEffect, Device, Task};
|
use rog_scsi::{AuraEffect, Device, Task};
|
||||||
use tokio::sync::{Mutex, MutexGuard};
|
|
||||||
|
|
||||||
use crate::error::RogError;
|
use crate::error::RogError;
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ impl ScsiZbus {
|
|||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn led_mode_data(&self) -> Result<AuraEffect, ZbErr> {
|
async fn led_mode_data(&self) -> Result<AuraEffect, ZbErr> {
|
||||||
// entirely possible to deadlock here, so use try instead of lock()
|
// entirely possible to deadlock here, so use try instead of lock()
|
||||||
if let Ok(config) = self.0.config.try_lock() {
|
if let Some(config) = self.0.config.try_lock() {
|
||||||
let mode = config.current_mode;
|
let mode = config.current_mode;
|
||||||
match config.modes.get(&mode) {
|
match config.modes.get(&mode) {
|
||||||
Some(effect) => Ok(effect.clone()),
|
Some(effect) => Ok(effect.clone()),
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use config::SlashConfig;
|
use config::SlashConfig;
|
||||||
|
use futures_util::lock::{Mutex, MutexGuard};
|
||||||
use rog_platform::hid_raw::HidRaw;
|
use rog_platform::hid_raw::HidRaw;
|
||||||
use rog_platform::usb_raw::USBRaw;
|
use rog_platform::usb_raw::USBRaw;
|
||||||
use rog_slash::usb::{get_options_packet, pkt_set_mode, pkts_for_init};
|
use rog_slash::usb::{get_options_packet, pkt_set_mode, pkts_for_init};
|
||||||
use rog_slash::SlashType;
|
use rog_slash::SlashType;
|
||||||
use tokio::sync::{Mutex, MutexGuard};
|
|
||||||
|
|
||||||
use crate::error::RogError;
|
use crate::error::RogError;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use config_traits::{StdConfig, StdConfigLoad};
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
|
use futures_util::lock::Mutex;
|
||||||
use log::{debug, error, info};
|
use log::{debug, error, info};
|
||||||
use rog_anime::error::AnimeError;
|
use rog_anime::error::AnimeError;
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_anime_type;
|
||||||
@@ -12,7 +13,6 @@ use rog_platform::usb_raw::USBRaw;
|
|||||||
use rog_scsi::{open_device, ScsiType};
|
use rog_scsi::{open_device, ScsiType};
|
||||||
use rog_slash::error::SlashError;
|
use rog_slash::error::SlashError;
|
||||||
use rog_slash::SlashType;
|
use rog_slash::SlashType;
|
||||||
use tokio::sync::Mutex;
|
|
||||||
|
|
||||||
use crate::aura_anime::config::AniMeConfig;
|
use crate::aura_anime::config::AniMeConfig;
|
||||||
use crate::aura_anime::AniMe;
|
use crate::aura_anime::AniMe;
|
||||||
|
|||||||
+9
-7
@@ -7,7 +7,13 @@ use rog_platform::platform::PlatformProfile;
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
const CONFIG_FILE: &str = "asusd.ron";
|
const CONFIG_FILE: &str = "asusd.ron";
|
||||||
type Tunings = HashMap<PlatformProfile, HashMap<FirmwareAttribute, i32>>;
|
|
||||||
|
#[derive(Default, Clone, Deserialize, Serialize, PartialEq)]
|
||||||
|
pub struct Tuning {
|
||||||
|
pub enabled: bool,
|
||||||
|
pub group: HashMap<FirmwareAttribute, i32>
|
||||||
|
}
|
||||||
|
type Tunings = HashMap<PlatformProfile, Tuning>;
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, PartialEq)]
|
#[derive(Deserialize, Serialize, PartialEq)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
@@ -47,17 +53,13 @@ pub struct Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
pub fn select_tunings(
|
pub fn select_tunings(&mut self, power_plugged: bool, profile: PlatformProfile) -> &mut Tuning {
|
||||||
&mut self,
|
|
||||||
power_plugged: bool,
|
|
||||||
profile: PlatformProfile
|
|
||||||
) -> &mut HashMap<FirmwareAttribute, i32> {
|
|
||||||
let config = if power_plugged {
|
let config = if power_plugged {
|
||||||
&mut self.ac_profile_tunings
|
&mut self.ac_profile_tunings
|
||||||
} else {
|
} else {
|
||||||
&mut self.dc_profile_tunings
|
&mut self.dc_profile_tunings
|
||||||
};
|
};
|
||||||
config.entry(profile).or_insert_with(HashMap::new)
|
config.entry(profile).or_insert_with(Tuning::default)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use config_traits::{StdConfig, StdConfigLoad};
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
use futures_lite::StreamExt;
|
use futures_lite::StreamExt;
|
||||||
|
use futures_util::lock::Mutex;
|
||||||
use log::{debug, error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use rog_platform::platform::{PlatformProfile, RogPlatform};
|
use rog_platform::platform::{PlatformProfile, RogPlatform};
|
||||||
use rog_profiles::error::ProfileError;
|
use rog_profiles::error::ProfileError;
|
||||||
use rog_profiles::fan_curve_set::CurveData;
|
use rog_profiles::fan_curve_set::CurveData;
|
||||||
use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles};
|
use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use tokio::sync::Mutex;
|
|
||||||
use zbus::object_server::SignalEmitter;
|
use zbus::object_server::SignalEmitter;
|
||||||
use zbus::{interface, Connection};
|
use zbus::{interface, Connection};
|
||||||
|
|
||||||
|
|||||||
+120
-12
@@ -3,12 +3,12 @@ use std::process::Command;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use config_traits::StdConfig;
|
use config_traits::StdConfig;
|
||||||
|
use futures_util::lock::Mutex;
|
||||||
use log::{debug, error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use rog_platform::asus_armoury::FirmwareAttributes;
|
use rog_platform::asus_armoury::{AttrValue, FirmwareAttribute, FirmwareAttributes};
|
||||||
use rog_platform::cpu::{CPUControl, CPUGovernor, CPUEPP};
|
use rog_platform::cpu::{CPUControl, CPUGovernor, CPUEPP};
|
||||||
use rog_platform::platform::{PlatformProfile, Properties, RogPlatform};
|
use rog_platform::platform::{PlatformProfile, Properties, RogPlatform};
|
||||||
use rog_platform::power::AsusPower;
|
use rog_platform::power::AsusPower;
|
||||||
use zbus::export::futures_util::lock::Mutex;
|
|
||||||
use zbus::fdo::Error as FdoErr;
|
use zbus::fdo::Error as FdoErr;
|
||||||
use zbus::object_server::SignalEmitter;
|
use zbus::object_server::SignalEmitter;
|
||||||
use zbus::{interface, Connection};
|
use zbus::{interface, Connection};
|
||||||
@@ -43,24 +43,27 @@ macro_rules! platform_get_value {
|
|||||||
pub struct CtrlPlatform {
|
pub struct CtrlPlatform {
|
||||||
power: AsusPower,
|
power: AsusPower,
|
||||||
platform: RogPlatform,
|
platform: RogPlatform,
|
||||||
|
attributes: FirmwareAttributes,
|
||||||
cpu_control: Option<CPUControl>,
|
cpu_control: Option<CPUControl>,
|
||||||
config: Arc<Mutex<Config>>
|
config: Arc<Mutex<Config>>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CtrlPlatform {
|
impl CtrlPlatform {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
platform: RogPlatform,
|
||||||
|
power: AsusPower,
|
||||||
|
attributes: FirmwareAttributes,
|
||||||
config: Arc<Mutex<Config>>,
|
config: Arc<Mutex<Config>>,
|
||||||
config_path: &Path,
|
config_path: &Path,
|
||||||
signal_context: SignalEmitter<'static>
|
signal_context: SignalEmitter<'static>
|
||||||
) -> Result<Self, RogError> {
|
) -> Result<Self, RogError> {
|
||||||
let platform = RogPlatform::new()?;
|
|
||||||
let power = AsusPower::new()?;
|
|
||||||
let config1 = config.clone();
|
let config1 = config.clone();
|
||||||
let config_path = config_path.to_owned();
|
let config_path = config_path.to_owned();
|
||||||
|
|
||||||
let ret_self = CtrlPlatform {
|
let ret_self = CtrlPlatform {
|
||||||
power,
|
power,
|
||||||
platform,
|
platform,
|
||||||
|
attributes,
|
||||||
config,
|
config,
|
||||||
cpu_control: CPUControl::new()
|
cpu_control: CPUControl::new()
|
||||||
.map_err(|e| error!("Couldn't get CPU control sysfs: {e}"))
|
.map_err(|e| error!("Couldn't get CPU control sysfs: {e}"))
|
||||||
@@ -69,7 +72,7 @@ impl CtrlPlatform {
|
|||||||
let mut inotify_self = ret_self.clone();
|
let mut inotify_self = ret_self.clone();
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
use zbus::export::futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
info!("Starting inotify watch for asusd config file");
|
info!("Starting inotify watch for asusd config file");
|
||||||
|
|
||||||
let mut buffer = [0; 32];
|
let mut buffer = [0; 32];
|
||||||
@@ -332,6 +335,7 @@ impl CtrlPlatform {
|
|||||||
warn!("platform_profile {}", err);
|
warn!("platform_profile {}", err);
|
||||||
FdoErr::Failed(format!("RogPlatform: platform_profile: {err}"))
|
FdoErr::Failed(format!("RogPlatform: platform_profile: {err}"))
|
||||||
})?;
|
})?;
|
||||||
|
self.enable_ppt_group_changed(&ctxt).await?;
|
||||||
Ok(self.platform_profile_changed(&ctxt).await?)
|
Ok(self.platform_profile_changed(&ctxt).await?)
|
||||||
} else {
|
} else {
|
||||||
Err(FdoErr::NotSupported(
|
Err(FdoErr::NotSupported(
|
||||||
@@ -346,19 +350,27 @@ impl CtrlPlatform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn set_platform_profile(&mut self, policy: PlatformProfile) -> Result<(), FdoErr> {
|
async fn set_platform_profile(
|
||||||
|
&mut self,
|
||||||
|
#[zbus(signal_context)] ctxt: SignalEmitter<'_>,
|
||||||
|
policy: PlatformProfile
|
||||||
|
) -> Result<(), FdoErr> {
|
||||||
// TODO: watch for external changes
|
// TODO: watch for external changes
|
||||||
if self.platform.has_platform_profile() {
|
if self.platform.has_platform_profile() {
|
||||||
let change_epp = self.config.lock().await.platform_profile_linked_epp;
|
let change_epp = self.config.lock().await.platform_profile_linked_epp;
|
||||||
let epp = self.get_config_epp_for_throttle(policy).await;
|
let epp = self.get_config_epp_for_throttle(policy).await;
|
||||||
self.check_and_set_epp(epp, change_epp);
|
self.check_and_set_epp(epp, change_epp);
|
||||||
|
|
||||||
self.config.lock().await.write();
|
self.config.lock().await.write();
|
||||||
|
// TODO: Need to get supported profiles here and ensure we translate to one
|
||||||
self.platform
|
self.platform
|
||||||
.set_platform_profile(policy.into())
|
.set_platform_profile(policy.into())
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
warn!("platform_profile {}", err);
|
warn!("platform_profile {}", err);
|
||||||
FdoErr::Failed(format!("RogPlatform: platform_profile: {err}"))
|
FdoErr::Failed(format!("RogPlatform: platform_profile: {err}"))
|
||||||
})
|
})?;
|
||||||
|
self.enable_ppt_group_changed(&ctxt).await?;
|
||||||
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(FdoErr::NotSupported(
|
Err(FdoErr::NotSupported(
|
||||||
"RogPlatform: platform_profile not supported".to_owned()
|
"RogPlatform: platform_profile not supported".to_owned()
|
||||||
@@ -386,10 +398,11 @@ impl CtrlPlatform {
|
|||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn set_platform_profile_on_battery(
|
async fn set_platform_profile_on_battery(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
#[zbus(signal_context)] ctxt: SignalEmitter<'_>,
|
||||||
policy: PlatformProfile
|
policy: PlatformProfile
|
||||||
) -> Result<(), FdoErr> {
|
) -> Result<(), FdoErr> {
|
||||||
self.config.lock().await.platform_profile_on_battery = policy;
|
self.config.lock().await.platform_profile_on_battery = policy;
|
||||||
self.set_platform_profile(policy).await?;
|
self.set_platform_profile(ctxt, policy).await?;
|
||||||
self.config.lock().await.write();
|
self.config.lock().await.write();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -412,9 +425,13 @@ impl CtrlPlatform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
async fn set_platform_profile_on_ac(&mut self, policy: PlatformProfile) -> Result<(), FdoErr> {
|
async fn set_platform_profile_on_ac(
|
||||||
|
&mut self,
|
||||||
|
#[zbus(signal_context)] ctxt: SignalEmitter<'_>,
|
||||||
|
policy: PlatformProfile
|
||||||
|
) -> Result<(), FdoErr> {
|
||||||
self.config.lock().await.platform_profile_on_ac = policy;
|
self.config.lock().await.platform_profile_on_ac = policy;
|
||||||
self.set_platform_profile(policy).await?;
|
self.set_platform_profile(ctxt, policy).await?;
|
||||||
self.config.lock().await.write();
|
self.config.lock().await.write();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -475,9 +492,92 @@ impl CtrlPlatform {
|
|||||||
let change_pp = self.config.lock().await.platform_profile_linked_epp;
|
let change_pp = self.config.lock().await.platform_profile_linked_epp;
|
||||||
self.config.lock().await.profile_performance_epp = epp;
|
self.config.lock().await.profile_performance_epp = epp;
|
||||||
self.check_and_set_epp(epp, change_pp);
|
self.check_and_set_epp(epp, change_pp);
|
||||||
|
|
||||||
self.config.lock().await.write();
|
self.config.lock().await.write();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set if the PPT tuning group for the current profile is enabled
|
||||||
|
#[zbus(property)]
|
||||||
|
async fn enable_ppt_group(&self) -> Result<bool, FdoErr> {
|
||||||
|
let power_plugged = self
|
||||||
|
.power
|
||||||
|
.get_online()
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Could not get power status: {e:?}");
|
||||||
|
e
|
||||||
|
})
|
||||||
|
.unwrap_or_default();
|
||||||
|
let profile: PlatformProfile = self.platform.get_platform_profile()?.into();
|
||||||
|
Ok(self
|
||||||
|
.config
|
||||||
|
.lock()
|
||||||
|
.await
|
||||||
|
.select_tunings(power_plugged == 1, profile)
|
||||||
|
.enabled)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Set if the PPT tuning group for the current profile is enabled
|
||||||
|
#[zbus(property)]
|
||||||
|
async fn set_enable_ppt_group(&mut self, enable: bool) -> Result<(), FdoErr> {
|
||||||
|
let power_plugged = self
|
||||||
|
.power
|
||||||
|
.get_online()
|
||||||
|
.map_err(|e| {
|
||||||
|
error!("Could not get power status: {e:?}");
|
||||||
|
e
|
||||||
|
})
|
||||||
|
.unwrap_or_default();
|
||||||
|
let profile: PlatformProfile = self.platform.get_platform_profile()?.into();
|
||||||
|
|
||||||
|
if enable {
|
||||||
|
// Clone to reduce blocking
|
||||||
|
let tuning = self
|
||||||
|
.config
|
||||||
|
.lock()
|
||||||
|
.await
|
||||||
|
.select_tunings(power_plugged == 1, profile)
|
||||||
|
.clone();
|
||||||
|
|
||||||
|
for attr in self.attributes.attributes() {
|
||||||
|
let name: FirmwareAttribute = attr.name().into();
|
||||||
|
if name.is_ppt() {
|
||||||
|
// reset stored value
|
||||||
|
if let Some(tune) = self
|
||||||
|
.config
|
||||||
|
.lock()
|
||||||
|
.await
|
||||||
|
.select_tunings(power_plugged == 1, profile)
|
||||||
|
.group
|
||||||
|
.get_mut(&name)
|
||||||
|
{
|
||||||
|
let value = tuning
|
||||||
|
.group
|
||||||
|
.get(&name)
|
||||||
|
.map(|v| AttrValue::Integer(*v))
|
||||||
|
.unwrap_or_else(|| attr.default_value().clone());
|
||||||
|
// restore default
|
||||||
|
attr.set_current_value(&value)?;
|
||||||
|
if let AttrValue::Integer(i) = value {
|
||||||
|
*tune = i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// finally, reapply the profile to ensure acpi does the thingy
|
||||||
|
self.platform.set_platform_profile(profile.into())?;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.config
|
||||||
|
.lock()
|
||||||
|
.await
|
||||||
|
.select_tunings(power_plugged == 1, profile)
|
||||||
|
.enabled = enable;
|
||||||
|
self.config.lock().await.write();
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl crate::ZbusRun for CtrlPlatform {
|
impl crate::ZbusRun for CtrlPlatform {
|
||||||
@@ -576,6 +676,7 @@ impl CtrlTask for CtrlPlatform {
|
|||||||
let platform1 = self.clone();
|
let platform1 = self.clone();
|
||||||
let platform2 = self.clone();
|
let platform2 = self.clone();
|
||||||
let platform3 = self.clone();
|
let platform3 = self.clone();
|
||||||
|
let signal_ctxt_copy = signal_ctxt.clone();
|
||||||
self.create_sys_event_tasks(
|
self.create_sys_event_tasks(
|
||||||
move |sleeping| {
|
move |sleeping| {
|
||||||
let platform1 = platform1.clone();
|
let platform1 = platform1.clone();
|
||||||
@@ -643,6 +744,7 @@ impl CtrlTask for CtrlPlatform {
|
|||||||
},
|
},
|
||||||
move |power_plugged| {
|
move |power_plugged| {
|
||||||
let platform3 = platform3.clone();
|
let platform3 = platform3.clone();
|
||||||
|
let signal_ctxt_copy = signal_ctxt.clone();
|
||||||
// power change
|
// power change
|
||||||
async move {
|
async move {
|
||||||
if platform3.platform.has_platform_profile() {
|
if platform3.platform.has_platform_profile() {
|
||||||
@@ -665,6 +767,7 @@ impl CtrlTask for CtrlPlatform {
|
|||||||
error!("Platform: get_platform_profile error: {e}");
|
error!("Platform: get_platform_profile error: {e}");
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
// TODO: manage this better, shouldn't need to create every time
|
||||||
let attrs = FirmwareAttributes::new();
|
let attrs = FirmwareAttributes::new();
|
||||||
set_config_or_default(
|
set_config_or_default(
|
||||||
&attrs,
|
&attrs,
|
||||||
@@ -673,6 +776,10 @@ impl CtrlTask for CtrlPlatform {
|
|||||||
profile
|
profile
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
platform3
|
||||||
|
.enable_ppt_group_changed(&signal_ctxt_copy)
|
||||||
|
.await
|
||||||
|
.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -681,7 +788,7 @@ impl CtrlTask for CtrlPlatform {
|
|||||||
|
|
||||||
// This spawns a new task for every item.
|
// This spawns a new task for every item.
|
||||||
// TODO: find a better way to manage this
|
// TODO: find a better way to manage this
|
||||||
self.watch_charge_control_end_threshold(signal_ctxt.clone())
|
self.watch_charge_control_end_threshold(signal_ctxt_copy.clone())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let watch_platform_profile = self.platform.monitor_platform_profile()?;
|
let watch_platform_profile = self.platform.monitor_platform_profile()?;
|
||||||
@@ -708,7 +815,8 @@ impl CtrlTask for CtrlPlatform {
|
|||||||
let change_epp = ctrl.config.lock().await.platform_profile_linked_epp;
|
let change_epp = ctrl.config.lock().await.platform_profile_linked_epp;
|
||||||
let epp = ctrl.get_config_epp_for_throttle(profile).await;
|
let epp = ctrl.get_config_epp_for_throttle(profile).await;
|
||||||
ctrl.check_and_set_epp(epp, change_epp);
|
ctrl.check_and_set_epp(epp, change_epp);
|
||||||
ctrl.platform_profile_changed(&signal_ctxt).await.ok();
|
ctrl.platform_profile_changed(&signal_ctxt_copy).await.ok();
|
||||||
|
ctrl.enable_ppt_group_changed(&signal_ctxt_copy).await.ok();
|
||||||
let power_plugged = ctrl
|
let power_plugged = ctrl
|
||||||
.power
|
.power
|
||||||
.get_online()
|
.get_online()
|
||||||
|
|||||||
+15
-2
@@ -2,7 +2,6 @@ use std::env;
|
|||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use ::zbus::export::futures_util::lock::Mutex;
|
|
||||||
use ::zbus::Connection;
|
use ::zbus::Connection;
|
||||||
use asusd::asus_armoury::start_attributes_zbus;
|
use asusd::asus_armoury::start_attributes_zbus;
|
||||||
use asusd::aura_manager::DeviceManager;
|
use asusd::aura_manager::DeviceManager;
|
||||||
@@ -11,7 +10,9 @@ use asusd::ctrl_fancurves::CtrlFanCurveZbus;
|
|||||||
use asusd::ctrl_platform::CtrlPlatform;
|
use asusd::ctrl_platform::CtrlPlatform;
|
||||||
use asusd::{print_board_info, start_tasks, CtrlTask, DBUS_NAME};
|
use asusd::{print_board_info, start_tasks, CtrlTask, DBUS_NAME};
|
||||||
use config_traits::{StdConfig, StdConfigLoad1};
|
use config_traits::{StdConfig, StdConfigLoad1};
|
||||||
|
use futures_util::lock::Mutex;
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
|
use rog_platform::asus_armoury::FirmwareAttributes;
|
||||||
use rog_platform::platform::RogPlatform;
|
use rog_platform::platform::RogPlatform;
|
||||||
use rog_platform::power::AsusPower;
|
use rog_platform::power::AsusPower;
|
||||||
use zbus::fdo::ObjectManager;
|
use zbus::fdo::ObjectManager;
|
||||||
@@ -69,7 +70,15 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
// supported.add_to_server(&mut connection).await;
|
// supported.add_to_server(&mut connection).await;
|
||||||
let platform = RogPlatform::new()?; // TODO: maybe needs async mutex?
|
let platform = RogPlatform::new()?; // TODO: maybe needs async mutex?
|
||||||
let power = AsusPower::new()?; // TODO: maybe needs async mutex?
|
let power = AsusPower::new()?; // TODO: maybe needs async mutex?
|
||||||
start_attributes_zbus(&server, platform, power, config.clone()).await?;
|
let attributes = FirmwareAttributes::new();
|
||||||
|
start_attributes_zbus(
|
||||||
|
&server,
|
||||||
|
platform.clone(),
|
||||||
|
power.clone(),
|
||||||
|
attributes.clone(),
|
||||||
|
config.clone()
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
match CtrlFanCurveZbus::new() {
|
match CtrlFanCurveZbus::new() {
|
||||||
Ok(ctrl) => {
|
Ok(ctrl) => {
|
||||||
@@ -82,6 +91,9 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match CtrlPlatform::new(
|
match CtrlPlatform::new(
|
||||||
|
platform,
|
||||||
|
power,
|
||||||
|
attributes,
|
||||||
config.clone(),
|
config.clone(),
|
||||||
&cfg_path,
|
&cfg_path,
|
||||||
CtrlPlatform::signal_context(&server)?
|
CtrlPlatform::signal_context(&server)?
|
||||||
@@ -100,6 +112,7 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
// Request dbus name after finishing initalizing all functions
|
// Request dbus name after finishing initalizing all functions
|
||||||
server.request_name(DBUS_NAME).await?;
|
server.request_name(DBUS_NAME).await?;
|
||||||
|
|
||||||
|
info!("Startup success, begining dbus server loop");
|
||||||
loop {
|
loop {
|
||||||
// This is just a blocker to idle and ensure the reator reacts
|
// This is just a blocker to idle and ensure the reator reacts
|
||||||
server.executor().tick().await;
|
server.executor().tick().await;
|
||||||
|
|||||||
+1
-1
@@ -67,7 +67,7 @@ macro_rules! task_watch_item {
|
|||||||
&self,
|
&self,
|
||||||
signal_ctxt: SignalEmitter<'static>,
|
signal_ctxt: SignalEmitter<'static>,
|
||||||
) -> Result<(), RogError> {
|
) -> Result<(), RogError> {
|
||||||
use zbus::export::futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
|
|
||||||
let ctrl = self.clone();
|
let ctrl = self.clone();
|
||||||
concat_idents::concat_idents!(watch_fn = monitor_, $name {
|
concat_idents::concat_idents!(watch_fn = monitor_, $name {
|
||||||
|
|||||||
+2
-1
@@ -6,7 +6,7 @@ After=nvidia-powerd.service systemd-udevd.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Environment=IS_SERVICE=1
|
Environment=IS_SERVICE=1
|
||||||
Environment=RUST_LOG="info"
|
Environment=RUST_LOG="debug"
|
||||||
# required to prevent init issues with hid_asus and MCU
|
# required to prevent init issues with hid_asus and MCU
|
||||||
ExecStartPre=/bin/sleep 1
|
ExecStartPre=/bin/sleep 1
|
||||||
ExecStart=/usr/bin/asusd
|
ExecStart=/usr/bin/asusd
|
||||||
@@ -16,3 +16,4 @@ Type=dbus
|
|||||||
BusName=xyz.ljones.Asusd
|
BusName=xyz.ljones.Asusd
|
||||||
SELinuxContext=system_u:system_r:unconfined_t:s0
|
SELinuxContext=system_u:system_r:unconfined_t:s0
|
||||||
#SELinuxContext=system_u:object_r:modules_object_t:s0
|
#SELinuxContext=system_u:object_r:modules_object_t:s0
|
||||||
|
TimeoutSec=10
|
||||||
|
|||||||
@@ -35,6 +35,15 @@
|
|||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
device_name: "FA617NS",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "fa617ns",
|
||||||
|
basic_modes: [Static, Breathe, Pulse],
|
||||||
|
basic_zones: [],
|
||||||
|
advanced_type: None,
|
||||||
|
power_zones: [Keyboard],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
device_name: "FX505",
|
device_name: "FX505",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
@@ -80,6 +89,15 @@
|
|||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
device_name: "FX617X",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "fa506i",
|
||||||
|
basic_modes: [Static, Breathe, Pulse],
|
||||||
|
basic_zones: [],
|
||||||
|
advanced_type: None,
|
||||||
|
power_zones: [Keyboard],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
device_name: "FX705D",
|
device_name: "FX705D",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
@@ -134,12 +152,21 @@
|
|||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
device_name: "G513RW",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "g513i-per-key",
|
||||||
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
|
basic_zones: [],
|
||||||
|
advanced_type: PerKey,
|
||||||
|
power_zones: [Keyboard, Lightbar],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
device_name: "G513RC",
|
device_name: "G513RC",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i",
|
layout_name: "g513i",
|
||||||
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
@@ -548,15 +575,6 @@
|
|||||||
advanced_type: Zoned([SingleZone]),
|
advanced_type: Zoned([SingleZone]),
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
),
|
),
|
||||||
(
|
|
||||||
device_name: "GA605W",
|
|
||||||
product_id: "",
|
|
||||||
layout_name: "ga401q",
|
|
||||||
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
|
||||||
basic_zones: [],
|
|
||||||
advanced_type: Zoned([SingleZone]),
|
|
||||||
power_zones: [Keyboard],
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
device_name: "GL503",
|
device_name: "GL503",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ zbus.workspace = true
|
|||||||
dirs.workspace = true
|
dirs.workspace = true
|
||||||
notify-rust.workspace = true
|
notify-rust.workspace = true
|
||||||
concat-idents.workspace = true
|
concat-idents.workspace = true
|
||||||
|
futures-util.workspace = true
|
||||||
|
|
||||||
versions.workspace = true
|
versions.workspace = true
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ use slint_build::CompilerConfiguration;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// write_locales();
|
// write_locales();
|
||||||
|
|
||||||
let root = env!("CARGO_MANIFEST_DIR");
|
let root = env!("CARGO_MANIFEST_DIR");
|
||||||
let mut main = PathBuf::from_str(root).unwrap();
|
let mut main = PathBuf::from_str(root).unwrap();
|
||||||
main.push("ui/main_window.slint");
|
main.push("ui/main_window.slint");
|
||||||
@@ -14,7 +13,6 @@ fn main() {
|
|||||||
include.push("ui");
|
include.push("ui");
|
||||||
|
|
||||||
slint_build::print_rustc_flags().unwrap();
|
slint_build::print_rustc_flags().unwrap();
|
||||||
// slint_build::compile("ui/main_window.slint").unwrap();
|
|
||||||
slint_build::compile_with_config(
|
slint_build::compile_with_config(
|
||||||
main,
|
main,
|
||||||
CompilerConfiguration::new()
|
CompilerConfiguration::new()
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=1.0
|
Version=1.0
|
||||||
Type=Application
|
Type=Application
|
||||||
|
|
||||||
Name=ROG Control Center
|
Name=ROG Control Center
|
||||||
Comment=Make your ASUS ROG Laptop go Brrrrr!
|
Comment=Make your ASUS ROG Laptop go Brrrrr!
|
||||||
Categories=Settings
|
Categories=Settings
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::env::args;
|
use std::env::{self, args};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
@@ -32,6 +32,12 @@ async fn main() -> Result<()> {
|
|||||||
.format_timestamp(None)
|
.format_timestamp(None)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
|
// If we're running under gamescope we have to set WAYLAND_DISPLAY for winit to
|
||||||
|
// use
|
||||||
|
if let Ok(gamescope) = env::var("GAMESCOPE_WAYLAND_DISPLAY") {
|
||||||
|
env::set_var("WAYLAND_DISPLAY", gamescope);
|
||||||
|
}
|
||||||
|
|
||||||
// Try to open a proxy and check for app state first
|
// Try to open a proxy and check for app state first
|
||||||
{
|
{
|
||||||
let user_con = zbus::blocking::Connection::session()?;
|
let user_con = zbus::blocking::Connection::session()?;
|
||||||
@@ -49,7 +55,12 @@ async fn main() -> Result<()> {
|
|||||||
let self_version = env!("CARGO_PKG_VERSION");
|
let self_version = env!("CARGO_PKG_VERSION");
|
||||||
let zbus_con = zbus::blocking::Connection::system()?;
|
let zbus_con = zbus::blocking::Connection::system()?;
|
||||||
let platform_proxy = rog_dbus::zbus_platform::PlatformProxyBlocking::new(&zbus_con)?;
|
let platform_proxy = rog_dbus::zbus_platform::PlatformProxyBlocking::new(&zbus_con)?;
|
||||||
let asusd_version = platform_proxy.version().unwrap();
|
let asusd_version = platform_proxy
|
||||||
|
.version()
|
||||||
|
.map_err(|e| {
|
||||||
|
println!("Could not get asusd version: {e:?}\nIs asusd.service running?");
|
||||||
|
})
|
||||||
|
.unwrap();
|
||||||
if asusd_version != self_version {
|
if asusd_version != self_version {
|
||||||
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@@ -79,7 +90,7 @@ async fn main() -> Result<()> {
|
|||||||
let board_name = dmi.board_name;
|
let board_name = dmi.board_name;
|
||||||
let prod_family = dmi.product_family;
|
let prod_family = dmi.product_family;
|
||||||
info!("Running on {board_name}, product: {prod_family}");
|
info!("Running on {board_name}, product: {prod_family}");
|
||||||
let is_rog_ally = prod_family == "RC71L";
|
let is_rog_ally = prod_family == "RC71L" || prod_family == "RC72L";
|
||||||
|
|
||||||
let args: Vec<String> = args().skip(1).collect();
|
let args: Vec<String> = args().skip(1).collect();
|
||||||
|
|
||||||
@@ -115,7 +126,9 @@ async fn main() -> Result<()> {
|
|||||||
config.enable_tray_icon = false;
|
config.enable_tray_icon = false;
|
||||||
config.run_in_background = false;
|
config.run_in_background = false;
|
||||||
config.startup_in_background = false;
|
config.startup_in_background = false;
|
||||||
|
config.start_fullscreen = true;
|
||||||
}
|
}
|
||||||
|
config.write();
|
||||||
|
|
||||||
let enable_tray_icon = config.enable_tray_icon;
|
let enable_tray_icon = config.enable_tray_icon;
|
||||||
let startup_in_background = config.startup_in_background;
|
let startup_in_background = config.startup_in_background;
|
||||||
@@ -131,8 +144,8 @@ async fn main() -> Result<()> {
|
|||||||
// i_slint_backend_selector::with_platform(|_| Ok(())).unwrap();
|
// i_slint_backend_selector::with_platform(|_| Ok(())).unwrap();
|
||||||
|
|
||||||
if !startup_in_background {
|
if !startup_in_background {
|
||||||
if let Ok(mut lock) = app_state.lock() {
|
if let Ok(mut app_state) = app_state.lock() {
|
||||||
*lock = AppState::MainWindowShouldOpen;
|
*app_state = AppState::MainWindowShouldOpen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,15 +162,15 @@ async fn main() -> Result<()> {
|
|||||||
let mut state = AppState::StartingUp;
|
let mut state = AppState::StartingUp;
|
||||||
loop {
|
loop {
|
||||||
// save as a var, don't hold the lock the entire time or deadlocks happen
|
// save as a var, don't hold the lock the entire time or deadlocks happen
|
||||||
if let Ok(lock) = app_state.lock() {
|
if let Ok(app_state) = app_state.lock() {
|
||||||
state = *lock;
|
state = *app_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This sleep is required to give the event loop time to react
|
// This sleep is required to give the event loop time to react
|
||||||
sleep(Duration::from_millis(300));
|
sleep(Duration::from_millis(300));
|
||||||
if state == AppState::MainWindowShouldOpen {
|
if state == AppState::MainWindowShouldOpen {
|
||||||
if let Ok(mut lock) = app_state.lock() {
|
if let Ok(mut app_state) = app_state.lock() {
|
||||||
*lock = AppState::MainWindowOpen;
|
*app_state = AppState::MainWindowOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
let config_copy = config.clone();
|
let config_copy = config.clone();
|
||||||
@@ -169,20 +182,39 @@ async fn main() -> Result<()> {
|
|||||||
if let Some(ui) = ui.as_mut() {
|
if let Some(ui) = ui.as_mut() {
|
||||||
ui.window().show().unwrap();
|
ui.window().show().unwrap();
|
||||||
ui.window().on_close_requested(move || {
|
ui.window().on_close_requested(move || {
|
||||||
if let Ok(mut lock) = app_state_copy.lock() {
|
if let Ok(mut app_state) = app_state_copy.lock() {
|
||||||
*lock = AppState::MainWindowClosed;
|
*app_state = AppState::MainWindowClosed;
|
||||||
}
|
}
|
||||||
slint::CloseRequestResponse::HideWindow
|
slint::CloseRequestResponse::HideWindow
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
let config_copy_2 = config_copy.clone();
|
||||||
let newui = setup_window(config_copy);
|
let newui = setup_window(config_copy);
|
||||||
newui.window().show().unwrap();
|
|
||||||
newui.window().on_close_requested(move || {
|
newui.window().on_close_requested(move || {
|
||||||
if let Ok(mut lock) = app_state_copy.lock() {
|
if let Ok(mut app_state) = app_state_copy.lock() {
|
||||||
*lock = AppState::MainWindowClosed;
|
*app_state = AppState::MainWindowClosed;
|
||||||
}
|
}
|
||||||
slint::CloseRequestResponse::HideWindow
|
slint::CloseRequestResponse::HideWindow
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let ui_copy = newui.as_weak();
|
||||||
|
newui
|
||||||
|
.window()
|
||||||
|
.set_rendering_notifier(move |s, _| {
|
||||||
|
if let slint::RenderingState::RenderingSetup = s {
|
||||||
|
let config = config_copy_2.clone();
|
||||||
|
ui_copy
|
||||||
|
.upgrade_in_event_loop(move |w| {
|
||||||
|
let fullscreen =
|
||||||
|
config.lock().is_ok_and(|c| c.start_fullscreen);
|
||||||
|
if fullscreen && !w.window().is_fullscreen() {
|
||||||
|
w.window().set_fullscreen(fullscreen);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.ok();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.ok();
|
||||||
ui.replace(newui);
|
ui.replace(newui);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -192,8 +224,8 @@ async fn main() -> Result<()> {
|
|||||||
slint::quit_event_loop().unwrap();
|
slint::quit_event_loop().unwrap();
|
||||||
exit(0);
|
exit(0);
|
||||||
} else if state != AppState::MainWindowOpen {
|
} else if state != AppState::MainWindowOpen {
|
||||||
if let Ok(lock) = config.lock() {
|
if let Ok(config) = config.lock() {
|
||||||
if !lock.run_in_background {
|
if !config.run_in_background {
|
||||||
slint::quit_event_loop().unwrap();
|
slint::quit_event_loop().unwrap();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,15 @@ pub fn init_tray(_supported_properties: Vec<Properties>, config: Arc<Mutex<Confi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => warn!("Couldn't get mode form supergfxd: {e:?}")
|
Err(e) => match e {
|
||||||
|
zbus::Error::MethodError(_, _, message) => {
|
||||||
|
warn!(
|
||||||
|
"Couldn't get mode from supergfxd: {message:?}, the supergfxd service \
|
||||||
|
may not be running or installed"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
_ => warn!("Couldn't get mode from supergfxd: {e:?}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Started ROGTray");
|
info!("Started ROGTray");
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ pub mod setup_system;
|
|||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
use config_traits::StdConfig;
|
use config_traits::StdConfig;
|
||||||
|
use log::warn;
|
||||||
use rog_dbus::list_iface_blocking;
|
use rog_dbus::list_iface_blocking;
|
||||||
use slint::{ComponentHandle, PhysicalSize, SharedString, Weak};
|
use slint::{ComponentHandle, SharedString, Weak};
|
||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::ui::setup_anime::setup_anime_page;
|
use crate::ui::setup_anime::setup_anime_page;
|
||||||
@@ -82,16 +83,11 @@ pub fn show_toast(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn setup_window(config: Arc<Mutex<Config>>) -> MainWindow {
|
pub fn setup_window(config: Arc<Mutex<Config>>) -> MainWindow {
|
||||||
|
slint::set_xdg_app_id("rog-control-center")
|
||||||
|
.map_err(|e| warn!("Couldn't set application ID: {e:?}"))
|
||||||
|
.ok();
|
||||||
let ui = MainWindow::new().unwrap();
|
let ui = MainWindow::new().unwrap();
|
||||||
if let Ok(lock) = config.try_lock() {
|
ui.window().show().unwrap();
|
||||||
let fullscreen = lock.start_fullscreen;
|
|
||||||
let width = lock.fullscreen_width;
|
|
||||||
let height = lock.fullscreen_height;
|
|
||||||
if fullscreen {
|
|
||||||
ui.window().set_fullscreen(fullscreen);
|
|
||||||
ui.window().set_size(PhysicalSize { width, height });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let available = list_iface_blocking().unwrap_or_default();
|
let available = list_iface_blocking().unwrap_or_default();
|
||||||
ui.set_sidebar_items_avilable(
|
ui.set_sidebar_items_avilable(
|
||||||
@@ -125,6 +121,7 @@ pub fn setup_window(config: Arc<Mutex<Config>>) -> MainWindow {
|
|||||||
if available.contains(&"xyz.ljones.FanCurves".to_string()) {
|
if available.contains(&"xyz.ljones.FanCurves".to_string()) {
|
||||||
setup_fan_curve_page(&ui, config);
|
setup_fan_curve_page(&ui, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui
|
ui
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,18 +16,20 @@ use crate::{set_ui_callbacks, set_ui_props_async, AttrMinMax, MainWindow, System
|
|||||||
const MINMAX: AttrMinMax = AttrMinMax {
|
const MINMAX: AttrMinMax = AttrMinMax {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 0,
|
max: 0,
|
||||||
val: -1.0
|
current: -1.0
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
|
pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
|
||||||
let conn = zbus::blocking::Connection::system().unwrap();
|
let conn = zbus::blocking::Connection::system().unwrap();
|
||||||
let platform = PlatformProxyBlocking::new(&conn).unwrap();
|
let platform = PlatformProxyBlocking::builder(&conn).build().unwrap();
|
||||||
// let armoury_attrs =
|
// let armoury_attrs =
|
||||||
// find_iface::<AsusArmouryProxyBlocking>("xyz.ljones.AsusArmoury").unwrap();
|
// find_iface::<AsusArmouryProxyBlocking>("xyz.ljones.AsusArmoury").unwrap();
|
||||||
|
|
||||||
// Null everything before the setup step
|
// Null everything before the setup step
|
||||||
ui.global::<SystemPageData>()
|
ui.global::<SystemPageData>()
|
||||||
.set_charge_control_end_threshold(-1.0);
|
.set_charge_control_end_threshold(-1.0);
|
||||||
|
ui.global::<SystemPageData>()
|
||||||
|
.set_charge_control_enabled(false);
|
||||||
ui.global::<SystemPageData>().set_platform_profile(-1);
|
ui.global::<SystemPageData>().set_platform_profile(-1);
|
||||||
ui.global::<SystemPageData>().set_panel_overdrive(-1);
|
ui.global::<SystemPageData>().set_panel_overdrive(-1);
|
||||||
ui.global::<SystemPageData>().set_boot_sound(-1);
|
ui.global::<SystemPageData>().set_boot_sound(-1);
|
||||||
@@ -40,12 +42,17 @@ pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
|
|||||||
ui.global::<SystemPageData>().set_ppt_platform_sppt(MINMAX);
|
ui.global::<SystemPageData>().set_ppt_platform_sppt(MINMAX);
|
||||||
ui.global::<SystemPageData>().set_nv_dynamic_boost(MINMAX);
|
ui.global::<SystemPageData>().set_nv_dynamic_boost(MINMAX);
|
||||||
ui.global::<SystemPageData>().set_nv_temp_target(MINMAX);
|
ui.global::<SystemPageData>().set_nv_temp_target(MINMAX);
|
||||||
|
ui.global::<SystemPageData>().set_ppt_enabled(false);
|
||||||
|
ui.global::<SystemPageData>()
|
||||||
|
.set_ppt_enabled_available(false);
|
||||||
|
|
||||||
let sys_props = platform.supported_properties().unwrap();
|
let sys_props = platform.supported_properties().unwrap();
|
||||||
log::debug!("Available system properties: {sys_props:?}");
|
log::debug!("Available system properties: {:?}", &sys_props);
|
||||||
if sys_props.contains(&Properties::ChargeControlEndThreshold) {
|
if sys_props.contains(&Properties::ChargeControlEndThreshold) {
|
||||||
ui.global::<SystemPageData>()
|
ui.global::<SystemPageData>()
|
||||||
.set_charge_control_end_threshold(60.0);
|
.set_charge_control_end_threshold(60.0);
|
||||||
|
ui.global::<SystemPageData>()
|
||||||
|
.set_charge_control_enabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,13 +100,13 @@ macro_rules! init_minmax_property {
|
|||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let min = proxy_copy.min_value().await.unwrap();
|
let min = proxy_copy.min_value().await.unwrap();
|
||||||
let max = proxy_copy.max_value().await.unwrap();
|
let max = proxy_copy.max_value().await.unwrap();
|
||||||
let val = proxy_copy.current_value().await.unwrap() as f32;
|
let current = proxy_copy.current_value().await.unwrap() as f32;
|
||||||
handle_copy
|
handle_copy
|
||||||
.upgrade_in_event_loop(move |handle| {
|
.upgrade_in_event_loop(move |handle| {
|
||||||
concat_idents!(setter = set_, $property {
|
concat_idents!(setter = set_, $property {
|
||||||
handle
|
handle
|
||||||
.global::<SystemPageData>()
|
.global::<SystemPageData>()
|
||||||
.setter(AttrMinMax { min, max, val });
|
.setter(AttrMinMax { min, max, current });
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
@@ -156,7 +163,7 @@ macro_rules! setup_external {
|
|||||||
concat_idents!(setter = set_, $property {
|
concat_idents!(setter = set_, $property {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let mut x = proxy_copy.receive_current_value_changed().await;
|
let mut x = proxy_copy.receive_current_value_changed().await;
|
||||||
use zbus::export::futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
while let Some(e) = x.next().await {
|
while let Some(e) = x.next().await {
|
||||||
if let Ok(out) = e.get().await {
|
if let Ok(out) = e.get().await {
|
||||||
handle_copy
|
handle_copy
|
||||||
@@ -174,49 +181,59 @@ macro_rules! setup_external {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For handling external value changes
|
// For handling external value changes
|
||||||
macro_rules! setup_minmax_external {
|
macro_rules! setup_value_watch {
|
||||||
($property:ident, $handle:expr, $attr:expr, $platform:expr) => {
|
($property:ident, $handle:expr, $proxy:expr, $value_type:ident $($conv: tt)*) => {
|
||||||
let handle_copy = $handle.as_weak();
|
let handle_copy = $handle.as_weak();
|
||||||
let proxy_copy = $attr.clone();
|
let proxy_copy = $proxy.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let mut x = proxy_copy.receive_current_value_changed().await;
|
let mut x = concat_idents!(recv = receive_, $value_type, _value_changed {
|
||||||
use zbus::export::futures_util::StreamExt;
|
proxy_copy.recv().await
|
||||||
|
});
|
||||||
|
use futures_util::StreamExt;
|
||||||
while let Some(e) = x.next().await {
|
while let Some(e) = x.next().await {
|
||||||
if let Ok(out) = e.get().await {
|
if let Ok(out) = e.get().await {
|
||||||
concat_idents!(getter = get_, $property {
|
concat_idents!(getter = get_, $property {
|
||||||
handle_copy
|
handle_copy
|
||||||
.upgrade_in_event_loop(move |handle| {
|
.upgrade_in_event_loop(move |handle| {
|
||||||
let mut tmp: AttrMinMax =
|
let mut tmp: AttrMinMax =
|
||||||
handle.global::<SystemPageData>().getter();
|
handle.global::<SystemPageData>().getter();
|
||||||
tmp.val = out as f32;
|
tmp.$value_type = out $($conv)*;
|
||||||
concat_idents!(setter = set_, $property {
|
concat_idents!(setter = set_, $property {
|
||||||
handle.global::<SystemPageData>().setter(tmp);
|
handle.global::<SystemPageData>().setter(tmp);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! setup_minmax_external {
|
||||||
|
($property:ident, $handle:expr, $attr:expr, $platform:expr) => {
|
||||||
|
setup_value_watch!($property, $handle, $attr, current as f32);
|
||||||
|
setup_value_watch!($property, $handle, $attr, min);
|
||||||
|
setup_value_watch!($property, $handle, $attr, max);
|
||||||
|
|
||||||
let handle_copy = $handle.as_weak();
|
let handle_copy = $handle.as_weak();
|
||||||
let proxy_copy = $attr.clone();
|
let proxy_copy = $attr.clone();
|
||||||
let platform_proxy_copy = $platform.clone();
|
let platform_proxy_copy = $platform.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let mut x = platform_proxy_copy.receive_platform_profile_changed().await;
|
let mut x = platform_proxy_copy.receive_platform_profile_changed().await;
|
||||||
use zbus::export::futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
while let Some(e) = x.next().await {
|
while let Some(e) = x.next().await {
|
||||||
if let Ok(_) = e.get().await {
|
if let Ok(_) = e.get().await {
|
||||||
debug!("receive_platform_profile_changed, getting new {}", stringify!(attr));
|
debug!("receive_platform_profile_changed, getting new {}", stringify!(attr));
|
||||||
let min = proxy_copy.min_value().await.unwrap();
|
let min = proxy_copy.min_value().await.unwrap();
|
||||||
let max = proxy_copy.max_value().await.unwrap();
|
let max = proxy_copy.max_value().await.unwrap();
|
||||||
let val = proxy_copy.current_value().await.unwrap() as f32;
|
let current = proxy_copy.current_value().await.unwrap() as f32;
|
||||||
handle_copy
|
handle_copy
|
||||||
.upgrade_in_event_loop(move |handle| {
|
.upgrade_in_event_loop(move |handle| {
|
||||||
concat_idents!(setter = set_, $property {
|
concat_idents!(setter = set_, $property {
|
||||||
handle
|
handle
|
||||||
.global::<SystemPageData>()
|
.global::<SystemPageData>()
|
||||||
.setter(AttrMinMax { min, max, val });
|
.setter(AttrMinMax { min, max, current });
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
@@ -249,7 +266,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
|||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
// Create the connections/proxies here to prevent future delays in process
|
// Create the connections/proxies here to prevent future delays in process
|
||||||
let conn = zbus::Connection::system().await.unwrap();
|
let conn = zbus::Connection::system().await.unwrap();
|
||||||
let platform = PlatformProxy::new(&conn).await.unwrap();
|
let platform = PlatformProxy::builder(&conn).build().await.unwrap();
|
||||||
|
|
||||||
set_ui_props_async!(
|
set_ui_props_async!(
|
||||||
handle,
|
handle,
|
||||||
@@ -288,9 +305,18 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
|||||||
change_platform_profile_on_ac
|
change_platform_profile_on_ac
|
||||||
);
|
);
|
||||||
|
|
||||||
|
set_ui_props_async!(handle, platform, SystemPageData, enable_ppt_group);
|
||||||
|
|
||||||
let platform_copy = platform.clone();
|
let platform_copy = platform.clone();
|
||||||
handle
|
handle
|
||||||
.upgrade_in_event_loop(move |handle| {
|
.upgrade_in_event_loop(move |handle| {
|
||||||
|
set_ui_callbacks!(handle,
|
||||||
|
SystemPageData(as bool),
|
||||||
|
platform_copy.enable_ppt_group(as bool),
|
||||||
|
"Applied PPT group settings {}",
|
||||||
|
"Setting PPT group settings failed"
|
||||||
|
);
|
||||||
|
|
||||||
set_ui_callbacks!(handle,
|
set_ui_callbacks!(handle,
|
||||||
SystemPageData(as f32),
|
SystemPageData(as f32),
|
||||||
platform_copy.charge_control_end_threshold(as u8),
|
platform_copy.charge_control_end_threshold(as u8),
|
||||||
@@ -381,6 +407,36 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
|||||||
FirmwareAttribute::ApuMem => {}
|
FirmwareAttribute::ApuMem => {}
|
||||||
FirmwareAttribute::CoresPerformance => {}
|
FirmwareAttribute::CoresPerformance => {}
|
||||||
FirmwareAttribute::CoresEfficiency => {}
|
FirmwareAttribute::CoresEfficiency => {}
|
||||||
|
FirmwareAttribute::PptEnabled => {
|
||||||
|
init_property!(ppt_enabled, handle, value, bool);
|
||||||
|
setup_callback!(ppt_enabled, handle, attr, bool);
|
||||||
|
let handle_copy = handle.as_weak();
|
||||||
|
let proxy_copy = attr.clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let mut x = proxy_copy.receive_current_value_changed().await;
|
||||||
|
use futures_util::StreamExt;
|
||||||
|
while let Some(e) = x.next().await {
|
||||||
|
if let Ok(out) = e.get().await {
|
||||||
|
handle_copy
|
||||||
|
.upgrade_in_event_loop(move |handle| {
|
||||||
|
handle
|
||||||
|
.global::<SystemPageData>()
|
||||||
|
.set_enable_ppt_group(out == 1);
|
||||||
|
handle
|
||||||
|
.global::<SystemPageData>()
|
||||||
|
.set_ppt_enabled(out == 1);
|
||||||
|
})
|
||||||
|
.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
handle
|
||||||
|
.global::<SystemPageData>()
|
||||||
|
.set_ppt_enabled_available(true);
|
||||||
|
handle
|
||||||
|
.global::<SystemPageData>()
|
||||||
|
.set_enable_ppt_group(value == 1);
|
||||||
|
}
|
||||||
FirmwareAttribute::PptPl1Spl => {
|
FirmwareAttribute::PptPl1Spl => {
|
||||||
init_minmax_property!(ppt_pl1_spl, handle, attr);
|
init_minmax_property!(ppt_pl1_spl, handle, attr);
|
||||||
setup_callback!(ppt_pl1_spl, handle, attr, i32);
|
setup_callback!(ppt_pl1_spl, handle, attr, i32);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2025-01-19 10:35+0000\n"
|
"POT-Creation-Date: 2025-02-10 09:04+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@@ -12,233 +12,238 @@ msgstr ""
|
|||||||
"Language: \n"
|
"Language: \n"
|
||||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:19
|
#: rog-control-center/ui/pages/system.slint:20
|
||||||
msgctxt "SystemPageData"
|
msgctxt "SystemPageData"
|
||||||
msgid "Balanced"
|
msgid "Balanced"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:19 rog-control-center/ui/pages/system.slint:23
|
#: rog-control-center/ui/pages/system.slint:20 rog-control-center/ui/pages/system.slint:24
|
||||||
msgctxt "SystemPageData"
|
msgctxt "SystemPageData"
|
||||||
msgid "Performance"
|
msgid "Performance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:19
|
#: rog-control-center/ui/pages/system.slint:20
|
||||||
msgctxt "SystemPageData"
|
msgctxt "SystemPageData"
|
||||||
msgid "Quiet"
|
msgid "Quiet"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:22
|
#: rog-control-center/ui/pages/system.slint:23
|
||||||
msgctxt "SystemPageData"
|
msgctxt "SystemPageData"
|
||||||
msgid "Default"
|
msgid "Default"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:24
|
#: rog-control-center/ui/pages/system.slint:25
|
||||||
msgctxt "SystemPageData"
|
msgctxt "SystemPageData"
|
||||||
msgid "BalancePerformance"
|
msgid "BalancePerformance"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:25
|
#: rog-control-center/ui/pages/system.slint:26
|
||||||
msgctxt "SystemPageData"
|
msgctxt "SystemPageData"
|
||||||
msgid "BalancePower"
|
msgid "BalancePower"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:26
|
#: rog-control-center/ui/pages/system.slint:27
|
||||||
msgctxt "SystemPageData"
|
msgctxt "SystemPageData"
|
||||||
msgid "Power"
|
msgid "Power"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:139
|
#: rog-control-center/ui/pages/system.slint:147
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Power settings"
|
msgid "Power settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:144
|
#: rog-control-center/ui/pages/system.slint:152
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Charge limit"
|
msgid "Charge limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:158
|
#: rog-control-center/ui/pages/system.slint:167
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Platform Profile"
|
msgid "Platform Profile"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:168
|
#: rog-control-center/ui/pages/system.slint:177
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Advanced"
|
msgid "Advanced"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:186
|
#: rog-control-center/ui/pages/system.slint:195
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Armoury settings"
|
msgid "Armoury settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:194
|
#: rog-control-center/ui/pages/system.slint:205
|
||||||
msgctxt "PageSystem"
|
msgctxt "no_asus_armoury_driver_1"
|
||||||
msgid "Panel Overdrive"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:202
|
|
||||||
msgctxt "PageSystem"
|
|
||||||
msgid "MiniLED Mode"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:210
|
|
||||||
msgctxt "PageSystem"
|
|
||||||
msgid "POST boot sound"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:224
|
|
||||||
msgctxt "no_asus_armoury_driver_2"
|
|
||||||
msgid "The asus-armoury driver is not loaded"
|
msgid "The asus-armoury driver is not loaded"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:230
|
#: rog-control-center/ui/pages/system.slint:211
|
||||||
msgctxt "no_asus_armoury_driver_2"
|
msgctxt "no_asus_armoury_driver_2"
|
||||||
msgid "For advanced features you will require a kernel with this driver added."
|
msgid "For advanced features you will require a kernel with this driver added."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:241
|
#: rog-control-center/ui/pages/system.slint:222
|
||||||
msgctxt "ppt_warning"
|
msgctxt "PageSystem"
|
||||||
msgid "The following settings may not be safe, please review the help."
|
msgid "Panel Overdrive"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:246 rog-control-center/ui/pages/system.slint:247
|
#: rog-control-center/ui/pages/system.slint:230
|
||||||
|
msgctxt "PageSystem"
|
||||||
|
msgid "MiniLED Mode"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/pages/system.slint:238
|
||||||
|
msgctxt "PageSystem"
|
||||||
|
msgid "POST boot sound"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/pages/system.slint:254
|
||||||
|
msgctxt "ppt_warning"
|
||||||
|
msgid "The following settings are not applied until the toggle is enabled."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/pages/system.slint:259 rog-control-center/ui/pages/system.slint:266
|
||||||
|
msgctxt "ppt_group_enabled"
|
||||||
|
msgid "Enable Tuning"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/pages/system.slint:277 rog-control-center/ui/pages/system.slint:278
|
||||||
msgctxt "ppt_pl1_spl"
|
msgctxt "ppt_pl1_spl"
|
||||||
msgid "CPU Sustained Power Limit"
|
msgid "CPU Sustained Power Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:248
|
#: rog-control-center/ui/pages/system.slint:279
|
||||||
msgctxt "ppt_pl1_spl_help"
|
msgctxt "ppt_pl1_spl_help"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Long-term CPU power limit that affects sustained workload performance. "
|
"Long-term CPU power limit that affects sustained workload performance. "
|
||||||
"Higher values may increase heat and power consumption."
|
"Higher values may increase heat and power consumption."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:263 rog-control-center/ui/pages/system.slint:264
|
#: rog-control-center/ui/pages/system.slint:295 rog-control-center/ui/pages/system.slint:296
|
||||||
msgctxt "ppt_pl2_sppt"
|
msgctxt "ppt_pl2_sppt"
|
||||||
msgid "CPU Turbo Power Limit"
|
msgid "CPU Turbo Power Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:265
|
#: rog-control-center/ui/pages/system.slint:297
|
||||||
msgctxt "ppt_pl2_sppt_help"
|
msgctxt "ppt_pl2_sppt_help"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Short-term CPU power limit for boost periods. Controls maximum power during "
|
"Short-term CPU power limit for boost periods. Controls maximum power during "
|
||||||
"brief high-performance bursts."
|
"brief high-performance bursts."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:280 rog-control-center/ui/pages/system.slint:281
|
#: rog-control-center/ui/pages/system.slint:313 rog-control-center/ui/pages/system.slint:314
|
||||||
msgctxt "ppt_pl3_fppt"
|
msgctxt "ppt_pl3_fppt"
|
||||||
msgid "CPU Fast Burst Power Limit"
|
msgid "CPU Fast Burst Power Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:282
|
#: rog-control-center/ui/pages/system.slint:315
|
||||||
msgctxt "ppt_pl3_fppt_help"
|
msgctxt "ppt_pl3_fppt_help"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Ultra-short duration power limit for instantaneous CPU bursts. Affects "
|
"Ultra-short duration power limit for instantaneous CPU bursts. Affects "
|
||||||
"responsiveness during sudden workload spikes."
|
"responsiveness during sudden workload spikes."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:296 rog-control-center/ui/pages/system.slint:297
|
#: rog-control-center/ui/pages/system.slint:330 rog-control-center/ui/pages/system.slint:331
|
||||||
msgctxt "ppt_fppt"
|
msgctxt "ppt_fppt"
|
||||||
msgid "Fast Package Power Limit"
|
msgid "Fast Package Power Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:298
|
#: rog-control-center/ui/pages/system.slint:332
|
||||||
msgctxt "ppt_fppt_help"
|
msgctxt "ppt_fppt_help"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Ultra-short duration power limit for system package. Controls maximum power "
|
"Ultra-short duration power limit for system package. Controls maximum power "
|
||||||
"during millisecond-scale load spikes."
|
"during millisecond-scale load spikes."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:313 rog-control-center/ui/pages/system.slint:314
|
#: rog-control-center/ui/pages/system.slint:348 rog-control-center/ui/pages/system.slint:349
|
||||||
msgctxt "ppt_apu_sppt"
|
msgctxt "ppt_apu_sppt"
|
||||||
msgid "APU Sustained Power Limit"
|
msgid "APU Sustained Power Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:315
|
#: rog-control-center/ui/pages/system.slint:350
|
||||||
msgctxt "ppt_apu_sppt_help"
|
msgctxt "ppt_apu_sppt_help"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Long-term power limit for integrated graphics and CPU combined. Affects "
|
"Long-term power limit for integrated graphics and CPU combined. Affects "
|
||||||
"sustained performance of APU-based workloads."
|
"sustained performance of APU-based workloads."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:330 rog-control-center/ui/pages/system.slint:331
|
#: rog-control-center/ui/pages/system.slint:366 rog-control-center/ui/pages/system.slint:367
|
||||||
msgctxt "ppt_platform_sppt"
|
msgctxt "ppt_platform_sppt"
|
||||||
msgid "Platform Sustained Power Limit"
|
msgid "Platform Sustained Power Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:332
|
#: rog-control-center/ui/pages/system.slint:368
|
||||||
msgctxt "ppt_platform_sppt_help"
|
msgctxt "ppt_platform_sppt_help"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Overall system power limit for sustained operations. Controls total platform "
|
"Overall system power limit for sustained operations. Controls total platform "
|
||||||
"power consumption over extended periods."
|
"power consumption over extended periods."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:347 rog-control-center/ui/pages/system.slint:348
|
#: rog-control-center/ui/pages/system.slint:384 rog-control-center/ui/pages/system.slint:385
|
||||||
msgctxt "nv_dynamic_boost"
|
msgctxt "nv_dynamic_boost"
|
||||||
msgid "GPU Power Boost"
|
msgid "GPU Power Boost"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:349
|
#: rog-control-center/ui/pages/system.slint:386
|
||||||
msgctxt "nv_dynamic_boost_help"
|
msgctxt "nv_dynamic_boost_help"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Additional power allocation for GPU dynamic boost. Higher values increase "
|
"Additional power allocation for GPU dynamic boost. Higher values increase "
|
||||||
"GPU performance but generate more heat."
|
"GPU performance but generate more heat."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:364 rog-control-center/ui/pages/system.slint:365
|
#: rog-control-center/ui/pages/system.slint:402 rog-control-center/ui/pages/system.slint:403
|
||||||
msgctxt "nv_temp_target"
|
msgctxt "nv_temp_target"
|
||||||
msgid "GPU Temperature Limit"
|
msgid "GPU Temperature Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:366
|
#: rog-control-center/ui/pages/system.slint:404
|
||||||
msgctxt "nv_temp_target_help"
|
msgctxt "nv_temp_target_help"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Maximum GPU temperature threshold in Celsius. GPU will throttle to maintain "
|
"Maximum GPU temperature threshold in Celsius. GPU will throttle to maintain "
|
||||||
"temperature below this limit."
|
"temperature below this limit."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:417
|
#: rog-control-center/ui/pages/system.slint:456
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Energy Performance Preference linked to Throttle Policy"
|
msgid "Energy Performance Preference linked to Throttle Policy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:421
|
#: rog-control-center/ui/pages/system.slint:460
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Change EPP based on Throttle Policy"
|
msgid "Change EPP based on Throttle Policy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:429
|
#: rog-control-center/ui/pages/system.slint:468
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "EPP for Balanced Policy"
|
msgid "EPP for Balanced Policy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:439
|
#: rog-control-center/ui/pages/system.slint:478
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "EPP for Performance Policy"
|
msgid "EPP for Performance Policy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:449
|
#: rog-control-center/ui/pages/system.slint:488
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "EPP for Quiet Policy"
|
msgid "EPP for Quiet Policy"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:467
|
#: rog-control-center/ui/pages/system.slint:506
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Throttle Policy for power state"
|
msgid "Throttle Policy for power state"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:473
|
#: rog-control-center/ui/pages/system.slint:512
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Throttle Policy on Battery"
|
msgid "Throttle Policy on Battery"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:483 rog-control-center/ui/pages/system.slint:504
|
#: rog-control-center/ui/pages/system.slint:522 rog-control-center/ui/pages/system.slint:543
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Enabled"
|
msgid "Enabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:494
|
#: rog-control-center/ui/pages/system.slint:533
|
||||||
msgctxt "PageSystem"
|
msgctxt "PageSystem"
|
||||||
msgid "Throttle Policy on AC"
|
msgid "Throttle Policy on AC"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -723,47 +728,47 @@ msgctxt "AuraPowerGroupOld"
|
|||||||
msgid "Sleep"
|
msgid "Sleep"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/common.slint:133
|
#: rog-control-center/ui/widgets/common.slint:136
|
||||||
msgctxt "confirm_reset"
|
msgctxt "confirm_reset"
|
||||||
msgid "Are you sure you want to reset this?"
|
msgid "Are you sure you want to reset this?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:51
|
#: rog-control-center/ui/main_window.slint:55
|
||||||
msgctxt "MainWindow"
|
msgctxt "MainWindow"
|
||||||
msgid "ROG"
|
msgid "ROG"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:53
|
#: rog-control-center/ui/main_window.slint:57
|
||||||
msgctxt "Menu1"
|
msgctxt "Menu1"
|
||||||
msgid "System Control"
|
msgid "System Control"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:54
|
#: rog-control-center/ui/main_window.slint:58
|
||||||
msgctxt "Menu2"
|
msgctxt "Menu2"
|
||||||
msgid "Keyboard Aura"
|
msgid "Keyboard Aura"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:55
|
#: rog-control-center/ui/main_window.slint:59
|
||||||
msgctxt "Menu3"
|
msgctxt "Menu3"
|
||||||
msgid "AniMe Matrix"
|
msgid "AniMe Matrix"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:56
|
#: rog-control-center/ui/main_window.slint:60
|
||||||
msgctxt "Menu4"
|
msgctxt "Menu4"
|
||||||
msgid "Fan Curves"
|
msgid "Fan Curves"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:57
|
#: rog-control-center/ui/main_window.slint:61
|
||||||
msgctxt "Menu5"
|
msgctxt "Menu5"
|
||||||
msgid "App Settings"
|
msgid "App Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:58
|
#: rog-control-center/ui/main_window.slint:62
|
||||||
msgctxt "Menu6"
|
msgctxt "Menu6"
|
||||||
msgid "About"
|
msgid "About"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:70
|
#: rog-control-center/ui/main_window.slint:74
|
||||||
msgctxt "MainWindow"
|
msgctxt "MainWindow"
|
||||||
msgid "Quit App"
|
msgid "Quit App"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ export { AppSize, AttrMinMax, SystemPageData, AnimePageData, AppSettingsPageData
|
|||||||
|
|
||||||
export component MainWindow inherits Window {
|
export component MainWindow inherits Window {
|
||||||
title: "ROG Control";
|
title: "ROG Control";
|
||||||
default-font-family: "DejaVu Sans";
|
always-on-top: true;
|
||||||
|
default-font-family: "Noto Sans";
|
||||||
|
default-font-size: 14px;
|
||||||
|
default-font-weight: 400;
|
||||||
|
icon: @image-url("../data/rog-control-center.png");
|
||||||
in property <[bool]> sidebar_items_avilable: [true, true, true, true, true, true];
|
in property <[bool]> sidebar_items_avilable: [true, true, true, true, true, true];
|
||||||
private property <bool> show_notif;
|
private property <bool> show_notif;
|
||||||
private property <bool> fade_cover;
|
private property <bool> fade_cover;
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
import { SystemSlider, SystemDropdown, SystemToggle, SystemToggleInt } from "../widgets/common.slint";
|
import { SystemSlider, SystemDropdown, SystemToggle, SystemToggleInt } from "../widgets/common.slint";
|
||||||
import { Palette, HorizontalBox , VerticalBox, ScrollView, Slider, Button, Switch, ComboBox, GroupBox} from "std-widgets.slint";
|
import { Palette, HorizontalBox , VerticalBox, ScrollView, Slider, Button, Switch, ComboBox, GroupBox, StandardButton} from "std-widgets.slint";
|
||||||
|
|
||||||
export struct AttrMinMax {
|
export struct AttrMinMax {
|
||||||
min: int,
|
min: int,
|
||||||
max: int,
|
max: int,
|
||||||
val: float,
|
current: float,
|
||||||
}
|
}
|
||||||
|
|
||||||
export struct AttrPossible {
|
export struct AttrPossible {
|
||||||
range: [int],
|
range: [int],
|
||||||
val: int,
|
current: int,
|
||||||
}
|
}
|
||||||
|
|
||||||
export global SystemPageData {
|
export global SystemPageData {
|
||||||
|
in-out property <bool> charge_control_enabled: true;
|
||||||
in-out property <float> charge_control_end_threshold: 30;
|
in-out property <float> charge_control_end_threshold: 30;
|
||||||
callback cb_charge_control_end_threshold(/* charge limit */ int);
|
callback cb_charge_control_end_threshold(/* charge limit */ int);
|
||||||
in-out property <int> platform_profile: 0;
|
in-out property <int> platform_profile: 0;
|
||||||
@@ -54,7 +55,7 @@ export global SystemPageData {
|
|||||||
in-out property <AttrMinMax> ppt_pl1_spl: {
|
in-out property <AttrMinMax> ppt_pl1_spl: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
max: 100,
|
||||||
val: 20,
|
current: 20,
|
||||||
};
|
};
|
||||||
callback cb_ppt_pl1_spl(int);
|
callback cb_ppt_pl1_spl(int);
|
||||||
callback cb_default_ppt_pl1_spl();
|
callback cb_default_ppt_pl1_spl();
|
||||||
@@ -62,7 +63,7 @@ export global SystemPageData {
|
|||||||
in-out property <AttrMinMax> ppt_pl2_sppt: {
|
in-out property <AttrMinMax> ppt_pl2_sppt: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
max: 100,
|
||||||
val: 20,
|
current: 20,
|
||||||
};
|
};
|
||||||
callback cb_ppt_pl2_sppt(int);
|
callback cb_ppt_pl2_sppt(int);
|
||||||
callback cb_default_ppt_pl2_sppt();
|
callback cb_default_ppt_pl2_sppt();
|
||||||
@@ -70,7 +71,7 @@ export global SystemPageData {
|
|||||||
in-out property <AttrMinMax> ppt_pl3_fppt: {
|
in-out property <AttrMinMax> ppt_pl3_fppt: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
max: 100,
|
||||||
val: 20,
|
current: 20,
|
||||||
};
|
};
|
||||||
callback cb_ppt_pl3_fppt(int);
|
callback cb_ppt_pl3_fppt(int);
|
||||||
callback cb_default_ppt_pl3_fppt();
|
callback cb_default_ppt_pl3_fppt();
|
||||||
@@ -78,7 +79,7 @@ export global SystemPageData {
|
|||||||
in-out property <AttrMinMax> ppt_fppt: {
|
in-out property <AttrMinMax> ppt_fppt: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
max: 100,
|
||||||
val: 20,
|
current: 20,
|
||||||
};
|
};
|
||||||
callback cb_ppt_fppt(int);
|
callback cb_ppt_fppt(int);
|
||||||
callback cb_default_ppt_fppt();
|
callback cb_default_ppt_fppt();
|
||||||
@@ -86,7 +87,7 @@ export global SystemPageData {
|
|||||||
in-out property <AttrMinMax> ppt_apu_sppt: {
|
in-out property <AttrMinMax> ppt_apu_sppt: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
max: 100,
|
||||||
val: 20,
|
current: 20,
|
||||||
};
|
};
|
||||||
callback cb_ppt_apu_sppt(int);
|
callback cb_ppt_apu_sppt(int);
|
||||||
callback cb_default_ppt_apu_sppt();
|
callback cb_default_ppt_apu_sppt();
|
||||||
@@ -94,7 +95,7 @@ export global SystemPageData {
|
|||||||
in-out property <AttrMinMax> ppt_platform_sppt: {
|
in-out property <AttrMinMax> ppt_platform_sppt: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
max: 100,
|
||||||
val: 20,
|
current: 20,
|
||||||
};
|
};
|
||||||
callback cb_ppt_platform_sppt(int);
|
callback cb_ppt_platform_sppt(int);
|
||||||
callback cb_default_ppt_platform_sppt();
|
callback cb_default_ppt_platform_sppt();
|
||||||
@@ -102,7 +103,7 @@ export global SystemPageData {
|
|||||||
in-out property <AttrMinMax> nv_dynamic_boost: {
|
in-out property <AttrMinMax> nv_dynamic_boost: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 30,
|
max: 30,
|
||||||
val: 5,
|
current: 5,
|
||||||
};
|
};
|
||||||
callback cb_nv_dynamic_boost(int);
|
callback cb_nv_dynamic_boost(int);
|
||||||
callback cb_default_nv_dynamic_boost();
|
callback cb_default_nv_dynamic_boost();
|
||||||
@@ -110,10 +111,17 @@ export global SystemPageData {
|
|||||||
in-out property <AttrMinMax> nv_temp_target: {
|
in-out property <AttrMinMax> nv_temp_target: {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 80,
|
max: 80,
|
||||||
val: 75,
|
current: 75,
|
||||||
};
|
};
|
||||||
callback cb_nv_temp_target(int);
|
callback cb_nv_temp_target(int);
|
||||||
callback cb_default_nv_temp_target();
|
callback cb_default_nv_temp_target();
|
||||||
|
|
||||||
|
in-out property <bool> enable_ppt_group: false;
|
||||||
|
callback cb_enable_ppt_group(bool);
|
||||||
|
|
||||||
|
in-out property <bool> ppt_enabled_available;
|
||||||
|
in-out property <bool> ppt_enabled;
|
||||||
|
callback cb_ppt_enabled(bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
export component PageSystem inherits Rectangle {
|
export component PageSystem inherits Rectangle {
|
||||||
@@ -145,6 +153,7 @@ export component PageSystem inherits Rectangle {
|
|||||||
minimum: 20;
|
minimum: 20;
|
||||||
maximum: 100;
|
maximum: 100;
|
||||||
has_reset: false;
|
has_reset: false;
|
||||||
|
enabled <=> SystemPageData.charge_control_enabled;
|
||||||
value: SystemPageData.charge_control_end_threshold;
|
value: SystemPageData.charge_control_end_threshold;
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.charge_control_end_threshold = self.value;
|
SystemPageData.charge_control_end_threshold = self.value;
|
||||||
@@ -187,6 +196,25 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !SystemPageData.asus_armoury_loaded: Rectangle {
|
||||||
|
border-width: 3px;
|
||||||
|
border-color: red;
|
||||||
|
max-height: 30px;
|
||||||
|
VerticalBox {
|
||||||
|
Text {
|
||||||
|
text: @tr("no_asus_armoury_driver_1" => "The asus-armoury driver is not loaded");
|
||||||
|
font-size: 16px;
|
||||||
|
horizontal-alignment: TextHorizontalAlignment.center;
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: @tr("no_asus_armoury_driver_2" => "For advanced features you will require a kernel with this driver added.");
|
||||||
|
font-size: 16px;
|
||||||
|
horizontal-alignment: TextHorizontalAlignment.center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HorizontalBox {
|
HorizontalBox {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
spacing: 10px;
|
spacing: 10px;
|
||||||
@@ -215,164 +243,175 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !SystemPageData.asus_armoury_loaded: Rectangle {
|
if SystemPageData.ppt_pl1_spl.current != -1 || SystemPageData.ppt_pl2_sppt.current != -1 || SystemPageData.nv_dynamic_boost.current != -1: HorizontalLayout {
|
||||||
border-width: 3px;
|
padding-right: 10px;
|
||||||
border-color: red;
|
padding-left: 10px;
|
||||||
max-height: 30px;
|
alignment: LayoutAlignment.space-between;
|
||||||
VerticalBox {
|
Rectangle {
|
||||||
|
height: 32px;
|
||||||
Text {
|
Text {
|
||||||
text: @tr("no_asus_armoury_driver_2" => "The asus-armoury driver is not loaded");
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
text: @tr("ppt_warning" => "The following settings are not applied until the toggle is enabled.");
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: @tr("no_asus_armoury_driver_2" => "For advanced features you will require a kernel with this driver added.");
|
|
||||||
font-size: 16px;
|
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if SystemPageData.ppt_pl1_spl.val != -1: Rectangle {
|
if !SystemPageData.ppt_enabled_available: Switch {
|
||||||
height: 32px;
|
text: @tr("ppt_group_enabled" => "Enable Tuning");
|
||||||
Text {
|
checked <=> SystemPageData.enable_ppt_group;
|
||||||
font-size: 16px;
|
toggled => {
|
||||||
text: @tr("ppt_warning" => "The following settings may not be safe, please review the help.");
|
SystemPageData.cb_enable_ppt_group(SystemPageData.enable_ppt_group)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if SystemPageData.ppt_enabled_available: Switch {
|
||||||
|
text: @tr("ppt_group_enabled" => "Enable Tuning");
|
||||||
|
checked <=> SystemPageData.ppt_enabled;
|
||||||
|
toggled => {
|
||||||
|
SystemPageData.enable_ppt_group = self.checked;
|
||||||
|
SystemPageData.cb_ppt_enabled(SystemPageData.ppt_enabled)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.ppt_pl1_spl.val != -1: SystemSlider {
|
if SystemPageData.ppt_pl1_spl.current != -1: SystemSlider {
|
||||||
text: @tr("ppt_pl1_spl" => "CPU Sustained Power Limit");
|
text: @tr("ppt_pl1_spl" => "CPU Sustained Power Limit");
|
||||||
title: @tr("ppt_pl1_spl" => "CPU Sustained Power Limit");
|
title: @tr("ppt_pl1_spl" => "CPU Sustained Power Limit");
|
||||||
help_text: @tr("ppt_pl1_spl_help" => "Long-term CPU power limit that affects sustained workload performance. Higher values may increase heat and power consumption.");
|
help_text: @tr("ppt_pl1_spl_help" => "Long-term CPU power limit that affects sustained workload performance. Higher values may increase heat and power consumption.");
|
||||||
minimum: SystemPageData.ppt_pl1_spl.min;
|
minimum: SystemPageData.ppt_pl1_spl.min;
|
||||||
maximum: SystemPageData.ppt_pl1_spl.max;
|
maximum: SystemPageData.ppt_pl1_spl.max;
|
||||||
value: SystemPageData.ppt_pl1_spl.val;
|
value: SystemPageData.ppt_pl1_spl.current;
|
||||||
|
enabled <=> SystemPageData.enable_ppt_group;
|
||||||
has_reset: true;
|
has_reset: true;
|
||||||
cb_do_reset => {
|
cb_do_reset => {
|
||||||
SystemPageData.cb_default_ppt_pl1_spl();
|
SystemPageData.cb_default_ppt_pl1_spl();
|
||||||
}
|
}
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.ppt_pl1_spl.val = self.value;
|
SystemPageData.ppt_pl1_spl.current = self.value;
|
||||||
SystemPageData.cb_ppt_pl1_spl(Math.round(self.value))
|
SystemPageData.cb_ppt_pl1_spl(Math.round(self.value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.ppt_pl2_sppt.val != -1: SystemSlider {
|
if SystemPageData.ppt_pl2_sppt.current != -1: SystemSlider {
|
||||||
text: @tr("ppt_pl2_sppt" => "CPU Turbo Power Limit");
|
text: @tr("ppt_pl2_sppt" => "CPU Turbo Power Limit");
|
||||||
title: @tr("ppt_pl2_sppt" => "CPU Turbo Power Limit");
|
title: @tr("ppt_pl2_sppt" => "CPU Turbo Power Limit");
|
||||||
help_text: @tr("ppt_pl2_sppt_help" => "Short-term CPU power limit for boost periods. Controls maximum power during brief high-performance bursts.");
|
help_text: @tr("ppt_pl2_sppt_help" => "Short-term CPU power limit for boost periods. Controls maximum power during brief high-performance bursts.");
|
||||||
minimum: SystemPageData.ppt_pl2_sppt.min;
|
minimum: SystemPageData.ppt_pl2_sppt.min;
|
||||||
maximum: SystemPageData.ppt_pl2_sppt.max;
|
maximum: SystemPageData.ppt_pl2_sppt.max;
|
||||||
value: SystemPageData.ppt_pl2_sppt.val;
|
value: SystemPageData.ppt_pl2_sppt.current;
|
||||||
|
enabled <=> SystemPageData.enable_ppt_group;
|
||||||
has_reset: true;
|
has_reset: true;
|
||||||
cb_do_reset => {
|
cb_do_reset => {
|
||||||
SystemPageData.cb_default_ppt_pl2_sppt();
|
SystemPageData.cb_default_ppt_pl2_sppt();
|
||||||
}
|
}
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.ppt_pl2_sppt.val = self.value;
|
SystemPageData.ppt_pl2_sppt.current = self.value;
|
||||||
SystemPageData.cb_ppt_pl2_sppt(Math.round(self.value))
|
SystemPageData.cb_ppt_pl2_sppt(Math.round(self.value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.ppt_pl3_fppt.val != -1: SystemSlider {
|
if SystemPageData.ppt_pl3_fppt.current != -1: SystemSlider {
|
||||||
text: @tr("ppt_pl3_fppt" => "CPU Fast Burst Power Limit");
|
text: @tr("ppt_pl3_fppt" => "CPU Fast Burst Power Limit");
|
||||||
title: @tr("ppt_pl3_fppt" => "CPU Fast Burst Power Limit");
|
title: @tr("ppt_pl3_fppt" => "CPU Fast Burst Power Limit");
|
||||||
help_text: @tr("ppt_pl3_fppt_help" => "Ultra-short duration power limit for instantaneous CPU bursts. Affects responsiveness during sudden workload spikes.");
|
help_text: @tr("ppt_pl3_fppt_help" => "Ultra-short duration power limit for instantaneous CPU bursts. Affects responsiveness during sudden workload spikes.");
|
||||||
minimum: SystemPageData.ppt_pl3_fppt.min;
|
minimum: SystemPageData.ppt_pl3_fppt.min;
|
||||||
maximum: SystemPageData.ppt_pl3_fppt.max;
|
maximum: SystemPageData.ppt_pl3_fppt.max;
|
||||||
value: SystemPageData.ppt_pl3_fppt.val;
|
value: SystemPageData.ppt_pl3_fppt.current;
|
||||||
|
enabled <=> SystemPageData.enable_ppt_group;
|
||||||
has_reset: true;
|
has_reset: true;
|
||||||
cb_do_reset => {
|
cb_do_reset => {
|
||||||
SystemPageData.cb_default_ppt_pl3_fppt();
|
SystemPageData.cb_default_ppt_pl3_fppt();
|
||||||
}
|
}
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.ppt_pl3_fppt.val = self.value;
|
SystemPageData.ppt_pl3_fppt.current = self.value;
|
||||||
SystemPageData.cb_ppt_pl3_fppt(Math.round(self.value))
|
SystemPageData.cb_ppt_pl3_fppt(Math.round(self.value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if SystemPageData.ppt_fppt.val != -1: SystemSlider {
|
if SystemPageData.ppt_fppt.current != -1: SystemSlider {
|
||||||
text: @tr("ppt_fppt" => "Fast Package Power Limit");
|
text: @tr("ppt_fppt" => "Fast Package Power Limit");
|
||||||
title: @tr("ppt_fppt" => "Fast Package Power Limit");
|
title: @tr("ppt_fppt" => "Fast Package Power Limit");
|
||||||
help_text: @tr("ppt_fppt_help" => "Ultra-short duration power limit for system package. Controls maximum power during millisecond-scale load spikes.");
|
help_text: @tr("ppt_fppt_help" => "Ultra-short duration power limit for system package. Controls maximum power during millisecond-scale load spikes.");
|
||||||
minimum: SystemPageData.ppt_fppt.min;
|
minimum: SystemPageData.ppt_fppt.min;
|
||||||
maximum: SystemPageData.ppt_fppt.max;
|
maximum: SystemPageData.ppt_fppt.max;
|
||||||
value: SystemPageData.ppt_fppt.val;
|
value: SystemPageData.ppt_fppt.current;
|
||||||
|
enabled <=> SystemPageData.enable_ppt_group;
|
||||||
has_reset: true;
|
has_reset: true;
|
||||||
cb_do_reset => {
|
cb_do_reset => {
|
||||||
SystemPageData.cb_default_ppt_fppt();
|
SystemPageData.cb_default_ppt_fppt();
|
||||||
}
|
}
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.ppt_fppt.val = self.value;
|
SystemPageData.ppt_fppt.current = self.value;
|
||||||
SystemPageData.cb_ppt_fppt(Math.round(self.value))
|
SystemPageData.cb_ppt_fppt(Math.round(self.value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.ppt_apu_sppt.val != -1: SystemSlider {
|
if SystemPageData.ppt_apu_sppt.current != -1: SystemSlider {
|
||||||
text: @tr("ppt_apu_sppt" => "APU Sustained Power Limit");
|
text: @tr("ppt_apu_sppt" => "APU Sustained Power Limit");
|
||||||
title: @tr("ppt_apu_sppt" => "APU Sustained Power Limit");
|
title: @tr("ppt_apu_sppt" => "APU Sustained Power Limit");
|
||||||
help_text: @tr("ppt_apu_sppt_help" => "Long-term power limit for integrated graphics and CPU combined. Affects sustained performance of APU-based workloads.");
|
help_text: @tr("ppt_apu_sppt_help" => "Long-term power limit for integrated graphics and CPU combined. Affects sustained performance of APU-based workloads.");
|
||||||
minimum: SystemPageData.ppt_apu_sppt.min;
|
minimum: SystemPageData.ppt_apu_sppt.min;
|
||||||
maximum: SystemPageData.ppt_apu_sppt.max;
|
maximum: SystemPageData.ppt_apu_sppt.max;
|
||||||
value: SystemPageData.ppt_apu_sppt.val;
|
value: SystemPageData.ppt_apu_sppt.current;
|
||||||
|
enabled <=> SystemPageData.enable_ppt_group;
|
||||||
has_reset: true;
|
has_reset: true;
|
||||||
cb_do_reset => {
|
cb_do_reset => {
|
||||||
SystemPageData.cb_default_ppt_apu_sppt();
|
SystemPageData.cb_default_ppt_apu_sppt();
|
||||||
}
|
}
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.ppt_apu_sppt.val = self.value;
|
SystemPageData.ppt_apu_sppt.current = self.value;
|
||||||
SystemPageData.cb_ppt_apu_sppt(Math.round(self.value))
|
SystemPageData.cb_ppt_apu_sppt(Math.round(self.value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.ppt_platform_sppt.val != -1: SystemSlider {
|
if SystemPageData.ppt_platform_sppt.current != -1: SystemSlider {
|
||||||
text: @tr("ppt_platform_sppt" => "Platform Sustained Power Limit");
|
text: @tr("ppt_platform_sppt" => "Platform Sustained Power Limit");
|
||||||
title: @tr("ppt_platform_sppt" => "Platform Sustained Power Limit");
|
title: @tr("ppt_platform_sppt" => "Platform Sustained Power Limit");
|
||||||
help_text: @tr("ppt_platform_sppt_help" => "Overall system power limit for sustained operations. Controls total platform power consumption over extended periods.");
|
help_text: @tr("ppt_platform_sppt_help" => "Overall system power limit for sustained operations. Controls total platform power consumption over extended periods.");
|
||||||
minimum: SystemPageData.ppt_platform_sppt.min;
|
minimum: SystemPageData.ppt_platform_sppt.min;
|
||||||
maximum: SystemPageData.ppt_platform_sppt.max;
|
maximum: SystemPageData.ppt_platform_sppt.max;
|
||||||
value: SystemPageData.ppt_platform_sppt.val;
|
value: SystemPageData.ppt_platform_sppt.current;
|
||||||
|
enabled <=> SystemPageData.enable_ppt_group;
|
||||||
has_reset: true;
|
has_reset: true;
|
||||||
cb_do_reset => {
|
cb_do_reset => {
|
||||||
SystemPageData.cb_default_ppt_platform_sppt();
|
SystemPageData.cb_default_ppt_platform_sppt();
|
||||||
}
|
}
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.ppt_platform_sppt.val = self.value;
|
SystemPageData.ppt_platform_sppt.current = self.value;
|
||||||
SystemPageData.cb_ppt_platform_sppt(Math.round(self.value))
|
SystemPageData.cb_ppt_platform_sppt(Math.round(self.value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.nv_dynamic_boost.val != -1: SystemSlider {
|
if SystemPageData.nv_dynamic_boost.current != -1: SystemSlider {
|
||||||
text: @tr("nv_dynamic_boost" => "GPU Power Boost");
|
text: @tr("nv_dynamic_boost" => "GPU Power Boost");
|
||||||
title: @tr("nv_dynamic_boost" => "GPU Power Boost");
|
title: @tr("nv_dynamic_boost" => "GPU Power Boost");
|
||||||
help_text: @tr("nv_dynamic_boost_help" => "Additional power allocation for GPU dynamic boost. Higher values increase GPU performance but generate more heat.");
|
help_text: @tr("nv_dynamic_boost_help" => "Additional power allocation for GPU dynamic boost. Higher values increase GPU performance but generate more heat.");
|
||||||
minimum: SystemPageData.nv_dynamic_boost.min;
|
minimum: SystemPageData.nv_dynamic_boost.min;
|
||||||
maximum: SystemPageData.nv_dynamic_boost.max;
|
maximum: SystemPageData.nv_dynamic_boost.max;
|
||||||
value: SystemPageData.nv_dynamic_boost.val;
|
value: SystemPageData.nv_dynamic_boost.current;
|
||||||
|
enabled <=> SystemPageData.enable_ppt_group;
|
||||||
has_reset: true;
|
has_reset: true;
|
||||||
cb_do_reset => {
|
cb_do_reset => {
|
||||||
SystemPageData.cb_default_nv_dynamic_boost();
|
SystemPageData.cb_default_nv_dynamic_boost();
|
||||||
}
|
}
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.nv_dynamic_boost.val = self.value;
|
SystemPageData.nv_dynamic_boost.current = self.value;
|
||||||
SystemPageData.cb_nv_dynamic_boost(Math.round(self.value))
|
SystemPageData.cb_nv_dynamic_boost(Math.round(self.value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.nv_temp_target.val != -1: SystemSlider {
|
if SystemPageData.nv_temp_target.current != -1: SystemSlider {
|
||||||
text: @tr("nv_temp_target" => "GPU Temperature Limit");
|
text: @tr("nv_temp_target" => "GPU Temperature Limit");
|
||||||
title: @tr("nv_temp_target" => "GPU Temperature Limit");
|
title: @tr("nv_temp_target" => "GPU Temperature Limit");
|
||||||
help_text: @tr("nv_temp_target_help" => "Maximum GPU temperature threshold in Celsius. GPU will throttle to maintain temperature below this limit.");
|
help_text: @tr("nv_temp_target_help" => "Maximum GPU temperature threshold in Celsius. GPU will throttle to maintain temperature below this limit.");
|
||||||
minimum: SystemPageData.nv_temp_target.min;
|
minimum: SystemPageData.nv_temp_target.min;
|
||||||
maximum: SystemPageData.nv_temp_target.max;
|
maximum: SystemPageData.nv_temp_target.max;
|
||||||
value: SystemPageData.nv_temp_target.val;
|
value: SystemPageData.nv_temp_target.current;
|
||||||
|
enabled <=> SystemPageData.enable_ppt_group;
|
||||||
has_reset: true;
|
has_reset: true;
|
||||||
cb_do_reset => {
|
cb_do_reset => {
|
||||||
SystemPageData.cb_default_nv_temp_target();
|
SystemPageData.cb_default_nv_temp_target();
|
||||||
}
|
}
|
||||||
released => {
|
released => {
|
||||||
SystemPageData.nv_temp_target.val = self.value;
|
SystemPageData.nv_temp_target.current = self.value;
|
||||||
SystemPageData.cb_nv_temp_target(Math.round(self.value))
|
SystemPageData.cb_nv_temp_target(Math.round(self.value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export component RogItem inherits Rectangle {
|
|||||||
export component SystemSlider inherits RogItem {
|
export component SystemSlider inherits RogItem {
|
||||||
in property <string> title;
|
in property <string> title;
|
||||||
in property <string> text;
|
in property <string> text;
|
||||||
|
in-out property <bool> enabled: true;
|
||||||
in-out property <float> value;
|
in-out property <float> value;
|
||||||
in-out property <float> minimum;
|
in-out property <float> minimum;
|
||||||
in-out property <float> maximum;
|
in-out property <float> maximum;
|
||||||
@@ -27,6 +28,7 @@ export component SystemSlider inherits RogItem {
|
|||||||
alignment: LayoutAlignment.stretch;
|
alignment: LayoutAlignment.stretch;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
TouchArea {
|
TouchArea {
|
||||||
|
enabled <=> root.enabled;
|
||||||
clicked => {
|
clicked => {
|
||||||
slider.value += 1;
|
slider.value += 1;
|
||||||
if slider.value > slider.maximum {
|
if slider.value > slider.maximum {
|
||||||
@@ -57,6 +59,7 @@ export component SystemSlider inherits RogItem {
|
|||||||
// alignment: LayoutAlignment.end;
|
// alignment: LayoutAlignment.end;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
slider := Slider {
|
slider := Slider {
|
||||||
|
enabled <=> root.enabled;
|
||||||
maximum: root.maximum;
|
maximum: root.maximum;
|
||||||
minimum: root.minimum;
|
minimum: root.minimum;
|
||||||
value <=> root.value;
|
value <=> root.value;
|
||||||
@@ -150,6 +153,7 @@ export component SystemSlider inherits RogItem {
|
|||||||
reset := HorizontalBox {
|
reset := HorizontalBox {
|
||||||
if (has_reset): StandardButton {
|
if (has_reset): StandardButton {
|
||||||
kind: StandardButtonKind.reset;
|
kind: StandardButtonKind.reset;
|
||||||
|
enabled <=> root.enabled;
|
||||||
clicked => {
|
clicked => {
|
||||||
reset_popup.show();
|
reset_popup.show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,4 +104,12 @@ pub trait Platform {
|
|||||||
fn platform_profile(&self) -> zbus::Result<PlatformProfile>;
|
fn platform_profile(&self) -> zbus::Result<PlatformProfile>;
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
fn set_platform_profile(&self, platform_profile: PlatformProfile) -> zbus::Result<()>;
|
fn set_platform_profile(&self, platform_profile: PlatformProfile) -> zbus::Result<()>;
|
||||||
|
|
||||||
|
/// Set if the PPT tuning group for the current profile is enabled
|
||||||
|
#[zbus(property)]
|
||||||
|
fn enable_ppt_group(&self) -> zbus::Result<bool>;
|
||||||
|
|
||||||
|
/// Set if the PPT tuning group for the current profile is enabled
|
||||||
|
#[zbus(property)]
|
||||||
|
fn set_enable_ppt_group(&self, enable: bool) -> zbus::Result<()>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use std::fs::{read_dir, File, OpenOptions};
|
|||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
|
use log::{debug, error};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
|
|
||||||
@@ -75,6 +76,15 @@ impl Attribute {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn base_path_exists(&self) -> bool {
|
||||||
|
let exists = self.base_path.exists();
|
||||||
|
debug!(
|
||||||
|
"Attribute path {:?} exits? {exists}",
|
||||||
|
self.base_path.as_os_str()
|
||||||
|
);
|
||||||
|
exists
|
||||||
|
}
|
||||||
|
|
||||||
/// Write the `current_value` directly to the attribute path
|
/// Write the `current_value` directly to the attribute path
|
||||||
pub fn set_current_value(&self, new_value: &AttrValue) -> Result<(), PlatformError> {
|
pub fn set_current_value(&self, new_value: &AttrValue) -> Result<(), PlatformError> {
|
||||||
let path = self.base_path.join("current_value");
|
let path = self.base_path.join("current_value");
|
||||||
@@ -162,8 +172,8 @@ impl Attribute {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_watcher(&self) -> Result<inotify::Inotify, PlatformError> {
|
pub fn get_watcher(&self, attr: &str) -> Result<inotify::Inotify, PlatformError> {
|
||||||
let path = self.base_path.join("current_value");
|
let path = self.base_path.join(attr);
|
||||||
if let Some(path) = path.to_str() {
|
if let Some(path) = path.to_str() {
|
||||||
let inotify = inotify::Inotify::init()?;
|
let inotify = inotify::Inotify::init()?;
|
||||||
inotify
|
inotify
|
||||||
@@ -294,7 +304,8 @@ pub enum FirmwareAttribute {
|
|||||||
GpuMuxMode = 21,
|
GpuMuxMode = 21,
|
||||||
MiniLedMode = 22,
|
MiniLedMode = 22,
|
||||||
PendingReboot = 23,
|
PendingReboot = 23,
|
||||||
None = 24
|
PptEnabled = 24,
|
||||||
|
None = 25
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FirmwareAttribute {
|
impl FirmwareAttribute {
|
||||||
@@ -307,7 +318,13 @@ impl FirmwareAttribute {
|
|||||||
| FirmwareAttribute::PptFppt
|
| FirmwareAttribute::PptFppt
|
||||||
| FirmwareAttribute::PptApuSppt
|
| FirmwareAttribute::PptApuSppt
|
||||||
| FirmwareAttribute::PptPlatformSppt
|
| FirmwareAttribute::PptPlatformSppt
|
||||||
| FirmwareAttribute::NvDynamicBoost
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_dgpu(&self) -> bool {
|
||||||
|
matches!(
|
||||||
|
self,
|
||||||
|
FirmwareAttribute::NvDynamicBoost
|
||||||
| FirmwareAttribute::NvTempTarget
|
| FirmwareAttribute::NvTempTarget
|
||||||
| FirmwareAttribute::DgpuTgp
|
| FirmwareAttribute::DgpuTgp
|
||||||
)
|
)
|
||||||
@@ -320,6 +337,7 @@ impl From<&str> for FirmwareAttribute {
|
|||||||
"apu_mem" => Self::ApuMem,
|
"apu_mem" => Self::ApuMem,
|
||||||
"cores_performance" => Self::CoresPerformance,
|
"cores_performance" => Self::CoresPerformance,
|
||||||
"cores_efficiency" => Self::CoresEfficiency,
|
"cores_efficiency" => Self::CoresEfficiency,
|
||||||
|
"ppt_enabled" => Self::PptEnabled,
|
||||||
"ppt_pl1_spl" => Self::PptPl1Spl,
|
"ppt_pl1_spl" => Self::PptPl1Spl,
|
||||||
"ppt_pl2_sppt" => Self::PptPl2Sppt,
|
"ppt_pl2_sppt" => Self::PptPl2Sppt,
|
||||||
"ppt_pl3_fppt" => Self::PptPl3Fppt,
|
"ppt_pl3_fppt" => Self::PptPl3Fppt,
|
||||||
@@ -328,7 +346,7 @@ impl From<&str> for FirmwareAttribute {
|
|||||||
"ppt_platform_sppt" => Self::PptPlatformSppt,
|
"ppt_platform_sppt" => Self::PptPlatformSppt,
|
||||||
"nv_dynamic_boost" => Self::NvDynamicBoost,
|
"nv_dynamic_boost" => Self::NvDynamicBoost,
|
||||||
"nv_temp_target" => Self::NvTempTarget,
|
"nv_temp_target" => Self::NvTempTarget,
|
||||||
"dgpu_base_tgp" => Self::DgpuBaseTgp,
|
"nv_base_tgp" => Self::DgpuBaseTgp,
|
||||||
"dgpu_tgp" => Self::DgpuTgp,
|
"dgpu_tgp" => Self::DgpuTgp,
|
||||||
"charge_mode" => Self::ChargeMode,
|
"charge_mode" => Self::ChargeMode,
|
||||||
"boot_sound" => Self::BootSound,
|
"boot_sound" => Self::BootSound,
|
||||||
@@ -341,7 +359,10 @@ impl From<&str> for FirmwareAttribute {
|
|||||||
"gpu_mux_mode" => Self::GpuMuxMode,
|
"gpu_mux_mode" => Self::GpuMuxMode,
|
||||||
"mini_led_mode" => Self::MiniLedMode,
|
"mini_led_mode" => Self::MiniLedMode,
|
||||||
"pending_reboot" => Self::PendingReboot,
|
"pending_reboot" => Self::PendingReboot,
|
||||||
_ => panic!("Invalid firmware attribute: {}", s)
|
_ => {
|
||||||
|
error!("Invalid firmware attribute: {}", s);
|
||||||
|
Self::None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,6 +373,7 @@ impl From<FirmwareAttribute> for &str {
|
|||||||
FirmwareAttribute::ApuMem => "apu_mem",
|
FirmwareAttribute::ApuMem => "apu_mem",
|
||||||
FirmwareAttribute::CoresPerformance => "cores_performance",
|
FirmwareAttribute::CoresPerformance => "cores_performance",
|
||||||
FirmwareAttribute::CoresEfficiency => "cores_efficiency",
|
FirmwareAttribute::CoresEfficiency => "cores_efficiency",
|
||||||
|
FirmwareAttribute::PptEnabled => "ppt_enabled",
|
||||||
FirmwareAttribute::PptPl1Spl => "ppt_pl1_spl",
|
FirmwareAttribute::PptPl1Spl => "ppt_pl1_spl",
|
||||||
FirmwareAttribute::PptPl2Sppt => "ppt_pl2_sppt",
|
FirmwareAttribute::PptPl2Sppt => "ppt_pl2_sppt",
|
||||||
FirmwareAttribute::PptPl3Fppt => "ppt_pl3_fppt",
|
FirmwareAttribute::PptPl3Fppt => "ppt_pl3_fppt",
|
||||||
|
|||||||
Reference in New Issue
Block a user