Separate count from the list of indexes in configuration.IoPin.
This commit is contained in:
parent
59c0ab067b
commit
5ff81b59ec
|
@ -1186,7 +1186,12 @@ class IoPin ( object ):
|
|||
self.stem = stem
|
||||
self.upos = upos
|
||||
self.ustep = ustep
|
||||
self.count = count
|
||||
if isinstance(count,int):
|
||||
self.count = count
|
||||
self.indexes = range(self.count)
|
||||
else:
|
||||
self.count = len(count)
|
||||
self.indexes = count
|
||||
if self.upos == 0 and not (self.flags & IoPin.A_MASK):
|
||||
raise ErrorMessage( 1, [ 'IoPin.__init__(): "upos" parameter cannot be zero, corners are forbidden.'
|
||||
, 'For net "{}"'.format(stem) ] )
|
||||
|
@ -1194,12 +1199,6 @@ class IoPin ( object ):
|
|||
raise ErrorMessage( 1, [ 'IoPin.__init__(): "ustep" parameter cannot be zero when "count" more than 1.'
|
||||
, 'For net "{}"'.format(stem) ] )
|
||||
|
||||
@property
|
||||
def indexes ( self ):
|
||||
if isinstance(self.count,int):
|
||||
return range(self.count)
|
||||
return self.count
|
||||
|
||||
# def place ( self, block ):
|
||||
# """
|
||||
# Performs the actual creation of the Pin. Should be called prior to any
|
||||
|
|
Loading…
Reference in New Issue