##// END OF EJS Templates
this fixes bug #1074 and bug #1101
José Chávez -
r1011:6db081ca94fe
parent child
Show More
@@ -0,0 +1,69
1 {
2 "configurations": [
3 {
4 "name": "Mac",
5 "includePath": [
6 "/usr/include",
7 "/usr/local/include",
8 "${workspaceRoot}"
9 ],
10 "defines": [],
11 "intelliSenseMode": "clang-x64",
12 "browse": {
13 "path": [
14 "/usr/include",
15 "/usr/local/include",
16 "${workspaceRoot}"
17 ],
18 "limitSymbolsToIncludedHeaders": true,
19 "databaseFilename": ""
20 }
21 },
22 {
23 "name": "Linux",
24 "includePath": [
25 "/usr/include/c++/4.8.4",
26 "/usr/include/x86_64-linux-gnu/c++/4.8",
27 "/usr/local/include",
28 "/usr/include",
29 "/usr/include/x86_64-linux-gnu",
30 "${workspaceRoot}"
31 ],
32 "defines": [],
33 "intelliSenseMode": "clang-x64",
34 "browse": {
35 "path": [
36 "/usr/include/c++/4.8.4",
37 "/usr/include/x86_64-linux-gnu/c++/4.8",
38 "/usr/local/include",
39 "/usr/include",
40 "/usr/include/x86_64-linux-gnu",
41 "${workspaceRoot}"
42 ],
43 "limitSymbolsToIncludedHeaders": true,
44 "databaseFilename": ""
45 }
46 },
47 {
48 "name": "Win32",
49 "includePath": [
50 "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
51 "${workspaceRoot}"
52 ],
53 "defines": [
54 "_DEBUG",
55 "UNICODE"
56 ],
57 "intelliSenseMode": "msvc-x64",
58 "browse": {
59 "path": [
60 "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
61 "${workspaceRoot}"
62 ],
63 "limitSymbolsToIncludedHeaders": true,
64 "databaseFilename": ""
65 }
66 }
67 ],
68 "version": 2
69 } No newline at end of file
@@ -0,0 +1,7
1 {
2 "files.associations": {
3 "arrayobject.h": "c",
4 "ndarrayobject.h": "c",
5 "complex": "c"
6 }
7 } No newline at end of file
@@ -1,13 +1,108
1 .project
1 # Byte-compiled / optimized / DLL files
2 .pydevproject
2 __pycache__/
3 build/
3 *.py[cod]
4 *.pyc
4 *$py.class
5
6 # C extensions
5 *.so
7 *.so
8
9 # Distribution / packaging
10 .Python
11 env/
12 build/
13 develop-eggs/
14 dist/
15 downloads/
16 eggs/
17 .eggs/
18 lib/
19 lib64/
20 parts/
21 sdist/
22 var/
23 wheels/
6 *.egg-info/
24 *.egg-info/
25 .installed.cfg
26 *.egg
27
28 # PyInstaller
29 # Usually these files are written by a python script from a template
30 # before PyInstaller builds the exe, so as to inject date/other infos into it.
31 *.manifest
32 *.spec
33
34 # Installer logs
35 pip-log.txt
36 pip-delete-this-directory.txt
37
38 # Unit test / coverage reports
39 htmlcov/
40 .tox/
41 .coverage
42 .coverage.*
43 .cache
44 nosetests.xml
45 coverage.xml
46 *,cover
47 .hypothesis/
48
49 # Translations
50 *.mo
51 *.pot
52
53 # Django stuff:
54 *.log
55 local_settings.py
56
57 # Flask stuff:
58 instance/
59 .webassets-cache
60
61 # Scrapy stuff:
62 .scrapy
63
64 # Sphinx documentation
65 docs/_build/
66
67 # PyBuilder
68 target/
69
70 # Jupyter Notebook
71 .ipynb_checkpoints
72
73 # pyenv
74 .python-version
75
76 # celery beat schedule file
77 celerybeat-schedule
78
79 # SageMath parsed files
80 *.sage.py
81
82 # dotenv
83 .env
84
85 # virtualenv
86 .venv
87 venv/
88 ENV/
89
90 # Spyder project settings
91 .spyderproject
92 .spyproject
93
94 # Rope project settings
95 .ropeproject
96
97 # mkdocs documentation
98 /site
7
99
8 # eclipse
100 # eclipse
9 .project
101 .project
10 .pydevproject
102 .pydevproject
103 .svn/
104 *.png
105 *.pyc
106 schainpy/scripts
11
107
12 # vscode
108 schaingui/node_modules No newline at end of file
13 .vscode No newline at end of file
@@ -276,8 +276,8 class OperationConf():
276
276
277 parameterObj = self.getParameterObj(parameterName)
277 parameterObj = self.getParameterObj(parameterName)
278
278
279 # if not parameterObj:
279 # if not parameterObj:
280 # return None
280 # return None
281
281
282 value = parameterObj.getValue()
282 value = parameterObj.getValue()
283
283
@@ -578,10 +578,10 class ProcUnitConf():
578 def printattr(self):
578 def printattr(self):
579
579
580 print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME,
580 print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME,
581 self.id,
581 self.id,
582 self.name,
582 self.name,
583 self.datatype,
583 self.datatype,
584 self.inputId)
584 self.inputId)
585
585
586 for opConfObj in self.opConfObjList:
586 for opConfObj in self.opConfObjList:
587 opConfObj.printattr()
587 opConfObj.printattr()
@@ -624,13 +624,13 class ProcUnitConf():
624 sts = self.procUnitObj.call(opType = opConfObj.type,
624 sts = self.procUnitObj.call(opType = opConfObj.type,
625 opName = opConfObj.name,
625 opName = opConfObj.name,
626 opId = opConfObj.id,
626 opId = opConfObj.id,
627 **kwargs)
627 **kwargs)
628
629 # total_time = time.time() - ini
630 #
631 # if total_time > 0.002:
632 # print "%s::%s took %f seconds" %(self.name, opConfObj.name, total_time)
633
628
629 # total_time = time.time() - ini
630 #
631 # if total_time > 0.002:
632 # print "%s::%s took %f seconds" %(self.name, opConfObj.name, total_time)
633
634 is_ok = is_ok or sts
634 is_ok = is_ok or sts
635
635
636 return is_ok
636 return is_ok
@@ -647,7 +647,7 class ProcUnitConf():
647 self.procUnitObj.close()
647 self.procUnitObj.close()
648
648
649 return
649 return
650
650
651 class ReadUnitConf(ProcUnitConf):
651 class ReadUnitConf(ProcUnitConf):
652
652
653 path = None
653 path = None
@@ -772,16 +772,16 class ReadUnitConf(ProcUnitConf):
772
772
773 return opObj
773 return opObj
774
774
775 # def makeXml(self, projectElement):
775 # def makeXml(self, projectElement):
776 #
776 #
777 # procUnitElement = SubElement(projectElement, self.ELEMENTNAME)
777 # procUnitElement = SubElement(projectElement, self.ELEMENTNAME)
778 # procUnitElement.set('id', str(self.id))
778 # procUnitElement.set('id', str(self.id))
779 # procUnitElement.set('name', self.name)
779 # procUnitElement.set('name', self.name)
780 # procUnitElement.set('datatype', self.datatype)
780 # procUnitElement.set('datatype', self.datatype)
781 # procUnitElement.set('inputId', str(self.inputId))
781 # procUnitElement.set('inputId', str(self.inputId))
782 #
782 #
783 # for opConfObj in self.opConfObjList:
783 # for opConfObj in self.opConfObjList:
784 # opConfObj.makeXml(procUnitElement)
784 # opConfObj.makeXml(procUnitElement)
785
785
786 def readXml(self, upElement):
786 def readXml(self, upElement):
787
787
@@ -1024,7 +1024,7 class Project():
1024
1024
1025 self.id = self.projectElement.get('id')
1025 self.id = self.projectElement.get('id')
1026 self.name = self.projectElement.get('name')
1026 self.name = self.projectElement.get('name')
1027 self.description = self.projectElement.get('description')
1027 self.description = self.projectElement.get('description')
1028
1028
1029 readUnitElementList = self.projectElement.iter(ReadUnitConf().getElementName())
1029 readUnitElementList = self.projectElement.iter(ReadUnitConf().getElementName())
1030
1030
@@ -1055,8 +1055,8 class Project():
1055 def printattr(self):
1055 def printattr(self):
1056
1056
1057 print "Project[%s]: name = %s, description = %s" %(self.id,
1057 print "Project[%s]: name = %s, description = %s" %(self.id,
1058 self.name,
1058 self.name,
1059 self.description)
1059 self.description)
1060
1060
1061 for procUnitConfObj in self.procUnitConfObjDict.values():
1061 for procUnitConfObj in self.procUnitConfObjDict.values():
1062 procUnitConfObj.printattr()
1062 procUnitConfObj.printattr()
@@ -1093,8 +1093,8 class Project():
1093 import socket
1093 import socket
1094
1094
1095 err = traceback.format_exception(sys.exc_info()[0],
1095 err = traceback.format_exception(sys.exc_info()[0],
1096 sys.exc_info()[1],
1096 sys.exc_info()[1],
1097 sys.exc_info()[2])
1097 sys.exc_info()[2])
1098
1098
1099 print "***** Error occurred in %s *****" %(procUnitConfObj.name)
1099 print "***** Error occurred in %s *****" %(procUnitConfObj.name)
1100 print "***** %s" %err[-1]
1100 print "***** %s" %err[-1]
@@ -1126,9 +1126,9 class Project():
1126
1126
1127 adminObj = schainpy.admin.SchainNotify()
1127 adminObj = schainpy.admin.SchainNotify()
1128 adminObj.sendAlert(message=message,
1128 adminObj.sendAlert(message=message,
1129 subject=subject,
1129 subject=subject,
1130 subtitle=subtitle,
1130 subtitle=subtitle,
1131 filename=self.filename)
1131 filename=self.filename)
1132
1132
1133 def isPaused(self):
1133 def isPaused(self):
1134 return 0
1134 return 0
@@ -14,7 +14,7 class ControllerThread(threading.Thread, Project):
14 self.setDaemon(True)
14 self.setDaemon(True)
15
15
16 self.lock = threading.Lock()
16 self.lock = threading.Lock()
17 self.control = {'stop':False, 'pause':False}
17 self.control = { 'stop':False, 'pause':False }
18
18
19 def __del__(self):
19 def __del__(self):
20
20
@@ -90,7 +90,7 class ControllerThread(threading.Thread, Project):
90 continue
90 continue
91
91
92 if thisOpObj.name in plotterList:
92 if thisOpObj.name in plotterList:
93 thisOpObj.type = "plotter"
93 thisOpObj.type = "other"
94
94
95 def setPlotterQueue(self, plotter_queue):
95 def setPlotterQueue(self, plotter_queue):
96
96
@@ -583,6 +583,8 class SendToServer(ProcessingUnit):
583
583
584 self.isConfig = False
584 self.isConfig = False
585 self.clientObj = None
585 self.clientObj = None
586
587
586
588
587 def setup(self, server, username, password, remotefolder, localfolder, ext='.png', period=60, protocol='ftp', **kwargs):
589 def setup(self, server, username, password, remotefolder, localfolder, ext='.png', period=60, protocol='ftp', **kwargs):
588
590
@@ -638,18 +640,20 class SendToServer(ProcessingUnit):
638 return fullfilenameList
640 return fullfilenameList
639
641
640 def run(self, **kwargs):
642 def run(self, **kwargs):
641
642 if not self.isConfig:
643 if not self.isConfig:
643 self.init = time.time()
644 self.init = time.time()
644 self.setup(**kwargs)
645 self.setup(**kwargs)
645 self.isConfig = True
646 self.isConfig = True
646
647
648 if not self.clientObj.is_alive():
649 print "[Remote Server]: Restarting connection "
650 self.setup(**kwargs)
651
647 if time.time() - self.init >= self.period:
652 if time.time() - self.init >= self.period:
648 fullfilenameList = self.findFiles()
653 fullfilenameList = self.findFiles()
649
654
650 if self.clientObj.updateFileList(fullfilenameList):
655 if self.clientObj.updateFileList(fullfilenameList):
651 print "[Remote Server]: Sending the next files ", str(fullfilenameList)
656 print "[Remote Server]: Sending the next files ", str(fullfilenameList)
652
653 self.init = time.time()
657 self.init = time.time()
654
658
655 def close(self):
659 def close(self):
General Comments 0
You need to be logged in to leave comments. Login now