##// END OF EJS Templates

File last commit:

r196:1878b9614cd2
r260:0445cfc125a4
Show More
test4NewSignalChain.py
102 lines | 3.4 KiB | text/x-python | PythonLexer
/ schainpy / test4NewSignalChain.py
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189 """
$Author$
$Id$
"""
import datetime
from controller import *
from model import *
class Test():
def __init__(self):
self.createObjects()
self.run()
def createObjects(self):
self.upConfig = controller.UPConf(id=1, name="voltageproc", type="voltage")
opConf = self.upConfig.addOperation(name="init", priority=0)
opConf1 = self.upConfig.addOperation(name="CohInt", priority=1, type="other")
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 opConf1.addParameter(name="nCohInt", value=100)
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 opConf2 = self.upConfig.addOperation(name="Scope", priority=2, type="other")
opConf2.addParameter(name="idfigure", value=1)
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189
Daniel Valdez
En graphics:...
r192
self.upConfigSpc = controller.UPConf(id=2, name="spectraproc", type="spectra")
opConf = self.upConfigSpc.addOperation(name="init", priority=0)
opConf.addParameter(name="nFFTPoints", value=8)
opConf3 = self.upConfigSpc.addOperation(name="SpectraPlot", priority=1, type="other")
opConf3.addParameter(name="idfigure", value=2)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 # opConf = self.upConfig.addOperation(name="selectChannels", priority=3)
# opConf.addParameter(name="channelList", value=[0,1])
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189
#########################################
self.objR = jrodataIO.VoltageReader()
self.objP = jroprocessing.VoltageProc()
Daniel Valdez
En graphics:...
r192 self.objSpc = jroprocessing.SpectraProc()
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189
self.objInt = jroprocessing.CohInt()
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189 self.objP.addOperation(self.objInt, opConf1.id)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 self.objScope = jroplot.Scope()
self.objP.addOperation(self.objScope, opConf2.id)
Daniel Valdez
En graphics:...
r192 self.objSpcPlot = jroplot.SpectraPlot()
self.objSpc.addOperation(self.objSpcPlot, opConf3.id)
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189 self.connect(self.objR, self.objP)
Daniel Valdez
En graphics:...
r192 self.connect(self.objP, self.objSpc)
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189 def connect(self, obj1, obj2):
Daniel Valdez
En graphics:...
r192 obj2.setInput(obj1.getOutput())
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189
def run(self):
while(True):
Daniel Valdez
En esta version se ha implementado la clase para ploteo de espectros, a este grafico aun le falta agregar el perfil de potencia para cada canal.
r196 self.objR.run(path="/Users/dsuarez/Remote/EW_DRIFTS2",
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189 startDate=datetime.date(2012,1,1),
endDate=datetime.date(2012,12,30),
startTime=datetime.time(0,0,0),
endTime=datetime.time(23,59,59),
set=0,
expLabel = "",
ext = None,
online = False)
for opConf in self.upConfig.getOperationObjList():
kwargs={}
for parm in opConf.getParameterObjList():
kwargs[parm.name]=parm.value
self.objP.call(opConf,**kwargs)
Daniel Valdez
En graphics:...
r192
############################
for opConfSpc in self.upConfigSpc.getOperationObjList():
kwargs={}
for parm in opConfSpc.getParameterObjList():
kwargs[parm.name]=parm.value
self.objSpc.call(opConfSpc,**kwargs)
Daniel Valdez
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
r189
if self.objR.flagNoMoreFiles:
break
if self.objR.flagIsNewBlock:
print 'Block No %04d, Time: %s' %(self.objR.nTotalBlocks,
datetime.datetime.fromtimestamp(self.objR.basicHeaderObj.utc + self.objR.basicHeaderObj.miliSecond/1000.0),)
if __name__ == "__main__":
Test()