mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e512d0e2a0 | ||
|
|
8161005096 | ||
|
|
ad073c10ff |
@@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
- Fix PPT sliders not updating
|
||||||
|
|
||||||
## [6.3.2]
|
## [6.3.2]
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|||||||
@@ -970,52 +970,72 @@ fn print_firmware_attr(attr: &AsusArmouryProxyBlocking) -> Result<(), Box<dyn st
|
|||||||
let name = attr.name()?;
|
let name = attr.name()?;
|
||||||
println!("{}:", <&str>::from(name));
|
println!("{}:", <&str>::from(name));
|
||||||
|
|
||||||
let attrs = attr.available_attrs()?;
|
// Be resilient to DBus read failures: if any read fails, show "unavailable"
|
||||||
if attrs.contains(&"min_value".to_string())
|
let attrs = attr.available_attrs().unwrap_or_default();
|
||||||
&& attrs.contains(&"max_value".to_string())
|
|
||||||
&& attrs.contains(&"current_value".to_string())
|
let has_min = attrs.contains(&"min_value".to_string());
|
||||||
{
|
let has_max = attrs.contains(&"max_value".to_string());
|
||||||
let c = attr.current_value()?;
|
let has_current = attrs.contains(&"current_value".to_string());
|
||||||
let min = attr.min_value()?;
|
let has_possible = attrs.contains(&"possible_values".to_string());
|
||||||
let max = attr.max_value()?;
|
let has_default = attrs.contains(&"default_value".to_string());
|
||||||
println!(" current: {min}..[{c}]..{max}");
|
|
||||||
if attrs.contains(&"default_value".to_string()) {
|
if has_min && has_max && has_current {
|
||||||
println!(" default: {}\n", attr.default_value()?);
|
let c = attr.current_value().ok();
|
||||||
|
let min = attr.min_value().ok();
|
||||||
|
let max = attr.max_value().ok();
|
||||||
|
match (min, c, max) {
|
||||||
|
(Some(min), Some(c), Some(max)) => println!(" current: {min}..[{c}]..{max}"),
|
||||||
|
_ => println!(" current: unavailable"),
|
||||||
|
}
|
||||||
|
|
||||||
|
if has_default {
|
||||||
|
match attr.default_value().ok() {
|
||||||
|
Some(d) => println!(" default: {}\n", d),
|
||||||
|
None => println!(" default: unavailable\n"),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
println!();
|
println!();
|
||||||
}
|
}
|
||||||
} else if attrs.contains(&"possible_values".to_string())
|
} else if has_possible && has_current {
|
||||||
&& attrs.contains(&"current_value".to_string())
|
let c = attr.current_value().ok();
|
||||||
{
|
let v = attr.possible_values().ok();
|
||||||
let c = attr.current_value()?;
|
if let (Some(c), Some(v)) = (c, v) {
|
||||||
let v = attr.possible_values()?;
|
for p in v.iter().enumerate() {
|
||||||
for p in v.iter().enumerate() {
|
if p.0 == 0 {
|
||||||
if p.0 == 0 {
|
print!(" current: [");
|
||||||
print!(" current: [");
|
}
|
||||||
|
if *p.1 == c {
|
||||||
|
print!("({c})");
|
||||||
|
} else {
|
||||||
|
print!("{}", p.1);
|
||||||
|
}
|
||||||
|
if p.0 < v.len() - 1 {
|
||||||
|
print!(",");
|
||||||
|
}
|
||||||
|
if p.0 == v.len() - 1 {
|
||||||
|
print!("]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if *p.1 == c {
|
if has_default {
|
||||||
print!("({c})");
|
match attr.default_value().ok() {
|
||||||
|
Some(d) => println!(" default: {}\n", d),
|
||||||
|
None => println!(" default: unavailable\n"),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print!("{}", p.1);
|
println!("\n");
|
||||||
}
|
}
|
||||||
if p.0 < v.len() - 1 {
|
|
||||||
print!(",");
|
|
||||||
}
|
|
||||||
if p.0 == v.len() - 1 {
|
|
||||||
print!("]");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if attrs.contains(&"default_value".to_string()) {
|
|
||||||
println!(" default: {}\n", attr.default_value()?);
|
|
||||||
} else {
|
} else {
|
||||||
println!("\n");
|
println!(" current: unavailable\n");
|
||||||
|
}
|
||||||
|
} else if has_current {
|
||||||
|
match attr.current_value().ok() {
|
||||||
|
Some(c) => println!(" current: {c}\n"),
|
||||||
|
None => println!(" current: unavailable\n"),
|
||||||
}
|
}
|
||||||
} else if attrs.contains(&"current_value".to_string()) {
|
|
||||||
let c = attr.current_value()?;
|
|
||||||
println!(" current: {c}\n");
|
|
||||||
} else {
|
} else {
|
||||||
println!();
|
println!(" unavailable\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -654,6 +654,15 @@ impl CtrlPlatform {
|
|||||||
.enabled = enable;
|
.enabled = enable;
|
||||||
self.config.lock().await.write();
|
self.config.lock().await.write();
|
||||||
|
|
||||||
|
// Re-emit armoury attribute limits so GUI sees updated min/max for PPT
|
||||||
|
// attributes which can change when enabling/disabling PPT tuning groups.
|
||||||
|
// Fire-and-forget: we don't want to fail the property call if emit fails.
|
||||||
|
let _ = self
|
||||||
|
.armoury_registry
|
||||||
|
.emit_limits(&self.connection)
|
||||||
|
.await
|
||||||
|
.map_err(|e| log::error!("Failed to emit armoury limits: {e:?}"));
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,6 +721,13 @@ impl ReloadAndNotify for CtrlPlatform {
|
|||||||
*config = data;
|
*config = data;
|
||||||
config.base_charge_control_end_threshold =
|
config.base_charge_control_end_threshold =
|
||||||
base_charge_control_end_threshold.unwrap_or_default();
|
base_charge_control_end_threshold.unwrap_or_default();
|
||||||
|
|
||||||
|
// Ensure any armoury limits changes from the new config are emitted
|
||||||
|
let _ = self
|
||||||
|
.armoury_registry
|
||||||
|
.emit_limits(&self.connection)
|
||||||
|
.await
|
||||||
|
.map_err(|e| log::error!("Failed to emit armoury limits after reload: {e:?}"));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,21 +21,6 @@ export component PageGPU inherits Rectangle {
|
|||||||
padding: 12px;
|
padding: 12px;
|
||||||
spacing: 8px;
|
spacing: 8px;
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
background: Palette.alternate-background;
|
|
||||||
border-color: Palette.border;
|
|
||||||
border-width: 1px;
|
|
||||||
border-radius: 2px;
|
|
||||||
height: 36px;
|
|
||||||
Text {
|
|
||||||
font-size: 16px;
|
|
||||||
color: Palette.control-foreground;
|
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
|
||||||
text: @tr("Coming Soon: GPU Configuration");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
background: Palette.alternate-background;
|
background: Palette.alternate-background;
|
||||||
border-color: Palette.border;
|
border-color: Palette.border;
|
||||||
@@ -74,7 +59,6 @@ export component PageGPU inherits Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user