Fix whitespace in orashi nonunitcapacitor
This commit is contained in:
parent
c9fe5713cf
commit
5c2203b0f3
|
@ -34,17 +34,17 @@ class NonUnitCapacitor(CapacitorUnit):
|
|||
self.device = device
|
||||
self.capacitorType = capacitorType
|
||||
self.direction = direction
|
||||
self.capacitance = capacitance
|
||||
self.capacitorUnit = capacitorUnit
|
||||
self.abutmentBoxPosition = abutmentBoxPosition
|
||||
self.capUnitTopPlates_spacing = capUnitTopPlates_spacing
|
||||
self.capacitance = capacitance
|
||||
self.capacitorUnit = capacitorUnit
|
||||
self.abutmentBoxPosition = abutmentBoxPosition
|
||||
self.capUnitTopPlates_spacing = capUnitTopPlates_spacing
|
||||
|
||||
self.unitCapDim = CapacitorUnit.__computeCapDim__( self, capacitorUnit, capacitorType )
|
||||
self.unitCapDim = CapacitorUnit.__computeCapDim__( self, capacitorUnit, capacitorType )
|
||||
|
||||
if self.__isDirectionOk__(direction):
|
||||
self.nonUnitCapDim = {"width" : self.unitCapDim["width"] , "height" : 0 } if direction == "vertical" else {"width" : 0 , "height" : self.unitCapDim["width"] }
|
||||
self.nonUnitCapDim = {"width" : self.unitCapDim["width"] , "height" : 0 } if direction == "vertical" else {"width" : 0 , "height" : self.unitCapDim["width"] }
|
||||
|
||||
self.nonUnitCapDim_sideLimit = 0
|
||||
self.nonUnitCapDim_sideLimit = 0
|
||||
self.dummyCapDim = {}
|
||||
|
||||
return
|
||||
|
@ -62,7 +62,7 @@ class NonUnitCapacitor(CapacitorUnit):
|
|||
|
||||
def setRules( self ):
|
||||
|
||||
CapacitorUnit.setRules(self)
|
||||
CapacitorUnit.setRules(self)
|
||||
|
||||
if self.capacitorType == 'MIMCap':
|
||||
self.__setattr__( "minWidth_dummyTopPlate" , CapacitorUnit.rules.minWidth_metcapdum )
|
||||
|
@ -70,7 +70,7 @@ class NonUnitCapacitor(CapacitorUnit):
|
|||
elif self.capacitorType == 'PIPCap':
|
||||
self.__setattr__( "minWidth_dummyTopPlate" , CapacitorUnit.rules.minWidth_cpoly )
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
@ -78,37 +78,36 @@ class NonUnitCapacitor(CapacitorUnit):
|
|||
|
||||
UpdateSession.open()
|
||||
|
||||
self.setRules()
|
||||
self.computeDimensions()
|
||||
self.setRules()
|
||||
self.computeDimensions()
|
||||
|
||||
if self.__isCapacitorOk__() :
|
||||
if self.__isCapacitorOk__() :
|
||||
|
||||
print('drawing capacitor')
|
||||
activeCapacitor = CapacitorUnit ( self.device, self.capacitorType, self.abutmentBoxPosition, capDim = self.nonUnitCapDim )
|
||||
activeCapacitor.create( b, t )
|
||||
print('drawing capacitor')
|
||||
activeCapacitor = CapacitorUnit ( self.device, self.capacitorType, self.abutmentBoxPosition, capDim = self.nonUnitCapDim )
|
||||
activeCapacitor.create( b, t )
|
||||
|
||||
side = "height" if self.direction == "vertical" else "width"
|
||||
if self.__isNonUnitCapSideOk__( side ) :
|
||||
if self.__isNonUnitCapSideOk__( side ):
|
||||
print("drawing dummy too")
|
||||
# activeCapacitor = CapacitorUnit ( self.device, activeCapacitance, self.capacitorType, self.abutmentBoxPosition )
|
||||
|
||||
print("drawing dummy too")
|
||||
# activeCapacitor = CapacitorUnit ( self.device, activeCapacitance, self.capacitorType, self.abutmentBoxPosition )
|
||||
|
||||
dummyAbutmentBoxPosition = [ self.abutmentBoxPosition[0], self.abutmentBoxPosition[1] - CapacitorUnit.computeAbutmentBoxDimensions( self, self.dummyCapDim )["height"] ] if self.direction == "vertical" else [ self.abutmentBoxPosition[0] + CapacitorUnit.computeAbutmentBoxDimensions( self, self.nonUnitCapDim )["width"] , self.abutmentBoxPosition[1] ]
|
||||
dummyAbutmentBoxPosition = [ self.abutmentBoxPosition[0], self.abutmentBoxPosition[1] - CapacitorUnit.computeAbutmentBoxDimensions( self, self.dummyCapDim )["height"] ] if self.direction == "vertical" else [ self.abutmentBoxPosition[0] + CapacitorUnit.computeAbutmentBoxDimensions( self, self.nonUnitCapDim )["width"] , self.abutmentBoxPosition[1] ]
|
||||
|
||||
dummyCapacitor = CapacitorUnit( self.device, self.capacitorType, dummyAbutmentBoxPosition, capDim = self.dummyCapDim )
|
||||
# activeCapacitor.create( b, t )
|
||||
dummyCapacitor.create ( b, t )
|
||||
# activeCapacitor.create( b, t )
|
||||
dummyCapacitor.create ( b, t )
|
||||
|
||||
else : print("not drawing dummy")
|
||||
|
||||
# abutmentBoxDimensions = self.computeAbutmentBoxDimensions(capDim)
|
||||
# CapacitorUnit.drawAbutmentBox( self )
|
||||
# abutmentBoxDimensions = self.computeAbutmentBoxDimensions(capDim)
|
||||
# CapacitorUnit.drawAbutmentBox( self )
|
||||
|
||||
else : raise Error(1,'create() : Impossible to draw capacitor in the defined geometric limits.')
|
||||
else : raise Error(1,'create() : Impossible to draw capacitor in the defined geometric limits.')
|
||||
|
||||
UpdateSession.close()
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
@ -121,30 +120,30 @@ class NonUnitCapacitor(CapacitorUnit):
|
|||
|
||||
def __isCapacitorOk__( self ):
|
||||
|
||||
capacitorMax = self.computeCapacitorMax()
|
||||
capacitorMax = self.computeCapacitorMax()
|
||||
|
||||
print("CMax",capacitorMax)
|
||||
print("self.capacitance",self.capacitance)
|
||||
print("self.capUnitTopPlates_spacing",toPhy(self.capUnitTopPlates_spacing))
|
||||
print("CMax",capacitorMax)
|
||||
print("self.capacitance",self.capacitance)
|
||||
print("self.capUnitTopPlates_spacing",toPhy(self.capUnitTopPlates_spacing))
|
||||
|
||||
return True if self.capacitance < capacitorMax else False
|
||||
return True if self.capacitance < capacitorMax else False
|
||||
|
||||
|
||||
|
||||
|
||||
def computeDimensions( self ):
|
||||
|
||||
if self.capUnitTopPlates_spacing == -1 :
|
||||
CapacitorUnit.computeAbutmentBoxDimensions(self, self.unitCapDim )
|
||||
self.capUnitTopPlates_spacing = 2*(self.minSpacing_botPlate + self.enclosure_botPlate_topPlate)
|
||||
if self.capUnitTopPlates_spacing == -1 :
|
||||
CapacitorUnit.computeAbutmentBoxDimensions(self, self.unitCapDim )
|
||||
self.capUnitTopPlates_spacing = 2*(self.minSpacing_botPlate + self.enclosure_botPlate_topPlate)
|
||||
|
||||
self.nonUnitCapDim_sideLimit = 2*self.unitCapDim["width"] - self.minWidth_dummyTopPlate
|
||||
self.nonUnitCapDim_sideLimit = 2*self.unitCapDim["width"] - self.minWidth_dummyTopPlate
|
||||
|
||||
if self.direction == "vertical":
|
||||
self.nonUnitCapDim["height"] = self.computeNonUnitCapheight()
|
||||
self.nonUnitCapDim["height"] = self.computeNonUnitCapheight()
|
||||
else : self.nonUnitCapDim["width"] = self.computeNonUnitCapheight()
|
||||
|
||||
print("sideLimit",toPhy(self.nonUnitCapDim_sideLimit))
|
||||
print("sideLimit",toPhy(self.nonUnitCapDim_sideLimit))
|
||||
print("self.capUnitTopPlates_spacing",toPhy(self.capUnitTopPlates_spacing))
|
||||
print('self.nonUnitCapDim["width"]',toPhy(self.nonUnitCapDim["width"]))
|
||||
print('self.nonUnitCapDim["height"]',toPhy(self.nonUnitCapDim["height"]))
|
||||
|
@ -156,32 +155,32 @@ class NonUnitCapacitor(CapacitorUnit):
|
|||
|
||||
print("self.dummyCapDim",toPhy(self.dummyCapDim["width" ]))
|
||||
print("self.dummyCapDim",toPhy(self.dummyCapDim["height" ]))
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
|
||||
def computeCapacitorMax( self ):
|
||||
|
||||
[ areaCapacitorPerUnit, perimeterCapacitorPerUnit ] = CapacitorUnit.__setCapacitorPerUnit__(self, self.capacitorType)
|
||||
capUnit_width = toPhy( self.unitCapDim["width"] )
|
||||
topPlates_spacing = toPhy( self.capUnitTopPlates_spacing )
|
||||
print("[ areaCapacitorPerUnit, perimeterCapacitorPerUnit ]",[ areaCapacitorPerUnit, perimeterCapacitorPerUnit ])
|
||||
print("width",capUnit_width)
|
||||
CMax = ( 2*capUnit_width + topPlates_spacing )*capUnit_width*areaCapacitorPerUnit + ( 3*capUnit_width + topPlates_spacing )*perimeterCapacitorPerUnit
|
||||
[ areaCapacitorPerUnit, perimeterCapacitorPerUnit ] = CapacitorUnit.__setCapacitorPerUnit__(self, self.capacitorType)
|
||||
capUnit_width = toPhy( self.unitCapDim["width"] )
|
||||
topPlates_spacing = toPhy( self.capUnitTopPlates_spacing )
|
||||
print("[ areaCapacitorPerUnit, perimeterCapacitorPerUnit ]",[ areaCapacitorPerUnit, perimeterCapacitorPerUnit ])
|
||||
print("width",capUnit_width)
|
||||
CMax = ( 2*capUnit_width + topPlates_spacing )*capUnit_width*areaCapacitorPerUnit + ( 3*capUnit_width + topPlates_spacing )*perimeterCapacitorPerUnit
|
||||
|
||||
return CMax
|
||||
return CMax
|
||||
|
||||
|
||||
|
||||
def computeNonUnitCapheight( self ):
|
||||
|
||||
|
||||
[ areaCapacitorPerUnit, perimeterCapacitorPerUnit ] = CapacitorUnit.__setCapacitorPerUnit__(self, self.capacitorType)
|
||||
width = toPhy( self.unitCapDim["width"] )
|
||||
height = self.capacitance/( (width*areaCapacitorPerUnit + perimeterCapacitorPerUnit) + width*perimeterCapacitorPerUnit )
|
||||
[ areaCapacitorPerUnit, perimeterCapacitorPerUnit ] = CapacitorUnit.__setCapacitorPerUnit__(self, self.capacitorType)
|
||||
width = toPhy( self.unitCapDim["width"] )
|
||||
height = self.capacitance/( (width*areaCapacitorPerUnit + perimeterCapacitorPerUnit) + width*perimeterCapacitorPerUnit )
|
||||
|
||||
print("height",height)
|
||||
return toDbU(height)
|
||||
print("height",height)
|
||||
return toDbU(height)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue