Преглед на файлове

Merge branch 'master' of ssh://dyndns.wheretonext.de:8822/subDesTagesMitExtraKaese/windkanal

subDesTagesMitExtraKaese преди 4 години
родител
ревизия
fbc7d04edb
променени са 7 файла, в които са добавени 238 реда и са изтрити 709 реда
  1. 0 6
      software/ui/build.sh
  2. 0 145
      software/ui/main_ui.py
  3. 0 212
      software/ui/main_ui.ui
  4. 0 12
      software/ui/makefile
  5. 238 0
      software/ui/tkinter_windkanal.py
  6. 0 134
      software/ui/windkanal.py
  7. 0 200
      software/ui/windkanal.ui

+ 0 - 6
software/ui/build.sh

@@ -1,6 +0,0 @@
-#!/bin/bash
-
-cd "$(dirname "$0")"
-
-make clean
-make

+ 0 - 145
software/ui/main_ui.py

@@ -1,145 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'main_ui.ui'
-#
-# Created by: PyQt5 UI code generator 5.14.1
-#
-# WARNING! All changes made in this file will be lost!
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_MainWindow(object):
-    def setupUi(self, MainWindow):
-        MainWindow.setObjectName("MainWindow")
-        MainWindow.resize(947, 722)
-        self.centralwidget = QtWidgets.QWidget(MainWindow)
-        self.centralwidget.setObjectName("centralwidget")
-        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
-        self.gridLayout.setObjectName("gridLayout")
-        self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
-        self.tabWidget.setObjectName("tabWidget")
-        self.tab = QtWidgets.QWidget()
-        self.tab.setObjectName("tab")
-        self.gridLayout_3 = QtWidgets.QGridLayout(self.tab)
-        self.gridLayout_3.setObjectName("gridLayout_3")
-        self.tab1menu = QtWidgets.QGridLayout()
-        self.tab1menu.setContentsMargins(-1, 30, -1, -1)
-        self.tab1menu.setObjectName("tab1menu")
-        self.gridLCD = QtWidgets.QGridLayout()
-        self.gridLCD.setObjectName("gridLCD")
-        self.lcdNumber_pressure = QtWidgets.QLCDNumber(self.tab)
-        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
-        sizePolicy.setHorizontalStretch(0)
-        sizePolicy.setVerticalStretch(100)
-        sizePolicy.setHeightForWidth(self.lcdNumber_pressure.sizePolicy().hasHeightForWidth())
-        self.lcdNumber_pressure.setSizePolicy(sizePolicy)
-        self.lcdNumber_pressure.setMinimumSize(QtCore.QSize(100, 100))
-        self.lcdNumber_pressure.setObjectName("lcdNumber_pressure")
-        self.gridLCD.addWidget(self.lcdNumber_pressure, 1, 0, 1, 1)
-        self.label = QtWidgets.QLabel(self.tab)
-        self.label.setObjectName("label")
-        self.gridLCD.addWidget(self.label, 0, 0, 1, 1)
-        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
-        self.gridLCD.addItem(spacerItem, 1, 1, 1, 1)
-        self.tab1menu.addLayout(self.gridLCD, 0, 1, 1, 1)
-        self.gridLayout_5 = QtWidgets.QGridLayout()
-        self.gridLayout_5.setContentsMargins(20, -1, -1, -1)
-        self.gridLayout_5.setObjectName("gridLayout_5")
-        self.formLayout = QtWidgets.QFormLayout()
-        self.formLayout.setObjectName("formLayout")
-        self.label_2 = QtWidgets.QLabel(self.tab)
-        self.label_2.setObjectName("label_2")
-        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
-        self.pushButton_5 = QtWidgets.QPushButton(self.tab)
-        self.pushButton_5.setObjectName("pushButton_5")
-        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.pushButton_5)
-        self.label_3 = QtWidgets.QLabel(self.tab)
-        self.label_3.setObjectName("label_3")
-        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_3)
-        self.pushButton_4 = QtWidgets.QPushButton(self.tab)
-        self.pushButton_4.setObjectName("pushButton_4")
-        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.pushButton_4)
-        self.label_4 = QtWidgets.QLabel(self.tab)
-        self.label_4.setObjectName("label_4")
-        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_4)
-        self.pushButton_3 = QtWidgets.QPushButton(self.tab)
-        self.pushButton_3.setObjectName("pushButton_3")
-        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.pushButton_3)
-        self.gridLayout_5.addLayout(self.formLayout, 1, 0, 1, 1)
-        self.tab1menu.addLayout(self.gridLayout_5, 0, 2, 1, 1)
-        self.gridLayout_3.addLayout(self.tab1menu, 0, 0, 1, 1)
-        self.tabWidget.addTab(self.tab, "")
-        self.tab_2 = QtWidgets.QWidget()
-        self.tab_2.setObjectName("tab_2")
-        self.tabWidget.addTab(self.tab_2, "")
-        self.tab_3 = QtWidgets.QWidget()
-        self.tab_3.setObjectName("tab_3")
-        self.tabWidget.addTab(self.tab_3, "")
-        self.tab_4 = QtWidgets.QWidget()
-        self.tab_4.setObjectName("tab_4")
-        self.tabWidget.addTab(self.tab_4, "")
-        self.tab_5 = QtWidgets.QWidget()
-        self.tab_5.setObjectName("tab_5")
-        self.tabWidget.addTab(self.tab_5, "")
-        self.tab_6 = QtWidgets.QWidget()
-        self.tab_6.setObjectName("tab_6")
-        self.tabWidget.addTab(self.tab_6, "")
-        self.tab_7 = QtWidgets.QWidget()
-        self.tab_7.setObjectName("tab_7")
-        self.tabWidget.addTab(self.tab_7, "")
-        self.tab_8 = QtWidgets.QWidget()
-        self.tab_8.setObjectName("tab_8")
-        self.tabWidget.addTab(self.tab_8, "")
-        self.gridLayout.addWidget(self.tabWidget, 0, 0, 2, 1)
-        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
-        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
-        self.saveButton = QtWidgets.QPushButton(self.centralwidget)
-        self.saveButton.setObjectName("saveButton")
-        self.horizontalLayout_2.addWidget(self.saveButton)
-        self.gridLayout.addLayout(self.horizontalLayout_2, 3, 0, 1, 1)
-        MainWindow.setCentralWidget(self.centralwidget)
-        self.menubar = QtWidgets.QMenuBar(MainWindow)
-        self.menubar.setGeometry(QtCore.QRect(0, 0, 947, 22))
-        self.menubar.setObjectName("menubar")
-        self.menuFile = QtWidgets.QMenu(self.menubar)
-        self.menuFile.setObjectName("menuFile")
-        self.menuEdit = QtWidgets.QMenu(self.menubar)
-        self.menuEdit.setObjectName("menuEdit")
-        self.menuView = QtWidgets.QMenu(self.menubar)
-        self.menuView.setObjectName("menuView")
-        MainWindow.setMenuBar(self.menubar)
-        self.statusbar = QtWidgets.QStatusBar(MainWindow)
-        self.statusbar.setObjectName("statusbar")
-        MainWindow.setStatusBar(self.statusbar)
-        self.menubar.addAction(self.menuFile.menuAction())
-        self.menubar.addAction(self.menuEdit.menuAction())
-        self.menubar.addAction(self.menuView.menuAction())
-
-        self.retranslateUi(MainWindow)
-        self.tabWidget.setCurrentIndex(0)
-        QtCore.QMetaObject.connectSlotsByName(MainWindow)
-
-    def retranslateUi(self, MainWindow):
-        _translate = QtCore.QCoreApplication.translate
-        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
-        self.label.setText(_translate("MainWindow", "Anzeige1"))
-        self.label_2.setText(_translate("MainWindow", "TextLabel"))
-        self.pushButton_5.setText(_translate("MainWindow", "PushButton"))
-        self.label_3.setText(_translate("MainWindow", "TextLabel"))
-        self.pushButton_4.setText(_translate("MainWindow", "PushButton"))
-        self.label_4.setText(_translate("MainWindow", "TextLabel"))
-        self.pushButton_3.setText(_translate("MainWindow", "PushButton"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Fenster1"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Fenster2"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Fenster3"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), _translate("MainWindow", "Fenster4"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), _translate("MainWindow", "Fenster5"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_6), _translate("MainWindow", "Fenster6"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_7), _translate("MainWindow", "Fenster7"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_8), _translate("MainWindow", "Fenster8"))
-        self.saveButton.setText(_translate("MainWindow", "save"))
-        self.menuFile.setTitle(_translate("MainWindow", "File"))
-        self.menuEdit.setTitle(_translate("MainWindow", "Edit"))
-        self.menuView.setTitle(_translate("MainWindow", "View"))

+ 0 - 212
software/ui/main_ui.ui

@@ -1,212 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>947</width>
-    <height>722</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>MainWindow</string>
-  </property>
-  <widget class="QWidget" name="centralwidget">
-   <layout class="QGridLayout" name="gridLayout">
-    <item row="0" column="0" rowspan="2">
-     <widget class="QTabWidget" name="tabWidget">
-      <property name="currentIndex">
-       <number>0</number>
-      </property>
-      <widget class="QWidget" name="tab">
-       <attribute name="title">
-        <string>Fenster1</string>
-       </attribute>
-       <layout class="QGridLayout" name="gridLayout_3">
-        <item row="0" column="0">
-         <layout class="QGridLayout" name="tab1menu">
-          <property name="topMargin">
-           <number>30</number>
-          </property>
-          <item row="0" column="1">
-           <layout class="QGridLayout" name="gridLCD">
-            <item row="1" column="0">
-             <widget class="QLCDNumber" name="lcdNumber_pressure">
-              <property name="sizePolicy">
-               <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-                <horstretch>0</horstretch>
-                <verstretch>100</verstretch>
-               </sizepolicy>
-              </property>
-              <property name="minimumSize">
-               <size>
-                <width>100</width>
-                <height>100</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item row="0" column="0">
-             <widget class="QLabel" name="label">
-              <property name="text">
-               <string>Anzeige1</string>
-              </property>
-             </widget>
-            </item>
-            <item row="1" column="1">
-             <spacer name="horizontalSpacer">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-           </layout>
-          </item>
-          <item row="0" column="2">
-           <layout class="QGridLayout" name="gridLayout_5">
-            <property name="leftMargin">
-             <number>20</number>
-            </property>
-            <item row="1" column="0">
-             <layout class="QFormLayout" name="formLayout">
-              <item row="0" column="0">
-               <widget class="QLabel" name="label_2">
-                <property name="text">
-                 <string>TextLabel</string>
-                </property>
-               </widget>
-              </item>
-              <item row="0" column="1">
-               <widget class="QPushButton" name="pushButton_5">
-                <property name="text">
-                 <string>PushButton</string>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="0">
-               <widget class="QLabel" name="label_3">
-                <property name="text">
-                 <string>TextLabel</string>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="1">
-               <widget class="QPushButton" name="pushButton_4">
-                <property name="text">
-                 <string>PushButton</string>
-                </property>
-               </widget>
-              </item>
-              <item row="2" column="0">
-               <widget class="QLabel" name="label_4">
-                <property name="text">
-                 <string>TextLabel</string>
-                </property>
-               </widget>
-              </item>
-              <item row="2" column="1">
-               <widget class="QPushButton" name="pushButton_3">
-                <property name="text">
-                 <string>PushButton</string>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="tab_2">
-       <attribute name="title">
-        <string>Fenster2</string>
-       </attribute>
-      </widget>
-      <widget class="QWidget" name="tab_3">
-       <attribute name="title">
-        <string>Fenster3</string>
-       </attribute>
-      </widget>
-      <widget class="QWidget" name="tab_4">
-       <attribute name="title">
-        <string>Fenster4</string>
-       </attribute>
-      </widget>
-      <widget class="QWidget" name="tab_5">
-       <attribute name="title">
-        <string>Fenster5</string>
-       </attribute>
-      </widget>
-      <widget class="QWidget" name="tab_6">
-       <attribute name="title">
-        <string>Fenster6</string>
-       </attribute>
-      </widget>
-      <widget class="QWidget" name="tab_7">
-       <attribute name="title">
-        <string>Fenster7</string>
-       </attribute>
-      </widget>
-      <widget class="QWidget" name="tab_8">
-       <attribute name="title">
-        <string>Fenster8</string>
-       </attribute>
-      </widget>
-     </widget>
-    </item>
-    <item row="3" column="0">
-     <layout class="QHBoxLayout" name="horizontalLayout_2">
-      <item>
-       <widget class="QPushButton" name="saveButton">
-        <property name="text">
-         <string>save</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>947</width>
-     <height>22</height>
-    </rect>
-   </property>
-   <widget class="QMenu" name="menuFile">
-    <property name="title">
-     <string>File</string>
-    </property>
-   </widget>
-   <widget class="QMenu" name="menuEdit">
-    <property name="title">
-     <string>Edit</string>
-    </property>
-   </widget>
-   <widget class="QMenu" name="menuView">
-    <property name="title">
-     <string>View</string>
-    </property>
-   </widget>
-   <addaction name="menuFile"/>
-   <addaction name="menuEdit"/>
-   <addaction name="menuView"/>
-  </widget>
-  <widget class="QStatusBar" name="statusbar"/>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 12
software/ui/makefile

@@ -1,12 +0,0 @@
-UIFILES := $(wildcard *.ui)
-PYFILES := $(UIFILES:.ui=.py)    
-
-CC = python3 -m PyQt5.uic.pyuic
-
-all: $(PYFILES)
-
-%.py: %.ui
-	$(CC) -o $@ $< 
-
-clean:
-	rm $(PYFILES)

+ 238 - 0
software/ui/tkinter_windkanal.py

@@ -0,0 +1,238 @@
+# The code for changing pages was derived from: http://stackoverflow.com/questions/7546050/switch-between-two-frames-in-tkinter
+# License: http://creativecommons.org/licenses/by-sa/3.0/	
+
+import matplotlib
+from matplotlib.backends.backend_tkagg import (
+    FigureCanvasTkAgg, NavigationToolbar2Tk)
+from matplotlib.figure import Figure
+import matplotlib.animation as animation
+from matplotlib import style
+
+import tkinter as tk
+import serial
+import tk_tools
+import threading
+import queue
+from time import *
+
+LARGE_FONT= ("Verdana", 12)
+style.use("ggplot")
+
+#initialize serial port
+ser = serial.Serial()
+ser.port = '/dev/ttyUSB0' #Arduino serial port
+ser.baudrate = 9600
+ser.timeout = 10 #specify timeout when using readline()
+ser.open()
+if ser.is_open==True:
+    print("\nAll right, serial port now open. Configuration:\n")
+    print(ser, "\n") #print serial parameters
+
+fig = Figure()
+ax = fig.add_subplot(111)
+xs = [] #store trials here (n)
+ys = [] #store relative frequency here
+
+class getdata(threading.Thread):
+    def __init__(self, label, t, q):
+        threading.Thread.__init__(self)       
+        self.jobqueue = q # get job queue for sending commands
+        self.t = t 
+
+       
+    def run(self):
+        while True:# and self.mb.entrycget(1,"label")=="Stop":
+            sleep(0.1) # wait a second
+            SerialObj = Serial()
+            self.t = SerialObj.animate(self)
+
+            # send to job queue !!!
+            self.jobqueue.put(("cnt_label",self.t))
+
+class Serial(tk.Tk):
+    def __init__(self):
+        tk.Frame.__init__(self)
+
+    def animate(i,self):
+        line=ser.readline()      #ascii
+        line_as_list = line.split(b',')
+        i = int(line_as_list[0])
+        relProb = line_as_list[1]
+        relProb_as_list = relProb.split(b'\n')
+        relProb_float = float(relProb_as_list[0])
+        # Add x and y to lists
+        xs.append(i)
+        ys.append(relProb_float)
+
+
+        ax.clear()
+        ax.plot(xs, ys, "#00A3E0", label="1. Graph")
+        ax.legend(bbox_to_anchor=(0, 1.02, 1, .102), loc=3, ncol=2, borderaxespad=0)
+        ax.set_title('Windkanal')
+
+        return relProb_float
+       
+
+class Main(tk.Tk):
+    def __init__(self, *args, **kwargs):
+        tk.Tk.__init__(self, *args, **kwargs)
+        tk.Tk.wm_title(self, "Windkanal-Tool")
+        
+        
+        container = tk.Frame(self)
+        container.pack(side="top", fill="both", expand = True)
+        container.grid_rowconfigure(0, weight=1)
+        container.grid_columnconfigure(0, weight=1)
+
+
+        menubar = tk.Menu(container)
+        filemenu = tk.Menu(menubar, tearoff=0)
+        filemenu.add_command(label="Save settings", command = lambda: self.popupmsg("Not supported just yet!"))
+        filemenu.add_separator()
+        filemenu.add_command(label="Exit", command=quit)
+        menubar.add_cascade(label="File", menu=filemenu)
+
+        tk.Tk.config(self, menu=menubar)
+
+        self.frames = {}
+
+        for F in (Page_1, Page_2, Page_3, Page_4):
+
+            frame = F(container, self)
+
+            self.frames[F] = frame
+
+            frame.grid(row=0, column=0, sticky="nsew")
+
+        self.show_frame(Page_1)
+
+    def show_frame(self, cont):
+        frame = self.frames[cont]
+        frame.tkraise()
+
+    def popupmsg(self, msg=""):
+        popup = tk.Toplevel(self.master)
+        popup.wm_title("Error!")
+        label = tk.Label(popup, text=msg, font=LARGE_FONT)
+        label.pack(side="top", fill="x", pady=10)
+        b1 = tk.Button(popup, text="Okay", command=popup.destroy)
+        b1.pack()
+
+class Page_4(tk.Frame):
+    def __init__(self, parent, controller):
+        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()
+
+class Page_3(tk.Frame):
+    def __init__(self, parent, controller):
+        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()
+
+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)
+        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()
+
+
+
+class Page_1(tk.Frame):
+    def __init__(self, parent, controller):
+        tk.Frame.__init__(self, parent)
+        self.t = 0
+        label = tk.Label(self, text="Bedienelemente", font=LARGE_FONT)
+        label.pack(pady=10,padx=10)
+        # top menu
+        top = tk.Frame(self, borderwidth=2, relief="solid")
+        button1 = tk.Button(top, text="Bedienelemente", command=lambda: controller.show_frame(Page_0))
+        button1.pack(side=tk.LEFT)
+
+        button2 = tk.Button(top, text="Kräfte", command=lambda: controller.show_frame(Page_2))
+        button2.pack(side=tk.LEFT)
+
+        button3 = tk.Button(top, text="Druck", command=lambda: controller.show_frame(Page_2))
+        button3.pack(side=tk.LEFT)
+
+        button4 = tk.Button(top,text="Einstellungen",command=lambda: controller.show_frame(Page_2))
+        button4.pack(side=tk.LEFT)
+
+        button5 = tk.Button(top, text="QUIT", fg="red",command=quit)
+        button5.pack(side=tk.LEFT)
+        top.pack(side="top", expand=True, fill="both")
+        # graph
+        canvas = FigureCanvasTkAgg(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)
+        # right menu
+        left = tk.Frame(self, borderwidth=2, relief="solid")
+        container = tk.Frame(left, borderwidth=2, relief="solid")
+        label1 = tk.Label(container, text="I could be a canvas, but I'm a label right now")
+
+        SerialObj = Serial()
+        #p = tk_tools.RotaryScale(self, max_value=22.0, unit='m/s')
+        #p.pack()
+        #p.set_value(SerialObj.animate(self))
+        #print(SerialObj.animate(self))
+
+        self.seconds = SerialObj.animate(self)
+
+        self.label4 = tk.Label(self,font=("Arial","30"),fg="red")
+        self.label4.pack()
+        self.label4.config(text=str(self.t))
+
+        self.q = queue.Queue() # Make job queue (Queue)
+        offswitch = threading.Event() # Make offswitch (Event)
+        
+        #self.label4.after(100,self.label_update)
+        
+        cd = getdata(self.label4, self.t, self.q)
+        cd.start()
+
+        SendButton = tk.Button(left, text='Quit', command=quit)
+        label2 = tk.Label(left, text="I could be a button")
+        label3 = tk.Label(left, text="So could I")
+
+        left.pack(side="left", expand=True, fill="both")
+        container.pack(expand=True, fill="both", padx=7, pady=5)
+        SendButton.pack()
+
+        label1.pack()
+        label2.pack()
+        label3.pack()
+
+    def label_update(self):
+        job = self.q.get() #get job form queue!!!
+
+        
+        if job[0] == "cnt_label":
+            self.label4.config(text=str(job[1]) + " Nm")
+        else:
+            print("Unknown job:", job)
+            
+        self.label4.after(100,self.label_update)
+
+
+    def sendFactorToMCU(self):
+        self.serialReference.sendSerialData(self.entry.get() + '%')
+
+
+app = Main()
+app.geometry("1280x720")
+SerialObj = Serial()
+ani = animation.FuncAnimation(fig, SerialObj.animate, interval=500)
+app.mainloop()

+ 0 - 134
software/ui/windkanal.py

@@ -1,134 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'windkanal.ui'
-#
-# Created by: PyQt5 UI code generator 5.14.1
-#
-# WARNING! All changes made in this file will be lost!
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_Form(object):
-    def setupUi(self, Form):
-        Form.setObjectName("Form")
-        Form.resize(998, 600)
-        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
-        sizePolicy.setHorizontalStretch(0)
-        sizePolicy.setVerticalStretch(0)
-        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
-        Form.setSizePolicy(sizePolicy)
-        self.gridLayout = QtWidgets.QGridLayout(Form)
-        self.gridLayout.setObjectName("gridLayout")
-        self.gridLayout_2 = QtWidgets.QGridLayout()
-        self.gridLayout_2.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
-        self.gridLayout_2.setContentsMargins(-1, 0, -1, -1)
-        self.gridLayout_2.setObjectName("gridLayout_2")
-        self.pushButton_2 = QtWidgets.QPushButton(Form)
-        self.pushButton_2.setObjectName("pushButton_2")
-        self.gridLayout_2.addWidget(self.pushButton_2, 0, 1, 1, 1)
-        self.pushButton = QtWidgets.QPushButton(Form)
-        self.pushButton.setObjectName("pushButton")
-        self.gridLayout_2.addWidget(self.pushButton, 0, 0, 1, 1)
-        self.gridLayout.addLayout(self.gridLayout_2, 1, 1, 1, 1)
-        self.tabWidget = QtWidgets.QTabWidget(Form)
-        self.tabWidget.setObjectName("tabWidget")
-        self.tab = QtWidgets.QWidget()
-        self.tab.setObjectName("tab")
-        self.gridLayout_3 = QtWidgets.QGridLayout(self.tab)
-        self.gridLayout_3.setObjectName("gridLayout_3")
-        self.tab1menu = QtWidgets.QGridLayout()
-        self.tab1menu.setContentsMargins(-1, 30, -1, -1)
-        self.tab1menu.setObjectName("tab1menu")
-        self.gridLCD = QtWidgets.QGridLayout()
-        self.gridLCD.setObjectName("gridLCD")
-        self.lcdNumber = QtWidgets.QLCDNumber(self.tab)
-        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
-        sizePolicy.setHorizontalStretch(0)
-        sizePolicy.setVerticalStretch(100)
-        sizePolicy.setHeightForWidth(self.lcdNumber.sizePolicy().hasHeightForWidth())
-        self.lcdNumber.setSizePolicy(sizePolicy)
-        self.lcdNumber.setMinimumSize(QtCore.QSize(100, 100))
-        self.lcdNumber.setObjectName("lcdNumber")
-        self.gridLCD.addWidget(self.lcdNumber, 1, 0, 1, 1)
-        self.label = QtWidgets.QLabel(self.tab)
-        self.label.setObjectName("label")
-        self.gridLCD.addWidget(self.label, 0, 0, 1, 1)
-        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
-        self.gridLCD.addItem(spacerItem, 1, 1, 1, 1)
-        self.tab1menu.addLayout(self.gridLCD, 0, 1, 1, 1)
-        self.gridLayout_5 = QtWidgets.QGridLayout()
-        self.gridLayout_5.setContentsMargins(20, -1, -1, -1)
-        self.gridLayout_5.setObjectName("gridLayout_5")
-        self.formLayout = QtWidgets.QFormLayout()
-        self.formLayout.setObjectName("formLayout")
-        self.label_2 = QtWidgets.QLabel(self.tab)
-        self.label_2.setObjectName("label_2")
-        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
-        self.pushButton_5 = QtWidgets.QPushButton(self.tab)
-        self.pushButton_5.setObjectName("pushButton_5")
-        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.pushButton_5)
-        self.label_3 = QtWidgets.QLabel(self.tab)
-        self.label_3.setObjectName("label_3")
-        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_3)
-        self.pushButton_4 = QtWidgets.QPushButton(self.tab)
-        self.pushButton_4.setObjectName("pushButton_4")
-        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.pushButton_4)
-        self.label_4 = QtWidgets.QLabel(self.tab)
-        self.label_4.setObjectName("label_4")
-        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_4)
-        self.pushButton_3 = QtWidgets.QPushButton(self.tab)
-        self.pushButton_3.setObjectName("pushButton_3")
-        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.pushButton_3)
-        self.gridLayout_5.addLayout(self.formLayout, 1, 0, 1, 1)
-        self.tab1menu.addLayout(self.gridLayout_5, 0, 2, 1, 1)
-        self.gridLayout_3.addLayout(self.tab1menu, 0, 0, 1, 1)
-        self.tabWidget.addTab(self.tab, "")
-        self.tab_2 = QtWidgets.QWidget()
-        self.tab_2.setObjectName("tab_2")
-        self.tabWidget.addTab(self.tab_2, "")
-        self.tab_3 = QtWidgets.QWidget()
-        self.tab_3.setObjectName("tab_3")
-        self.tabWidget.addTab(self.tab_3, "")
-        self.tab_4 = QtWidgets.QWidget()
-        self.tab_4.setObjectName("tab_4")
-        self.tabWidget.addTab(self.tab_4, "")
-        self.tab_5 = QtWidgets.QWidget()
-        self.tab_5.setObjectName("tab_5")
-        self.tabWidget.addTab(self.tab_5, "")
-        self.tab_6 = QtWidgets.QWidget()
-        self.tab_6.setObjectName("tab_6")
-        self.tabWidget.addTab(self.tab_6, "")
-        self.tab_7 = QtWidgets.QWidget()
-        self.tab_7.setObjectName("tab_7")
-        self.tabWidget.addTab(self.tab_7, "")
-        self.tab_8 = QtWidgets.QWidget()
-        self.tab_8.setObjectName("tab_8")
-        self.tabWidget.addTab(self.tab_8, "")
-        self.gridLayout.addWidget(self.tabWidget, 0, 1, 1, 1)
-
-        self.retranslateUi(Form)
-        self.tabWidget.setCurrentIndex(0)
-        QtCore.QMetaObject.connectSlotsByName(Form)
-
-    def retranslateUi(self, Form):
-        _translate = QtCore.QCoreApplication.translate
-        Form.setWindowTitle(_translate("Form", "Form"))
-        self.pushButton_2.setText(_translate("Form", "PushButton"))
-        self.pushButton.setText(_translate("Form", "PushButton"))
-        self.label.setText(_translate("Form", "Anzeige1"))
-        self.label_2.setText(_translate("Form", "TextLabel"))
-        self.pushButton_5.setText(_translate("Form", "PushButton"))
-        self.label_3.setText(_translate("Form", "TextLabel"))
-        self.pushButton_4.setText(_translate("Form", "PushButton"))
-        self.label_4.setText(_translate("Form", "TextLabel"))
-        self.pushButton_3.setText(_translate("Form", "PushButton"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("Form", "Fenster1"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("Form", "Fenster2"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("Form", "Fenster3"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), _translate("Form", "Fenster4"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), _translate("Form", "Fenster5"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_6), _translate("Form", "Fenster6"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_7), _translate("Form", "Fenster7"))
-        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_8), _translate("Form", "Fenster8"))

+ 0 - 200
software/ui/windkanal.ui

@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Form</class>
- <widget class="QWidget" name="Form">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>998</width>
-    <height>600</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="1" column="1">
-    <layout class="QGridLayout" name="gridLayout_2">
-     <property name="sizeConstraint">
-      <enum>QLayout::SetDefaultConstraint</enum>
-     </property>
-     <property name="topMargin">
-      <number>0</number>
-     </property>
-     <item row="0" column="1">
-      <widget class="QPushButton" name="pushButton_2">
-       <property name="text">
-        <string>PushButton</string>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="0">
-      <widget class="QPushButton" name="pushButton">
-       <property name="text">
-        <string>PushButton</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item row="0" column="1">
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="tab">
-      <attribute name="title">
-       <string>Fenster1</string>
-      </attribute>
-      <layout class="QGridLayout" name="gridLayout_3">
-       <item row="0" column="0">
-        <layout class="QGridLayout" name="tab1menu">
-         <property name="topMargin">
-          <number>30</number>
-         </property>
-         <item row="0" column="1">
-          <layout class="QGridLayout" name="gridLCD">
-           <item row="1" column="0">
-            <widget class="QLCDNumber" name="lcdNumber">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-               <horstretch>0</horstretch>
-               <verstretch>100</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="minimumSize">
-              <size>
-               <width>100</width>
-               <height>100</height>
-              </size>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="0">
-            <widget class="QLabel" name="label">
-             <property name="text">
-              <string>Anzeige1</string>
-             </property>
-            </widget>
-           </item>
-           <item row="1" column="1">
-            <spacer name="horizontalSpacer">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-         <item row="0" column="2">
-          <layout class="QGridLayout" name="gridLayout_5">
-           <property name="leftMargin">
-            <number>20</number>
-           </property>
-           <item row="1" column="0">
-            <layout class="QFormLayout" name="formLayout">
-             <item row="0" column="0">
-              <widget class="QLabel" name="label_2">
-               <property name="text">
-                <string>TextLabel</string>
-               </property>
-              </widget>
-             </item>
-             <item row="0" column="1">
-              <widget class="QPushButton" name="pushButton_5">
-               <property name="text">
-                <string>PushButton</string>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="0">
-              <widget class="QLabel" name="label_3">
-               <property name="text">
-                <string>TextLabel</string>
-               </property>
-              </widget>
-             </item>
-             <item row="1" column="1">
-              <widget class="QPushButton" name="pushButton_4">
-               <property name="text">
-                <string>PushButton</string>
-               </property>
-              </widget>
-             </item>
-             <item row="2" column="0">
-              <widget class="QLabel" name="label_4">
-               <property name="text">
-                <string>TextLabel</string>
-               </property>
-              </widget>
-             </item>
-             <item row="2" column="1">
-              <widget class="QPushButton" name="pushButton_3">
-               <property name="text">
-                <string>PushButton</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_2">
-      <attribute name="title">
-       <string>Fenster2</string>
-      </attribute>
-     </widget>
-     <widget class="QWidget" name="tab_3">
-      <attribute name="title">
-       <string>Fenster3</string>
-      </attribute>
-     </widget>
-     <widget class="QWidget" name="tab_4">
-      <attribute name="title">
-       <string>Fenster4</string>
-      </attribute>
-     </widget>
-     <widget class="QWidget" name="tab_5">
-      <attribute name="title">
-       <string>Fenster5</string>
-      </attribute>
-     </widget>
-     <widget class="QWidget" name="tab_6">
-      <attribute name="title">
-       <string>Fenster6</string>
-      </attribute>
-     </widget>
-     <widget class="QWidget" name="tab_7">
-      <attribute name="title">
-       <string>Fenster7</string>
-      </attribute>
-     </widget>
-     <widget class="QWidget" name="tab_8">
-      <attribute name="title">
-       <string>Fenster8</string>
-      </attribute>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>