← Back to team overview

kicad-developers team mailing list archive

Re: IPC-7351 Footprint wizard

 

Did anyone make any headway into integrating an IPC-7351 wizard into the
module plugins?  I don't want to duplicate effort, but I have a draft
IPC-wizard module plugin for the chip family of components RESC, CAPC,
DIOC, etc.  It is attached.

Could some IPC-7351 savvy individuals check it over and give some feedback?

I also have a skeleton for a FreeCAD workbench for creating parametric 3D
models in WRL format (screenshot attached).  Anyone intersted in
collaborating on this?

Thanks.

Ed Johns

Caveats:

This plugins create identical footprints to the "PCB Library Expert" for
sizes 1.6mm x 0.8mm or greater.  Below that size, it looks like they (
pcblibraries.com) deviate from the standard by vary from the standard by
changing recommended toe fillet sizes.
Does anyone have any insights into this?
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.

from __future__ import division
import pcbnew

import HelpfulFootprintWizardPlugin
import PadArray as PA
import math

class IpcComponentWizard(HelpfulFootprintWizardPlugin.HelpfulFootprintWizardPlugin):
    """"""

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        raise NotImplementedError

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        raise NotImplementedError

    def GetReferencePrefix(self):
        """
        """
        raise NotImplementedError

    def GetValue(self):
        """
        """
        raise NotImplementedError

    def GenerateIpcParameterList(self):
        """
        Generate footprint specific parameters.

        This is specific to each footprint class, you need to implement
        this
        """
        raise NotImplementedError

    def GenerateParameterList(self):
        """"""

        self.COURTYARD_EXCESS = [0.5, 0.25, 0.1]
        
        # Silkscreen parameters
        self.AddParam("Drawing", "Silkscreen Line Width", self.uMM, 0.12)
        self.AddParam("Drawing", "Silkscreen Clearance", self.uMM, 0.12)
        
        # Courtyard parameters
        self.AddParam("Drawing", "Courtyard Line Width", self.uMM, 0.05)
        #self.AddParam("Drawing", "Courtyard Excess", self.uMM, 0.25)
        
        # Fab drawing parameters
        self.AddParam("Drawing", "Fab Line Width", self.uMM, 0.12)
        
        # Generate footprint specific parameters after globals are set.
        self.GenerateIpcParameterList()

    def CheckIpcParameters(self):
        """
        Check footprint specific parameters.

        This is specific to each footprint class, you need to implement
        this
        """
        raise NotImplementedError

    def CheckParameters(self):
        """"""
        # TODO: HIDE COURTYARD EXCESS AND CALCULATE EXCESS AND FILLETS BASED ON SIZED LISTS !!!
        self.CourtyardLineWidth = int(self.parameters["Drawing"]["Courtyard Line Width"])
        self.FabLineWidth = int(self.parameters["Drawing"]["Fab Line Width"])
        self.SilkscreenClearance = int(self.parameters["Drawing"]["Silkscreen Clearance"])
        self.SilkscreenLineWidth = int(self.parameters["Drawing"]["Silkscreen Line Width"])

        # Check module-specific parameters
        self.CheckIpcParameters()
        
        self.CourtyardExcess = self.CalculateCourtyardExcess()

    def BuildIpcPads(self):
        """
        Draw the IPC pads.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        raise NotImplementedError

    def BuildIpcSilkscreen(self):
        """
        Draw the IPC silkscreen.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        raise NotImplementedError

    def BuildIpcCourtyard(self):
        """
        Draw the IPC courtyard excess.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        raise NotImplementedError

    def BuildIpcFabDrawing(self):
        """
        Draw the IPC fab or assembly drawing.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        raise NotImplementedError

    def BuildThisFootprint(self):
        """"""
        self.BuildIpcPads()
        self.BuildIpcSilkscreen()
        self.BuildIpcCourtyard()
        self.BuildIpcFabDrawing()
        
        # Draw courtyard origin
        self.draw.SetLayer(pcbnew.F_CrtYd)
        self.draw.SetWidth(self.CourtyardLineWidth)
        ch_lim = pcbnew.FromMM(0.35)
        self.draw.Line(-ch_lim, 0, ch_lim, 0)
        self.draw.Line(0, -ch_lim, 0, ch_lim)
        self.draw.Circle(0, 0, pcbnew.FromMM(0.25))
        self.module.Value().SetLayer(pcbnew.F_Fab)
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.

from ipc import *

class IpcChipWizard(IpcComponentWizard):
    """
    """

    def GenerateIpcParameterList(self):
        """
        Generate footprint specific parameters.

        This is specific to each footprint class, you need to implement
        this
        """
        
        self.AddParam("Component", "Height (max)", self.uMM, 1.4)
        self.AddParam("Component", "Length (min)", self.uMM, 3.0)
        self.AddParam("Component", "Length (max)", self.uMM, 3.4)
        self.AddParam("Component", "Width (min)", self.uMM, 1.4)
        self.AddParam("Component", "Width (max)", self.uMM, 1.8)
        self.AddParam("Pads", "Pad 1 Length (min)", self.uMM, 0.25)
        self.AddParam("Pads", "Pad 1 Length (max)", self.uMM, 0.75)
        self.AddParam("Pads", "Pad 2 Length (min)", self.uMM, 0.25)
        self.AddParam("Pads", "Pad 2 Length (max)", self.uMM, 0.75)
        
        # For components 1608 or larger
        self.JT_LARGE = [pcbnew.FromMM(0.55), pcbnew.FromMM(0.35), pcbnew.FromMM(0.15)]
        self.JH_LARGE = [pcbnew.FromMM(0.00), pcbnew.FromMM(0.00), pcbnew.FromMM(0.00)]
        self.JS_LARGE = [pcbnew.FromMM(0.05), pcbnew.FromMM(0.00), pcbnew.FromMM(-0.05)]
        self.COURTYARD_EXCESS_LARGE = [pcbnew.FromMM(0.50), pcbnew.FromMM(0.25), pcbnew.FromMM(0.10)]
        
        # For others
        self.JT_SMALL = [pcbnew.FromMM(0.30), pcbnew.FromMM(0.20), pcbnew.FromMM(0.10)]
        self.JH_SMALL = [pcbnew.FromMM(0.00), pcbnew.FromMM(0.00), pcbnew.FromMM(0.00)]
        self.JS_SMALL = [pcbnew.FromMM(0.05), pcbnew.FromMM(0.00), pcbnew.FromMM(-0.05)]
        self.COURTYARD_EXCESS_SMALL = [pcbnew.FromMM(0.20), pcbnew.FromMM(0.15), pcbnew.FromMM(0.10)]

    def CheckIpcParameters(self):
        """
        Check footprint specific parameters.

        This is specific to each footprint class, you need to implement
        this
        """
        self.ComponentHeightMax = self.parameters["Component"]["Height (max)"]
        self.ComponentLengthMin = self.parameters["Component"]["Length (min)"]
        self.ComponentLengthMax = self.parameters["Component"]["Length (max)"]
        self.ComponentWidthMin  = self.parameters["Component"]["Width (min)"]
        self.ComponentWidthMax  = self.parameters["Component"]["Width (max)"]
        self.Pad1LengthMin = self.parameters["Pads"]["Pad 1 Length (min)"]
        self.Pad1LengthMax = self.parameters["Pads"]["Pad 1 Length (max)"]
        self.Pad2LengthMin = self.parameters["Pads"]["Pad 2 Length (min)"]
        self.Pad2LengthMax = self.parameters["Pads"]["Pad 2 Length (max)"]
        self.PadNames = [1, 2]

    def calculateHeelFillet(self):
        """
        """
        return self.JH_LARGE[1] if self.__isAboveSizeLimit__() else self.JH_SMALL[1]

    def calculateSideFillet(self):
        """
        """
        return self.JS_LARGE[1] if self.__isAboveSizeLimit__() else self.JS_SMALL[1]

    def calculateToeFillet(self):
        """
        """
        return self.JT_LARGE[1] if self.__isAboveSizeLimit__() else self.JT_SMALL[1]

    def calculateZMax(self):
        """
        """
        
        lmin = self.ComponentLengthMin
        ltol = self.ComponentLengthMax - lmin
        
        zmax = lmin + 2 * self.calculateToeFillet() + math.sqrt(ltol**2 + pcbnew.FromMM(0.05)**2 + pcbnew.FromMM(0.1)**2)
        
        return int(zmax)

    def calculateGMin(self):
        """
        """
        
        lmin = self.ComponentLengthMin
        lmax = self.ComponentLengthMax
        ltol = lmax - lmin
        tmin = self.Pad1LengthMin
        tmax = self.Pad1LengthMax
        ttol = tmax - tmin
        
        stol = math.sqrt(ltol**2 + 2 * (ttol**2))
        
        sminw = lmin - 2*tmax
        smaxw = lmax - 2*tmin
        stolw = smaxw - sminw
        
        sdiff = (stolw-stol)/2
        smax = smaxw - sdiff
        
        gmin = smax - (2 * self.calculateHeelFillet()) - math.sqrt(stol**2 + pcbnew.FromMM(0.1)**2 + pcbnew.FromMM(0.05)**2)
        
        return int(gmin)

    def calculateXMax(self):
        """
        """
        
        wmin = self.ComponentWidthMin
        wmax = self.ComponentWidthMax
        wtol = wmax - wmin
        
        xmax = wmin + (2 * self.calculateSideFillet()) + math.sqrt(wtol**2 + pcbnew.FromMM(0.1)**2 + pcbnew.FromMM(0.05)**2)
        
        return int(xmax)

    def __isAboveSizeLimit__(self):
        """
        """
        length = (self.ComponentLengthMax + self.ComponentLengthMin)/2
        width = (self.ComponentWidthMax + self.ComponentWidthMin)/2
        
        area = length * width
        limit = pcbnew.FromMM(1.6) * pcbnew.FromMM(0.8)
        
        return True if (area) >= limit else False

    def CalculateCourtyardExcess(self):
        """
        """
        return self.COURTYARD_EXCESS_LARGE[1] if self.__isAboveSizeLimit__() else self.COURTYARD_EXCESS_SMALL[1]

    def BuildIpcPads(self):
        """
        Draw the IPC pads.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        
        zmax = self.calculateZMax()
        gmin = self.calculateGMin()
        xmax = self.calculateXMax()
        
        pad_width = xmax
        pad1_length = (zmax-gmin)/2
        pad2_length = pad1_length        
        pad_shape = pcbnew.PAD_RECT
        
        pad1 = PA.PadMaker(self.module).SMDPad(pad_width, pad1_length, shape=pad_shape)
        pad2 = PA.PadMaker(self.module).SMDPad(pad_width, pad2_length, shape=pad_shape)
        
        # Calculate pad locations
        x1 = -(zmax - pad1_length)/2
        x2 =  (zmax - pad2_length)/2
        
        # Draw pad 1
        pad1.SetPadName(self.PadNames[0])
        pad1.SetPos0(pcbnew.wxPoint(x1, 0))
        pad1.SetPosition(pcbnew.wxPoint(x1, 0))
        self.module.Add(pad1)
        
        # Draw pad 2
        pad2.SetPadName(self.PadNames[1])
        pad2.SetPos0(pcbnew.wxPoint(x2, 0))
        pad2.SetPosition(pcbnew.wxPoint(x2, 0))
        self.module.Add(pad2)

    def BuildIpcCourtyard(self):
        """
        Draw the IPC courtyard excess.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        
        zmax = self.calculateZMax()
        gmin = self.calculateGMin()
        xmax = self.calculateXMax()
        
        x = (zmax/2) + self.CourtyardExcess
        y = (xmax/2) + self.CourtyardExcess
        
        self.draw.SetLayer(pcbnew.F_CrtYd)
        self.draw.SetWidth(self.CourtyardLineWidth)
        self.draw.Polyline([(-x, y), (x, y), (x, -y), (-x, -y), (-x, y)])

    def BuildIpcFabDrawing(self):
        """
        Draw the IPC fab or assembly drawing.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        
        zmax = self.calculateZMax()
        gmin = self.calculateGMin()
        xmax = self.calculateXMax()
        
        x = self.ComponentLengthMax/2
        y = self.ComponentWidthMax/2
        
        self.draw.SetLayer(pcbnew.F_Fab)
        self.draw.SetWidth(self.FabLineWidth)
        self.draw.Polyline([(-x, y), (x, y), (x, -y), (-x, -y), (-x, y)])
        
        # Fit text
        l = len(self.GetValue())
        height = self.ComponentLengthMin / l
        size = pcbnew.wxSize(height, height)
        self.module.Value().SetSize(size)
        self.module.Value().SetThickness(int(height/10))

    def BuildIpcSilkscreen(self):
        """
        Draw the IPC silkscreen.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        
        zmax = self.calculateZMax()
        gmin = self.calculateGMin()
        xmax = self.calculateXMax()
        
        x = (self.ComponentLengthMax/2)
        y = (xmax/2) + self.SilkscreenClearance + (self.SilkscreenLineWidth/2)
        
        self.draw.SetLayer(pcbnew.F_SilkS)
        self.draw.SetWidth(self.SilkscreenLineWidth)
        self.draw.Polyline([(-x, y), (x, y)])
        self.draw.Polyline([(-x, -y), (x, -y)])

        # Draw text
        height = pcbnew.FromMM(1.2)
        size = pcbnew.wxSize(height, height)
        self.module.Reference().SetSize(size)
        self.module.Reference().SetThickness(int(height / 10))
        
        y = -xmax/2 - self.CourtyardExcess - (self.SilkscreenLineWidth/2) - self.SilkscreenClearance - pcbnew.FromMM(1.2/2)
        self.module.Reference().SetPosition(pcbnew.wxPoint(0, y))

class IpcChipPolarizedWizard(IpcChipWizard):
    """
    """

    def BuildIpcFabDrawing(self):
        """
        Draw the IPC fab or assembly drawing.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        
        zmax = self.calculateZMax()
        gmin = self.calculateGMin()
        xmax = self.calculateXMax()
        
        x = self.ComponentLengthMax/2
        y = self.ComponentWidthMax/2
        
        small_side = (2*y) if x > y else (2*x)
        chamfer = (small_side/3) if (small_side/3) < pcbnew.FromMM(1.27) else pcbnew.FromMM(1.27)
        
        self.draw.SetLayer(pcbnew.F_Fab)
        self.draw.SetWidth(self.FabLineWidth)
        self.draw.Polyline([(-x, y), (x, y), (x, -y), (-x + chamfer, -y), (-x, -y + chamfer), (-x, y)])
        
        # Fit text
        l = len(self.GetValue())
        height = self.ComponentLengthMin / l
        size = pcbnew.wxSize(height, height)
        self.module.Value().SetSize(size)
        self.module.Value().SetThickness(int(height/10))

    def BuildIpcSilkscreen(self):
        """
        Draw the IPC silkscreen.

        This is specific to each footprint class, you need to implement
        this to draw what you want
        """
        
        zmax = self.calculateZMax()
        gmin = self.calculateGMin()
        xmax = self.calculateXMax()
        
        x_left = -(zmax/2) - self.SilkscreenClearance - (self.SilkscreenLineWidth/2)
        x_right = (self.ComponentLengthMax/2)
        y = (xmax/2) + self.SilkscreenClearance + (self.SilkscreenLineWidth/2)
        
        # Draw outline
        self.draw.SetLayer(pcbnew.F_SilkS)
        self.draw.SetWidth(self.SilkscreenLineWidth)
        self.draw.Polyline([(x_right, y), (x_left, y), (x_left, -y), (x_right, -y)])
        
        # Draw pin 1 / cathode indicator
        x = x_left - self.SilkscreenClearance - pcbnew.FromMM(0.2)
        self.draw.SetWidth(pcbnew.FromMM(0.2))
        self.draw.Circle(x, 0, pcbnew.FromMM(0.10))
        
        # Draw text
        height = pcbnew.FromMM(1.2)
        size = pcbnew.wxSize(height, height)
        self.module.Reference().SetSize(size)
        
        y = -xmax/2 - self.CourtyardExcess - (self.SilkscreenLineWidth/2) - self.SilkscreenClearance - pcbnew.FromMM(1.2/2)
        self.module.Reference().SetPosition(pcbnew.wxPoint(0, y))
        self.module.Reference().SetThickness(int(height / 10))

class IpcChipResistorWizard(IpcChipWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC RESC'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Resistor'

    def GetValue(self):
        """
        """
        prefix = 'RESC'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'R'

class IpcChipCapacitorWizard(IpcChipWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC CAPC'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Capacitor'

    def GetValue(self):
        """
        """
        prefix = 'CAPC'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'C'

class IpcChipCapacitorPolarizedWizard(IpcChipPolarizedWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC CAPCP'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Capacitor, Polarized'

    def GetValue(self):
        """
        """
        prefix = 'CAPCP'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'C'

class IpcChipDiodeWizard(IpcChipPolarizedWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC DIOC'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Diode'

    def GetValue(self):
        """
        """
        prefix = 'DIOC'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'D'

    def BuildIpcPads(self):
        """
        """
        self.PadNames = ['C', 'A']
        IpcChipPolarizedWizard.BuildIpcPads(self)

class IpcChipDiodeNonPolarizedWizard(IpcChipWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC DIOCN'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Diode, Non-Polarized'

    def GetValue(self):
        """
        """
        prefix = 'DIOCN'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'D'

class IpcChipFuseWizard(IpcChipWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC FUSC'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Fuse'

    def GetValue(self):
        """
        """
        prefix = 'FUSC'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'F'

class IpcChipInductorWizard(IpcChipWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC INDC'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Inductor'

    def GetValue(self):
        """
        """
        prefix = 'INDC'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'L'

class IpcChipLedWizard(IpcChipDiodeWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC LEDC'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip LED'

    def GetValue(self):
        """
        """
        prefix = 'LEDC'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

class IpcChipThermistorWizard(IpcChipWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC THRMC'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Thermistor'

    def GetValue(self):
        """
        """
        prefix = 'THRMC'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'RT'

class IpcChipVaristorWizard(IpcChipWizard):
    """
    """

    def GetName(self):
        """
        Return footprint name.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC VARC'

    def GetDescription(self):
        """
        Return footprint description.

        This is specific to each footprint class, you need to implement
        this
        """
        return 'IPC Chip Varistor'

    def GetValue(self):
        """
        """
        prefix = 'VARC'
        length = int((self.ComponentLengthMin + self.ComponentLengthMax)/200000)
        width = int((self.ComponentWidthMin + self.ComponentWidthMax)/200000)
        height = int(self.ComponentHeightMax/10000)
        suffix = 'N'
        return prefix + str(length) + str(width) + 'X' + str(height) + str(suffix)

    def GetReferencePrefix(self):
        """
        """
        return 'RV'

IpcChipCapacitorWizard().register()
IpcChipCapacitorPolarizedWizard().register()
IpcChipDiodeWizard().register()
IpcChipDiodeNonPolarizedWizard().register()
IpcChipFuseWizard().register()
IpcChipInductorWizard().register()
IpcChipLedWizard().register()
IpcChipResistorWizard().register()
IpcChipThermistorWizard().register()
IpcChipVaristorWizard().register()

Attachment: ecad_1.png
Description: PNG image