diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2019-05-02 19:20:02 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2019-05-02 19:20:02 +0200 |
commit | b35d3e4e76ce4fad133316861f1962efd9b9184f (patch) | |
tree | 8990b30d768daf1bdea44137ea0858b0880fe02f /src/file.py | |
parent | 6db078cf4696289bb40169398ebe5f3b1f5e87bb (diff) |
Element edition window
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"] |