1 | NO CONTENT: new file 100644 |
|
NO CONTENT: new file 100644 |
@@ -0,0 +1,34 | |||||
|
1 | from schainpy.controller import Project | |||
|
2 | ||||
|
3 | desc = "A schain project" | |||
|
4 | ||||
|
5 | controller = Project() | |||
|
6 | controller.setup(id='191', name="project", description=desc) | |||
|
7 | ||||
|
8 | readUnitConf = controller.addReadUnit(datatype='VoltageReader', | |||
|
9 | path="/home/nanosat/schain/schainpy", | |||
|
10 | startDate="1970/01/01", | |||
|
11 | endDate="2017/12/31", | |||
|
12 | startTime="00:00:00", | |||
|
13 | endTime="23:59:59", | |||
|
14 | online=0, | |||
|
15 | verbose=1, | |||
|
16 | walk=1, | |||
|
17 | ) | |||
|
18 | ||||
|
19 | procUnitConf1 = controller.addProcUnit(datatype='VoltageProc', inputId=readUnitConf.getId()) | |||
|
20 | ||||
|
21 | opObj11 = procUnitConf1.addOperation(name='ProfileSelector', optype='other') | |||
|
22 | opObj11.addParameter(name='profileRangeList', value='120,183', format='intlist') | |||
|
23 | ||||
|
24 | opObj11 = procUnitConf1.addOperation(name='RTIPlot', optype='other') | |||
|
25 | opObj11.addParameter(name='wintitle', value='Jicamarca Radio Observatory', format='str') | |||
|
26 | opObj11.addParameter(name='showprofile', value='0', format='int') | |||
|
27 | opObj11.addParameter(name='xmin', value='0', format='int') | |||
|
28 | opObj11.addParameter(name='xmax', value='24', format='int') | |||
|
29 | opObj11.addParameter(name='figpath', value="/home/nanosat/schain/schainpy/figs", format='str') | |||
|
30 | opObj11.addParameter(name='wr_period', value='5', format='int') | |||
|
31 | opObj11.addParameter(name='exp_code', value='22', format='int') | |||
|
32 | ||||
|
33 | ||||
|
34 | controller.start() |
1 | NO CONTENT: new file 100644 |
|
NO CONTENT: new file 100644 |
1 | NO CONTENT: file renamed from schain-cli/.gitignore to schaincli/.gitignore |
|
NO CONTENT: file renamed from schain-cli/.gitignore to schaincli/.gitignore |
1 | NO CONTENT: file renamed from schain-cli/README.md to schaincli/README.md |
|
NO CONTENT: file renamed from schain-cli/README.md to schaincli/README.md |
1 | NO CONTENT: file renamed from schain-cli/schaincli/__init__.py to schaincli/__init__.py |
|
NO CONTENT: file renamed from schain-cli/schaincli/__init__.py to schaincli/__init__.py |
1 | NO CONTENT: file renamed from schain-cli/asdasd.py to schaincli/asdasd.py |
|
NO CONTENT: file renamed from schain-cli/asdasd.py to schaincli/asdasd.py |
1 | NO CONTENT: file renamed from schain-cli/schain.xml to schaincli/schain.xml |
|
NO CONTENT: file renamed from schain-cli/schain.xml to schaincli/schain.xml |
@@ -2,7 +2,8 import click | |||||
2 | import schainpy |
|
2 | import schainpy | |
3 | import subprocess |
|
3 | import subprocess | |
4 | from multiprocessing import cpu_count |
|
4 | from multiprocessing import cpu_count | |
5 | from schaincli import templates |
|
5 | from schaincli.schaincli import templates | |
|
6 | from schainpy import controller_api | |||
6 | import os |
|
7 | import os | |
7 | import sys |
|
8 | import sys | |
8 | import glob |
|
9 | import glob | |
@@ -22,7 +23,7 def print_version(ctx, param, value): | |||||
22 | def main(command, nextcommand, version, xml): |
|
23 | def main(command, nextcommand, version, xml): | |
23 | """COMMAND LINE INTERFACE FOR SIGNAL CHAIN - JICAMARCA RADIO OBSERVATORY""" |
|
24 | """COMMAND LINE INTERFACE FOR SIGNAL CHAIN - JICAMARCA RADIO OBSERVATORY""" | |
24 | if xml is not None: |
|
25 | if xml is not None: | |
25 | subprocess.call(['schain --file=' + xml], shell=True) |
|
26 | runFromXML(xml) | |
26 | elif command == 'generate': |
|
27 | elif command == 'generate': | |
27 | generate() |
|
28 | generate() | |
28 | elif command == 'test': |
|
29 | elif command == 'test': | |
@@ -43,6 +44,7 def main(command, nextcommand, version, xml): | |||||
43 | else: |
|
44 | else: | |
44 | click.echo('\x1b[6;37;41m[ERROR] - Command is not defined.\x1b[0m') |
|
45 | click.echo('\x1b[6;37;41m[ERROR] - Command is not defined.\x1b[0m') | |
45 |
|
46 | |||
|
47 | ||||
46 | def basicInputs(): |
|
48 | def basicInputs(): | |
47 | inputs = {} |
|
49 | inputs = {} | |
48 | inputs['desc'] = click.prompt('Enter a description', default="A schain project", type=str) |
|
50 | inputs['desc'] = click.prompt('Enter a description', default="A schain project", type=str) | |
@@ -55,6 +57,7 def basicInputs(): | |||||
55 | inputs['figpath'] = inputs['path'] + '/figs' |
|
57 | inputs['figpath'] = inputs['path'] + '/figs' | |
56 | return inputs |
|
58 | return inputs | |
57 |
|
59 | |||
|
60 | ||||
58 | def generate(): |
|
61 | def generate(): | |
59 | inputs = basicInputs() |
|
62 | inputs = basicInputs() | |
60 | inputs['multiprocess'] = click.confirm('Is this a multiprocess script?') |
|
63 | inputs['multiprocess'] = click.confirm('Is this a multiprocess script?') | |
@@ -73,5 +76,23 def generate(): | |||||
73 |
|
76 | |||
74 |
|
77 | |||
75 | def test(): |
|
78 | def test(): | |
76 |
print templates.basic.format(name='hola', desc= |
|
79 | print templates.basic.format(name='hola', desc='desc', path='path', startDate='0', endDate='0') | |
77 | click.echo('testing') |
|
80 | click.echo('testing') | |
|
81 | ||||
|
82 | ||||
|
83 | def runFromXML(filename): | |||
|
84 | controller = controller_api.ControllerThread() | |||
|
85 | if not controller.readXml(filename): | |||
|
86 | return | |||
|
87 | ||||
|
88 | plotterObj = controller.useExternalPlotter() | |||
|
89 | ||||
|
90 | controller.start() | |||
|
91 | plotterObj.start() | |||
|
92 | ||||
|
93 | print "Finishing all processes ..." | |||
|
94 | ||||
|
95 | controller.join(5) | |||
|
96 | ||||
|
97 | print "End of script" | |||
|
98 | return |
1 | NO CONTENT: file renamed from schain-cli/schaincli/templates.py to schaincli/schaincli/templates.py |
|
NO CONTENT: file renamed from schain-cli/schaincli/templates.py to schaincli/schaincli/templates.py |
1 | NO CONTENT: file renamed from schain-cli/setup.cfg to schaincli/setup.cfg |
|
NO CONTENT: file renamed from schain-cli/setup.cfg to schaincli/setup.cfg |
1 | NO CONTENT: file renamed from schain-cli/setup.py to schaincli/setup.py |
|
NO CONTENT: file renamed from schain-cli/setup.py to schaincli/setup.py |
1 | NO CONTENT: file renamed from schain-cli/tests/__init__.py to schaincli/tests/__init__.py |
|
NO CONTENT: file renamed from schain-cli/tests/__init__.py to schaincli/tests/__init__.py |
1 | NO CONTENT: file renamed from schain-cli/tests/test_cli.py to schaincli/tests/test_cli.py |
|
NO CONTENT: file renamed from schain-cli/tests/test_cli.py to schaincli/tests/test_cli.py |
1 | NO CONTENT: file renamed from schain-cli/tox.ini to schaincli/tox.ini |
|
NO CONTENT: file renamed from schain-cli/tox.ini to schaincli/tox.ini |
@@ -1313,9 +1313,9 class Project(): | |||||
1313 |
|
1313 | |||
1314 | print "Process finished" |
|
1314 | print "Process finished" | |
1315 |
|
1315 | |||
1316 | def start(self): |
|
1316 | def start(self, filename=None): | |
1317 |
|
1317 | |||
1318 | self.writeXml() |
|
1318 | self.writeXml(filename) | |
1319 | self.createObjects() |
|
1319 | self.createObjects() | |
1320 | self.connectObjects() |
|
1320 | self.connectObjects() | |
1321 | self.run() |
|
1321 | self.run() |
@@ -32,8 +32,12 setup(name="schainpy", | |||||
32 | 'schainpy.gui.figures': ['*.png','*.jpg'], |
|
32 | 'schainpy.gui.figures': ['*.png','*.jpg'], | |
33 | }, |
|
33 | }, | |
34 | include_package_data=False, |
|
34 | include_package_data=False, | |
35 | scripts =['schainpy/gui/schainGUI', |
|
35 | entry_points={ | |
36 | 'schainpy/scripts/schain'], |
|
36 | 'console_scripts': [ | |
|
37 | 'schain = schaincli.schaincli.cli:main', | |||
|
38 | ], | |||
|
39 | }, | |||
|
40 | scripts =['schainpy/gui/schainGUI'], | |||
37 | ext_modules=[Extension("cSchain", ["schainpy/model/proc/extensions.c"])], |
|
41 | ext_modules=[Extension("cSchain", ["schainpy/model/proc/extensions.c"])], | |
38 | install_requires=[ |
|
42 | install_requires=[ | |
39 | "scipy >= 0.14.0", |
|
43 | "scipy >= 0.14.0", |
General Comments 0
You need to be logged in to leave comments.
Login now