subDesTagesMitExtraKaese 4 years ago
parent
commit
a2986d09be
3 changed files with 17 additions and 14 deletions
  1. 14 5
      software/ui/Page_2.py
  2. 2 5
      software/ui/Page_3.py
  3. 1 4
      software/ui/Page_4.py

+ 14 - 5
software/ui/Page_2.py

@@ -8,9 +8,18 @@ class Page_2(tk.Frame):
     tk.Frame.__init__(self, parent)
     label = tk.Label(self, text="Kräfte", font=LARGE_FONT)
     label.pack(pady=10,padx=10)
-    button1 = tk.Button(self, text="Page_0", command=lambda: controller.show_frame(Page_0))
-    button1.pack()
-    button2 = tk.Button(self, text="Page_1", command=lambda: controller.show_frame(Page_1))
-    button2.pack()
+    
+    # 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):
-    pass
+    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}"),
+      ])

+ 2 - 5
software/ui/Page_3.py

@@ -8,9 +8,6 @@ class Page_3(tk.Frame):
     tk.Frame.__init__(self, parent)
     label = tk.Label(self, text="Druck", font=LARGE_FONT)
     label.pack(pady=10,padx=10)
-    button1 = tk.Button(self, text="Page_0", command=lambda: controller.show_frame(Page_0))
-    button1.pack()
-    button2 = tk.Button(self, text="Page_1", command=lambda: controller.show_frame(Page_1))
-    button2.pack()
+
   def update(self):
-    pass
+    controller.getLastValue('adc_0')

+ 1 - 4
software/ui/Page_4.py

@@ -7,9 +7,6 @@ class Page_4(tk.Frame):
     tk.Frame.__init__(self, parent)
     label = tk.Label(self, text="Einstellungen", font=LARGE_FONT)
     label.pack(pady=10,padx=10)
-    button1 = tk.Button(self, text="Page_0", command=lambda: controller.show_frame(Page_0))
-    button1.pack()
-    button2 = tk.Button(self, text="Page_1", command=lambda: controller.show_frame(Page_1))
-    button2.pack()
+
   def update(self):
     pass