Pythonic Virtual Machine
output Class Reference

Detailed Description

output.png
schema

Use this to dump the values of channels in a log file. The channel values that are printed to the file are added/removed using the Register and Unregister functions. The input channel record, if connected will make the circuit print to file only when its value is positive.

Initialisation parameters:

  • file = name of the log file
  • dump = # rate at which data is printed in the file

Input channels:

  • record = if connected, the output will be printed only when this input is 1

Output channels: This circuit has no output channel.

Example:

1 logger = machine.AddCircuit(type='output', name='logger', dump=1)
2 logger = machine.AddCircuit(type='output', name='logger', dump=100)

Inherits Circuit.

Public Member Functions

def Register (self, args)
 Register an output channel for file output. More...
 
def Unregister (self, args)
 Unregister a channel from the output. More...
 
def Dump (self)
 Write the output to the file. More...
 

Additional Inherited Members

- Public Attributes inherited from Circuit
 name
 Name of the circuit. More...
 
 enabled
 if it is working... More...
 
 machine
 Reference to the virtual machine to which this circuit belongs. More...
 
 pushed
 Push output buffer at the end of Update. More...
 
 I
 Dictionary of input channels.
 
 O
 Dictionary of output channels.
 
 cCoreID
 index of circuit in cCore
 

Member Function Documentation

def Dump (   self)

Use this function to write one record in the output file.

Example:

1 logger = machine.AddCircuit(type='output', name='logger', dump=100)
2 logger.RegisterChannel('global.time','waver.sin','filter.out', ...)
3 ...
4 logger.Dump()
def Register (   self,
  args 
)

If the channel is already registered in this output circuit, it won't be registered again.

Parameters
*argsChannel tags to be printed in the output.

Example:

1 logger = machine.AddCircuit(type='output', name='logger', dump=100)
2 logger.Register('global.time','waver.sin','adder.out', ...)
def Unregister (   self,
  args 
)

If the channel is already unregistered, it won't be unregistered again.

Parameters
*argsChannel tags to be removed from the output.

Example:

1 logger = machine.AddCircuit(type='output', name='logger', dump=100)
2 logger.RegisterChannel('global.time','waver.sin','adder.out', ...)
3 ...
4 logger.Unregister('adder.out', ...)

Documentation for pyVAFM
Generated on Wed Feb 8 2017 10:13:49 for pyVAFM by doxygen 1.8.9.1