Skip to content
Snippets Groups Projects
Commit d4e591cc authored by David Lanzendörfer's avatar David Lanzendörfer
Browse files

Fixing configuration class

parent 3e19487e
No related branches found
No related tags found
No related merge requests found
......@@ -6,10 +6,15 @@ from lclayout.tech_util import load_tech_file
import pint
class Config:
cfgname = None
confname = None
tech_data = None
def __init__(self, process):
self.ureg = pint.UnitRegistry()
self.ureg.autoconvert_offset_to_baseunit = True
self.confname = process
self.tech_data = load_tech_file(process)
def get_process_name(self):
return self.tech_data.name if hasattr(self.tech_data, "name") else "UNDEF"
......@@ -29,9 +34,24 @@ class Config:
print("WARNING: No minimum enclosue for",layer_pair,"defined!")
else:
print("WARNING: No minimum_enclosure defined!")
return w
def get_abutment_box(self):
r = (0,0)
if hasattr(self.tech_data, "my_abutment_box"):
r = self.tech_data.my_abutment_box
else:
print("WARNING: No abutment box defined!")
return r
def get_outline(self):
r = (0,0)
if hasattr(self.tech_data, "my_outline"):
r = self.tech_data.my_outline
else:
print("WARNING: No outline defined!")
return r
def get_min_spacing(self, layer_pair):
w = None
if hasattr(self.tech_data, "min_spacing"):
......@@ -107,14 +127,3 @@ class Config:
print("WARNING: weights_vertical not defined!")
return (x,y)
def __init__(self, name, cfgname):
if not os.path.exists(cfgname):
raise Exception(cfgname+" does not exist!")
self.ureg = pint.UnitRegistry()
self.ureg.autoconvert_offset_to_baseunit = True
self.confname = name
self.tech_data = load_tech_file(name)
self.cfgname = cfgname
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment