# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NvidiaProprietary # # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual # property and proprietary rights in and to this material, related # documentation and any modifications thereto. Any use, reproduction, # disclosure or distribution of this material and related documentation # without an express license agreement from NVIDIA CORPORATION or # its affiliates is strictly prohibited. from tkinter import StringVar from tkinter.ttk import Frame, Label from ...utils.common import PAttrs, PNames from ...utils.datacenter import platform_get_name from ...utils.layoutmanager import fill_parent, grid_span, padding from ...utils.subjectobserver import Observer class InfoFrame(Frame, Observer): def __init__(self, master=None, **kwargs): super().__init__(master, **kwargs) self.create_widgets() self.manage_layout() fill_parent(self) def create_widgets(self): self.power_mode_v = StringVar() self.platform_l = Label(self, text="Platform: " + platform_get_name()) self.power_mode_l = Label(self, textvariable=self.power_mode_v) def manage_layout(self): self.platform_l.grid(row=0, column=0, rowspan=1, columnspan=2, **padding) self.power_mode_l.grid(row=0, column=2, rowspan=1, columnspan=2, **padding) def update_data(self, data): self.power_mode_v.set( f"nvpmodel: {data[(PNames.NVPMODEL, PAttrs.POWER_MODE)]}")