[Kicad-developers] Should SCH_COMPONENT::m_convert default to 1?

2019-03-23 Thread Jon Evans
For context, I've been looking at the issues in this forum thread:
https://forum.kicad.info/t/before-giving-up-on-kicad-one-last-attempt-erc-misery/15933/63

I have already pushed a band-aid fix to "repair" these situations, but it
looks like they are being caused by the EAGLE importer (or at least that is
one path to this situation coming up)

Specifically, it looks like m_convert is set to 0 in SCH_COMPONENT::Init(),
but this value is not valid (it should be at least 1 for components).

Are there any cases that I am missing, where it makes sense for a component
to have m_convert set to 0?  If not, it's an easy fix in that Init() to set
it to 1.  If so, we can just update the SCH_EAGLE_PLUGIN to call
SetConvert() wherever it creates new components.

-Jon
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [eeschema] Names/descriptions for units

2019-03-23 Thread Kliment (Future Bits)
I have a prototype implementation of this now - descriptions are
currently taken from fields _UNITDESC_A, _UNITDESC_B etc. The unit
descriptions show up when browsing parts in the add dialog, and in the
dropdown menu when selecting units in the symbol editor. There is no GUI
for setting unit names yet - for the moment you have to add them as
normal fields. Patch is attached. All feedback very welcome.

Kliment

On 22.03.19 21:56, Kliment (Future Bits) wrote:
> I don't quite follow - what I'm proposing doesn't require any file
> format changes, I was planning to just use the existing field functionality.
> 
> If you want to bake it into the format instead, I'm 100% okay with that,
> but I don't think it's necessary. I'll look into implementing the UI
> functionality and defer to you on how/where to store the data.
> 
> On 22.03.19 21:45, Wayne Stambaugh wrote:
>> Hi Kliment
>>
>> This cannot happen until the new symbol library file format is
>> implemented.  There is a freeze (except for the new bus expansion
>> changes) on the current file format.  I will add a unit description
>> field for units in the new file format this way you can add a unique
>> description for each unit should you desire.
>>
>> Cheers,
>>
>> Wayne
>>
>> On 3/22/19 4:38 AM, Kliment (Future Bits) wrote:
>>> Hey,
>>>
>>> I'm working with a part that has a very large number of
>>> non-interchangeable units, each with many pins. For a part like this,
>>> it's very difficult to tell which unit is which from the preview. Parts
>>> have a description field that is shown in the list, but units don't. For
>>> parts with non-interchangeable units, I think a description like that
>>> would be very useful. I'd be interested in implementing such a thing.
>>> One way I can think of of doing this would be as follows:
>>>
>>> UI changes:
>>> 1. minor change to add part/component selection dialog - use the space
>>> to the right of "Unit A" etc to show description, add description to the
>>> space after the RD in the bottom part of the dialog
>>>
>>> 2. change to symbol editor - display unit description after "Unit A" in
>>> unit dropdown
>>>
>>> optionally, 3. make unit dropdown editable, make changes there save to
>>> unit name
>>>
>>> I would propose storing the descriptions in fields with special names of
>>> the form UNITDESC_A, _B etc. This requires no change to the existing
>>> data model.
>>>
>>> I'd like some feedback on a) whether this is a good idea, b) whether I'm
>>> stepping on anyone's toes if I do it and c) what branch should I base it off
>>>
>>> Thanks!
>>>
>>> Kliment
>>>
>>> ___
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

From f8432c1eb96eef566254f5e6006060d09022444c Mon Sep 17 00:00:00 2001
From: Kliment Yanev 
Date: Sun, 24 Mar 2019 00:23:00 +0100
Subject: [PATCH] Add unit label functionality If a part has _UNITDESC_A,
 _UNITDESC_B etc fields their values will be shown as the unit description in
 the part selection dialog and the unit selection dropdown

---
 common/lib_tree_model.cpp   |  3 +--
 eeschema/class_libentry.cpp | 17 +
 eeschema/class_libentry.h   | 11 +++
 eeschema/libedit/lib_edit_frame.cpp |  2 +-
 include/lib_tree_item.h |  1 +
 5 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/common/lib_tree_model.cpp b/common/lib_tree_model.cpp
index 71fe74c7d..dbee70166 100644
--- a/common/lib_tree_model.cpp
+++ b/common/lib_tree_model.cpp
@@ -129,7 +129,6 @@ LIB_TREE_NODE_UNIT::LIB_TREE_NODE_UNIT( LIB_TREE_NODE* aParent, LIB_TREE_ITEM* a
 {
 static void* locale = nullptr;
 static wxString namePrefix;
-
 // Fetching translations can take a surprising amount of time when loading libraries,
 // so only do it when necessary.
 if( Pgm().GetLocale() != locale )
@@ -145,7 +144,7 @@ LIB_TREE_NODE_UNIT::LIB_TREE_NODE_UNIT( LIB_TREE_NODE* aParent, LIB_TREE_ITEM* a
 LibId = aParent->LibId;
 
 Name = namePrefix + " " + aItem->GetUnitReference( aUnit );
-Desc = wxEmptyString;
+Desc = aItem->GetUnitDescription( aUnit );
 MatchName = wxEmptyString;
 
 IntrinsicRank = -aUnit;
diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp
index 0a96

[Kicad-developers] [RFC] online (real-time) ERC/DRC

2019-03-23 Thread Jon Evans
Hi all,

I would like to start laying the groundwork for online ERC/DRC.

This means, for example:
- Objects will know if they have any ERC/DRC errors
- If objects are edited, associated error markers can be cleared/updated

Eventually, we could add a (optional) mode where new ERC/DRC errors can be
added in real-time as the user edits.  To begin, I'd only be clearing or
updating existing errors (generated with the offline / batch ERC/DRC
process we have now).

For the schematic, I think all ERC checking will able to be done in
real-time once my new connectivity stuff is merged.  For the PCB, of course
there are some DRC checks that are way too slow to be done in real-time,
but we could explore whether some checks are fast enough.

I would start with the schematic ERC since that's where my head is at right
now, but what I do should be able to carry over to PcbNew in case it ends
up working well.

Any thoughts on this?

-Jon
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] get initial Python 3 support

2019-03-23 Thread Wayne Stambaugh
Thanks Nick!

On 3/23/19 7:47 AM, Nick Østergaard wrote:
> Ok, I can try that, but I am on vacation thus week, so I am not sure I
> will get arpund to it very soon.
> 
> lør. 23. mar. 2019 12.34 skrev Mitja Nemec  >:
> 
> Hi Nick!
> 
> As a python plugin writer, I am starting to get bug reports from
> ubuntu 18.04 users, as with 5.1 supporting GTK3 they've finally
> managed to run python plugins.
> More than half a year ago, you've made a Kicad python3 windows
> installer with WXPYTHON disabled. At that time this enabled me to
> test the business logic of my plugins.
> 
> I would really appreciate if you could make a 5.1 windows installer
> with python3 support and WXPYTHON disabled. But if you are tight on
> time, I can totally understand.
> 
> Best regards, Mitja
> 
> 
> 
> *From:* Nick Østergaard mailto:oe.n...@gmail.com>>
> *To:* thomas.pointhu...@gmx.at 
> *Cc:* KiCad Developers  >
> *Sent:* Tuesday, 14 August 2018, 23:26
> *Subject:* Re: [Kicad-developers] [PATCH] get initial Python 3 support
> 
> Hi Thomas,
> 
> I am happy to see that we port to python3 for various reasons, that
> should be obvious to everyone.
> 
> I have been testing your branch a bit on windows, just to get an
> overview of what changes might be needed. So far I think I made it
> work as you have on linux.
> 
> A lite installer is available on [link will disappear eventually]
> 
> http://downloads.kicad-pcb.org/windows/testing/patched/kicad-patched-88-review-8244-gef7a2fcc3-x86_64.exe
> 
> The build is of course with wxpython disabled, as it is my
> understanding that it does not support python3, and the next step is
> to migrate to wx phoenix which should indeed support python3.
> 
> I could start the python.exe inside the kicad/bin dir and import
> pcbnew without errors.
> 
> I did not try to run any standalone scripts.
> 
> I did try a couple of footprint wizards in the footprint editor, and
> some of them seemingly worked. But the BARCODE USS-39 errors. It looks
> like it needs to be updated to py3k syntax.
> 
> Regards
> Nick Østergaard
> Den lør. 4. aug. 2018 kl. 12.23 skrev Thomas Pointhuber
> mailto:thomas.pointhu...@gmx.at>>:
> >
> > Hi,
> >
> > I managed to get KiCad to run with Python 3 as well as did some quick
> > verification that basic methods are working using CLI (loading boards,
> > calling a method of it).
> >
> > Bugreport: https://bugs.launchpad.net/kicad/+bug/1785119
> >
> > My Branch: https://github.com/pointhi/kicad-source-mirror/tree/python3
> >
> > scripting inside of kicad was not tested because I'm not really
> familiar
> > with it right now, as well as because of known wx problems with
> that stuff.
> >
> > For now it can be enabled using -DKICAD_SCRIPTING_PYTHON3=ON
> > It is not possible to export modules for python 2 and python 3
> with one
> > build at the moment, but this should a thing which can be fixed in the
> > build-script.
> >
> > I made some small changes to existing python code to get it working on
> > both versions. To my knowledge and tests the scripts should not have
> > changed behavior.
> >
> > Regards, Thomas
> >
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to    : kicad-developers@lists.launchpad.net
> 
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help  : https://help.launchpad.net/ListHelp
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to    : kicad-developers@lists.launchpad.net
> 
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help  : https://help.launchpad.net/ListHelp
> 
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] get initial Python 3 support

2019-03-23 Thread Nick Østergaard
Ok, I can try that, but I am on vacation thus week, so I am not sure I will
get arpund to it very soon.

lør. 23. mar. 2019 12.34 skrev Mitja Nemec :

> Hi Nick!
>
> As a python plugin writer, I am starting to get bug reports from ubuntu
> 18.04 users, as with 5.1 supporting GTK3 they've finally managed to run
> python plugins.
> More than half a year ago, you've made a Kicad python3 windows installer
> with WXPYTHON disabled. At that time this enabled me to test the business
> logic of my plugins.
>
> I would really appreciate if you could make a 5.1 windows installer with
> python3 support and WXPYTHON disabled. But if you are tight on time, I can
> totally understand.
>
> Best regards, Mitja
>
>
> --
> *From:* Nick Østergaard 
> *To:* thomas.pointhu...@gmx.at
> *Cc:* KiCad Developers 
> *Sent:* Tuesday, 14 August 2018, 23:26
> *Subject:* Re: [Kicad-developers] [PATCH] get initial Python 3 support
>
> Hi Thomas,
>
> I am happy to see that we port to python3 for various reasons, that
> should be obvious to everyone.
>
> I have been testing your branch a bit on windows, just to get an
> overview of what changes might be needed. So far I think I made it
> work as you have on linux.
>
> A lite installer is available on [link will disappear eventually]
>
> http://downloads.kicad-pcb.org/windows/testing/patched/kicad-patched-88-review-8244-gef7a2fcc3-x86_64.exe
>
> The build is of course with wxpython disabled, as it is my
> understanding that it does not support python3, and the next step is
> to migrate to wx phoenix which should indeed support python3.
>
> I could start the python.exe inside the kicad/bin dir and import
> pcbnew without errors.
>
> I did not try to run any standalone scripts.
>
> I did try a couple of footprint wizards in the footprint editor, and
> some of them seemingly worked. But the BARCODE USS-39 errors. It looks
> like it needs to be updated to py3k syntax.
>
> Regards
> Nick Østergaard
> Den lør. 4. aug. 2018 kl. 12.23 skrev Thomas Pointhuber
> :
> >
> > Hi,
> >
> > I managed to get KiCad to run with Python 3 as well as did some quick
> > verification that basic methods are working using CLI (loading boards,
> > calling a method of it).
> >
> > Bugreport: https://bugs.launchpad.net/kicad/+bug/1785119
> >
> > My Branch: https://github.com/pointhi/kicad-source-mirror/tree/python3
> >
> > scripting inside of kicad was not tested because I'm not really familiar
> > with it right now, as well as because of known wx problems with that
> stuff.
> >
> > For now it can be enabled using -DKICAD_SCRIPTING_PYTHON3=ON
> > It is not possible to export modules for python 2 and python 3 with one
> > build at the moment, but this should a thing which can be fixed in the
> > build-script.
> >
> > I made some small changes to existing python code to get it working on
> > both versions. To my knowledge and tests the scripts should not have
> > changed behavior.
> >
> > Regards, Thomas
> >
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to: kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help  : https://help.launchpad.net/ListHelp
>
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to: kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help  : https://help.launchpad.net/ListHelp
>
>
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] get initial Python 3 support

2019-03-23 Thread Mitja Nemec
Hi Nick!
As a python plugin writer, I am starting to get bug reports from ubuntu 18.04 
users, as with 5.1 supporting GTK3 they've finally managed to run python 
plugins.More than half a year ago, you've made a Kicad python3 windows 
installer with WXPYTHON disabled. At that time this enabled me to test the 
business logic of my plugins. 

I would really appreciate if you could make a 5.1 windows installer with 
python3 support and WXPYTHON disabled. But if you are tight on time, I can 
totally understand.
Best regards, Mitja

  From: Nick Østergaard 
 To: thomas.pointhu...@gmx.at 
Cc: KiCad Developers 
 Sent: Tuesday, 14 August 2018, 23:26
 Subject: Re: [Kicad-developers] [PATCH] get initial Python 3 support
   
Hi Thomas,

I am happy to see that we port to python3 for various reasons, that
should be obvious to everyone.

I have been testing your branch a bit on windows, just to get an
overview of what changes might be needed. So far I think I made it
work as you have on linux.

A lite installer is available on [link will disappear eventually]
http://downloads.kicad-pcb.org/windows/testing/patched/kicad-patched-88-review-8244-gef7a2fcc3-x86_64.exe

The build is of course with wxpython disabled, as it is my
understanding that it does not support python3, and the next step is
to migrate to wx phoenix which should indeed support python3.

I could start the python.exe inside the kicad/bin dir and import
pcbnew without errors.

I did not try to run any standalone scripts.

I did try a couple of footprint wizards in the footprint editor, and
some of them seemingly worked. But the BARCODE USS-39 errors. It looks
like it needs to be updated to py3k syntax.

Regards
Nick Østergaard
Den lør. 4. aug. 2018 kl. 12.23 skrev Thomas Pointhuber
:
>
> Hi,
>
> I managed to get KiCad to run with Python 3 as well as did some quick
> verification that basic methods are working using CLI (loading boards,
> calling a method of it).
>
> Bugreport: https://bugs.launchpad.net/kicad/+bug/1785119
>
> My Branch: https://github.com/pointhi/kicad-source-mirror/tree/python3
>
> scripting inside of kicad was not tested because I'm not really familiar
> with it right now, as well as because of known wx problems with that stuff.
>
> For now it can be enabled using -DKICAD_SCRIPTING_PYTHON3=ON
> It is not possible to export modules for python 2 and python 3 with one
> build at the moment, but this should a thing which can be fixed in the
> build-script.
>
> I made some small changes to existing python code to get it working on
> both versions. To my knowledge and tests the scripts should not have
> changed behavior.
>
> Regards, Thomas
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to    : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help  : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to    : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help  : https://help.launchpad.net/ListHelp


   ___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp