Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
System Monitoring Center
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Kayıtlar (commit)
Kenar çubuğunu aç
Hakan Dündar
System Monitoring Center
Commits
772d6019
Kaydet (Commit)
772d6019
authored
Tem 23, 2023
tarafından
Hakan Dündar
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
New: Show GPU usage option (Summary tab)
üst
eaa2e7af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
163 additions
and
10 deletions
+163
-10
POTFILES.in
po/POTFILES.in
+1
-0
Config.py
src/Config.py
+18
-0
GpuMenu.py
src/GpuMenu.py
+4
-5
Libsysmon.py
src/Libsysmon.py
+0
-2
MainWindow.py
src/MainWindow.py
+7
-3
Summary.py
src/Summary.py
+0
-0
SummaryMenu.py
src/SummaryMenu.py
+132
-0
meson.build
src/meson.build
+1
-0
No files found.
po/POTFILES.in
Dosyayı görüntüle @
772d6019
...
...
@@ -26,6 +26,7 @@ src/ServicesDetails.py
src/ServicesMenu.py
src/SettingsWindow.py
src/Summary.py
src/SummaryMenu.py
src/System.py
src/Users.py
src/UsersDetails.py
...
...
src/Config.py
Dosyayı görüntüle @
772d6019
...
...
@@ -76,6 +76,7 @@ class Config:
"""
self
.
config_default_general_general_func
()
self
.
config_default_performance_summary_func
()
self
.
config_default_performance_cpu_func
()
self
.
config_default_performance_memory_func
()
self
.
config_default_performance_disk_func
()
...
...
@@ -106,6 +107,14 @@ class Config:
self
.
main_window_opacity
=
1.0
def
config_default_performance_summary_func
(
self
):
"""
Set default settings (Summary tab).
"""
self
.
summary_show_gpu_usage
=
0
def
config_default_performance_cpu_func
(
self
):
"""
Set default settings (CPU tab).
...
...
@@ -260,6 +269,11 @@ class Config:
else
:
pass
if
"summary_show_gpu_usage"
in
config_variables
:
self
.
summary_show_gpu_usage
=
float
(
config_values
[
config_variables
.
index
(
"summary_show_gpu_usage"
)])
else
:
pass
self
.
chart_line_color_cpu_percent
=
[
float
(
value
)
for
value
in
config_values
[
config_variables
.
index
(
"chart_line_color_cpu_percent"
)]
.
strip
(
"[]"
)
.
split
(
", "
)]
self
.
show_cpu_usage_per_core
=
int
(
config_values
[
config_variables
.
index
(
"show_cpu_usage_per_core"
)])
self
.
performance_cpu_usage_percent_precision
=
int
(
config_values
[
config_variables
.
index
(
"performance_cpu_usage_percent_precision"
)])
...
...
@@ -349,6 +363,10 @@ class Config:
config_write_text
=
config_write_text
+
"main_window_opacity = "
+
str
(
self
.
main_window_opacity
)
+
"
\n
"
config_write_text
=
config_write_text
+
"
\n
"
config_write_text
=
config_write_text
+
"[Performance Tab - Summary]"
+
"
\n
"
config_write_text
=
config_write_text
+
"summary_show_gpu_usage = "
+
str
(
self
.
summary_show_gpu_usage
)
+
"
\n
"
config_write_text
=
config_write_text
+
"
\n
"
config_write_text
=
config_write_text
+
"[Performance Tab - CPU]"
+
"
\n
"
config_write_text
=
config_write_text
+
"chart_line_color_cpu_percent = "
+
str
(
self
.
chart_line_color_cpu_percent
)
+
"
\n
"
config_write_text
=
config_write_text
+
"show_cpu_usage_per_core = "
+
str
(
self
.
show_cpu_usage_per_core
)
+
"
\n
"
...
...
src/GpuMenu.py
Dosyayı görüntüle @
772d6019
import
gi
gi
.
require_version
(
'Gtk'
,
'4.0'
)
gi
.
require_version
(
'Gdk'
,
'4.0'
)
from
gi.repository
import
Gtk
,
Gdk
from
gi.repository
import
Gtk
from
.Config
import
Config
from
.Gpu
import
Gpu
...
...
@@ -39,15 +38,15 @@ class GpuMenu:
# Button (Graph Color)
self
.
graph_color_button
=
Common
.
graph_color_button
(
self
)
main_grid
.
attach
(
self
.
graph_color_button
,
0
,
4
,
2
,
1
)
main_grid
.
attach
(
self
.
graph_color_button
,
0
,
1
,
2
,
1
)
# Separator
separator
=
Common
.
menu_separator
()
main_grid
.
attach
(
separator
,
0
,
5
,
2
,
1
)
main_grid
.
attach
(
separator
,
0
,
2
,
2
,
1
)
# Button (Reset)
self
.
reset_button
=
Common
.
reset_button
()
main_grid
.
attach
(
self
.
reset_button
,
0
,
14
,
2
,
1
)
main_grid
.
attach
(
self
.
reset_button
,
0
,
3
,
2
,
1
)
# Connect signals
self
.
reset_button
.
connect
(
"clicked"
,
self
.
on_reset_button_clicked
)
...
...
src/Libsysmon.py
Dosyayı görüntüle @
772d6019
...
...
@@ -41,8 +41,6 @@ amd_gpu_load_read_frequency = 1 / 120
amd_gpu_load_list
=
[
0
]
# This list is used in order to show full status of the process.
# Some values are required on systems with new kernels even if the opposite
# situation is written in the documentation.
# For more information, see: "https://man7.org/linux/man-pages/man5/proc.5.html".
process_status_dict
=
{
"R"
:
"Running"
,
"S"
:
"Sleeping"
,
"D"
:
"Waiting"
,
"I"
:
"Idle"
,
"Z"
:
"Zombie"
,
"T"
:
"Stopped"
,
"t"
:
"Tracing Stop"
,
"X"
:
"Dead"
,
...
...
src/MainWindow.py
Dosyayı görüntüle @
772d6019
...
...
@@ -536,7 +536,8 @@ class MainWindow():
if
Config
.
current_main_tab
==
0
:
if
Config
.
performance_tab_current_sub_tab
==
0
:
self
.
tab_menu_menubutton
.
set_popover
(
None
)
from
.SummaryMenu
import
SummaryMenu
self
.
tab_menu_menubutton
.
set_popover
(
SummaryMenu
.
menu_po
)
elif
Config
.
performance_tab_current_sub_tab
==
1
:
from
.CpuMenu
import
CpuMenu
...
...
@@ -642,7 +643,7 @@ class MainWindow():
GLib
.
idle_add
(
Summary
.
loop_func
)
# Show device selection list on a listbox between radiobuttons of Performance tab sub-tabs.
self
.
main_gui_device_selection_list
()
self
.
tab_menu_menubutton
.
set_sensitive
(
Fals
e
)
self
.
tab_menu_menubutton
.
set_sensitive
(
Tru
e
)
return
# Switch to "CPU" tab
...
...
@@ -719,7 +720,10 @@ class MainWindow():
if
"Gpu"
not
in
globals
():
global
Gpu
from
.Gpu
import
Gpu
self
.
gpu_tab_main_grid
.
attach
(
Gpu
.
tab_grid
,
0
,
0
,
1
,
1
)
# Grid may have been attached before Summary tab).
child_grid
=
self
.
gpu_tab_main_grid
.
get_child_at
(
0
,
0
)
if
child_grid
==
None
:
self
.
gpu_tab_main_grid
.
attach
(
Gpu
.
tab_grid
,
0
,
0
,
1
,
1
)
GLib
.
idle_add
(
Gpu
.
loop_func
)
try
:
self
.
main_gui_device_selection_list
()
...
...
src/Summary.py
Dosyayı görüntüle @
772d6019
This diff is collapsed.
Click to expand it.
src/SummaryMenu.py
0 → 100644
Dosyayı görüntüle @
772d6019
import
gi
gi
.
require_version
(
'Gtk'
,
'4.0'
)
from
gi.repository
import
Gtk
from
.Config
import
Config
from
.Summary
import
Summary
from
.MainWindow
import
MainWindow
from
.
import
Common
from
.
import
Libsysmon
_tr
=
Config
.
_tr
class
SummaryMenu
:
def
__init__
(
self
):
self
.
name
=
"SummaryMenu"
self
.
menu_gui
()
def
menu_gui
(
self
):
"""
Generate menu GUI.
"""
# Popover
self
.
menu_po
=
Gtk
.
Popover
()
# Grid (main)
main_grid
=
Common
.
menu_main_grid
()
self
.
menu_po
.
set_child
(
main_grid
)
# Label - menu title (Summary)
label
=
Common
.
menu_title_label
(
_tr
(
"Summary"
))
main_grid
.
attach
(
label
,
0
,
0
,
2
,
1
)
# Label (Graph - Show)
label
=
Common
.
title_label
(
_tr
(
"Graph - Show"
))
main_grid
.
attach
(
label
,
0
,
1
,
2
,
1
)
# CheckButton (GPU Usage)
self
.
gpu_usage_cb
=
Common
.
checkbutton
(
_tr
(
"GPU Usage"
),
None
)
main_grid
.
attach
(
self
.
gpu_usage_cb
,
0
,
2
,
2
,
1
)
# Label (This increases CPU usage.)
label
=
Common
.
static_information_label
(
_tr
(
"This increases CPU usage."
))
label
.
set_margin_start
(
20
)
main_grid
.
attach
(
label
,
0
,
3
,
2
,
1
)
# Separator
separator
=
Common
.
menu_separator
()
main_grid
.
attach
(
separator
,
0
,
4
,
2
,
1
)
# Button (Reset)
self
.
reset_button
=
Common
.
reset_button
()
main_grid
.
attach
(
self
.
reset_button
,
0
,
5
,
2
,
1
)
# Connect signals
self
.
reset_button
.
connect
(
"clicked"
,
self
.
on_reset_button_clicked
)
self
.
menu_po
.
connect
(
"show"
,
self
.
on_menu_po_show
)
def
connect_signals
(
self
):
"""
Connect some of the signals to be able to disconnect them for setting GUI.
"""
self
.
gpu_usage_cb
.
connect
(
"toggled"
,
self
.
on_gpu_usage_cb_toggled
)
def
disconnect_signals
(
self
):
"""
Disconnect some of the signals for setting GUI.
"""
self
.
gpu_usage_cb
.
disconnect_by_func
(
self
.
on_gpu_usage_cb_toggled
)
def
on_menu_po_show
(
self
,
widget
):
"""
Run code when menu is shown.
"""
try
:
self
.
disconnect_signals
()
except
TypeError
:
pass
self
.
set_gui
()
self
.
connect_signals
()
def
on_gpu_usage_cb_toggled
(
self
,
widget
):
"""
Show/Hide GPU usage percentage graphics.
"""
if
widget
.
get_active
()
==
True
:
Config
.
summary_show_gpu_usage
=
1
if
widget
.
get_active
()
==
False
:
Config
.
summary_show_gpu_usage
=
0
Common
.
save_tab_settings
(
Summary
)
def
on_reset_button_clicked
(
self
,
widget
):
"""
Reset all tab settings.
"""
# Load default settings
Config
.
config_default_performance_summary_func
()
Config
.
config_save_func
()
Common
.
update_tab_and_menu_gui
(
self
,
Summary
)
def
set_gui
(
self
):
"""
Set menu GUI items.
"""
# Set active checkbuttons if disk read speed/disk write speed values are "1".
if
Config
.
summary_show_gpu_usage
==
1
:
self
.
gpu_usage_cb
.
set_active
(
True
)
if
Config
.
summary_show_gpu_usage
==
0
:
self
.
gpu_usage_cb
.
set_active
(
False
)
SummaryMenu
=
SummaryMenu
()
src/meson.build
Dosyayı görüntüle @
772d6019
...
...
@@ -52,6 +52,7 @@ system_monitoring_center_sources = [
'ServicesMenu.py',
'SettingsWindow.py',
'Summary.py',
'SummaryMenu.py',
'System.py',
'Users.py',
'UsersDetails.py',
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment