mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Check in the fan curve work
This commit is contained in:
@@ -26,9 +26,9 @@ export component PageAura inherits Rectangle {
|
||||
SystemDropdown {
|
||||
text: @tr("Brightness");
|
||||
current_index <=> AuraPageData.brightness;
|
||||
current_value: AuraPageData.brightness_names[self.current-index];
|
||||
current_value: AuraPageData.brightness_names[self.current-index];
|
||||
model <=> AuraPageData.brightness_names;
|
||||
selected => {
|
||||
selected => {
|
||||
AuraPageData.set_brightness(AuraPageData.brightness)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +1,154 @@
|
||||
import { Palette } from "std-widgets.slint";
|
||||
import { Graph } from "../widgets/graph.slint";
|
||||
import { Palette, TabWidget, Button, CheckBox } from "std-widgets.slint";
|
||||
import { Graph, Node } from "../widgets/graph.slint";
|
||||
import { SystemToggle } from "../widgets/common.slint";
|
||||
import { Profile, FanType, FanPageData } from "../types/fan_types.slint";
|
||||
|
||||
export struct Node { x: length, y: length}
|
||||
component FanTab inherits Rectangle {
|
||||
in-out property <bool> enabled: false;
|
||||
in-out property <bool> tab_enabled: false;
|
||||
in property <Profile> profile;
|
||||
in property <FanType> fan_type;
|
||||
callback apply();
|
||||
callback cancel();
|
||||
callback default();
|
||||
callback toggled();
|
||||
in property <string> title;
|
||||
in-out property <[Node]> nodes;
|
||||
|
||||
export component PageFans inherits VerticalLayout {
|
||||
in-out property <[Node]> nodes: [
|
||||
{
|
||||
x: 10px,
|
||||
y: 10px,
|
||||
},
|
||||
{
|
||||
x: 40px,
|
||||
y: 30px,
|
||||
},
|
||||
{
|
||||
x: 70px,
|
||||
y: 50px,
|
||||
},
|
||||
{
|
||||
x: 100px,
|
||||
y: 70px,
|
||||
},
|
||||
{
|
||||
x: 130px,
|
||||
y: 90px,
|
||||
},
|
||||
{
|
||||
x: 160px,
|
||||
y: 110px,
|
||||
},
|
||||
{
|
||||
x: 190px,
|
||||
y: 130px,
|
||||
},
|
||||
{
|
||||
x: 220px,
|
||||
y: 150px,
|
||||
},
|
||||
];
|
||||
Text {
|
||||
text: "WORK IN PROGRESS";
|
||||
if !root.tab_enabled: VerticalLayout {
|
||||
alignment: center;
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Text {
|
||||
font-size: 24px;
|
||||
text: "WIP: Not enabled yet";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
Graph {
|
||||
// width: root.preferred-width;
|
||||
// height: root.preferred-height;
|
||||
nodes <=> root.nodes;
|
||||
|
||||
VerticalLayout {
|
||||
HorizontalLayout {
|
||||
Graph {
|
||||
nodes <=> root.nodes;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
alignment: LayoutAlignment.end;
|
||||
CheckBox {
|
||||
text: @tr("Enabled");
|
||||
checked <=> root.enabled;
|
||||
enabled <=> root.tab_enabled;
|
||||
toggled => {
|
||||
root.toggled();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: @tr("Apply");
|
||||
enabled <=> root.tab_enabled;
|
||||
clicked => {
|
||||
root.apply();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: @tr("Cancel");
|
||||
enabled <=> root.tab_enabled;
|
||||
clicked => {
|
||||
root.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: @tr("Factory Default");
|
||||
enabled <=> root.tab_enabled;
|
||||
clicked => {
|
||||
root.default();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export component PageFans inherits VerticalLayout {
|
||||
TabWidget {
|
||||
Tab {
|
||||
title: @tr("Balanced");
|
||||
TabWidget {
|
||||
Tab {
|
||||
title: @tr("CPU");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.balanced_cpu;
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
title: @tr("Mid");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.balanced_mid;
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
title: @tr("GPU");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.balanced_gpu;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
title: @tr("Performance");
|
||||
TabWidget {
|
||||
Tab {
|
||||
title: @tr("CPU");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.performance_cpu;
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
title: @tr("Mid");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.performance_mid;
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
title: @tr("GPU");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.performance_gpu;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
title: @tr("Quiet");
|
||||
TabWidget {
|
||||
Tab {
|
||||
title: @tr("CPU");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.quiet_cpu;
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
title: @tr("Mid");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.quiet_mid;
|
||||
}
|
||||
}
|
||||
|
||||
Tab {
|
||||
title: @tr("GPU");
|
||||
FanTab {
|
||||
nodes <=> FanPageData.quiet_gpu;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ export component PageSystem inherits Rectangle {
|
||||
minimum: 20;
|
||||
maximum: 100;
|
||||
value <=> SystemPageData.charge_control_end_threshold;
|
||||
released => {
|
||||
released => {
|
||||
SystemPageData.set_charge_control_end_threshold(Math.round(SystemPageData.charge_control_end_threshold))
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ export component PageSystem inherits Rectangle {
|
||||
current_index <=> SystemPageData.throttle_thermal_policy;
|
||||
current_value: SystemPageData.throttle_policy_choices[SystemPageData.throttle_thermal_policy];
|
||||
model <=> SystemPageData.throttle_policy_choices;
|
||||
selected => {
|
||||
selected => {
|
||||
SystemPageData.set_throttle_thermal_policy(SystemPageData.throttle_thermal_policy)
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ export component PageSystem inherits Rectangle {
|
||||
if SystemPageData.available.panel-od: SystemToggle {
|
||||
text: @tr("Panel Overdrive");
|
||||
checked <=> SystemPageData.panel_od;
|
||||
toggled => {
|
||||
toggled => {
|
||||
SystemPageData.set_panel_od(SystemPageData.panel_od)
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ export component PageSystem inherits Rectangle {
|
||||
if SystemPageData.available.mini-led-mode: SystemToggle {
|
||||
text: @tr("MiniLED Mode");
|
||||
checked <=> SystemPageData.mini_led_mode;
|
||||
toggled => {
|
||||
toggled => {
|
||||
SystemPageData.set_mini_led_mode(SystemPageData.mini_led_mode)
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export component PageSystem inherits Rectangle {
|
||||
if SystemPageData.available.boot-sound: SystemToggle {
|
||||
text: @tr("POST boot sound");
|
||||
checked <=> SystemPageData.boot_sound;
|
||||
toggled => {
|
||||
toggled => {
|
||||
SystemPageData.set_boot_sound(SystemPageData.boot_sound)
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ export component PageSystem inherits Rectangle {
|
||||
minimum: 5;
|
||||
maximum: 250;
|
||||
value <=> SystemPageData.ppt_pl1_spl;
|
||||
released => {
|
||||
released => {
|
||||
SystemPageData.set_ppt_pl1_spl(Math.round(SystemPageData.ppt_pl1_spl))
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ export component PageSystem inherits Rectangle {
|
||||
minimum: 5;
|
||||
maximum: 250;
|
||||
value <=> SystemPageData.ppt_pl2_sppt;
|
||||
released => {
|
||||
released => {
|
||||
SystemPageData.set_ppt_pl2_sppt(Math.round(SystemPageData.ppt_pl2_sppt))
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ export component PageSystem inherits Rectangle {
|
||||
minimum: 5;
|
||||
maximum: 250;
|
||||
value <=> SystemPageData.ppt_fppt;
|
||||
released => {
|
||||
released => {
|
||||
SystemPageData.set_ppt_fppt(Math.round(SystemPageData.ppt_fppt))
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ export component PageSystem inherits Rectangle {
|
||||
minimum: 5;
|
||||
maximum: 130;
|
||||
value <=> SystemPageData.ppt_apu_sppt;
|
||||
released => {
|
||||
released => {
|
||||
SystemPageData.set_ppt_apu_sppt(Math.round(SystemPageData.ppt_apu_sppt))
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ export component PageSystem inherits Rectangle {
|
||||
maximum: 130;
|
||||
minimum: 5;
|
||||
value <=> SystemPageData.ppt_platform_sppt;
|
||||
released => {
|
||||
released => {
|
||||
SystemPageData.set_ppt_platform_sppt(Math.round(SystemPageData.ppt_platform_sppt))
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,7 @@ export component PageSystem inherits Rectangle {
|
||||
minimum: 5;
|
||||
maximum: 25;
|
||||
value <=> SystemPageData.nv_dynamic_boost;
|
||||
released => {
|
||||
released => {
|
||||
SystemPageData.set_nv_dynamic_boost(Math.round(SystemPageData.nv_dynamic_boost))
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ export component PageSystem inherits Rectangle {
|
||||
minimum: 75;
|
||||
maximum: 87;
|
||||
value <=> SystemPageData.nv_temp_target;
|
||||
released => {
|
||||
released => {
|
||||
SystemPageData.set_nv_temp_target(Math.round(SystemPageData.nv_temp_target))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user