Commit 418eed43 authored by Berk Onat's avatar Berk Onat

Flexiable recorder/parser functions added to SmartParser, Stream RTF, PAR,...

Flexiable recorder/parser functions added to SmartParser, Stream RTF, PAR, CRD, COOR readers and force field parameters with ParmEd support added to MDDataAccess, resetting support added to MetaInfoStorage.
parent 44a3f97e
......@@ -159,6 +159,19 @@ class Container(object):
else:
self.accumulateValues(self, arg)
def reset(self, *args):
for arg in args:
if isinstance(arg, dict):
if arg["startSection"]:
if self.Name in arg["startSection"]:
self.resetValues(self, arg)
else:
if self.Containers:
for module in self.Containers:
module.reset(arg)
else:
self.resetValues(self, arg)
def updateBackend(self, backend, startsection=None, autoopenclose=False):
if startsection:
if self.Name == startsection:
......@@ -247,6 +260,16 @@ class Container(object):
if "muteSections" in arg:
if self.Name in arg["muteSections"]:
self.Active = False
def resetValues(self, *args):
for arg in args:
if isinstance(arg, dict):
if self.Storage:
self.resetAllValues()
if self.Containers:
for module in self.Containers:
module.resetValues(arg)
self.Active = False
def checkUpdateValue(self, item, localdict):
""" Updating value with the rules given in depends
......@@ -605,6 +628,13 @@ class Container(object):
newValue = itemv["unitconverter"](self, itemv)
self.Storage.__dict__[itemk["val"]] = newvalue
def resetAllValues(self):
for itemk in self.Storage.__dict__:
self.Storage.__dict__[itemk]["val"] = None
self.Storage.__dict__[itemk]["stor"] = False
self.Storage.__dict__[itemk]["act"] = False
self.Active = False
def __str__(self, caller=None, decorate='', color=None, printactive=None, onlynames=None):
string = ''
if onlynames is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment