sexta-feira, 20 de março de 2015

Tela máquina - versão 1

.

#*********************************************************************
# Autor:        ubiratã uaatsim itza I.
# Data:         10/03/2014
# Hora:         17:40:06
#*********************************************************************
# Arquivo:      telaMaquina1.py
#
# Descrição:   O arquivo telaMaquina1.py
#
#               Métodos:
#
# uso:          from telaMaquina1 import TelaMaquina1
#               p = TelaMaquina1
#               p.
#
#*********************************************************************
#
#*********************************************************************
#!/usr/bin/env python
#-*- coding:utf-8 -*-
#*********************************************************************
#
#*********************************************************************
import random
import tkinter
from tkinter import ttk
from tkinter import messagebox

import sys, os
#*********************************************************************
#
#*********************************************************************
class TelaMaquina1(object):
    def __init__(self):
        self.v_padrao = 'p'
        p = TelaMaquina1

        self.tela1 = tkinter.Tk()
        self.style = ttk.Style()
        self.tela1.geometry('270x500')
        self.tela1.title('Máquina')

        self.rotulotemperatura = tkinter.Label(self.tela1, text='Temperatura (.C)', bg='yellow')
        self.rotulotemperatura.pack(pady=10, padx=10)
        self.vartemperatura = tkinter.IntVar()
        self.escalatemperatura = tkinter.Scale(self.tela1, orient=tkinter.HORIZONTAL, from_=0, to=60, length=200, width="10", resolution=1, activebackground="blue", variable=self.vartemperatura, command=self.escalaTemperatura)
        self.escalatemperatura.pack()

        self.rotuloagua = tkinter.Label(self.tela1, text='Luz (percentual)', bg='yellow')
        self.rotuloagua.pack(pady=10, padx=10)
        self.varagua = tkinter.IntVar()
        self.escalaagua = tkinter.Scale(self.tela1, orient=tkinter.HORIZONTAL, from_=0, to=100, length=200, width="10", resolution=1, activebackground="blue", variable=self.varagua, command=self.escalaAgua)
        self.escalaagua.pack()

        self.rotuloluz = tkinter.Label(self.tela1, text='Água (percentual)', bg='yellow')
        self.rotuloluz.pack(pady=10, padx=10)
        self.varluz = tkinter.IntVar()
        self.escalaluz = tkinter.Scale(self.tela1, orient=tkinter.HORIZONTAL, from_=0, to=100, length=200, width="10", resolution=1, activebackground="blue", variable=self.varluz, command=self.escalaLuz)
        self.escalaluz.pack()

        self.rotuloportae = tkinter.Label(self.tela1, text='Porta Esquerda', bg='yellow')
        self.rotuloportae.pack(pady=10, padx=10)
        self.varportae = tkinter.IntVar()

        self.rotuloportap = tkinter.Label(self.tela1, text='Porta principal', bg='yellow')
        self.rotuloportap.pack(pady=10, padx=10)
        self.varportap = tkinter.IntVar()

        self.rotuloportad = tkinter.Label(self.tela1, text='Porta Direita', bg='yellow')
        self.rotuloportad.pack(pady=10, padx=10)
        self.varportad = tkinter.IntVar()

        self.rotulouso = tkinter.Label(self.tela1, text='Tempo de Uso', bg='yellow')
        self.rotulouso.pack(pady=10, padx=10)
        self.varuso = tkinter.IntVar()

        print('Atributos instanciados - Classe Padrão')
#*********************************************************************
    def versao():
        '''27/02/2015
        '''
        print('Classe Padrão - versao 1.0')
#*********************************************************************
    def spinRetorno(self):
        '''Quantidade de pessoas que se deseja cadastrar.
        '''
        print(self.spinval.get())

    def escalaTemperatura(self, event):
        '''
        '''
        v = str(self.vartemperatura.get())
        print(v)

    def escalaLuz(self, event):
        '''
        '''
        v = str(self.varluz.get())
        print(v)

    def escalaAgua(self, event):
        '''
        '''
        v = str(self.varagua.get())
        print(v)

#*********************************************************************
if __name__ == '__main__':
    TelaMaquina1()
    print ('Classe instanciada - Padrao!')
#*********************************************************************

.

Nenhum comentário:

Postar um comentário