/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions
Scraper::adlidsensor::AdLidSensorFaker Class Reference
Inheritance diagram for Scraper::adlidsensor::AdLidSensorFaker:
Inheritance graph
[legend]
Collaboration diagram for Scraper::adlidsensor::AdLidSensorFaker:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def fake

Detailed Description

Definition at line 161 of file adlidsensor.py.


Member Function Documentation

def Scraper::adlidsensor::AdLidSensorFaker::fake (   self,
  inst,
  id,
  dt = None 
)
Invoked from base class, sets source instance attributes to form a fake 

:param inst: source instance
:param id: id to assign to the instance 

Definition at line 163 of file adlidsensor.py.

00164                                        :
00165         """
00166         Invoked from base class, sets source instance attributes to form a fake 
00167 
00168         :param inst: source instance
00169         :param id: id to assign to the instance 
00170         """
00171         if dt==None:
00172             dt = datetime.now()
00173         for k,v in inst.asdict.items():
00174             if k == 'id':
00175                 setattr( inst, k, id )
00176             elif k == 'date_time':
00177                 setattr( inst, k, dt )
00178             else:
00179                 # TODO switch on simulated data profiles
00180                 #if self.profile == "modulo_ramp":
00181                 #elif self.profile == "island_of_stability":
00182                 #elif self.profile == "island_of_change":
00183 
00184                 # TODO simulate actual fluid heights.  for now, simulate counts
00185                 if k.startswith('Ultrasonic'):
00186                     setattr( inst, k, random.gauss(2000, 5) )
00187                 elif k.startswith('Capacitance'):
00188                     setattr( inst, k, random.gauss(200, 10) )
00189                 elif k.startswith('Temp_'):
00190                     setattr( inst, k, random.gauss(22.7, 0.1) )
00191                 elif k.startswith('Tilt'):
00192                     setattr( inst, k, random.gauss(0, 0.1) )
00193                 else:
00194                     setattr( inst, k, 0 );   
00195 
00196 # source database variables
00197 #  Ultrasonic_GdLS=0,
00198 #  Ultrasonic_LS=0,
00199 #  Capacitance_GdLS=0,
00200 #  Capacitance_LS=0,
00201 #  Capacitance_MO=0,
00202 #  Tiltx_Sensor1=0,
00203 #  Tilty_Sensor1=0,
00204 #  Tiltx_Sensor2=0,
00205 #  Tilty_Sensor2=0,
00206 #  Tiltx_Sensor3=0,
00207 #  Tilty_Sensor3=0,
00208 #  Temp_GdLS=0,
00209 #  Temp_LS=0,
00210 #  Capacitance_Temp_GdLS=0,
00211 #  Capacitance_Temp_LS=0,
00212 #  Capacitance_Temp_MO=0,
00213 


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:03 for Scraper by doxygen 1.7.4