Extra debug output in ROGCC

This commit is contained in:
Luke Jones
2025-03-02 15:15:06 +13:00
parent 805ccfe451
commit 2cd4c4850f
6 changed files with 50 additions and 216 deletions

201
Cargo.lock generated
View File

@@ -18,98 +18,6 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046"
[[package]]
name = "accesskit"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3d3b8f9bae46a948369bc4a03e815d4ed6d616bd00de4051133a5019dc31c5a"
[[package]]
name = "accesskit_atspi_common"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c5dd55e6e94949498698daf4d48fb5659e824d7abec0d394089656ceaf99d4f"
dependencies = [
"accesskit",
"accesskit_consumer",
"atspi-common",
"serde",
"thiserror 1.0.69",
"zvariant 4.2.0",
]
[[package]]
name = "accesskit_consumer"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f47983a1084940ba9a39c077a8c63e55c619388be5476ac04c804cfbd1e63459"
dependencies = [
"accesskit",
"hashbrown 0.15.2",
"immutable-chunkmap",
]
[[package]]
name = "accesskit_macos"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7329821f3bd1101e03a7d2e03bd339e3ac0dc64c70b4c9f9ae1949e3ba8dece1"
dependencies = [
"accesskit",
"accesskit_consumer",
"hashbrown 0.15.2",
"objc2 0.5.2",
"objc2-app-kit 0.2.2",
"objc2-foundation 0.2.2",
]
[[package]]
name = "accesskit_unix"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcee751cc20d88678c33edaf9c07e8b693cd02819fe89053776f5313492273f5"
dependencies = [
"accesskit",
"accesskit_atspi_common",
"async-channel",
"async-executor",
"async-task",
"atspi",
"futures-lite",
"futures-util",
"serde",
"zbus 4.4.0",
]
[[package]]
name = "accesskit_windows"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24fcd5d23d70670992b823e735e859374d694a3d12bfd8dd32bd3bd8bedb5d81"
dependencies = [
"accesskit",
"accesskit_consumer",
"hashbrown 0.15.2",
"paste",
"static_assertions",
"windows 0.58.0",
"windows-core 0.58.0",
]
[[package]]
name = "accesskit_winit"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a6a48dad5530b6deb9fc7a52cc6c3bf72cdd9eb8157ac9d32d69f2427a5e879"
dependencies = [
"accesskit",
"accesskit_macos",
"accesskit_unix",
"accesskit_windows",
"raw-window-handle",
"winit",
]
[[package]]
name = "addr2line"
version = "0.24.2"
@@ -516,57 +424,6 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "atspi"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be534b16650e35237bb1ed189ba2aab86ce65e88cc84c66f4935ba38575cecbf"
dependencies = [
"atspi-common",
"atspi-connection",
"atspi-proxies",
]
[[package]]
name = "atspi-common"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1909ed2dc01d0a17505d89311d192518507e8a056a48148e3598fef5e7bb6ba7"
dependencies = [
"enumflags2",
"serde",
"static_assertions",
"zbus 4.4.0",
"zbus-lockstep",
"zbus-lockstep-macros",
"zbus_names 3.0.0",
"zvariant 4.2.0",
]
[[package]]
name = "atspi-connection"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "430c5960624a4baaa511c9c0fcc2218e3b58f5dbcc47e6190cafee344b873333"
dependencies = [
"atspi-common",
"atspi-proxies",
"futures-lite",
"zbus 4.4.0",
]
[[package]]
name = "atspi-proxies"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5e6c5de3e524cf967569722446bcd458d5032348554d9a17d7d72b041ab7496"
dependencies = [
"atspi-common",
"serde",
"zbus 4.4.0",
"zvariant 4.2.0",
]
[[package]]
name = "auto_enums"
version = "0.8.7"
@@ -2564,8 +2421,6 @@ name = "i-slint-backend-winit"
version = "1.10.0"
source = "git+https://github.com/slint-ui/slint.git#2fb62ca0e8f1ce0df6ac2b0e0d81baffb93b47eb"
dependencies = [
"accesskit",
"accesskit_winit",
"cfg-if",
"cfg_aliases",
"copypasta",
@@ -2957,15 +2812,6 @@ version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408"
[[package]]
name = "immutable-chunkmap"
version = "2.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12f97096f508d54f8f8ab8957862eee2ccd628847b6217af1a335e1c44dee578"
dependencies = [
"arrayvec",
]
[[package]]
name = "indexmap"
version = "1.9.3"
@@ -4453,16 +4299,6 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
[[package]]
name = "quick-xml"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956"
dependencies = [
"memchr",
"serde",
]
[[package]]
name = "quick-xml"
version = "0.31.0"
@@ -7136,30 +6972,6 @@ dependencies = [
"zvariant 5.4.0",
]
[[package]]
name = "zbus-lockstep"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ca2c5dceb099bddaade154055c926bb8ae507a18756ba1d8963fd7b51d8ed1d"
dependencies = [
"zbus_xml",
"zvariant 4.2.0",
]
[[package]]
name = "zbus-lockstep-macros"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "709ab20fc57cb22af85be7b360239563209258430bccf38d8b979c5a2ae3ecce"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.98",
"zbus-lockstep",
"zbus_xml",
"zvariant 4.2.0",
]
[[package]]
name = "zbus_macros"
version = "4.4.0"
@@ -7211,19 +7023,6 @@ dependencies = [
"zvariant 5.4.0",
]
[[package]]
name = "zbus_xml"
version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab3f374552b954f6abb4bd6ce979e6c9b38fb9d0cd7cc68a7d796e70c9f3a233"
dependencies = [
"quick-xml 0.30.0",
"serde",
"static_assertions",
"zbus_names 3.0.0",
"zvariant 4.2.0",
]
[[package]]
name = "zerocopy"
version = "0.7.35"

View File

@@ -51,7 +51,6 @@ default-features = false
features = [
"compat-1-2",
"gettext",
"accessibility",
"backend-winit-wayland",
"renderer-femtovg",
# "renderer-skia-opengl",

View File

@@ -20,12 +20,18 @@ const MINMAX: AttrMinMax = AttrMinMax {
};
pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
let conn = zbus::blocking::Connection::system().unwrap();
let platform = PlatformProxyBlocking::builder(&conn).build().unwrap();
let conn = zbus::blocking::Connection::system()
.map_err(|e| error!("DBus system connection failed: {e:?}"))
.unwrap();
let platform = PlatformProxyBlocking::builder(&conn)
.build()
.map_err(|e| error!("PlatformProxy failed: {e:?}"))
.unwrap();
// let armoury_attrs =
// find_iface::<AsusArmouryProxyBlocking>("xyz.ljones.AsusArmoury").unwrap();
// Null everything before the setup step
debug!("Defaulting system page values");
ui.global::<SystemPageData>()
.set_charge_control_end_threshold(-1.0);
ui.global::<SystemPageData>()
@@ -46,13 +52,17 @@ pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
ui.global::<SystemPageData>()
.set_ppt_enabled_available(false);
let sys_props = platform.supported_properties().unwrap();
log::debug!("Available system properties: {:?}", &sys_props);
if sys_props.contains(&Properties::ChargeControlEndThreshold) {
ui.global::<SystemPageData>()
.set_charge_control_end_threshold(60.0);
ui.global::<SystemPageData>()
.set_charge_control_enabled(true);
if let Ok(sys_props) = platform
.supported_properties()
.map_err(|e| log::error!("Failed to get supported properties: {}", e))
{
log::debug!("Available system properties: {:?}", &sys_props);
if sys_props.contains(&Properties::ChargeControlEndThreshold) {
ui.global::<SystemPageData>()
.set_charge_control_end_threshold(60.0);
ui.global::<SystemPageData>()
.set_charge_control_enabled(true);
}
}
}
@@ -265,9 +275,21 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
tokio::spawn(async move {
// Create the connections/proxies here to prevent future delays in process
let conn = zbus::Connection::system().await.unwrap();
let platform = PlatformProxy::builder(&conn).build().await.unwrap();
let conn = zbus::Connection::system()
.await
.map_err(|e| {
log::error!("Failed to connect to system bus: {}", e);
})
.unwrap();
let platform = PlatformProxy::builder(&conn)
.build()
.await
.map_err(|e| {
log::error!("Failed to create platform proxy: {}", e);
})
.unwrap();
debug!("Setting up system page profile callbacks");
set_ui_props_async!(
handle,
platform,
@@ -310,6 +332,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
let platform_copy = platform.clone();
handle
.upgrade_in_event_loop(move |handle| {
debug!("Setting up system page standard callbacks");
set_ui_callbacks!(handle,
SystemPageData(as bool),
platform_copy.enable_ppt_group(as bool),
@@ -383,6 +406,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
let armoury_attrs;
if let Ok(attrs) = find_iface_async::<AsusArmouryProxy>("xyz.ljones.AsusArmoury").await {
debug!("Found AsusArmoury interfaces");
armoury_attrs = attrs;
handle
.upgrade_in_event_loop(|ui| {
@@ -401,6 +425,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
for attr in armoury_attrs {
if let Ok(value) = attr.current_value().await {
let name = attr.name().await.unwrap();
debug!("Setting up {} = {value}", <&str>::from(name));
let platform = platform.clone();
handle
.upgrade_in_event_loop(move |handle| match name {
@@ -515,5 +540,17 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
.ok();
}
}
handle
.upgrade_in_event_loop(|ui| {
debug!(
"get_asus_armoury_loaded: {:?}",
ui.global::<SystemPageData>().get_asus_armoury_loaded()
);
debug!(
"get_ppt_enabled_available: {:?}",
ui.global::<SystemPageData>().get_ppt_enabled_available()
);
})
.ok();
});
}

View File

@@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-02-18 09:08+0000\n"
"POT-Creation-Date: 2025-03-01 07:51+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@@ -270,7 +270,6 @@ export component PageSystem inherits Rectangle {
SystemPageData.cb_ppt_enabled(SystemPageData.ppt_enabled)
}
}
}
if SystemPageData.ppt_pl1_spl.current != -1: SystemSlider {

View File

@@ -28,7 +28,7 @@ export component SystemSlider inherits RogItem {
alignment: LayoutAlignment.stretch;
padding-left: 10px;
TouchArea {
enabled <=> root.enabled;
enabled <=> root.enabled;
clicked => {
slider.value += 1;
if slider.value > slider.maximum {