##// END OF EJS Templates
Miguel Valdez -
r577:bea3bacb993a
parent child
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -0,0 +1,7
1 # ~/.bash_logout: executed by bash(1) when login shell exits.
2
3 # when leaving the console clear the screen to increase privacy
4
5 if [ "$SHLVL" = 1 ]; then
6 [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
7 fi
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,29
1 #!/usr/bin/env python
2 import os, sys
3 from PyQt4 import QtCore, QtGui
4 from PyQt4.QtGui import QApplication
5
6 from schainpy.gui.viewcontroller.initwindow import InitWindow
7 from schainpy.gui.viewcontroller.basicwindow import BasicWindow
8 from schainpy.gui.viewcontroller.workspace import Workspace
9
10 def main():
11
12 app = QtGui.QApplication(sys.argv)
13
14 Welcome=InitWindow()
15
16 if not Welcome.exec_():
17 sys.exit(-1)
18
19 WorkPathspace=Workspace()
20 if not WorkPathspace.exec_():
21 sys.exit(-1)
22
23 MainGUI=BasicWindow()
24 MainGUI.setWorkSpaceGUI(WorkPathspace.dirComBox.currentText())
25 MainGUI.show()
26 sys.exit(app.exec_())
27
28 if __name__ == "__main__":
29 main() No newline at end of file
@@ -0,0 +1,29
1 #!/usr/bin/env python
2 import os, sys
3 from PyQt4 import QtCore, QtGui
4 from PyQt4.QtGui import QApplication
5
6 from schainpy.gui.viewcontroller.initwindow import InitWindow
7 from schainpy.gui.viewcontroller.basicwindow import BasicWindow
8 from schainpy.gui.viewcontroller.workspace import Workspace
9
10 def main():
11
12 app = QtGui.QApplication(sys.argv)
13
14 Welcome=InitWindow()
15
16 if not Welcome.exec_():
17 sys.exit(-1)
18
19 WorkPathspace=Workspace()
20 if not WorkPathspace.exec_():
21 sys.exit(-1)
22
23 MainGUI=BasicWindow()
24 MainGUI.setWorkSpaceGUI(WorkPathspace.dirComBox.currentText())
25 MainGUI.show()
26 sys.exit(app.exec_())
27
28 if __name__ == "__main__":
29 main() No newline at end of file
@@ -0,0 +1,97
1 import threading
2 import Queue
3 import pickle
4 import numpy, os, sys
5
6 from schainpy.controller import Project
7 from command import *
8
9 class ControllerThread(threading.Thread):
10 def __init__(self, filename, data_q):
11 super(ControllerThread, self).__init__()
12 self.filename = filename
13 self.data_q = data_q
14 self.control = {'stop':False,'pause':False}
15
16 def stop(self):
17 self.control['stop'] = True
18
19 def pause(self):
20 self.control['pause'] = not(self.control['pause'])
21
22 def run(self):
23 self.control['stop'] = False
24 self.control['pause'] = False
25 self.controllerObj = Project(self.control, self.data_q)
26 self.controllerObj.readXml(self.filename)
27 self.controllerObj.createObjects()
28 self.controllerObj.connectObjects()
29 self.controllerObj.run()
30
31 class CommCtrlProcessThread(threading.Thread):
32 """ Implements the threading.Thread interface (start, join, etc.) and
33 can be controlled via the cmd_q Queue attribute. Replies are placed in
34 the reply_q Queue attribute.
35 """
36 def __init__(self, cmd_q=Queue.Queue(), reply_q=Queue.Queue()):
37 super(CommCtrlProcessThread, self).__init__()
38 self.cmd_q = cmd_q
39 self.reply_q = reply_q
40
41 # self.print_q = Queue.Queue()
42 self.data_q = Queue.Queue()
43
44 self.alive = threading.Event()
45 self.alive.set()
46 self.socket = None
47
48 self.socketIO = None
49 self.mySocket = None
50
51
52 self.handlers = {
53 ProcessCommand.PROCESS: self._handle_ioPROCESSTHREAD,
54 ProcessCommand.MESSAGE: self._handle_ioMESSAGE,
55 ProcessCommand.DATA: self._handle_ioDATA,
56 ProcessCommand.STOP: self._handle_ioSTOP,
57 ProcessCommand.PAUSE: self._handle_ioPAUSE
58 }
59
60 def run(self):
61 while self.alive.isSet():
62 try:
63 cmd = self.cmd_q.get(True, 0.1)
64 self.handlers[cmd.type](cmd)
65 except Queue.Empty as e:
66 continue
67
68
69 def _handle_ioPROCESSTHREAD(self, cmd):
70 filename = cmd.data
71 self.controllerObj = ControllerThread(filename=filename, data_q=self.data_q)
72 self.controllerObj.start()
73
74 def _handle_ioPAUSE(self, cmd):
75 self.controllerObj.pause()
76
77 def _handle_ioSTOP(self, cmd):
78 self.controllerObj.stop()
79
80 def _handle_ioDATA(self, cmd):
81 self.reply_q.put(self._success_reply_data(data=cmd.data))
82
83 def _handle_ioMESSAGE(self, cmd):
84 self.reply_q.put(self._success_reply_message(data=cmd.data))
85
86 def _success_reply_data(self, data=None):
87 return ClientReply(ClientReply.DATA, data)
88
89 def _success_reply_message(self, data=None):
90 return ClientReply(ClientReply.MESSAGE, data)
91
92 def join(self, timeout=None):
93 self.alive.clear()
94 threading.Thread.join(self, timeout)
95
96
97 No newline at end of file
@@ -0,0 +1,50
1 class ProcessCommand(object):
2 """ A command to the client thread.
3 Each command type has its associated data:
4
5 DATA: Data Radar Object
6 MESSAGE: Data String
7 STOP: Event to Stop the process thread
8 PAUSE: Event to Pause the process thread
9 """
10 PROCESS, DATA, MESSAGE, STOP, PAUSE = range(5)
11
12 def __init__(self, type, data=None):
13 self.type = type
14 self.data = data
15
16
17 class ClientCommand(object):
18 """ A command to the client thread.
19 Each command type has its associated data:
20
21 CONNECT: (host, port) tuple
22 SEND: Data string
23 RECEIVE: None
24 CLOSE: None
25 PROCESS: to processing
26 SEND: send a data
27 SENDXML: send xml file
28 """
29 CONNECT, SEND, SENDXML, RECEIVE, CLOSE, PROCESS = range(6)
30
31 def __init__(self, type, data=None):
32 self.type = type
33 self.data = data
34
35
36 class ClientReply(object):
37 """ A reply from the client thread.
38 Each reply type has its associated data:
39
40 ERROR: The error string
41 MESSAGE: Data String
42 DATA: Data
43 SUCCESS: Depends on the command - for RECEIVE it's the received
44 data string, for others None.
45 """
46 ERROR, SUCCESS, MESSAGE, DATA= range(4)
47
48 def __init__(self, type, data=None):
49 self.type = type
50 self.data = data
@@ -0,0 +1,21
1 # -*- coding: utf-8 -*-
2
3 """
4 Module implementing Ftp.
5 """
6
7 from PyQt4.QtGui import QMainWindow
8 from PyQt4.QtCore import pyqtSignature
9
10 from schainpy.gui.viewer.ftp import Ui_Ftp
11
12 class Ftp(QMainWindow, Ui_MainWindow):
13 """
14 Class documentation goes here.
15 """
16 def __init__(self, parent = None):
17 """
18 Constructor
19 """
20 QMainWindow.__init__(self, parent)
21 self.setupUi(self)
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
@@ -0,0 +1,298
1 import os.path
2 import ftplib
3
4
5 class Ftp():
6 """
7 Ftp is a public class used to define custom File Transfer Protocol from "ftplib" python module
8
9 Non-standard Python modules used: None
10
11 Written by "Daniel Suarez":mailto:daniel.suarez@jro.igp.gob.pe Oct. 26, 2010
12 """
13
14 def __init__(self,host = None, username=None, passw=None, remotefolder=None):
15 """
16 This method is used to setting parameters for FTP and establishing connection to remote host
17
18 Inputs:
19 host - remote host IP Address
20
21 username - remote host Username
22
23 passw - remote host Passw
24
25 remotefolder - remote host current working directory
26
27 Return: void
28
29 Affects:
30 self.status - in Error Case or Connection Failed this parameter is set to 1 else 0
31
32 self.folderList - sub-folder list of remote folder
33
34 self.fileList - file list of remote folder
35
36
37 """
38
39 if ((host == None) and (username==None) and (passw==None) and (remotefolder==None)):
40 host, username, passw, remotefolder = self.parmsByDefault()
41
42 self.host = host
43 self.username = username
44 self.passw = passw
45 self.remotefolder = remotefolder
46 self.file = None
47 self.ftp = None
48 self.status = 0
49
50 try:
51 self.ftp = ftplib.FTP(self.host)
52 self.ftp.login(self.username,self.passw)
53 self.ftp.cwd(self.remotefolder)
54 # print 'Connect to FTP Server: Successfully'
55
56 except ftplib.all_errors:
57 print 'Error FTP Service'
58 self.status = 1
59 return
60
61
62
63 self.dirList = []
64
65 try:
66 self.dirList = self.ftp.nlst()
67
68 except ftplib.error_perm, resp:
69 if str(resp) == "550 No files found":
70 print "no files in this directory"
71 self.status = 1
72 return
73
74 except ftplib.all_errors:
75 print 'Error Displaying Dir-Files'
76 self.status = 1
77 return
78
79 self.fileList = []
80 self.folderList = []
81 #only for test
82 for f in self.dirList:
83 name, ext = os.path.splitext(f)
84 if ext != '':
85 self.fileList.append(f)
86 # print 'filename: %s - size: %d'%(f,self.ftp.size(f))
87
88 def parmsByDefault(self):
89 host = 'jro-app.igp.gob.pe'
90 username = 'wmaster'
91 passw = 'mst2010vhf'
92 remotefolder = '/home/wmaster/graficos'
93
94 # host = 'jro.igp.gob.pe'
95 # username = 'operaciones'
96 # passw = 'mst2010vhf'
97 # remotefolder = '/users/databases/on-line'
98
99 return host, username, passw, remotefolder
100
101
102 def mkd(self,dirname):
103 """
104 mkd is used to make directory in remote host
105
106 Input:
107 dirname - directory name
108
109 Return:
110 1 in error case else 0
111 """
112 try:
113 self.ftp.mkd(dirname)
114 except:
115 print 'Error creating remote folder:%s'%dirname
116 return 1
117
118 return 0
119
120
121 def delete(self,filename):
122 """
123 delete is used to delete file in current working directory of remote host
124
125 Input:
126 filename - filename to delete in remote folder
127
128 Return:
129 1 in error case else 0
130 """
131
132 try:
133 self.ftp.delete(filename)
134 except:
135 print 'Error deleting remote file:%s'%filename
136 return 1
137
138 return 0
139
140 def download(self,filename,localfolder):
141 """
142 download is used to downloading file from remote folder into local folder
143
144 Inputs:
145 filename - filename to donwload
146
147 localfolder - directory local to store filename
148
149 Returns:
150 self.status - 1 in error case else 0
151 """
152
153 self.status = 0
154
155
156 if not(filename in self.fileList):
157 print 'filename:%s not exists'%filename
158 self.status = 1
159 return self.status
160
161 newfilename = os.path.join(localfolder,filename)
162
163 self.file = open(newfilename, 'wb')
164
165 try:
166 print 'Download: ' + filename
167 self.ftp.retrbinary('RETR ' + filename, self.__handleDownload)
168 print 'Download Complete'
169 except ftplib.all_errors:
170 print 'Error Downloading ' + filename
171 self.status = 1
172 return self.status
173
174 self.file.close()
175
176 return self.status
177
178
179 def __handleDownload(self,block):
180 """
181 __handleDownload is used to handle writing file
182 """
183 self.file.write(block)
184
185
186 def upload(self,filename,remotefolder=None):
187 """
188 upload is used to uploading local file to remote directory
189
190 Inputs:
191 filename - full path name of local file to store in remote directory
192
193 remotefolder - remote directory
194
195 Returns:
196 self.status - 1 in error case else 0
197 """
198
199 if remotefolder == None:
200 remotefolder = self.remotefolder
201
202 self.status = 0
203
204 try:
205 self.ftp.cwd(remotefolder)
206
207 self.file = open(filename, 'rb')
208
209 (head, tail) = os.path.split(filename)
210
211 command = "STOR " + tail
212
213 print 'Uploading: ' + tail
214 self.ftp.storbinary(command, self.file)
215 print 'Upload Completed'
216
217 except ftplib.all_errors:
218 print 'Error Uploading ' + tail
219 self.status = 1
220 return self.status
221
222 self.file.close()
223
224 #back to initial directory in __init__()
225 self.ftp.cwd(self.remotefolder)
226
227 return self.status
228
229
230 def dir(self,remotefolder):
231 """
232 dir is used to change working directory of remote host and get folder and file list
233
234 Input:
235 remotefolder - current working directory
236
237 Affects:
238 self.fileList - file list of working directory
239
240 Return:
241 infoList - list with filenames and size of file in bytes
242
243 self.folderList - folder list
244 """
245
246 self.remotefolder = remotefolder
247 print 'Change to ' + self.remotefolder
248 try:
249 self.ftp.cwd(remotefolder)
250 except ftplib.all_errors:
251 print 'Error Change to ' + self.remotefolder
252 infoList = None
253 self.folderList = None
254 return infoList,self.folderList
255
256 self.dirList = []
257
258 try:
259 self.dirList = self.ftp.nlst()
260
261 except ftplib.error_perm, resp:
262 if str(resp) == "550 No files found":
263 print "no files in this directory"
264 infoList = None
265 self.folderList = None
266 return infoList,self.folderList
267 except ftplib.all_errors:
268 print 'Error Displaying Dir-Files'
269 infoList = None
270 self.folderList = None
271 return infoList,self.folderList
272
273 infoList = []
274 self.fileList = []
275 self.folderList = []
276 for f in self.dirList:
277 name,ext = os.path.splitext(f)
278 if ext != '':
279 self.fileList.append(f)
280 value = (f,self.ftp.size(f))
281 infoList.append(value)
282
283 if ext == '':
284 self.folderList.append(f)
285
286 return infoList,self.folderList
287
288
289 def close(self):
290 """
291 close is used to close and end FTP connection
292
293 Inputs: None
294
295 Return: void
296
297 """
298 self.ftp.close() No newline at end of file
This diff has been collapsed as it changes many lines, (538 lines changed) Show them Hide them
@@ -0,0 +1,538
1 import os
2 import numpy
3 import time, datetime
4 import mpldriver_gui
5 from customftp import *
6 import Queue
7 import threading
8
9 class FTP_Thread (threading.Thread):
10 def __init__(self):
11 threading.Thread.__init__(self)
12 self.exitFlag = 0
13 self.queueLock = threading.Lock()
14 self.workQueue = Queue.Queue()
15
16 def run(self):
17 self.send_data()
18
19 def fin(self):
20 self.exitFlag = 1
21
22 def put_data(self, data):
23 # Fill the queue
24 self.queueLock.acquire()
25 self.workQueue.put(data)
26 self.queueLock.release()
27
28 def send_data(self):
29 while not self.exitFlag:
30 if self.workQueue.qsize():
31
32 data = self.workQueue.get(True)
33
34 try:
35 ftpObj = Ftp(host=data['server'],
36 username=data['username'],
37 passw=data['password'],
38 remotefolder=data['folder'])
39
40 ftpObj.upload(data['figfilename'])
41 ftpObj.close()
42 except:
43 print ValueError, 'Error FTP'
44 print "don't worry still running the program"
45
46
47 class Figure():
48
49 __driver = mpldriver_gui
50 __isConfigThread = False
51 fig = None
52
53 id = None
54 wintitle = None
55 width = None
56 height = None
57 nplots = None
58 timerange = None
59
60 axesObjList = []
61
62 WIDTH = None
63 HEIGHT = None
64 PREFIX = 'fig'
65
66 FTP_WEI = None #(WW)
67 EXP_CODE = None #(EXP)
68 SUB_EXP_CODE = None #(SS)
69 PLOT_CODE = None #(TT)
70 PLOT_POS = None #(NN)
71
72
73
74 def __init__(self):
75
76 raise ValueError, "This method is not implemented"
77
78 def getSubplots(self):
79
80 raise ValueError, "Abstract method: This method should be defined"
81
82 def getAxesObjList(self):
83
84 return self.axesObjList
85
86 def getScreenDim(self, widthplot, heightplot):
87
88 nrow, ncol = self.getSubplots()
89 widthscreen = widthplot*ncol
90 heightscreen = heightplot*nrow
91
92 return widthscreen, heightscreen
93
94 def getFilename(self, name, ext='.png'):
95 path = '%s%03d' %(self.PREFIX, self.id)
96 filename = '%s_%s%s' %(self.PREFIX, name, ext)
97 return os.path.join(path, filename)
98
99 def createFigure(self, id, wintitle, widthplot=None, heightplot=None):
100
101 if widthplot == None:
102 widthplot = self.WIDTH
103
104 if heightplot == None:
105 heightplot = self.HEIGHT
106
107 self.id = id
108
109 self.wintitle = wintitle
110
111 self.widthscreen, self.heightscreen = self.getScreenDim(widthplot, heightplot)
112
113 self.fig = self.__driver.createFigure(id=self.id,
114 wintitle=self.wintitle,
115 width=self.widthscreen,
116 height=self.heightscreen)
117
118 self.axesObjList = []
119
120 return self.fig
121
122 def clearAxes(self):
123 self.axesObjList = []
124
125 def addAxes(self, *args):
126 axesObj = Axes(self.fig, *args)
127 self.axesObjList.append(axesObj)
128
129 def saveFigure(self, figpath, figfile, *args):
130
131 filename = os.path.join(figpath, figfile)
132
133 fullpath = os.path.split(filename)[0]
134
135 if not os.path.exists(fullpath):
136 subpath = os.path.split(fullpath)[0]
137
138 if not os.path.exists(subpath):
139 os.mkdir(subpath)
140
141 os.mkdir(fullpath)
142
143 self.__driver.saveFigure(self.fig, filename, *args)
144
145 def getTimeLim(self, x, xmin, xmax):
146
147 if self.timerange != None:
148 txmin = x[0] - x[0]%self.timerange
149 else:
150 txmin = numpy.min(x)
151
152 thisdatetime = datetime.datetime.utcfromtimestamp(txmin)
153 thisdate = datetime.datetime.combine(thisdatetime.date(), datetime.time(0,0,0))
154
155 ####################################################
156 #If the x is out of xrange
157 if xmax < (thisdatetime - thisdate).seconds/(60*60.):
158 xmin = None
159 xmax = None
160
161 if xmin == None:
162 td = thisdatetime - thisdate
163 xmin = td.seconds/(60*60.)
164
165 if xmax == None:
166 xmax = xmin + self.timerange/(60*60.)
167
168 mindt = thisdate + datetime.timedelta(hours=xmin) - datetime.timedelta(seconds=time.timezone)
169 tmin = time.mktime(mindt.timetuple())
170
171 maxdt = thisdate + datetime.timedelta(hours=xmax) - datetime.timedelta(seconds=time.timezone)
172 tmax = time.mktime(maxdt.timetuple())
173
174 self.timerange = tmax - tmin
175
176 return tmin, tmax
177
178 def sendByFTP(self, figfilename, server, folder, username, password):
179 ftpObj = Ftp(host=server, username=username, passw=password, remotefolder=folder)
180 ftpObj.upload(figfilename)
181 ftpObj.close()
182
183 def sendByFTP_Thread(self, figfilename, server, folder, username, password):
184 data = {'figfilename':figfilename,'server':server,'folder':folder,'username':username,'password':password}
185
186 if not(self.__isConfigThread):
187
188 self.thread = FTP_Thread()
189 self.thread.start()
190 self.__isConfigThread = True
191
192 self.thread.put_data(data)
193
194
195 def getNameToFtp(self, thisDatetime, FTP_WEI, EXP_CODE, SUB_EXP_CODE, PLOT_CODE, PLOT_POS):
196 YEAR_STR = '%4.4d'%thisDatetime.timetuple().tm_year
197 DOY_STR = '%3.3d'%thisDatetime.timetuple().tm_yday
198 FTP_WEI = '%2.2d'%FTP_WEI
199 EXP_CODE = '%3.3d'%EXP_CODE
200 SUB_EXP_CODE = '%2.2d'%SUB_EXP_CODE
201 PLOT_CODE = '%2.2d'%PLOT_CODE
202 PLOT_POS = '%2.2d'%PLOT_POS
203 name = YEAR_STR + DOY_STR + FTP_WEI + EXP_CODE + SUB_EXP_CODE + PLOT_CODE + PLOT_POS
204 return name
205
206 def draw(self):
207 self.__driver.draw(self.fig)
208
209 axesList = property(getAxesObjList)
210
211 class Axes:
212
213 __driver = mpldriver_gui
214 fig = None
215 ax = None
216 plot = None
217 __missing = 1E30
218 __firsttime = None
219
220 __showprofile = False
221
222 xmin = None
223 xmax = None
224 ymin = None
225 ymax = None
226 zmin = None
227 zmax = None
228
229 x_buffer = None
230 z_buffer = None
231
232 decimationx = None
233 decimationy = None
234
235 __MAXNUMX = 1000.
236 __MAXNUMY = 500.
237
238 def __init__(self, *args):
239
240 """
241
242 Input:
243 *args : Los parametros necesarios son
244 fig, nrow, ncol, xpos, ypos, colspan, rowspan
245 """
246
247 ax = self.__driver.createAxes(*args)
248 self.fig = args[0]
249 self.ax = ax
250 self.plot = None
251
252 self.__firsttime = True
253 self.idlineList = []
254
255 self.x_buffer = numpy.array([])
256 self.z_buffer = numpy.array([])
257
258 def pcolor(self, x, y, z,
259 xmin=None, xmax=None,
260 ymin=None, ymax=None,
261 zmin=None, zmax=None,
262 xlabel='', ylabel='',
263 title='', rti = False, colormap='jet',
264 **kwargs):
265
266 """
267 Input:
268 x :
269 y :
270 x :
271 xmin :
272 xmax :
273 ymin :
274 ymax :
275 zmin :
276 zmax :
277 xlabel :
278 ylabel :
279 title :
280 **kwargs : Los parametros aceptados son
281 ticksize=9,
282 cblabel=''
283 rti = True or False
284 """
285
286 if self.__firsttime:
287
288 if xmin == None: xmin = numpy.nanmin(x)
289 if xmax == None: xmax = numpy.nanmax(x)
290 if ymin == None: ymin = numpy.nanmin(y)
291 if ymax == None: ymax = numpy.nanmax(y)
292 if zmin == None: zmin = numpy.nanmin(z)
293 if zmax == None: zmax = numpy.nanmax(z)
294
295
296 self.plot = self.__driver.createPcolor(self.ax, x, y, z,
297 xmin, xmax,
298 ymin, ymax,
299 zmin, zmax,
300 xlabel=xlabel,
301 ylabel=ylabel,
302 title=title,
303 colormap=colormap,
304 **kwargs)
305
306 if self.xmin == None: self.xmin = xmin
307 if self.xmax == None: self.xmax = xmax
308 if self.ymin == None: self.ymin = ymin
309 if self.ymax == None: self.ymax = ymax
310 if self.zmin == None: self.zmin = zmin
311 if self.zmax == None: self.zmax = zmax
312
313 self.__firsttime = False
314 return
315
316 if rti:
317 self.__driver.addpcolor(self.ax, x, y, z, self.zmin, self.zmax,
318 xlabel=xlabel,
319 ylabel=ylabel,
320 title=title,
321 colormap=colormap)
322 return
323
324 self.__driver.pcolor(self.plot, z,
325 xlabel=xlabel,
326 ylabel=ylabel,
327 title=title)
328
329
330 def pline(self, x, y,
331 xmin=None, xmax=None,
332 ymin=None, ymax=None,
333 xlabel='', ylabel='',
334 title='',
335 **kwargs):
336
337 """
338
339 Input:
340 x :
341 y :
342 xmin :
343 xmax :
344 ymin :
345 ymax :
346 xlabel :
347 ylabel :
348 title :
349 **kwargs : Los parametros aceptados son
350
351 ticksize
352 ytick_visible
353 """
354
355 if self.__firsttime:
356
357 if xmin == None: xmin = numpy.nanmin(x)
358 if xmax == None: xmax = numpy.nanmax(x)
359 if ymin == None: ymin = numpy.nanmin(y)
360 if ymax == None: ymax = numpy.nanmax(y)
361
362 self.plot = self.__driver.createPline(self.ax, x, y,
363 xmin, xmax,
364 ymin, ymax,
365 xlabel=xlabel,
366 ylabel=ylabel,
367 title=title,
368 **kwargs)
369
370 self.idlineList.append(0)
371 self.__firsttime = False
372 return
373
374 self.__driver.pline(self.plot, x, y, xlabel=xlabel,
375 ylabel=ylabel,
376 title=title)
377
378 def pmultiline(self, x, y,
379 xmin=None, xmax=None,
380 ymin=None, ymax=None,
381 xlabel='', ylabel='',
382 title='',
383 **kwargs):
384
385 if self.__firsttime:
386
387 if xmin == None: xmin = numpy.nanmin(x)
388 if xmax == None: xmax = numpy.nanmax(x)
389 if ymin == None: ymin = numpy.nanmin(y)
390 if ymax == None: ymax = numpy.nanmax(y)
391
392 self.plot = self.__driver.createPmultiline(self.ax, x, y,
393 xmin, xmax,
394 ymin, ymax,
395 xlabel=xlabel,
396 ylabel=ylabel,
397 title=title,
398 **kwargs)
399 self.__firsttime = False
400 return
401
402 self.__driver.pmultiline(self.plot, x, y, xlabel=xlabel,
403 ylabel=ylabel,
404 title=title)
405
406 def pmultilineyaxis(self, x, y,
407 xmin=None, xmax=None,
408 ymin=None, ymax=None,
409 xlabel='', ylabel='',
410 title='',
411 **kwargs):
412
413 if self.__firsttime:
414
415 if xmin == None: xmin = numpy.nanmin(x)
416 if xmax == None: xmax = numpy.nanmax(x)
417 if ymin == None: ymin = numpy.nanmin(y)
418 if ymax == None: ymax = numpy.nanmax(y)
419
420 self.plot = self.__driver.createPmultilineYAxis(self.ax, x, y,
421 xmin, xmax,
422 ymin, ymax,
423 xlabel=xlabel,
424 ylabel=ylabel,
425 title=title,
426 **kwargs)
427 if self.xmin == None: self.xmin = xmin
428 if self.xmax == None: self.xmax = xmax
429 if self.ymin == None: self.ymin = ymin
430 if self.ymax == None: self.ymax = ymax
431
432 self.__firsttime = False
433 return
434
435 self.__driver.pmultilineyaxis(self.plot, x, y, xlabel=xlabel,
436 ylabel=ylabel,
437 title=title)
438
439 def addpline(self, x, y, idline, **kwargs):
440 lines = self.ax.lines
441
442 if idline in self.idlineList:
443 self.__driver.set_linedata(self.ax, x, y, idline)
444
445 if idline not in(self.idlineList):
446 self.__driver.addpline(self.ax, x, y, **kwargs)
447 self.idlineList.append(idline)
448
449 return
450
451 def pcolorbuffer(self, x, y, z,
452 xmin=None, xmax=None,
453 ymin=None, ymax=None,
454 zmin=None, zmax=None,
455 xlabel='', ylabel='',
456 title='', rti = True, colormap='jet',
457 maxNumX = None, maxNumY = None,
458 **kwargs):
459
460 if maxNumX == None:
461 maxNumX = self.__MAXNUMX
462
463 if maxNumY == None:
464 maxNumY = self.__MAXNUMY
465
466 if self.__firsttime:
467 self.z_buffer = z
468 self.x_buffer = numpy.hstack((self.x_buffer, x))
469
470 if xmin == None: xmin = numpy.nanmin(x)
471 if xmax == None: xmax = numpy.nanmax(x)
472 if ymin == None: ymin = numpy.nanmin(y)
473 if ymax == None: ymax = numpy.nanmax(y)
474 if zmin == None: zmin = numpy.nanmin(z)
475 if zmax == None: zmax = numpy.nanmax(z)
476
477
478 self.plot = self.__driver.createPcolor(self.ax, self.x_buffer, y, z,
479 xmin, xmax,
480 ymin, ymax,
481 zmin, zmax,
482 xlabel=xlabel,
483 ylabel=ylabel,
484 title=title,
485 colormap=colormap,
486 **kwargs)
487
488 if self.xmin == None: self.xmin = xmin
489 if self.xmax == None: self.xmax = xmax
490 if self.ymin == None: self.ymin = ymin
491 if self.ymax == None: self.ymax = ymax
492 if self.zmin == None: self.zmin = zmin
493 if self.zmax == None: self.zmax = zmax
494
495 self.__firsttime = False
496 return
497
498 self.x_buffer = numpy.hstack((self.x_buffer, x[-1]))
499 self.z_buffer = numpy.hstack((self.z_buffer, z))
500
501 if self.decimationx == None:
502 deltax = float(self.xmax - self.xmin)/maxNumX
503 deltay = float(self.ymax - self.ymin)/maxNumY
504
505 resolutionx = self.x_buffer[2]-self.x_buffer[0]
506 resolutiony = y[1]-y[0]
507
508 self.decimationx = numpy.ceil(deltax / resolutionx)
509 self.decimationy = numpy.ceil(deltay / resolutiony)
510
511 z_buffer = self.z_buffer.reshape(-1,len(y))
512
513 x_buffer = self.x_buffer[::self.decimationx]
514 y_buffer = y[::self.decimationy]
515 z_buffer = z_buffer[::self.decimationx, ::self.decimationy]
516 #===================================================
517
518 x_buffer, y_buffer, z_buffer = self.__fillGaps(x_buffer, y_buffer, z_buffer)
519
520 self.__driver.addpcolorbuffer(self.ax, x_buffer, y_buffer, z_buffer, self.zmin, self.zmax,
521 xlabel=xlabel,
522 ylabel=ylabel,
523 title=title,
524 colormap=colormap)
525 def __fillGaps(self, x_buffer, y_buffer, z_buffer):
526
527 deltas = x_buffer[1:] - x_buffer[0:-1]
528 x_median = numpy.median(deltas)
529
530 index = numpy.where(deltas >= 2*x_median)
531
532 if len(index[0]) != 0:
533 z_buffer[index[0],::] = self.__missing
534 z_buffer = numpy.ma.masked_inside(z_buffer,0.99*self.__missing,1.01*self.__missing)
535
536 return x_buffer, y_buffer, z_buffer
537
538 No newline at end of file
@@ -0,0 +1,326
1 import numpy
2 import datetime
3 import sys
4
5 from matplotlib.figure import Figure
6 from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
7
8 from mpl_toolkits.axes_grid1 import make_axes_locatable
9 from matplotlib.ticker import *
10 import matplotlib.gridspec as gridspec
11 import matplotlib.cm as cm
12 import matplotlib.colorbar
13
14 def createFigure(id, wintitle, width, height, facecolor="w"):
15 figsize = (width,height)
16 fig = Figure(figsize=figsize, facecolor=facecolor)
17
18 return fig
19
20 def createAxes(fig, nrow, ncol, x, y, ratio):
21 width_ratios = []
22 for i in range(ncol):
23 if i%2==0:
24 width_ratios.append(ratio)
25 else:
26 width_ratios.append(1)
27
28 gs = gridspec.GridSpec(nrow, ncol, width_ratios=width_ratios)
29 ax = fig.add_subplot(gs[x,y])
30
31 return ax
32
33 def saveFigure(fig, filename):
34 fig.savefig(filename)
35
36
37 def printLabels(ax, xlabel, ylabel, title):
38
39 ax.set_xlabel(xlabel, size=11)
40 ax.set_ylabel(ylabel, size=11)
41 ax.set_title(title, size=12)
42
43 def createPcolor(ax, x, y, z, xmin, xmax, ymin, ymax, zmin, zmax,
44 xlabel='', ylabel='', title='', ticksize = 9,
45 colormap='jet',cblabel='', cbsize="5%",
46 XAxisAsTime=False):
47
48 divider = make_axes_locatable(ax)
49 ax_cb = divider.new_horizontal(size=cbsize, pad=0.05)
50 fig = ax.get_figure()
51 fig.add_axes(ax_cb)
52
53 ax.set_xlim([xmin,xmax])
54 ax.set_ylim([ymin,ymax])
55
56 printLabels(ax, xlabel, ylabel, title)
57
58 imesh = ax.pcolormesh(x,y,z.T, vmin=zmin, vmax=zmax, cmap=cm.get_cmap(colormap))
59 cb = fig.colorbar(imesh, cax=ax_cb)
60 cb.set_label(cblabel)
61
62 for tick in ax.yaxis.get_major_ticks():
63 tick.label.set_fontsize(ticksize)
64
65 for tick in ax.xaxis.get_major_ticks():
66 tick.label.set_fontsize(ticksize)
67
68 for tick in cb.ax.get_yticklabels():
69 tick.set_fontsize(ticksize)
70
71 ax_cb.yaxis.tick_right()
72
73 if '0.' in matplotlib.__version__[0:2]:
74 print "The matplotlib version has to be updated to 1.1 or newer"
75 return imesh
76
77 if '1.0.' in matplotlib.__version__[0:4]:
78 print "The matplotlib version has to be updated to 1.1 or newer"
79 return imesh
80
81 fig.tight_layout()
82
83 if XAxisAsTime:
84
85 func = lambda x, pos: ('%s') %(datetime.datetime.utcfromtimestamp(x).strftime("%H:%M:%S"))
86 ax.xaxis.set_major_formatter(FuncFormatter(func))
87 ax.xaxis.set_major_locator(LinearLocator(7))
88
89 return imesh
90
91 def pcolor(imesh, z, xlabel='', ylabel='', title=''):
92
93 z = z.T
94
95 ax = imesh.get_axes()
96
97 printLabels(ax, xlabel, ylabel, title)
98
99 imesh.set_array(z.ravel())
100
101 def addpcolorbuffer(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', colormap='jet'):
102
103 printLabels(ax, xlabel, ylabel, title)
104
105 ax.collections.remove(ax.collections[0])
106
107 ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=matplotlib.pyplot.get_cmap(colormap))
108
109
110 def draw(fig):
111
112 if type(fig) == 'int':
113 raise ValueError, "This parameter should be of tpye matplotlib figure"
114
115 fig.canvas.draw()
116
117
118 def createPline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='',
119 ticksize=9, xtick_visible=True, ytick_visible=True,
120 nxticks=4, nyticks=10,
121 grid=None):
122
123 """
124
125 Input:
126 grid : None, 'both', 'x', 'y'
127 """
128 fig = ax.get_figure()
129 ax.set_xlim([xmin,xmax])
130 ax.set_ylim([ymin,ymax])
131
132 printLabels(ax, xlabel, ylabel, title)
133
134 ######################################################
135 if (xmax-xmin)<=1:
136 xtickspos = numpy.linspace(xmin,xmax,nxticks)
137 xtickspos = numpy.array([float("%.1f"%i) for i in xtickspos])
138 ax.set_xticks(xtickspos)
139 else:
140 xtickspos = numpy.arange(nxticks)*int((xmax-xmin)/(nxticks)) + int(xmin)
141 # xtickspos = numpy.arange(nxticks)*float(xmax-xmin)/float(nxticks) + int(xmin)
142 ax.set_xticks(xtickspos)
143
144 for tick in ax.get_xticklabels():
145 tick.set_visible(xtick_visible)
146
147 for tick in ax.xaxis.get_major_ticks():
148 tick.label.set_fontsize(ticksize)
149
150 ######################################################
151 for tick in ax.get_yticklabels():
152 tick.set_visible(ytick_visible)
153
154 for tick in ax.yaxis.get_major_ticks():
155 tick.label.set_fontsize(ticksize)
156
157 ax.plot(x, y)
158 iplot = ax.lines[-1]
159
160 ######################################################
161 if '0.' in matplotlib.__version__[0:2]:
162 print "The matplotlib version has to be updated to 1.1 or newer"
163 return iplot
164
165 if '1.0.' in matplotlib.__version__[0:4]:
166 print "The matplotlib version has to be updated to 1.1 or newer"
167 return iplot
168
169 if grid != None:
170 ax.grid(b=True, which='major', axis=grid)
171 fig.tight_layout()
172 return iplot
173
174 def set_linedata(ax, x, y, idline):
175
176 ax.lines[idline].set_data(x,y)
177
178 def pline(iplot, x, y, xlabel='', ylabel='', title=''):
179
180 ax = iplot.get_axes()
181
182 printLabels(ax, xlabel, ylabel, title)
183
184 set_linedata(ax, x, y, idline=0)
185
186 def addpline(ax, x, y, color, linestyle, lw):
187
188 ax.plot(x,y,color=color,linestyle=linestyle,lw=lw)
189
190 def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None,
191 ticksize=9, xtick_visible=True, ytick_visible=True,
192 nxticks=4, nyticks=10,
193 grid=None):
194
195 """
196
197 Input:
198 grid : None, 'both', 'x', 'y'
199 """
200
201 # matplotlib.pyplot.ioff()
202 fig = ax.get_figure()
203
204 lines = ax.plot(x.T, y)
205 leg = ax.legend(lines, legendlabels, loc='upper right')
206 leg.get_frame().set_alpha(0.5)
207 ax.set_xlim([xmin,xmax])
208 ax.set_ylim([ymin,ymax])
209 printLabels(ax, xlabel, ylabel, title)
210
211 xtickspos = numpy.arange(nxticks)*int((xmax-xmin)/(nxticks)) + int(xmin)
212 ax.set_xticks(xtickspos)
213
214 for tick in ax.get_xticklabels():
215 tick.set_visible(xtick_visible)
216
217 for tick in ax.xaxis.get_major_ticks():
218 tick.label.set_fontsize(ticksize)
219
220 for tick in ax.get_yticklabels():
221 tick.set_visible(ytick_visible)
222
223 for tick in ax.yaxis.get_major_ticks():
224 tick.label.set_fontsize(ticksize)
225
226 iplot = ax.lines[-1]
227
228 if '0.' in matplotlib.__version__[0:2]:
229 print "The matplotlib version has to be updated to 1.1 or newer"
230 return iplot
231
232 if '1.0.' in matplotlib.__version__[0:4]:
233 print "The matplotlib version has to be updated to 1.1 or newer"
234 return iplot
235
236 if grid != None:
237 ax.grid(b=True, which='major', axis=grid)
238
239 # matplotlib.pyplot.tight_layout()
240 #
241 # matplotlib.pyplot.ion()
242
243 fig.tight_layout()
244
245 return iplot
246
247
248 def pmultiline(iplot, x, y, xlabel='', ylabel='', title=''):
249
250 ax = iplot.get_axes()
251
252 printLabels(ax, xlabel, ylabel, title)
253
254 for i in range(len(ax.lines)):
255 line = ax.lines[i]
256 line.set_data(x[i,:],y)
257
258 def createPmultilineYAxis(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None,
259 ticksize=9, xtick_visible=True, ytick_visible=True,
260 nxticks=4, nyticks=10, marker='.', markersize=10, linestyle="None",
261 grid=None, XAxisAsTime=False):
262
263
264 # matplotlib.pyplot.ioff()
265 fig = ax.get_figure()
266
267 lines = ax.plot(x, y.T, linestyle='None', marker='.', markersize=markersize)
268 leg = ax.legend(lines, legendlabels, loc='upper left', bbox_to_anchor=(1.01, 1.00), numpoints=1, handlelength=1.5, \
269 handletextpad=0.5, borderpad=0.5, labelspacing=0.5, borderaxespad=0.)
270
271 for label in leg.get_texts(): label.set_fontsize(9)
272
273 ax.set_xlim([xmin,xmax])
274 ax.set_ylim([ymin,ymax])
275 printLabels(ax, xlabel, ylabel, title)
276
277 # xtickspos = numpy.arange(nxticks)*int((xmax-xmin)/(nxticks)) + int(xmin)
278 # ax.set_xticks(xtickspos)
279
280 for tick in ax.get_xticklabels():
281 tick.set_visible(xtick_visible)
282
283 for tick in ax.xaxis.get_major_ticks():
284 tick.label.set_fontsize(ticksize)
285
286 for tick in ax.get_yticklabels():
287 tick.set_visible(ytick_visible)
288
289 for tick in ax.yaxis.get_major_ticks():
290 tick.label.set_fontsize(ticksize)
291
292 iplot = ax.lines[-1]
293
294 if '0.' in matplotlib.__version__[0:2]:
295 print "The matplotlib version has to be updated to 1.1 or newer"
296 return iplot
297
298 if '1.0.' in matplotlib.__version__[0:4]:
299 print "The matplotlib version has to be updated to 1.1 or newer"
300 return iplot
301
302 if grid != None:
303 ax.grid(b=True, which='major', axis=grid)
304
305 # matplotlib.pyplot.tight_layout()
306
307 if XAxisAsTime:
308
309 func = lambda x, pos: ('%s') %(datetime.datetime.utcfromtimestamp(x).strftime("%H:%M:%S"))
310 ax.xaxis.set_major_formatter(FuncFormatter(func))
311 ax.xaxis.set_major_locator(LinearLocator(7))
312
313 fig.tight_layout()
314 # matplotlib.pyplot.ion()
315
316 return iplot
317
318 def pmultilineyaxis(iplot, x, y, xlabel='', ylabel='', title=''):
319
320 ax = iplot.get_axes()
321
322 printLabels(ax, xlabel, ylabel, title)
323
324 for i in range(len(ax.lines)):
325 line = ax.lines[i]
326 line.set_data(x,y[i,:]) No newline at end of file
@@ -0,0 +1,139
1 # -*- coding: utf-8 -*-
2
3 # Form implementation generated from reading ui file '/home/alex/ui/ftpConfig4.ui'
4 #
5 # Created: Tue Aug 20 08:24:35 2013
6 # by: PyQt4 UI code generator 4.10
7 #
8 # WARNING! All changes made in this file will be lost!
9
10 from PyQt4 import QtCore, QtGui
11
12 try:
13 _fromUtf8 = QtCore.QString.fromUtf8
14 except AttributeError:
15 def _fromUtf8(s):
16 return s
17
18 try:
19 _encoding = QtGui.QApplication.UnicodeUTF8
20 def _translate(context, text, disambig):
21 return QtGui.QApplication.translate(context, text, disambig, _encoding)
22 except AttributeError:
23 def _translate(context, text, disambig):
24 return QtGui.QApplication.translate(context, text, disambig)
25
26 class Ui_Ftp(object):
27 def setupUi(self, MainWindow):
28 MainWindow.setObjectName(_fromUtf8("MainWindow"))
29 MainWindow.resize(374, 399)
30 MainWindow.setMinimumSize(QtCore.QSize(374, 399))
31 MainWindow.setMaximumSize(QtCore.QSize(374, 399))
32 self.centralWidget = QtGui.QWidget(MainWindow)
33 self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
34 self.label = QtGui.QLabel(self.centralWidget)
35 self.label.setGeometry(QtCore.QRect(9, 38, 47, 17))
36 self.label.setObjectName(_fromUtf8("label"))
37 self.label_2 = QtGui.QLabel(self.centralWidget)
38 self.label_2.setGeometry(QtCore.QRect(9, 133, 77, 17))
39 self.label_2.setObjectName(_fromUtf8("label_2"))
40 self.label_3 = QtGui.QLabel(self.centralWidget)
41 self.label_3.setGeometry(QtCore.QRect(9, 166, 68, 17))
42 self.label_3.setObjectName(_fromUtf8("label_3"))
43 self.label_4 = QtGui.QLabel(self.centralWidget)
44 self.label_4.setGeometry(QtCore.QRect(9, 9, 101, 17))
45 font = QtGui.QFont()
46 font.setBold(True)
47 font.setWeight(75)
48 self.label_4.setFont(font)
49 self.label_4.setObjectName(_fromUtf8("label_4"))
50 self.label_5 = QtGui.QLabel(self.centralWidget)
51 self.label_5.setGeometry(QtCore.QRect(9, 104, 87, 17))
52 font = QtGui.QFont()
53 font.setBold(True)
54 font.setWeight(75)
55 self.label_5.setFont(font)
56 self.label_5.setObjectName(_fromUtf8("label_5"))
57 self.label_6 = QtGui.QLabel(self.centralWidget)
58 self.label_6.setGeometry(QtCore.QRect(9, 71, 47, 17))
59 self.label_6.setObjectName(_fromUtf8("label_6"))
60 self.serverFTP = QtGui.QLineEdit(self.centralWidget)
61 self.serverFTP.setGeometry(QtCore.QRect(130, 40, 231, 27))
62 self.serverFTP.setObjectName(_fromUtf8("serverFTP"))
63 self.folderFTP = QtGui.QLineEdit(self.centralWidget)
64 self.folderFTP.setGeometry(QtCore.QRect(130, 70, 231, 27))
65 self.folderFTP.setObjectName(_fromUtf8("folderFTP"))
66 self.usernameFTP = QtGui.QLineEdit(self.centralWidget)
67 self.usernameFTP.setGeometry(QtCore.QRect(130, 130, 231, 27))
68 self.usernameFTP.setObjectName(_fromUtf8("usernameFTP"))
69 self.passwordFTP = QtGui.QLineEdit(self.centralWidget)
70 self.passwordFTP.setGeometry(QtCore.QRect(130, 160, 231, 27))
71 self.passwordFTP.setObjectName(_fromUtf8("passwordFTP"))
72 self.ftpCancelButton = QtGui.QPushButton(self.centralWidget)
73 self.ftpCancelButton.setGeometry(QtCore.QRect(130, 360, 111, 27))
74 self.ftpCancelButton.setObjectName(_fromUtf8("ftpCancelButton"))
75 self.ftpOkButton = QtGui.QPushButton(self.centralWidget)
76 self.ftpOkButton.setGeometry(QtCore.QRect(250, 360, 111, 27))
77 self.ftpOkButton.setObjectName(_fromUtf8("ftpOkButton"))
78 self.label_7 = QtGui.QLabel(self.centralWidget)
79 self.label_7.setGeometry(QtCore.QRect(10, 200, 66, 17))
80 font = QtGui.QFont()
81 font.setBold(True)
82 font.setWeight(75)
83 self.label_7.setFont(font)
84 self.label_7.setObjectName(_fromUtf8("label_7"))
85 self.label_8 = QtGui.QLabel(self.centralWidget)
86 self.label_8.setGeometry(QtCore.QRect(10, 230, 81, 17))
87 self.label_8.setObjectName(_fromUtf8("label_8"))
88 self.label_9 = QtGui.QLabel(self.centralWidget)
89 self.label_9.setGeometry(QtCore.QRect(10, 260, 81, 17))
90 self.label_9.setObjectName(_fromUtf8("label_9"))
91 self.label_10 = QtGui.QLabel(self.centralWidget)
92 self.label_10.setGeometry(QtCore.QRect(10, 290, 81, 17))
93 self.label_10.setObjectName(_fromUtf8("label_10"))
94 self.label_11 = QtGui.QLabel(self.centralWidget)
95 self.label_11.setGeometry(QtCore.QRect(10, 320, 81, 17))
96 self.label_11.setObjectName(_fromUtf8("label_11"))
97 self.weightFTP = QtGui.QLineEdit(self.centralWidget)
98 self.weightFTP.setGeometry(QtCore.QRect(130, 230, 231, 27))
99 self.weightFTP.setObjectName(_fromUtf8("weightFTP"))
100 self.expcodeFTP = QtGui.QLineEdit(self.centralWidget)
101 self.expcodeFTP.setGeometry(QtCore.QRect(130, 260, 231, 27))
102 self.expcodeFTP.setObjectName(_fromUtf8("expcodeFTP"))
103 self.subexpFTP = QtGui.QLineEdit(self.centralWidget)
104 self.subexpFTP.setGeometry(QtCore.QRect(130, 290, 231, 27))
105 self.subexpFTP.setObjectName(_fromUtf8("subexpFTP"))
106 self.plotposFTP = QtGui.QLineEdit(self.centralWidget)
107 self.plotposFTP.setGeometry(QtCore.QRect(130, 320, 231, 27))
108 self.plotposFTP.setObjectName(_fromUtf8("plotposFTP"))
109 MainWindow.setCentralWidget(self.centralWidget)
110
111 self.retranslateUi(MainWindow)
112 QtCore.QMetaObject.connectSlotsByName(MainWindow)
113
114 def retranslateUi(self, MainWindow):
115 MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
116 self.label.setText(_translate("MainWindow", "Server:", None))
117 self.label_2.setText(_translate("MainWindow", "User Name:", None))
118 self.label_3.setText(_translate("MainWindow", "Password:", None))
119 self.label_4.setText(_translate("MainWindow", "Server Details", None))
120 self.label_5.setText(_translate("MainWindow", "User Details", None))
121 self.label_6.setText(_translate("MainWindow", "Folder:", None))
122 self.ftpCancelButton.setText(_translate("MainWindow", "Cancel", None))
123 self.ftpOkButton.setText(_translate("MainWindow", "Ok", None))
124 self.label_7.setText(_translate("MainWindow", "Others", None))
125 self.label_8.setText(_translate("MainWindow", "Ftp_wei:", None))
126 self.label_9.setText(_translate("MainWindow", "Exp_code:", None))
127 self.label_10.setText(_translate("MainWindow", "Sub_exp:", None))
128 self.label_11.setText(_translate("MainWindow", "Plot_pos:", None))
129
130
131 if __name__ == "__main__":
132 import sys
133 app = QtGui.QApplication(sys.argv)
134 MainWindow = QtGui.QMainWindow()
135 ui = Ui_Ftp()
136 ui.setupUi(MainWindow)
137 MainWindow.show()
138 sys.exit(app.exec_())
139
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,855 +1,1024
1 '''
1 '''
2 Created on September , 2012
2 Created on September , 2012
3 @author:
3 @author:
4 '''
4 '''
5 from xml.etree.ElementTree import Element, SubElement
5 from xml.etree.ElementTree import Element, SubElement
6 from xml.etree import ElementTree as ET
6 from xml.etree import ElementTree as ET
7 from xml.dom import minidom
7 from xml.dom import minidom
8
8
9 #import datetime
9 #import datetime
10 from model import *
10 from model import *
11
11
12 import ast
12 import ast
13
13
14 def prettify(elem):
14 def prettify(elem):
15 """Return a pretty-printed XML string for the Element.
15 """Return a pretty-printed XML string for the Element.
16 """
16 """
17 rough_string = ET.tostring(elem, 'utf-8')
17 rough_string = ET.tostring(elem, 'utf-8')
18 reparsed = minidom.parseString(rough_string)
18 reparsed = minidom.parseString(rough_string)
19 return reparsed.toprettyxml(indent=" ")
19 return reparsed.toprettyxml(indent=" ")
20
20
21 class ParameterConf():
21 class ParameterConf():
22
22
23 id = None
23 id = None
24 name = None
24 name = None
25 value = None
25 value = None
26 format = None
26 format = None
27
27
28 __formated_value = None
28 __formated_value = None
29
29
30 ELEMENTNAME = 'Parameter'
30 ELEMENTNAME = 'Parameter'
31
31
32 def __init__(self):
32 def __init__(self):
33
33
34 self.format = 'str'
34 self.format = 'str'
35
35
36 def getElementName(self):
36 def getElementName(self):
37
37
38 return self.ELEMENTNAME
38 return self.ELEMENTNAME
39
39
40 def getValue(self):
40 def getValue(self):
41
41
42 if self.__formated_value != None:
42 if self.__formated_value != None:
43
43
44 return self.__formated_value
44 return self.__formated_value
45
45
46 value = self.value
46 value = self.value
47
47
48 if self.format == 'bool':
48 if self.format == 'bool':
49 value = int(value)
49 value = int(value)
50
50
51 if self.format == 'list':
51 if self.format == 'list':
52 strList = value.split(',')
52 strList = value.split(',')
53
53
54 self.__formated_value = strList
54 self.__formated_value = strList
55
55
56 return self.__formated_value
56 return self.__formated_value
57
57
58 if self.format == 'intlist':
58 if self.format == 'intlist':
59 """
59 """
60 Example:
60 Example:
61 value = (0,1,2)
61 value = (0,1,2)
62 """
62 """
63 strList = value.split(',')
63 strList = value.split(',')
64 intList = [int(x) for x in strList]
64 intList = [int(x) for x in strList]
65
65
66 self.__formated_value = intList
66 self.__formated_value = intList
67
67
68 return self.__formated_value
68 return self.__formated_value
69
69
70 if self.format == 'floatlist':
70 if self.format == 'floatlist':
71 """
71 """
72 Example:
72 Example:
73 value = (0.5, 1.4, 2.7)
73 value = (0.5, 1.4, 2.7)
74 """
74 """
75 strList = value.split(',')
75 strList = value.split(',')
76 floatList = [float(x) for x in strList]
76 floatList = [float(x) for x in strList]
77
77
78 self.__formated_value = floatList
78 self.__formated_value = floatList
79
79
80 return self.__formated_value
80 return self.__formated_value
81
81
82 if self.format == 'date':
82 if self.format == 'date':
83 strList = value.split('/')
83 strList = value.split('/')
84 intList = [int(x) for x in strList]
84 intList = [int(x) for x in strList]
85 date = datetime.date(intList[0], intList[1], intList[2])
85 date = datetime.date(intList[0], intList[1], intList[2])
86
86
87 self.__formated_value = date
87 self.__formated_value = date
88
88
89 return self.__formated_value
89 return self.__formated_value
90
90
91 if self.format == 'time':
91 if self.format == 'time':
92 strList = value.split(':')
92 strList = value.split(':')
93 intList = [int(x) for x in strList]
93 intList = [int(x) for x in strList]
94 time = datetime.time(intList[0], intList[1], intList[2])
94 time = datetime.time(intList[0], intList[1], intList[2])
95
95
96 self.__formated_value = time
96 self.__formated_value = time
97
97
98 return self.__formated_value
98 return self.__formated_value
99
99
100 if self.format == 'pairslist':
100 if self.format == 'pairslist':
101 """
101 """
102 Example:
102 Example:
103 value = (0,1),(1,2)
103 value = (0,1),(1,2)
104 """
104 """
105
105
106 value = value.replace('(', '')
106 value = value.replace('(', '')
107 value = value.replace(')', '')
107 value = value.replace(')', '')
108
108
109 strList = value.split(',')
109 strList = value.split(',')
110 intList = [int(item) for item in strList]
110 intList = [int(item) for item in strList]
111 pairList = []
111 pairList = []
112 for i in range(len(intList)/2):
112 for i in range(len(intList)/2):
113 pairList.append((intList[i*2], intList[i*2 + 1]))
113 pairList.append((intList[i*2], intList[i*2 + 1]))
114
114
115 self.__formated_value = pairList
115 self.__formated_value = pairList
116
116
117 return self.__formated_value
117 return self.__formated_value
118
118
119 if self.format == 'multilist':
119 if self.format == 'multilist':
120 """
120 """
121 Example:
121 Example:
122 value = (0,1,2),(3,4,5)
122 value = (0,1,2),(3,4,5)
123 """
123 """
124 multiList = ast.literal_eval(value)
124 multiList = ast.literal_eval(value)
125
125
126 self.__formated_value = multiList
126 self.__formated_value = multiList
127
127
128 return self.__formated_value
128 return self.__formated_value
129
129
130 format_func = eval(self.format)
130 format_func = eval(self.format)
131
131
132 self.__formated_value = format_func(value)
132 self.__formated_value = format_func(value)
133
133
134 return self.__formated_value
134 return self.__formated_value
135
135
136 def setup(self, id, name, value, format='str'):
136 def setup(self, id, name, value, format='str'):
137
137
138 self.id = id
138 self.id = id
139 self.name = name
139 self.name = name
140 self.value = str(value)
140 self.value = str(value)
141 self.format = str.lower(format)
141 self.format = str.lower(format)
142
142
143 def update(self, name, value, format='str'):
144
145 self.name = name
146 self.value = str(value)
147 self.format = format
148
143 def makeXml(self, opElement):
149 def makeXml(self, opElement):
144
150
145 parmElement = SubElement(opElement, self.ELEMENTNAME)
151 parmElement = SubElement(opElement, self.ELEMENTNAME)
146 parmElement.set('id', str(self.id))
152 parmElement.set('id', str(self.id))
147 parmElement.set('name', self.name)
153 parmElement.set('name', self.name)
148 parmElement.set('value', self.value)
154 parmElement.set('value', self.value)
149 parmElement.set('format', self.format)
155 parmElement.set('format', self.format)
150
156
151 def readXml(self, parmElement):
157 def readXml(self, parmElement):
152
158
153 self.id = parmElement.get('id')
159 self.id = parmElement.get('id')
154 self.name = parmElement.get('name')
160 self.name = parmElement.get('name')
155 self.value = parmElement.get('value')
161 self.value = parmElement.get('value')
156 self.format = str.lower(parmElement.get('format'))
162 self.format = str.lower(parmElement.get('format'))
157
163
158 #Compatible with old signal chain version
164 #Compatible with old signal chain version
159 if self.format == 'int' and self.name == 'idfigure':
165 if self.format == 'int' and self.name == 'idfigure':
160 self.name = 'id'
166 self.name = 'id'
161
167
162 def printattr(self):
168 def printattr(self):
163
169
164 print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format)
170 print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format)
165
171
166 class OperationConf():
172 class OperationConf():
167
173
168 id = None
174 id = None
169 name = None
175 name = None
170 priority = None
176 priority = None
171 type = None
177 type = None
172
178
173 parmConfObjList = []
179 parmConfObjList = []
174
180
175 ELEMENTNAME = 'Operation'
181 ELEMENTNAME = 'Operation'
176
182
177 def __init__(self):
183 def __init__(self):
178
184
179 self.id = 0
185 self.id = 0
180 self.name = None
186 self.name = None
181 self.priority = None
187 self.priority = None
182 self.type = 'self'
188 self.type = 'self'
183
189
184
190
185 def __getNewId(self):
191 def __getNewId(self):
186
192
187 return int(self.id)*10 + len(self.parmConfObjList) + 1
193 return int(self.id)*10 + len(self.parmConfObjList) + 1
188
194
189 def getElementName(self):
195 def getElementName(self):
190
196
191 return self.ELEMENTNAME
197 return self.ELEMENTNAME
192
198
193 def getParameterObjList(self):
199 def getParameterObjList(self):
194
200
195 return self.parmConfObjList
201 return self.parmConfObjList
196
202
203 def getParameterObj(self, parameterName):
204
205 for parmConfObj in self.parmConfObjList:
206
207 if parmConfObj.name != parameterName:
208 continue
209
210 return parmConfObj
211
212 return None
213
214 def getParameterObjfromValue(self,parameterValue):
215 for parmConfObj in self.parmConfObjList:
216
217 if parmConfObj.getValue() != parameterValue:
218 continue
219
220 return parmConfObj.getValue()
221
222 return None
223
224 def getParameterValue(self, parameterName):
225
226 parameterObj = self.getParameterObj(parameterName)
227 value = parameterObj.getValue()
228
229 return value
230
197 def setup(self, id, name, priority, type):
231 def setup(self, id, name, priority, type):
198
232
199 self.id = id
233 self.id = id
200 self.name = name
234 self.name = name
201 self.type = type
235 self.type = type
202 self.priority = priority
236 self.priority = priority
203
237
204 self.parmConfObjList = []
238 self.parmConfObjList = []
205
239
240 def removeParameters(self):
241
242 for obj in self.parmConfObjList:
243 del obj
244
245 self.parmConfObjList = []
246
206 def addParameter(self, name, value, format='str'):
247 def addParameter(self, name, value, format='str'):
207
248
208 id = self.__getNewId()
249 id = self.__getNewId()
209
250
210 parmConfObj = ParameterConf()
251 parmConfObj = ParameterConf()
211 parmConfObj.setup(id, name, value, format)
252 parmConfObj.setup(id, name, value, format)
212
253
213 self.parmConfObjList.append(parmConfObj)
254 self.parmConfObjList.append(parmConfObj)
214
255
215 return parmConfObj
256 return parmConfObj
216
257
258 def changeParameter(self, name, value, format='str'):
259
260 parmConfObj = self.getParameterObj(name)
261 parmConfObj.update(name, value, format)
262
263 return parmConfObj
264
217 def makeXml(self, upElement):
265 def makeXml(self, upElement):
218
266
219 opElement = SubElement(upElement, self.ELEMENTNAME)
267 opElement = SubElement(upElement, self.ELEMENTNAME)
220 opElement.set('id', str(self.id))
268 opElement.set('id', str(self.id))
221 opElement.set('name', self.name)
269 opElement.set('name', self.name)
222 opElement.set('type', self.type)
270 opElement.set('type', self.type)
223 opElement.set('priority', str(self.priority))
271 opElement.set('priority', str(self.priority))
224
272
225 for parmConfObj in self.parmConfObjList:
273 for parmConfObj in self.parmConfObjList:
226 parmConfObj.makeXml(opElement)
274 parmConfObj.makeXml(opElement)
227
275
228 def readXml(self, opElement):
276 def readXml(self, opElement):
229
277
230 self.id = opElement.get('id')
278 self.id = opElement.get('id')
231 self.name = opElement.get('name')
279 self.name = opElement.get('name')
232 self.type = opElement.get('type')
280 self.type = opElement.get('type')
233 self.priority = opElement.get('priority')
281 self.priority = opElement.get('priority')
234
282
235 #Compatible with old signal chain version
283 #Compatible with old signal chain version
236 #Use of 'run' method instead 'init'
284 #Use of 'run' method instead 'init'
237 if self.type == 'self' and self.name == 'init':
285 if self.type == 'self' and self.name == 'init':
238 self.name = 'run'
286 self.name = 'run'
239
287
240 self.parmConfObjList = []
288 self.parmConfObjList = []
241
289
242 parmElementList = opElement.getiterator(ParameterConf().getElementName())
290 parmElementList = opElement.getiterator(ParameterConf().getElementName())
243
291
244 for parmElement in parmElementList:
292 for parmElement in parmElementList:
245 parmConfObj = ParameterConf()
293 parmConfObj = ParameterConf()
246 parmConfObj.readXml(parmElement)
294 parmConfObj.readXml(parmElement)
247
295
248 #Compatible with old signal chain version
296 #Compatible with old signal chain version
249 #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER
297 #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER
250 if self.type != 'self' and self.name == 'Plot':
298 if self.type != 'self' and self.name == 'Plot':
251 if parmConfObj.format == 'str' and parmConfObj.name == 'type':
299 if parmConfObj.format == 'str' and parmConfObj.name == 'type':
252 self.name = parmConfObj.value
300 self.name = parmConfObj.value
253 continue
301 continue
254
302
255 self.parmConfObjList.append(parmConfObj)
303 self.parmConfObjList.append(parmConfObj)
256
304
257 def printattr(self):
305 def printattr(self):
258
306
259 print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME,
307 print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME,
260 self.id,
308 self.id,
261 self.name,
309 self.name,
262 self.type,
310 self.type,
263 self.priority)
311 self.priority)
264
312
265 for parmConfObj in self.parmConfObjList:
313 for parmConfObj in self.parmConfObjList:
266 parmConfObj.printattr()
314 parmConfObj.printattr()
267
315
268 def createObject(self):
316 def createObject(self):
269
317
270 if self.type == 'self':
318 if self.type == 'self':
271 raise ValueError, "This operation type cannot be created"
319 raise ValueError, "This operation type cannot be created"
272
320
273 if self.type == 'external' or self.type == 'other':
321 if self.type == 'external' or self.type == 'other':
274 className = eval(self.name)
322 className = eval(self.name)
275 opObj = className()
323 opObj = className()
276
324
277 return opObj
325 return opObj
278
326
279 class ProcUnitConf():
327 class ProcUnitConf():
280
328
281 id = None
329 id = None
282 name = None
330 name = None
283 datatype = None
331 datatype = None
284 inputId = None
332 inputId = None
333 parentId = None
285
334
286 opConfObjList = []
335 opConfObjList = []
287
336
288 procUnitObj = None
337 procUnitObj = None
289 opObjList = []
338 opObjList = []
290
339
291 ELEMENTNAME = 'ProcUnit'
340 ELEMENTNAME = 'ProcUnit'
292
341
293 def __init__(self):
342 def __init__(self):
294
343
295 self.id = None
344 self.id = None
296 self.datatype = None
345 self.datatype = None
297 self.name = None
346 self.name = None
298 self.inputId = None
347 self.inputId = None
299
348
300 self.opConfObjList = []
349 self.opConfObjList = []
301
350
302 self.procUnitObj = None
351 self.procUnitObj = None
303 self.opObjDict = {}
352 self.opObjDict = {}
304
353
305 def __getPriority(self):
354 def __getPriority(self):
306
355
307 return len(self.opConfObjList)+1
356 return len(self.opConfObjList)+1
308
357
309 def __getNewId(self):
358 def __getNewId(self):
310
359
311 return int(self.id)*10 + len(self.opConfObjList) + 1
360 return int(self.id)*10 + len(self.opConfObjList) + 1
312
361
313 def getElementName(self):
362 def getElementName(self):
314
363
315 return self.ELEMENTNAME
364 return self.ELEMENTNAME
316
365
317 def getId(self):
366 def getId(self):
318
367
319 return str(self.id)
368 return str(self.id)
320
369
321 def getInputId(self):
370 def getInputId(self):
322
371
323 return str(self.inputId)
372 return str(self.inputId)
324
373
325 def getOperationObjList(self):
374 def getOperationObjList(self):
326
375
327 return self.opConfObjList
376 return self.opConfObjList
328
377
378 def getOperationObj(self, name=None):
379
380 for opConfObj in self.opConfObjList:
381
382 if opConfObj.name != name:
383 continue
384
385 return opConfObj
386
387 return None
388
389 def getOpObjfromParamValue(self,value=None):
390
391 for opConfObj in self.opConfObjList:
392 if opConfObj.getParameterObjfromValue(parameterValue=value) != value:
393 continue
394 return opConfObj
395 return None
396
329 def getProcUnitObj(self):
397 def getProcUnitObj(self):
330
398
331 return self.procUnitObj
399 return self.procUnitObj
332
400
333 def setup(self, id, name, datatype, inputId):
401 def setup(self, id, name, datatype, inputId, parentId=None):
334
402
335 self.id = id
403 self.id = id
336 self.name = name
404 self.name = name
337 self.datatype = datatype
405 self.datatype = datatype
338 self.inputId = inputId
406 self.inputId = inputId
407 self.parentId = parentId
339
408
340 self.opConfObjList = []
409 self.opConfObjList = []
341
410
342 self.addOperation(name='run', optype='self')
411 self.addOperation(name='run', optype='self')
343
412
413 def removeOperations(self):
414
415 for obj in self.opConfObjList:
416 del obj
417
418 self.opConfObjList = []
419 self.addOperation(name='run')
420
344 def addParameter(self, **kwargs):
421 def addParameter(self, **kwargs):
345
422
346 opObj = self.opConfObjList[0]
423 opObj = self.opConfObjList[0]
347
424
348 opObj.addParameter(**kwargs)
425 opObj.addParameter(**kwargs)
349
426
350 return opObj
427 return opObj
351
428
352 def addOperation(self, name, optype='self'):
429 def addOperation(self, name, optype='self'):
353
430
354 id = self.__getNewId()
431 id = self.__getNewId()
355 priority = self.__getPriority()
432 priority = self.__getPriority()
356
433
357 opConfObj = OperationConf()
434 opConfObj = OperationConf()
358 opConfObj.setup(id, name=name, priority=priority, type=optype)
435 opConfObj.setup(id, name=name, priority=priority, type=optype)
359
436
360 self.opConfObjList.append(opConfObj)
437 self.opConfObjList.append(opConfObj)
361
438
362 return opConfObj
439 return opConfObj
363
440
364 def makeXml(self, procUnitElement):
441 def makeXml(self, procUnitElement):
365
442
366 upElement = SubElement(procUnitElement, self.ELEMENTNAME)
443 upElement = SubElement(procUnitElement, self.ELEMENTNAME)
367 upElement.set('id', str(self.id))
444 upElement.set('id', str(self.id))
368 upElement.set('name', self.name)
445 upElement.set('name', self.name)
369 upElement.set('datatype', self.datatype)
446 upElement.set('datatype', self.datatype)
370 upElement.set('inputId', str(self.inputId))
447 upElement.set('inputId', str(self.inputId))
371
448
372 for opConfObj in self.opConfObjList:
449 for opConfObj in self.opConfObjList:
373 opConfObj.makeXml(upElement)
450 opConfObj.makeXml(upElement)
374
451
375 def readXml(self, upElement):
452 def readXml(self, upElement):
376
453
377 self.id = upElement.get('id')
454 self.id = upElement.get('id')
378 self.name = upElement.get('name')
455 self.name = upElement.get('name')
379 self.datatype = upElement.get('datatype')
456 self.datatype = upElement.get('datatype')
380 self.inputId = upElement.get('inputId')
457 self.inputId = upElement.get('inputId')
381
458
382 self.opConfObjList = []
459 self.opConfObjList = []
383
460
384 opElementList = upElement.getiterator(OperationConf().getElementName())
461 opElementList = upElement.getiterator(OperationConf().getElementName())
385
462
386 for opElement in opElementList:
463 for opElement in opElementList:
387 opConfObj = OperationConf()
464 opConfObj = OperationConf()
388 opConfObj.readXml(opElement)
465 opConfObj.readXml(opElement)
389 self.opConfObjList.append(opConfObj)
466 self.opConfObjList.append(opConfObj)
390
467
391 def printattr(self):
468 def printattr(self):
392
469
393 print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME,
470 print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME,
394 self.id,
471 self.id,
395 self.name,
472 self.name,
396 self.datatype,
473 self.datatype,
397 self.inputId)
474 self.inputId)
398
475
399 for opConfObj in self.opConfObjList:
476 for opConfObj in self.opConfObjList:
400 opConfObj.printattr()
477 opConfObj.printattr()
401
478
402 def createObjects(self):
479 def createObjects(self):
403
480
404 className = eval(self.name)
481 className = eval(self.name)
405 procUnitObj = className()
482 procUnitObj = className()
406
483
407 for opConfObj in self.opConfObjList:
484 for opConfObj in self.opConfObjList:
408
485
409 if opConfObj.type == 'self':
486 if opConfObj.type == 'self':
410 continue
487 continue
411
488
412 opObj = opConfObj.createObject()
489 opObj = opConfObj.createObject()
413
490
414 self.opObjDict[opConfObj.id] = opObj
491 self.opObjDict[opConfObj.id] = opObj
415 procUnitObj.addOperation(opObj, opConfObj.id)
492 procUnitObj.addOperation(opObj, opConfObj.id)
416
493
417 self.procUnitObj = procUnitObj
494 self.procUnitObj = procUnitObj
418
495
419 return procUnitObj
496 return procUnitObj
420
497
421 def run(self):
498 def run(self):
422
499
423 finalSts = False
500 finalSts = False
424
501
425 for opConfObj in self.opConfObjList:
502 for opConfObj in self.opConfObjList:
426
503
427 kwargs = {}
504 kwargs = {}
428 for parmConfObj in opConfObj.getParameterObjList():
505 for parmConfObj in opConfObj.getParameterObjList():
506 if opConfObj.name == 'run' and parmConfObj.name == 'datatype':
507 continue
508
429 kwargs[parmConfObj.name] = parmConfObj.getValue()
509 kwargs[parmConfObj.name] = parmConfObj.getValue()
430
510
431 #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id)
511 #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id)
432 sts = self.procUnitObj.call(opType = opConfObj.type,
512 sts = self.procUnitObj.call(opType = opConfObj.type,
433 opName = opConfObj.name,
513 opName = opConfObj.name,
434 opId = opConfObj.id,
514 opId = opConfObj.id,
435 **kwargs)
515 **kwargs)
436 finalSts = finalSts or sts
516 finalSts = finalSts or sts
437
517
438 return finalSts
518 return finalSts
439
519
440 def close(self):
520 def close(self):
441
521
522 for opConfObj in self.opConfObjList:
523 if opConfObj.type == 'self':
524 continue
525
526 opObj = self.procUnitObj.getOperationObj(opConfObj.id)
527 opObj.close()
528
442 self.procUnitObj.close()
529 self.procUnitObj.close()
443
530
444 return
531 return
445
532
446 class ReadUnitConf(ProcUnitConf):
533 class ReadUnitConf(ProcUnitConf):
447
534
448 path = None
535 path = None
449 startDate = None
536 startDate = None
450 endDate = None
537 endDate = None
451 startTime = None
538 startTime = None
452 endTime = None
539 endTime = None
453
540
454 ELEMENTNAME = 'ReadUnit'
541 ELEMENTNAME = 'ReadUnit'
455
542
456 def __init__(self):
543 def __init__(self):
457
544
458 self.id = None
545 self.id = None
459 self.datatype = None
546 self.datatype = None
460 self.name = None
547 self.name = None
461 self.inputId = 0
548 self.inputId = 0
462
549
463 self.opConfObjList = []
550 self.opConfObjList = []
464 self.opObjList = []
551 self.opObjList = []
465
552
466 def getElementName(self):
553 def getElementName(self):
467
554
468 return self.ELEMENTNAME
555 return self.ELEMENTNAME
469
556
470 def setup(self, id, name, datatype, path="", startDate="", endDate="", startTime="", endTime="", **kwargs):
557 def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs):
471
558
472 self.id = id
559 self.id = id
473 self.name = name
560 self.name = name
474 self.datatype = datatype
561 self.datatype = datatype
475
562
476 self.path = path
563 self.path = path
477 self.startDate = startDate
564 self.startDate = startDate
478 self.endDate = endDate
565 self.endDate = endDate
479 self.startTime = startTime
566 self.startTime = startTime
480 self.endTime = endTime
567 self.endTime = endTime
481
568
482 self.addRunOperation(**kwargs)
569 self.addRunOperation(**kwargs)
483
570
571 def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, **kwargs):
572
573 self.datatype = datatype
574 self.path = path
575 self.startDate = startDate
576 self.endDate = endDate
577 self.startTime = startTime
578 self.endTime = endTime
579
580 self.updateRunOperation(**kwargs)
581
484 def addRunOperation(self, **kwargs):
582 def addRunOperation(self, **kwargs):
485
583
486 opObj = self.addOperation(name = 'run', optype = 'self')
584 opObj = self.addOperation(name = 'run', optype = 'self')
487
585
586 opObj.addParameter(name='datatype' , value=self.datatype, format='str')
488 opObj.addParameter(name='path' , value=self.path, format='str')
587 opObj.addParameter(name='path' , value=self.path, format='str')
489 opObj.addParameter(name='startDate' , value=self.startDate, format='date')
588 opObj.addParameter(name='startDate' , value=self.startDate, format='date')
490 opObj.addParameter(name='endDate' , value=self.endDate, format='date')
589 opObj.addParameter(name='endDate' , value=self.endDate, format='date')
491 opObj.addParameter(name='startTime' , value=self.startTime, format='time')
590 opObj.addParameter(name='startTime' , value=self.startTime, format='time')
492 opObj.addParameter(name='endTime' , value=self.endTime, format='time')
591 opObj.addParameter(name='endTime' , value=self.endTime, format='time')
493
592
494 for key, value in kwargs.items():
593 for key, value in kwargs.items():
495 opObj.addParameter(name=key, value=value, format=type(value).__name__)
594 opObj.addParameter(name=key, value=value, format=type(value).__name__)
496
595
497 return opObj
596 return opObj
498
597
598 def updateRunOperation(self, **kwargs):
599
600 opObj = self.getOperationObj(name = 'run')
601 opObj.removeParameters()
602
603 opObj.addParameter(name='datatype' , value=self.datatype, format='str')
604 opObj.addParameter(name='path' , value=self.path, format='str')
605 opObj.addParameter(name='startDate' , value=self.startDate, format='date')
606 opObj.addParameter(name='endDate' , value=self.endDate, format='date')
607 opObj.addParameter(name='startTime' , value=self.startTime, format='time')
608 opObj.addParameter(name='endTime' , value=self.endTime, format='time')
609
610 for key, value in kwargs.items():
611 opObj.addParameter(name=key, value=value, format=type(value).__name__)
612
613 return opObj
499
614
500 class Project():
615 class Project():
501
616
502 id = None
617 id = None
503 name = None
618 name = None
504 description = None
619 description = None
505 # readUnitConfObjList = None
620 # readUnitConfObjList = None
506 procUnitConfObjDict = None
621 procUnitConfObjDict = None
507
622
508 ELEMENTNAME = 'Project'
623 ELEMENTNAME = 'Project'
509
624
510 def __init__(self):
625 def __init__(self, control=None, dataq=None):
511
626
512 self.id = None
627 self.id = None
513 self.name = None
628 self.name = None
514 self.description = None
629 self.description = None
515
630
516 # self.readUnitConfObjList = []
517 self.procUnitConfObjDict = {}
631 self.procUnitConfObjDict = {}
518
632
633 #global data_q
634 #data_q = dataq
635
636 if control==None:
637 control = {}
638 control['stop'] = False
639 control['pause'] = False
640
641 self.control = control
642
519 def __getNewId(self):
643 def __getNewId(self):
520
644
521 id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1
645 id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1
522
646
523 return str(id)
647 return str(id)
524
648
525 def getElementName(self):
649 def getElementName(self):
526
650
527 return self.ELEMENTNAME
651 return self.ELEMENTNAME
528
652
653 def getId(self):
654
655 return self.id
656
529 def setup(self, id, name, description):
657 def setup(self, id, name, description):
530
658
531 self.id = id
659 self.id = id
532 self.name = name
660 self.name = name
533 self.description = description
661 self.description = description
534
662
663 def update(self, name, description):
664
665 self.name = name
666 self.description = description
667
535 def addReadUnit(self, datatype=None, name=None, **kwargs):
668 def addReadUnit(self, datatype=None, name=None, **kwargs):
536
669
537 #Compatible with old signal chain version
670 #Compatible with old signal chain version
538 if datatype==None and name==None:
671 if datatype==None and name==None:
539 raise ValueError, "datatype or name should be defined"
672 raise ValueError, "datatype or name should be defined"
540
673
541 if name==None:
674 if name==None:
542 if 'Reader' in datatype:
675 if 'Reader' in datatype:
543 name = datatype
676 name = datatype
544 else:
677 else:
545 name = '%sReader' %(datatype)
678 name = '%sReader' %(datatype)
546
679
547 if datatype==None:
680 if datatype==None:
548 datatype = name.replace('Reader','')
681 datatype = name.replace('Reader','')
549
682
550 id = self.__getNewId()
683 id = self.__getNewId()
551
684
552 readUnitConfObj = ReadUnitConf()
685 readUnitConfObj = ReadUnitConf()
553 readUnitConfObj.setup(id, name, datatype, **kwargs)
686 readUnitConfObj.setup(id, name, datatype, parentId=self.id, **kwargs)
554
687
555 self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj
688 self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj
556
689
557 return readUnitConfObj
690 return readUnitConfObj
558
691
559 def addProcUnit(self, inputId=0, datatype=None, name=None):
692 def addProcUnit(self, inputId=0, datatype=None, name=None):
560
693
561 #Compatible with old signal chain version
694 #Compatible with old signal chain version
562 if datatype==None and name==None:
695 if datatype==None and name==None:
563 raise ValueError, "datatype or name should be defined"
696 raise ValueError, "datatype or name should be defined"
564
697
565 if name==None:
698 if name==None:
566 if 'Proc' in datatype:
699 if 'Proc' in datatype:
567 name = datatype
700 name = datatype
568 else:
701 else:
569 name = '%sProc' %(datatype)
702 name = '%sProc' %(datatype)
570
703
571 if datatype==None:
704 if datatype==None:
572 datatype = name.replace('Proc','')
705 datatype = name.replace('Proc','')
573
706
574 id = self.__getNewId()
707 id = self.__getNewId()
575
708
576 procUnitConfObj = ProcUnitConf()
709 procUnitConfObj = ProcUnitConf()
577 procUnitConfObj.setup(id, name, datatype, inputId)
710 procUnitConfObj.setup(id, name, datatype, inputId, parentId=self.id)
578
711
579 self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj
712 self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj
580
713
581 return procUnitConfObj
714 return procUnitConfObj
582
715
716 def getReadUnitId(self):
717
718 readUnitConfObj = self.getReadUnitObj()
719
720 return readUnitConfObj.id
721
722 def getReadUnitObj(self):
723
724 for obj in self.procUnitConfObjDict.values():
725 if obj.getElementName() == "ReadUnit":
726 return obj
727
728 return None
729
730 def getProcUnitObj(self, id):
731
732 return self.procUnitConfObjDict[id]
733
583 def makeXml(self):
734 def makeXml(self):
584
735
585 projectElement = Element('Project')
736 projectElement = Element('Project')
586 projectElement.set('id', str(self.id))
737 projectElement.set('id', str(self.id))
587 projectElement.set('name', self.name)
738 projectElement.set('name', self.name)
588 projectElement.set('description', self.description)
739 projectElement.set('description', self.description)
589
740
590 # for readUnitConfObj in self.readUnitConfObjList:
741 # for readUnitConfObj in self.readUnitConfObjList:
591 # readUnitConfObj.makeXml(projectElement)
742 # readUnitConfObj.makeXml(projectElement)
592
743
593 for procUnitConfObj in self.procUnitConfObjDict.values():
744 for procUnitConfObj in self.procUnitConfObjDict.values():
594 procUnitConfObj.makeXml(projectElement)
745 procUnitConfObj.makeXml(projectElement)
595
746
596 self.projectElement = projectElement
747 self.projectElement = projectElement
597
748
598 def writeXml(self, filename):
749 def writeXml(self, filename):
599
750
600 self.makeXml()
751 self.makeXml()
601
752
602 #print prettify(self.projectElement)
753 #print prettify(self.projectElement)
603
754
604 ElementTree(self.projectElement).write(filename, method='xml')
755 ElementTree(self.projectElement).write(filename, method='xml')
605
756
606 def readXml(self, filename):
757 def readXml(self, filename):
607
758
608 #tree = ET.parse(filename)
759 #tree = ET.parse(filename)
609 self.projectElement = None
760 self.projectElement = None
610 # self.readUnitConfObjList = []
761 # self.readUnitConfObjList = []
611 self.procUnitConfObjDict = {}
762 self.procUnitConfObjDict = {}
612
763
613 self.projectElement = ElementTree().parse(filename)
764 self.projectElement = ElementTree().parse(filename)
614
765
615 self.project = self.projectElement.tag
766 self.project = self.projectElement.tag
616
767
617 self.id = self.projectElement.get('id')
768 self.id = self.projectElement.get('id')
618 self.name = self.projectElement.get('name')
769 self.name = self.projectElement.get('name')
619 self.description = self.projectElement.get('description')
770 self.description = self.projectElement.get('description')
620
771
621 readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName())
772 readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName())
622
773
623 for readUnitElement in readUnitElementList:
774 for readUnitElement in readUnitElementList:
624 readUnitConfObj = ReadUnitConf()
775 readUnitConfObj = ReadUnitConf()
625 readUnitConfObj.readXml(readUnitElement)
776 readUnitConfObj.readXml(readUnitElement)
626
777
627 self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj
778 self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj
628
779
629 procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName())
780 procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName())
630
781
631 for procUnitElement in procUnitElementList:
782 for procUnitElement in procUnitElementList:
632 procUnitConfObj = ProcUnitConf()
783 procUnitConfObj = ProcUnitConf()
633 procUnitConfObj.readXml(procUnitElement)
784 procUnitConfObj.readXml(procUnitElement)
634
785
635 self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj
786 self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj
636
787
637 def printattr(self):
788 def printattr(self):
638
789
639 print "Project[%s]: name = %s, description = %s" %(self.id,
790 print "Project[%s]: name = %s, description = %s" %(self.id,
640 self.name,
791 self.name,
641 self.description)
792 self.description)
642
793
643 # for readUnitConfObj in self.readUnitConfObjList:
794 # for readUnitConfObj in self.readUnitConfObjList:
644 # readUnitConfObj.printattr()
795 # readUnitConfObj.printattr()
645
796
646 for procUnitConfObj in self.procUnitConfObjDict.values():
797 for procUnitConfObj in self.procUnitConfObjDict.values():
647 procUnitConfObj.printattr()
798 procUnitConfObj.printattr()
648
799
649 def createObjects(self):
800 def createObjects(self):
650
801
651 # for readUnitConfObj in self.readUnitConfObjList:
802 # for readUnitConfObj in self.readUnitConfObjList:
652 # readUnitConfObj.createObjects()
803 # readUnitConfObj.createObjects()
653
804
654 for procUnitConfObj in self.procUnitConfObjDict.values():
805 for procUnitConfObj in self.procUnitConfObjDict.values():
655 procUnitConfObj.createObjects()
806 procUnitConfObj.createObjects()
656
807
657 def __connect(self, objIN, thisObj):
808 def __connect(self, objIN, thisObj):
658
809
659 thisObj.setInput(objIN.getOutputObj())
810 thisObj.setInput(objIN.getOutputObj())
660
811
661 def connectObjects(self):
812 def connectObjects(self):
662
813
663 for thisPUConfObj in self.procUnitConfObjDict.values():
814 for thisPUConfObj in self.procUnitConfObjDict.values():
664
815
665 inputId = thisPUConfObj.getInputId()
816 inputId = thisPUConfObj.getInputId()
666
817
667 if int(inputId) == 0:
818 if int(inputId) == 0:
668 continue
819 continue
669
820
670 #Get input object
821 #Get input object
671 puConfINObj = self.procUnitConfObjDict[inputId]
822 puConfINObj = self.procUnitConfObjDict[inputId]
672 puObjIN = puConfINObj.getProcUnitObj()
823 puObjIN = puConfINObj.getProcUnitObj()
673
824
674 #Get current object
825 #Get current object
675 thisPUObj = thisPUConfObj.getProcUnitObj()
826 thisPUObj = thisPUConfObj.getProcUnitObj()
676
827
677 self.__connect(puObjIN, thisPUObj)
828 self.__connect(puObjIN, thisPUObj)
678
829
679 def run(self):
830 def run(self):
680
831
681 # for readUnitConfObj in self.readUnitConfObjList:
832 # for readUnitConfObj in self.readUnitConfObjList:
682 # readUnitConfObj.run()
833 # readUnitConfObj.run()
683 print
834 print
684 print "*"*40
835 print "*"*40
685 print " Starting SIGNAL CHAIN PROCESSING "
836 print " Starting SIGNAL CHAIN PROCESSING "
686 print "*"*40
837 print "*"*40
687 print
838 print
688
839
689 keyList = self.procUnitConfObjDict.keys()
840 keyList = self.procUnitConfObjDict.keys()
690 keyList.sort()
841 keyList.sort()
691
842
692 while(True):
843 while(True):
693
844
694 finalSts = False
845 finalSts = False
695
846
696 for procKey in keyList:
847 for procKey in keyList:
697 # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id)
848 # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id)
698
849
699 procUnitConfObj = self.procUnitConfObjDict[procKey]
850 procUnitConfObj = self.procUnitConfObjDict[procKey]
700 sts = procUnitConfObj.run()
851 sts = procUnitConfObj.run()
701 finalSts = finalSts or sts
852 finalSts = finalSts or sts
702
853
703 #If every process unit finished so end process
854 #If every process unit finished so end process
704 if not(finalSts):
855 if not(finalSts):
705 print "Every process unit have finished"
856 print "Every process unit have finished"
706 break
857 break
707
858
859 if self.control['pause']:
860 print "Pause..."
861
862 while True:
863 time.sleep(0.1)
864
865 if not self.control['pause']:
866 break
867
868 if self.control['stop']:
869 break
870
871 if self.control['stop']:
872 print "Stopping process"
873 break
874
708 #Closing every process
875 #Closing every process
709 for procKey in keyList:
876 for procKey in keyList:
710 procUnitConfObj = self.procUnitConfObjDict[procKey]
877 procUnitConfObj = self.procUnitConfObjDict[procKey]
711 procUnitConfObj.close()
878 procUnitConfObj.close()
712
879
880 print "Process stopped"
881
713 def start(self, filename):
882 def start(self, filename):
714
883
715 self.writeXml(filename)
884 self.writeXml(filename)
716 self.readXml(filename)
885 self.readXml(filename)
717
886
718 self.createObjects()
887 self.createObjects()
719 self.connectObjects()
888 self.connectObjects()
720 self.run()
889 self.run()
721
890
722 if __name__ == '__main__':
891 if __name__ == '__main__':
723
892
724 desc = "Segundo Test"
893 desc = "Segundo Test"
725 filename = "schain.xml"
894 filename = "schain.xml"
726
895
727 controllerObj = Project()
896 controllerObj = Project()
728
897
729 controllerObj.setup(id = '191', name='test01', description=desc)
898 controllerObj.setup(id = '191', name='test01', description=desc)
730
899
731 readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage',
900 readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage',
732 path='data/rawdata/',
901 path='data/rawdata/',
733 startDate='2011/01/01',
902 startDate='2011/01/01',
734 endDate='2012/12/31',
903 endDate='2012/12/31',
735 startTime='00:00:00',
904 startTime='00:00:00',
736 endTime='23:59:59',
905 endTime='23:59:59',
737 online=1,
906 online=1,
738 walk=1)
907 walk=1)
739
908
740 # opObj00 = readUnitConfObj.addOperation(name='printInfo')
909 # opObj00 = readUnitConfObj.addOperation(name='printInfo')
741
910
742 procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
911 procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId())
743
912
744 opObj10 = procUnitConfObj0.addOperation(name='selectChannels')
913 opObj10 = procUnitConfObj0.addOperation(name='selectChannels')
745 opObj10.addParameter(name='channelList', value='3,4,5', format='intlist')
914 opObj10.addParameter(name='channelList', value='3,4,5', format='intlist')
746
915
747 opObj10 = procUnitConfObj0.addOperation(name='selectHeights')
916 opObj10 = procUnitConfObj0.addOperation(name='selectHeights')
748 opObj10.addParameter(name='minHei', value='90', format='float')
917 opObj10.addParameter(name='minHei', value='90', format='float')
749 opObj10.addParameter(name='maxHei', value='180', format='float')
918 opObj10.addParameter(name='maxHei', value='180', format='float')
750
919
751 opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external')
920 opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external')
752 opObj12.addParameter(name='n', value='10', format='int')
921 opObj12.addParameter(name='n', value='10', format='int')
753
922
754 procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId())
923 procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId())
755 procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int')
924 procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int')
756 # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='')
925 # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='')
757
926
758
927
759 opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external')
928 opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external')
760 opObj11.addParameter(name='idfigure', value='1', format='int')
929 opObj11.addParameter(name='idfigure', value='1', format='int')
761 opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str')
930 opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str')
762 opObj11.addParameter(name='zmin', value='40', format='int')
931 opObj11.addParameter(name='zmin', value='40', format='int')
763 opObj11.addParameter(name='zmax', value='90', format='int')
932 opObj11.addParameter(name='zmax', value='90', format='int')
764 opObj11.addParameter(name='showprofile', value='1', format='int')
933 opObj11.addParameter(name='showprofile', value='1', format='int')
765
934
766 # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='external')
935 # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='external')
767 # opObj11.addParameter(name='idfigure', value='2', format='int')
936 # opObj11.addParameter(name='idfigure', value='2', format='int')
768 # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str')
937 # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str')
769 # opObj11.addParameter(name='zmin', value='40', format='int')
938 # opObj11.addParameter(name='zmin', value='40', format='int')
770 # opObj11.addParameter(name='zmax', value='90', format='int')
939 # opObj11.addParameter(name='zmax', value='90', format='int')
771
940
772
941
773 # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitConfObj0.getId())
942 # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitConfObj0.getId())
774 #
943 #
775 # opObj12 = procUnitConfObj2.addOperation(name='CohInt', optype='external')
944 # opObj12 = procUnitConfObj2.addOperation(name='CohInt', optype='external')
776 # opObj12.addParameter(name='n', value='2', format='int')
945 # opObj12.addParameter(name='n', value='2', format='int')
777 # opObj12.addParameter(name='overlapping', value='1', format='int')
946 # opObj12.addParameter(name='overlapping', value='1', format='int')
778 #
947 #
779 # procUnitConfObj3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj2.getId())
948 # procUnitConfObj3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj2.getId())
780 # procUnitConfObj3.addParameter(name='nFFTPoints', value='32', format='int')
949 # procUnitConfObj3.addParameter(name='nFFTPoints', value='32', format='int')
781 #
950 #
782 # opObj11 = procUnitConfObj3.addOperation(name='SpectraPlot', optype='external')
951 # opObj11 = procUnitConfObj3.addOperation(name='SpectraPlot', optype='external')
783 # opObj11.addParameter(name='idfigure', value='2', format='int')
952 # opObj11.addParameter(name='idfigure', value='2', format='int')
784 # opObj11.addParameter(name='wintitle', value='SpectraPlot1', format='str')
953 # opObj11.addParameter(name='wintitle', value='SpectraPlot1', format='str')
785 # opObj11.addParameter(name='zmin', value='40', format='int')
954 # opObj11.addParameter(name='zmin', value='40', format='int')
786 # opObj11.addParameter(name='zmax', value='90', format='int')
955 # opObj11.addParameter(name='zmax', value='90', format='int')
787 # opObj11.addParameter(name='showprofile', value='1', format='int')
956 # opObj11.addParameter(name='showprofile', value='1', format='int')
788
957
789 # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external')
958 # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external')
790 # opObj11.addParameter(name='idfigure', value='10', format='int')
959 # opObj11.addParameter(name='idfigure', value='10', format='int')
791 # opObj11.addParameter(name='wintitle', value='RTI', format='str')
960 # opObj11.addParameter(name='wintitle', value='RTI', format='str')
792 ## opObj11.addParameter(name='xmin', value='21', format='float')
961 ## opObj11.addParameter(name='xmin', value='21', format='float')
793 ## opObj11.addParameter(name='xmax', value='22', format='float')
962 ## opObj11.addParameter(name='xmax', value='22', format='float')
794 # opObj11.addParameter(name='zmin', value='40', format='int')
963 # opObj11.addParameter(name='zmin', value='40', format='int')
795 # opObj11.addParameter(name='zmax', value='90', format='int')
964 # opObj11.addParameter(name='zmax', value='90', format='int')
796 # opObj11.addParameter(name='showprofile', value='1', format='int')
965 # opObj11.addParameter(name='showprofile', value='1', format='int')
797 # opObj11.addParameter(name='timerange', value=str(60), format='int')
966 # opObj11.addParameter(name='timerange', value=str(60), format='int')
798
967
799 # opObj10 = procUnitConfObj1.addOperation(name='selectChannels')
968 # opObj10 = procUnitConfObj1.addOperation(name='selectChannels')
800 # opObj10.addParameter(name='channelList', value='0,2,4,6', format='intlist')
969 # opObj10.addParameter(name='channelList', value='0,2,4,6', format='intlist')
801 #
970 #
802 # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external')
971 # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external')
803 # opObj12.addParameter(name='n', value='2', format='int')
972 # opObj12.addParameter(name='n', value='2', format='int')
804 #
973 #
805 # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external')
974 # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external')
806 # opObj11.addParameter(name='idfigure', value='2', format='int')
975 # opObj11.addParameter(name='idfigure', value='2', format='int')
807 # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str')
976 # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str')
808 # opObj11.addParameter(name='zmin', value='70', format='int')
977 # opObj11.addParameter(name='zmin', value='70', format='int')
809 # opObj11.addParameter(name='zmax', value='90', format='int')
978 # opObj11.addParameter(name='zmax', value='90', format='int')
810 #
979 #
811 # opObj10 = procUnitConfObj1.addOperation(name='selectChannels')
980 # opObj10 = procUnitConfObj1.addOperation(name='selectChannels')
812 # opObj10.addParameter(name='channelList', value='2,6', format='intlist')
981 # opObj10.addParameter(name='channelList', value='2,6', format='intlist')
813 #
982 #
814 # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external')
983 # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external')
815 # opObj12.addParameter(name='n', value='2', format='int')
984 # opObj12.addParameter(name='n', value='2', format='int')
816 #
985 #
817 # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external')
986 # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external')
818 # opObj11.addParameter(name='idfigure', value='3', format='int')
987 # opObj11.addParameter(name='idfigure', value='3', format='int')
819 # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str')
988 # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str')
820 # opObj11.addParameter(name='zmin', value='70', format='int')
989 # opObj11.addParameter(name='zmin', value='70', format='int')
821 # opObj11.addParameter(name='zmax', value='90', format='int')
990 # opObj11.addParameter(name='zmax', value='90', format='int')
822
991
823
992
824 # opObj12 = procUnitConfObj1.addOperation(name='decoder')
993 # opObj12 = procUnitConfObj1.addOperation(name='decoder')
825 # opObj12.addParameter(name='ncode', value='2', format='int')
994 # opObj12.addParameter(name='ncode', value='2', format='int')
826 # opObj12.addParameter(name='nbauds', value='8', format='int')
995 # opObj12.addParameter(name='nbauds', value='8', format='int')
827 # opObj12.addParameter(name='code0', value='001110011', format='int')
996 # opObj12.addParameter(name='code0', value='001110011', format='int')
828 # opObj12.addParameter(name='code1', value='001110011', format='int')
997 # opObj12.addParameter(name='code1', value='001110011', format='int')
829
998
830
999
831
1000
832 # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj1.getId())
1001 # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj1.getId())
833 #
1002 #
834 # opObj21 = procUnitConfObj2.addOperation(name='IncohInt', optype='external')
1003 # opObj21 = procUnitConfObj2.addOperation(name='IncohInt', optype='external')
835 # opObj21.addParameter(name='n', value='2', format='int')
1004 # opObj21.addParameter(name='n', value='2', format='int')
836 #
1005 #
837 # opObj11 = procUnitConfObj2.addOperation(name='SpectraPlot', optype='external')
1006 # opObj11 = procUnitConfObj2.addOperation(name='SpectraPlot', optype='external')
838 # opObj11.addParameter(name='idfigure', value='4', format='int')
1007 # opObj11.addParameter(name='idfigure', value='4', format='int')
839 # opObj11.addParameter(name='wintitle', value='SpectraPlot OBJ 2', format='str')
1008 # opObj11.addParameter(name='wintitle', value='SpectraPlot OBJ 2', format='str')
840 # opObj11.addParameter(name='zmin', value='70', format='int')
1009 # opObj11.addParameter(name='zmin', value='70', format='int')
841 # opObj11.addParameter(name='zmax', value='90', format='int')
1010 # opObj11.addParameter(name='zmax', value='90', format='int')
842
1011
843 print "Escribiendo el archivo XML"
1012 print "Escribiendo el archivo XML"
844
1013
845 controllerObj.writeXml(filename)
1014 controllerObj.writeXml(filename)
846
1015
847 print "Leyendo el archivo XML"
1016 print "Leyendo el archivo XML"
848 controllerObj.readXml(filename)
1017 controllerObj.readXml(filename)
849 #controllerObj.printattr()
1018 #controllerObj.printattr()
850
1019
851 controllerObj.createObjects()
1020 controllerObj.createObjects()
852 controllerObj.connectObjects()
1021 controllerObj.connectObjects()
853 controllerObj.run()
1022 controllerObj.run()
854
1023
855 No newline at end of file
1024
@@ -1,1 +0,0
1 from figure import * No newline at end of file
@@ -1,30 +1,29
1 #!/usr/bin/python
1
2 # -*- coding: utf-8 -*-'
3 import sys
2 import sys
4 from PyQt4 import QtCore, QtGui
3 from PyQt4 import QtCore, QtGui
5 from PyQt4.QtGui import QApplication
4 from PyQt4.QtGui import QApplication
6 #from PyQt4.QtCore import pyqtSignature
5 #from PyQt4.QtCore import pyqtSignature
7
6
8 from viewcontroller.initwindow import InitWindow
7 from viewcontroller.initwindow import InitWindow
9 from viewcontroller.basicwindow import BasicWindow
8 from viewcontroller.basicwindow import BasicWindow
10 from viewcontroller.workspace import Workspace
9 from viewcontroller.workspace import Workspace
11
10
12 def main():
11 def main():
13 import sys
12 import sys
14 app = QtGui.QApplication(sys.argv)
13 app = QtGui.QApplication(sys.argv)
15
14
16 Welcome=InitWindow()
15 Welcome=InitWindow()
17 if not Welcome.exec_():
16 if not Welcome.exec_():
18 sys.exit(-1)
17 sys.exit(-1)
19
18
20 WorkPathspace=Workspace()
19 WorkPathspace=Workspace()
21 if not WorkPathspace.exec_():
20 if not WorkPathspace.exec_():
22 sys.exit(-1)
21 sys.exit(-1)
23
22
24 MainGUI=BasicWindow()
23 MainGUI=BasicWindow()
25 MainGUI.setWorkSpaceGUI(WorkPathspace.dirComBox.currentText())
24 MainGUI.setWorkSpaceGUI(WorkPathspace.dirComBox.currentText())
26 MainGUI.show()
25 MainGUI.show()
27 sys.exit(app.exec_())
26 sys.exit(app.exec_())
28
27
29 if __name__ == "__main__":
28 if __name__ == "__main__":
30 main() No newline at end of file
29 main()
@@ -1,1 +0,0
1 from viewcontroller import * No newline at end of file
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -1,42 +1,42
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 """
3 """
4 Module implementing InitWindow.
4 Module implementing InitWindow.
5 """
5 """
6
6
7 from PyQt4.QtGui import QDialog
7 from PyQt4.QtGui import QDialog
8 from PyQt4.QtCore import pyqtSignature
8 from PyQt4.QtCore import pyqtSignature
9 from PyQt4 import QtCore
9 from PyQt4 import QtCore
10 from PyQt4 import QtGui
10 from PyQt4 import QtGui
11
11
12 from viewer.ui_initwindow import Ui_InitWindow
12 from schainpy.gui.viewer.ui_initwindow import Ui_InitWindow
13
13
14 class InitWindow(QDialog, Ui_InitWindow):
14 class InitWindow(QDialog, Ui_InitWindow):
15 """
15 """
16 Class documentation goes here.
16 Class documentation goes here.
17 """
17 """
18 def __init__(self, parent = None):
18 def __init__(self, parent = None):
19 """
19 """
20 Constructor
20 Constructor
21 """
21 """
22 QDialog.__init__(self, parent)
22 QDialog.__init__(self, parent)
23 self.setupUi(self)
23 self.setupUi(self)
24 self.setWindowTitle("ROJ-Signal Chain")
24 self.setWindowTitle("ROJ-Signal Chain")
25 self.setWindowIcon(QtGui.QIcon("figure/adn.jpg"))
25 self.setWindowIcon(QtGui.QIcon("schainpy/gui/figure/adn.jpg"))
26
26
27 @pyqtSignature("")
27 @pyqtSignature("")
28 def on_ExitBtn_clicked(self):
28 def on_ExitBtn_clicked(self):
29 """
29 """
30 Exit cierra la ventana de Bienvenida
30 Exit cierra la ventana de Bienvenida
31 """
31 """
32 self.close()
32 self.close()
33
33
34 @pyqtSignature("")
34 @pyqtSignature("")
35 def on_ContinueBtn_clicked(self):
35 def on_ContinueBtn_clicked(self):
36 """
36 """
37 Continue cierra la ventana de Bienvenida, a este evento se le complementa con la accion
37 Continue cierra la ventana de Bienvenida, a este evento se le complementa con la accion
38 conectar con la ventana de configuracion de Workspace
38 conectar con la ventana de configuracion de Workspace
39 """
39 """
40 # TODO: not implemented yet
40 # TODO: not implemented yet
41 #raise NotImplementedError
41 #raise NotImplementedError
42 self.accept()
42 self.accept()
@@ -1,633 +1,632
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 Module implementing MainWindow.
3 Module implementing MainWindow.
4 #+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++#
4 #+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++#
5 """
5 """
6 from PyQt4.QtGui import QMainWindow
6 from PyQt4.QtGui import QMainWindow
7 from PyQt4.QtCore import pyqtSignature
7 from PyQt4.QtCore import pyqtSignature
8 from PyQt4.QtCore import pyqtSignal
8 from PyQt4.QtCore import pyqtSignal
9 from PyQt4 import QtCore
9 from PyQt4 import QtCore
10 from PyQt4 import QtGui
10 from PyQt4 import QtGui
11 from timeconversions import Doy2Date
11 from timeconversions import Doy2Date
12 from modelProperties import treeModel
12 from modelProperties import treeModel
13
13
14 from viewer.ui_unitprocess import Ui_UnitProcess
14 from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess
15 from viewer.ui_window import Ui_window
15 from schainpy.gui.viewer.ui_window import Ui_window
16 from viewer.ui_mainwindow import Ui_MainWindow
16 from schainpy.gui.viewer.ui_mainwindow import Ui_MainWindow
17
17
18
18 from schainpy.controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf
19 from controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf
20 import os
19 import os
21
20
22
21
23 class BodyMainWindow(QMainWindow, Ui_MainWindow):
22 class BodyMainWindow(QMainWindow, Ui_MainWindow):
24 __projObjDict = {}
23 __projObjDict = {}
25 __arbolDict = {}
24 __arbolDict = {}
26 __upObjDict = {}
25 __upObjDict = {}
27
26
28 """
27 """
29 Class documentation goes here.
28 Class documentation goes here.
30 #*##################VENTANA CUERPO DEL PROGRAMA####################
29 #*##################VENTANA CUERPO DEL PROGRAMA####################
31 """
30 """
32 def __init__(self, parent = None):
31 def __init__(self, parent = None):
33 """
32 """
34 Constructor
33 Constructor
35 """
34 """
36 print "Inicio de Programa Interfaz Gráfica"
35 print "Inicio de Programa Interfaz Gráfica"
37 QMainWindow.__init__(self, parent)
36 QMainWindow.__init__(self, parent)
38 self.setupUi(self)
37 self.setupUi(self)
39
38
40 self.indexclick=None
39 self.indexclick=None
41
40
42 self.online=0
41 self.online=0
43 self.datatype=0
42 self.datatype=0
44 self.variableList=[]
43 self.variableList=[]
45
44
46 self.proObjList=[]
45 self.proObjList=[]
47 self.idp=0
46 self.idp=0
48 self.namep=0
47 self.namep=0
49 self.description=0
48 self.description=0
50 self.namepTree=0
49 self.namepTree=0
51 self.valuep=0
50 self.valuep=0
52
51
53 self.upObjList= []
52 self.upObjList= []
54 self.upn=0
53 self.upn=0
55 self.upName=0
54 self.upName=0
56 self.upType=0
55 self.upType=0
57 self.uporProObjRecover=0
56 self.uporProObjRecover=0
58
57
59 self.readUnitConfObjList=[]
58 self.readUnitConfObjList=[]
60
59
61 self.upObjVolList=[]
60 self.upObjVolList=[]
62 self.upobjSpecList=[]
61 self.upobjSpecList=[]
63
62
64 self.operObjList=[]
63 self.operObjList=[]
65
64
66 self.configProject=None
65 self.configProject=None
67 self.configUP=None
66 self.configUP=None
68
67
69 self.readUnitConfObj=None
68 self.readUnitConfObj=None
70 self.procUnitConfObj0=None
69 self.procUnitConfObj0=None
71 self.opObj10=None
70 self.opObj10=None
72 self.opObj12=None
71 self.opObj12=None
73
72
74 self.setParam()
73 self.setParam()
75
74
76 #-----------------------------------NEW PROPERTIES------------------------------------------------#
75 #-----------------------------------NEW PROPERTIES------------------------------------------------#
77 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
76 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
78 self.addprojectBtn.setToolTip('Add_New_Project')
77 self.addprojectBtn.setToolTip('Add_New_Project')
79 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
78 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
80
79
81 #-----------------------------------NEW PROPERTIES------------------------------------------------#
80 #-----------------------------------NEW PROPERTIES------------------------------------------------#
82 self.model = QtGui.QStandardItemModel()
81 self.model = QtGui.QStandardItemModel()
83 self.treeView.setModel(self.model)
82 self.treeView.setModel(self.model)
84 self.treeView.clicked.connect(self.clickFunctiontree)
83 self.treeView.clicked.connect(self.clickFunctiontree)
85 self.treeView.expandAll()
84 self.treeView.expandAll()
86 #self.treeView.clicked.connect(self.treefunction1)
85 #self.treeView.clicked.connect(self.treefunction1)
87
86
88 #-----------------------------------BARRA DE MENU-------------------------------------------------#
87 #-----------------------------------BARRA DE MENU-------------------------------------------------#
89
88
90 #----------------------------------- MENU_PROJECT--------------------------------------------------#
89 #----------------------------------- MENU_PROJECT--------------------------------------------------#
91
90
92 @pyqtSignature("")
91 @pyqtSignature("")
93 def on_menuFileAbrirObj_triggered(self):
92 def on_menuFileAbrirObj_triggered(self):
94 """
93 """
95 Abre un archivo de configuracion seleccionado, lee los parametros y
94 Abre un archivo de configuracion seleccionado, lee los parametros y
96 actualiza los atributos de esta clase; creando los objetos necesarios
95 actualiza los atributos de esta clase; creando los objetos necesarios
97 con los parametros leidos desde el archivo.
96 con los parametros leidos desde el archivo.
98 """
97 """
99 print "Leer un archivo xml y extraer sus atributos Not implemented yet"
98 print "Leer un archivo xml y extraer sus atributos Not implemented yet"
100
99
101 @pyqtSignature("")
100 @pyqtSignature("")
102 def on_menuFileCrearObj_triggered(self):
101 def on_menuFileCrearObj_triggered(self):
103 """
102 """
104 Crea un proyecto nuevo y lo anade a mi diccionario de proyectos
103 Crea un proyecto nuevo y lo anade a mi diccionario de proyectos
105 y habilita la ventana de configuracion del proyecto.
104 y habilita la ventana de configuracion del proyecto.
106
105
107 """
106 """
108 self.addProject()
107 self.addProject()
109
108
110 @pyqtSignature("")
109 @pyqtSignature("")
111 def on_menuFileGuardarObj_triggered(self):
110 def on_menuFileGuardarObj_triggered(self):
112 """
111 """
113 METODO EJECUTADO CUANDO OCURRE EL EVENTO GUARDAR PROJECTO
112 METODO EJECUTADO CUANDO OCURRE EL EVENTO GUARDAR PROJECTO
114
113
115 Llama al metodo saveProject.
114 Llama al metodo saveProject.
116 """
115 """
117 # my_id = arbol_selected()
116 # my_id = arbol_selected()
118 # filename = savefindow.show()
117 # filename = savefindow.show()
119 # self.saveProject(id, filename)
118 # self.saveProject(id, filename)
120 print "probsave"
119 print "probsave"
121 self.saveProject()
120 self.saveProject()
122
121
123 @pyqtSignature("")
122 @pyqtSignature("")
124 def on_menuFileCerrarObj_triggered(self):
123 def on_menuFileCerrarObj_triggered(self):
125 """
124 """
126 METODO EJECUTADO CUANDO OCURRE EL EVENTO CERRAR
125 METODO EJECUTADO CUANDO OCURRE EL EVENTO CERRAR
127 Llama al metodo close.
126 Llama al metodo close.
128 """
127 """
129 self.close()
128 self.close()
130
129
131 #-----------------------------------MENU_RUN----------------------------------------------------#
130 #-----------------------------------MENU_RUN----------------------------------------------------#
132
131
133 @pyqtSignature("")
132 @pyqtSignature("")
134 def on_menuRUNStartObj_clicked(self):
133 def on_menuRUNStartObj_clicked(self):
135 """
134 """
136 METODO EJECUTADO CUANDO OCURRE EL EVENTO RUN
135 METODO EJECUTADO CUANDO OCURRE EL EVENTO RUN
137 Llama al metodo RUN.
136 Llama al metodo RUN.
138 """
137 """
139 print "Not implemented yet"
138 print "Not implemented yet"
140
139
141 @pyqtSignature("")
140 @pyqtSignature("")
142 def on_menuRUNPausaObj_clicked(self):
141 def on_menuRUNPausaObj_clicked(self):
143 """
142 """
144 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
143 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
145 Llama al metodo PAUSA.
144 Llama al metodo PAUSA.
146 """
145 """
147 print "Not implemented yet"
146 print "Not implemented yet"
148
147
149 #-----------------------------------MENU_OPTION-------------------------------------------------#
148 #-----------------------------------MENU_OPTION-------------------------------------------------#
150
149
151 @pyqtSignature("")
150 @pyqtSignature("")
152 def on_menuOptConfigLogfileObj_clicked(self):
151 def on_menuOptConfigLogfileObj_clicked(self):
153 """
152 """
154 METODO EJECUTADO CUANDO OCURRE EL EVENTO ConfigLog
153 METODO EJECUTADO CUANDO OCURRE EL EVENTO ConfigLog
155 Llama al metodo close.
154 Llama al metodo close.
156 """
155 """
157 print "Not implemented yet"
156 print "Not implemented yet"
158
157
159 @pyqtSignature("")
158 @pyqtSignature("")
160 def on_menuOptConfigserverObj_clicked(self):
159 def on_menuOptConfigserverObj_clicked(self):
161 """
160 """
162 METODO EJECUTADO CUANDO OCURRE EL EVENTO Config Server
161 METODO EJECUTADO CUANDO OCURRE EL EVENTO Config Server
163 Llama al metodo close.
162 Llama al metodo close.
164 """
163 """
165 print "Not implemented yet"
164 print "Not implemented yet"
166 #-----------------------------------MENU_HELP-------------------------------------------------------#
165 #-----------------------------------MENU_HELP-------------------------------------------------------#
167
166
168 @pyqtSignature("")
167 @pyqtSignature("")
169 def on_menuHELPAboutObj_clicked(self):
168 def on_menuHELPAboutObj_clicked(self):
170 """
169 """
171 METODO EJECUTADO CUANDO OCURRE EL EVENTO HELP
170 METODO EJECUTADO CUANDO OCURRE EL EVENTO HELP
172 Llama al metodo close.
171 Llama al metodo close.
173 """
172 """
174 print "Not implemented yet"
173 print "Not implemented yet"
175
174
176 @pyqtSignature("")
175 @pyqtSignature("")
177 def on_menuHELPPrfObj_clicked(self):
176 def on_menuHELPPrfObj_clicked(self):
178 """
177 """
179 METODO EJECUTADO CUANDO OCURRE EL EVENTO HElp
178 METODO EJECUTADO CUANDO OCURRE EL EVENTO HElp
180 Llama al metodo close.
179 Llama al metodo close.
181 """
180 """
182 print "Not implemented yet"
181 print "Not implemented yet"
183
182
184 #-----------------------------------BARRA DE HERRAMIENTAS----------------------------------------#
183 #-----------------------------------BARRA DE HERRAMIENTAS----------------------------------------#
185
184
186 @pyqtSignature("")
185 @pyqtSignature("")
187 def on_actOpenObj_triggered(self):
186 def on_actOpenObj_triggered(self):
188 """
187 """
189 METODO CARGA UN ARCHIVO DE CONFIGURACION ANTERIOR
188 METODO CARGA UN ARCHIVO DE CONFIGURACION ANTERIOR
190 """
189 """
191 print "Leer un archivo xml y extraer sus atributos Not implemented yet"
190 print "Leer un archivo xml y extraer sus atributos Not implemented yet"
192
191
193 @pyqtSignature("")
192 @pyqtSignature("")
194 def on_actCreateObj_triggered(self):
193 def on_actCreateObj_triggered(self):
195 """
194 """
196 CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS
195 CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS
197 Llama al metodo addProject.
196 Llama al metodo addProject.
198 """
197 """
199 self.addProject()
198 self.addProject()
200
199
201 @pyqtSignature("")
200 @pyqtSignature("")
202 def on_actStopObj_triggered(self):
201 def on_actStopObj_triggered(self):
203 """
202 """
204 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
203 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
205 Llama al metodo PAUSA.
204 Llama al metodo PAUSA.
206 """
205 """
207 print "Not implemented yet"
206 print "Not implemented yet"
208
207
209 @pyqtSignature("")
208 @pyqtSignature("")
210 def on_actPlayObj_triggered(self):
209 def on_actPlayObj_triggered(self):
211 """
210 """
212 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
211 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
213 Llama al metodo PAUSA.
212 Llama al metodo PAUSA.
214 """
213 """
215 print "Not implemented yet"
214 print "Not implemented yet"
216
215
217 @pyqtSignature("")
216 @pyqtSignature("")
218 def on_actSaveObj_triggered(self):
217 def on_actSaveObj_triggered(self):
219 """
218 """
220 METODO EJECUTADO CUANDO OCURRE EL EVENTO SAVE
219 METODO EJECUTADO CUANDO OCURRE EL EVENTO SAVE
221 Llama al metodo SAVE.
220 Llama al metodo SAVE.
222 """
221 """
223 self.saveProject()
222 self.saveProject()
224
223
225 #-----------------------------------PUSHBUTTON_CREATE PROJECT----------------------------------#
224 #-----------------------------------PUSHBUTTON_CREATE PROJECT----------------------------------#
226
225
227 @pyqtSignature("")
226 @pyqtSignature("")
228 def on_addprojectBtn_clicked(self):
227 def on_addprojectBtn_clicked(self):
229 """
228 """
230 CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS
229 CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS
231 Llama al metodo addProject.
230 Llama al metodo addProject.
232 """
231 """
233 self.addProject()
232 self.addProject()
234
233
235 #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------#
234 #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------#
236
235
237 @pyqtSignature("int")
236 @pyqtSignature("int")
238 def on_dataTypeCmbBox_activated(self,index):
237 def on_dataTypeCmbBox_activated(self,index):
239 """
238 """
240 Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA
239 Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA
241 """
240 """
242 self.dataFormatTxt.setReadOnly(True)
241 self.dataFormatTxt.setReadOnly(True)
243 if index==0:
242 if index==0:
244 self.datatype='Voltage'
243 self.datatype='Voltage'
245 elif index==1:
244 elif index==1:
246 self.datatype='Spectra'
245 self.datatype='Spectra'
247 else :
246 else :
248 self.datatype=''
247 self.datatype=''
249 self.dataFormatTxt.setReadOnly(False)
248 self.dataFormatTxt.setReadOnly(False)
250 self.dataFormatTxt.setText(self.datatype)
249 self.dataFormatTxt.setText(self.datatype)
251
250
252 @pyqtSignature("")
251 @pyqtSignature("")
253 def on_dataPathBrowse_clicked(self):
252 def on_dataPathBrowse_clicked(self):
254 """
253 """
255 OBTENCION DE LA RUTA DE DATOS
254 OBTENCION DE LA RUTA DE DATOS
256 """
255 """
257 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
256 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
258 self.dataPathTxt.setText(self.dataPath)
257 self.dataPathTxt.setText(self.dataPath)
259 self.statusDpath=self.existDir(self.dataPath)
258 self.statusDpath=self.existDir(self.dataPath)
260 self.loadDays()
259 self.loadDays()
261
260
262 @pyqtSignature("int")
261 @pyqtSignature("int")
263 def on_starDateCmbBox_activated(self, index):
262 def on_starDateCmbBox_activated(self, index):
264 """
263 """
265 SELECCION DEL RANGO DE FECHAS -START DATE
264 SELECCION DEL RANGO DE FECHAS -START DATE
266 """
265 """
267 var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex()
266 var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex()
268 self.endDateCmbBox.clear()
267 self.endDateCmbBox.clear()
269 for i in self.variableList[index:]:
268 for i in self.variableList[index:]:
270 self.endDateCmbBox.addItem(i)
269 self.endDateCmbBox.addItem(i)
271 self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index)
270 self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index)
272 self.getsubList()
271 self.getsubList()
273
272
274 @pyqtSignature("int")
273 @pyqtSignature("int")
275 def on_endDateCmbBox_activated(self, index):
274 def on_endDateCmbBox_activated(self, index):
276 """
275 """
277 SELECCION DEL RANGO DE FECHAS-END DATE
276 SELECCION DEL RANGO DE FECHAS-END DATE
278 """
277 """
279 var_StartDay_index=self.starDateCmbBox.currentIndex()
278 var_StartDay_index=self.starDateCmbBox.currentIndex()
280 var_end_index = self.endDateCmbBox.count() - index
279 var_end_index = self.endDateCmbBox.count() - index
281 self.starDateCmbBox.clear()
280 self.starDateCmbBox.clear()
282 for i in self.variableList[:len(self.variableList) - var_end_index + 1]:
281 for i in self.variableList[:len(self.variableList) - var_end_index + 1]:
283 self.starDateCmbBox.addItem(i)
282 self.starDateCmbBox.addItem(i)
284 self.starDateCmbBox.setCurrentIndex(var_StartDay_index)
283 self.starDateCmbBox.setCurrentIndex(var_StartDay_index)
285 self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas
284 self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas
286
285
287 @pyqtSignature("int")
286 @pyqtSignature("int")
288 def on_readModeCmBox_activated(self, p0):
287 def on_readModeCmBox_activated(self, p0):
289 """
288 """
290 SELECCION DEL MODO DE LECTURA ON=1, OFF=0
289 SELECCION DEL MODO DE LECTURA ON=1, OFF=0
291 """
290 """
292 if p0==0:
291 if p0==0:
293 self.online=0
292 self.online=0
294 elif p0==1:
293 elif p0==1:
295 self.online=1
294 self.online=1
296
295
297 #---------------PUSHBUTTON_DATA " OKBUTTON "_CONFIGURATION PROJECT--------------------------#
296 #---------------PUSHBUTTON_DATA " OKBUTTON "_CONFIGURATION PROJECT--------------------------#
298
297
299 @pyqtSignature("")
298 @pyqtSignature("")
300 def on_dataOkBtn_clicked(self):
299 def on_dataOkBtn_clicked(self):
301 """
300 """
302 Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml.
301 Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml.
303 Prepara la configuración del diágrama del Arbol del treeView numero 2
302 Prepara la configuración del diágrama del Arbol del treeView numero 2
304 """
303 """
305 print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online"
304 print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online"
306
305
307 for i in self.__arbolDict:
306 for i in self.__arbolDict:
308 if self.__arbolDict[i]==self.indexclick:
307 if self.__arbolDict[i]==self.indexclick:
309 self.projectObj=self.__projObjDict[int(i)]
308 self.projectObj=self.__projObjDict[int(i)]
310 # print self.projectObj
309 # print self.projectObj
311 # print i
310 # print i
312 # print "get",self.__arbolDict.items()
311 # print "get",self.__arbolDict.items()
313 # print "keys",self.__arbolDict.keys()
312 # print "keys",self.__arbolDict.keys()
314 self.description="Think"
313 self.description="Think"
315 id=i
314 id=i
316 name=str(self.nameProjectTxt.text())
315 name=str(self.nameProjectTxt.text())
317 desc=str(self.description)
316 desc=str(self.description)
318
317
319 self.projectObj.setup(id = id, name=name, description=desc)
318 self.projectObj.setup(id = id, name=name, description=desc)
320 print self.projectObj.id
319 print self.projectObj.id
321 # print self.projectObj.name
320 # print self.projectObj.name
322 # print self.projectObj.description
321 # print self.projectObj.description
323
322
324 datatype=str(self.dataTypeCmbBox.currentText())
323 datatype=str(self.dataTypeCmbBox.currentText())
325 path=str(self.dataPathTxt.text())
324 path=str(self.dataPathTxt.text())
326 online=int(self.online)
325 online=int(self.online)
327 starDate=str(self.starDateCmbBox.currentText())
326 starDate=str(self.starDateCmbBox.currentText())
328 endDate=str(self.endDateCmbBox.currentText())
327 endDate=str(self.endDateCmbBox.currentText())
329
328
330
329
331 self.readUnitConfObj = self.projectObj.addReadUnit(datatype=datatype,
330 self.readUnitConfObj = self.projectObj.addReadUnit(datatype=datatype,
332 path=path,
331 path=path,
333 startDate=starDate,
332 startDate=starDate,
334 endDate=endDate,
333 endDate=endDate,
335 startTime='06:10:00',
334 startTime='06:10:00',
336 endTime='23:59:59',
335 endTime='23:59:59',
337 online=online)
336 online=online)
338
337
339 self.readUnitConfObjList.append(self.readUnitConfObj)
338 self.readUnitConfObjList.append(self.readUnitConfObj)
340 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online
339 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online
341
340
342 self.model_2=treeModel()
341 self.model_2=treeModel()
343 self.model_2.setParams(name=self.projectObj.name+str(self.projectObj.id),
342 self.model_2.setParams(name=self.projectObj.name+str(self.projectObj.id),
344 directorio=path,
343 directorio=path,
345 workspace="C:\\WorkspaceGUI",
344 workspace="C:\\WorkspaceGUI",
346 remode=str(self.readModeCmBox.currentText()),
345 remode=str(self.readModeCmBox.currentText()),
347 dataformat=datatype,
346 dataformat=datatype,
348 date=str(starDate)+"-"+str(endDate),
347 date=str(starDate)+"-"+str(endDate),
349 initTime='06:10:00',
348 initTime='06:10:00',
350 endTime='23:59:59',
349 endTime='23:59:59',
351 timezone="Local" ,
350 timezone="Local" ,
352 Summary="test de prueba")
351 Summary="test de prueba")
353 self.model_2.arbol()
352 self.model_2.arbol()
354 self.treeView_2.setModel(self.model_2)
353 self.treeView_2.setModel(self.model_2)
355 self.treeView_2.expandAll()
354 self.treeView_2.expandAll()
356
355
357 #
356 #
358 #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------#
357 #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------#
359 @pyqtSignature("")
358 @pyqtSignature("")
360 def on_addUnitProces_clicked(self):
359 def on_addUnitProces_clicked(self):
361 """
360 """
362 CREAR PROCESSING UNI ,ANADE UNA UNIDAD DE PROCESAMIENTO, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO
361 CREAR PROCESSING UNI ,ANADE UNA UNIDAD DE PROCESAMIENTO, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO
363 Llama al metodo addUP.
362 Llama al metodo addUP.
364 """
363 """
365 # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
364 # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
366 self.addUP()
365 self.addUP()
367
366
368 #----------------------------BASICO-----------------------------------#
367 #----------------------------BASICO-----------------------------------#
369
368
370 def getNumberofProject(self):
369 def getNumberofProject(self):
371 # for i in self.proObjList:
370 # for i in self.proObjList:
372 # print i
371 # print i
373 return self.proObjList
372 return self.proObjList
374 # for i in self.proObjList:
373 # for i in self.proObjList:
375 # print i
374 # print i
376
375
377 def setParam(self):
376 def setParam(self):
378
377
379 self.tabWidgetProject.setEnabled(False)
378 self.tabWidgetProject.setEnabled(False)
380 self.dataPathTxt.setText('C:\data')
379 self.dataPathTxt.setText('C:\data')
381 self.nameProjectTxt.setText("Test")
380 self.nameProjectTxt.setText("Test")
382 self.numberChannelopVol.setEnabled(False)
381 self.numberChannelopVol.setEnabled(False)
383 self.lineHeighProfileTxtopVol.setEnabled(False)
382 self.lineHeighProfileTxtopVol.setEnabled(False)
384 self.numberIntegration.setEnabled(False)
383 self.numberIntegration.setEnabled(False)
385 self.valuenFFTPointOpSpec.setEnabled(False)
384 self.valuenFFTPointOpSpec.setEnabled(False)
386 self.lineProfileSelecopVolCEB.setEnabled(False)
385 self.lineProfileSelecopVolCEB.setEnabled(False)
387
386
388 def clickFunctiontree(self,index):
387 def clickFunctiontree(self,index):
389 self.indexclick= index.model().itemFromIndex(index)
388 self.indexclick= index.model().itemFromIndex(index)
390 print self.indexclick
389 print self.indexclick
391 return self.indexclick
390 return self.indexclick
392 # self.indexclick= index.model().itemFromIndex(index).text()
391 # self.indexclick= index.model().itemFromIndex(index).text()
393 # return self.indexclick
392 # return self.indexclick
394 # print self.indexclick()
393 # print self.indexclick()
395 # print index.model().itemFromIndex(index)
394 # print index.model().itemFromIndex(index)
396 # print self.indexclick
395 # print self.indexclick
397 # NumofPro=self.indexclick[8:10]
396 # NumofPro=self.indexclick[8:10]
398 # self.valuep=NumofPro
397 # self.valuep=NumofPro
399 # #print self.valuep
398 # #print self.valuep
400 # NameofPro=self.indexclick[0:7]
399 # NameofPro=self.indexclick[0:7]
401 # self.namepTree=NameofPro
400 # self.namepTree=NameofPro
402 # print self.namepTree
401 # print self.namepTree
403
402
404 def addProject(self):
403 def addProject(self):
405 self.tabWidgetProject.setEnabled(True)
404 self.tabWidgetProject.setEnabled(True)
406 print "En este nivel se debe crear el proyecto,id,nombre,desc"
405 print "En este nivel se debe crear el proyecto,id,nombre,desc"
407 #+++++++++++++++++++Creacion del Objeto Controller-XML+++++++++++++#
406 #+++++++++++++++++++Creacion del Objeto Controller-XML+++++++++++++#
408
407
409 self.idp += 1
408 self.idp += 1
410 self.projectObj = Project()
409 self.projectObj = Project()
411 print self.projectObj
410 print self.projectObj
412 self.__projObjDict[self.idp] = self.projectObj
411 self.__projObjDict[self.idp] = self.projectObj
413
412
414 #++++++++++++++++++Creación del Arbol++++++++++++++++++++#
413 #++++++++++++++++++Creación del Arbol++++++++++++++++++++#
415 self.parentItem = self.model.invisibleRootItem()
414 self.parentItem = self.model.invisibleRootItem()
416 name=str(self.nameProjectTxt.text())
415 name=str(self.nameProjectTxt.text())
417 self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name+" %0").arg(self.idp))
416 self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name+" %0").arg(self.idp))
418 print self.__arbolDict[self.idp]
417 print self.__arbolDict[self.idp]
419 self.parentItem.appendRow(self.__arbolDict[self.idp])
418 self.parentItem.appendRow(self.__arbolDict[self.idp])
420 self.parentItem=self.__arbolDict[self.idp]
419 self.parentItem=self.__arbolDict[self.idp]
421
420
422 print "Porfavor ingrese los parámetros de configuracion del Proyecto"
421 print "Porfavor ingrese los parámetros de configuracion del Proyecto"
423
422
424 def existDir(self, var_dir):
423 def existDir(self, var_dir):
425 """
424 """
426 METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR
425 METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR
427 VARIABLE DIRECCION
426 VARIABLE DIRECCION
428 """
427 """
429 if os.path.isdir(var_dir):
428 if os.path.isdir(var_dir):
430 return True
429 return True
431 else:
430 else:
432 self.textEdit.append("Incorrect path:" + str(var_dir))
431 self.textEdit.append("Incorrect path:" + str(var_dir))
433 return False
432 return False
434
433
435 def loadDays(self):
434 def loadDays(self):
436 """
435 """
437 METODO PARA CARGAR LOS DIAS
436 METODO PARA CARGAR LOS DIAS
438 """
437 """
439 self.variableList=[]
438 self.variableList=[]
440 self.starDateCmbBox.clear()
439 self.starDateCmbBox.clear()
441 self.endDateCmbBox.clear()
440 self.endDateCmbBox.clear()
442
441
443 Dirlist = os.listdir(self.dataPath)
442 Dirlist = os.listdir(self.dataPath)
444 Dirlist.sort()
443 Dirlist.sort()
445
444
446 for a in range(0, len(Dirlist)):
445 for a in range(0, len(Dirlist)):
447 fname= Dirlist[a]
446 fname= Dirlist[a]
448 Doy=fname[5:8]
447 Doy=fname[5:8]
449 fname = fname[1:5]
448 fname = fname[1:5]
450 print fname
449 print fname
451 fecha=Doy2Date(int(fname),int(Doy))
450 fecha=Doy2Date(int(fname),int(Doy))
452 fechaList=fecha.change2date()
451 fechaList=fecha.change2date()
453 #print fechaList[0]
452 #print fechaList[0]
454 Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1])
453 Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1])
455 #+"-"+ fechaList[0]+"-"+fechaList[1]
454 #+"-"+ fechaList[0]+"-"+fechaList[1]
456
455
457 #---------------AQUI TIENE QUE SER MODIFICADO--------#
456 #---------------AQUI TIENE QUE SER MODIFICADO--------#
458
457
459 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
458 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
460 for i in range(0, (len(Dirlist))):
459 for i in range(0, (len(Dirlist))):
461 self.variableList.append(Dirlist[i])
460 self.variableList.append(Dirlist[i])
462
461
463 for i in self.variableList:
462 for i in self.variableList:
464 self.starDateCmbBox.addItem(i)
463 self.starDateCmbBox.addItem(i)
465 self.endDateCmbBox.addItem(i)
464 self.endDateCmbBox.addItem(i)
466 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
465 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
467
466
468 self.getsubList()
467 self.getsubList()
469 self.dataOkBtn.setEnabled(True)
468 self.dataOkBtn.setEnabled(True)
470
469
471 def getsubList(self):
470 def getsubList(self):
472 """
471 """
473 OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS
472 OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS
474 """
473 """
475 self.subList=[]
474 self.subList=[]
476 for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]:
475 for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]:
477 self.subList.append(i)
476 self.subList.append(i)
478
477
479 def addUP(self):
478 def addUP(self):
480
479
481 self.configUP=UnitProcess(self)
480 self.configUP=UnitProcess(self)
482 for i in self.__arbolDict:
481 for i in self.__arbolDict:
483 if self.__arbolDict[i]==self.indexclick:
482 if self.__arbolDict[i]==self.indexclick:
484 if self.__projObjDict.has_key(i)==True:
483 if self.__projObjDict.has_key(i)==True:
485 self.projectObj=self.__projObjDict[int(i)]
484 self.projectObj=self.__projObjDict[int(i)]
486 print self.projectObj.id
485 print self.projectObj.id
487 self.configUP.getfromWindowList.append(self.projectObj)
486 self.configUP.getfromWindowList.append(self.projectObj)
488
487
489
488
490 for i in self.projectObj.procUnitConfObjDict:
489 for i in self.projectObj.procUnitConfObjDict:
491 if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit':
490 if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit':
492 self.upObj=self.projectObj.procUnitConfObjDict[i]
491 self.upObj=self.projectObj.procUnitConfObjDict[i]
493 self.configUP.getfromWindowList.append(self.upObj)
492 self.configUP.getfromWindowList.append(self.upObj)
494
493
495
494
496
495
497 self.configUP.loadTotalList()
496 self.configUP.loadTotalList()
498 self.configUP.show()
497 self.configUP.show()
499 #self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
498 #self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
500 self.configUP.closed.connect(self.createUP)
499 self.configUP.closed.connect(self.createUP)
501
500
502
501
503
502
504 def createUP(self):
503 def createUP(self):
505
504
506 print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
505 print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
507
506
508 if not self.configUP.create:
507 if not self.configUP.create:
509 return
508 return
510
509
511 self.uporProObjRecover=self.configUP.getFromWindow
510 self.uporProObjRecover=self.configUP.getFromWindow
512
511
513 self.upType = self.configUP.typeofUP
512 self.upType = self.configUP.typeofUP
514 for i in self.__arbolDict:
513 for i in self.__arbolDict:
515 if self.__arbolDict[i]==self.indexclick:
514 if self.__arbolDict[i]==self.indexclick:
516 self.projectObj=self.__projObjDict[int(i)]
515 self.projectObj=self.__projObjDict[int(i)]
517
516
518 datatype=str(self.upType)
517 datatype=str(self.upType)
519 uporprojectObj=self.uporProObjRecover
518 uporprojectObj=self.uporProObjRecover
520
519
521 if uporprojectObj.getElementName()=='ProcUnit':
520 if uporprojectObj.getElementName()=='ProcUnit':
522 inputId=uporprojectObj.getId()
521 inputId=uporprojectObj.getId()
523 else:
522 else:
524 inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId()
523 inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId()
525
524
526 print 'uporprojectObj.id','inputId', uporprojectObj.id,inputId
525 print 'uporprojectObj.id','inputId', uporprojectObj.id,inputId
527 self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId)
526 self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId)
528 self.__upObjDict[inputId]= self.procUnitConfObj1
527 self.__upObjDict[inputId]= self.procUnitConfObj1
529
528
530 self.parentItem=self.__arbolDict[uporprojectObj.id]
529 self.parentItem=self.__arbolDict[uporprojectObj.id]
531 #print "i","self.__arbolDict[i]",i ,self.__arbolDict[i]
530 #print "i","self.__arbolDict[i]",i ,self.__arbolDict[i]
532 self.numbertree=int(self.procUnitConfObj1.getId())-1
531 self.numbertree=int(self.procUnitConfObj1.getId())-1
533 self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree))
532 self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree))
534 self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id])
533 self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id])
535 self.parentItem=self.__arbolDict[self.procUnitConfObj1.id]
534 self.parentItem=self.__arbolDict[self.procUnitConfObj1.id]
536 # self.loadUp()
535 # self.loadUp()
537 self.treeView.expandAll()
536 self.treeView.expandAll()
538
537
539 def resetopVolt(self):
538 def resetopVolt(self):
540 self.selecChannelopVolCEB.setChecked(False)
539 self.selecChannelopVolCEB.setChecked(False)
541 self.selecHeighopVolCEB.setChecked(False)
540 self.selecHeighopVolCEB.setChecked(False)
542 self.coherentIntegrationCEB.setChecked(False)
541 self.coherentIntegrationCEB.setChecked(False)
543 self.profileSelecopVolCEB.setChecked(False)
542 self.profileSelecopVolCEB.setChecked(False)
544 #self.selecChannelopVolCEB.setEnabled(False)
543 #self.selecChannelopVolCEB.setEnabled(False)
545 self.lineHeighProfileTxtopVol.clear()
544 self.lineHeighProfileTxtopVol.clear()
546 self.lineProfileSelecopVolCEB.clear()
545 self.lineProfileSelecopVolCEB.clear()
547 self.numberChannelopVol.clear()
546 self.numberChannelopVol.clear()
548 self.numberIntegration.clear()
547 self.numberIntegration.clear()
549
548
550
549
551 def resetopSpec(self):
550 def resetopSpec(self):
552 self.nFFTPointOpSpecCEB.setChecked(False)
551 self.nFFTPointOpSpecCEB.setChecked(False)
553
552
554 self.valuenFFTPointOpSpec.clear()
553 self.valuenFFTPointOpSpec.clear()
555
554
556 def resetgraphSpec(self):
555 def resetgraphSpec(self):
557 self.SpectraPlotGraphCEB.setChecked(False)
556 self.SpectraPlotGraphCEB.setChecked(False)
558 self.CrossSpectraPlotGraphceb.setChecked(False)
557 self.CrossSpectraPlotGraphceb.setChecked(False)
559 self.RTIPlotGraphCEB.setChecked(False)
558 self.RTIPlotGraphCEB.setChecked(False)
560
559
561
560
562 def saveProject(self):
561 def saveProject(self):
563 print "entro"
562 print "entro"
564 #filename="C:\WorkspaceGUI\config1.xml"
563 #filename="C:\WorkspaceGUI\config1.xml"
565 for i in self.__arbolDict:
564 for i in self.__arbolDict:
566 if self.__arbolDict[i]==self.indexclick:
565 if self.__arbolDict[i]==self.indexclick:
567 self.projectObj=self.__projObjDict[int(i)]
566 self.projectObj=self.__projObjDict[int(i)]
568 print "Encontre project"
567 print "Encontre project"
569 filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml"
568 filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml"
570 print "Escribo Project"
569 print "Escribo Project"
571 self.projectObj.writeXml(filename)
570 self.projectObj.writeXml(filename)
572
571
573
572
574 class UnitProcess(QMainWindow, Ui_UnitProcess):
573 class UnitProcess(QMainWindow, Ui_UnitProcess):
575 """
574 """
576 Class documentation goes here.
575 Class documentation goes here.
577 """
576 """
578 closed=pyqtSignal()
577 closed=pyqtSignal()
579 create= False
578 create= False
580 def __init__(self, parent = None):
579 def __init__(self, parent = None):
581 """
580 """
582 Constructor
581 Constructor
583 """
582 """
584 QMainWindow.__init__(self, parent)
583 QMainWindow.__init__(self, parent)
585 self.setupUi(self)
584 self.setupUi(self)
586 self.getFromWindow=None
585 self.getFromWindow=None
587 self.getfromWindowList=[]
586 self.getfromWindowList=[]
588
587
589 self.listUP=None
588 self.listUP=None
590
589
591 @pyqtSignature("")
590 @pyqtSignature("")
592 def on_unitPokbut_clicked(self):
591 def on_unitPokbut_clicked(self):
593 """
592 """
594 Slot documentation goes here.
593 Slot documentation goes here.
595 """
594 """
596 self.create =True
595 self.create =True
597 self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())]
596 self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())]
598 #self.nameofUP= str(self.nameUptxt.text())
597 #self.nameofUP= str(self.nameUptxt.text())
599 self.typeofUP= str(self.comboTypeBox.currentText())
598 self.typeofUP= str(self.comboTypeBox.currentText())
600 self.close()
599 self.close()
601
600
602
601
603 @pyqtSignature("")
602 @pyqtSignature("")
604 def on_unitPcancelbut_clicked(self):
603 def on_unitPcancelbut_clicked(self):
605 """
604 """
606 Slot documentation goes here.
605 Slot documentation goes here.
607 """
606 """
608 # TODO: not implemented yet
607 # TODO: not implemented yet
609 #raise NotImplementedError
608 #raise NotImplementedError
610 self.create=False
609 self.create=False
611 self.close()
610 self.close()
612
611
613 def loadTotalList(self):
612 def loadTotalList(self):
614 self.comboInputBox.clear()
613 self.comboInputBox.clear()
615 for i in self.getfromWindowList:
614 for i in self.getfromWindowList:
616
615
617 name=i.getElementName()
616 name=i.getElementName()
618 if name=='Project':
617 if name=='Project':
619 id= i.id
618 id= i.id
620 if name=='ProcUnit':
619 if name=='ProcUnit':
621 id=int(i.id)-1
620 id=int(i.id)-1
622 self.comboInputBox.addItem(str(name)+str(id))
621 self.comboInputBox.addItem(str(name)+str(id))
623
622
624 def closeEvent(self, event):
623 def closeEvent(self, event):
625 self.closed.emit()
624 self.closed.emit()
626 event.accept()
625 event.accept()
627
626
628
627
629
628
630
629
631
630
632
631
633 No newline at end of file
632
@@ -1,277 +1,303
1 # -*- coding: utf-8 -*-
1 from PyQt4 import QtCore
2 from PyQt4 import QtCore
3 import itertools
2
4
3 HORIZONTAL_HEADERS = ("Property","Value " )
5 HORIZONTAL_HEADERS = ("Property","Value " )
4
6
5 HORIZONTAL = ("RAMA :",)
7 HORIZONTAL = ("RAMA :",)
6
8
7 class treeModel(QtCore.QAbstractItemModel):
9 class treeModel(QtCore.QAbstractItemModel):
8 '''
10 '''
9 a model to display a few names, ordered by encabezado
11 a model to display a few names, ordered by encabezado
12
10 '''
13 '''
14 def __init__(self ,parent=None):
15 super(treeModel, self).__init__(parent)
16 self.people = []
17 self.initProjectProperties()
18 self.initPUVoltageProperties()
19 self.initPUSpectraProperties()
20 self.initPUSpectraHeisProperties()
21
22 def initProjectProperties(self):
23
11 name=None
24 name=None
12 directorio=None
25 directorio=None
13 workspace=None
26 workspace=None
14 remode=None
27 remode=None
15 dataformat=None
28 dataformat=None
16 date=None
29 startDate=None
17 initTime=None
30 endDate=None
31 startTime=None
18 endTime=None
32 endTime=None
33 delay=None
34 set= None
35 walk=None
19 timezone=None
36 timezone=None
20 Summary=None
37 Summary=None
21
22 description=None
38 description=None
23
39
24 def __init__(self ,parent=None):
40 def initPUVoltageProperties(self):
25 super(treeModel, self).__init__(parent)
41 type=None
26 self.people = []
42 channel=None
43 heights=None
44 filter=None
45 profile=None
46 code=None
47 mode=None
48 coherentintegration=None
49
50 def initPUSpectraProperties(self):
51 type =None
52 nFFTpoints =None
53 ippFactor = None
54 pairsList =None
55 channel =None
56 heights =None
57 incoherentintegration =None
58 removeDC = None
59 removeInterference =None
60 getNoise = None
61 operationSpecPlot=None
62 operationCrossSpecPlot = None
63 operationRTIPlot = None
64 operationCohermap = None
65 operationPowProfilePlot = None
66
67 def initPUSpectraHeisProperties(self):
68 type =None
69 incoherentintegration =None
70 operationSpecHeisPlot=None
71 operationRTIHeisPlot = None
72
73 def initProjectView(self):
74 """
75 Reemplazo del método showtree
76 """
77 HORIZONTAL_HEADERS = ("Property","Value " )
78 HORIZONTAL = ("RAMA :",)
79 self.rootItem = TreeItem(None, "ALL", None)
80 self.parents = {0 : self.rootItem}
81 self.setupModelData()
27
82
83 def initPUVoltageView(self):
84 HORIZONTAL_HEADERS = ("Operation"," Parameter Value " )
85 HORIZONTAL = ("RAMA :",)
86 self.rootItem = TreeItem(None, "ALL", None)
87 self.parents = {0 : self.rootItem}
88 self.setupModelData()
28
89
29 def properties_projecto(self,description):
90 def showProjectParms(self,caracteristicaList,principalList,descripcionList):
30 self.caracteristica="Project_Properties"
91 """
31 self.principal ="Name"
92 set2Obje
32 self.description =description
93 """
33 exam_project=person_class(self.caracteristica,self.principal,self.description)
94 for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList):
34 return exam_project
35
36
37
38 def arbol(self):
39 for caracteristica,principal, descripcion in (("Properties","Name",self.name),
40 ("Properties","Data Path",self.directorio),
41 ("Properties","Workspace",self.workspace),
42 ("Parameters", "Read Mode ",self.remode),
43 ("Parameters", "DataType ",self.dataformat),
44 ("Parameters", "Date ",self.date),
45 ("Parameters", "Init Time ",self.initTime),
46 ("Parameters", "Final Time ",self.endTime),
47 ("Parameters", " Time zone ",self.timezone),
48 ("Parameters", "Profiles ","1"),
49 ("Description", "Summary ", self.Summary),
50 ):
51 person = person_class(caracteristica, principal, descripcion)
95 person = person_class(caracteristica, principal, descripcion)
52 self.people.append(person)
96 self.people.append(person)
53 def addProjectproperties(self,person):
97 self.rootItem = TreeItem(None, "ALL", None)
98 self.parents = {0 : self.rootItem}
99 self.setupModelData()
100
101 def showPUVoltageParms(self,caracteristicaList,principalList,descripcionList):
102
103 for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList):
104 person = person_class(caracteristica, principal, descripcion)
54 self.people.append(person)
105 self.people.append(person)
106 self.rootItem = TreeItem(None, "ALL", None)
107 self.parents = {0 : self.rootItem}
108 self.setupModelData()
55
109
56
110
57 #def veamos(self):
111 def showPUSpectraParms(self,caracteristicaList,principalList,descripcionList):
58 # self.update= MainWindow(self)
59 # self.update.dataProyectTxt.text()
60 # return self.update.dataProyectTxt.text()
61
112
62 def showtree(self):
113 for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList):
114 person = person_class(caracteristica, principal, descripcion)
115 self.people.append(person)
63 self.rootItem = TreeItem(None, "ALL", None)
116 self.rootItem = TreeItem(None, "ALL", None)
64 self.parents = {0 : self.rootItem}
117 self.parents = {0 : self.rootItem}
65 self.setupModelData()
118 self.setupModelData()
66
119
67 def setParams(self,name,directorio,workspace,remode,dataformat,date,initTime,endTime,timezone,Summary):
120 def showPUSpectraHeisParms(self,caracteristicaList,principalList,descripcionList):
68 self.name=name
121
69 self.workspace=workspace
122 for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList):
70 self.directorio= directorio
71 self.remode=remode
72 self.dataformat=dataformat
73 self.date=date
74 self.initTime=initTime
75 self.endTime=endTime
76 self.timezone=timezone
77 self.Summary=Summary
78
79
80 for caracteristica,principal, descripcion in (("Properties","Name",self.name),
81 ("Properties","Data Path",self.directorio),
82 ("Properties","Workspace",self.workspace),
83 ("Parameters", "Read Mode ",self.remode),
84 ("Parameters", "DataType ",self.dataformat),
85 ("Parameters", "Date ",self.date),
86 ("Parameters", "Init Time ",self.initTime),
87 ("Parameters", "Final Time ",self.endTime),
88 ("Parameters", " Time zone ",self.timezone),
89 ("Parameters", "Profiles ","1"),
90 ("Description", "Summary ", self.Summary),
91 ):
92 person = person_class(caracteristica, principal, descripcion)
123 person = person_class(caracteristica, principal, descripcion)
93 self.people.append(person)
124 self.people.append(person)
94 self.rootItem = TreeItem(None, "ALL", None)
125 self.rootItem = TreeItem(None, "ALL", None)
95 self.parents = {0 : self.rootItem}
126 self.parents = {0 : self.rootItem}
96 self.setupModelData()
127 self.setupModelData()
97
128
98
129
99 def columnCount(self, parent=None):
130 def columnCount(self, parent=None):
100 if parent and parent.isValid():
131 if parent and parent.isValid():
101 return parent.internalPointer().columnCount()
132 return parent.internalPointer().columnCount()
102 else:
133 else:
103 return len(HORIZONTAL_HEADERS)
134 return len(HORIZONTAL_HEADERS)
104
135
105 def data(self, index, role):
136 def data(self, index, role):
106 if not index.isValid():
137 if not index.isValid():
107 return QtCore.QVariant()
138 return QtCore.QVariant()
108
139
109 item = index.internalPointer()
140 item = index.internalPointer()
110 if role == QtCore.Qt.DisplayRole:
141 if role == QtCore.Qt.DisplayRole:
111 return item.data(index.column())
142 return item.data(index.column())
112 if role == QtCore.Qt.UserRole:
143 if role == QtCore.Qt.UserRole:
113 if item:
144 if item:
114 return item.person
145 return item.person
115
146
116 return QtCore.QVariant()
147 return QtCore.QVariant()
117
148
118 def headerData(self, column, orientation, role):
149 def headerData(self, column, orientation, role):
119 if (orientation == QtCore.Qt.Horizontal and
150 if (orientation == QtCore.Qt.Horizontal and
120 role == QtCore.Qt.DisplayRole):
151 role == QtCore.Qt.DisplayRole):
121 try:
152 try:
122 return QtCore.QVariant(HORIZONTAL_HEADERS[column])
153 return QtCore.QVariant(HORIZONTAL_HEADERS[column])
123 except IndexError:
154 except IndexError:
124 pass
155 pass
125
156
126 return QtCore.QVariant()
157 return QtCore.QVariant()
127
158
128 def index(self, row, column, parent):
159 def index(self, row, column, parent):
129 if not self.hasIndex(row, column, parent):
160 if not self.hasIndex(row, column, parent):
130 return QtCore.QModelIndex()
161 return QtCore.QModelIndex()
131
162
132 if not parent.isValid():
163 if not parent.isValid():
133 parentItem = self.rootItem
164 parentItem = self.rootItem
134 else:
165 else:
135 parentItem = parent.internalPointer()
166 parentItem = parent.internalPointer()
136
167
137 childItem = parentItem.child(row)
168 childItem = parentItem.child(row)
138 if childItem:
169 if childItem:
139 return self.createIndex(row, column, childItem)
170 return self.createIndex(row, column, childItem)
140 else:
171 else:
141 return QtCore.QModelIndex()
172 return QtCore.QModelIndex()
142
173
143 def parent(self, index):
174 def parent(self, index):
144 if not index.isValid():
175 if not index.isValid():
145 return QtCore.QModelIndex()
176 return QtCore.QModelIndex()
146
177
147 childItem = index.internalPointer()
178 childItem = index.internalPointer()
148 if not childItem:
179 if not childItem:
149 return QtCore.QModelIndex()
180 return QtCore.QModelIndex()
150
181
151 parentItem = childItem.parent()
182 parentItem = childItem.parent()
152
183
153 if parentItem == self.rootItem:
184 if parentItem == self.rootItem:
154 return QtCore.QModelIndex()
185 return QtCore.QModelIndex()
155
186
156 return self.createIndex(parentItem.row(), 0, parentItem)
187 return self.createIndex(parentItem.row(), 0, parentItem)
157
188
158 def rowCount(self, parent=QtCore.QModelIndex()):
189 def rowCount(self, parent=QtCore.QModelIndex()):
159 if parent.column() > 0:
190 if parent.column() > 0:
160 return 0
191 return 0
161 if not parent.isValid():
192 if not parent.isValid():
162 p_Item = self.rootItem
193 p_Item = self.rootItem
163 else:
194 else:
164 p_Item = parent.internalPointer()
195 p_Item = parent.internalPointer()
165 return p_Item.childCount()
196 return p_Item.childCount()
166
197
167 def setupModelData(self):
198 def setupModelData(self):
168 for person in self.people:
199 for person in self.people:
169 if person.descripcion:
200 if person.descripcion:
170 encabezado = person.caracteristica
201 encabezado = person.caracteristica
171
202
172
203
173 if not self.parents.has_key(encabezado):
204 if not self.parents.has_key(encabezado):
174 newparent = TreeItem(None, encabezado, self.rootItem)
205 newparent = TreeItem(None, encabezado, self.rootItem)
175 self.rootItem.appendChild(newparent)
206 self.rootItem.appendChild(newparent)
176
207
177 self.parents[encabezado] = newparent
208 self.parents[encabezado] = newparent
178
209
179 parentItem = self.parents[encabezado]
210 parentItem = self.parents[encabezado]
180 newItem = TreeItem(person, "", parentItem)
211 newItem = TreeItem(person, "", parentItem)
181 parentItem.appendChild(newItem)
212 parentItem.appendChild(newItem)
182
213
183 def searchModel(self, person):
214 def searchModel(self, person):
184 '''
215 '''
185 get the modelIndex for a given appointment
216 get the modelIndex for a given appointment
186 '''
217 '''
187 def searchNode(node):
218 def searchNode(node):
188 '''
219 '''
189 a function called recursively, looking at all nodes beneath node
220 a function called recursively, looking at all nodes beneath node
190 '''
221 '''
191 for child in node.childItems:
222 for child in node.childItems:
192 if person == child.person:
223 if person == child.person:
193 index = self.createIndex(child.row(), 0, child)
224 index = self.createIndex(child.row(), 0, child)
194 return index
225 return index
195
226
196 if child.childCount() > 0:
227 if child.childCount() > 0:
197 result = searchNode(child)
228 result = searchNode(child)
198 if result:
229 if result:
199 return result
230 return result
200
231
201 retarg = searchNode(self.parents[0])
232 retarg = searchNode(self.parents[0])
202 #print retarg
233 #print retarg
203 return retarg
234 return retarg
204
235
205 def find_GivenName(self, principal):
236 def find_GivenName(self, principal):
206 app = None
237 app = None
207 for person in self.people:
238 for person in self.people:
208 if person.principal == principal:
239 if person.principal == principal:
209 app = person
240 app = person
210 break
241 break
211 if app != None:
242 if app != None:
212 index = self.searchModel(app)
243 index = self.searchModel(app)
213 return (True, index)
244 return (True, index)
214 return (False, None)
245 return (False, None)
215
246
216
247
217
218
219
220
221
222 class person_class(object):
248 class person_class(object):
223 '''
249 '''
224 a trivial custom data object
250 a trivial custom data object
225 '''
251 '''
226 def __init__(self, caracteristica, principal, descripcion):
252 def __init__(self, caracteristica, principal, descripcion):
227 self.caracteristica = caracteristica
253 self.caracteristica = caracteristica
228 self.principal = principal
254 self.principal = principal
229 self.descripcion = descripcion
255 self.descripcion = descripcion
230
256
231 def __repr__(self):
257 def __repr__(self):
232 return "PERSON - %s %s"% (self.principal, self.caracteristica)
258 return "PERSON - %s %s"% (self.principal, self.caracteristica)
233
259
234 class TreeItem(object):
260 class TreeItem(object):
235 '''
261 '''
236 a python object used to return row/column data, and keep note of
262 a python object used to return row/column data, and keep note of
237 it's parents and/or children
263 it's parents and/or children
238 '''
264 '''
239 def __init__(self, person, header, parentItem):
265 def __init__(self, person, header, parentItem):
240 self.person = person
266 self.person = person
241 self.parentItem = parentItem
267 self.parentItem = parentItem
242 self.header = header
268 self.header = header
243 self.childItems = []
269 self.childItems = []
244
270
245 def appendChild(self, item):
271 def appendChild(self, item):
246 self.childItems.append(item)
272 self.childItems.append(item)
247
273
248 def child(self, row):
274 def child(self, row):
249 return self.childItems[row]
275 return self.childItems[row]
250
276
251 def childCount(self):
277 def childCount(self):
252 return len(self.childItems)
278 return len(self.childItems)
253
279
254 def columnCount(self):
280 def columnCount(self):
255 return 2
281 return 2
256
282
257 def data(self, column):
283 def data(self, column):
258 if self.person == None:
284 if self.person == None:
259 if column == 0:
285 if column == 0:
260 return QtCore.QVariant(self.header)
286 return QtCore.QVariant(self.header)
261 if column == 1:
287 if column == 1:
262 return QtCore.QVariant("")
288 return QtCore.QVariant("")
263 else:
289 else:
264 if column == 0:
290 if column == 0:
265 return QtCore.QVariant(self.person.principal)
291 return QtCore.QVariant(self.person.principal)
266 if column == 1:
292 if column == 1:
267 return QtCore.QVariant(self.person.descripcion)
293 return QtCore.QVariant(self.person.descripcion)
268 return QtCore.QVariant()
294 return QtCore.QVariant()
269
295
270 def parent(self):
296 def parent(self):
271 return self.parentItem
297 return self.parentItem
272
298
273 def row(self):
299 def row(self):
274 if self.parentItem:
300 if self.parentItem:
275 return self.parentItem.childItems.index(self)
301 return self.parentItem.childItems.index(self)
276 return 0
302 return 0
277 No newline at end of file
303
@@ -1,41 +1,38
1 import os, sys
1 import os, sys
2 import getopt
2 import getopt
3 path = os.path.split(os.getcwd())[0]
4 #path="C://Users//alex//workspace//gui_14_03_13"
5 sys.path.append(path)
6
3
7 from controller import *
4 from schainpy.controller import Project
8
5
9 class scProcessController():
6 class scProcessController():
10 def __init__(self):
7 def __init__(self):
11 print "ESTOY EJECUTANDO EL NUEVO PROCESO PERO APARENTEMENTE NO QUIERE"
8 print "ESTOY EJECUTANDO EL NUEVO PROCESO PERO APARENTEMENTE NO QUIERE"
12 self.setfilename()
9 self.setfilename()
13 self.operation()
10 self.operation()
14
11
15 def setfilename(self):
12 def setfilename(self):
16 arglist= ''
13 arglist= ''
17 longarglist=['filename=']
14 longarglist=['filename=']
18 optlist,args=getopt.getopt(sys.argv[1:],arglist,longarglist)
15 optlist,args=getopt.getopt(sys.argv[1:],arglist,longarglist)
19 for opt in optlist:
16 for opt in optlist:
20 if opt[0]== '--filename':
17 if opt[0]== '--filename':
21 self.filename = opt[1]
18 self.filename = opt[1]
22
19
23 def operation(self):
20 def operation(self):
24 print 'inicia operation'
21 print 'inicia operation'
25 controllerObj = Project()
22 controllerObj = Project()
26 print "Leyendo el archivo XML"
23 print "Leyendo el archivo XML"
27 #self.filename="C://Users//alex//schain_workspace//Alexander1.xml"
24 #self.filename="C://Users//alex//schain_workspace//Alexander1.xml"
28 controllerObj.readXml(self.filename)
25 controllerObj.readXml(self.filename)
29 #controllerObj.printattr()
26 #controllerObj.printattr()
30
27
31 controllerObj.createObjects()
28 controllerObj.createObjects()
32 controllerObj.connectObjects()
29 controllerObj.connectObjects()
33 controllerObj.run()
30 controllerObj.run()
34
31
35
32
36 def main():
33 def main():
37 a=scProcessController()
34 a=scProcessController()
38
35
39
36
40 if __name__ == "__main__":
37 if __name__ == "__main__":
41 main() No newline at end of file
38 main()
@@ -1,58 +1,58
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 """
3 """
4 Module implementing MainWindow.
4 Module implementing MainWindow.
5 """
5 """
6
6
7 from PyQt4.QtGui import QMainWindow
7 from PyQt4.QtGui import QMainWindow
8 from PyQt4.QtCore import pyqtSignature
8 from PyQt4.QtCore import pyqtSignature
9
9
10 from viewer.ui_unitprocess import Ui_UnitProcess
10 from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess
11
11
12 class UnitProcess(QMainWindow, Ui_UnitProcess):
12 class UnitProcess(QMainWindow, Ui_UnitProcess):
13 """
13 """
14 Class documentation goes here.
14 Class documentation goes here.
15 """
15 """
16
16
17 def __init__(self, parent = None):
17 def __init__(self, parent = None):
18 """
18 """
19 Constructor
19 Constructor
20 """
20 """
21 QMainWindow.__init__(self, parent)
21 QMainWindow.__init__(self, parent)
22 self.setupUi(self)
22 self.setupUi(self)
23
23
24
24
25 @pyqtSignature("QString")
25 @pyqtSignature("QString")
26 def on_comboInputBox_activated(self, p0):
26 def on_comboInputBox_activated(self, p0):
27 """
27 """
28 Slot documentation goes here.
28 Slot documentation goes here.
29 """
29 """
30 # TODO: not implemented yet
30 # TODO: not implemented yet
31 raise NotImplementedError
31 raise NotImplementedError
32
32
33 @pyqtSignature("QString")
33 @pyqtSignature("QString")
34 def on_comboTypeBox_activated(self, p0):
34 def on_comboTypeBox_activated(self, p0):
35 """
35 """
36 Slot documentation goes here.
36 Slot documentation goes here.
37 """
37 """
38 # TODO: not implemented yet
38 # TODO: not implemented yet
39 raise NotImplementedError
39 raise NotImplementedError
40
40
41
41
42 @pyqtSignature("")
42 @pyqtSignature("")
43 def on_unitPokbut_clicked(self):
43 def on_unitPokbut_clicked(self):
44 """
44 """
45 Slot documentation goes here.
45 Slot documentation goes here.
46 """
46 """
47 # TODO: not implemented yet
47 # TODO: not implemented yet
48 #raise NotImplementedError
48 #raise NotImplementedError
49 print "this is suspiscious"
49 print "this is suspiscious"
50 print "njdasjdajj"
50 print "njdasjdajj"
51
51
52 @pyqtSignature("")
52 @pyqtSignature("")
53 def on_unitPcancelbut_clicked(self):
53 def on_unitPcancelbut_clicked(self):
54 """
54 """
55 Slot documentation goes here.
55 Slot documentation goes here.
56 """
56 """
57 # TODO: not implemented yet
57 # TODO: not implemented yet
58 raise NotImplementedError
58 raise NotImplementedError
@@ -1,807 +1,807
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 Module implementing MainWindow.
3 Module implementing MainWindow.
4 #+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++#
4 #+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++#
5 """
5 """
6 from PyQt4.QtGui import QMainWindow
6 from PyQt4.QtGui import QMainWindow
7 from PyQt4.QtCore import pyqtSignature
7 from PyQt4.QtCore import pyqtSignature
8 from PyQt4.QtCore import pyqtSignal
8 from PyQt4.QtCore import pyqtSignal
9 from PyQt4 import QtCore
9 from PyQt4 import QtCore
10 from PyQt4 import QtGui
10 from PyQt4 import QtGui
11 from timeconversions import Doy2Date
11 from timeconversions import Doy2Date
12 from modelProperties import treeModel
12 from modelProperties import treeModel
13 from viewer.ui_unitprocess import Ui_UnitProcess
13 from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess
14 from viewer.ui_window import Ui_window
14 from schainpy.gui.viewer.ui_window import Ui_window
15 from viewer.ui_mainwindow import Ui_MainWindow
15 from schainpy.gui.viewer.ui_mainwindow import Ui_MainWindow
16 from viewer.ui_workspace import Ui_Workspace
16 from schainpy.gui.viewer.ui_workspace import Ui_Workspace
17 from viewer.ui_initwindow import Ui_InitWindow
17 from schainpy.gui.viewer.ui_initwindow import Ui_InitWindow
18
18
19 from controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf
19 from schainpy.controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf
20 import os
20 import os
21
21
22 HORIZONTAL_HEADERS = ("ITEM :"," DATOS : " )
22 HORIZONTAL_HEADERS = ("ITEM :"," DATOS : " )
23
23
24 HORIZONTAL = ("RAMA :",)
24 HORIZONTAL = ("RAMA :",)
25
25
26 class MainWindow(QMainWindow, Ui_MainWindow):
26 class MainWindow(QMainWindow, Ui_MainWindow):
27
27
28 nop=None
28 nop=None
29
29
30 __projObjDict = {}
30 __projObjDict = {}
31 __arbolDict = {}
31 __arbolDict = {}
32
32
33 """
33 """
34 Class documentation goes here.
34 Class documentation goes here.
35 #*##################VENTANA CUERPO DEL PROGRAMA####################
35 #*##################VENTANA CUERPO DEL PROGRAMA####################
36 """
36 """
37 def __init__(self, parent = None):
37 def __init__(self, parent = None):
38 """
38 """
39 Constructor
39 Constructor
40 """
40 """
41 print "Inicio de Programa Interfaz Gráfica"
41 print "Inicio de Programa Interfaz Gráfica"
42 QMainWindow.__init__(self, parent)
42 QMainWindow.__init__(self, parent)
43 self.setupUi(self)
43 self.setupUi(self)
44
44
45 self.online=0
45 self.online=0
46 self.datatype=0
46 self.datatype=0
47 self.variableList=[]
47 self.variableList=[]
48
48
49 self.proObjList=[]
49 self.proObjList=[]
50 self.idp=0
50 self.idp=0
51 self.projectName=0
51 self.projectName=0
52 self.description=0
52 self.description=0
53 self.namepTree=0
53 self.namepTree=0
54 self.valuep=0
54 self.valuep=0
55
55
56 self.upObjList= []
56 self.upObjList= []
57 self.upn=0
57 self.upn=0
58 self.upName=0
58 self.upName=0
59 self.upType=0
59 self.upType=0
60 self.uporProObjRecover=0
60 self.uporProObjRecover=0
61
61
62
62
63 self.readUnitConfObjList=[]
63 self.readUnitConfObjList=[]
64
64
65 self.upObjVolList=[]
65 self.upObjVolList=[]
66 self.upobjSpecList=[]
66 self.upobjSpecList=[]
67
67
68
68
69 self.operObjList=[]
69 self.operObjList=[]
70
70
71 self.projectWindow=None
71 self.projectWindow=None
72 self.configUP=None
72 self.configUP=None
73
73
74 self.projectObj=None
74 self.projectObj=None
75 self.readUnitConfObj=None
75 self.readUnitConfObj=None
76 self.procUnitConfObj0=None
76 self.procUnitConfObj0=None
77 self.opObj10=None
77 self.opObj10=None
78 self.opObj12=None
78 self.opObj12=None
79
79
80
80
81 self.setParam()
81 self.setParam()
82
82
83 #++++++++++++++++++NEW PROPERTIES+++++++++++++++++#
83 #++++++++++++++++++NEW PROPERTIES+++++++++++++++++#
84 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
84 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
85 self.addpBtn.setToolTip('Add_New_Project')
85 self.addpBtn.setToolTip('Add_New_Project')
86 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
86 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
87
87
88 #++++++++++++++++++NEW PROPERTIES+++++++++++++++++#
88 #++++++++++++++++++NEW PROPERTIES+++++++++++++++++#
89 self.model = QtGui.QStandardItemModel()
89 self.model = QtGui.QStandardItemModel()
90 self.treeView.setModel(self.model)
90 self.treeView.setModel(self.model)
91 self.treeView.clicked.connect(self.clickFunctiontree)
91 self.treeView.clicked.connect(self.clickFunctiontree)
92 self.treeView.expandAll()
92 self.treeView.expandAll()
93 #self.treeView.clicked.connect(self.treefunction1)
93 #self.treeView.clicked.connect(self.treefunction1)
94
94
95 def getNumberofProject(self):
95 def getNumberofProject(self):
96 # for i in self.proObjList:
96 # for i in self.proObjList:
97 # print i
97 # print i
98 return self.proObjList
98 return self.proObjList
99 # for i in self.proObjList:
99 # for i in self.proObjList:
100 # print i
100 # print i
101
101
102 def setParam(self):
102 def setParam(self):
103 self.dataPathTxt.setText('C:\data')
103 self.dataPathTxt.setText('C:\data')
104 self.numberChannelopVol.setEnabled(False)
104 self.numberChannelopVol.setEnabled(False)
105 self.lineHeighProfileTxtopVol.setEnabled(False)
105 self.lineHeighProfileTxtopVol.setEnabled(False)
106 self.numberIntegration.setEnabled(False)
106 self.numberIntegration.setEnabled(False)
107 self.valuenFFTPointOpSpec.setEnabled(False)
107 self.valuenFFTPointOpSpec.setEnabled(False)
108 self.lineProfileSelecopVolCEB.setEnabled(False)
108 self.lineProfileSelecopVolCEB.setEnabled(False)
109
109
110
110
111 def clickFunctiontree(self,index):
111 def clickFunctiontree(self,index):
112 indexclick= index.model().itemFromIndex(index).text()
112 indexclick= index.model().itemFromIndex(index).text()
113 #print indexclick
113 #print indexclick
114 NumofPro=indexclick[8:10]
114 NumofPro=indexclick[8:10]
115 self.valuep=NumofPro
115 self.valuep=NumofPro
116 #print self.valuep
116 #print self.valuep
117 NameofPro=indexclick[0:7]
117 NameofPro=indexclick[0:7]
118 self.namepTree=NameofPro
118 self.namepTree=NameofPro
119 #print self.namepTree
119 #print self.namepTree
120
120
121
121
122 @pyqtSignature("")
122 @pyqtSignature("")
123 def on_addprojectBtn_clicked(self):
123 def on_addprojectBtn_clicked(self):
124 """
124 """
125 Llama al metodo addProject.
125 Llama al metodo addProject.
126 """
126 """
127 print "En este nivel se abre el window"
127 print "En este nivel se abre el window"
128
128
129
129
130 self.addProject()
130 self.addProject()
131
131
132 def addProject(self):
132 def addProject(self):
133 """
133 """
134 Muestra una
134 Muestra una
135 """
135 """
136
136
137 self.projectWindow = ProjectWindow(self)
137 self.projectWindow = ProjectWindow(self)
138 self.projectWindow.show()
138 self.projectWindow.show()
139
139
140 #Al cerrar la venta de proyecto se ejecutara el metodo createProject
140 #Al cerrar la venta de proyecto se ejecutara el metodo createProject
141 self.projectWindow.closed.connect(self.createProject)
141 self.projectWindow.closed.connect(self.createProject)
142
142
143 def createProject(self):
143 def createProject(self):
144 """
144 """
145 Crea un nuevo proyecto del tipo Controller.Project() y lo adiciona al diccionario
145 Crea un nuevo proyecto del tipo Controller.Project() y lo adiciona al diccionario
146 self.__projectDict.
146 self.__projectDict.
147 """
147 """
148
148
149 if not self.projectWindow.create:
149 if not self.projectWindow.create:
150 return
150 return
151
151
152 self.projectName = self.projectWindow.name
152 self.projectName = self.projectWindow.name
153 self.description = self.projectWindow.description
153 self.description = self.projectWindow.description
154
154
155 print "En este nivel se debe crear el proyecto,id,nombre,desc"
155 print "En este nivel se debe crear el proyecto,id,nombre,desc"
156 #+++++Creacion del Objeto Controller-XML++++++++++#
156 #+++++Creacion del Objeto Controller-XML++++++++++#
157 self.idp += 1
157 self.idp += 1
158 self.projectObj = Project()
158 self.projectObj = Project()
159
159
160 id=int(self.idp)
160 id=int(self.idp)
161 name=str(self.projectName)
161 name=str(self.projectName)
162 desc=str(self.description)
162 desc=str(self.description)
163
163
164 self.projectObj.setup(id = id, name=name, description=desc)
164 self.projectObj.setup(id = id, name=name, description=desc)
165 self.__projObjDict[id] = self.projectObj
165 self.__projObjDict[id] = self.projectObj
166 self.proObjList.append(self.projectObj)
166 self.proObjList.append(self.projectObj)
167
167
168 self.parentItem = self.model.invisibleRootItem()
168 self.parentItem = self.model.invisibleRootItem()
169 self.__arbolDict[id] = QtGui.QStandardItem(QtCore.QString("Project %0").arg(self.idp))
169 self.__arbolDict[id] = QtGui.QStandardItem(QtCore.QString("Project %0").arg(self.idp))
170
170
171 self.parentItem.appendRow(self.__arbolDict[projectObj.id])
171 self.parentItem.appendRow(self.__arbolDict[projectObj.id])
172
172
173 #+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++#
173 #+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++#
174
174
175
175
176 # self.parentItem=self.projectObj.arbol
176 # self.parentItem=self.projectObj.arbol
177 # self.loadProjects()
177 # self.loadProjects()
178
178
179 print "Porfavor ingrese los parámetros de configuracion del Proyecto"
179 print "Porfavor ingrese los parámetros de configuracion del Proyecto"
180
180
181 def loadProjects(self):
181 def loadProjects(self):
182 self.proConfCmbBox.clear()
182 self.proConfCmbBox.clear()
183 for i in self.__projObjDict.values():
183 for i in self.__projObjDict.values():
184 self.proConfCmbBox.addItem("Project"+str(i.id))
184 self.proConfCmbBox.addItem("Project"+str(i.id))
185
185
186 @pyqtSignature("int")
186 @pyqtSignature("int")
187 def on_dataTypeCmbBox_activated(self,index):
187 def on_dataTypeCmbBox_activated(self,index):
188 self.dataFormatTxt.setReadOnly(True)
188 self.dataFormatTxt.setReadOnly(True)
189 if index==0:
189 if index==0:
190 self.datatype='Voltage'
190 self.datatype='Voltage'
191 elif index==1:
191 elif index==1:
192 self.datatype='Spectra'
192 self.datatype='Spectra'
193 else :
193 else :
194 self.datatype=''
194 self.datatype=''
195 self.dataFormatTxt.setReadOnly(False)
195 self.dataFormatTxt.setReadOnly(False)
196 self.dataFormatTxt.setText(self.datatype)
196 self.dataFormatTxt.setText(self.datatype)
197
197
198 def existDir(self, var_dir):
198 def existDir(self, var_dir):
199 """
199 """
200 METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR
200 METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR
201 VARIABLE DIRECCION
201 VARIABLE DIRECCION
202 """
202 """
203 if os.path.isdir(var_dir):
203 if os.path.isdir(var_dir):
204 return True
204 return True
205 else:
205 else:
206 self.textEdit.append("Incorrect path:" + str(var_dir))
206 self.textEdit.append("Incorrect path:" + str(var_dir))
207 return False
207 return False
208
208
209 def loadDays(self):
209 def loadDays(self):
210 """
210 """
211 METODO PARA CARGAR LOS DIAS
211 METODO PARA CARGAR LOS DIAS
212 """
212 """
213 self.variableList=[]
213 self.variableList=[]
214 self.starDateCmbBox.clear()
214 self.starDateCmbBox.clear()
215 self.endDateCmbBox.clear()
215 self.endDateCmbBox.clear()
216
216
217 Dirlist = os.listdir(self.dataPath)
217 Dirlist = os.listdir(self.dataPath)
218 Dirlist.sort()
218 Dirlist.sort()
219
219
220 for a in range(0, len(Dirlist)):
220 for a in range(0, len(Dirlist)):
221 fname= Dirlist[a]
221 fname= Dirlist[a]
222 Doy=fname[5:8]
222 Doy=fname[5:8]
223 fname = fname[1:5]
223 fname = fname[1:5]
224 print fname
224 print fname
225 fecha=Doy2Date(int(fname),int(Doy))
225 fecha=Doy2Date(int(fname),int(Doy))
226 fechaList=fecha.change2date()
226 fechaList=fecha.change2date()
227 #print fechaList[0]
227 #print fechaList[0]
228 Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1])
228 Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1])
229 #+"-"+ fechaList[0]+"-"+fechaList[1]
229 #+"-"+ fechaList[0]+"-"+fechaList[1]
230
230
231 #---------------AQUI TIENE QUE SER MODIFICADO--------#
231 #---------------AQUI TIENE QUE SER MODIFICADO--------#
232
232
233 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
233 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
234 for i in range(0, (len(Dirlist))):
234 for i in range(0, (len(Dirlist))):
235 self.variableList.append(Dirlist[i])
235 self.variableList.append(Dirlist[i])
236
236
237 for i in self.variableList:
237 for i in self.variableList:
238 self.starDateCmbBox.addItem(i)
238 self.starDateCmbBox.addItem(i)
239 self.endDateCmbBox.addItem(i)
239 self.endDateCmbBox.addItem(i)
240 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
240 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
241
241
242 self.getsubList()
242 self.getsubList()
243 self.dataOkBtn.setEnabled(True)
243 self.dataOkBtn.setEnabled(True)
244
244
245 def getsubList(self):
245 def getsubList(self):
246 """
246 """
247 OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS
247 OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS
248 """
248 """
249 self.subList=[]
249 self.subList=[]
250 for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]:
250 for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]:
251 self.subList.append(i)
251 self.subList.append(i)
252
252
253 @pyqtSignature("")
253 @pyqtSignature("")
254 def on_dataPathBrowse_clicked(self):
254 def on_dataPathBrowse_clicked(self):
255 """
255 """
256 OBTENCION DE LA RUTA DE DATOS
256 OBTENCION DE LA RUTA DE DATOS
257 """
257 """
258 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
258 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
259 self.dataPathTxt.setText(self.dataPath)
259 self.dataPathTxt.setText(self.dataPath)
260 self.statusDpath=self.existDir(self.dataPath)
260 self.statusDpath=self.existDir(self.dataPath)
261 self.loadDays()
261 self.loadDays()
262
262
263 @pyqtSignature("int")
263 @pyqtSignature("int")
264 def on_starDateCmbBox_activated(self, index):
264 def on_starDateCmbBox_activated(self, index):
265 """
265 """
266 SELECCION DEL RANGO DE FECHAS -STAR DATE
266 SELECCION DEL RANGO DE FECHAS -STAR DATE
267 """
267 """
268 var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex()
268 var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex()
269 self.endDateCmbBox.clear()
269 self.endDateCmbBox.clear()
270 for i in self.variableList[index:]:
270 for i in self.variableList[index:]:
271 self.endDateCmbBox.addItem(i)
271 self.endDateCmbBox.addItem(i)
272 self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index)
272 self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index)
273 self.getsubList()
273 self.getsubList()
274
274
275 @pyqtSignature("int")
275 @pyqtSignature("int")
276 def on_endDateCmbBox_activated(self, index):
276 def on_endDateCmbBox_activated(self, index):
277 """
277 """
278 SELECCION DEL RANGO DE FECHAS-END DATE
278 SELECCION DEL RANGO DE FECHAS-END DATE
279 """
279 """
280 var_StartDay_index=self.starDateCmbBox.currentIndex()
280 var_StartDay_index=self.starDateCmbBox.currentIndex()
281 var_end_index = self.endDateCmbBox.count() - index
281 var_end_index = self.endDateCmbBox.count() - index
282 self.starDateCmbBox.clear()
282 self.starDateCmbBox.clear()
283 for i in self.variableList[:len(self.variableList) - var_end_index + 1]:
283 for i in self.variableList[:len(self.variableList) - var_end_index + 1]:
284 self.starDateCmbBox.addItem(i)
284 self.starDateCmbBox.addItem(i)
285 self.starDateCmbBox.setCurrentIndex(var_StartDay_index)
285 self.starDateCmbBox.setCurrentIndex(var_StartDay_index)
286 self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas
286 self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas
287
287
288 @pyqtSignature("int")
288 @pyqtSignature("int")
289 def on_readModeCmBox_activated(self, p0):
289 def on_readModeCmBox_activated(self, p0):
290 """
290 """
291 Slot documentation goes here.
291 Slot documentation goes here.
292 """
292 """
293 if p0==0:
293 if p0==0:
294 self.online=0
294 self.online=0
295 elif p0==1:
295 elif p0==1:
296 self.online=1
296 self.online=1
297
297
298 @pyqtSignature("")
298 @pyqtSignature("")
299 def on_dataOkBtn_clicked(self):
299 def on_dataOkBtn_clicked(self):
300 """
300 """
301 Slot documentation goes here.
301 Slot documentation goes here.
302 """
302 """
303 print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online"
303 print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online"
304
304
305 projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())]
305 projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())]
306 datatype=str(self.dataTypeCmbBox.currentText())
306 datatype=str(self.dataTypeCmbBox.currentText())
307 path=str(self.dataPathTxt.text())
307 path=str(self.dataPathTxt.text())
308 online=int(self.online)
308 online=int(self.online)
309 starDate=str(self.starDateCmbBox.currentText())
309 starDate=str(self.starDateCmbBox.currentText())
310 endDate=str(self.endDateCmbBox.currentText())
310 endDate=str(self.endDateCmbBox.currentText())
311
311
312
312
313 self.readUnitConfObj = projectObj.addReadUnit(datatype=datatype,
313 self.readUnitConfObj = projectObj.addReadUnit(datatype=datatype,
314 path=path,
314 path=path,
315 startDate=starDate,
315 startDate=starDate,
316 endDate=endDate,
316 endDate=endDate,
317 startTime='06:10:00',
317 startTime='06:10:00',
318 endTime='23:59:59',
318 endTime='23:59:59',
319 online=online)
319 online=online)
320
320
321 self.readUnitConfObjList.append(self.readUnitConfObj)
321 self.readUnitConfObjList.append(self.readUnitConfObj)
322
322
323 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online
323 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online
324
324
325
325
326 self.model_2=treeModel()
326 self.model_2=treeModel()
327
327
328 self.model_2.setParams(name=projectObj.name+str(projectObj.id),
328 self.model_2.setParams(name=projectObj.name+str(projectObj.id),
329 directorio=path,
329 directorio=path,
330 workspace="C:\\WorkspaceGUI",
330 workspace="C:\\WorkspaceGUI",
331 remode=str(self.readModeCmBox.currentText()),
331 remode=str(self.readModeCmBox.currentText()),
332 dataformat=datatype,
332 dataformat=datatype,
333 date=str(starDate)+"-"+str(endDate),
333 date=str(starDate)+"-"+str(endDate),
334 initTime='06:10:00',
334 initTime='06:10:00',
335 endTime='23:59:59',
335 endTime='23:59:59',
336 timezone="Local" ,
336 timezone="Local" ,
337 Summary="test de prueba")
337 Summary="test de prueba")
338 self.model_2.arbol()
338 self.model_2.arbol()
339 self.treeView_2.setModel(self.model_2)
339 self.treeView_2.setModel(self.model_2)
340 self.treeView_2.expandAll()
340 self.treeView_2.expandAll()
341
341
342
342
343 @pyqtSignature("")
343 @pyqtSignature("")
344 def on_addUnitProces_clicked(self):
344 def on_addUnitProces_clicked(self):
345 """
345 """
346 Slot documentation goes here.
346 Slot documentation goes here.
347 """
347 """
348 # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
348 # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
349 # self.procUnitConfObj0 = self.projectObj.addProcUnit(datatype='Voltage', inputId=self.readUnitConfObj.getId())
349 # self.procUnitConfObj0 = self.projectObj.addProcUnit(datatype='Voltage', inputId=self.readUnitConfObj.getId())
350 self.showUp()
350 self.showUp()
351
351
352 def showUp(self):
352 def showUp(self):
353
353
354 self.configUP=UnitProcess(self)
354 self.configUP=UnitProcess(self)
355 for i in self.proObjList:
355 for i in self.proObjList:
356 self.configUP.getfromWindowList.append(i)
356 self.configUP.getfromWindowList.append(i)
357 #print i
357 #print i
358 for i in self.upObjList:
358 for i in self.upObjList:
359 self.configUP.getfromWindowList.append(i)
359 self.configUP.getfromWindowList.append(i)
360 self.configUP.loadTotalList()
360 self.configUP.loadTotalList()
361 self.configUP.show()
361 self.configUP.show()
362 self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
362 self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
363 self.configUP.closed.connect(self.createUP)
363 self.configUP.closed.connect(self.createUP)
364
364
365 def reciveUPparameters(self):
365 def reciveUPparameters(self):
366
366
367 self.uporProObjRecover,self.upType=self.configUP.almacena()
367 self.uporProObjRecover,self.upType=self.configUP.almacena()
368
368
369
369
370 def createUP(self):
370 def createUP(self):
371 print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
371 print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
372 projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())]
372 projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())]
373
373
374 datatype=str(self.upType)
374 datatype=str(self.upType)
375 uporprojectObj=self.uporProObjRecover
375 uporprojectObj=self.uporProObjRecover
376 #+++++++++++LET FLY+++++++++++#
376 #+++++++++++LET FLY+++++++++++#
377 if uporprojectObj.getElementName()=='ProcUnit':
377 if uporprojectObj.getElementName()=='ProcUnit':
378 inputId=uporprojectObj.getId()
378 inputId=uporprojectObj.getId()
379 elif uporprojectObj.getElementName()=='Project':
379 elif uporprojectObj.getElementName()=='Project':
380 inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId()
380 inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId()
381
381
382
382
383 self.procUnitConfObj1 = projectObj.addProcUnit(datatype=datatype, inputId=inputId)
383 self.procUnitConfObj1 = projectObj.addProcUnit(datatype=datatype, inputId=inputId)
384 self.upObjList.append(self.procUnitConfObj1)
384 self.upObjList.append(self.procUnitConfObj1)
385 print inputId
385 print inputId
386 print self.procUnitConfObj1.getId()
386 print self.procUnitConfObj1.getId()
387 self.parentItem=uporprojectObj.arbol
387 self.parentItem=uporprojectObj.arbol
388 self.numbertree=int(self.procUnitConfObj1.getId())-1
388 self.numbertree=int(self.procUnitConfObj1.getId())-1
389 self.procUnitConfObj1.arbol=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree))
389 self.procUnitConfObj1.arbol=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree))
390 self.parentItem.appendRow(self.procUnitConfObj1.arbol)
390 self.parentItem.appendRow(self.procUnitConfObj1.arbol)
391 self.parentItem=self.procUnitConfObj1.arbol
391 self.parentItem=self.procUnitConfObj1.arbol
392 self.loadUp()
392 self.loadUp()
393 self.treeView.expandAll()
393 self.treeView.expandAll()
394
394
395 def loadUp(self):
395 def loadUp(self):
396 self.addOpUpselec.clear()
396 self.addOpUpselec.clear()
397 self.addOpSpecUpselec.clear()
397 self.addOpSpecUpselec.clear()
398 for i in self.upObjList:
398 for i in self.upObjList:
399 if i.datatype=='Voltage':
399 if i.datatype=='Voltage':
400 self.upObjVolList.append(i)
400 self.upObjVolList.append(i)
401 name=i.getElementName()
401 name=i.getElementName()
402 id=int(i.id)-1
402 id=int(i.id)-1
403 self.addOpUpselec.addItem(name+str(id))
403 self.addOpUpselec.addItem(name+str(id))
404 if i.datatype=='Spectra':
404 if i.datatype=='Spectra':
405 self.upobjSpecList.append(i)
405 self.upobjSpecList.append(i)
406 name=i.getElementName()
406 name=i.getElementName()
407 id=int(i.id)-1
407 id=int(i.id)-1
408 self.addOpSpecUpselec.addItem(name+str(id))
408 self.addOpSpecUpselec.addItem(name+str(id))
409
409
410 self.resetopVolt()
410 self.resetopVolt()
411 self.resetopSpec()
411 self.resetopSpec()
412
412
413
413
414 @pyqtSignature("int")
414 @pyqtSignature("int")
415 def on_selecChannelopVolCEB_stateChanged(self, p0):
415 def on_selecChannelopVolCEB_stateChanged(self, p0):
416 """
416 """
417 Slot documentation goes here.
417 Slot documentation goes here.
418 """
418 """
419 if p0==2:
419 if p0==2:
420 self.numberChannelopVol.setEnabled(True)
420 self.numberChannelopVol.setEnabled(True)
421 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
421 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
422 opObj10=upProcessSelect.addOperation(name='selectChannels')
422 opObj10=upProcessSelect.addOperation(name='selectChannels')
423 print opObj10.id
423 print opObj10.id
424 self.operObjList.append(opObj10)
424 self.operObjList.append(opObj10)
425 print " Ingresa seleccion de Canales"
425 print " Ingresa seleccion de Canales"
426 if p0==0:
426 if p0==0:
427 print " deshabilitado"
427 print " deshabilitado"
428
428
429 @pyqtSignature("int")
429 @pyqtSignature("int")
430 def on_selecHeighopVolCEB_stateChanged(self, p0):
430 def on_selecHeighopVolCEB_stateChanged(self, p0):
431 """
431 """
432 Slot documentation goes here.
432 Slot documentation goes here.
433 """
433 """
434 if p0==2:
434 if p0==2:
435 self.lineHeighProfileTxtopVol.setEnabled(True)
435 self.lineHeighProfileTxtopVol.setEnabled(True)
436 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
436 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
437 opObj10=upProcessSelect.addOperation(name='selectHeights')
437 opObj10=upProcessSelect.addOperation(name='selectHeights')
438 print opObj10.id
438 print opObj10.id
439 self.operObjList.append(opObj10)
439 self.operObjList.append(opObj10)
440 print " Select Type of Profile"
440 print " Select Type of Profile"
441 if p0==0:
441 if p0==0:
442 print " deshabilitado"
442 print " deshabilitado"
443
443
444
444
445 @pyqtSignature("int")
445 @pyqtSignature("int")
446 def on_profileSelecopVolCEB_stateChanged(self, p0):
446 def on_profileSelecopVolCEB_stateChanged(self, p0):
447 """
447 """
448 Slot documentation goes here.
448 Slot documentation goes here.
449 """
449 """
450 if p0==2:
450 if p0==2:
451 self.lineProfileSelecopVolCEB.setEnabled(True)
451 self.lineProfileSelecopVolCEB.setEnabled(True)
452 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
452 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
453 opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other')
453 opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other')
454 print opObj10.id
454 print opObj10.id
455 self.operObjList.append(opObj10)
455 self.operObjList.append(opObj10)
456 print " Select Type of Profile"
456 print " Select Type of Profile"
457 if p0==0:
457 if p0==0:
458 print " deshabilitado"
458 print " deshabilitado"
459
459
460
460
461 @pyqtSignature("int")
461 @pyqtSignature("int")
462 def on_coherentIntegrationCEB_stateChanged(self, p0):
462 def on_coherentIntegrationCEB_stateChanged(self, p0):
463 """
463 """
464 Slot documentation goes here.
464 Slot documentation goes here.
465 """
465 """
466 if p0==2:
466 if p0==2:
467 self.numberIntegration.setEnabled(True)
467 self.numberIntegration.setEnabled(True)
468 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
468 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
469 opObj10=upProcessSelect.addOperation(name='CohInt', optype='other')
469 opObj10=upProcessSelect.addOperation(name='CohInt', optype='other')
470 print opObj10.id
470 print opObj10.id
471 self.operObjList.append(opObj10)
471 self.operObjList.append(opObj10)
472 print "Choose number of Cohint"
472 print "Choose number of Cohint"
473 if p0==0:
473 if p0==0:
474 print " deshabilitado"
474 print " deshabilitado"
475 self.numberChannelopVol.setEnabled(False)
475 self.numberChannelopVol.setEnabled(False)
476
476
477 def resetopVolt(self):
477 def resetopVolt(self):
478 self.selecChannelopVolCEB.setChecked(False)
478 self.selecChannelopVolCEB.setChecked(False)
479 self.selecHeighopVolCEB.setChecked(False)
479 self.selecHeighopVolCEB.setChecked(False)
480 self.coherentIntegrationCEB.setChecked(False)
480 self.coherentIntegrationCEB.setChecked(False)
481 self.profileSelecopVolCEB.setChecked(False)
481 self.profileSelecopVolCEB.setChecked(False)
482 #self.selecChannelopVolCEB.setEnabled(False)
482 #self.selecChannelopVolCEB.setEnabled(False)
483 self.lineHeighProfileTxtopVol.clear()
483 self.lineHeighProfileTxtopVol.clear()
484 self.lineProfileSelecopVolCEB.clear()
484 self.lineProfileSelecopVolCEB.clear()
485 self.numberChannelopVol.clear()
485 self.numberChannelopVol.clear()
486 self.numberIntegration.clear()
486 self.numberIntegration.clear()
487
487
488
488
489 @pyqtSignature("")
489 @pyqtSignature("")
490 def on_dataopVolOkBtn_clicked(self):
490 def on_dataopVolOkBtn_clicked(self):
491 """
491 """
492 Slot documentation goes here.
492 Slot documentation goes here.
493 """
493 """
494 if self.selecChannelopVolCEB.isChecked():
494 if self.selecChannelopVolCEB.isChecked():
495 for i in self.operObjList:
495 for i in self.operObjList:
496 if i.name=='selectChannels':
496 if i.name=='selectChannels':
497 value=self.numberChannelopVol.text()
497 value=self.numberChannelopVol.text()
498 i.addParameter(name='channelList', value=value, format='intlist')
498 i.addParameter(name='channelList', value=value, format='intlist')
499
499
500
500
501 print "channel"
501 print "channel"
502
502
503 if self.selecHeighopVolCEB.isChecked():
503 if self.selecHeighopVolCEB.isChecked():
504 for i in self.operObjList:
504 for i in self.operObjList:
505 if i.name=='selectHeights' :
505 if i.name=='selectHeights' :
506 value=self.lineHeighProfileTxtopVol.text()
506 value=self.lineHeighProfileTxtopVol.text()
507 valueList=value.split(',')
507 valueList=value.split(',')
508 i.addParameter(name='minHei', value=valueList[0], format='float')
508 i.addParameter(name='minHei', value=valueList[0], format='float')
509 i.addParameter(name='maxHei', value=valueList[1], format='float')
509 i.addParameter(name='maxHei', value=valueList[1], format='float')
510
510
511 print "height"
511 print "height"
512
512
513
513
514 if self.selecHeighopVolCEB.isChecked():
514 if self.selecHeighopVolCEB.isChecked():
515 for i in self.operObjList:
515 for i in self.operObjList:
516 if i.name=='ProfileSelector' :
516 if i.name=='ProfileSelector' :
517 value=self.lineProfileSelecopVolCEB.text()
517 value=self.lineProfileSelecopVolCEB.text()
518 i.addParameter(name='ProfileSelector', value=value, format='intlist')
518 i.addParameter(name='ProfileSelector', value=value, format='intlist')
519
519
520
520
521
521
522 if self.coherentIntegrationCEB.isChecked():
522 if self.coherentIntegrationCEB.isChecked():
523 for i in self.operObjList:
523 for i in self.operObjList:
524 if i.name=='CohInt':
524 if i.name=='CohInt':
525 value=self.numberIntegration.text()
525 value=self.numberIntegration.text()
526 i.addParameter(name='n', value=value, format='int')
526 i.addParameter(name='n', value=value, format='int')
527
527
528
528
529 @pyqtSignature("int")
529 @pyqtSignature("int")
530 def on_nFFTPointOpSpecCEB_stateChanged(self, p0):
530 def on_nFFTPointOpSpecCEB_stateChanged(self, p0):
531 """
531 """
532 Slot documentation goes here.
532 Slot documentation goes here.
533 """
533 """
534 if p0==2:
534 if p0==2:
535 self.valuenFFTPointOpSpec.setEnabled(True)
535 self.valuenFFTPointOpSpec.setEnabled(True)
536 print " nFFTPoint"
536 print " nFFTPoint"
537 if p0==0:
537 if p0==0:
538 print " deshabilitado"
538 print " deshabilitado"
539
539
540
540
541 def resetopSpec(self):
541 def resetopSpec(self):
542 self.nFFTPointOpSpecCEB.setChecked(False)
542 self.nFFTPointOpSpecCEB.setChecked(False)
543
543
544 self.valuenFFTPointOpSpec.clear()
544 self.valuenFFTPointOpSpec.clear()
545
545
546
546
547 @pyqtSignature("")
547 @pyqtSignature("")
548 def on_dataopSpecOkBtn_clicked(self):
548 def on_dataopSpecOkBtn_clicked(self):
549 """
549 """
550 Slot documentation goes here.
550 Slot documentation goes here.
551 """
551 """
552 print "Añadimos operaciones Spectra,nchannels,value,format"
552 print "Añadimos operaciones Spectra,nchannels,value,format"
553 if self.nFFTPointOpSpecCEB.isChecked():
553 if self.nFFTPointOpSpecCEB.isChecked():
554 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
554 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
555 value=self.valuenFFTPointOpSpec.text()
555 value=self.valuenFFTPointOpSpec.text()
556 upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int')
556 upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int')
557
557
558 @pyqtSignature("int")
558 @pyqtSignature("int")
559 def on_SpectraPlotGraphCEB_stateChanged(self, p0):
559 def on_SpectraPlotGraphCEB_stateChanged(self, p0):
560 """
560 """
561 Slot documentation goes here.
561 Slot documentation goes here.
562 """
562 """
563 if p0==2:
563 if p0==2:
564 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
564 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
565 opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other')
565 opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other')
566 print opObj10.id
566 print opObj10.id
567 self.operObjList.append(opObj10)
567 self.operObjList.append(opObj10)
568
568
569 if p0==0:
569 if p0==0:
570 print " deshabilitado"
570 print " deshabilitado"
571
571
572 @pyqtSignature("int")
572 @pyqtSignature("int")
573 def on_CrossSpectraPlotGraphceb_stateChanged(self, p0):
573 def on_CrossSpectraPlotGraphceb_stateChanged(self, p0):
574 """
574 """
575 Slot documentation goes here.
575 Slot documentation goes here.
576 """
576 """
577 if p0==2:
577 if p0==2:
578 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
578 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
579 opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other')
579 opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other')
580 print opObj10.id
580 print opObj10.id
581 self.operObjList.append(opObj10)
581 self.operObjList.append(opObj10)
582 if p0==0:
582 if p0==0:
583 print " deshabilitado"
583 print " deshabilitado"
584
584
585 @pyqtSignature("int")
585 @pyqtSignature("int")
586 def on_RTIPlotGraphCEB_stateChanged(self, p0):
586 def on_RTIPlotGraphCEB_stateChanged(self, p0):
587 """
587 """
588 Slot documentation goes here.
588 Slot documentation goes here.
589 """
589 """
590 if p0==2:
590 if p0==2:
591 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
591 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
592 opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other')
592 opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other')
593 print opObj10.id
593 print opObj10.id
594 self.operObjList.append(opObj10)
594 self.operObjList.append(opObj10)
595 if p0==0:
595 if p0==0:
596 print " deshabilitado"
596 print " deshabilitado"
597
597
598
598
599 def resetgraphSpec(self):
599 def resetgraphSpec(self):
600 self.SpectraPlotGraphCEB.setChecked(False)
600 self.SpectraPlotGraphCEB.setChecked(False)
601 self.CrossSpectraPlotGraphceb.setChecked(False)
601 self.CrossSpectraPlotGraphceb.setChecked(False)
602 self.RTIPlotGraphCEB.setChecked(False)
602 self.RTIPlotGraphCEB.setChecked(False)
603
603
604 @pyqtSignature("")
604 @pyqtSignature("")
605 def on_dataGraphSpecOkBtn_clicked(self):
605 def on_dataGraphSpecOkBtn_clicked(self):
606 """
606 """
607 Slot documentation goes here.
607 Slot documentation goes here.
608 """
608 """
609 print "Graficar Spec op"
609 print "Graficar Spec op"
610 if self.SpectraPlotGraphCEB.isChecked():
610 if self.SpectraPlotGraphCEB.isChecked():
611 for i in self.operObjList:
611 for i in self.operObjList:
612 if i.name=='SpectraPlot':
612 if i.name=='SpectraPlot':
613 i.addParameter(name='idfigure', value='1', format='int')
613 i.addParameter(name='idfigure', value='1', format='int')
614 i.addParameter(name='wintitle', value='SpectraPlot0', format='str')
614 i.addParameter(name='wintitle', value='SpectraPlot0', format='str')
615 i.addParameter(name='zmin', value='40', format='int')
615 i.addParameter(name='zmin', value='40', format='int')
616 i.addParameter(name='zmax', value='90', format='int')
616 i.addParameter(name='zmax', value='90', format='int')
617 i.addParameter(name='showprofile', value='1', format='int')
617 i.addParameter(name='showprofile', value='1', format='int')
618
618
619 if self.CrossSpectraPlotGraphceb.isChecked():
619 if self.CrossSpectraPlotGraphceb.isChecked():
620 for i in self.operObjList:
620 for i in self.operObjList:
621 if i.name=='CrossSpectraPlot' :
621 if i.name=='CrossSpectraPlot' :
622 i.addParameter(name='idfigure', value='2', format='int')
622 i.addParameter(name='idfigure', value='2', format='int')
623 i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str')
623 i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str')
624 i.addParameter(name='zmin', value='40', format='int')
624 i.addParameter(name='zmin', value='40', format='int')
625 i.addParameter(name='zmax', value='90', format='int')
625 i.addParameter(name='zmax', value='90', format='int')
626
626
627 if self.RTIPlotGraphCEB.isChecked():
627 if self.RTIPlotGraphCEB.isChecked():
628 for i in self.operObjList:
628 for i in self.operObjList:
629 if i.name=='RTIPlot':
629 if i.name=='RTIPlot':
630 i.addParameter(name='n', value='2', format='int')
630 i.addParameter(name='n', value='2', format='int')
631 i.addParameter(name='overlapping', value='1', format='int')
631 i.addParameter(name='overlapping', value='1', format='int')
632
632
633 @pyqtSignature("")
633 @pyqtSignature("")
634 def on_actionguardarObj_triggered(self):
634 def on_actionguardarObj_triggered(self):
635 """
635 """
636 GUARDAR EL ARCHIVO DE CONFIGURACION XML
636 GUARDAR EL ARCHIVO DE CONFIGURACION XML
637 """
637 """
638 if self.idp==1:
638 if self.idp==1:
639 self.valuep=1
639 self.valuep=1
640
640
641 print "Escribiendo el archivo XML"
641 print "Escribiendo el archivo XML"
642 filename="C:\\WorkspaceGUI\\CONFIG"+str(self.valuep)+".xml"
642 filename="C:\\WorkspaceGUI\\CONFIG"+str(self.valuep)+".xml"
643 self.projectObj=self.proObjList[int(self.valuep)-1]
643 self.projectObj=self.proObjList[int(self.valuep)-1]
644 self.projectObj.writeXml(filename)
644 self.projectObj.writeXml(filename)
645
645
646
646
647 class BasicWindow(MainWindow):
647 class BasicWindow(MainWindow):
648
648
649 def __init__(self):
649 def __init__(self):
650 pass
650 pass
651
651
652 class AdvancedWindow(MainWindow):
652 class AdvancedWindow(MainWindow):
653
653
654 def __init__(self):
654 def __init__(self):
655 pass
655 pass
656
656
657
657
658
658
659 class ProjectWindow(QMainWindow, Ui_window):
659 class ProjectWindow(QMainWindow, Ui_window):
660 """
660 """
661 Class documentation goes here.
661 Class documentation goes here.
662 """
662 """
663 closed = pyqtSignal()
663 closed = pyqtSignal()
664
664
665 create = False
665 create = False
666 name = None
666 name = None
667 description = None
667 description = None
668
668
669
669
670
670
671 def __init__(self, parent = None):
671 def __init__(self, parent = None):
672 """
672 """
673 Constructor
673 Constructor
674 """
674 """
675 QMainWindow.__init__(self, parent)
675 QMainWindow.__init__(self, parent)
676 self.setupUi(self)
676 self.setupUi(self)
677 self.name=None
677 self.name=None
678
678
679 self.proyectNameLine.setText('My_name_is...')
679 self.proyectNameLine.setText('My_name_is...')
680 self.descriptionTextEdit.setText('Write a description...')
680 self.descriptionTextEdit.setText('Write a description...')
681
681
682
682
683 @pyqtSignature("")
683 @pyqtSignature("")
684 def on_cancelButton_clicked(self):
684 def on_cancelButton_clicked(self):
685 """
685 """
686 Slot documentation goes here.
686 Slot documentation goes here.
687 """
687 """
688 # TODO: not implemented yet
688 # TODO: not implemented yet
689 #raise NotImplementedError
689 #raise NotImplementedError
690 self.create = False
690 self.create = False
691 self.close()
691 self.close()
692
692
693 @pyqtSignature("")
693 @pyqtSignature("")
694 def on_okButton_clicked(self):
694 def on_okButton_clicked(self):
695 """
695 """
696 Slot documentation goes here.
696 Slot documentation goes here.
697 """
697 """
698 #self.almacena()
698 #self.almacena()
699 self.create = True
699 self.create = True
700 self.name = str(self.proyectNameLine.text())
700 self.name = str(self.proyectNameLine.text())
701 self.description = str(self.descriptionTextEdit.toPlainText())
701 self.description = str(self.descriptionTextEdit.toPlainText())
702
702
703 self.close()
703 self.close()
704
704
705 # @pyqtSignature("")
705 # @pyqtSignature("")
706 # def on_saveButton_clicked(self):
706 # def on_saveButton_clicked(self):
707 # """
707 # """
708 # Slot documentation goes here.
708 # Slot documentation goes here.
709 # """
709 # """
710 # self.almacena()
710 # self.almacena()
711 ## self.close()
711 ## self.close()
712 #
712 #
713 # def almacena(self):
713 # def almacena(self):
714 # #print str(self.proyectNameLine.text())
714 # #print str(self.proyectNameLine.text())
715 # self.nameproject=str(self.proyectNameLine.text())
715 # self.nameproject=str(self.proyectNameLine.text())
716 # self.description=str(self.descriptionTextEdit.toPlainText())
716 # self.description=str(self.descriptionTextEdit.toPlainText())
717 # return self.nameproject,self.description
717 # return self.nameproject,self.description
718 #
718 #
719 def closeEvent(self, event):
719 def closeEvent(self, event):
720 self.closed.emit()
720 self.closed.emit()
721 event.accept()
721 event.accept()
722
722
723
723
724 class UnitProcess(QMainWindow, Ui_UnitProcess):
724 class UnitProcess(QMainWindow, Ui_UnitProcess):
725 """
725 """
726 Class documentation goes here.
726 Class documentation goes here.
727 """
727 """
728 closed=pyqtSignal()
728 closed=pyqtSignal()
729 def __init__(self, parent = None):
729 def __init__(self, parent = None):
730 """
730 """
731 Constructor
731 Constructor
732 """
732 """
733 QMainWindow.__init__(self, parent)
733 QMainWindow.__init__(self, parent)
734 self.setupUi(self)
734 self.setupUi(self)
735 self.getFromWindow=None
735 self.getFromWindow=None
736 self.getfromWindowList=[]
736 self.getfromWindowList=[]
737
737
738 self.listUP=None
738 self.listUP=None
739
739
740 def loadTotalList(self):
740 def loadTotalList(self):
741 self.comboInputBox.clear()
741 self.comboInputBox.clear()
742 for i in self.getfromWindowList:
742 for i in self.getfromWindowList:
743 name=i.getElementName()
743 name=i.getElementName()
744 id= i.id
744 id= i.id
745 if i.getElementName()=='ProcUnit':
745 if i.getElementName()=='ProcUnit':
746 id=int(i.id)-1
746 id=int(i.id)-1
747 self.comboInputBox.addItem(str(name)+str(id))
747 self.comboInputBox.addItem(str(name)+str(id))
748
748
749 @pyqtSignature("QString")
749 @pyqtSignature("QString")
750 def on_comboInputBox_activated(self, p0):
750 def on_comboInputBox_activated(self, p0):
751 """
751 """
752 Slot documentation goes here.
752 Slot documentation goes here.
753 """
753 """
754
754
755 # TODO: not implemented yet
755 # TODO: not implemented yet
756 #raise NotImplementedError
756 #raise NotImplementedError
757
757
758 @pyqtSignature("QString")
758 @pyqtSignature("QString")
759 def on_comboTypeBox_activated(self, p0):
759 def on_comboTypeBox_activated(self, p0):
760 """
760 """
761 Slot documentation goes here.
761 Slot documentation goes here.
762 """
762 """
763 # TODO: not implemented yet
763 # TODO: not implemented yet
764 #raise NotImplementedError
764 #raise NotImplementedError
765
765
766 @pyqtSignature("")
766 @pyqtSignature("")
767 def on_unitPokbut_clicked(self):
767 def on_unitPokbut_clicked(self):
768 """
768 """
769 Slot documentation goes here.
769 Slot documentation goes here.
770 """
770 """
771 self.close()
771 self.close()
772
772
773 @pyqtSignature("")
773 @pyqtSignature("")
774 def on_unitPsavebut_clicked(self):
774 def on_unitPsavebut_clicked(self):
775 """
775 """
776 Slot documentation goes here.
776 Slot documentation goes here.
777 """
777 """
778
778
779 print "alex"
779 print "alex"
780 self.almacena()
780 self.almacena()
781
781
782 @pyqtSignature("")
782 @pyqtSignature("")
783 def on_unitPcancelbut_clicked(self):
783 def on_unitPcancelbut_clicked(self):
784 """
784 """
785 Slot documentation goes here.
785 Slot documentation goes here.
786 """
786 """
787 # TODO: not implemented yet
787 # TODO: not implemented yet
788 #raise NotImplementedError
788 #raise NotImplementedError
789 self.hide()
789 self.hide()
790
790
791 def almacena(self):
791 def almacena(self):
792 self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())]
792 self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())]
793 #self.nameofUP= str(self.nameUptxt.text())
793 #self.nameofUP= str(self.nameUptxt.text())
794 self.typeofUP= str(self.comboTypeBox.currentText())
794 self.typeofUP= str(self.comboTypeBox.currentText())
795 return self.getFromWindow,self.typeofUP
795 return self.getFromWindow,self.typeofUP
796
796
797 def closeEvent(self, event):
797 def closeEvent(self, event):
798 self.closed.emit()
798 self.closed.emit()
799 event.accept()
799 event.accept()
800
800
801
801
802
802
803
803
804
804
805
805
806
806
807 No newline at end of file
807
@@ -1,65 +1,67
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 import os
2 import os
3 from os.path import expanduser
4
3 from PyQt4.QtGui import QDialog
5 from PyQt4.QtGui import QDialog
4 from PyQt4.QtCore import pyqtSignature
6 from PyQt4.QtCore import pyqtSignature
5 from PyQt4.QtCore import pyqtSignal
7 from PyQt4.QtCore import pyqtSignal
6 from PyQt4 import QtGui, QtCore
8 from PyQt4 import QtGui, QtCore
7 from viewer.ui_workspace import Ui_Workspace
9
8 from os.path import expanduser
10 from schainpy.gui.viewer.ui_workspace import Ui_Workspace
9
11
10 class Workspace(QDialog, Ui_Workspace):
12 class Workspace(QDialog, Ui_Workspace):
11 """
13 """
12 Class documentation goes here.
14 Class documentation goes here.
13 """
15 """
14
16
15 def __init__(self, parent = None):
17 def __init__(self, parent = None):
16 """
18 """
17 Constructor
19 Constructor
18 """
20 """
19 QDialog.__init__(self, parent)
21 QDialog.__init__(self, parent)
20 self.dirList=[]
22 self.dirList=[]
21 self.setupUi(self)
23 self.setupUi(self)
22 self.setWindowTitle("ROJ-Signal Chain")
24 self.setWindowTitle("ROJ-Signal Chain")
23 self.setWindowIcon(QtGui.QIcon("figure/adn.jpg"))
25 self.setWindowIcon(QtGui.QIcon("schainpy/gui/figure/adn.jpg"))
24 #*####### DIRECTORIO DE TRABAJO #########*#
26 #*####### DIRECTORIO DE TRABAJO #########*#
25 #self.dirCmbBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "C:\WorkSpaceGui", None, QtGui.QApplication.UnicodeUTF8))
27 #self.dirCmbBox.setItemText(0, QtGui.QApplication.translate("MainWindow", "C:\WorkSpaceGui", None, QtGui.QApplication.UnicodeUTF8))
26 home=expanduser("~")
28 home=expanduser("~")
27 self.dir=os.path.join(home,'schain_workspace')
29 self.dir=os.path.join(home,'schain_workspace')
28 if not os.path.exists(self.dir):
30 if not os.path.exists(self.dir):
29 os.makedirs(self.dir)
31 os.makedirs(self.dir)
30 self.dirComBox.addItem(self.dir)
32 self.dirComBox.addItem(self.dir)
31 self.i=0
33 self.i=0
32
34
33
35
34 @pyqtSignature("")
36 @pyqtSignature("")
35 def on_dirToolPath_clicked(self):
37 def on_dirToolPath_clicked(self):
36 """
38 """
37 Slot documentation goes here.
39 Slot documentation goes here.
38 """
40 """
39 self.i +=1
41 self.i +=1
40 self.dirBrowse = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
42 self.dirBrowse = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
41 self.dirComBox.addItem(self.dirBrowse)
43 self.dirComBox.addItem(self.dirBrowse)
42 self.dirComBox.setCurrentIndex(self.i)
44 self.dirComBox.setCurrentIndex(self.i)
43
45
44
46
45
47
46 @pyqtSignature("")
48 @pyqtSignature("")
47 def on_dirOkBtn_clicked(self):
49 def on_dirOkBtn_clicked(self):
48 """
50 """
49 VISTA DE INTERFAZ GRÁFICA
51 VISTA DE INTERFAZ GRÁFICA
50 """
52 """
51 self.accept()
53 self.accept()
52 # self.close()
54 # self.close()
53 #
55 #
54 @pyqtSignature("")
56 @pyqtSignature("")
55 def on_dirCancelBtn_clicked(self):
57 def on_dirCancelBtn_clicked(self):
56 """
58 """
57 Cerrar
59 Cerrar
58 """
60 """
59 self.close()
61 self.close()
60
62
61
63
62
64
63
65
64
66
65 No newline at end of file
67
@@ -1,4 +1,5
1 import ui_initwindow
1 import ui_initwindow
2 import ui_workspace
2 import ui_workspace
3 import ui_mainwindow
3 import ui_mainwindow
4 import ui_window
4 import ui_window
5 import ui_ftp No newline at end of file
@@ -1,88 +1,88
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Form implementation generated from reading ui file '/home/roj-idl71/SignalChain/initwindowv2.ui'
3 # Form implementation generated from reading ui file '/home/roj-idl71/SignalChain/initwindowv2.ui'
4 #
4 #
5 # Created: Wed Mar 6 15:32:39 2013
5 # Created: Wed Mar 6 15:32:39 2013
6 # by: PyQt4 UI code generator 4.8.6
6 # by: PyQt4 UI code generator 4.8.6
7 #
7 #
8 # WARNING! All changes made in this file will be lost!
8 # WARNING! All changes made in this file will be lost!
9
9
10 from PyQt4 import QtCore, QtGui
10 from PyQt4 import QtCore, QtGui
11
11
12 try:
12 try:
13 _fromUtf8 = QtCore.QString.fromUtf8
13 _fromUtf8 = QtCore.QString.fromUtf8
14 except AttributeError:
14 except AttributeError:
15 _fromUtf8 = lambda s: s
15 _fromUtf8 = lambda s: s
16
16
17 class Ui_InitWindow(object):
17 class Ui_InitWindow(object):
18 def setupUi(self, Dialog):
18 def setupUi(self, Dialog):
19 Dialog.setObjectName(_fromUtf8("Dialog"))
19 Dialog.setObjectName(_fromUtf8("Dialog"))
20 Dialog.resize(652, 496)
20 Dialog.resize(652, 496)
21 Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
21 Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
22 self.gridLayout = QtGui.QGridLayout(Dialog)
22 self.gridLayout = QtGui.QGridLayout(Dialog)
23 self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
23 self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
24 self.verticalLayout_3 = QtGui.QVBoxLayout()
24 self.verticalLayout_3 = QtGui.QVBoxLayout()
25 self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
25 self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
26 self.verticalLayout_4 = QtGui.QVBoxLayout()
26 self.verticalLayout_4 = QtGui.QVBoxLayout()
27 self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
27 self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
28 self.label_3 = QtGui.QLabel(Dialog)
28 self.label_3 = QtGui.QLabel(Dialog)
29 font = QtGui.QFont()
29 font = QtGui.QFont()
30 font.setFamily(_fromUtf8("Cambria"))
30 font.setFamily(_fromUtf8("Cambria"))
31 font.setPointSize(22)
31 font.setPointSize(22)
32 font.setBold(False)
32 font.setBold(False)
33 font.setWeight(50)
33 font.setWeight(50)
34 self.label_3.setFont(font)
34 self.label_3.setFont(font)
35 self.label_3.setText(QtGui.QApplication.translate("Dialog", "Signal Chain - Ver. 1.0", None, QtGui.QApplication.UnicodeUTF8))
35 self.label_3.setText(QtGui.QApplication.translate("Dialog", "Signal Chain - Ver. 1.0", None, QtGui.QApplication.UnicodeUTF8))
36 self.label_3.setObjectName(_fromUtf8("label_3"))
36 self.label_3.setObjectName(_fromUtf8("label_3"))
37 self.verticalLayout_4.addWidget(self.label_3)
37 self.verticalLayout_4.addWidget(self.label_3)
38 self.line_2 = QtGui.QFrame(Dialog)
38 self.line_2 = QtGui.QFrame(Dialog)
39 self.line_2.setFrameShape(QtGui.QFrame.HLine)
39 self.line_2.setFrameShape(QtGui.QFrame.HLine)
40 self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
40 self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
41 self.line_2.setObjectName(_fromUtf8("line_2"))
41 self.line_2.setObjectName(_fromUtf8("line_2"))
42 self.verticalLayout_4.addWidget(self.line_2)
42 self.verticalLayout_4.addWidget(self.line_2)
43 self.label_4 = QtGui.QLabel(Dialog)
43 self.label_4 = QtGui.QLabel(Dialog)
44 self.label_4.setText(_fromUtf8(""))
44 self.label_4.setText(_fromUtf8(""))
45 self.label_4.setPixmap(QtGui.QPixmap(_fromUtf8("figure/w.jpg")))
45 self.label_4.setPixmap(QtGui.QPixmap(_fromUtf8("schainpy/gui/figure/w.jpg")))
46 self.label_4.setScaledContents(True)
46 self.label_4.setScaledContents(True)
47 self.label_4.setObjectName(_fromUtf8("label_4"))
47 self.label_4.setObjectName(_fromUtf8("label_4"))
48 self.verticalLayout_4.addWidget(self.label_4)
48 self.verticalLayout_4.addWidget(self.label_4)
49 self.verticalLayout_3.addLayout(self.verticalLayout_4)
49 self.verticalLayout_3.addLayout(self.verticalLayout_4)
50 self.horizontalLayout_3 = QtGui.QHBoxLayout()
50 self.horizontalLayout_3 = QtGui.QHBoxLayout()
51 self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
51 self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
52 self.horizontalLayout_4 = QtGui.QHBoxLayout()
52 self.horizontalLayout_4 = QtGui.QHBoxLayout()
53 self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
53 self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
54 spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
54 spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
55 self.horizontalLayout_4.addItem(spacerItem)
55 self.horizontalLayout_4.addItem(spacerItem)
56 self.ExitBtn = QtGui.QPushButton(Dialog)
56 self.ExitBtn = QtGui.QPushButton(Dialog)
57 self.ExitBtn.setText(QtGui.QApplication.translate("Dialog", "Exit", None, QtGui.QApplication.UnicodeUTF8))
57 self.ExitBtn.setText(QtGui.QApplication.translate("Dialog", "Exit", None, QtGui.QApplication.UnicodeUTF8))
58 self.ExitBtn.setObjectName(_fromUtf8("ExitBtn"))
58 self.ExitBtn.setObjectName(_fromUtf8("ExitBtn"))
59 self.horizontalLayout_4.addWidget(self.ExitBtn)
59 self.horizontalLayout_4.addWidget(self.ExitBtn)
60 self.ContinueBtn = QtGui.QPushButton(Dialog)
60 self.ContinueBtn = QtGui.QPushButton(Dialog)
61 self.ContinueBtn.setText(QtGui.QApplication.translate("Dialog", "Continue", None, QtGui.QApplication.UnicodeUTF8))
61 self.ContinueBtn.setText(QtGui.QApplication.translate("Dialog", "Continue", None, QtGui.QApplication.UnicodeUTF8))
62 self.ContinueBtn.setObjectName(_fromUtf8("ContinueBtn"))
62 self.ContinueBtn.setObjectName(_fromUtf8("ContinueBtn"))
63 self.horizontalLayout_4.addWidget(self.ContinueBtn)
63 self.horizontalLayout_4.addWidget(self.ContinueBtn)
64 spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
64 spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
65 self.horizontalLayout_4.addItem(spacerItem1)
65 self.horizontalLayout_4.addItem(spacerItem1)
66 self.horizontalLayout_3.addLayout(self.horizontalLayout_4)
66 self.horizontalLayout_3.addLayout(self.horizontalLayout_4)
67 self.verticalLayout_3.addLayout(self.horizontalLayout_3)
67 self.verticalLayout_3.addLayout(self.horizontalLayout_3)
68 self.gridLayout.addLayout(self.verticalLayout_3, 0, 0, 1, 1)
68 self.gridLayout.addLayout(self.verticalLayout_3, 0, 0, 1, 1)
69
69
70 self.retranslateUi(Dialog)
70 self.retranslateUi(Dialog)
71 QtCore.QMetaObject.connectSlotsByName(Dialog)
71 QtCore.QMetaObject.connectSlotsByName(Dialog)
72
72
73 def retranslateUi(self, Dialog):
73 def retranslateUi(self, Dialog):
74 pass
74 pass
75
75
76
76
77 if __name__ == "__main__":
77 if __name__ == "__main__":
78 import sys
78 import sys
79 app = QtGui.QApplication(sys.argv)
79 app = QtGui.QApplication(sys.argv)
80 Dialog = QtGui.QDialog()
80 Dialog = QtGui.QDialog()
81 ui = Ui_InitWindow()
81 ui = Ui_InitWindow()
82 ui.setupUi(Dialog)
82 ui.setupUi(Dialog)
83 Dialog.show()
83 Dialog.show()
84 sys.exit(app.exec_())
84 sys.exit(app.exec_())
85
85
86
86
87
87
88
88
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
General Comments 0
You need to be logged in to leave comments. Login now