Fixed missing sub-sheet check
This commit is contained in:
parent
9cd2581582
commit
b435bd9761
|
|
@ -1360,7 +1360,7 @@ class SchematicSheet(object):
|
||||||
return self.sheet
|
return self.sheet
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def load(f):
|
def load(f, parent):
|
||||||
# Position & Size
|
# Position & Size
|
||||||
line = f.get_line()
|
line = f.get_line()
|
||||||
if line[0] != 'S':
|
if line[0] != 'S':
|
||||||
|
|
@ -1397,7 +1397,7 @@ class SchematicSheet(object):
|
||||||
raise SchFileError('Malformed sheet file name', line, f)
|
raise SchFileError('Malformed sheet file name', line, f)
|
||||||
sch.file = m.group(1)
|
sch.file = m.group(1)
|
||||||
sch.file_size = int(m.group(2))
|
sch.file_size = int(m.group(2))
|
||||||
if not os.path.isfile(sch.file):
|
if not os.path.isfile(os.path.join(os.path.dirname(parent), sch.file)):
|
||||||
raise SchFileError('Missing sub-sheet `{}`'.format(sch.file), line, f)
|
raise SchFileError('Missing sub-sheet `{}`'.format(sch.file), line, f)
|
||||||
else:
|
else:
|
||||||
sch.labels.append(SchematicPort.parse(line[1:], f))
|
sch.labels.append(SchematicPort.parse(line[1:], f))
|
||||||
|
|
@ -1537,7 +1537,7 @@ class Schematic(object):
|
||||||
obj = SchematicBitmap.load(f)
|
obj = SchematicBitmap.load(f)
|
||||||
self.bitmaps.append(obj)
|
self.bitmaps.append(obj)
|
||||||
elif line.startswith('$Sheet'):
|
elif line.startswith('$Sheet'):
|
||||||
obj = SchematicSheet.load(f)
|
obj = SchematicSheet.load(f, fname)
|
||||||
self.sheets.append(obj)
|
self.sheets.append(obj)
|
||||||
else:
|
else:
|
||||||
raise SchFileError('Unknown definition', line, f)
|
raise SchFileError('Unknown definition', line, f)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue