In cumulus/Chip plugin Check that the spare side is not too small.

* Change: In Cumulus/plugins/block/spares, check that "block.spareSide"
    is not below 7*sliceHeight and issue a warning instead of a later
    divide by zero...
This commit is contained in:
Jean-Paul Chaput 2020-10-18 23:17:16 +02:00
parent 6bc8751879
commit f7ba17213d
1 changed files with 4 additions and 0 deletions

View File

@ -756,6 +756,10 @@ class Spares ( object ):
def build ( self ):
if not self.conf.useSpares: return
trace( 540, ',+', '\tSpares.build()\n' )
if self.conf.cfg.block.spareSide < 7*self.conf.sliceHeight:
raise ErrorMessage( 2, 'Spares.build(): Minimal block spare side ({}) must be greater than 7*sliceHeight ({}).' \
.format( DbU.getValueString( self.conf.cfg.block.spareSide)
, DbU.getValueString(7*self.conf.sliceHeight ) ))
with UpdateSession():
self.quadTree = QuadTree.create( self )
trace( 540, '-' )