'''Created on 19/02/2013@author: Alan Nungaray'''import timeimport sysfrom Ventana import Ui_MainWindowfrom PyQt4 import QtGui, QtCoreimport threadingclass Prinsipal(QtGui.QMainWindow): def __init__(self): QtGui.QApplication.__init__(self) self.Ventana= Ui_MainWindow() self.Ventana.setupUi(self) self.estado=0 self.Lotes=True self.connect(self.Ventana.BanadirProceso,QtCore.SIGNAL("clicked()"), self.AgregarProceso) self.connect(self.Ventana.BLotes,QtCore.SIGNAL("clicked()"),self.IniciarLotes) self.connect(self.Ventana.BMultiprogramacion,QtCore.SIGNAL("clicked()"),self.IniciarMulti) self.connect(self.Ventana.actionMultiprogramacion,QtCore.SIGNAL("triggered()"),self.MostrarInfoMulti) self.connect(self.Ventana.actionPor_Lotes,QtCore.SIGNAL("triggered()"),self.MostrarInfoLotes) self.connect(self.Ventana.actionDatos_Personales,QtCore.SIGNAL("triggered()"),self.MostrarDatosPersonales) self.connect(self.Ventana.actionSalir,QtCore.SIGNAL("triggered()"),QtGui.qApp,QtCore.SLOT("quit()")) self.connect(self.Ventana.actionComo_Funciona,QtCore.SIGNAL("triggered()"),self.MostrarComoFunciona) def MostrarComoFunciona(self): self.MostrarVentana("Como funciona?", "1.-Escribe un nombre en la region de proceso a agregar y asigna un numero que será\n el tiempo que tardará en realizarce\n \n2.-Pulsa el botón Agregar \n \n3. Elige un tipo de procesamiento ya sea con el boton Lotes o Multiprogramación\n \n4.-Puedes esperar o agregar mas procesos mientras se termina") def MostrarInfoMulti(self): self.MostrarVentana("Informacion Procesos Por Multiprogramacion", " En la funcion multiprogramacion todo el tiempo se analizara si hay algun proceso con un tiempo menor para darle mayor prioridad") def MostrarDatosPersonales(self): self.MostrarVentana("Datos personales", " Nombre: Alan David Nungaray Becerra \n Grado: 6 Semestre \n Carrera: Ingenieria en computación") def MostrarInfoLotes(self): self.MostrarVentana("Informacion Procesos Por lotes", " En el procesamiento por lotes siempre el primer proceso que llegue al procesador sera el primero en realizare y no compenzará otro procedimiento hasta haber terminado el actual") def IniciarMulti(self): self.ProcesarPorMultiprogramacion() def IniciarLotes(self): self.ProcesarPorLotes() def ProcesarPorMultiprogramacion (self): if self.Ventana.ProcesoA.text()!="" or self.Ventana.ProcesoB.text()!="" or self.Ventana.ProcesoC.text()!="" or self.Ventana.ProcesoD.text()!="" or self.Ventana.ProcesoE.text()!="" or self.Ventana.ProcesoF.text()!="" or self.Ventana.ProcesoG.text()!="" or self.Ventana.ProcesoH.text()!="" or self.Ventana.ProcesoI.text()!="" or self.Ventana.ProcesoJ.text()!="": self.Ventana.BLotes.disconnect(self.Ventana.BLotes,QtCore.SIGNAL("clicked()"),self.IniciarLotes) self.Ventana.BLotes.disconnect(self.Ventana.BMultiprogramacion,QtCore.SIGNAL("clicked()"),self.IniciarMulti) self.CompararElementos() self.Asignar() if self.Ventana.TiempoProcesoEjecucion!="": self.recorrer() t = threading.Thread(target=self.ImprimeMultiprogramacion, args=(int(self.Ventana.TiempoProcesoEjecucion.text()), )) t.start() else: self.connect(self.Ventana.BLotes,QtCore.SIGNAL("clicked()"),self.IniciarLotes) self.connect(self.Ventana.BMultiprogramacion,QtCore.SIGNAL("clicked()"),self.IniciarMulti) def CompararElementos(self): if self.Ventana.ProcesoA.text()!="": self.TiempoMenor=self.Ventana.TiempoA self.ProcesMenor=self.Ventana.ProcesoA if self.Ventana.ProcesoB.text()!="" and int(self.Ventana.TiempoB.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoB self.ProcesMenor=self.Ventana.ProcesoB if self.Ventana.ProcesoC.text()!="" and int(self.Ventana.TiempoC.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoC self.ProcesMenor=self.Ventana.ProcesoC if self.Ventana.ProcesoD.text()!="" and int(self.Ventana.TiempoD.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoD self.ProcesMenor=self.Ventana.ProcesoD if self.Ventana.ProcesoE.text()!="" and int(self.Ventana.TiempoE.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoE self.ProcesMenor=self.Ventana.ProcesoE if self.Ventana.ProcesoF.text()!="" and int(self.Ventana.TiempoF.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoF self.ProcesMenor=self.Ventana.ProcesoF if self.Ventana.ProcesoG.text()!="" and int(self.Ventana.TiempoG.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoG self.ProcesMenor=self.Ventana.ProcesoG if self.Ventana.ProcesoH.text()!="" and int(self.Ventana.TiempoH.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoH self.ProcesMenor=self.Ventana.ProcesoH if self.Ventana.ProcesoI.text()!="" and int(self.Ventana.TiempoI.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoI self.ProcesMenor=self.Ventana.ProcesoI if self.Ventana.ProcesoJ.text()!="" and int(self.Ventana.TiempoJ.text()) <int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoJ self.ProcesMenor=self.Ventana.ProcesoJ def Asignar(self): self.Ventana.TiempoProcesoEjecucion.setText(self.TiempoMenor.text()) self.Ventana.ProcesoEjecucion.setText(self.ProcesMenor.text()) self.ProcesMenor.setText("") self.TiempoMenor.setText("") def ImprimeMultiprogramacion(self,num): for i in range(0,num+1): self.Ventana.TiempoProcesoEjecucion.setText(str(num-i)) time.sleep(1) if(self.Ventana.TiempoProcesoEjecucion.text()=="0"): self.Ventana.ProcesoTerminado.setText(self.Ventana.ProcesoEjecucion.text()) self.Ventana.ProcesoEjecucion.setText("") self.Ventana.TiempoProcesoEjecucion.setText("") self.ProcesarPorMultiprogramacion() def ProcesarPorLotes (self): if(self.Ventana.ProcesoA.text()!=""): self.Ventana.BLotes.disconnect(self.Ventana.BLotes,QtCore.SIGNAL("clicked()"),self.IniciarLotes) self.Ventana.BLotes.disconnect(self.Ventana.BMultiprogramacion,QtCore.SIGNAL("clicked()"),self.IniciarMulti) self.Ventana.ProcesoEjecucion.setText(str(self.Ventana.ProcesoA.text())) self.Ventana.TiempoProcesoEjecucion.setText(str(self.Ventana.TiempoA.text())) self.Ventana.ProcesoA.setText(str(self.Ventana.ProcesoB.text())) self.Ventana.TiempoA.setText(str(self.Ventana.TiempoB.text())) self.Ventana.ProcesoB.setText(str(self.Ventana.ProcesoC.text())) self.Ventana.TiempoB.setText(str(self.Ventana.TiempoC.text())) self.Ventana.ProcesoC.setText(str(self.Ventana.ProcesoD.text())) self.Ventana.TiempoC.setText(str(self.Ventana.TiempoD.text())) self.Ventana.ProcesoD.setText(str(self.Ventana.ProcesoE.text())) self.Ventana.TiempoD.setText(str(self.Ventana.TiempoE.text())) self.Ventana.ProcesoE.setText(str(self.Ventana.ProcesoF.text())) self.Ventana.TiempoE.setText(str(self.Ventana.TiempoF.text())) self.Ventana.ProcesoF.setText(str(self.Ventana.ProcesoG.text())) self.Ventana.TiempoF.setText(str(self.Ventana.TiempoG.text())) self.Ventana.ProcesoG.setText(str(self.Ventana.ProcesoH.text())) self.Ventana.TiempoG.setText(str(self.Ventana.TiempoH.text())) self.Ventana.ProcesoH.setText(str(self.Ventana.ProcesoI.text())) self.Ventana.TiempoH.setText(str(self.Ventana.TiempoI.text())) self.Ventana.ProcesoI.setText(str(self.Ventana.ProcesoJ.text())) self.Ventana.TiempoI.setText(str(self.Ventana.TiempoJ.text())) self.Ventana.ProcesoJ.setText("") self.Ventana.TiempoJ.setText("") t = threading.Thread(target=self.imprimeLotes, args=(int(self.Ventana.TiempoProcesoEjecucion.text()), )) t.start() else: self.connect(self.Ventana.BLotes,QtCore.SIGNAL("clicked()"),self.IniciarLotes) self.connect(self.Ventana.BMultiprogramacion,QtCore.SIGNAL("clicked()"),self.IniciarMulti) def imprimeLotes(self,num): for i in range(0,num+1): self.Ventana.TiempoProcesoEjecucion.setText(str(num-i)) time.sleep(1) if(self.Ventana.TiempoProcesoEjecucion.text()=="0"): self.Ventana.ProcesoTerminado.setText(self.Ventana.ProcesoEjecucion.text()) self.Ventana.ProcesoEjecucion.setText("") self.Ventana.TiempoProcesoEjecucion.setText("") self.ProcesarPorLotes() def AgregarProceso (self): if self.Ventana.ProcesoA.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoB.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoC.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoD.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoE.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoF.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoG.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoH.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoI.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoJ.text()!=self.Ventana.ProcesoAAgregar.text() and self.Ventana.ProcesoAAgregar.text()!="": if(self.Ventana.ProcesoA.text()==""): self.Ventana.ProcesoA.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoA.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoB.text()==""): self.Ventana.ProcesoB.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoB.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoC.text()==""): self.Ventana.ProcesoC.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoC.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoD.text()==""): self.Ventana.ProcesoD.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoD.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoE.text()==""): self.Ventana.ProcesoE.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoE.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoF.text()==""): self.Ventana.ProcesoF.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoF.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoG.text()==""): self.Ventana.ProcesoG.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoG.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoH.text()==""): self.Ventana.ProcesoH.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoH.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoI.text()==""): self.Ventana.ProcesoI.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoI.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoJ.text()==""): self.Ventana.ProcesoJ.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoJ.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) else: print("Cola LLena") def recorrer(self): if(self.Ventana.ProcesoA.text()==""): self.Ventana.ProcesoA.setText(self.Ventana.ProcesoB.text()) self.Ventana.TiempoA.setText(self.Ventana.TiempoB.text()) self.Ventana.ProcesoB.setText("") self.Ventana.TiempoB.setText("") if(self.Ventana.ProcesoB.text()==""): self.Ventana.ProcesoB.setText(self.Ventana.ProcesoC.text()) self.Ventana.TiempoB.setText(self.Ventana.TiempoC.text()) self.Ventana.ProcesoC.setText("") self.Ventana.TiempoC.setText("") if(self.Ventana.ProcesoC.text()==""): self.Ventana.ProcesoC.setText(self.Ventana.ProcesoD.text()) self.Ventana.TiempoC.setText(self.Ventana.TiempoD.text()) self.Ventana.ProcesoD.setText("") self.Ventana.TiempoD.setText("") if(self.Ventana.ProcesoD.text()==""): self.Ventana.ProcesoD.setText(self.Ventana.ProcesoE.text()) self.Ventana.TiempoD.setText(self.Ventana.TiempoE.text()) self.Ventana.ProcesoE.setText("") self.Ventana.TiempoE.setText("") if(self.Ventana.ProcesoE.text()==""): self.Ventana.ProcesoE.setText(self.Ventana.ProcesoF.text()) self.Ventana.TiempoE.setText(self.Ventana.TiempoF.text()) self.Ventana.ProcesoF.setText("") self.Ventana.TiempoF.setText("") if(self.Ventana.ProcesoF.text()==""): self.Ventana.ProcesoF.setText(self.Ventana.ProcesoG.text()) self.Ventana.TiempoF.setText(self.Ventana.TiempoG.text()) self.Ventana.ProcesoG.setText("") self.Ventana.TiempoG.setText("") if(self.Ventana.ProcesoG.text()==""): self.Ventana.ProcesoG.setText(self.Ventana.ProcesoH.text()) self.Ventana.TiempoG.setText(self.Ventana.TiempoH.text()) self.Ventana.ProcesoH.setText("") self.Ventana.TiempoH.setText("") if(self.Ventana.ProcesoH.text()==""): self.Ventana.ProcesoH.setText(self.Ventana.ProcesoI.text()) self.Ventana.TiempoH.setText(self.Ventana.TiempoI.text()) self.Ventana.ProcesoI.setText("") self.Ventana.TiempoI.setText("") if(self.Ventana.ProcesoI.text()==""): self.Ventana.ProcesoI.setText(self.Ventana.ProcesoJ.text()) self.Ventana.TiempoI.setText(self.Ventana.TiempoJ.text()) self.Ventana.ProcesoJ.setText("") self.Ventana.TiempoJ.setText("") def MostrarVentana(self,Titulo,Texto): QtGui.QMessageBox.about(self,Titulo,Texto) def main(): app=QtGui.QApplication(sys.argv) Calculadora= Prinsipal() Calculadora.show() app.exec_() if __name__=="__main__": main()
# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'Ventana.ui'## Created: Thu Feb 21 17:17:41 2013# by: PyQt4 UI code generator 4.9.6## WARNING! All changes made in this file will be lost!from PyQt4 import QtCore, QtGuifrom pickle import FALSEtry: _fromUtf8 = QtCore.QString.fromUtf8except AttributeError: def _fromUtf8(s): return stry: _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(420, 370) MainWindow.setMinimumSize(QtCore.QSize(420, 370)) MainWindow.setMaximumSize(QtCore.QSize(420, 370)) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.BLotes = QtGui.QPushButton(self.centralwidget) self.BLotes.setGeometry(QtCore.QRect(180, 30, 221, 41)) self.BLotes.setStyleSheet(_fromUtf8("")) self.BLotes.setObjectName(_fromUtf8("BLotes")) self.BMultiprogramacion = QtGui.QPushButton(self.centralwidget) self.BMultiprogramacion.setGeometry(QtCore.QRect(180, 80, 221, 41)) self.BMultiprogramacion.setObjectName(_fromUtf8("BMultiprogramacion")) self.BanadirProceso = QtGui.QPushButton(self.centralwidget) self.BanadirProceso.setGeometry(QtCore.QRect(20, 90, 101, 23)) self.BanadirProceso.setObjectName(_fromUtf8("BanadirProceso")) self.LbModoEjecucion = QtGui.QLabel(self.centralwidget) self.LbModoEjecucion.setGeometry(QtCore.QRect(190, 0, 121, 31)) self.LbModoEjecucion.setObjectName(_fromUtf8("LbModoEjecucion")) self.LbAgregar = QtGui.QLabel(self.centralwidget) self.LbAgregar.setGeometry(QtCore.QRect(20, 10, 211, 16)) self.LbAgregar.setObjectName(_fromUtf8("LbAgregar")) self.ProcesoAAgregar = QtGui.QLineEdit(self.centralwidget) self.ProcesoAAgregar.setGeometry(QtCore.QRect(60, 30, 51, 20)) self.ProcesoAAgregar.setMaxLength(3) self.ProcesoAAgregar.setObjectName(_fromUtf8("ProcesoAAgregar")) self.LbNombreAgregar = QtGui.QLabel(self.centralwidget) self.LbNombreAgregar.setGeometry(QtCore.QRect(20, 30, 46, 13)) self.LbNombreAgregar.setObjectName(_fromUtf8("LbNombreAgregar")) self.TiempodelProcesoAAgregar = QtGui.QSpinBox(self.centralwidget) self.TiempodelProcesoAAgregar.setGeometry(QtCore.QRect(60, 50, 51, 22)) self.TiempodelProcesoAAgregar.setMinimum(1) self.TiempodelProcesoAAgregar.setMaximum(10) self.TiempodelProcesoAAgregar.setObjectName(_fromUtf8("TiempodelProcesoAAgregar")) self.LbTiempoAgregar = QtGui.QLabel(self.centralwidget) self.LbTiempoAgregar.setGeometry(QtCore.QRect(20, 50, 46, 13)) self.LbTiempoAgregar.setObjectName(_fromUtf8("LbTiempoAgregar")) self.LbCola = QtGui.QLabel(self.centralwidget) self.LbCola.setGeometry(QtCore.QRect(20, 120, 101, 41)) self.LbCola.setObjectName(_fromUtf8("LbCola")) self.ProcesoA = QtGui.QLineEdit(self.centralwidget) self.ProcesoA.setGeometry(QtCore.QRect(380, 160, 31, 21)) self.ProcesoA.setReadOnly(True) self.ProcesoA.setObjectName(_fromUtf8("ProcesoA")) self.TiempoA = QtGui.QLineEdit(self.centralwidget) self.TiempoA.setGeometry(QtCore.QRect(380, 190, 31, 21)) self.TiempoA.setReadOnly(True) self.TiempoA.setObjectName(_fromUtf8("TiempoA")) self.ProcesoB = QtGui.QLineEdit(self.centralwidget) self.ProcesoB.setGeometry(QtCore.QRect(340, 160, 31, 21)) self.ProcesoB.setReadOnly(True) self.ProcesoB.setObjectName(_fromUtf8("ProcesoB")) self.TiempoB = QtGui.QLineEdit(self.centralwidget) self.TiempoB.setGeometry(QtCore.QRect(340, 190, 31, 21)) self.TiempoB.setReadOnly(True) self.TiempoB.setObjectName(_fromUtf8("TiempoB")) self.ProcesoD = QtGui.QLineEdit(self.centralwidget) self.ProcesoD.setGeometry(QtCore.QRect(260, 160, 31, 21)) self.ProcesoD.setReadOnly(True) self.ProcesoD.setObjectName(_fromUtf8("ProcesoD")) self.ProcesoC = QtGui.QLineEdit(self.centralwidget) self.ProcesoC.setGeometry(QtCore.QRect(300, 160, 31, 21)) self.ProcesoC.setReadOnly(True) self.ProcesoC.setObjectName(_fromUtf8("ProcesoC")) self.TiempoC = QtGui.QLineEdit(self.centralwidget) self.TiempoC.setGeometry(QtCore.QRect(300, 190, 31, 21)) self.TiempoC.setReadOnly(True) self.TiempoC.setObjectName(_fromUtf8("TiempoC")) self.TiempoD = QtGui.QLineEdit(self.centralwidget) self.TiempoD.setGeometry(QtCore.QRect(260, 190, 31, 21)) self.TiempoD.setReadOnly(True) self.TiempoD.setObjectName(_fromUtf8("TiempoD")) self.ProcesoF = QtGui.QLineEdit(self.centralwidget) self.ProcesoF.setGeometry(QtCore.QRect(180, 160, 31, 21)) self.ProcesoF.setReadOnly(True) self.ProcesoF.setObjectName(_fromUtf8("ProcesoF")) self.ProcesoE = QtGui.QLineEdit(self.centralwidget) self.ProcesoE.setGeometry(QtCore.QRect(220, 160, 31, 21)) self.ProcesoE.setReadOnly(True) self.ProcesoE.setObjectName(_fromUtf8("ProcesoE")) self.TiempoF = QtGui.QLineEdit(self.centralwidget) self.TiempoF.setGeometry(QtCore.QRect(180, 190, 31, 21)) self.TiempoF.setReadOnly(True) self.TiempoF.setObjectName(_fromUtf8("TiempoF")) self.TiempoE = QtGui.QLineEdit(self.centralwidget) self.TiempoE.setGeometry(QtCore.QRect(220, 190, 31, 21)) self.TiempoE.setReadOnly(True) self.TiempoE.setObjectName(_fromUtf8("TiempoE")) self.ProcesoH = QtGui.QLineEdit(self.centralwidget) self.ProcesoH.setGeometry(QtCore.QRect(100, 160, 31, 21)) self.ProcesoH.setReadOnly(True) self.ProcesoH.setObjectName(_fromUtf8("ProcesoH")) self.ProcesoG = QtGui.QLineEdit(self.centralwidget) self.ProcesoG.setGeometry(QtCore.QRect(140, 160, 31, 21)) self.ProcesoG.setReadOnly(True) self.ProcesoG.setObjectName(_fromUtf8("ProcesoG")) self.TiempoG = QtGui.QLineEdit(self.centralwidget) self.TiempoG.setGeometry(QtCore.QRect(140, 190, 31, 21)) self.TiempoG.setReadOnly(True) self.TiempoG.setObjectName(_fromUtf8("TiempoG")) self.TiempoH = QtGui.QLineEdit(self.centralwidget) self.TiempoH.setGeometry(QtCore.QRect(100, 190, 31, 21)) self.TiempoH.setReadOnly(True) self.TiempoH.setObjectName(_fromUtf8("TiempoH")) self.ProcesoJ = QtGui.QLineEdit(self.centralwidget) self.ProcesoJ.setGeometry(QtCore.QRect(20, 160, 31, 21)) self.ProcesoJ.setReadOnly(True) self.ProcesoJ.setObjectName(_fromUtf8("ProcesoJ")) self.ProcesoI = QtGui.QLineEdit(self.centralwidget) self.ProcesoI.setGeometry(QtCore.QRect(60, 160, 31, 21)) self.ProcesoI.setReadOnly(True) self.ProcesoI.setObjectName(_fromUtf8("ProcesoI")) self.TiempoI = QtGui.QLineEdit(self.centralwidget) self.TiempoI.setGeometry(QtCore.QRect(60, 190, 31, 21)) self.TiempoI.setReadOnly(True) self.TiempoI.setObjectName(_fromUtf8("TiempoI")) self.TiempoJ = QtGui.QLineEdit(self.centralwidget) self.TiempoJ.setGeometry(QtCore.QRect(20, 190, 31, 21)) self.TiempoJ.setReadOnly(True) self.TiempoJ.setObjectName(_fromUtf8("TiempoJ")) self.LbTEjecucion = QtGui.QLabel(self.centralwidget) self.LbTEjecucion.setGeometry(QtCore.QRect(180, 260, 46, 13)) self.LbTEjecucion.setObjectName(_fromUtf8("LbTEjecucion")) self.LbPEjecucion = QtGui.QLabel(self.centralwidget) self.LbPEjecucion.setGeometry(QtCore.QRect(30, 250, 46, 13)) self.LbPEjecucion.setObjectName(_fromUtf8("LbPEjecucion")) self.ProcesoEjecucion = QtGui.QLineEdit(self.centralwidget) self.ProcesoEjecucion.setGeometry(QtCore.QRect(80, 240, 61, 41)) self.ProcesoEjecucion.setMinimumSize(QtCore.QSize(61, 41)) self.ProcesoEjecucion.setMaximumSize(QtCore.QSize(61, 41)) font = QtGui.QFont() font.setFamily(_fromUtf8("Monotype Corsiva")) font.setPointSize(30) font.setBold(True) font.setItalic(True) font.setUnderline(True) font.setWeight(75) font.setStrikeOut(False) self.ProcesoEjecucion.setFont(font) self.ProcesoEjecucion.setText(_fromUtf8("")) self.ProcesoEjecucion.setMaxLength(3) self.ProcesoEjecucion.setReadOnly(True) self.ProcesoEjecucion.setObjectName(_fromUtf8("ProcesoEjecucion")) self.LbEjecucion = QtGui.QLabel(self.centralwidget) self.LbEjecucion.setGeometry(QtCore.QRect(10, 210, 101, 41)) self.LbEjecucion.setObjectName(_fromUtf8("LbEjecucion")) self.LbTTerminado = QtGui.QLabel(self.centralwidget) self.LbTTerminado.setGeometry(QtCore.QRect(20, 300, 46, 13)) self.LbTTerminado.setObjectName(_fromUtf8("LbTTerminado")) self.ProcesoTerminado = QtGui.QLineEdit(self.centralwidget) self.ProcesoTerminado.setGeometry(QtCore.QRect(230, 240, 61, 41)) font = QtGui.QFont() font.setFamily(_fromUtf8("Monotype Corsiva")) font.setPointSize(30) font.setBold(True) font.setItalic(True) font.setUnderline(False) font.setWeight(75) font.setStrikeOut(True) self.ProcesoTerminado.setFont(font) self.ProcesoTerminado.setText(_fromUtf8("")) self.ProcesoTerminado.setReadOnly(True) self.ProcesoTerminado.setObjectName(_fromUtf8("ProcesoTerminado")) self.LblTerminado = QtGui.QLabel(self.centralwidget) self.LblTerminado.setGeometry(QtCore.QRect(170, 210, 101, 41)) self.LblTerminado.setObjectName(_fromUtf8("LblTerminado")) self.TiempoProcesoEjecucion = QtGui.QLabel(self.centralwidget) self.TiempoProcesoEjecucion.setGeometry(QtCore.QRect(80, 290, 61, 31)) font = QtGui.QFont() font.setFamily(_fromUtf8("Monotype Corsiva")) font.setPointSize(30) font.setItalic(True) self.TiempoProcesoEjecucion.setFont(font) self.TiempoProcesoEjecucion.setStyleSheet(_fromUtf8("background-color: rgb(255, 255, 255);")) self.TiempoProcesoEjecucion.setText(_fromUtf8("")) self.TiempoProcesoEjecucion.setOpenExternalLinks(False) self.TiempoProcesoEjecucion.setObjectName(_fromUtf8("TiempoProcesoEjecucion")) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 420, 21)) self.menubar.setObjectName(_fromUtf8("menubar")) self.menuMenu = QtGui.QMenu(self.menubar) self.menuMenu.setObjectName(_fromUtf8("menuMenu")) self.menuAyuda = QtGui.QMenu(self.menubar) self.menuAyuda.setObjectName(_fromUtf8("menuAyuda")) self.menuInformacion = QtGui.QMenu(self.menubar) self.menuInformacion.setObjectName(_fromUtf8("menuInformacion")) MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) self.actionSalir = QtGui.QAction(MainWindow) self.actionSalir.setObjectName(_fromUtf8("actionSalir")) self.actionPor_Lotes = QtGui.QAction(MainWindow) self.actionPor_Lotes.setObjectName(_fromUtf8("actionPor_Lotes")) self.actionMultiprogramacion = QtGui.QAction(MainWindow) self.actionMultiprogramacion.setObjectName(_fromUtf8("actionMultiprogramacion")) self.actionComo_Funciona = QtGui.QAction(MainWindow) self.actionComo_Funciona.setObjectName(_fromUtf8("actionComo_Funciona")) self.actionDatos_Personales = QtGui.QAction(MainWindow) self.actionDatos_Personales.setObjectName(_fromUtf8("actionDatos_Personales")) self.menuAyuda.addAction(self.actionComo_Funciona) self.menuInformacion.addAction(self.actionPor_Lotes) self.menuInformacion.addAction(self.actionMultiprogramacion) self.menuInformacion.addAction(self.actionDatos_Personales) self.menubar.addAction(self.menuAyuda.menuAction()) self.menubar.addAction(self.menuInformacion.menuAction()) self.menubar.addAction(self.menuMenu.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) self.BLotes.setText(_translate("MainWindow", "Lotes", None)) self.BMultiprogramacion.setText(_translate("MainWindow", "Multiprogramacion.", None)) self.BanadirProceso.setText(_translate("MainWindow", "Añadir proceso", None)) self.LbModoEjecucion.setText(_translate("MainWindow", "Modo De ejecución", None)) self.LbAgregar.setText(_translate("MainWindow", "Agregar proceso al sistema", None)) self.LbNombreAgregar.setText(_translate("MainWindow", "Nombre", None)) self.LbTiempoAgregar.setText(_translate("MainWindow", "Tiempo", None)) self.LbCola.setText(_translate("MainWindow", "Cola de procesos", None)) self.LbTEjecucion.setText(_translate("MainWindow", "Nombre", None)) self.LbPEjecucion.setText(_translate("MainWindow", "Nombre", None)) self.LbEjecucion.setText(_translate("MainWindow", "Proceso en ejecucion", None)) self.LbTTerminado.setText(_translate("MainWindow", "Tiempo", None)) self.LblTerminado.setText(_translate("MainWindow", "Proceso Terminado", None)) self.menuMenu.setTitle(_translate("MainWindow", "Salir", None)) self.menuAyuda.setTitle(_translate("MainWindow", "Ayuda", None)) self.menuInformacion.setTitle(_translate("MainWindow", "Informacion", None)) self.actionSalir.setText(_translate("MainWindow", "Salir", None)) self.actionSalir.setShortcut(_translate("MainWindow", "Ctrl+Q", None)) self.actionPor_Lotes.setText(_translate("MainWindow", "Por Lotes", None)) self.actionPor_Lotes.setShortcut(_translate("MainWindow", "Ctrl+L", None)) self.actionMultiprogramacion.setText(_translate("MainWindow", "Multiprogramacion", None)) self.actionMultiprogramacion.setShortcut(_translate("MainWindow", "Ctrl+M", None)) self.actionComo_Funciona.setText(_translate("MainWindow", "Como Funciona", None)) self.actionComo_Funciona.setShortcut(_translate("MainWindow", "Ctrl+H", None)) self.actionDatos_Personales.setText(_translate("MainWindow", "Datos Personales", None))if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) MainWindow = QtGui.QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_())
abc = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k', 'l', 'm', 'n', 'ñ',\ 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x','y', 'z', 'A', 'B', 'C',\ 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M','N', 'Ñ', 'O', 'P', 'Q',\ 'R', 'S', 'T', 'U', 'V','W', 'X', 'Y', 'Z']num = [34, 0, 2, 10, 51, 29, 18, 0, 2, 10]for n in num: print abc[n],
'''Created on 23/02/2013@author: Alan Nungaray'''import timeimport sysfrom ventana2 import Ui_MainWindowfrom PyQt4 import QtGui, QtCoreimport threadingclass Prinsipal(QtGui.QMainWindow): try: def __init__(self): QtGui.QApplication.__init__(self) self.Ventana= Ui_MainWindow() self.Ventana.setupUi(self) #coneccion de Botones de la interfaz self.connect(self.Ventana.BanadirProceso,QtCore.SIGNAL("clicked()"), self.AgregarProceso) self.connect(self.Ventana.BLotes,QtCore.SIGNAL("clicked()"),self.ProcesarPorLotes) self.connect(self.Ventana.BMultiprogramacion,QtCore.SIGNAL("clicked()"),self.HiloMultiprogramacion) #Conección de los mensajes self.connect(self.Ventana.actionMultiprogramacion,QtCore.SIGNAL("triggered()"),self.MostrarInfoMulti) self.connect(self.Ventana.actionPor_Lotes,QtCore.SIGNAL("triggered()"),self.MostrarInfoLotes) self.connect(self.Ventana.actionDatos_Personales,QtCore.SIGNAL("triggered()"),self.MostrarDatosPersonales) #Coneccion de menú self.connect(self.Ventana.actionEjecutar_Por_Lotes,QtCore.SIGNAL("triggered()"),self.ProcesarPorLotes) self.connect(self.Ventana.actionEjecutar_Por_Multiprogramacion,QtCore.SIGNAL("triggered()"),self.HiloMultiprogramacion) self.connect(self.Ventana.actionSalir,QtCore.SIGNAL("triggered()"),QtGui.qApp,QtCore.SLOT("quit()")) self.connect(self.Ventana.actionComo_Funciona,QtCore.SIGNAL("triggered()"),self.MostrarInfoMulti) def HiloMultiprogramacion(self): self.HiloMultiprogramacionPadre = threading.Thread(target=self.ProcesarPorMultiprogramacion, args=(),) self.HiloMultiprogramacionPadre.start() def MostrarInfoMulti(self): self.MostrarVentana("Informacion Procesos Por Multiprogramacion", " En la funcion multiprogramacion todo el tiempo se analizara si hay algun proceso con un tiempo menor para darle mayor prioridad") def MostrarDatosPersonales(self): self.MostrarVentana("Datos personales", " Nombre: Alan David Nungaray Becerra \n Grado: 6 Semestre \n Carrera: Ingenieria en computación") def MostrarInfoLotes(self): self.MostrarVentana("Informacion Procesos Por lotes", " En el procesamiento por lotes siempre el primer proceso que llegue al procesador sera el primero en realizare y no compenzará otro procedimiento hasta haber terminado el actual") def ProcesarPorMultiprogramacion (self): if self.Ventana.ProcesoA.text()!="" or self.Ventana.ProcesoB.text()!="" or self.Ventana.ProcesoC.text()!="" or self.Ventana.ProcesoD.text()!="" or self.Ventana.ProcesoE.text()!="": print("el Hilo Multiprogramacion Padre está vivo?: ", self.HiloMultiprogramacionPadre.is_alive()) self.CompararElementos() self.Asignar() if self.Ventana.TiempoProcesoEjecucion!="": self.recorrer() self.t = threading.Thread(target=self.ImprimeMultiprogramacion, args=(int(self.Ventana.TiempoProcesoEjecucion.text()), )) self.t.start() self.t.join() print("El hilo de Mulprogramacion esta vivo? ",self.HiloMultiprogramacionPadre.is_alive()) self.ProcesarPorMultiprogramacion() else: print("terminé el multiprocesamiento") def CompararElementos(self): if self.Ventana.ProcesoA.text()!="": self.TiempoMenor=self.Ventana.TiempoA self.ProcesMenor=self.Ventana.ProcesoA if self.Ventana.ProcesoB.text()!="" and int(self.Ventana.TiempoB.text()) <=int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoB self.ProcesMenor=self.Ventana.ProcesoB if self.Ventana.ProcesoC.text()!="" and int(self.Ventana.TiempoC.text()) <=int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoC self.ProcesMenor=self.Ventana.ProcesoC if self.Ventana.ProcesoD.text()!="" and int(self.Ventana.TiempoD.text()) <=int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoD self.ProcesMenor=self.Ventana.ProcesoD if self.Ventana.ProcesoE.text()!="" and int(self.Ventana.TiempoE.text()) <=int(self.TiempoMenor.text()) : self.TiempoMenor=self.Ventana.TiempoE self.ProcesMenor=self.Ventana.ProcesoE def Asignar(self): self.Ventana.TiempoProcesoEjecucion.setText(self.TiempoMenor.text()) self.Ventana.ProcesoEjecucion.setText(self.ProcesMenor.text()) self.ProcesMenor.setText("") self.TiempoMenor.setText("") def ImprimeMultiprogramacion(self,num): for i in range(0,num+1): self.Ventana.TiempoProcesoEjecucion.setText(str(num-i)) time.sleep(1) if(self.Ventana.TiempoProcesoEjecucion.text()=="0"): self.Ventana.ProcesoTerminado.setText(self.Ventana.ProcesoEjecucion.text()) self.Ventana.ProcesoEjecucion.setText("") self.Ventana.TiempoProcesoEjecucion.setText("") def ProcesarPorLotes (self): if(self.Ventana.ProcesoA.text()!=""): self.Ventana.ProcesoEjecucion.setText(str(self.Ventana.ProcesoA.text())) self.Ventana.TiempoProcesoEjecucion.setText(str(self.Ventana.TiempoA.text())) self.Ventana.ProcesoA.setText(str(self.Ventana.ProcesoB.text())) self.Ventana.TiempoA.setText(str(self.Ventana.TiempoB.text())) self.Ventana.ProcesoB.setText(str(self.Ventana.ProcesoC.text())) self.Ventana.TiempoB.setText(str(self.Ventana.TiempoC.text())) self.Ventana.ProcesoC.setText(str(self.Ventana.ProcesoD.text())) self.Ventana.TiempoC.setText(str(self.Ventana.TiempoD.text())) self.Ventana.ProcesoD.setText(str(self.Ventana.ProcesoE.text())) self.Ventana.TiempoD.setText(str(self.Ventana.TiempoE.text())) self.Ventana.ProcesoE.setText("") self.Ventana.TiempoE.setText("") self.t = threading.Thread(target=self.imprimeLotes, args=(int(self.Ventana.TiempoProcesoEjecucion.text()),)) print("el hilo imprimir por lotes esta vivo?: ", self.t.is_alive()) self.t.start() else: print("Terminé de ejecutar por lotes") def imprimeLotes(self,num): for i in range(0,num+1): self.Ventana.TiempoProcesoEjecucion.setText(str(num-i)) time.sleep(1) if(self.Ventana.TiempoProcesoEjecucion.text()=="0"): self.Ventana.ProcesoTerminado.setText(self.Ventana.ProcesoEjecucion.text()) self.Ventana.ProcesoEjecucion.setText("") self.Ventana.TiempoProcesoEjecucion.setText("") print("el hilo imprimir por lotes esta vivo?: ", self.t.is_alive()) self.ProcesarPorLotes() and self.t._delete() def AgregarProceso (self): if(self.Ventana.ProcesoAAgregar.text()!="" and self.Ventana.ProcesoAAgregar.text()!=self.Ventana.ProcesoA.text() and self.Ventana.ProcesoAAgregar.text()!=self.Ventana.ProcesoB.text() and self.Ventana.ProcesoAAgregar.text()!=self.Ventana.ProcesoC.text() and self.Ventana.ProcesoAAgregar.text()!=self.Ventana.ProcesoD.text() and self.Ventana.ProcesoAAgregar.text()!=self.Ventana.ProcesoE.text()): if(self.Ventana.ProcesoA.text()==""): self.Ventana.ProcesoA.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoA.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoB.text()==""): self.Ventana.ProcesoB.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoB.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoC.text()==""): self.Ventana.ProcesoC.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoC.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoD.text()==""): self.Ventana.ProcesoD.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoD.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) elif(self.Ventana.ProcesoE.text()==""): self.Ventana.ProcesoE.setText(str(self.Ventana.ProcesoAAgregar.text())) self.Ventana.TiempoE.setText(str(self.Ventana.TiempodelProcesoAAgregar.text())) else: self.MostrarVentana("Aviso", "El proceso a agregar esta vacio o el nombre ya existe") def recorrer(self): if(self.Ventana.ProcesoA.text()==""): self.Ventana.ProcesoA.setText(self.Ventana.ProcesoB.text()) self.Ventana.TiempoA.setText(self.Ventana.TiempoB.text()) self.Ventana.ProcesoB.setText("") self.Ventana.TiempoB.setText("") if(self.Ventana.ProcesoB.text()==""): self.Ventana.ProcesoB.setText(self.Ventana.ProcesoC.text()) self.Ventana.TiempoB.setText(self.Ventana.TiempoC.text()) self.Ventana.ProcesoC.setText("") self.Ventana.TiempoC.setText("") if(self.Ventana.ProcesoC.text()==""): self.Ventana.ProcesoC.setText(self.Ventana.ProcesoD.text()) self.Ventana.TiempoC.setText(self.Ventana.TiempoD.text()) self.Ventana.ProcesoD.setText("") self.Ventana.TiempoD.setText("") if(self.Ventana.ProcesoD.text()==""): self.Ventana.ProcesoD.setText(self.Ventana.ProcesoE.text()) self.Ventana.TiempoD.setText(self.Ventana.TiempoE.text()) self.Ventana.ProcesoE.setText("") self.Ventana.TiempoE.setText("") def MostrarVentana(self,Titulo,Texto): QtGui.QMessageBox.about(self,Titulo,Texto) except: print(" Tranquilo") def main(): app=QtGui.QApplication(sys.argv) Calculadora= Prinsipal() Calculadora.show() app.exec_() if __name__=="__main__": main()
# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'Interfaz_Simple.ui'## Created: Sun Feb 24 10:01:09 2013# by: PyQt4 UI code generator 4.9.6## WARNING! All changes made in this file will be lost!from PyQt4 import QtCore, QtGuitry: _fromUtf8 = QtCore.QString.fromUtf8except AttributeError: def _fromUtf8(s): return stry: _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(420, 370) MainWindow.setMinimumSize(QtCore.QSize(420, 370)) MainWindow.setMaximumSize(QtCore.QSize(420, 370)) MainWindow.setWindowOpacity(0.97) MainWindow.setStyleSheet(_fromUtf8("")) MainWindow.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.BLotes = QtGui.QPushButton(self.centralwidget) self.BLotes.setGeometry(QtCore.QRect(180, 40, 221, 41)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.BLotes.setFont(font) self.BLotes.setStyleSheet(_fromUtf8("")) self.BLotes.setObjectName(_fromUtf8("BLotes")) self.BMultiprogramacion = QtGui.QPushButton(self.centralwidget) self.BMultiprogramacion.setGeometry(QtCore.QRect(180, 90, 221, 41)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.BMultiprogramacion.setFont(font) self.BMultiprogramacion.setStyleSheet(_fromUtf8("")) self.BMultiprogramacion.setObjectName(_fromUtf8("BMultiprogramacion")) self.BanadirProceso = QtGui.QPushButton(self.centralwidget) self.BanadirProceso.setGeometry(QtCore.QRect(20, 80, 111, 23)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.BanadirProceso.setFont(font) self.BanadirProceso.setStyleSheet(_fromUtf8("")) self.BanadirProceso.setObjectName(_fromUtf8("BanadirProceso")) self.LbModoEjecucion = QtGui.QLabel(self.centralwidget) self.LbModoEjecucion.setGeometry(QtCore.QRect(170, 10, 121, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbModoEjecucion.setFont(font) self.LbModoEjecucion.setStyleSheet(_fromUtf8("")) self.LbModoEjecucion.setObjectName(_fromUtf8("LbModoEjecucion")) self.LbAgregar = QtGui.QLabel(self.centralwidget) self.LbAgregar.setGeometry(QtCore.QRect(10, 10, 151, 16)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbAgregar.setFont(font) self.LbAgregar.setStyleSheet(_fromUtf8("")) self.LbAgregar.setObjectName(_fromUtf8("LbAgregar")) self.ProcesoAAgregar = QtGui.QLineEdit(self.centralwidget) self.ProcesoAAgregar.setGeometry(QtCore.QRect(70, 30, 51, 20)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.ProcesoAAgregar.setFont(font) self.ProcesoAAgregar.setStyleSheet(_fromUtf8("")) self.ProcesoAAgregar.setText(_fromUtf8("")) self.ProcesoAAgregar.setMaxLength(3) self.ProcesoAAgregar.setObjectName(_fromUtf8("ProcesoAAgregar")) self.LbNombreAgregar = QtGui.QLabel(self.centralwidget) self.LbNombreAgregar.setGeometry(QtCore.QRect(20, 30, 46, 13)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbNombreAgregar.setFont(font) self.LbNombreAgregar.setStyleSheet(_fromUtf8("")) self.LbNombreAgregar.setObjectName(_fromUtf8("LbNombreAgregar")) self.TiempodelProcesoAAgregar = QtGui.QSpinBox(self.centralwidget) self.TiempodelProcesoAAgregar.setGeometry(QtCore.QRect(70, 50, 51, 22)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.TiempodelProcesoAAgregar.setFont(font) self.TiempodelProcesoAAgregar.setStyleSheet(_fromUtf8("")) self.TiempodelProcesoAAgregar.setReadOnly(False) self.TiempodelProcesoAAgregar.setMinimum(1) self.TiempodelProcesoAAgregar.setMaximum(20) self.TiempodelProcesoAAgregar.setObjectName(_fromUtf8("TiempodelProcesoAAgregar")) self.LbTiempoAgregar = QtGui.QLabel(self.centralwidget) self.LbTiempoAgregar.setGeometry(QtCore.QRect(20, 50, 46, 13)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbTiempoAgregar.setFont(font) self.LbTiempoAgregar.setStyleSheet(_fromUtf8("")) self.LbTiempoAgregar.setObjectName(_fromUtf8("LbTiempoAgregar")) self.LbCola = QtGui.QLabel(self.centralwidget) self.LbCola.setGeometry(QtCore.QRect(20, 130, 101, 41)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbCola.setFont(font) self.LbCola.setObjectName(_fromUtf8("LbCola")) self.ProcesoA = QtGui.QLineEdit(self.centralwidget) self.ProcesoA.setGeometry(QtCore.QRect(380, 160, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.ProcesoA.setFont(font) self.ProcesoA.setStyleSheet(_fromUtf8("")) self.ProcesoA.setText(_fromUtf8("")) self.ProcesoA.setReadOnly(True) self.ProcesoA.setObjectName(_fromUtf8("ProcesoA")) self.TiempoA = QtGui.QLineEdit(self.centralwidget) self.TiempoA.setGeometry(QtCore.QRect(380, 190, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.TiempoA.setFont(font) self.TiempoA.setStyleSheet(_fromUtf8("")) self.TiempoA.setText(_fromUtf8("")) self.TiempoA.setReadOnly(True) self.TiempoA.setObjectName(_fromUtf8("TiempoA")) self.ProcesoB = QtGui.QLineEdit(self.centralwidget) self.ProcesoB.setGeometry(QtCore.QRect(340, 160, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.ProcesoB.setFont(font) self.ProcesoB.setStyleSheet(_fromUtf8("")) self.ProcesoB.setReadOnly(True) self.ProcesoB.setObjectName(_fromUtf8("ProcesoB")) self.TiempoB = QtGui.QLineEdit(self.centralwidget) self.TiempoB.setGeometry(QtCore.QRect(340, 190, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.TiempoB.setFont(font) self.TiempoB.setStyleSheet(_fromUtf8("")) self.TiempoB.setReadOnly(True) self.TiempoB.setObjectName(_fromUtf8("TiempoB")) self.ProcesoD = QtGui.QLineEdit(self.centralwidget) self.ProcesoD.setGeometry(QtCore.QRect(260, 160, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.ProcesoD.setFont(font) self.ProcesoD.setStyleSheet(_fromUtf8("")) self.ProcesoD.setReadOnly(True) self.ProcesoD.setObjectName(_fromUtf8("ProcesoD")) self.ProcesoC = QtGui.QLineEdit(self.centralwidget) self.ProcesoC.setGeometry(QtCore.QRect(300, 160, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.ProcesoC.setFont(font) self.ProcesoC.setStyleSheet(_fromUtf8("")) self.ProcesoC.setReadOnly(True) self.ProcesoC.setObjectName(_fromUtf8("ProcesoC")) self.TiempoC = QtGui.QLineEdit(self.centralwidget) self.TiempoC.setGeometry(QtCore.QRect(300, 190, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.TiempoC.setFont(font) self.TiempoC.setStyleSheet(_fromUtf8("")) self.TiempoC.setReadOnly(True) self.TiempoC.setObjectName(_fromUtf8("TiempoC")) self.TiempoD = QtGui.QLineEdit(self.centralwidget) self.TiempoD.setGeometry(QtCore.QRect(260, 190, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.TiempoD.setFont(font) self.TiempoD.setStyleSheet(_fromUtf8("")) self.TiempoD.setText(_fromUtf8("")) self.TiempoD.setReadOnly(True) self.TiempoD.setObjectName(_fromUtf8("TiempoD")) self.ProcesoF = QtGui.QLineEdit(self.centralwidget) self.ProcesoF.setGeometry(QtCore.QRect(180, 160, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.ProcesoF.setFont(font) self.ProcesoF.setStyleSheet(_fromUtf8("")) self.ProcesoF.setText(_fromUtf8("")) self.ProcesoF.setReadOnly(True) self.ProcesoF.setObjectName(_fromUtf8("ProcesoF")) self.ProcesoE = QtGui.QLineEdit(self.centralwidget) self.ProcesoE.setGeometry(QtCore.QRect(220, 160, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.ProcesoE.setFont(font) self.ProcesoE.setStyleSheet(_fromUtf8("")) self.ProcesoE.setText(_fromUtf8("")) self.ProcesoE.setReadOnly(True) self.ProcesoE.setObjectName(_fromUtf8("ProcesoE")) self.TiempoF = QtGui.QLineEdit(self.centralwidget) self.TiempoF.setGeometry(QtCore.QRect(180, 190, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.TiempoF.setFont(font) self.TiempoF.setStyleSheet(_fromUtf8("")) self.TiempoF.setText(_fromUtf8("")) self.TiempoF.setReadOnly(True) self.TiempoF.setObjectName(_fromUtf8("TiempoF")) self.TiempoE = QtGui.QLineEdit(self.centralwidget) self.TiempoE.setGeometry(QtCore.QRect(220, 190, 31, 21)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(10) font.setBold(False) font.setItalic(True) font.setWeight(50) self.TiempoE.setFont(font) self.TiempoE.setStyleSheet(_fromUtf8("")) self.TiempoE.setText(_fromUtf8("")) self.TiempoE.setReadOnly(True) self.TiempoE.setObjectName(_fromUtf8("TiempoE")) self.LbTEjecucion = QtGui.QLabel(self.centralwidget) self.LbTEjecucion.setGeometry(QtCore.QRect(170, 250, 46, 13)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbTEjecucion.setFont(font) self.LbTEjecucion.setStyleSheet(_fromUtf8("")) self.LbTEjecucion.setObjectName(_fromUtf8("LbTEjecucion")) self.LbPEjecucion = QtGui.QLabel(self.centralwidget) self.LbPEjecucion.setGeometry(QtCore.QRect(20, 250, 46, 13)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbPEjecucion.setFont(font) self.LbPEjecucion.setStyleSheet(_fromUtf8("")) self.LbPEjecucion.setObjectName(_fromUtf8("LbPEjecucion")) self.ProcesoEjecucion = QtGui.QLineEdit(self.centralwidget) self.ProcesoEjecucion.setGeometry(QtCore.QRect(80, 240, 61, 41)) self.ProcesoEjecucion.setMinimumSize(QtCore.QSize(61, 41)) self.ProcesoEjecucion.setMaximumSize(QtCore.QSize(61, 41)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(24) font.setBold(False) font.setItalic(True) font.setUnderline(True) font.setWeight(50) self.ProcesoEjecucion.setFont(font) self.ProcesoEjecucion.setStyleSheet(_fromUtf8("")) self.ProcesoEjecucion.setText(_fromUtf8("")) self.ProcesoEjecucion.setMaxLength(3) self.ProcesoEjecucion.setReadOnly(True) self.ProcesoEjecucion.setObjectName(_fromUtf8("ProcesoEjecucion")) self.LbEjecucion = QtGui.QLabel(self.centralwidget) self.LbEjecucion.setGeometry(QtCore.QRect(20, 220, 121, 16)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbEjecucion.setFont(font) self.LbEjecucion.setStyleSheet(_fromUtf8("")) self.LbEjecucion.setObjectName(_fromUtf8("LbEjecucion")) self.LbTTerminado = QtGui.QLabel(self.centralwidget) self.LbTTerminado.setGeometry(QtCore.QRect(20, 300, 46, 13)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LbTTerminado.setFont(font) self.LbTTerminado.setStyleSheet(_fromUtf8("")) self.LbTTerminado.setObjectName(_fromUtf8("LbTTerminado")) self.ProcesoTerminado = QtGui.QLineEdit(self.centralwidget) self.ProcesoTerminado.setGeometry(QtCore.QRect(230, 240, 61, 41)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(24) font.setBold(False) font.setItalic(False) font.setWeight(50) font.setStrikeOut(True) self.ProcesoTerminado.setFont(font) self.ProcesoTerminado.setStyleSheet(_fromUtf8("")) self.ProcesoTerminado.setText(_fromUtf8("")) self.ProcesoTerminado.setReadOnly(True) self.ProcesoTerminado.setObjectName(_fromUtf8("ProcesoTerminado")) self.LblTerminado = QtGui.QLabel(self.centralwidget) self.LblTerminado.setGeometry(QtCore.QRect(170, 220, 121, 16)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.LblTerminado.setFont(font) self.LblTerminado.setStyleSheet(_fromUtf8("")) self.LblTerminado.setObjectName(_fromUtf8("LblTerminado")) self.TiempoProcesoEjecucion = QtGui.QLabel(self.centralwidget) self.TiempoProcesoEjecucion.setGeometry(QtCore.QRect(80, 290, 61, 41)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(24) font.setBold(False) font.setItalic(True) font.setWeight(50) self.TiempoProcesoEjecucion.setFont(font) self.TiempoProcesoEjecucion.setStyleSheet(_fromUtf8("background-color: rgb(255, 255, 255);")) self.TiempoProcesoEjecucion.setText(_fromUtf8("")) self.TiempoProcesoEjecucion.setOpenExternalLinks(False) self.TiempoProcesoEjecucion.setObjectName(_fromUtf8("TiempoProcesoEjecucion")) self.BAutomatico = QtGui.QPushButton(self.centralwidget) self.BAutomatico.setGeometry(QtCore.QRect(20, 110, 111, 23)) font = QtGui.QFont() font.setFamily(_fromUtf8("MS Shell Dlg 2")) font.setPointSize(9) font.setBold(False) font.setItalic(False) font.setWeight(50) self.BAutomatico.setFont(font) self.BAutomatico.setStyleSheet(_fromUtf8("")) self.BAutomatico.setObjectName(_fromUtf8("BAutomatico")) MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 420, 21)) self.menubar.setObjectName(_fromUtf8("menubar")) self.menuSalir = QtGui.QMenu(self.menubar) self.menuSalir.setObjectName(_fromUtf8("menuSalir")) self.menuAyuda = QtGui.QMenu(self.menubar) self.menuAyuda.setObjectName(_fromUtf8("menuAyuda")) self.menuInformacion = QtGui.QMenu(self.menubar) self.menuInformacion.setObjectName(_fromUtf8("menuInformacion")) MainWindow.setMenuBar(self.menubar) self.actionPor_Lotes = QtGui.QAction(MainWindow) self.actionPor_Lotes.setObjectName(_fromUtf8("actionPor_Lotes")) self.actionMultiprogramacion = QtGui.QAction(MainWindow) self.actionMultiprogramacion.setObjectName(_fromUtf8("actionMultiprogramacion")) self.actionComo_Funciona = QtGui.QAction(MainWindow) self.actionComo_Funciona.setObjectName(_fromUtf8("actionComo_Funciona")) self.actionDatos_Personales = QtGui.QAction(MainWindow) self.actionDatos_Personales.setObjectName(_fromUtf8("actionDatos_Personales")) self.actionEjecutar_Por_Lotes = QtGui.QAction(MainWindow) self.actionEjecutar_Por_Lotes.setObjectName(_fromUtf8("actionEjecutar_Por_Lotes")) self.actionEjecutar_Por_Multiprogramacion = QtGui.QAction(MainWindow) self.actionEjecutar_Por_Multiprogramacion.setObjectName(_fromUtf8("actionEjecutar_Por_Multiprogramacion")) self.actionSalir = QtGui.QAction(MainWindow) self.actionSalir.setObjectName(_fromUtf8("actionSalir")) self.menuSalir.addAction(self.actionEjecutar_Por_Lotes) self.menuSalir.addAction(self.actionEjecutar_Por_Multiprogramacion) self.menuSalir.addSeparator() self.menuSalir.addAction(self.actionSalir) self.menuAyuda.addAction(self.actionComo_Funciona) self.menuInformacion.addAction(self.actionPor_Lotes) self.menuInformacion.addAction(self.actionMultiprogramacion) self.menuInformacion.addSeparator() self.menuInformacion.addAction(self.actionDatos_Personales) self.menubar.addAction(self.menuSalir.menuAction()) self.menubar.addAction(self.menuInformacion.menuAction()) self.menubar.addAction(self.menuAyuda.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(_translate("MainWindow", "Simulador De Administrador de Procesos", None)) self.BLotes.setWhatsThis(_translate("MainWindow", "<html><head/><body><p><span style=\" color:#00aaff;\">Al ejecutar por lotes, los procesos se ejecutarán conforme vayan llegando</span></p><p><span style=\" color:#00aaff;\">sin inportar el tiempo en que se tarden.</span></p></body></html>", None)) self.BLotes.setText(_translate("MainWindow", "Lotes", None)) self.BMultiprogramacion.setWhatsThis(_translate("MainWindow", "<html><head/><body><p><span style=\" font-size:12pt; color:#00aaff;\">Al ejecutar por Multiprocesos, primero se revisará cual es el menor de toda la cola para poderlo ejecutar</span></p></body></html>", None)) self.BMultiprogramacion.setText(_translate("MainWindow", "Multiprogramacion.", None)) self.BanadirProceso.setText(_translate("MainWindow", "Añadir proceso", None)) self.LbModoEjecucion.setText(_translate("MainWindow", "Modo De ejecución", None)) self.LbAgregar.setText(_translate("MainWindow", "Agregar proceso al sistema", None)) self.LbNombreAgregar.setText(_translate("MainWindow", "Nombre", None)) self.LbTiempoAgregar.setText(_translate("MainWindow", "Tiempo", None)) self.LbCola.setText(_translate("MainWindow", "Cola de procesos", None)) self.LbTEjecucion.setText(_translate("MainWindow", "Nombre", None)) self.LbPEjecucion.setText(_translate("MainWindow", "Nombre", None)) self.LbEjecucion.setText(_translate("MainWindow", "Proceso en ejecucion", None)) self.LbTTerminado.setText(_translate("MainWindow", "Tiempo", None)) self.LblTerminado.setText(_translate("MainWindow", "Proceso Terminado", None)) self.BAutomatico.setText(_translate("MainWindow", "Añadir Automatico", None)) self.menuSalir.setTitle(_translate("MainWindow", "Archivo", None)) self.menuAyuda.setTitle(_translate("MainWindow", "Ayuda", None)) self.menuInformacion.setTitle(_translate("MainWindow", "Informacion", None)) self.actionPor_Lotes.setText(_translate("MainWindow", "Por Lotes", None)) self.actionPor_Lotes.setShortcut(_translate("MainWindow", "Ctrl+Shift+L", None)) self.actionMultiprogramacion.setText(_translate("MainWindow", "Multiprogramacion", None)) self.actionMultiprogramacion.setShortcut(_translate("MainWindow", "Ctrl+Shift+M", None)) self.actionComo_Funciona.setText(_translate("MainWindow", "Como Funciona?", None)) self.actionComo_Funciona.setShortcut(_translate("MainWindow", "Ctrl+H", None)) self.actionDatos_Personales.setText(_translate("MainWindow", "Datos Personales", None)) self.actionDatos_Personales.setShortcut(_translate("MainWindow", "Ctrl+P", None)) self.actionEjecutar_Por_Lotes.setText(_translate("MainWindow", "Ejecutar Por Lotes", None)) self.actionEjecutar_Por_Lotes.setShortcut(_translate("MainWindow", "Ctrl+L", None)) self.actionEjecutar_Por_Multiprogramacion.setText(_translate("MainWindow", "Ejecutar Por Multiprogramacion", None)) self.actionEjecutar_Por_Multiprogramacion.setShortcut(_translate("MainWindow", "Ctrl+M", None)) self.actionSalir.setText(_translate("MainWindow", "Salir", None)) self.actionSalir.setShortcut(_translate("MainWindow", "Esc", None))if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) MainWindow = QtGui.QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_())