Fixed KiCad 6 problems with empty title block items

- The saved SCH wasn't usable if company, rev, title, etc.
  were absent in the original file.
This commit is contained in:
Salvador E. Tropea 2022-03-26 12:33:08 -03:00
parent 6480d0be79
commit 637a6917c0
4 changed files with 10 additions and 36 deletions

View File

@ -1576,12 +1576,17 @@ class SchematicV6(Schematic):
def write_title_block(self):
data = [Sep()]
data += [_symbol('title', [self.title_ori]), Sep()]
data += [_symbol('date', [self.date_ori]), Sep()]
data += [_symbol('rev', [self.revision_ori]), Sep()]
data += [_symbol('company', [self.company_ori]), Sep()]
if self.title_ori:
data += [_symbol('title', [self.title_ori]), Sep()]
if self.date_ori:
data += [_symbol('date', [self.date_ori]), Sep()]
if self.revision_ori:
data += [_symbol('rev', [self.revision_ori]), Sep()]
if self.company_ori:
data += [_symbol('company', [self.company_ori]), Sep()]
for num, val in enumerate(self.comment_ori):
data += [_symbol('comment', [num+1, val]), Sep()]
if val:
data += [_symbol('comment', [num+1, val]), Sep()]
return [Sep(), Sep(), _symbol('title_block', data)]
def write_lib_symbols(self, cross=False):

View File

@ -5,19 +5,6 @@
(paper "A4")
(title_block
(title "")
(date "")
(rev "")
(company "")
(comment 1 "")
(comment 2 "")
(comment 3 "")
(comment 4 "")
(comment 5 "")
(comment 6 "")
(comment 7 "")
(comment 8 "")
(comment 9 "")
)
(lib_symbols

View File

@ -5,19 +5,6 @@
(paper "A4")
(title_block
(title "")
(date "")
(rev "")
(company "")
(comment 1 "")
(comment 2 "")
(comment 3 "")
(comment 4 "")
(comment 5 "")
(comment 6 "")
(comment 7 "")
(comment 8 "")
(comment 9 "")
)
(lib_symbols

View File

@ -13,11 +13,6 @@
(comment 2 "Comment 2")
(comment 3 "Comment 3")
(comment 4 "@Comment4@")
(comment 5 "")
(comment 6 "")
(comment 7 "")
(comment 8 "")
(comment 9 "")
)
(lib_symbols