Missing data from Net inspector

Hi Guys,
Thanks to Kicad developers. It’s just a great fantastic job!

I miss a Manhattan length computation (Fromto length) in Net inspector. I use this data with Excel after placement (And before any routing) to check transmission line length and compute Transition Equivalent Length to implement adaptation loads when necessary.
Today this function is absolutely mandatory to validate routing on DDRx memories and high speed differential synchronous busses as HDMI, DSI, CSI etc.
By the way, via length & total length are not very useful because part of via travelled by signal is not exactly computed. Can be removed or improved in a later release.
Great to think about “die to pad length” to synchronize bus length. Thanks a lot for this feature.

Mecagigi.

Hi,
you can use my plugin to do this.
Put the files from Index of /kicadplugin in the kicad scripting directory.
Texts are in french but you can translate them by yourself.
Eric
Python code :

import pcbnew
import os
import wx

from pcbnew import *
class MesurePistePlugin(pcbnew.ActionPlugin):
    def defaults(self):
        self.name = "Mesurer tous les nets et la piste sélectionnée"
        self.category = "Mesure"
        self.description = "Mesure la longueur de tous les nets du circuit imprimé et de la piste sélectionnée"
        self.show_toolbar_button = True
        self.icon_file_name = os.path.join(os.path.dirname(__file__), 'longueur_pistes.png')

    def Run(self):
        carte = GetBoard()
        pistes = carte.GetTracks()
        nbSegmentsSelection = 0
        longueurSelection = 0
        longueurParNet = dict()
        nbSegmentsParNet = dict()
        longueurTotale = 0

        for piste in pistes:
            #wx.MessageBox(piste.GetNetname(), 'Nom de la piste', wx.OK | wx.ICON_INFORMATION)
            if piste.GetNetname() in longueurParNet:
                longueurParNet[piste.GetNetname()] = longueurParNet[piste.GetNetname()] + piste.GetLength()/1000000
                nbSegmentsParNet[piste.GetNetname()] = nbSegmentsParNet[piste.GetNetname()] + 1
            else:
                longueurParNet[piste.GetNetname()] = piste.GetLength()/1000000
                nbSegmentsParNet[piste.GetNetname()] = 1
            if piste.IsSelected():
                longueurSelection = longueurSelection + piste.GetLength()/1000000
                nbSegmentsSelection = nbSegmentsSelection + 1
        bilan = ''
        for net in longueurParNet:
            longueurTotale = longueurTotale + longueurParNet[net]
            #bilan = bilan + 'Longueur de l\'équipotentielle ' + net + ' : ' + str(longueurParNet[net]) + ' mm en ' + str(nbSegmentsParNet[net]) + ' segment(s).\n'
            bilan = bilan + 'Longueur de l\'équipotentielle ' + net + ' : {0:4.3f}'.format(longueurParNet[net]) + ' mm en ' + str(nbSegmentsParNet[net]) + ' segment(s).\n'
        if nbSegmentsSelection > 0:
            bilan = bilan + '\nLongueur de piste(s) sélectionnée(s) : {0:4.3f}'.format(longueurSelection) + ' mm en ' + str(nbSegmentsSelection) + ' segment(s).\n'
        bilan = bilan + '\nLongueur totale de pistes : {0:4.3f}'.format(longueurTotale) + 'mm'
        wx.MessageBox(bilan, 'Mesure des longueurs de pistes', wx.OK | wx.ICON_INFORMATION)
        
MesurePistePlugin().register()

type or paste code here

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.