COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
plotData.DataGen Class Reference
Inheritance diagram for plotData.DataGen:
Collaboration diagram for plotData.DataGen:

Public Member Functions

def __init__ (self, init=0)
 
def next (self)
 

Public Attributes

 data
 
 init
 

Private Member Functions

def _recalc_data (self)
 

Detailed Description

A silly class that generates pseudo-random data for
    display in the plot.

Constructor & Destructor Documentation

def plotData.DataGen.__init__ (   self,
  init = 0 
)
44  def __init__(self, init=0):
45  self.data = self.init = init
46 

Member Function Documentation

def plotData.DataGen.next (   self)
47  def next(self):
48  self._recalc_data()
49  return self.data
50 
def plotData.DataGen._recalc_data (   self)
private
51  def _recalc_data(self):
52  delta = random.uniform(-0.5, 0.5)
53  r = random.random()
54  #self.data += delta *15
55 
56  #x, y = loadtxt('example.txt',unpack=True, usecols=[0,1],delimiter=',')
57  roll, pitch, yaw = loadtxt('lastdatapoint.dat',unpack=True, usecols=[1,2,3],delimiter=',')
58  self.data = yaw
59 
60  #if r > 0.9:
61  # self.data += delta * 15
62  #elif r > 0.8:
63  # attraction to the initial value
64  # delta += (0.5 if self.init > self.data else -0.5)
65  # self.data += delta
66  #else:
67  # self.data += delta
68 
69 

Member Data Documentation

plotData.DataGen.data
plotData.DataGen.init

The documentation for this class was generated from the following file: