mcstasscript.instr_reader.read_declare.DeclareReader

mcstasscript.instr_reader.read_declare.DeclareReader

class mcstasscript.instr_reader.read_declare.DeclareReader(Instr, write_file, product_filename, get_next_line, return_line)

Reads the declare section of a McStas instrument file and adds the found parameters / functions / structs to the McStasScript Instr instance. The information can also be written to a python file for reproduction of a McStas instrument.

__init__(Instr, write_file, product_filename, get_next_line, return_line)

Methods

__init__(Instr, write_file, ...)

read_declare_line(line)

Reads line of instrument declare, returns bolean.

set_instr_name(name)

read_declare_line(line)

Reads line of instrument declare, returns bolean. If it encounters the end of the declare section, it returns False, otherwise True.

The contents of the declare section is written to the McStasScript Instr object.