##// END OF EJS Templates
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014

File last commit:

r487:89975db10cce
r487:89975db10cce
Show More
jroIO_example.py
99 lines | 2.2 KiB | text/x-python | PythonLexer
'''
Created on Jul 3, 2014
@author: roj-idl71
'''
import os
from schainpy.model.data.jrodata import Voltage
from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation
class Reader(ProcessingUnit):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
ProcessingUnit.__init__(self)
# self.dataIn = None
#
# self.isConfig = False
#Is really necessary create the output object in the initializer
self.dataOut = Voltage()
def setup(self, path = None,
startDate = None,
endDate = None,
startTime = None,
endTime = None,
set = None,
expLabel = "",
ext = None,
online = False,
delay = 60,
walk = True):
'''
In this method we should set all initial parameters.
'''
self.isConfig = True
def run(self, **kwargs):
'''
This method will be called many times so here you should put all your code
'''
if not self.isConfig:
self.setup(**kwargs)
class Writer(Operation):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
self.dataOut = None
self.isConfig = False
def setup(self, dataIn, path, blocksPerFile, set=0, ext=None):
'''
In this method we should set all initial parameters.
Input:
dataIn : Input data will also be outputa data
'''
self.dataOut = dataIn
self.isConfig = True
return
def run(self, dataIn, **kwargs):
'''
This method will be called many times so here you should put all your code
Inputs:
dataIn : object with the data
'''
if not self.isConfig:
self.setup(dataIn, **kwargs)