Coder Social home page Coder Social logo

kicad_action_plugins's People

Contributors

awmt102 avatar bcbnz avatar billypocketnc avatar forty-bot avatar hildogjr avatar jakobhaufe avatar jordiorlando avatar majorbreakfast avatar mitjanemec avatar ondrejpopp avatar prasetekus avatar qu1ck avatar stfrick avatar sur5r avatar sww1235 avatar theslowgrowth avatar whinis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kicad_action_plugins's Issues

Replicate parts but not tracks

Last try of replicate plugins, I got the replicated placement but not the tracks and vias. The error:

Traceback (most recent call last):
File "/home/h/.kicad_plugins/replicate_layout/action_replicate_layout.py", line 302, in Run
polar)
File "/home/h/.kicad_plugins/replicate_layout/replicatelayout.py", line 943, in replicate_layout
self.replicate_tracks(x_offset, y_offset, polar)
File "/home/h/.kicad_plugins/replicate_layout/replicatelayout.py", line 764, in replicate_tracks
net_pairs, net_dict = self.get_net_pairs(sheet)
File "/home/h/.kicad_plugins/replicate_layout/replicatelayout.py", line 478, in get_net_pairs
index = match_len.index(max(match_len))
ValueError: max() arg is an empty sequence

[feature] undo function for archive_project

It would be nice to have a function to undo the changes to the project done by archive footprint later if you want to do changes on the project again for bugfixing or a completely new version.

most important: change the modified paths for documentation, 3dmodels, schematic symbols back to their global origin. this probably would need to save this informations during the archiving process.

nice to have (but probably easier): remove the archived libs in the project directory (documentations and 3d-shapes folder, archive-lib)

Exception swapping pins

I'm really excited to see this plugin work, but it isn't working for me.

I'm running Kicad 5.0 rc2 (June 21 version) on Windows 10 64-bit. With my schematic closed, I've selected 2 pads on a part and tried executing SwapPins through the Tools->External Plugins menu item, but I get an exception. I can't copy and paste the whole string of errors, but here is a summary:

Line 86: swap_pins.swap(board,pad1,pad2)
Line39: all_sch_files = find_all_sch_files(main_sch_file,all_sch_files)
Line 178: seznam = find_all_sch_files(sheet,list_of_files)
Line 177: for sheet in extract_subsheets(filename):

File "C:/Program Files/Kicad/share/kicad/scripting/plugings/swap_pins.py", line 136, in extract subsheets
with open(filename) as f:
IOError (2, 'No such file or directory', C:\path_to_project_dir\~M2OE')

~M2OE is a signal name, so the script shouldn't be trying to open it as a file.

Hope that helps debug the issue.

Replicate parts doen't take account REF width

Replicate parts doen't take account REF width / height / tickness.

To reproduce:

  1. Do the placement and tracks of one channel;
  2. Adjust the Reference Silk, change it width / height / tickness;
  3. Use the replicate plugin;
  4. See that the new parts follow the standard library / Pcbnew silk configuration.

Propose:
Add a check box on the plugin: "replicate the silk configurations".

Can't install

I copied relevant folder into ~/.kicad_plugins and refresh plugins. But these tools didn't show up in external plugins. I tried to copy kicad/demos/python_scripts_examples/action_plugin_test_undoredo.py there, this script works well. So I want to know some details about the installation.
Thank you!

Application: kicad
Version: 5.1.2+dfsg1-1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.64.0 OpenSSL/1.1.1c zlib/1.2.9 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.67.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.64.0
Compiler: Clang 7.0.1 with C++ ABI 1002

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

pad2pad: Crash using latest nightly build

When using the KiCad version at the bottom of this post, from 24 Feb 2019, I see the following error message:
image

Note that net2net works for me.

Application: pcbnew
Version: (5.1.0-rc1-136-g8ad15b1d6), release build
Libraries:
wxWidgets 3.0.4
libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.68.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.61.1
Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

Swap pins fails to draw nets

Hello Again,

Although you fixed swap_pins, I've found that it fails to move a pin that has already been swapped. I think it's related to the way the nets are drawn on the schematic. When swap_pins moves a pin, it's moving the label to a non-existent net on top of the symbol pin instead of moving the label with it's attached net. If I fix the schematic to include a net, then the swap works.

The anchor for the label could use some adjustment if it's possible. Looks like labels have their anchor on the side of the text that is closest to the symbol, so when labels are moved from one side of a symbol to the other, maybe the anchor can move as well.

Here is the exception I get when I try swap a pin that has already been swapped before:

image

and here is what the schematic looks like as a result of swapped pins:

image

Replicated Layout don't create any tracks

Hello. I tried to use plugins both on MacOS and Win7.
First I want to say that it start working when I put it in different folder than specified in README.md
On MacOs it was inside the packet ~Kicad/contents/sharedsupport/scripting/plugins not in ~Library. On windows C:\Program Files\KiCad\share\kicad\scripting\plugins
On MacOS it's ok. But on Win7 all components goes to the same places, but no any traces create. And I have a message fatal error when making an instance of replicator.

replicate_layout.log

KiCad 5.02, Linux, replicate layout

After installing the replicate plugin in KiCad 5.02 (Ubuntu 18.04), PCBNew crashes on every start up.

Is there a log somewhere from where I can get more information?

[feature] datasheet archiving from protected addresses

the datasheet archiving only works for open access links but some manufacturers and network storages only grant access to documents with a valid user account. so these datasheets can not be copied for now.

at least from my side a very low priority feature because I store my datasheets not with this feature, but some others may need it.

Add tests to replicate_layout

Add tests to replicate layout to test:

  • when pivot module is not the first in sequence
  • when selected sheets are before and after the pivot module sequence wise

Create a 'update mode' on `replicate_layout`

replicate_layout already have the XY align and the circular align, so create a 'update mode' on replicate_layout to just update the already created replicated layouts. Use the selected component in the base layout as offset/origin in all the other ones; so the position of these components will not change in Pcbnew.
This may be useful to update the various replicated layout after integrated in the big layout.

Swap pins exception

Hello Mitja,

Unfortunately, I'm getting an exception when trying to run your indispensable swap pins plugin while using Kicad version 5.0.1-44. I've looked at the log and don't see anything significant. Here is a screenshot of the exception:

image

Thanks

Fatal error when executing place footprints in matrix

08-20 08:09:23 place_footprints.action_place_footprints 687:Fatal error when executing place footprints
Traceback (most recent call last):
File "C:\Users\xiaoxu.niu.WONDERLAN\AppData\Roaming\kicad\scripting\plugins/place_footprints/action_place_footprints.py", line 682, in Run
placer.place_matrix(sorted_modules, step_x, step_y, nr_columns)
TypeError: place_matrix() takes exactly 6 arguments (5 given)

pad2pad_track_distance - support entire nets

The existing functionality is impressive! Thank you!

Especially when doing designs that have primary circuits connected to an AC mains and secondary circuits which need isolation, there are creepage rules. This will apply to an entire net and not just the pads/tracks on the net (also zones, for example). It would be great to have the tool that checks the distance between one net and another net, combing through each element on the net to find the closest distance between nets.

Replicate layout rotates all components and does not layout tracks.

Hello:

I am grateful that you took on the challenge of updating mmccoo's replicate layout script and implemented it as a proper module. Your version at least partially works ๐Ÿ‘ .

I attempted to use the master branch as of f763c1a and had the following behavior with version 2017-09-29-revision b6d54ac for Mac OS X.

I installed the plugin where it seems things work for now on mac, which is /Applications/KiCad/Kicad.app/Contents/SharedSupport/scripting/plugins with the replicatelayout directory inside plugins.

It showed up in the plugins menu just fine and the dialog box appeared when I ran it. I entered a y offset but no x offset and selected linear offset.

When I clicked ok, I got the traceback inserted at the end in another dialog box, and when I clicked ok on it, the footprints were moved to their proper place but no tracks were replicated and all the replicated footprints had been rotated 45 degrees.

I also ran the replicatelayout.py file separately without moving it with the following result:

ฮฉ:python3 replicatelayout.py all
  File "replicatelayout.py", line 666
    print "passed all tests"
                           ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print "passed all tests")?

It almost seems like part of the linear replicator is getting called, and part of the polar replicator is getting called.

From looking back through the Kicad launchpad git history, it seems like this commit broke the script, which was probably released hours after they compiled the windows daily release for 2017-9-19.

Traceback (most recent call last):

  File "/Applications/Kicad/kicad.app/Contents/SharedSupport/scripting/plugins/replicate_layout/action_replicate_layout.py", line 232, in Run
    polar)

  File "/Applications/Kicad/kicad.app/Contents/SharedSupport/scripting/plugins/replicate_layout/replicatelayout.py", line 595, in replicate_layout
    self.replicate_tracks(x_offset, y_offset, polar)

  File "/Applications/Kicad/kicad.app/Contents/SharedSupport/scripting/plugins/replicate_layout/replicatelayout.py", line 443, in replicate_tracks
    net_pairs, net_dict = self.get_net_pairs(sheet)

  File "/Applications/Kicad/kicad.app/Contents/SharedSupport/scripting/plugins/replicate_layout/replicatelayout.py", line 277, in get_net_pairs
    pad_name = p_pad.GetPadName()

  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/pcbnew.py", line 9338, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, D_PAD, name)

  File "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/pcbnew.py", line 83, in _swig_getattr
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))

AttributeError: 'D_PAD' object has no attribute 'GetPadName'

Replicate layout: Multiple copies end up at the same position

First: thank you for this plugin, I greatly appreciate your work!

I have the following issue running the latest c3395f2: my board has two copies of a single hierarchical sheet. I want both copies to each adapt layout and traces from the third (pre-configured) copy. But when I run the script, the two instances always end up at the same (overlapping) position. This also happens when I try to deselect one of the two copies in the dialog.

Am I doing something wrong, or is this a genuine issue with the plugin?

Demonstration: https://sukzessiv.net/~gohai/kicad/overlap.mp4

If this matters: here is my hierarchy

  • NOT2
  • CLK
    • instance of NOT2
    • instance of NOT2

Replicate layout does not handle component rotation on back side

Components on back side are rotated incorrectly. The replicated component is rotated the inverse of the pivot component. For example:

  • pivot = 90, replicated = 270
  • pivot = 270, replicated = 90

I am running KiCad 5.1.2-201904240820+f72e74a84ubuntu18.04.1 amd64.

Broken dialog in PCBnew

Thanks for the plugins!

I am using the kicad 5rc2
It seems that the plugin dialog is broken here.

The dialog when executing:
grafik

Clicking the radiobuttons does not change that both are ticked.
I can however switch to the circular window and back.
grafik

Observation 1:
I can input the linear data. If I execute the script, it is interpreted as circular data (x offset being the radius and y offset the angle)

Observation 2:
Circular execution is working as expected

My guess is that in the dialog initialization something is broken.
With a quick lock in the code didn't find the reason.

If you need any more informations or pics just let me know.

Thanks a lot!

Request: Archive datasheets

It would be quite useful if the project archiver would pull all of the datasheets from the web and place them in a datasheets or docs folder, then update the datasheet field to point to the new path.

This way, if you open the project in 10 years, you will still have access to the datasheets.

Not copyng module (improve error message)

I am using the last KiCad NIgthly on Ubuntu 16 and constantly getting the message: "More or less than 1 module selected. Please select exactly one module and run the script again.".

Screenshot from 2019-04-10 09-55-38

As far I know, I selected exactly the necessary one instance of the module. So, I don't known if it is a version compatibility error.

Could this message be improved to give me some tip about (each components are missing or were selected in excess).

I am also having the same error with the PCB examples.

Crash on kicad 5.0.1 Windows 10

Hi,
I encounter a problem in my Kicad 5.0.1 installation on Windows 10, when I run your plugins I get an error "IndexError: list index out od range".
The problem seems to be in the followings code:

def Run(self):
        _pcbnew_frame = \
            filter(lambda w: w.GetTitle().startswith('Pcbnew'),
                   wx.GetTopLevelWindows()
                   )[0]

I replaced it with:

    def Run(self):
        _pcbnew_frame = wx.GetActiveWindow()

And now it seems to work correctly.

By the way, your plugins are very useful, in particular the replicator.
Thank you again for your great work.

Suggestions for replicate_layout instructions

Description of issue

I was trying to duplicate a block of components/tracks/vias 5+ times and had a bit of trouble getting the plugin to work initially. I duplicated the hierarchical block in the top level sheet like so (stripped down for tests):

screen shot 2019-01-21 at 4 36 05 pm

(They have unique timestamps, not sure if this is relevant or not). The tree looks similar to the example gif in the repo.

image

After selecting the main footprint in PCBnew and running the plugin, I get the following error when it attempts to find the levels:

Traceback (most recent call last):

  File "/Applications/KiCad/kicad.app/Contents/SharedSupport/scripting/replicate_layout/action_replicate_layout.py", line 334, in Run
    replicator.calculate_spacing(sheet_levels[-1])

IndexError: list index out of range

Resolution

It took a while to figure out that I needed to:

  1. Annotate for the new parts in the duplicated sheet
  2. Import these parts into the existing pcb before the tool would work successfully.

Suggestion

I'm not a python/scripting person, but improving error handling to be a little more verbose in this particular error case would help a lot.

Alternatively, I could PR some more specific instructions into the readme (or separate guide document) if you want, its a great tool and I'd like to save someone the frustration I had!

Thanks!


System: Mac OSX 10.14, KiCAD 5.0.2, plugins are from current master branch 0e88015.

archive_project doesn't work depending on language setting

I am using german language and the closing of pcbnew at the end of the process doesn't work.
This is because the key combination changes with language. When I change the language to english it works fine.
I modified my .py file to use the german combination wich is Alt+d ->b ->tab ->enter and it works fine, too.

But nonetheless a great plugin, thanks for your work!

Replicate layout not replicating all tracks

Hello:

Using the Bugfix_circular_in_y_linear branch

Unfortunately, I didn't notice if this happened on nightly 2017-09-29, but it does happen on 2018-02-01.

Stupidly, I forgot to backup my 2017-09-29 copy before installing the new one over the top of it. I might be able to retrieve an older nightly, but am not hopeful.

What appears to happen is that the bounding box for replication appears to be just around the footprints and does not take tracks into account.

The top layout is the original layout, the bottom layout is the replicated layout but missing the top most and bottom most traces of the original.

screen shot 2018-02-01 at 09 59 34

Replicate silk annotations

A interesting feature would be replicate also (by one checkbox option) replicate the silk annotation inside the boundary of the hierarchical layout.

Procedure (internal idea to the algorithm):

  1. Replicate the parts and tracks;
  2. Check the silk that are inside (or at least some part inside) the boundary defined by the already made layout (we have to check how to do this with the pcbnew package);
  3. Replicate this silk annotations.

net2net: Support selecting elements other than pads

Running the script fails if two and only two pads are not selected.

Since this is a net tool, allow selection of vias, tracks, and other elements that are part of a net. Or any combination of those elements. You mentioned at #29 that it is not going to work for zones so I didn't list them.

Remove duplicated track

Sometimes we duplicate a layout and forgot to check the "remove existing tracks/zones/drawings", making place of duplicated symbols / silks / tracks in each instance of the layout.

Should be interesting check for this occurrences and delete them, even in the source layout.

archive_project doesn't archive the page layout description file

As the title says, a configured page layout file isn't archived so does not become portable.

I'd like the archive_project to copy the defined page layout file for both schematic and pcb to the project folder and then redirect the path to the project directory.

The setting for the page layout for both EEschema and PCBNew is in the project .pro file, so that might make this difficult...

Vias do not replicate drill size

Hi,

I've got a large VIA on my board, and I've noticed that the script doesn't replicate the inner (drilled) hole, only the outer part.

swap_unit fails when unit pins don't have a name

swap_units fails when unit pins don't have a name. E.g. 74HC14 both pins have the same name "~" the result is swapped pins of one or both units only in layout (input is connected where output whs connected and vice versa)

replicate_layout.log is missing

Hello,

I upgraded my computer from an older Mac Air running OS X 10.12.6 Sierra to MacBook Air running OS X 10.14.4 Mojave with 16 Gbytes of RAM.

The file "replicate_layout.log" for my current project is missing from my current computer. Ones from previous projects exist on my old computer, but none with dates more recent than March 9.

To determine where the problem was, I copied the KiCad project that produced a "replicate_layout.log" file on my previous computer to the new one. I then used the new machine to see if the "replicate_layout.log" would be produced when I ran "Place_footprints" and then "replicate_layout" again on a layout that was know to produce that file on the older machine. The log file was not created on the new machine.

So, things that have changed for that test case:

  1. A new computer, but merely an upgraded version of the old one,
  2. A new version of the operating system (paths may have changed),
  3. A new version of KiCad (the old version is (5.0.2-5)-5, release build; the new one is 5.1.0-0, release build),
    4 A new install of Action Plugins "Place_footprints" and "Replicate_layout".

Things that have not changed:

  1. the test file,
  2. the procedure followed.

I need to get the "replicate_layout.log" because I am trying to track down a few other issues. Any help would be greatly appreciated.

Best regards,
Peter

Open issues with python3

As mentioned in the kicad forum thread, there are open issues with the scripts on python3 systems. only swap_pins, swap_units and Pad2Pad_Distance plugin appear in the external plugin list after refreshing, every other plugin is missing.

Pad2Pad_distance raises an AttributeError: module 'pad2pad_track_distance' hads no attribute 'Distance' for code line 95 for action_pad2pad_track_distance.py

swap_pins raises an AttributeError: module 'wx' has no attribute 'wx' for line 49 in action_swap_pins.py

swap_units raises an AttributeError: module 'wx' has no attribute 'wx' for line 49 in action_swap_units.py

Kicad info:

Application: kicad
Version: 5.1.0-060a0da~80~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-46-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Replicate layout: If run before saving all sheets in eeschema gives criptic message.

To reproduce the issue:
-Create a hierarchical sheet with some components in it (assign also footprints), don't save it.
-Copy and paste the hierarchical sheet (don't save).
Syncrhronize pcb (F8)
Use the script on one of the newly created sheets. An error pop up is shown with the message "u'5D76A583" and the "ok" button (that seems to be the unique timestamp of the new sheet with the components to be placed).

Tested on master branch kicad,
Cheers,
Dino.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.