123456789101112131415161718192021222324252627 |
- import tkinter as tk
- import tk_tools
- from .Plot import Plot
- from .globals import *
- class Page_2(tk.Frame):
- def __init__(self, parent, controller):
- tk.Frame.__init__(self, parent)
- self.controller = controller
- label = tk.Label(self, text="Kräfte", font=LARGE_FONT)
- label.pack(pady=10,padx=10)
-
- # graphs
- self.forcePlot = Plot(nPoints=100, xaxis=(-2, 2), yaxis=(-2, 2), nGraphs=3,
- ytitle="y-Kraft [mV]",
- xtitle="x-Kraft [mV]",
- title="XY-Graph",
- line_colors=["#2222ff", "#22ff22", "#ff2222"])
- canvas = self.forcePlot.create_canvas(self)
- canvas.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
- def update(self, visible):
- self.forcePlot.update(
- xs=[self.controller.getLastValue("force_X_{}".format(i+1)) for i in range(3)],
- ys=[self.controller.getLastValue("force_Y_{}".format(i+1)) for i in range(3)],
- visible=visible
- )
|