Skip to content

Conversation

mathoudebine
Copy link
Owner

No description provided.

@mathoudebine mathoudebine force-pushed the hicwic/feature/plot-graph branch from facae8d to 2e78b7c Compare January 28, 2024 19:29
@mathoudebine mathoudebine marked this pull request as ready for review January 28, 2024 21:11
@mathoudebine
Copy link
Owner Author

Hi @hicwic
I've reworked a bit your PR in this branch.
I've moved most of the code from sensors_custom.py to other sensor classes (LHM, Python) and added line graphs on most CPU/GPU sensors
I've also slightly edited your theme to reflect on these changes
Don't hesitate to have a look and tell me what you think before I merge this branch!

@hicwic
Copy link
Contributor

hicwic commented Jan 29, 2024

hi @mathoudebine

Thx for integrating my work. Really pleased

I quickly looked your PR on my Steam Deck, as i'm not at home. So i could not test it futher until next weekend.

Seems good, but i have one major request. Please make the size of history definable by a line graph attribute. It will be more customizable, and you'll save memory if you don't use plot graph on a stat. (actually you save 10 elements of each stat, even if we are not using it). In my use case, my FPS graph is 100 plots long, and this may vary along use cases.

for example you can define a LINE_GRAPH.HISTORY_SIZE with a default value to 10.
Change that to an empty initialization

class CPU:
    last_values_cpu_percentage = last_values_list(size=10)
    last_values_cpu_temperature = last_values_list(size=10)
    last_values_cpu_fan_speed = last_values_list(size=10)

Group this two lines under an IF statement. And initialize the list if LINE_GRAPH is activated.
Like

if not theme_data['LINE_GRAPH'].get("SHOW", False):
        if list is not initialized: # will be played only first time
            <method to initialize list to theme_data['LINE_GRAPH']['HISTORY_SIZE'] or default value 10>

        save_last_value(cpu_percentage, cls.last_values_cpu_ percentage)
        display_themed_line_graph(theme_data['LINE_GRAPH'], cls.last_values_cpu_percentage)

Don't really know the dynamic list allocation in python, but there might be a malloc equivalent, or just loop append() method HISTORY_SIZE time...

(sorry for bad style/formatting/exact code, but it's hard on the Steam Deck :D )

What do you think about this ?

Anyway i'll will test if more deeply saturday or sunday.

@mathoudebine
Copy link
Owner Author

Thanks for reviewing it! Did you really type Python code on a Steam Deck ? 😄
I've added a way to set the history size from the theme for line graphs, thanks to what you suggested

@mathoudebine mathoudebine merged commit 9c60f3e into main Feb 19, 2024
@mathoudebine mathoudebine deleted the hicwic/feature/plot-graph branch February 19, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants