# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'Gui.ui'
#
# Created: Sat Sep  3 21:59:42 2016
#      by: PyQt4 UI code generator 4.11.2
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
import logging
import PiRapidStream
import cv2
import numpy as np
import sys

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s

try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(949, 870)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.frameSyringePump = QtGui.QFrame(self.centralwidget)
        self.frameSyringePump.setGeometry(QtCore.QRect(10, 530, 471, 181))
        self.frameSyringePump.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frameSyringePump.setFrameShadow(QtGui.QFrame.Raised)
        self.frameSyringePump.setObjectName(_fromUtf8("frameSyringePump"))
        self.labelSyringePumpMenu = QtGui.QLabel(self.frameSyringePump)
        self.labelSyringePumpMenu.setGeometry(QtCore.QRect(10, 10, 141, 17))
        self.labelSyringePumpMenu.setObjectName(_fromUtf8("labelSyringePumpMenu"))
        self.frameSyringeOptions = QtGui.QFrame(self.frameSyringePump)
        self.frameSyringeOptions.setGeometry(QtCore.QRect(250, 30, 221, 141))
        self.frameSyringeOptions.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frameSyringeOptions.setFrameShadow(QtGui.QFrame.Raised)
        self.frameSyringeOptions.setObjectName(_fromUtf8("frameSyringeOptions"))
        self.line_2 = QtGui.QFrame(self.frameSyringeOptions)
        self.line_2.setGeometry(QtCore.QRect(0, 10, 221, 20))
        self.line_2.setFrameShape(QtGui.QFrame.HLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_2.setObjectName(_fromUtf8("line_2"))
        self.horizontalLayoutWidget_4 = QtGui.QWidget(self.frameSyringeOptions)
        self.horizontalLayoutWidget_4.setGeometry(QtCore.QRect(90, 20, 107, 111))
        self.horizontalLayoutWidget_4.setObjectName(_fromUtf8("horizontalLayoutWidget_4"))
        self.horizontalLayout_3 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_4)
        self.horizontalLayout_3.setMargin(0)
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.setLiquidButton = QtGui.QPushButton(self.horizontalLayoutWidget_4)
        self.setLiquidButton.setMaximumSize(QtCore.QSize(35, 16777215))
        self.setLiquidButton.setObjectName(_fromUtf8("setLiquidButton"))
        self.verticalLayout_2.addWidget(self.setLiquidButton)
        self.setTimeIntervallButton = QtGui.QPushButton(self.horizontalLayoutWidget_4)
        self.setTimeIntervallButton.setMaximumSize(QtCore.QSize(35, 16777215))
        self.setTimeIntervallButton.setObjectName(_fromUtf8("setTimeIntervallButton"))
        self.verticalLayout_2.addWidget(self.setTimeIntervallButton)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem)
        self.horizontalLayout_3.addLayout(self.verticalLayout_2)
        self.verticalLayout_7 = QtGui.QVBoxLayout()
        self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7"))
        self.doubleSpinBoxLiquid = QtGui.QDoubleSpinBox(self.horizontalLayoutWidget_4)
        self.doubleSpinBoxLiquid.setWrapping(False)
        self.doubleSpinBoxLiquid.setButtonSymbols(QtGui.QAbstractSpinBox.PlusMinus)
        self.doubleSpinBoxLiquid.setDecimals(0)
        self.doubleSpinBoxLiquid.setObjectName(_fromUtf8("doubleSpinBoxLiquid"))
        self.verticalLayout_7.addWidget(self.doubleSpinBoxLiquid)
        self.doubleSpinBoxTime = QtGui.QDoubleSpinBox(self.horizontalLayoutWidget_4)
        self.doubleSpinBoxTime.setButtonSymbols(QtGui.QAbstractSpinBox.PlusMinus)
        self.doubleSpinBoxTime.setDecimals(0)
        self.doubleSpinBoxTime.setSingleStep(1.0)
        self.doubleSpinBoxTime.setObjectName(_fromUtf8("doubleSpinBoxTime"))
        self.verticalLayout_7.addWidget(self.doubleSpinBoxTime)
        spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout_7.addItem(spacerItem1)
        self.horizontalLayout_3.addLayout(self.verticalLayout_7)
        self.labelSetTimeIntervall = QtGui.QLabel(self.frameSyringeOptions)
        self.labelSetTimeIntervall.setGeometry(QtCore.QRect(10, 40, 61, 41))
        self.labelSetTimeIntervall.setObjectName(_fromUtf8("labelSetTimeIntervall"))
        self.labelSetLiquid = QtGui.QLabel(self.frameSyringeOptions)
        self.labelSetLiquid.setGeometry(QtCore.QRect(10, 20, 81, 20))
        self.labelSetLiquid.setObjectName(_fromUtf8("labelSetLiquid"))
        self.labelSyringeOptions = QtGui.QLabel(self.frameSyringeOptions)
        self.labelSyringeOptions.setGeometry(QtCore.QRect(10, 0, 66, 17))
        self.labelSyringeOptions.setObjectName(_fromUtf8("labelSyringeOptions"))
        self.frame_3 = QtGui.QFrame(self.frameSyringePump)
        self.frame_3.setGeometry(QtCore.QRect(10, 30, 221, 141))
        self.frame_3.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame_3.setFrameShadow(QtGui.QFrame.Raised)
        self.frame_3.setObjectName(_fromUtf8("frame_3"))
        self.line_3 = QtGui.QFrame(self.frame_3)
        self.line_3.setGeometry(QtCore.QRect(0, 10, 221, 16))
        self.line_3.setFrameShape(QtGui.QFrame.HLine)
        self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_3.setObjectName(_fromUtf8("line_3"))
        self.labelSyringeStatus = QtGui.QLabel(self.frame_3)
        self.labelSyringeStatus.setGeometry(QtCore.QRect(0, 0, 66, 17))
        self.labelSyringeStatus.setObjectName(_fromUtf8("labelSyringeStatus"))
        self.horizontalLayoutWidget_3 = QtGui.QWidget(self.frame_3)
        self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(0, 20, 221, 116))
        self.horizontalLayoutWidget_3.setObjectName(_fromUtf8("horizontalLayoutWidget_3"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_3)
        self.horizontalLayout_2.setMargin(0)
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.verticalLayout_4 = QtGui.QVBoxLayout()
        self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
        self.labelLastAction = QtGui.QLabel(self.horizontalLayoutWidget_3)
        self.labelLastAction.setObjectName(_fromUtf8("labelLastAction"))
        self.verticalLayout_4.addWidget(self.labelLastAction)
        self.labelNextAction = QtGui.QLabel(self.horizontalLayoutWidget_3)
        self.labelNextAction.setObjectName(_fromUtf8("labelNextAction"))
        self.verticalLayout_4.addWidget(self.labelNextAction)
        self.labelTimeIntervall = QtGui.QLabel(self.horizontalLayoutWidget_3)
        self.labelTimeIntervall.setObjectName(_fromUtf8("labelTimeIntervall"))
        self.verticalLayout_4.addWidget(self.labelTimeIntervall)
        self.labelLiquidAmount = QtGui.QLabel(self.horizontalLayoutWidget_3)
        self.labelLiquidAmount.setObjectName(_fromUtf8("labelLiquidAmount"))
        self.verticalLayout_4.addWidget(self.labelLiquidAmount)
        self.horizontalLayout_2.addLayout(self.verticalLayout_4)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.verticalLayout_5 = QtGui.QVBoxLayout()
        self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
        self.lcdLastAction = QtGui.QLCDNumber(self.horizontalLayoutWidget_3)
        self.lcdLastAction.setObjectName(_fromUtf8("lcdLastAction"))
        self.verticalLayout_5.addWidget(self.lcdLastAction)
        self.lcdNextAction = QtGui.QLCDNumber(self.horizontalLayoutWidget_3)
        self.lcdNextAction.setObjectName(_fromUtf8("lcdNextAction"))
        self.verticalLayout_5.addWidget(self.lcdNextAction)
        self.lcdTimeIntervall = QtGui.QLCDNumber(self.horizontalLayoutWidget_3)
        self.lcdTimeIntervall.setObjectName(_fromUtf8("lcdTimeIntervall"))
        self.verticalLayout_5.addWidget(self.lcdTimeIntervall)
        self.lcdLiquidAmount = QtGui.QLCDNumber(self.horizontalLayoutWidget_3)
        self.lcdLiquidAmount.setObjectName(_fromUtf8("lcdLiquidAmount"))
        self.verticalLayout_5.addWidget(self.lcdLiquidAmount)
        self.horizontalLayout.addLayout(self.verticalLayout_5)
        self.verticalLayout_6 = QtGui.QVBoxLayout()
        self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6"))
        self.labelLastActionMin = QtGui.QLabel(self.horizontalLayoutWidget_3)
        self.labelLastActionMin.setObjectName(_fromUtf8("labelLastActionMin"))
        self.verticalLayout_6.addWidget(self.labelLastActionMin)
        self.labelNextActionMin = QtGui.QLabel(self.horizontalLayoutWidget_3)
        self.labelNextActionMin.setObjectName(_fromUtf8("labelNextActionMin"))
        self.verticalLayout_6.addWidget(self.labelNextActionMin)
        self.labelTimeIntervallMin = QtGui.QLabel(self.horizontalLayoutWidget_3)
        self.labelTimeIntervallMin.setObjectName(_fromUtf8("labelTimeIntervallMin"))
        self.verticalLayout_6.addWidget(self.labelTimeIntervallMin)
        self.labelLiquidAmountMl = QtGui.QLabel(self.horizontalLayoutWidget_3)
        self.labelLiquidAmountMl.setObjectName(_fromUtf8("labelLiquidAmountMl"))
        self.verticalLayout_6.addWidget(self.labelLiquidAmountMl)
        self.horizontalLayout.addLayout(self.verticalLayout_6)
        self.horizontalLayout_2.addLayout(self.horizontalLayout)
        self.horizontalLayoutWidget = QtGui.QWidget(self.centralwidget)
        self.horizontalLayoutWidget.setGeometry(QtCore.QRect(30, 400, 111, 81))
        self.horizontalLayoutWidget.setObjectName(_fromUtf8("horizontalLayoutWidget"))
        self.cameraButtonsLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
        self.cameraButtonsLayout.setSpacing(1)
        self.cameraButtonsLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
        self.cameraButtonsLayout.setMargin(0)
        self.cameraButtonsLayout.setObjectName(_fromUtf8("cameraButtonsLayout"))
        self.buttonLeft = QtGui.QPushButton(self.horizontalLayoutWidget)
        self.buttonLeft.setMaximumSize(QtCore.QSize(35, 35))
        self.buttonLeft.setText(_fromUtf8(""))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8("LeftArrow.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.buttonLeft.setIcon(icon)
        self.buttonLeft.setObjectName(_fromUtf8("buttonLeft"))
        self.cameraButtonsLayout.addWidget(self.buttonLeft)
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.buttonUp = QtGui.QPushButton(self.horizontalLayoutWidget)
        self.buttonUp.setMaximumSize(QtCore.QSize(35, 35))
        self.buttonUp.setText(_fromUtf8(""))
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8("UpArrow.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.buttonUp.setIcon(icon1)
        self.buttonUp.setObjectName(_fromUtf8("buttonUp"))
        self.verticalLayout.addWidget(self.buttonUp)
        self.buttonDown = QtGui.QPushButton(self.horizontalLayoutWidget)
        self.buttonDown.setMaximumSize(QtCore.QSize(35, 35))
        self.buttonDown.setText(_fromUtf8(""))
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(_fromUtf8("DownArrow.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.buttonDown.setIcon(icon2)
        self.buttonDown.setObjectName(_fromUtf8("buttonDown"))
        self.verticalLayout.addWidget(self.buttonDown)
        self.cameraButtonsLayout.addLayout(self.verticalLayout)
        self.buttonRight = QtGui.QPushButton(self.horizontalLayoutWidget)
        self.buttonRight.setMaximumSize(QtCore.QSize(35, 35))
        self.buttonRight.setText(_fromUtf8(""))
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap(_fromUtf8("RightArrow.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.buttonRight.setIcon(icon3)
        self.buttonRight.setObjectName(_fromUtf8("buttonRight"))
        self.cameraButtonsLayout.addWidget(self.buttonRight)
        self.verticalLayoutWidget_2 = QtGui.QWidget(self.centralwidget)
        self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(10, 10, 151, 218))
        self.verticalLayoutWidget_2.setObjectName(_fromUtf8("verticalLayoutWidget_2"))
        self.verticalLayoutMainMenu = QtGui.QVBoxLayout(self.verticalLayoutWidget_2)
        self.verticalLayoutMainMenu.setMargin(0)
        self.verticalLayoutMainMenu.setObjectName(_fromUtf8("verticalLayoutMainMenu"))
        self.labelMainMenu = QtGui.QLabel(self.verticalLayoutWidget_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.labelMainMenu.sizePolicy().hasHeightForWidth())
        self.labelMainMenu.setSizePolicy(sizePolicy)
        self.labelMainMenu.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.labelMainMenu.setFrameShape(QtGui.QFrame.Box)
        self.labelMainMenu.setTextFormat(QtCore.Qt.AutoText)
        self.labelMainMenu.setAlignment(QtCore.Qt.AlignCenter)
        self.labelMainMenu.setWordWrap(False)
        self.labelMainMenu.setObjectName(_fromUtf8("labelMainMenu"))
        self.verticalLayoutMainMenu.addWidget(self.labelMainMenu)
        self.buttonStart = QtGui.QPushButton(self.verticalLayoutWidget_2)
        self.buttonStart.setObjectName(_fromUtf8("buttonStart"))
        self.verticalLayoutMainMenu.addWidget(self.buttonStart)
        self.buttonStop = QtGui.QPushButton(self.verticalLayoutWidget_2)
        self.buttonStop.setObjectName(_fromUtf8("buttonStop"))
        self.verticalLayoutMainMenu.addWidget(self.buttonStop)
        self.labelCameraOptions = QtGui.QLabel(self.verticalLayoutWidget_2)
        self.labelCameraOptions.setObjectName(_fromUtf8("labelCameraOptions"))
        self.verticalLayoutMainMenu.addWidget(self.labelCameraOptions)
        self.line = QtGui.QFrame(self.verticalLayoutWidget_2)
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.verticalLayoutMainMenu.addWidget(self.line)
        self.buttonTakePicture = QtGui.QPushButton(self.verticalLayoutWidget_2)
        self.buttonTakePicture.setObjectName(_fromUtf8("buttonTakePicture"))
        self.verticalLayoutMainMenu.addWidget(self.buttonTakePicture)
        self.buttonSavePicture = QtGui.QPushButton(self.verticalLayoutWidget_2)
        self.buttonSavePicture.setObjectName(_fromUtf8("buttonSavePicture"))
        self.verticalLayoutMainMenu.addWidget(self.buttonSavePicture)
        self.buttonOpenPicture = QtGui.QPushButton(self.verticalLayoutWidget_2)
        self.buttonOpenPicture.setObjectName(_fromUtf8("buttonOpenPicture"))
        self.verticalLayoutMainMenu.addWidget(self.buttonOpenPicture)
        self.frameLogFiles = QtGui.QFrame(self.centralwidget)
        self.frameLogFiles.setGeometry(QtCore.QRect(490, 530, 431, 181))
        self.frameLogFiles.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frameLogFiles.setFrameShadow(QtGui.QFrame.Raised)
        self.frameLogFiles.setObjectName(_fromUtf8("frameLogFiles"))
        self.GCODEINPUT = QtGui.QLineEdit(self.frameLogFiles)
        self.GCODEINPUT.setGeometry(QtCore.QRect(10, 150, 341, 26))
        self.GCODEINPUT.setAutoFillBackground(True)
        self.GCODEINPUT.setObjectName(_fromUtf8("GCODEINPUT"))
        self.ConsoleBox = QtGui.QTextEdit(self.frameLogFiles)
        self.ConsoleBox.setGeometry(QtCore.QRect(10, 10, 411, 131))
        self.ConsoleBox.setObjectName(_fromUtf8("ConsoleBox"))
        self.ConsoleBox.setReadOnly(True)
        self.labelMoveCamera = QtGui.QLabel(self.centralwidget)
        self.labelMoveCamera.setGeometry(QtCore.QRect(30, 380, 111, 20))
        self.labelMoveCamera.setAlignment(QtCore.Qt.AlignCenter)
        self.labelMoveCamera.setObjectName(_fromUtf8("labelMoveCamera"))
        self.buttonPicture = QtGui.QPushButton(self.centralwidget)
        self.buttonPicture.setGeometry(QtCore.QRect(10, 230, 150, 150))
        self.buttonPicture.setText(_fromUtf8(""))
        self.icon4 = QtGui.QIcon()
        #self.icon4.addPixmap(QtGui.QPixmap(_fromUtf8("pic.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        #self.buttonPicture.setIcon(self.icon4)
        #self.buttonPicture.setIconSize(QtCore.QSize(130, 130))
        self.buttonPicture.setObjectName(_fromUtf8("buttonPicture"))
        self.buttonDown_Z = QtGui.QPushButton(self.centralwidget)
        self.buttonDown_Z.setGeometry(QtCore.QRect(130, 450, 35, 35))
        self.buttonDown_Z.setMaximumSize(QtCore.QSize(35, 35))
        self.buttonDown_Z.setText(_fromUtf8(""))
        self.buttonDown_Z.setIcon(icon2)
        self.buttonDown_Z.setObjectName(_fromUtf8("buttonDown_Z"))
        self.buttonUp_Z = QtGui.QPushButton(self.centralwidget)
        self.buttonUp_Z.setGeometry(QtCore.QRect(130, 390, 35, 35))
        self.buttonUp_Z.setMaximumSize(QtCore.QSize(35, 35))
        self.buttonUp_Z.setText(_fromUtf8(""))
        self.buttonUp_Z.setIcon(icon1)
        self.buttonUp_Z.setObjectName(_fromUtf8("buttonUp_Z"))
        self.verticalLayoutWidget = QtGui.QWidget(self.centralwidget)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(179, 9, 741, 511))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.layoutVideo = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.layoutVideo.setMargin(0)
        self.layoutVideo.setObjectName(_fromUtf8("layoutVideo"))
        self.pushButton = QtGui.QPushButton(self.centralwidget)
        self.pushButton.setGeometry(QtCore.QRect(846, 680, 71, 27))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.PiCAMStream = QtGui.QLabel(self.centralwidget)
        self.PiCAMStream.setGeometry(QtCore.QRect(175, 11, 741, 471))
        self.PiCAMStream.setObjectName(_fromUtf8("PiCAMStream"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 949, 20))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(140, 430, 16, 21))
        self.label.setObjectName(_fromUtf8("label"))
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(_translate("MainWindow", "RobotLabs", None))
        self.labelSyringePumpMenu.setText(_translate("MainWindow", "Syringe Pump", None))
        self.setLiquidButton.setText(_translate("MainWindow", "Set", None))
        self.setTimeIntervallButton.setText(_translate("MainWindow", "Set", None))
        self.labelSetTimeIntervall.setText(_translate("MainWindow", "Set Time \n"
"Intervall:", None))
        self.labelSetLiquid.setText(_translate("MainWindow", "Set Liquid:", None))
        self.labelSyringeOptions.setText(_translate("MainWindow", "Options:", None))
        self.labelSyringeStatus.setText(_translate("MainWindow", "Status:", None))
        self.labelLastAction.setText(_translate("MainWindow", "Last Action:", None))
        self.labelNextAction.setText(_translate("MainWindow", "Next Action:", None))
        self.labelTimeIntervall.setText(_translate("MainWindow", "Time Intervall:", None))
        self.labelLiquidAmount.setText(_translate("MainWindow", "Liquid Amount:", None))
        self.labelLastActionMin.setText(_translate("MainWindow", "min", None))
        self.labelNextActionMin.setText(_translate("MainWindow", "min", None))
        self.labelTimeIntervallMin.setText(_translate("MainWindow", "min", None))
        self.labelLiquidAmountMl.setText(_translate("MainWindow", "µl", None))
        self.labelMainMenu.setText(_translate("MainWindow", "Main Menu", None))
        self.buttonStart.setText(_translate("MainWindow", "Start", None))
        self.buttonStop.setText(_translate("MainWindow", "Stop", None))
        self.labelCameraOptions.setText(_translate("MainWindow", "Camera Options", None))
        self.buttonTakePicture.setText(_translate("MainWindow", "Take Picture", None))
        self.buttonSavePicture.setText(_translate("MainWindow", "Save Picture", None))
        self.buttonOpenPicture.setText(_translate("MainWindow", "Open Picture", None))
        self.GCODEINPUT.setPlaceholderText(_translate("MainWindow", "Insert here lovely GCode Commands", None))
        self.labelMoveCamera.setText(_translate("MainWindow", "Move Camera", None))
        self.label.setText(_translate("MainWindow", "Z", None))
        self.pushButton.setText(_translate("MainWindow", "SEND IT", None))

class QPlainTextEditLogger(logging.Handler):
    def __init__(self, parent):
        super(logging.Logger, self).__init__(self)

        self.widget = QPlainTextEdit(parent)
        self.widget.setReadOnly(True)

        def emit(self,record):
            msg = self.format(record)
            self.widget.textCursor().appendPlainText(msg)

        def write(self, m):
            pass

class OutLog:
    def __init__(self, edit, out=None, color=None):
        """(edit, out=None, color=None) -> can write stdout, stderr to a QTextEdit.
        edit = QTextEdit
        out = alternate stream ( can be the original sys.stdout )
        color = alternate color (i.e. color stderr a different color)
        """
        self.edit = edit
        self.out = None
        self.color = color

    def write(self, m):
        if self.color:
            tc = self.edit.textColor()
            self.edit.setTExtColor(self.color)

        self.edit.moveCursor(QtGui.QTextCursor.End)
        self.edit.insertPlainText( m )

        if self.color:
            self.edit.setTextColor(tc)

        if self.out:
            self.out.write(m)

