Ejemplo n.º 1
0
    def update_displayed_information(self):
        """ Update all the graphs that are being displayed """

        for source in self.controller.sources:
            source_name = source.get_source_name()
            if (any(self.graphs_menu.active_sensors[source_name])
                    or any(self.summary_menu.active_sensors[source_name])):
                source.update()

        for graph in self.visible_graphs.values():
            try:
                graph.update()
            except IndexError:
                logging.debug("Graph update failed")
                pass

        # update graph summery
        for summary in self.visible_summaries.values():
            try:
                summary.update()
            except IndexError:
                logging.debug("Summary update failed")
                pass

        # Only update clock if not is stress mode
        if self.controller.stress_conroller.get_current_mode() != 'Monitor':
            self.clock_view.set_text(
                seconds_to_text((timeit.default_timer() -
                                 self.controller.stress_start_time)))
Ejemplo n.º 2
0
from s_tui.sturwid.ui_elements import button
from s_tui.sturwid.ui_elements import DEFAULT_PALETTE
from s_tui.sturwid.bar_graph_vector import BarGraphVector
from s_tui.sturwid.summary_text_list import SummaryTextList
# Sources
from s_tui.sources.util_source import UtilSource
from s_tui.sources.freq_source import FreqSource
from s_tui.sources.temp_source import TempSource
from s_tui.sources.rapl_power_source import RaplPowerSource
from s_tui.sources.fan_source import FanSource
from s_tui.sources.script_hook_loader import ScriptHookLoader

UPDATE_INTERVAL = 1
HOOK_INTERVAL = 30 * 1000
DEGREE_SIGN = u'\N{DEGREE SIGN}'
ZERO_TIME = seconds_to_text(0)

DEFAULT_LOG_FILE = "_s-tui.log"

DEFAULT_CSV_FILE = "s-tui_log_" + time.strftime("%Y-%m-%d_%H_%M_%S") + ".csv"

VERSION_MESSAGE = \
    "s-tui " + __version__ +\
    " - (C) 2017-2020 Alex Manuskin, Gil Tsuker\n\
    Released under GNU GPLv2"

ERROR_MESSAGE = "\n\
        Oops! s-tui has encountered a fatal error\n\
        Please report this bug here: https://github.com/amanusk/s-tui"

graph_controller = None