diff options
Diffstat (limited to 'src/file.py')
-rw-r--r-- | src/file.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/file.py b/src/file.py index 7c5f570..417c77b 100644 --- a/src/file.py +++ b/src/file.py @@ -1,7 +1,7 @@ import re, sys, traceback, json import phys -file_format_version = 2 +file_format_version = 4 def save_system(path, system): ser = dict() @@ -11,7 +11,9 @@ def save_system(path, system): ser["elements"] = [] for pol in system.elements: el = { + "name": pol.name, "type": pol.type, + "enable": pol.enable, "angle": pol.angle, "delta": pol.delta, "ref": pol.ref, @@ -38,6 +40,8 @@ def open_system(path): for el in ser["elements"]: pol = phys.Polarizer(str(el["type"])) + pol.name = str(el["name"]) + pol.enable = bool(el["enable"]) pol.angle = float(el["angle"]) pol.delta = float(el["delta"]) pol.ref = el["ref"] |