From bd043f1950125d63f87d347f1adecc3c7bdf3925 2015-10-01 17:48:40 From: Miguel Valdez Date: 2015-10-01 17:48:40 Subject: [PATCH] SCHAIN GUI: -ExpLabel parameter was added -ProfilesPerBlock parameter was deleted from Spectra Window -Bug fixed: RemoteFolder doesn't include "./" path anymore --- diff --git a/schainpy/gui/viewcontroller/basicwindow.py b/schainpy/gui/viewcontroller/basicwindow.py index f10e7da..777d916 100644 --- a/schainpy/gui/viewcontroller/basicwindow.py +++ b/schainpy/gui/viewcontroller/basicwindow.py @@ -12,6 +12,8 @@ import Queue from collections import OrderedDict from os.path import expanduser from time import sleep +# from gevent import sleep + import ast from PyQt4.QtGui import QMainWindow @@ -19,11 +21,14 @@ from PyQt4.QtCore import pyqtSignature from PyQt4.QtCore import pyqtSignal from PyQt4 import QtCore from PyQt4 import QtGui +# from PyQt4.QtCore import QThread +# from PyQt4.QtCore import QObject, SIGNAL from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess from schainpy.gui.viewer.ui_ftp import Ui_Ftp from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow -from schainpy.controller import Project, ControllerThread +from schainpy.controller_api import ControllerThread +from schainpy.controller import Project from propertiesViewModel import TreeModel, PropertyBuffer from parametersModel import ProjectParms @@ -34,23 +39,23 @@ FIGURES_PATH = tools.get_path() TEMPORAL_FILE = ".temp.xml" def isRadarFile(file): - try: - year = int(file[1:5]) - doy = int(file[5:8]) - set = int(file[8:11]) - except: - return 0 - - return 1 + try: + year = int(file[1:5]) + doy = int(file[5:8]) + set = int(file[8:11]) + except: + return 0 + + return 1 def isRadarPath(path): - try: - year = int(path[1:5]) - doy = int(path[5:8]) - except: - return 0 - - return 1 + try: + year = int(path[1:5]) + doy = int(path[5:8]) + except: + return 0 + + return 1 class BasicWindow(QMainWindow, Ui_BasicWindow): """ @@ -84,7 +89,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.walk = 0 self.create = False self.selectedItemTree = None - self.controllerObj = None + self.controllerThread = None # self.commCtrlPThread = None # self.create_figure() self.temporalFTP = ftpBuffer() @@ -108,11 +113,11 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.__operationObjDict = {} self.__puLocalFolder2FTP = {} - self.__initialized = False + self.__enable = False # self.create_comm() self.create_updating_timer() - self.setParameter() + self.setGUIStatus() @pyqtSignature("") def on_actionOpen_triggered(self): @@ -271,10 +276,10 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.proDelay.setEnabled(False) elif index == 1: self.online = 1 - self.proSet.setText(" ") + self.proSet.setText("") self.proDelay.setText("5") self.proSet.setEnabled(True) - self.proDelay.setEnabled(True) + self.proDelay.setEnabled(True) @pyqtSignature("int") def on_proComDataType_activated(self, index): @@ -284,6 +289,9 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.labelSet.show() self.proSet.show() + self.labExpLabel.show() + self.proExpLabel.show() + self.labelIPPKm.hide() self.proIPPKm.hide() @@ -296,11 +304,15 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): elif index == 3: extension = '.hdf5' - self.labelSet.hide() - self.proSet.hide() self.labelIPPKm.show() self.proIPPKm.show() + self.labelSet.hide() + self.proSet.hide() + + self.labExpLabel.hide() + self.proExpLabel.hide() + self.proDataType.setText(extension) @pyqtSignature("int") @@ -345,7 +357,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if not os.path.exists(datapath): self.console.clear() - self.console.append("Write a correct a path") + self.console.append("Write a valid path") return self.dataPath = datapath @@ -364,7 +376,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if not parameter_list[0]: return - parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set = parameter_list + parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list if read_mode == "Offline": self.proComStartDate.clear() @@ -376,15 +388,15 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.frame_2.setEnabled(True) if read_mode == "Online": - self.proComStartDate.addItem("2000/01/30") - self.proComEndDate.addItem("2016/12/31") + self.proComStartDate.addItem("1960/01/30") + self.proComEndDate.addItem("2018/12/31") self.proComStartDate.setEnabled(False) self.proComEndDate.setEnabled(False) self.proStartTime.setEnabled(False) self.proEndTime.setEnabled(False) self.frame_2.setEnabled(True) - self.loadDays(data_path, ext, walk) + self.loadDays(data_path, ext, walk, expLabel) @pyqtSignature("int") def on_proComStartDate_activated(self, index): @@ -964,12 +976,14 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): """ Donde se guardan los DATOS """ - self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) - self.volGraphPath.setText(self.dataPath) + save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) + self.volGraphPath.setText(save_path) -# if not os.path.exists(self.dataPath): -# self.volGraphOk.setEnabled(False) -# return + if not os.path.exists(save_path): + self.console.clear() + self.console.append("Set a valid path") + self.volGraphOk.setEnabled(False) + return @pyqtSignature("int") def on_volGraphCebshow_stateChanged(self, p0): @@ -1734,7 +1748,6 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): opObj = puObj.addOperation(name='SpectraWriter', optype='other') opObj.addParameter(name='path', value=output_path) opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') - opObj.addParameter(name='profilesPerBlock', value=profilesperblock, format='int') self.console.clear() try: @@ -1859,11 +1872,11 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): def on_specGraphToolPath_clicked(self): """ """ - self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) - self.specGraphPath.setText(self.savePath) - if not os.path.exists(self.savePath): + save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) + self.specGraphPath.setText(save_path) + if not os.path.exists(save_path): self.console.clear() - self.console.append("Write a correct a path") + self.console.append("Write a valid path") return @pyqtSignature("") @@ -1874,11 +1887,11 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): def on_specHeisGraphToolPath_clicked(self): """ """ - self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) - self.specHeisGraphPath.setText(self.savePath) - if not os.path.exists(self.savePath): + save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) + self.specHeisGraphPath.setText(save_path) + if not os.path.exists(save_path): self.console.clear() - self.console.append("Write a correct a path") + self.console.append("Write a valid path") return @pyqtSignature("int") @@ -2095,9 +2108,9 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): return 0 if addFTP and not localfolder: - self.console.clear() - self.console.append("You have to save the plots before sending them to FTP Server") - return 0 + self.console.clear() + self.console.append("You should save plots before send them to FTP Server") + return 0 # if something happened parms_ok, output_path, blocksperfile, metada = self.checkInputsPUSave(datatype='SpectraHeis') @@ -2376,6 +2389,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): parms_ok = False walk = int(self.proComWalk.currentIndex()) + expLabel = str(self.proExpLabel.text()) startDate = str(self.proComStartDate.currentText()) endDate = str(self.proComEndDate.currentText()) @@ -2404,11 +2418,12 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): projectParms.endDate = endDate projectParms.startTime = startTime projectParms.endTime = endTime - projectParms.delay=delay - projectParms.walk=walk - projectParms.set=set - projectParms.ippKm=ippKm - projectParms.parmsOk=parms_ok + projectParms.delay = delay + projectParms.walk = walk + projectParms.expLabel = expLabel + projectParms.set = set + projectParms.ippKm = ippKm + projectParms.parmsOk = parms_ok return projectParms @@ -2461,6 +2476,12 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): except: pass + expLabel = '' + try: + expLabel = operationObj.getParameterValue(parameterName='expLabel') + except: + pass + ippKm = '' if datatype.lower() == 'usrp': try: @@ -2484,11 +2505,12 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): projectParms.walk=walk projectParms.set=set projectParms.ippKm=ippKm + projectParms.expLabel = expLabel projectParms.parmsOk=parms_ok return projectParms - def refreshProjectWindow2(self, projectObjView): + def refreshProjectWindow(self, projectObjView): projectParms = self.__getParmsFromProjectObj(projectObjView) @@ -2506,6 +2528,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.proSet.setText(str(projectParms.set)) self.proIPPKm.setText(str(projectParms.ippKm)) self.proComWalk.setCurrentIndex(projectParms.walk) + self.proExpLabel.setText(str(projectParms.expLabel).strip()) dateList = self.loadDays(data_path = projectParms.dpath, ext = projectParms.getExt(), @@ -3521,7 +3544,6 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if opObj == None: self.specOutputPath.clear() self.specOutputblocksperfile.clear() - self.specOutputprofileperblock.clear() else: value = opObj.getParameterObj(parameterName='path') if value == None: @@ -3537,13 +3559,6 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): value = opObj.getParameterValue(parameterName='blocksPerFile') blocksperfile = str(value) self.specOutputblocksperfile.setText(blocksperfile) - value = opObj.getParameterObj(parameterName='profilesPerBlock') - if value == None: - self.specOutputprofileperblock.clear() - else: - value = opObj.getParameterValue(parameterName='profilesPerBlock') - profilesPerBlock = str(value) - self.specOutputprofileperblock.setText(profilesPerBlock) return @@ -3861,7 +3876,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): #A project has been selected if projectObjView == selectedObjView: - self.refreshProjectWindow2(projectObjView) + self.refreshProjectWindow(projectObjView) self.refreshProjectProperties(projectObjView) self.tabProject.setEnabled(True) @@ -3939,11 +3954,6 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if action == quitAction3: self.close() return 0 - - def create_updating_timer(self): - self.comm_data_timer = QtCore.QTimer(self) - self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) - self.comm_data_timer.start(1000) def createProjectView(self, id): @@ -4003,7 +4013,10 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if projectParms.delay: readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") - + + if projectParms.expLabel: + readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) + if projectParms.datatype == "USRP": readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, path=projectParms.dpath, @@ -4046,6 +4059,9 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if projectParms.delay: readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") + + if projectParms.expLabel: + readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) if projectParms.datatype == "USRP": readUnitConfObj.update(datatype=projectParms.datatype, @@ -4141,35 +4157,35 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if self.temporalFTP.plot_pos: opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') - def __checkFTPProcUnit(self, projectObj, localfolder): - - puId = None - puObj = None - - for thisPuId, thisPuObj in projectObj.procUnitItems(): - - if not thisPuObj.name == "SendToServer": - continue - - opObj = thisPuObj.getOperationObj(name='run') - - parmObj = opObj.getParameterObj('localfolder') - - #localfolder parameter should always be set, if it is not set then ProcUnit should be removed - if not parmObj: - projectObj.removeProcUnit(thisPuId) - continue - - thisLocalfolder = parmObj.getValue() - - if localfolder != thisLocalfolder: - continue - - puId = thisPuId - puObj = thisPuObj - break - - return puObj +# def __checkFTPProcUnit(self, projectObj, localfolder): +# +# puId = None +# puObj = None +# +# for thisPuId, thisPuObj in projectObj.procUnitItems(): +# +# if not thisPuObj.name == "SendToServer": +# continue +# +# opObj = thisPuObj.getOperationObj(name='run') +# +# parmObj = opObj.getParameterObj('localfolder') +# +# #localfolder parameter should always be set, if it is not set then ProcUnit should be removed +# if not parmObj: +# projectObj.removeProcUnit(thisPuId) +# continue +# +# thisLocalfolder = parmObj.getValue() +# +# if localfolder != thisLocalfolder: +# continue +# +# puId = thisPuId +# puObj = thisPuObj +# break +# +# return puObj def createFTPProcUnitView(self): @@ -4183,10 +4199,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if not self.__puLocalFolder2FTP: return - folderList = "" - - for localfolder in self.__puLocalFolder2FTP.values(): - folderList += str(localfolder) + "," + folderList = ",".join(self.__puLocalFolder2FTP.values()) procUnitConfObj = projectObj.addProcUnit(name="SendToServer") @@ -4477,7 +4490,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.console.append("The selected xml file could not be loaded ...") return 0 - self.refreshProjectWindow2(projectObjLoad) + self.refreshProjectWindow(projectObjLoad) self.refreshProjectProperties(projectObjLoad) projectId = projectObjLoad.id @@ -4534,16 +4547,30 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.actionStart.setEnabled(True) self.actionStarToolbar.setEnabled(True) - + + def create_updating_timer(self): + self.comm_data_timer = QtCore.QTimer(self) + self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) + self.comm_data_timer.start(1000) + def on_comm_updating_timer(self): # Verifica si algun proceso ha sido inicializado y sigue ejecutandose - - if not self.__initialized: + # Si el proceso se ha parado actualizar el GUI (stopProject) + if not self.__enable: return - - if not self.controllerObj.isAlive(): + + if self.controllerThread.isFinished(): self.stopProject() - + +# def jobStartedFromThread(self, success): +# +# self.console.clear() +# self.console.append("Job started") +# +# def jobFinishedFromThread(self, success): +# +# self.stopProject() + def playProject(self, ext=".xml", save=1): # self.console.clear() @@ -4572,18 +4599,25 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.console.append("Please Wait...") - self.controllerObj = ControllerThread(filename) - self.controllerObj.start() + self.controllerThread = ControllerThread(filename) + +# QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread ) +# QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread ) + + self.controllerThread.start() sleep(0.5) - self.__initialized = True + self.__enable = True def stopProject(self): - self.__initialized = False + self.__enable = False # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) - self.controllerObj.stop() + self.controllerThread.stop() + while self.controllerThread.isRunning(): + sleep(0.5) + self.actionStart.setEnabled(True) self.actionPause.setEnabled(False) self.actionStop.setEnabled(False) @@ -4597,7 +4631,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): def pauseProject(self): # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) - self.controllerObj.pause() + self.controllerThread.pause() self.actionStart.setEnabled(False) self.actionPause.setEnabled(True) @@ -4940,13 +4974,15 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): parms_ok = False read_mode = None - try: - delay = int(str(self.proDelay.text())) - except: - outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) - self.console.append(outputstr) -# parms_ok = False - delay = None + delay = None + if read_mode == "Online": + parms_ok = False + try: + delay = int(str(self.proDelay.text())) + parms_ok = True + except: + outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) + self.console.append(outputstr) try: set = int(str(self.proSet.text())) @@ -4956,9 +4992,10 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): # parms_ok = False set = None - walk = self.proComWalk.currentIndex() + walk = int(self.proComWalk.currentIndex()) + expLabel = str(self.proExpLabel.text()) - return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set + return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel def checkInputsPUSave(self, datatype): """ @@ -4978,7 +5015,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if datatype == "Spectra": output_path = str(self.specOutputPath.text()) blocksperfile = str(self.specOutputblocksperfile.text()) - profilesperblock = str(self.specOutputprofileperblock.text()) + profilesperblock = 0 if datatype == "SpectraHeis": output_path = str(self.specHeisOutputPath.text()) @@ -5007,12 +5044,6 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.console.append(outputstr) parms_ok = False profilesperblock = None - - elif datatype == "Spectra": - outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.specOutputprofileperblock.text()) - self.console.append(outputstr) - parms_ok = False - profilesperblock = None try: blocksperfile = int(blocksperfile) @@ -5104,11 +5135,13 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if not os.path.isdir(data_path): return + self.dataPath = data_path + dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) if not dateList: # self.console.clear() - outputstr = "The path: %s is empty with file extension *%s" % (data_path, ext) + outputstr = "The path %s has no files with extension *%s" % (data_path, ext) self.console.append(outputstr) return @@ -5126,6 +5159,9 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.dateList = dateStrList self.proOk.setEnabled(True) + self.console.clear() + self.console.append("Successful load") + return self.dateList def setWorkSpaceGUI(self, pathWorkSpace=None): @@ -5156,7 +5192,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.console.append(text) self.console.setTextColor(color_black) - def setParameter(self): + def setGUIStatus(self): self.setWindowTitle("ROJ-Signal Chain") self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"adn.jpg") )) @@ -5226,8 +5262,9 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.treeProjectProperties.resizeColumnToContents(1) # set Project + self.proExpLabel.setEnabled(True) self.proDelay.setEnabled(False) - self.proSet.setEnabled(False) + self.proSet.setEnabled(True) self.proDataType.setReadOnly(True) # set Operation Voltage @@ -5332,6 +5369,12 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') + self.labelSet.show() + self.proSet.show() + + self.labelIPPKm.hide() + self.proIPPKm.hide() + sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) @@ -5441,9 +5484,9 @@ class Ftp(QMainWindow, Ui_Ftp): """ QMainWindow.__init__(self, parent) self.setupUi(self) - self.setParameter() + self.setGUIStatus() - def setParameter(self): + def setGUIStatus(self): self.setWindowTitle("ROJ-Signal Chain") self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') self.folderFTP.setToolTip('Example: /home/wmaster/graficos') diff --git a/schainpy/gui/viewcontroller/comm.py b/schainpy/gui/viewcontroller/comm.py deleted file mode 100644 index a0b7e0d..0000000 --- a/schainpy/gui/viewcontroller/comm.py +++ /dev/null @@ -1,125 +0,0 @@ -import threading -import Queue -try: - from gevent import sleep -except: - from time import sleep - -from schainpy.controller import Project -from command import * - -class ControllerThread(threading.Thread): - - def __init__(self, filename, data_q=None): - - super(ControllerThread, self).__init__() - self.setDaemon(True) - - self.filename = filename - self.data_q = data_q - self.control = {'stop':False,'pause':False} - - def stop(self): - self.control['stop'] = True - - def pause(self): - self.control['pause'] = not(self.control['pause']) - - def run(self): - self.control['stop'] = False - self.control['pause'] = False - self.controllerObj = Project(self.control, self.data_q) - self.controllerObj.readXml(self.filename) - self.controllerObj.createObjects() - self.controllerObj.connectObjects() - self.controllerObj.run() - -class CommCtrlProcessThread(threading.Thread): - """ Implements the threading.Thread interface (start, join, etc.) and - can be controlled via the cmd_q Queue attribute. Replies are placed in - the reply_q Queue attribute. - """ - def __init__(self, cmd_q=Queue.Queue(), reply_q=Queue.Queue()): - super(CommCtrlProcessThread, self).__init__() - self.cmd_q = cmd_q -# self.reply_q = reply_q - -# self.print_q = Queue.Queue() -# self.data_q = Queue.Queue() - - - self.alive = threading.Event() - self.setDaemon(True) - self.alive.set() - self.socket = None - - self.socketIO = None - self.mySocket = None - - self.controllerObj = None - - self.handlers = { - ProcessCommand.PROCESS: self._handle_ioPROCESSTHREAD, - ProcessCommand.MESSAGE: self._handle_ioMESSAGE, - ProcessCommand.DATA: self._handle_ioDATA, - ProcessCommand.STOP: self._handle_ioSTOP, - ProcessCommand.PAUSE: self._handle_ioPAUSE - } - - def run(self): - - while self.alive.isSet(): - try: - cmd = self.cmd_q.get(True, 0.1) - self.handlers[cmd.type](cmd) - except Queue.Empty as e: - continue - - def isRunning(self): - - if self.controllerObj == None: - return False - - if self.controllerObj.isAlive(): - return True - - return False - - def _handle_ioPROCESSTHREAD(self, cmd): - filename = cmd.data - self.controllerObj = ControllerThread(filename=filename) - self.controllerObj.start() - - def _handle_ioPAUSE(self, cmd): - self.controllerObj.pause() - - def _handle_ioSTOP(self, cmd): - self.controllerObj.stop() - - while self.controllerObj.isAlive(): - self.console.clear() - self.console.append("Close graphics before continue...") - sleep(0.1) - - - self.controllerObj.join() -# print "Process thread finished" - - def _handle_ioDATA(self, cmd): - self.reply_q.put(self._success_reply_data(data=cmd.data)) - - def _handle_ioMESSAGE(self, cmd): - self.reply_q.put(self._success_reply_message(data=cmd.data)) - - def _success_reply_data(self, data=None): - return ClientReply(ClientReply.DATA, data) - - def _success_reply_message(self, data=None): - return ClientReply(ClientReply.MESSAGE, data) - - def join(self, timeout=None): - self.alive.clear() - threading.Thread.join(self, timeout) - - - \ No newline at end of file diff --git a/schainpy/gui/viewcontroller/command.py b/schainpy/gui/viewcontroller/command.py deleted file mode 100644 index 994ebfc..0000000 --- a/schainpy/gui/viewcontroller/command.py +++ /dev/null @@ -1,50 +0,0 @@ -class ProcessCommand(object): - """ A command to the client thread. - Each command type has its associated data: - - DATA: Data Radar Object - MESSAGE: Data String - STOP: Event to Stop the process thread - PAUSE: Event to Pause the process thread - """ - PROCESS, DATA, MESSAGE, STOP, PAUSE = range(5) - - def __init__(self, type, data=None): - self.type = type - self.data = data - - -class ClientCommand(object): - """ A command to the client thread. - Each command type has its associated data: - - CONNECT: (host, port) tuple - SEND: Data string - RECEIVE: None - CLOSE: None - PROCESS: to processing - SEND: send a data - SENDXML: send xml file - """ - CONNECT, SEND, SENDXML, RECEIVE, CLOSE, PROCESS = range(6) - - def __init__(self, type, data=None): - self.type = type - self.data = data - - -class ClientReply(object): - """ A reply from the client thread. - Each reply type has its associated data: - - ERROR: The error string - MESSAGE: Data String - DATA: Data - SUCCESS: Depends on the command - for RECEIVE it's the received - data string, for others None. - """ - ERROR, SUCCESS, MESSAGE, DATA= range(4) - - def __init__(self, type, data=None): - self.type = type - self.data = data diff --git a/schainpy/gui/viewcontroller/mainwindow.py b/schainpy/gui/viewcontroller/mainwindow.py deleted file mode 100644 index d138009..0000000 --- a/schainpy/gui/viewcontroller/mainwindow.py +++ /dev/null @@ -1,632 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Module implementing MainWindow. -#+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++# -""" -from PyQt4.QtGui import QMainWindow -from PyQt4.QtCore import pyqtSignature -from PyQt4.QtCore import pyqtSignal -from PyQt4 import QtCore -from PyQt4 import QtGui -from timeconversions import Doy2Date -from modelProperties import treeModel - -from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess -from schainpy.gui.viewer.ui_window import Ui_window -from schainpy.gui.viewer.ui_mainwindow import Ui_MainWindow - -from schainpy.controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf -import os - - -class BodyMainWindow(QMainWindow, Ui_MainWindow): - __projObjDict = {} - __arbolDict = {} - __upObjDict = {} - - """ - Class documentation goes here. - #*##################VENTANA CUERPO DEL PROGRAMA#################### - """ - def __init__(self, parent = None): - """ - Constructor - """ - print "Inicio de Programa Interfaz Gráfica" - QMainWindow.__init__(self, parent) - self.setupUi(self) - - self.indexclick=None - - self.online=0 - self.datatype=0 - self.variableList=[] - - self.proObjList=[] - self.idp=0 - self.namep=0 - self.description=0 - self.namepTree=0 - self.valuep=0 - - self.upObjList= [] - self.upn=0 - self.upName=0 - self.upType=0 - self.uporProObjRecover=0 - - self.readUnitConfObjList=[] - - self.upObjVolList=[] - self.upobjSpecList=[] - - self.operObjList=[] - - self.configProject=None - self.configUP=None - - self.readUnitConfObj=None - self.procUnitConfObj0=None - self.opObj10=None - self.opObj12=None - - self.setParam() - - #-----------------------------------NEW PROPERTIES------------------------------------------------# - QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) - self.addprojectBtn.setToolTip('Add_New_Project') - self.addUnitProces.setToolTip('Add_New_Processing_Unit') - - #-----------------------------------NEW PROPERTIES------------------------------------------------# - self.model = QtGui.QStandardItemModel() - self.treeView.setModel(self.model) - self.treeView.clicked.connect(self.clickFunctiontree) - self.treeView.expandAll() - #self.treeView.clicked.connect(self.treefunction1) - - #-----------------------------------BARRA DE MENU-------------------------------------------------# - - #----------------------------------- MENU_PROJECT--------------------------------------------------# - - @pyqtSignature("") - def on_menuFileAbrirObj_triggered(self): - """ - Abre un archivo de configuracion seleccionado, lee los parametros y - actualiza los atributos de esta clase; creando los objetos necesarios - con los parametros leidos desde el archivo. - """ - print "Leer un archivo xml y extraer sus atributos Not implemented yet" - - @pyqtSignature("") - def on_menuFileCrearObj_triggered(self): - """ - Crea un proyecto nuevo y lo anade a mi diccionario de proyectos - y habilita la ventana de configuracion del proyecto. - - """ - self.addProject() - - @pyqtSignature("") - def on_menuFileGuardarObj_triggered(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO GUARDAR PROJECTO - - Llama al metodo saveProject. - """ -# my_id = arbol_selected() -# filename = savefindow.show() -# self.saveProject(id, filename) - print "probsave" - self.saveProject() - - @pyqtSignature("") - def on_menuFileCerrarObj_triggered(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO CERRAR - Llama al metodo close. - """ - self.close() - - #-----------------------------------MENU_RUN----------------------------------------------------# - - @pyqtSignature("") - def on_menuRUNStartObj_clicked(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO RUN - Llama al metodo RUN. - """ - print "Not implemented yet" - - @pyqtSignature("") - def on_menuRUNPausaObj_clicked(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA - Llama al metodo PAUSA. - """ - print "Not implemented yet" - - #-----------------------------------MENU_OPTION-------------------------------------------------# - - @pyqtSignature("") - def on_menuOptConfigLogfileObj_clicked(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO ConfigLog - Llama al metodo close. - """ - print "Not implemented yet" - - @pyqtSignature("") - def on_menuOptConfigserverObj_clicked(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO Config Server - Llama al metodo close. - """ - print "Not implemented yet" - #-----------------------------------MENU_HELP-------------------------------------------------------# - - @pyqtSignature("") - def on_menuHELPAboutObj_clicked(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO HELP - Llama al metodo close. - """ - print "Not implemented yet" - - @pyqtSignature("") - def on_menuHELPPrfObj_clicked(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO HElp - Llama al metodo close. - """ - print "Not implemented yet" - - #-----------------------------------BARRA DE HERRAMIENTAS----------------------------------------# - - @pyqtSignature("") - def on_actOpenObj_triggered(self): - """ - METODO CARGA UN ARCHIVO DE CONFIGURACION ANTERIOR - """ - print "Leer un archivo xml y extraer sus atributos Not implemented yet" - - @pyqtSignature("") - def on_actCreateObj_triggered(self): - """ - CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS - Llama al metodo addProject. - """ - self.addProject() - - @pyqtSignature("") - def on_actStopObj_triggered(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA - Llama al metodo PAUSA. - """ - print "Not implemented yet" - - @pyqtSignature("") - def on_actPlayObj_triggered(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA - Llama al metodo PAUSA. - """ - print "Not implemented yet" - - @pyqtSignature("") - def on_actSaveObj_triggered(self): - """ - METODO EJECUTADO CUANDO OCURRE EL EVENTO SAVE - Llama al metodo SAVE. - """ - self.saveProject() - - #-----------------------------------PUSHBUTTON_CREATE PROJECT----------------------------------# - - @pyqtSignature("") - def on_addprojectBtn_clicked(self): - """ - CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS - Llama al metodo addProject. - """ - self.addProject() - - #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------# - - @pyqtSignature("int") - def on_dataTypeCmbBox_activated(self,index): - """ - Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA - """ - self.dataFormatTxt.setReadOnly(True) - if index==0: - self.datatype='Voltage' - elif index==1: - self.datatype='Spectra' - else : - self.datatype='' - self.dataFormatTxt.setReadOnly(False) - self.dataFormatTxt.setText(self.datatype) - - @pyqtSignature("") - def on_dataPathBrowse_clicked(self): - """ - OBTENCION DE LA RUTA DE DATOS - """ - self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) - self.dataPathTxt.setText(self.dataPath) - self.statusDpath=self.existDir(self.dataPath) - self.loadDays() - - @pyqtSignature("int") - def on_starDateCmbBox_activated(self, index): - """ - SELECCION DEL RANGO DE FECHAS -START DATE - """ - var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex() - self.endDateCmbBox.clear() - for i in self.variableList[index:]: - self.endDateCmbBox.addItem(i) - self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index) - self.getsubList() - - @pyqtSignature("int") - def on_endDateCmbBox_activated(self, index): - """ - SELECCION DEL RANGO DE FECHAS-END DATE - """ - var_StartDay_index=self.starDateCmbBox.currentIndex() - var_end_index = self.endDateCmbBox.count() - index - self.starDateCmbBox.clear() - for i in self.variableList[:len(self.variableList) - var_end_index + 1]: - self.starDateCmbBox.addItem(i) - self.starDateCmbBox.setCurrentIndex(var_StartDay_index) - self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas - - @pyqtSignature("int") - def on_readModeCmBox_activated(self, p0): - """ - SELECCION DEL MODO DE LECTURA ON=1, OFF=0 - """ - if p0==0: - self.online=0 - elif p0==1: - self.online=1 - - #---------------PUSHBUTTON_DATA " OKBUTTON "_CONFIGURATION PROJECT--------------------------# - - @pyqtSignature("") - def on_dataOkBtn_clicked(self): - """ - Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. - Prepara la configuración del diágrama del Arbol del treeView numero 2 - """ - print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online" - - for i in self.__arbolDict: - if self.__arbolDict[i]==self.indexclick: - self.projectObj=self.__projObjDict[int(i)] -# print self.projectObj -# print i -# print "get",self.__arbolDict.items() -# print "keys",self.__arbolDict.keys() - self.description="Think" - id=i - name=str(self.nameProjectTxt.text()) - desc=str(self.description) - - self.projectObj.setup(id = id, name=name, description=desc) - print self.projectObj.id -# print self.projectObj.name -# print self.projectObj.description - - datatype=str(self.dataTypeCmbBox.currentText()) - path=str(self.dataPathTxt.text()) - online=int(self.online) - starDate=str(self.starDateCmbBox.currentText()) - endDate=str(self.endDateCmbBox.currentText()) - - - self.readUnitConfObj = self.projectObj.addReadUnit(datatype=datatype, - path=path, - startDate=starDate, - endDate=endDate, - startTime='06:10:00', - endTime='23:59:59', - online=online) - - self.readUnitConfObjList.append(self.readUnitConfObj) - print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online - - self.model_2=treeModel() - self.model_2.setParams(name=self.projectObj.name+str(self.projectObj.id), - directorio=path, - workspace="C:\\WorkspaceGUI", - remode=str(self.readModeCmBox.currentText()), - dataformat=datatype, - date=str(starDate)+"-"+str(endDate), - initTime='06:10:00', - endTime='23:59:59', - timezone="Local" , - Summary="test de prueba") - self.model_2.arbol() - self.treeView_2.setModel(self.model_2) - self.treeView_2.expandAll() - -# - #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------# - @pyqtSignature("") - def on_addUnitProces_clicked(self): - """ - CREAR PROCESSING UNI ,ANADE UNA UNIDAD DE PROCESAMIENTO, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO - Llama al metodo addUP. - """ -# print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" - self.addUP() - - #----------------------------BASICO-----------------------------------# - - def getNumberofProject(self): -# for i in self.proObjList: -# print i - return self.proObjList -# for i in self.proObjList: -# print i - - def setParam(self): - - self.tabWidgetProject.setEnabled(False) - self.dataPathTxt.setText('C:\data') - self.nameProjectTxt.setText("Test") - self.numberChannelopVol.setEnabled(False) - self.lineHeighProfileTxtopVol.setEnabled(False) - self.numberIntegration.setEnabled(False) - self.valuenFFTPointOpSpec.setEnabled(False) - self.lineProfileSelecopVolCEB.setEnabled(False) - - def clickFunctiontree(self,index): - self.indexclick= index.model().itemFromIndex(index) - print self.indexclick - return self.indexclick -# self.indexclick= index.model().itemFromIndex(index).text() -# return self.indexclick -# print self.indexclick() -# print index.model().itemFromIndex(index) -# print self.indexclick -# NumofPro=self.indexclick[8:10] -# self.valuep=NumofPro -# #print self.valuep -# NameofPro=self.indexclick[0:7] -# self.namepTree=NameofPro -# print self.namepTree - - def addProject(self): - self.tabWidgetProject.setEnabled(True) - print "En este nivel se debe crear el proyecto,id,nombre,desc" - #+++++++++++++++++++Creacion del Objeto Controller-XML+++++++++++++# - - self.idp += 1 - self.projectObj = Project() - print self.projectObj - self.__projObjDict[self.idp] = self.projectObj - - #++++++++++++++++++Creación del Arbol++++++++++++++++++++# - self.parentItem = self.model.invisibleRootItem() - name=str(self.nameProjectTxt.text()) - self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name+" %0").arg(self.idp)) - print self.__arbolDict[self.idp] - self.parentItem.appendRow(self.__arbolDict[self.idp]) - self.parentItem=self.__arbolDict[self.idp] - - print "Porfavor ingrese los parámetros de configuracion del Proyecto" - - def existDir(self, var_dir): - """ - METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR - VARIABLE DIRECCION - """ - if os.path.isdir(var_dir): - return True - else: - self.textEdit.append("Incorrect path:" + str(var_dir)) - return False - - def loadDays(self): - """ - METODO PARA CARGAR LOS DIAS - """ - self.variableList=[] - self.starDateCmbBox.clear() - self.endDateCmbBox.clear() - - Dirlist = os.listdir(self.dataPath) - Dirlist.sort() - - for a in range(0, len(Dirlist)): - fname= Dirlist[a] - Doy=fname[5:8] - fname = fname[1:5] - print fname - fecha=Doy2Date(int(fname),int(Doy)) - fechaList=fecha.change2date() - #print fechaList[0] - Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1]) - #+"-"+ fechaList[0]+"-"+fechaList[1] - - #---------------AQUI TIENE QUE SER MODIFICADO--------# - - #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) - for i in range(0, (len(Dirlist))): - self.variableList.append(Dirlist[i]) - - for i in self.variableList: - self.starDateCmbBox.addItem(i) - self.endDateCmbBox.addItem(i) - self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1) - - self.getsubList() - self.dataOkBtn.setEnabled(True) - - def getsubList(self): - """ - OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS - """ - self.subList=[] - for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]: - self.subList.append(i) - - def addUP(self): - - self.configUP=UnitProcess(self) - for i in self.__arbolDict: - if self.__arbolDict[i]==self.indexclick: - if self.__projObjDict.has_key(i)==True: - self.projectObj=self.__projObjDict[int(i)] - print self.projectObj.id - self.configUP.getfromWindowList.append(self.projectObj) - - - for i in self.projectObj.procUnitConfObjDict: - if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit': - self.upObj=self.projectObj.procUnitConfObjDict[i] - self.configUP.getfromWindowList.append(self.upObj) - - - - self.configUP.loadTotalList() - self.configUP.show() - #self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters) - self.configUP.closed.connect(self.createUP) - - - - def createUP(self): - - print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" - - if not self.configUP.create: - return - - self.uporProObjRecover=self.configUP.getFromWindow - - self.upType = self.configUP.typeofUP - for i in self.__arbolDict: - if self.__arbolDict[i]==self.indexclick: - self.projectObj=self.__projObjDict[int(i)] - - datatype=str(self.upType) - uporprojectObj=self.uporProObjRecover - - if uporprojectObj.getElementName()=='ProcUnit': - inputId=uporprojectObj.getId() - else: - inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() - - print 'uporprojectObj.id','inputId', uporprojectObj.id,inputId - self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId) - self.__upObjDict[inputId]= self.procUnitConfObj1 - - self.parentItem=self.__arbolDict[uporprojectObj.id] - #print "i","self.__arbolDict[i]",i ,self.__arbolDict[i] - self.numbertree=int(self.procUnitConfObj1.getId())-1 - self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree)) - self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id]) - self.parentItem=self.__arbolDict[self.procUnitConfObj1.id] - # self.loadUp() - self.treeView.expandAll() - - def resetopVolt(self): - self.selecChannelopVolCEB.setChecked(False) - self.selecHeighopVolCEB.setChecked(False) - self.coherentIntegrationCEB.setChecked(False) - self.profileSelecopVolCEB.setChecked(False) - #self.selecChannelopVolCEB.setEnabled(False) - self.lineHeighProfileTxtopVol.clear() - self.lineProfileSelecopVolCEB.clear() - self.numberChannelopVol.clear() - self.numberIntegration.clear() - - - def resetopSpec(self): - self.nFFTPointOpSpecCEB.setChecked(False) - - self.valuenFFTPointOpSpec.clear() - - def resetgraphSpec(self): - self.SpectraPlotGraphCEB.setChecked(False) - self.CrossSpectraPlotGraphceb.setChecked(False) - self.RTIPlotGraphCEB.setChecked(False) - - - def saveProject(self): - print "entro" - #filename="C:\WorkspaceGUI\config1.xml" - for i in self.__arbolDict: - if self.__arbolDict[i]==self.indexclick: - self.projectObj=self.__projObjDict[int(i)] - print "Encontre project" - filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml" - print "Escribo Project" - self.projectObj.writeXml(filename) - - -class UnitProcess(QMainWindow, Ui_UnitProcess): - """ - Class documentation goes here. - """ - closed=pyqtSignal() - create= False - def __init__(self, parent = None): - """ - Constructor - """ - QMainWindow.__init__(self, parent) - self.setupUi(self) - self.getFromWindow=None - self.getfromWindowList=[] - - self.listUP=None - - @pyqtSignature("") - def on_unitPokbut_clicked(self): - """ - Slot documentation goes here. - """ - self.create =True - self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] - #self.nameofUP= str(self.nameUptxt.text()) - self.typeofUP= str(self.comboTypeBox.currentText()) - self.close() - - - @pyqtSignature("") - def on_unitPcancelbut_clicked(self): - """ - Slot documentation goes here. - """ - # TODO: not implemented yet - #raise NotImplementedError - self.create=False - self.close() - - def loadTotalList(self): - self.comboInputBox.clear() - for i in self.getfromWindowList: - - name=i.getElementName() - if name=='Project': - id= i.id - if name=='ProcUnit': - id=int(i.id)-1 - self.comboInputBox.addItem(str(name)+str(id)) - - def closeEvent(self, event): - self.closed.emit() - event.accept() - - - - - - - \ No newline at end of file diff --git a/schainpy/gui/viewcontroller/modelProperties.py b/schainpy/gui/viewcontroller/modelProperties.py deleted file mode 100644 index cd5b02a..0000000 --- a/schainpy/gui/viewcontroller/modelProperties.py +++ /dev/null @@ -1,303 +0,0 @@ -# -*- coding: utf-8 -*- -from PyQt4 import QtCore -import itertools - -HORIZONTAL_HEADERS = ("Property","Value " ) - -HORIZONTAL = ("RAMA :",) - -class treeModel(QtCore.QAbstractItemModel): - ''' - a model to display a few names, ordered by encabezado - - ''' - def __init__(self ,parent=None): - super(treeModel, self).__init__(parent) - self.people = [] - self.initProjectProperties() - self.initPUVoltageProperties() - self.initPUSpectraProperties() - self.initPUSpectraHeisProperties() - - def initProjectProperties(self): - - name=None - directorio=None - workspace=None - remode=None - dataformat=None - startDate=None - endDate=None - startTime=None - endTime=None - delay=None - set= None - walk=None - timezone=None - Summary=None - description=None - - def initPUVoltageProperties(self): - type=None - channel=None - heights=None - filter=None - profile=None - code=None - mode=None - coherentintegration=None - - def initPUSpectraProperties(self): - type =None - nFFTpoints =None - ippFactor = None - pairsList =None - channel =None - heights =None - incoherentintegration =None - removeDC = None - removeInterference =None - getNoise = None - operationSpecPlot=None - operationCrossSpecPlot = None - operationRTIPlot = None - operationCohermap = None - operationPowProfilePlot = None - - def initPUSpectraHeisProperties(self): - type =None - incoherentintegration =None - operationSpecHeisPlot=None - operationRTIHeisPlot = None - - def initProjectView(self): - """ - Reemplazo del método showtree - """ - HORIZONTAL_HEADERS = ("Property","Value " ) - HORIZONTAL = ("RAMA :",) - self.rootItem = TreeItem(None, "ALL", None) - self.parents = {0 : self.rootItem} - self.setupModelData() - - def initPUVoltageView(self): - HORIZONTAL_HEADERS = ("Operation"," Parameter Value " ) - HORIZONTAL = ("RAMA :",) - self.rootItem = TreeItem(None, "ALL", None) - self.parents = {0 : self.rootItem} - self.setupModelData() - - def showProjectParms(self,caracteristicaList,principalList,descripcionList): - """ - set2Obje - """ - for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList): - person = person_class(caracteristica, principal, descripcion) - self.people.append(person) - self.rootItem = TreeItem(None, "ALL", None) - self.parents = {0 : self.rootItem} - self.setupModelData() - - def showPUVoltageParms(self,caracteristicaList,principalList,descripcionList): - - for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList): - person = person_class(caracteristica, principal, descripcion) - self.people.append(person) - self.rootItem = TreeItem(None, "ALL", None) - self.parents = {0 : self.rootItem} - self.setupModelData() - - - def showPUSpectraParms(self,caracteristicaList,principalList,descripcionList): - - for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList): - person = person_class(caracteristica, principal, descripcion) - self.people.append(person) - self.rootItem = TreeItem(None, "ALL", None) - self.parents = {0 : self.rootItem} - self.setupModelData() - - def showPUSpectraHeisParms(self,caracteristicaList,principalList,descripcionList): - - for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList): - person = person_class(caracteristica, principal, descripcion) - self.people.append(person) - self.rootItem = TreeItem(None, "ALL", None) - self.parents = {0 : self.rootItem} - self.setupModelData() - - - def columnCount(self, parent=None): - if parent and parent.isValid(): - return parent.internalPointer().columnCount() - else: - return len(HORIZONTAL_HEADERS) - - def data(self, index, role): - if not index.isValid(): - return QtCore.QVariant() - - item = index.internalPointer() - if role == QtCore.Qt.DisplayRole: - return item.data(index.column()) - if role == QtCore.Qt.UserRole: - if item: - return item.person - - return QtCore.QVariant() - - def headerData(self, column, orientation, role): - if (orientation == QtCore.Qt.Horizontal and - role == QtCore.Qt.DisplayRole): - try: - return QtCore.QVariant(HORIZONTAL_HEADERS[column]) - except IndexError: - pass - - return QtCore.QVariant() - - def index(self, row, column, parent): - if not self.hasIndex(row, column, parent): - return QtCore.QModelIndex() - - if not parent.isValid(): - parentItem = self.rootItem - else: - parentItem = parent.internalPointer() - - childItem = parentItem.child(row) - if childItem: - return self.createIndex(row, column, childItem) - else: - return QtCore.QModelIndex() - - def parent(self, index): - if not index.isValid(): - return QtCore.QModelIndex() - - childItem = index.internalPointer() - if not childItem: - return QtCore.QModelIndex() - - parentItem = childItem.parent() - - if parentItem == self.rootItem: - return QtCore.QModelIndex() - - return self.createIndex(parentItem.row(), 0, parentItem) - - def rowCount(self, parent=QtCore.QModelIndex()): - if parent.column() > 0: - return 0 - if not parent.isValid(): - p_Item = self.rootItem - else: - p_Item = parent.internalPointer() - return p_Item.childCount() - - def setupModelData(self): - for person in self.people: - if person.descripcion: - encabezado = person.caracteristica - - - if not self.parents.has_key(encabezado): - newparent = TreeItem(None, encabezado, self.rootItem) - self.rootItem.appendChild(newparent) - - self.parents[encabezado] = newparent - - parentItem = self.parents[encabezado] - newItem = TreeItem(person, "", parentItem) - parentItem.appendChild(newItem) - - def searchModel(self, person): - ''' - get the modelIndex for a given appointment - ''' - def searchNode(node): - ''' - a function called recursively, looking at all nodes beneath node - ''' - for child in node.childItems: - if person == child.person: - index = self.createIndex(child.row(), 0, child) - return index - - if child.childCount() > 0: - result = searchNode(child) - if result: - return result - - retarg = searchNode(self.parents[0]) - #print retarg - return retarg - - def find_GivenName(self, principal): - app = None - for person in self.people: - if person.principal == principal: - app = person - break - if app != None: - index = self.searchModel(app) - return (True, index) - return (False, None) - - -class person_class(object): - ''' - a trivial custom data object - ''' - def __init__(self, caracteristica, principal, descripcion): - self.caracteristica = caracteristica - self.principal = principal - self.descripcion = descripcion - - def __repr__(self): - return "PERSON - %s %s"% (self.principal, self.caracteristica) - -class TreeItem(object): - ''' - a python object used to return row/column data, and keep note of - it's parents and/or children - ''' - def __init__(self, person, header, parentItem): - self.person = person - self.parentItem = parentItem - self.header = header - self.childItems = [] - - def appendChild(self, item): - self.childItems.append(item) - - def child(self, row): - return self.childItems[row] - - def childCount(self): - return len(self.childItems) - - def columnCount(self): - return 2 - - def data(self, column): - if self.person == None: - if column == 0: - return QtCore.QVariant(self.header) - if column == 1: - return QtCore.QVariant("") - else: - if column == 0: - return QtCore.QVariant(self.person.principal) - if column == 1: - return QtCore.QVariant(self.person.descripcion) - return QtCore.QVariant() - - def parent(self): - return self.parentItem - - def row(self): - if self.parentItem: - return self.parentItem.childItems.index(self) - return 0 - \ No newline at end of file diff --git a/schainpy/gui/viewcontroller/parametersModel.py b/schainpy/gui/viewcontroller/parametersModel.py index f686474..a3f1c17 100644 --- a/schainpy/gui/viewcontroller/parametersModel.py +++ b/schainpy/gui/viewcontroller/parametersModel.py @@ -70,7 +70,7 @@ class ProjectParms(): def set(self, project_name, datatype, ext, dpath, online, startDate=None, endDate=None, startTime=None, endTime=None, - delay=None, walk=None, set=None, ippKm=None, parmsOk=True): + delay=None, walk=None, set=None, ippKm=None, parmsOk=True, expLabel=''): name = project_name datatype = datatype @@ -85,6 +85,7 @@ class ProjectParms(): walk = walk set = set ippKm = ippKm + expLabel = expLabel self.parmsOk = parmsOk diff --git a/schainpy/gui/viewcontroller/scprocesscontroller.py b/schainpy/gui/viewcontroller/scprocesscontroller.py deleted file mode 100644 index dca9b13..0000000 --- a/schainpy/gui/viewcontroller/scprocesscontroller.py +++ /dev/null @@ -1,38 +0,0 @@ -import os, sys -import getopt - -from schainpy.controller import Project - -class scProcessController(): - def __init__(self): - print "ESTOY EJECUTANDO EL NUEVO PROCESO PERO APARENTEMENTE NO QUIERE" - self.setfilename() - self.operation() - - def setfilename(self): - arglist= '' - longarglist=['filename='] - optlist,args=getopt.getopt(sys.argv[1:],arglist,longarglist) - for opt in optlist: - if opt[0]== '--filename': - self.filename = opt[1] - - def operation(self): - print 'inicia operation' - controllerObj = Project() - print "Leyendo el archivo XML" - #self.filename="C://Users//alex//schain_workspace//Alexander1.xml" - controllerObj.readXml(self.filename) - #controllerObj.printattr() - - controllerObj.createObjects() - controllerObj.connectObjects() - controllerObj.run() - - -def main(): - a=scProcessController() - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/schainpy/gui/viewcontroller/timeconversions.py b/schainpy/gui/viewcontroller/timeconversions.py deleted file mode 100644 index 564defa..0000000 --- a/schainpy/gui/viewcontroller/timeconversions.py +++ /dev/null @@ -1,427 +0,0 @@ -""" -The TIME_CONVERSIONS.py module gathers classes and functions for time system transformations -(e.g. between seconds from 1970 to datetime format). - -MODULES CALLED: -NUMPY, TIME, DATETIME, CALENDAR - -MODIFICATION HISTORY: -Created by Ing. Freddy Galindo (frederickgalindo@gmail.com). ROJ Aug 13, 2009. -""" - -import numpy as np -import time as tm -import datetime as dt -import calendar as cr - -class Time: - """ - time(year,month,dom,hour,min,secs) - - An object represents a date and time of certain event.. - - Parameters - ---------- - YEAR = Number of the desired year. Year must be valid values from the civil calendar. - Years B.C.E must be represented as negative integers. Years in the common era are repre- - sented as positive integers. In particular, note that there is no year 0 in the civil - calendar. 1 B.C.E. (-1) is followed by 1 C.E. (1). - - MONTH = Number of desired month (1=Jan, ..., 12=December). - - DOM = Number of day of the month. - - HOUR = Number of the hour of the day. By default hour=0 - - MINS = Number of the minute of the hour. By default min=0 - - SECS = Number of the second of the minute. By default secs=0. - - Examples - -------- - time_info = time(2008,9,30,12,30,00) - - time_info = time(2008,9,30) - """ - - def __init__(self,year=None,month=None,dom=None,hour=0,mins=0,secs=0): - # If one the first three inputs are not defined, it takes the current date. - date = tm.localtime() - if year==None:year=date[0] - if month==None:month=date[1] - if dom==None:dom=date[2] - - # Converting to arrays - year = np.array([year]); month = np.array([month]); dom = np.array([dom]) - hour = np.array([hour]); mins = np.array([mins]); secs = np.array([secs]) - - # Defining time information object. - self.year = np.atleast_1d(year) - self.month = np.atleast_1d(month) - self.dom = np.atleast_1d(dom) - self.hour = np.atleast_1d(hour) - self.mins = np.atleast_1d(mins) - self.secs = np.atleast_1d(secs) - - def change2julday(self): - """ - Converts a datetime to Julian days. - """ - - # Defining constants - greg = 2299171 # incorrect Julian day for Oct, 25, 1582. - min_calendar = -4716 - max_calendar = 5000000 - - min_year = np.nanmin(self.year) - max_year = np.nanmax(self.year) - if (min_yearmax_calendar): - print "Value of Julian date is out of allowed range" - return -1 - - noyear = np.sum(self.year==0) - if noyear>0: - print "There is no year zero in the civil calendar" - return -1 - - # Knowing if the year is less than 0. - bc = self.year<0 - - # Knowing if the month is less than March. - inJanFeb = self.month<=2 - - jy = self.year + bc - inJanFeb - jm = self.month + (1 + 12*inJanFeb) - - # Computing Julian days. - jul= np.floor(365.25*jy) + np.floor(30.6001*jm) + (self.dom+1720995.0) - - # Test whether to change to Gregorian Calendar - if np.min(jul) >= greg: - ja = np.int32(0.01*jy) - jul = jul + 2 - ja + np.int32(0.25*ja) - else: - gregchange = np.where(jul >= greg) - if gregchange[0].size>0: - ja = np.int32(0.01 + jy[gregchange]) - jy[grechange] = jy[gregchange] + 2 - ja + np.int32(0.25*ja) - - # Determining machine-specific parameters affecting floating-point. - eps = 0.0 # Replace this line for a function to get precision. - eps = abs(jul)*0.0 > eps - - jul = jul + (self.hour/24. -0.5) + (self.mins/1440.) + (self.secs/86400.) + eps - - return jul[0] - - def change2secs(self): - """ - Converts datetime to number of seconds respect to 1970. - """ - - year = self.year - if year.size>1: year = year[0] - - month = self.month - if month.size>1: month = month[0] - - dom = self.dom - if dom.size>1: dom = dom[0] - - # Resizing hour, mins and secs if it was necessary. - hour = self.hour - if hour.size>1:hour = hour[0] - if hour.size==1:hour = np.resize(hour,year.size) - - mins = self.mins - if mins.size>1:mins = mins[0] - if mins.size==1:mins = np.resize(mins,year.size) - - secs = self.secs - if secs.size>1:secs = secs[0] - if secs.size==1:secs = np.resize(secs,year.size) - - # Using time.mktime to compute seconds respect to 1970. - secs1970 = np.zeros(year.size) - for ii in np.arange(year.size): - secs1970[ii] = tm.mktime((int(year[ii]),int(month[ii]),int(dom[ii]),\ - int(hour[ii]),int(mins[ii]),int(secs[ii]),0,0,0)) - - secs1970 = np.int32(secs1970 - tm.timezone) - - return secs1970 - - def change2strdate(self,mode=1): - """ - change2strdate method converts a date and time of certain event to date string. The - string format is like localtime (e.g. Fri Oct 9 15:00:19 2009). - - Parameters - ---------- - None. - - Return - ------ - - Modification History - -------------------- - Created by Freddy R. Galindo, ROJ, 09 October 2009. - - """ - - secs = np.atleast_1d(self.change2secs()) - strdate = [] - for ii in np.arange(np.size(secs)): - secs_tmp = tm.localtime(secs[ii] + tm.timezone) - if mode==1: - strdate.append(tm.strftime("%d-%b-%Y (%j) %H:%M:%S",secs_tmp)) - elif mode==2: - strdate.append(tm.strftime("%d-%b-%Y (%j)",secs_tmp)) - - strdate = np.array(strdate) - - return strdate - - -class Secs: - """ - secs(secs): - - An object represents the number of seconds respect to 1970. - - Parameters - ---------- - - SECS = A scalar or array giving the number of seconds respect to 1970. - - Example: - -------- - secs_info = secs(1251241373) - - secs_info = secs([1251241373,1251241383,1251241393]) - """ - def __init__(self,secs): - self.secs = secs - - def change2julday(self): - """ - Convert seconds from 1970 to Julian days. - """ - - secs_1970 = time(1970,1,1,0,0,0).change2julday() - - julian = self.secs/86400.0 + secs_1970 - - return julian - - def change2time(self): - """ - Converts seconds from 1970 to datetime. - """ - - secs1970 = np.atleast_1d(self.secs) - - datetime = np.zeros((9,secs1970.size)) - for ii in np.arange(secs1970.size): - tuple = tm.gmtime(secs1970[ii]) - datetime[0,ii] = tuple[0] - datetime[1,ii] = tuple[1] - datetime[2,ii] = tuple[2] - datetime[3,ii] = tuple[3] - datetime[4,ii] = tuple[4] - datetime[5,ii] = tuple[5] - datetime[6,ii] = tuple[6] - datetime[7,ii] = tuple[7] - datetime[8,ii] = tuple[8] - - datetime = np.int32(datetime) - - return datetime - - -class Julian: - """ - julian(julian): - - An object represents julian days. - - Parameters - ---------- - - JULIAN = A scalar or array giving the julina days. - - Example: - -------- - julian_info = julian(2454740) - - julian_info = julian([2454740,2454760,2454780]) - """ - def __init__(self,julian): - self.julian = np.atleast_1d(julian) - - def change2time(self): - """ - change2time method converts from julian day to calendar date and time. - - Return - ------ - year = An array giving the year of the desired julian day. - month = An array giving the month of the desired julian day. - dom = An array giving the day of the desired julian day. - hour = An array giving the hour of the desired julian day. - mins = An array giving the minute of the desired julian day. - secs = An array giving the second of the desired julian day. - - Examples - -------- - >> jd = 2455119.0 - >> [yy,mo,dd,hh,mi,ss] = TimeTools.julian(jd).change2time() - >> print [yy,mo,dd,hh,mi,ss] - [2009] [10] [ 14.] [ 12.] [ 0.] [ 0.] - - Modification history - -------------------- - Translated from "Numerical Recipies in C", by William H. Press, Brian P. Flannery, - Saul A. Teukolsky, and William T. Vetterling. Cambridge University Press, 1988. - Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009. - """ - - min_julian = -1095 - max_julian = 1827933925 - if (np.min(self.julian) < min_julian) or (np.max(self.julian) > max_julian): - print 'Value of Julian date is out of allowed range.' - return None - - # Beginning of Gregorian calendar - igreg = 2299161 - julLong = np.floor(self.julian + 0.5) - minJul = np.min(julLong) - - if (minJul >= igreg): - # All are Gregorian - jalpha = np.int32(((julLong - 1867216) - 0.25)/36524.25) - ja = julLong + 1 + jalpha - np.int32(0.25*jalpha) - else: - ja = julLong - gregChange = np.where(julLong >= igreg) - if gregChange[0].size>0: - jalpha = np.int32(((julLong[gregChange]-1867216) - 0.25)/36524.25) - ja[gregChange] = julLong[gregChange]+1+jalpha-np.int32(0.25*jalpha) - - # clear memory. - jalpha = -1 - - jb = ja + 1524 - jc = np.int32(6680. + ((jb-2439870)-122.1)/365.25) - jd = np.int32(365.*jc + (0.25*jc)) - je = np.int32((jb - jd)/30.6001) - - dom = jb - jd - np.int32(30.6001*je) - month = je - 1 - month = ((month - 1) % 12) + 1 - month = np.atleast_1d(month) - year = jc - 4715 - year = year - (month > 2)*1 - year = year - (year <= 0)*1 - year = np.atleast_1d(year) - - # Getting hours, minutes, seconds - fraction = self.julian + 0.5 - julLong - eps_0 = dom*0.0 + 1.0e-12 - eps_1 = 1.0e-12*np.abs(julLong) - eps = (eps_0>eps_1)*eps_0 + (eps_0<=eps_1)*eps_1 - - hour_0 = dom*0 + 23 - hour_2 = dom*0 + 0 - hour_1 = np.floor(fraction*24.0 + eps) - hour = ((hour_1>hour_0)*23) + ((hour_1<=hour_0)*hour_1) - hour = ((hour_1=hour_2)*hour_1) - - fraction = fraction - (hour/24.0) - mins_0 = dom*0 + 59 - mins_2 = dom*0 + 0 - mins_1 = np.floor(fraction*1440.0 + eps) - mins = ((mins_1>mins_0)*59) + ((mins_1<=mins_0)*mins_1) - mins = ((mins_1=mins_2)*mins_1) - - secs_2 = dom*0 + 0 - secs_1 = (fraction - mins/1440.0)*86400.0 - secs = ((secs_1=secs_2)*secs_1) - - return year, month,dom, hour, mins, secs - - def change2secs(self): - """ - Converts from Julian days to seconds from 1970. - """ - - jul_1970 = Time(1970,1,1,0,0,0).change2julday() - - secs = np.int32((self.julian - jul_1970)*86400) - - return secs - - def change2lst(self,longitude=-76.8667): - """ - CT2LST converts from local civil time to local mean sideral time - - longitude = The longitude in degrees (east of Greenwich) of the place for which - the local sideral time is desired, scalar. The Greenwich mean sideral time (GMST) - can be found by setting longitude=0. - """ - - # Useful constants, see Meus, p. 84 - c = np.array([280.46061837, 360.98564736629, 0.000387933, 38710000.0]) - jd2000 = 2451545.0 - t0 = self.julian - jd2000 - t = t0/36525. - - # Computing GST in seconds - theta = c[0] + (c[1]*t0) + (t**2)*(c[2]-t/c[3]) - - # Computing LST in hours - lst = (theta + longitude)/15.0 - neg = np.where(lst < 0.0) - if neg[0].size>0:lst[neg] = 24.0 + (lst[neg] % 24) - lst = lst % 24.0 - - return lst - - -class date2doy: - def __init__(self,year,month,day): - self.year = year - self.month = month - self.day = day - - def change2doy(self): - if cr.isleap(self.year) == True: - tfactor = 1 - else: - tfactor = 2 - - day = self.day - month = self.month - - doy = np.floor((275*month)/9.0) - (tfactor*np.floor((month+9)/12.0)) + day - 30 - - return np.int32(doy) - - -class Doy2Date: - def __init__(self,year,doy): - self.year = year - self.doy = doy - - def change2date(self): - months = np.arange(12) + 1 - - first_dem = date2doy(self.year,months,1) - first_dem = first_dem.change2doy() - - imm = np.where((self.doy - first_dem) > 0) - - month = imm[0].size - dom = self.doy -first_dem[month - 1] + 1 - - return month, dom diff --git a/schainpy/gui/viewcontroller/unitprocess.py b/schainpy/gui/viewcontroller/unitprocess.py deleted file mode 100644 index 0944b44..0000000 --- a/schainpy/gui/viewcontroller/unitprocess.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -Module implementing MainWindow. -""" - -from PyQt4.QtGui import QMainWindow -from PyQt4.QtCore import pyqtSignature - -from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess - -class UnitProcess(QMainWindow, Ui_UnitProcess): - """ - Class documentation goes here. - """ - - def __init__(self, parent = None): - """ - Constructor - """ - QMainWindow.__init__(self, parent) - self.setupUi(self) - - - @pyqtSignature("QString") - def on_comboInputBox_activated(self, p0): - """ - Slot documentation goes here. - """ - # TODO: not implemented yet - raise NotImplementedError - - @pyqtSignature("QString") - def on_comboTypeBox_activated(self, p0): - """ - Slot documentation goes here. - """ - # TODO: not implemented yet - raise NotImplementedError - - - @pyqtSignature("") - def on_unitPokbut_clicked(self): - """ - Slot documentation goes here. - """ - # TODO: not implemented yet - #raise NotImplementedError - print "this is suspiscious" - print "njdasjdajj" - - @pyqtSignature("") - def on_unitPcancelbut_clicked(self): - """ - Slot documentation goes here. - """ - # TODO: not implemented yet - raise NotImplementedError diff --git a/schainpy/gui/viewcontroller/window.py b/schainpy/gui/viewcontroller/window.py deleted file mode 100644 index 66b6e59..0000000 --- a/schainpy/gui/viewcontroller/window.py +++ /dev/null @@ -1,807 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Module implementing MainWindow. -#+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++# -""" -from PyQt4.QtGui import QMainWindow -from PyQt4.QtCore import pyqtSignature -from PyQt4.QtCore import pyqtSignal -from PyQt4 import QtCore -from PyQt4 import QtGui -from timeconversions import Doy2Date -from modelProperties import treeModel -from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess -from schainpy.gui.viewer.ui_window import Ui_window -from schainpy.gui.viewer.ui_mainwindow import Ui_MainWindow -from schainpy.gui.viewer.ui_workspace import Ui_Workspace -from schainpy.gui.viewer.ui_initwindow import Ui_InitWindow - -from schainpy.controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf -import os - -HORIZONTAL_HEADERS = ("ITEM :"," DATOS : " ) - -HORIZONTAL = ("RAMA :",) - -class MainWindow(QMainWindow, Ui_MainWindow): - - nop=None - - __projObjDict = {} - __arbolDict = {} - - """ - Class documentation goes here. - #*##################VENTANA CUERPO DEL PROGRAMA#################### - """ - def __init__(self, parent = None): - """ - Constructor - """ - print "Inicio de Programa Interfaz Gráfica" - QMainWindow.__init__(self, parent) - self.setupUi(self) - - self.online=0 - self.datatype=0 - self.variableList=[] - - self.proObjList=[] - self.idp=0 - self.projectName=0 - self.description=0 - self.namepTree=0 - self.valuep=0 - - self.upObjList= [] - self.upn=0 - self.upName=0 - self.upType=0 - self.uporProObjRecover=0 - - - self.readUnitConfObjList=[] - - self.upObjVolList=[] - self.upobjSpecList=[] - - - self.operObjList=[] - - self.projectWindow=None - self.configUP=None - - self.projectObj=None - self.readUnitConfObj=None - self.procUnitConfObj0=None - self.opObj10=None - self.opObj12=None - - - self.setParam() - - #++++++++++++++++++NEW PROPERTIES+++++++++++++++++# - QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) - self.addpBtn.setToolTip('Add_New_Project') - self.addUnitProces.setToolTip('Add_New_Processing_Unit') - - #++++++++++++++++++NEW PROPERTIES+++++++++++++++++# - self.model = QtGui.QStandardItemModel() - self.treeView.setModel(self.model) - self.treeView.clicked.connect(self.clickFunctiontree) - self.treeView.expandAll() - #self.treeView.clicked.connect(self.treefunction1) - - def getNumberofProject(self): -# for i in self.proObjList: -# print i - return self.proObjList -# for i in self.proObjList: -# print i - - def setParam(self): - self.dataPathTxt.setText('C:\data') - self.numberChannelopVol.setEnabled(False) - self.lineHeighProfileTxtopVol.setEnabled(False) - self.numberIntegration.setEnabled(False) - self.valuenFFTPointOpSpec.setEnabled(False) - self.lineProfileSelecopVolCEB.setEnabled(False) - - - def clickFunctiontree(self,index): - indexclick= index.model().itemFromIndex(index).text() - #print indexclick - NumofPro=indexclick[8:10] - self.valuep=NumofPro - #print self.valuep - NameofPro=indexclick[0:7] - self.namepTree=NameofPro - #print self.namepTree - - - @pyqtSignature("") - def on_addprojectBtn_clicked(self): - """ - Llama al metodo addProject. - """ - print "En este nivel se abre el window" - - - self.addProject() - - def addProject(self): - """ - Muestra una - """ - - self.projectWindow = ProjectWindow(self) - self.projectWindow.show() - - #Al cerrar la venta de proyecto se ejecutara el metodo createProject - self.projectWindow.closed.connect(self.createProject) - - def createProject(self): - """ - Crea un nuevo proyecto del tipo Controller.Project() y lo adiciona al diccionario - self.__projectDict. - """ - - if not self.projectWindow.create: - return - - self.projectName = self.projectWindow.name - self.description = self.projectWindow.description - - print "En este nivel se debe crear el proyecto,id,nombre,desc" - #+++++Creacion del Objeto Controller-XML++++++++++# - self.idp += 1 - self.projectObj = Project() - - id=int(self.idp) - name=str(self.projectName) - desc=str(self.description) - - self.projectObj.setup(id = id, name=name, description=desc) - self.__projObjDict[id] = self.projectObj - self.proObjList.append(self.projectObj) - - self.parentItem = self.model.invisibleRootItem() - self.__arbolDict[id] = QtGui.QStandardItem(QtCore.QString("Project %0").arg(self.idp)) - - self.parentItem.appendRow(self.__arbolDict[projectObj.id]) - - #+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++# - - -# self.parentItem=self.projectObj.arbol -# self.loadProjects() - - print "Porfavor ingrese los parámetros de configuracion del Proyecto" - - def loadProjects(self): - self.proConfCmbBox.clear() - for i in self.__projObjDict.values(): - self.proConfCmbBox.addItem("Project"+str(i.id)) - - @pyqtSignature("int") - def on_dataTypeCmbBox_activated(self,index): - self.dataFormatTxt.setReadOnly(True) - if index==0: - self.datatype='Voltage' - elif index==1: - self.datatype='Spectra' - else : - self.datatype='' - self.dataFormatTxt.setReadOnly(False) - self.dataFormatTxt.setText(self.datatype) - - def existDir(self, var_dir): - """ - METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR - VARIABLE DIRECCION - """ - if os.path.isdir(var_dir): - return True - else: - self.textEdit.append("Incorrect path:" + str(var_dir)) - return False - - def loadDays(self): - """ - METODO PARA CARGAR LOS DIAS - """ - self.variableList=[] - self.starDateCmbBox.clear() - self.endDateCmbBox.clear() - - Dirlist = os.listdir(self.dataPath) - Dirlist.sort() - - for a in range(0, len(Dirlist)): - fname= Dirlist[a] - Doy=fname[5:8] - fname = fname[1:5] - print fname - fecha=Doy2Date(int(fname),int(Doy)) - fechaList=fecha.change2date() - #print fechaList[0] - Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1]) - #+"-"+ fechaList[0]+"-"+fechaList[1] - -#---------------AQUI TIENE QUE SER MODIFICADO--------# - - #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) - for i in range(0, (len(Dirlist))): - self.variableList.append(Dirlist[i]) - - for i in self.variableList: - self.starDateCmbBox.addItem(i) - self.endDateCmbBox.addItem(i) - self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1) - - self.getsubList() - self.dataOkBtn.setEnabled(True) - - def getsubList(self): - """ - OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS - """ - self.subList=[] - for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]: - self.subList.append(i) - - @pyqtSignature("") - def on_dataPathBrowse_clicked(self): - """ - OBTENCION DE LA RUTA DE DATOS - """ - self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) - self.dataPathTxt.setText(self.dataPath) - self.statusDpath=self.existDir(self.dataPath) - self.loadDays() - - @pyqtSignature("int") - def on_starDateCmbBox_activated(self, index): - """ - SELECCION DEL RANGO DE FECHAS -STAR DATE - """ - var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex() - self.endDateCmbBox.clear() - for i in self.variableList[index:]: - self.endDateCmbBox.addItem(i) - self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index) - self.getsubList() - - @pyqtSignature("int") - def on_endDateCmbBox_activated(self, index): - """ - SELECCION DEL RANGO DE FECHAS-END DATE - """ - var_StartDay_index=self.starDateCmbBox.currentIndex() - var_end_index = self.endDateCmbBox.count() - index - self.starDateCmbBox.clear() - for i in self.variableList[:len(self.variableList) - var_end_index + 1]: - self.starDateCmbBox.addItem(i) - self.starDateCmbBox.setCurrentIndex(var_StartDay_index) - self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas - - @pyqtSignature("int") - def on_readModeCmBox_activated(self, p0): - """ - Slot documentation goes here. - """ - if p0==0: - self.online=0 - elif p0==1: - self.online=1 - - @pyqtSignature("") - def on_dataOkBtn_clicked(self): - """ - Slot documentation goes here. - """ - print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online" - - projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())] - datatype=str(self.dataTypeCmbBox.currentText()) - path=str(self.dataPathTxt.text()) - online=int(self.online) - starDate=str(self.starDateCmbBox.currentText()) - endDate=str(self.endDateCmbBox.currentText()) - - - self.readUnitConfObj = projectObj.addReadUnit(datatype=datatype, - path=path, - startDate=starDate, - endDate=endDate, - startTime='06:10:00', - endTime='23:59:59', - online=online) - - self.readUnitConfObjList.append(self.readUnitConfObj) - - print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online - - - self.model_2=treeModel() - - self.model_2.setParams(name=projectObj.name+str(projectObj.id), - directorio=path, - workspace="C:\\WorkspaceGUI", - remode=str(self.readModeCmBox.currentText()), - dataformat=datatype, - date=str(starDate)+"-"+str(endDate), - initTime='06:10:00', - endTime='23:59:59', - timezone="Local" , - Summary="test de prueba") - self.model_2.arbol() - self.treeView_2.setModel(self.model_2) - self.treeView_2.expandAll() - - - @pyqtSignature("") - def on_addUnitProces_clicked(self): - """ - Slot documentation goes here. - """ -# print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" -# self.procUnitConfObj0 = self.projectObj.addProcUnit(datatype='Voltage', inputId=self.readUnitConfObj.getId()) - self.showUp() - - def showUp(self): - - self.configUP=UnitProcess(self) - for i in self.proObjList: - self.configUP.getfromWindowList.append(i) - #print i - for i in self.upObjList: - self.configUP.getfromWindowList.append(i) - self.configUP.loadTotalList() - self.configUP.show() - self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters) - self.configUP.closed.connect(self.createUP) - - def reciveUPparameters(self): - - self.uporProObjRecover,self.upType=self.configUP.almacena() - - - def createUP(self): - print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" - projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())] - - datatype=str(self.upType) - uporprojectObj=self.uporProObjRecover - #+++++++++++LET FLY+++++++++++# - if uporprojectObj.getElementName()=='ProcUnit': - inputId=uporprojectObj.getId() - elif uporprojectObj.getElementName()=='Project': - inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() - - - self.procUnitConfObj1 = projectObj.addProcUnit(datatype=datatype, inputId=inputId) - self.upObjList.append(self.procUnitConfObj1) - print inputId - print self.procUnitConfObj1.getId() - self.parentItem=uporprojectObj.arbol - self.numbertree=int(self.procUnitConfObj1.getId())-1 - self.procUnitConfObj1.arbol=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree)) - self.parentItem.appendRow(self.procUnitConfObj1.arbol) - self.parentItem=self.procUnitConfObj1.arbol - self.loadUp() - self.treeView.expandAll() - - def loadUp(self): - self.addOpUpselec.clear() - self.addOpSpecUpselec.clear() - for i in self.upObjList: - if i.datatype=='Voltage': - self.upObjVolList.append(i) - name=i.getElementName() - id=int(i.id)-1 - self.addOpUpselec.addItem(name+str(id)) - if i.datatype=='Spectra': - self.upobjSpecList.append(i) - name=i.getElementName() - id=int(i.id)-1 - self.addOpSpecUpselec.addItem(name+str(id)) - - self.resetopVolt() - self.resetopSpec() - - - @pyqtSignature("int") - def on_selecChannelopVolCEB_stateChanged(self, p0): - """ - Slot documentation goes here. - """ - if p0==2: - self.numberChannelopVol.setEnabled(True) - upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] - opObj10=upProcessSelect.addOperation(name='selectChannels') - print opObj10.id - self.operObjList.append(opObj10) - print " Ingresa seleccion de Canales" - if p0==0: - print " deshabilitado" - - @pyqtSignature("int") - def on_selecHeighopVolCEB_stateChanged(self, p0): - """ - Slot documentation goes here. - """ - if p0==2: - self.lineHeighProfileTxtopVol.setEnabled(True) - upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] - opObj10=upProcessSelect.addOperation(name='selectHeights') - print opObj10.id - self.operObjList.append(opObj10) - print " Select Type of Profile" - if p0==0: - print " deshabilitado" - - - @pyqtSignature("int") - def on_profileSelecopVolCEB_stateChanged(self, p0): - """ - Slot documentation goes here. - """ - if p0==2: - self.lineProfileSelecopVolCEB.setEnabled(True) - upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] - opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other') - print opObj10.id - self.operObjList.append(opObj10) - print " Select Type of Profile" - if p0==0: - print " deshabilitado" - - - @pyqtSignature("int") - def on_coherentIntegrationCEB_stateChanged(self, p0): - """ - Slot documentation goes here. - """ - if p0==2: - self.numberIntegration.setEnabled(True) - upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] - opObj10=upProcessSelect.addOperation(name='CohInt', optype='other') - print opObj10.id - self.operObjList.append(opObj10) - print "Choose number of Cohint" - if p0==0: - print " deshabilitado" - self.numberChannelopVol.setEnabled(False) - - def resetopVolt(self): - self.selecChannelopVolCEB.setChecked(False) - self.selecHeighopVolCEB.setChecked(False) - self.coherentIntegrationCEB.setChecked(False) - self.profileSelecopVolCEB.setChecked(False) - #self.selecChannelopVolCEB.setEnabled(False) - self.lineHeighProfileTxtopVol.clear() - self.lineProfileSelecopVolCEB.clear() - self.numberChannelopVol.clear() - self.numberIntegration.clear() - - - @pyqtSignature("") - def on_dataopVolOkBtn_clicked(self): - """ - Slot documentation goes here. - """ - if self.selecChannelopVolCEB.isChecked(): - for i in self.operObjList: - if i.name=='selectChannels': - value=self.numberChannelopVol.text() - i.addParameter(name='channelList', value=value, format='intlist') - - - print "channel" - - if self.selecHeighopVolCEB.isChecked(): - for i in self.operObjList: - if i.name=='selectHeights' : - value=self.lineHeighProfileTxtopVol.text() - valueList=value.split(',') - i.addParameter(name='minHei', value=valueList[0], format='float') - i.addParameter(name='maxHei', value=valueList[1], format='float') - - print "height" - - - if self.selecHeighopVolCEB.isChecked(): - for i in self.operObjList: - if i.name=='ProfileSelector' : - value=self.lineProfileSelecopVolCEB.text() - i.addParameter(name='ProfileSelector', value=value, format='intlist') - - - - if self.coherentIntegrationCEB.isChecked(): - for i in self.operObjList: - if i.name=='CohInt': - value=self.numberIntegration.text() - i.addParameter(name='n', value=value, format='int') - - - @pyqtSignature("int") - def on_nFFTPointOpSpecCEB_stateChanged(self, p0): - """ - Slot documentation goes here. - """ - if p0==2: - self.valuenFFTPointOpSpec.setEnabled(True) - print " nFFTPoint" - if p0==0: - print " deshabilitado" - - - def resetopSpec(self): - self.nFFTPointOpSpecCEB.setChecked(False) - - self.valuenFFTPointOpSpec.clear() - - - @pyqtSignature("") - def on_dataopSpecOkBtn_clicked(self): - """ - Slot documentation goes here. - """ - print "Añadimos operaciones Spectra,nchannels,value,format" - if self.nFFTPointOpSpecCEB.isChecked(): - upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] - value=self.valuenFFTPointOpSpec.text() - upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int') - - @pyqtSignature("int") - def on_SpectraPlotGraphCEB_stateChanged(self, p0): - """ - Slot documentation goes here. - """ - if p0==2: - upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] - opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other') - print opObj10.id - self.operObjList.append(opObj10) - - if p0==0: - print " deshabilitado" - - @pyqtSignature("int") - def on_CrossSpectraPlotGraphceb_stateChanged(self, p0): - """ - Slot documentation goes here. - """ - if p0==2: - upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] - opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other') - print opObj10.id - self.operObjList.append(opObj10) - if p0==0: - print " deshabilitado" - - @pyqtSignature("int") - def on_RTIPlotGraphCEB_stateChanged(self, p0): - """ - Slot documentation goes here. - """ - if p0==2: - upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] - opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other') - print opObj10.id - self.operObjList.append(opObj10) - if p0==0: - print " deshabilitado" - - - def resetgraphSpec(self): - self.SpectraPlotGraphCEB.setChecked(False) - self.CrossSpectraPlotGraphceb.setChecked(False) - self.RTIPlotGraphCEB.setChecked(False) - - @pyqtSignature("") - def on_dataGraphSpecOkBtn_clicked(self): - """ - Slot documentation goes here. - """ - print "Graficar Spec op" - if self.SpectraPlotGraphCEB.isChecked(): - for i in self.operObjList: - if i.name=='SpectraPlot': - i.addParameter(name='idfigure', value='1', format='int') - i.addParameter(name='wintitle', value='SpectraPlot0', format='str') - i.addParameter(name='zmin', value='40', format='int') - i.addParameter(name='zmax', value='90', format='int') - i.addParameter(name='showprofile', value='1', format='int') - - if self.CrossSpectraPlotGraphceb.isChecked(): - for i in self.operObjList: - if i.name=='CrossSpectraPlot' : - i.addParameter(name='idfigure', value='2', format='int') - i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') - i.addParameter(name='zmin', value='40', format='int') - i.addParameter(name='zmax', value='90', format='int') - - if self.RTIPlotGraphCEB.isChecked(): - for i in self.operObjList: - if i.name=='RTIPlot': - i.addParameter(name='n', value='2', format='int') - i.addParameter(name='overlapping', value='1', format='int') - - @pyqtSignature("") - def on_actionguardarObj_triggered(self): - """ - GUARDAR EL ARCHIVO DE CONFIGURACION XML - """ - if self.idp==1: - self.valuep=1 - - print "Escribiendo el archivo XML" - filename="C:\\WorkspaceGUI\\CONFIG"+str(self.valuep)+".xml" - self.projectObj=self.proObjList[int(self.valuep)-1] - self.projectObj.writeXml(filename) - - -class BasicWindow(MainWindow): - - def __init__(self): - pass - -class AdvancedWindow(MainWindow): - - def __init__(self): - pass - - - -class ProjectWindow(QMainWindow, Ui_window): - """ - Class documentation goes here. - """ - closed = pyqtSignal() - - create = False - name = None - description = None - - - - def __init__(self, parent = None): - """ - Constructor - """ - QMainWindow.__init__(self, parent) - self.setupUi(self) - self.name=None - - self.proyectNameLine.setText('My_name_is...') - self.descriptionTextEdit.setText('Write a description...') - - - @pyqtSignature("") - def on_cancelButton_clicked(self): - """ - Slot documentation goes here. - """ - # TODO: not implemented yet - #raise NotImplementedError - self.create = False - self.close() - - @pyqtSignature("") - def on_okButton_clicked(self): - """ - Slot documentation goes here. - """ - #self.almacena() - self.create = True - self.name = str(self.proyectNameLine.text()) - self.description = str(self.descriptionTextEdit.toPlainText()) - - self.close() - -# @pyqtSignature("") -# def on_saveButton_clicked(self): -# """ -# Slot documentation goes here. -# """ -# self.almacena() -## self.close() -# -# def almacena(self): -# #print str(self.proyectNameLine.text()) -# self.nameproject=str(self.proyectNameLine.text()) -# self.description=str(self.descriptionTextEdit.toPlainText()) -# return self.nameproject,self.description -# - def closeEvent(self, event): - self.closed.emit() - event.accept() - - -class UnitProcess(QMainWindow, Ui_UnitProcess): - """ - Class documentation goes here. - """ - closed=pyqtSignal() - def __init__(self, parent = None): - """ - Constructor - """ - QMainWindow.__init__(self, parent) - self.setupUi(self) - self.getFromWindow=None - self.getfromWindowList=[] - - self.listUP=None - - def loadTotalList(self): - self.comboInputBox.clear() - for i in self.getfromWindowList: - name=i.getElementName() - id= i.id - if i.getElementName()=='ProcUnit': - id=int(i.id)-1 - self.comboInputBox.addItem(str(name)+str(id)) - - @pyqtSignature("QString") - def on_comboInputBox_activated(self, p0): - """ - Slot documentation goes here. - """ - - # TODO: not implemented yet - #raise NotImplementedError - - @pyqtSignature("QString") - def on_comboTypeBox_activated(self, p0): - """ - Slot documentation goes here. - """ - # TODO: not implemented yet - #raise NotImplementedError - - @pyqtSignature("") - def on_unitPokbut_clicked(self): - """ - Slot documentation goes here. - """ - self.close() - - @pyqtSignature("") - def on_unitPsavebut_clicked(self): - """ - Slot documentation goes here. - """ - - print "alex" - self.almacena() - - @pyqtSignature("") - def on_unitPcancelbut_clicked(self): - """ - Slot documentation goes here. - """ - # TODO: not implemented yet - #raise NotImplementedError - self.hide() - - def almacena(self): - self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] - #self.nameofUP= str(self.nameUptxt.text()) - self.typeofUP= str(self.comboTypeBox.currentText()) - return self.getFromWindow,self.typeofUP - - def closeEvent(self, event): - self.closed.emit() - event.accept() - - - - - - - - \ No newline at end of file diff --git a/schainpy/gui/viewcontroller/xmlprint.py b/schainpy/gui/viewcontroller/xmlprint.py deleted file mode 100644 index 925523e..0000000 --- a/schainpy/gui/viewcontroller/xmlprint.py +++ /dev/null @@ -1,14 +0,0 @@ -''' -Created on Septembre, 2012 - -@author: roj-idl71 -''' -from xml.etree import ElementTree -from xml.dom import minidom - -def prettify(elem): - """Return a pretty-printed XML string for the Element. - """ - rough_string = ElementTree.tostring(elem, 'utf-8') - reparsed = minidom.parseString(rough_string) - return reparsed.toprettyxml(indent=" ") \ No newline at end of file diff --git a/schainpy/gui/viewer/ui_initwindow.py b/schainpy/gui/viewer/ui_initwindow.py index 5c77c0c..b0fb671 100644 --- a/schainpy/gui/viewer/ui_initwindow.py +++ b/schainpy/gui/viewer/ui_initwindow.py @@ -17,7 +17,7 @@ except AttributeError: import os from schainpy.gui.figures import tools -INITIAL_MSG = "Signal Chain GUI - v2.1.4" +INITIAL_MSG = "Signal Chain GUI - v2.1.5" FIGURES_PATH = tools.get_path() class Ui_InitWindow(object): diff --git a/schainpy/gui/viewer/windows/ui_project.py b/schainpy/gui/viewer/windows/ui_project.py index c517c20..1d2f87f 100644 --- a/schainpy/gui/viewer/windows/ui_project.py +++ b/schainpy/gui/viewer/windows/ui_project.py @@ -68,17 +68,29 @@ class Ui_ProjectTab(object): self.label_33 = QtGui.QLabel(self.frame) self.label_33.setObjectName(_fromUtf8("label_33")) self.gridLayout_2.addWidget(self.label_33, 3, 5, 1, 1) + self.proDelay = QtGui.QLineEdit(self.frame) self.proDelay.setObjectName(_fromUtf8("proDelay")) self.gridLayout_2.addWidget(self.proDelay, 3, 6, 1, 1) + self.label_32 = QtGui.QLabel(self.frame) self.label_32.setObjectName(_fromUtf8("label_32")) self.gridLayout_2.addWidget(self.label_32, 4, 0, 1, 1) + self.proComWalk = QtGui.QComboBox(self.frame) self.proComWalk.setObjectName(_fromUtf8("proComWalk")) self.proComWalk.addItem(_fromUtf8("")) self.proComWalk.addItem(_fromUtf8("")) - self.gridLayout_2.addWidget(self.proComWalk, 4, 1, 1, 8) + self.gridLayout_2.addWidget(self.proComWalk, 4, 1, 1, 4) + + self.labExpLabel = QtGui.QLabel(self.frame) + self.labExpLabel.setObjectName(_fromUtf8("labExpLabel")) + self.gridLayout_2.addWidget(self.labExpLabel, 4, 5, 1, 1) + + self.proExpLabel = QtGui.QLineEdit(self.frame) + self.proExpLabel.setObjectName(_fromUtf8("proExpLabel")) + self.gridLayout_2.addWidget(self.proExpLabel, 4, 6, 1, 1) + self.proLoadButton = QtGui.QPushButton(self.frame) self.proLoadButton.setObjectName(_fromUtf8("proLoadButton")) self.gridLayout_2.addWidget(self.proLoadButton, 5, 0, 1, 9) @@ -164,6 +176,7 @@ class Ui_ProjectTab(object): self.proComReadMode.setItemText(0, _translate("MainWindow", "Offline", None)) self.proComReadMode.setItemText(1, _translate("MainWindow", "Online", None)) self.label_33.setText(_translate("MainWindow", "Delay:", None)) + self.labExpLabel.setText(_translate("MainWindow", "Exp Label:", None)) self.label_32.setText(_translate("MainWindow", "Walk :", None)) self.proComWalk.setItemText(0, _translate("MainWindow", "On Files", None)) self.proComWalk.setItemText(1, _translate("MainWindow", "On Folder", None)) diff --git a/schainpy/gui/viewer/windows/ui_spectra.py b/schainpy/gui/viewer/windows/ui_spectra.py index 5ae8518..4bea2c1 100644 --- a/schainpy/gui/viewer/windows/ui_spectra.py +++ b/schainpy/gui/viewer/windows/ui_spectra.py @@ -104,8 +104,10 @@ class Ui_SpectraTab(object): self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra) self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency")) self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 3, 1, 2) + spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1) + self.label_21 = QtGui.QLabel(self.tabopSpectra) self.label_21.setObjectName(_fromUtf8("label_21")) self.gridLayout_5.addWidget(self.label_21, 1, 0, 1, 1) @@ -115,8 +117,10 @@ class Ui_SpectraTab(object): self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra) self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt")) self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 15, 0, 1, 1) + spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1) + self.label_70 = QtGui.QLabel(self.tabopSpectra) self.label_70.setObjectName(_fromUtf8("label_70")) self.gridLayout_5.addWidget(self.label_70, 3, 0, 1, 1) @@ -136,213 +140,219 @@ class Ui_SpectraTab(object): self.gridLayout_5.addWidget(self.specOpgetNoise, 16, 3, 1, 2) self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8("")) + ################################################################ + ################################################################ self.tabgraphSpectra = QtGui.QWidget() self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra")) self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra) self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) - spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) +# spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) +# self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) + xi = 0 self.label_24 = QtGui.QLabel(self.tabgraphSpectra) self.label_24.setObjectName(_fromUtf8("label_24")) - self.gridLayout_9.addWidget(self.label_24, 0, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_24, xi, 0, 1, 1) self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra) self.specGraphPath.setObjectName(_fromUtf8("specGraphPath")) - self.gridLayout_9.addWidget(self.specGraphPath, 0, 1, 1, 6) + self.gridLayout_9.addWidget(self.specGraphPath, xi, 1, 1, 6) self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra) self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath")) - self.gridLayout_9.addWidget(self.specGraphToolPath, 0, 7, 1, 1) + self.gridLayout_9.addWidget(self.specGraphToolPath, xi, 7, 1, 1) self.label_25 = QtGui.QLabel(self.tabgraphSpectra) self.label_25.setObjectName(_fromUtf8("label_25")) - self.gridLayout_9.addWidget(self.label_25, 2, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_25, xi+1, 0, 1, 1) self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra) self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix")) - self.gridLayout_9.addWidget(self.specGraphPrefix, 2, 1, 1, 7) + self.gridLayout_9.addWidget(self.specGraphPrefix, xi+1, 1, 1, 7) + xi = 2 self.label_40 = QtGui.QLabel(self.tabgraphSpectra) self.label_40.setObjectName(_fromUtf8("label_40")) - self.gridLayout_9.addWidget(self.label_40, 6, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_40, xi+1, 0, 1, 1) self.label_41 = QtGui.QLabel(self.tabgraphSpectra) self.label_41.setObjectName(_fromUtf8("label_41")) - self.gridLayout_9.addWidget(self.label_41, 8, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_41, xi+2, 0, 1, 1) self.label_42 = QtGui.QLabel(self.tabgraphSpectra) self.label_42.setObjectName(_fromUtf8("label_42")) - self.gridLayout_9.addWidget(self.label_42, 9, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_42, xi+3, 0, 1, 1) self.label_44 = QtGui.QLabel(self.tabgraphSpectra) self.label_44.setObjectName(_fromUtf8("label_44")) - self.gridLayout_9.addWidget(self.label_44, 10, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_44, xi+4, 0, 1, 1) self.label_46 = QtGui.QLabel(self.tabgraphSpectra) self.label_46.setObjectName(_fromUtf8("label_46")) - self.gridLayout_9.addWidget(self.label_46, 11, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_46, xi+5, 0, 1, 1) self.label_45 = QtGui.QLabel(self.tabgraphSpectra) self.label_45.setObjectName(_fromUtf8("label_45")) - self.gridLayout_9.addWidget(self.label_45, 13, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_45, xi+6, 0, 1, 1) self.label_43 = QtGui.QLabel(self.tabgraphSpectra) self.label_43.setObjectName(_fromUtf8("label_43")) - self.gridLayout_9.addWidget(self.label_43, 3, 3, 2, 1) + self.gridLayout_9.addWidget(self.label_43, xi, 3, 1, 1) self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphCebSpectraplot.setText(_fromUtf8("")) self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot")) - self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, 6, 3, 1, 1) + self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, xi+1, 3, 1, 1) self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphCebCrossSpectraplot.setText(_fromUtf8("")) self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot")) - self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, 8, 3, 1, 1) + self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, xi+2, 3, 1, 1) self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphCebRTIplot.setText(_fromUtf8("")) self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot")) - self.gridLayout_9.addWidget(self.specGraphCebRTIplot, 9, 3, 1, 1) + self.gridLayout_9.addWidget(self.specGraphCebRTIplot, xi+3, 3, 1, 1) self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphCebCoherencmap.setText(_fromUtf8("")) self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap")) - self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, 10, 3, 1, 1) + self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, xi+4, 3, 1, 1) self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphPowerprofile.setText(_fromUtf8("")) self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile")) - self.gridLayout_9.addWidget(self.specGraphPowerprofile, 11, 3, 1, 1) + self.gridLayout_9.addWidget(self.specGraphPowerprofile, xi+5, 3, 1, 1) self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphCebRTInoise.setText(_fromUtf8("")) self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise")) - self.gridLayout_9.addWidget(self.specGraphCebRTInoise, 13, 3, 1, 1) + self.gridLayout_9.addWidget(self.specGraphCebRTInoise, xi+6, 3, 1, 1) # spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) # self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1) self.label_47 = QtGui.QLabel(self.tabgraphSpectra) self.label_47.setObjectName(_fromUtf8("label_47")) - self.gridLayout_9.addWidget(self.label_47, 3, 5, 2, 1) + self.gridLayout_9.addWidget(self.label_47, xi, 5, 1, 1) self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphSaveSpectra.setText(_fromUtf8("")) self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra")) - self.gridLayout_9.addWidget(self.specGraphSaveSpectra, 6, 5, 1, 1) + self.gridLayout_9.addWidget(self.specGraphSaveSpectra, xi+1, 5, 1, 1) self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphSaveCross.setText(_fromUtf8("")) self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross")) - self.gridLayout_9.addWidget(self.specGraphSaveCross, 8, 5, 1, 1) + self.gridLayout_9.addWidget(self.specGraphSaveCross, xi+2, 5, 1, 1) self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphSaveRTIplot.setText(_fromUtf8("")) self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot")) - self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, 9, 5, 1, 1) + self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, xi+3, 5, 1, 1) self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphSaveCoherencemap.setText(_fromUtf8("")) self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap")) - self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, 10, 5, 1, 1) + self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, xi+4, 5, 1, 1) self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphSavePowerprofile.setText(_fromUtf8("")) self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile")) - self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, 11, 5, 1, 1) + self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, xi+5, 5, 1, 1) self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphSaveRTInoise.setText(_fromUtf8("")) self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise")) - self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, 13, 5, 1, 1) + self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, xi+6, 5, 1, 1) self.label_19 = QtGui.QLabel(self.tabgraphSpectra) self.label_19.setObjectName(_fromUtf8("label_19")) - self.gridLayout_9.addWidget(self.label_19, 3, 7, 2, 1) + self.gridLayout_9.addWidget(self.label_19, xi, 7, 1, 1) self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphftpSpectra.setText(_fromUtf8("")) self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra")) - self.gridLayout_9.addWidget(self.specGraphftpSpectra, 6, 7, 1, 1) + self.gridLayout_9.addWidget(self.specGraphftpSpectra, xi+1, 7, 1, 1) self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphftpCross.setText(_fromUtf8("")) self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross")) - self.gridLayout_9.addWidget(self.specGraphftpCross, 8, 7, 1, 1) + self.gridLayout_9.addWidget(self.specGraphftpCross, xi+2, 7, 1, 1) self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphftpRTIplot.setText(_fromUtf8("")) self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot")) - self.gridLayout_9.addWidget(self.specGraphftpRTIplot, 9, 7, 1, 1) + self.gridLayout_9.addWidget(self.specGraphftpRTIplot, xi+3, 7, 1, 1) self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphftpCoherencemap.setText(_fromUtf8("")) self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap")) - self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, 10, 7, 1, 1) + self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, xi+4, 7, 1, 1) self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphftpPowerprofile.setText(_fromUtf8("")) self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile")) - self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, 11, 7, 1, 1) + self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, xi+5, 7, 1, 1) self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) self.specGraphftpRTInoise.setText(_fromUtf8("")) self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise")) - self.gridLayout_9.addWidget(self.specGraphftpRTInoise, 13, 7, 1, 1) + self.gridLayout_9.addWidget(self.specGraphftpRTInoise, xi+6, 7, 1, 1) - spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) +# spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) +# self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) + + xi = 11 self.label_22 = QtGui.QLabel(self.tabgraphSpectra) self.label_22.setObjectName(_fromUtf8("label_22")) - self.gridLayout_9.addWidget(self.label_22, 16, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_22, xi, 0, 1, 1) self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq")) - self.gridLayout_9.addWidget(self.specGgraphFreq, 16, 2, 1, 2) + self.gridLayout_9.addWidget(self.specGgraphFreq, xi, 2, 1, 2) self.label_16 = QtGui.QLabel(self.tabgraphSpectra) self.label_16.setObjectName(_fromUtf8("label_16")) - self.gridLayout_9.addWidget(self.label_16, 17, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_16, xi+1, 0, 1, 1) self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight")) - self.gridLayout_9.addWidget(self.specGgraphHeight, 17, 2, 1, 2) + self.gridLayout_9.addWidget(self.specGgraphHeight, xi+1, 2, 1, 2) self.label_17 = QtGui.QLabel(self.tabgraphSpectra) self.label_17.setObjectName(_fromUtf8("label_17")) - self.gridLayout_9.addWidget(self.label_17, 18, 0, 1, 1) + self.gridLayout_9.addWidget(self.label_17, xi+2, 0, 1, 1) self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange")) - self.gridLayout_9.addWidget(self.specGgraphDbsrange, 18, 2, 1, 2) + self.gridLayout_9.addWidget(self.specGgraphDbsrange, xi+2, 2, 1, 2) self.specGraphTminTmaxLabel = QtGui.QLabel(self.tabgraphSpectra) self.specGraphTminTmaxLabel.setObjectName(_fromUtf8("specGraphTminTmaxLabel")) - self.gridLayout_9.addWidget(self.specGraphTminTmaxLabel, 19, 0, 1, 2) + self.gridLayout_9.addWidget(self.specGraphTminTmaxLabel, xi+3, 0, 1, 2) self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax")) - self.gridLayout_9.addWidget(self.specGgraphTminTmax, 19, 2, 1, 2) + self.gridLayout_9.addWidget(self.specGgraphTminTmax, xi+3, 2, 1, 2) self.specGraphMagLabel = QtGui.QLabel(self.tabgraphSpectra) self.specGraphMagLabel.setObjectName(_fromUtf8("specGraphMagLabel")) - self.gridLayout_9.addWidget(self.specGraphMagLabel, 16, 4, 1, 2) + self.gridLayout_9.addWidget(self.specGraphMagLabel, xi, 4, 1, 2) self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud")) - self.gridLayout_9.addWidget(self.specGgraphmagnitud, 16, 6, 1, 2) + self.gridLayout_9.addWidget(self.specGgraphmagnitud, xi, 6, 1, 2) self.specGraphPhaseLabel = QtGui.QLabel(self.tabgraphSpectra) self.specGraphPhaseLabel.setObjectName(_fromUtf8("specGraphPhaseLabel")) - self.gridLayout_9.addWidget(self.specGraphPhaseLabel, 17, 4, 1, 2) + self.gridLayout_9.addWidget(self.specGraphPhaseLabel, xi+1, 4, 1, 2) self.specGgraphPhase = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphPhase.setObjectName(_fromUtf8("specGgraphPhase")) - self.gridLayout_9.addWidget(self.specGgraphPhase, 17, 6, 1, 2) + self.gridLayout_9.addWidget(self.specGgraphPhase, xi+1, 6, 1, 2) self.label_6 = QtGui.QLabel(self.tabgraphSpectra) self.label_6.setObjectName(_fromUtf8("label_6")) - self.gridLayout_9.addWidget(self.label_6, 18, 4, 1, 1) + self.gridLayout_9.addWidget(self.label_6, xi+2, 4, 1, 1) self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList")) - self.gridLayout_9.addWidget(self.specGgraphChannelList, 18, 6, 1, 2) + self.gridLayout_9.addWidget(self.specGgraphChannelList, xi+2, 6, 1, 2) self.label_29 = QtGui.QLabel(self.tabgraphSpectra) self.label_29.setObjectName(_fromUtf8("label_29")) - self.gridLayout_9.addWidget(self.label_29, 19, 4, 1, 2) + self.gridLayout_9.addWidget(self.label_29, xi+3, 4, 1, 2) self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio")) - self.gridLayout_9.addWidget(self.specGgraphftpratio, 19, 6, 1, 2) + self.gridLayout_9.addWidget(self.specGgraphftpratio, xi+3, 6, 1, 2) self.label_48 = QtGui.QLabel(self.tabgraphSpectra) self.label_48.setObjectName(_fromUtf8("label_48")) - self.gridLayout_9.addWidget(self.label_48, 20, 4, 1, 2) + self.gridLayout_9.addWidget(self.label_48, xi+4, 4, 1, 2) self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra) self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange")) - self.gridLayout_9.addWidget(self.specGgraphTimeRange, 20, 6, 1, 2) - - spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) - spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) - spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) + self.gridLayout_9.addWidget(self.specGgraphTimeRange, xi+4, 6, 1, 2) + +# spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) +# self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) +# spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) +# self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) +# spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) +# self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) @@ -375,12 +385,7 @@ class Ui_SpectraTab(object): self.label_9 = QtGui.QLabel(self.taboutputSpectra) self.label_9.setObjectName(_fromUtf8("label_9")) self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2) - self.label_38 = QtGui.QLabel(self.taboutputSpectra) - self.label_38.setObjectName(_fromUtf8("label_38")) - self.gridLayout_11.addWidget(self.label_38, 3, 0, 1, 1) - self.specOutputprofileperblock = QtGui.QLineEdit(self.taboutputSpectra) - self.specOutputprofileperblock.setObjectName(_fromUtf8("specOutputprofileperblock")) - self.gridLayout_11.addWidget(self.specOutputprofileperblock, 3, 2, 1, 1) + self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8("")) self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1) @@ -444,7 +449,7 @@ class Ui_SpectraTab(object): self.label_34.setText(_translate("MainWindow", "Path:", None)) self.specOutputToolPath.setText(_translate("MainWindow", "...", None)) self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None)) - self.label_38.setText(_translate("MainWindow", "Profile per Block: ", None)) + self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None)) self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None))