File Writer Interface

class py4syn.writing.FileWriter.FileWriter(fileName)[source]

Class to be inherited by all data output classes in order to be transparently used in scan functions.

By default some informations such as username, start and end timestamp, command and others are already filled by the scan routines using the getters and setters bellow.

Constructor

Parameters:
fileName : string

The output filename

close()[source]

Abstract method called at the end of the process.

getCommand()[source]

Returns the command.

Returns:
`string`
getComments()[source]

Returns the comments list.

Returns:
`list`
getDataSize()[source]

Returns the data size in number of lines.

Returns:
`int`
getDevices()[source]

Returns the list of devices mnemonics.

Returns:
`list`
getDevicesData()[source]

Returns the map containing all devices data in a map where the device mnemonic is the key and the values are an array.

Returns:
`map`
getEndDate()[source]

Returns the process end timestamp.

Returns:
`string`
getFileName()[source]

Returns the filename in use.

Returns:
`string`
getSignals()[source]

Returns the list of signals mnemonics.

Returns:
`list`
getSignalsData()[source]

Returns the map containing all signals data in a map where the device mnemonic is the key and the values are an array.

Returns:
`map`
getStartDate()[source]

Returns the process start timestamp.

Returns:
`string`
getUsername()[source]

Returns the username.

Returns:
`string`
insertComment(value)[source]

Insert a new comment in the list

Parameters:
value : string

Comment information

insertDevice(value)[source]

Insert a new device in the list

Parameters:
value : string

Device mnemonic

insertDeviceData(device, value)[source]

Insert a new data value for the informed device in the map.

Parameters:
device : string

Device mnemonic

value : float, int, str, etc

Collected value

insertSignal(value)[source]

Insert a new signal in the list

Parameters:
value : string

Signal mnemonic

insertSignalData(signal, value)[source]

Insert a new data value for the informed signal in the map.

Parameters:
signal : string

Signal mnemonic

value : float, int, str, etc

Collected value

setCommand(value)[source]

Set the command information

Parameters:
value : string

Command information

setComments(value)[source]

Set the comments list

Parameters:
value : list

Comments list

setDataSize(value)[source]

Set the data size in number of lines

Parameters:
value : int

Data size

setDevices(value)[source]

Set the devices list

Parameters:
value : list

Devices Mnemonic list

setDevicesData(value)[source]

Set the devices data map

Parameters:
value : map

Devices data map

setEndDate(value)[source]

Set the end date

Parameters:
value : string

Date when the process finished

setSignals(value)[source]

Set the signals list

Parameters:
value : list

Signals Mnemonic list

setSignalsData(value)[source]

Set the signals data map

Parameters:
value : map

Signals data map

setStartDate(value)[source]

Set the start date

Parameters:
value : string

Date when the process started

setUsername(value)[source]

Set the username information

Parameters:
value : string

Username information

writeData(partial=False, idx=-1)[source]

Abstract method to start the data write process.

Parameters:
channel : int

If partial is True it means that only data at position idx must be written. Otherwise this function must write all data.

idx : int

The data index to be saved

writeHeader()[source]

Abstract method to start the header write process.