import tkinter as tk import tk_tools from .globals import * class Page_2(tk.Frame): def __init__(self, parent, controller): tk.Frame.__init__(self, parent) label = tk.Label(self, text="Kräfte", font=LARGE_FONT) label.pack(pady=10,padx=10) # graphs self.forcePlots = [Plot(20, 3), Plot(20, 3), Plot(20, 3)] for plot in self.forcePlots: canvas = FigureCanvasTkAgg(plot.fig, self) canvas.draw() canvas.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH, expand=True) canvas._tkcanvas.pack(side=tk.LEFT, fill=tk.BOTH, expand=True) def update(self): for i in range(3): self.forcePlots.update([ controller.getLastValue(f"force_X_{i}"), controller.getLastValue(f"force_Y_{i}"), controller.getLastValue(f"force_Z_{i}"), ])