def toS(parent, name): i = [ SizeField.toS(parent, 'size'), DistanceField.toS(parent, 'thickness') ] if parent.italic: i.append('italic') return S(name, i)
def toS(parent, name): return S(name, [S(str(l.num), [l.name, l.t]) for l in parent.layers])
def toS(self, name): return S(name, [self.name, self.t, self.shape] + self.fieldsToS())
def toS(self, name): if self.t: return S(name, [self.t, self.text] + self.fieldsToS()) else: return S(name, [self.text] + self.fieldsToS())
def toS(self, name): return S(name, self.fieldsToS())
def toS(parent, name): return S(name, [hex(parent.__getattribute__(name))[2:].upper()])
def toS(parent, name): f = parent.__getattribute__(name) return S(name, [nm(f[0]), nm(f[1])])
def toS(self): return S('kicad_pcb', self.fieldsToS())
def toS(parent, name): return S(name, [parent.hatchtype, nm(parent.hatchsize)])
def toS(parent, name): return S(name, [hex(parent.lselect1) + '_' + hex(parent.lselect2)[2:]])
def toS(parent, name): f = parent.__getattribute__(name) if len(f) == 3: return S(name, [nm(f[0]), nm(f[1]), str(f[2])]) else: return S(name, [nm(f[0]), nm(f[1])])
def toS(parent, name): return S(name, [str(parent.net[0]), parent.net[1]])
def toS(parent, name): return [S(name, [n]) for n in parent.nets]
def toS(self, name): return S(name, [self.name] + self.fieldsToS())
def toS(parent, name): i = [parent.connect] if parent.connect != 'thermal' else [] return S(name, i + [S('clearance', [nm(parent.clearance)])])
def toS(parent, name): r = [] for k, v in parent.nets.items(): r.append(S(name, [str(k), v])) return r
def toS(parent, name): return S(name, [S(k, ['not_allowed']) for k in parent.keepouts])
def toS(parent, name): return S(name, [str(parent.__getattribute__(name))])
def toS(parent, name): return S( name, [S('pts', [S('xy', [nm(p[0]), nm(p[1])]) for p in parent.pts])])
def toS(parent, name): return S(name, ['true' if parent.__getattribute__(name) else 'false'])
def toS(parent, name): return S(name, ['yes' if parent.__getattribute__(name) else 'no'])