[Kicad-developers] Review and help on Non Plated TH - Mechanical to polygon conversion

2015-03-22 Thread Mário Luzeiro
Hi all,

While working in 3D-Viewer, I found something that I am not sure if is an issue 
or feature.

It seems that the Non plated TH PAD types are extracted the way you can see in 
the attached picture. I was expecting no copper at all, but some "precision 
residues" are left ..

Anyone that understands this part could have a look and maybe check if it is 
possible to skip this NPTH pads?

I think it is related with:

https://github.com/KiCad/kicad-source-mirror/blob/master/3d-viewer/3d_draw.cpp#L692

TransformPadsShapesWithClearanceToPolygon function:
https://github.com/KiCad/kicad-source-mirror/blob/f16e083ecfec6ef773c198b4243ff441da6b5adc/pcbnew/board_items_to_polygon_shape_transform.cpp#L130

BuildPadDrillShapePolygon function:
https://github.com/KiCad/kicad-source-mirror/blob/f16e083ecfec6ef773c198b4243ff441da6b5adc/pcbnew/board_items_to_polygon_shape_transform.cpp#L656

Any help on that?
I could try change it myself, but I believe I will miss some scenario and break 
something :/

Thanks in advance!

Regards,
Mario Luzeiro___
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] Assertion failure and can't close Hotkeys List

2015-03-22 Thread jp charras
Le 21/03/2015 14:47, Marco Ciampa a écrit :
> On Sat, Mar 21, 2015 at 02:38:36PM +0100, jp charras wrote:
>> Le 21/03/2015 14:05, Marco Ciampa a écrit :
>>> On Fri, Mar 20, 2015 at 08:12:36PM +0100, jp charras wrote:
 Le 20/03/2015 19:15, Chris Pavlina a écrit :
> When the Hotkeys List was changed to non-modal, its OnCloseButtonClick()
> was not changed to reflect the fact that modal and modeless dialogs have
> to be closed differently in wx. Here's a patch to fix that, which should
> work for all HTML_MESSAGE_BOXes whether or not they're modal.
>
> Chris

 Damn!
 you are right.

 I committed your patch. thanks.
>>>
>>> And, BTW, why the hotkey list is not i18n? Using a HELP Window that do
>>> not help you in your tongue, meanwhile all the program dialogs are
>>> translated, is bizarre at least...
>>>
>>
>> Well:
>> - Most of hotkeys are the first letter of the command name (in English)
> 
> That is _not_ a problem, especially when translating a tutorial, having
> the same keys.
> 
>> - These strings are also used as keywords in hotkey config file.
>> Keep them in English is not so bad.
> 
> No, believe me. Either use the program in English or traslate _all_.
> In this case IMHO a compromise is not accettable
> 
>> (this is also the case for .kicad_pcb files which are using English
>> layers names for non copper layer.)
> 
> And I agree here. A document format/content is _not_ a help window.
> I espect it to be read by different kind of people, not beginners anyway...
> 
> --
> 
> 
> Marco Ciampa

These hotkey strings info are now translated in dialogs in rev 5530.

However, because I need both the translated and the English version of
these strings, they are prefixed by _HKI (instead of _ for usual
translatable strings, which are always translated).

This prefix can be used by translation tools to extract them.

(Just add this prefix to the list of other prefixes, which is currently
only one prefix: "_")


-- 
Jean-Pierre CHARRAS

___
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] Option in eeschema to annotate keeping multi-unit parts grouped

2015-03-22 Thread jp charras
Le 22/03/2015 03:18, Chris Pavlina a écrit :
> Here is a fixed version of the patch. It handled perfectly any complex
> hierarchies I could throw at it. Got anything worse to torture it with?
> 
> Chris

Better, but not yet perfect...

There is an issue for units of a package which are on different sheets
(both simple and complex hierarchies).
The "normal" annotation use only one package:
For instance unit A of package U1 is in a sheet, unit B of the same
package U1 is on an other sheet.
The "do not swap units" uses one package per sheet (U1A for a sheet, but
U2B for the other sheet).

-- 
Jean-Pierre CHARRAS

___
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


[Kicad-developers] Looking for a pcb kicad project to do tests and debug

2015-03-22 Thread Mário Luzeiro
Hello all,
Does anyone have a test project (for pcbnew) that I can use to test and see 
several complex aspects in a board?
Things like multi layers, complex edge cuts, different holes shapes and sizes, 
complex filling zones.. etc etc?

Thanks.
Mario Luzeiro
___
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


[Kicad-developers] VRML export issue in zone filling

2015-03-22 Thread Mário Luzeiro
Hi Cirilo,

while working in VRML model parser to import KiCad generated VRML files, I 
notice the issue attached.
The zone filling is strange and parts are missing. Any idea why?!

Regards,
Mario Luzeiro___
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] VRML export issue in zone filling

2015-03-22 Thread Mário Luzeiro
Hi Cirilo,

I forgot to mention that the screenshot is from FreeCad, so, same issue on 
FreeCAD.
The board in pcbnew and normal view3d is OK, in fact, I already produced it, 
assembly and tested in real life :)

I found another issue, if you dont set the "Footprint 3D model path", so, if it 
is null, the wxWidget will rise me an error, you may would like to check what 
happen when this path is zero ..

ASSERT INFO:
../src/common/filename.cpp(2004): assert "Assert failure" failed in 
IsValidDirComponent(): empty directory passed to wxFileName::InsertDir()

BACKTRACE:
[1] wxFileName::IsValidDirComponent(wxString const&)
[2] wxFileName::AppendDir(wxString const&)
[3] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, 
wxEvent&) const
[4] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, 
wxEvtHandler*, wxEvent&)
[5] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[6] wxEvtHandler::TryHereOnly(wxEvent&)
[7] wxEvtHandler::DoTryChain(wxEvent&)
[8] wxEvtHandler::ProcessEvent(wxEvent&)
[9] wxWindowBase::TryAfter(wxEvent&)
[10] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[11] wxMenuBase::SendEvent(int, int)
[12] g_closure_invoke
[13] g_signal_emit_valist
[14] g_signal_emit
[15] gtk_widget_activate
[16] gtk_menu_shell_activate_item
[17] g_closure_invoke
[18] g_signal_emit_valist
[19] g_signal_emit
[20] gtk_propagate_event
[21] gtk_main_do_event
[22] g_main_context_dispatch
[23] g_main_loop_run
[24] gtk_main
[25] wxGUIEventLoop::DoRun()
[26] wxEventLoopBase::Run()
[27] wxAppConsoleBase::MainLoop()
[28] APP_SINGLE_TOP::OnRun() 
/home/kammutierspule/kicad_sources/kicad.bzr/common/single_top.cpp:155
[29] wxEntry(int&, wchar_t**)
[30] main /home/kammutierspule/kicad_sources/kicad.bzr/common/single_top.cpp:189
[31] __libc_start_main
[32] _start


I think the issue could be in the:
https://github.com/KiCad/kicad-source-mirror/blob/05073c15edd92611d672bf286cdfc8dc956e1326/pcbnew/dialogs/dialog_export_vrml.cpp#L176


Regards,
Mario Luzeiro

From: Cirilo Bernardo [cirilo.berna...@gmail.com]
Sent: 22 March 2015 22:11
To: Mário Luzeiro
Subject: Re: VRML export issue in zone filling

HI Mario,

 I don't understand what could cause those fill problems. Have you used another 
viewer like
'view3dscene' to see if it is only a problem with the viewer?

 In the past there were problems with OpenGL operations near (0,0,n) and the 
result was
missing points which of course caused rendering problems. To work around that 
problem
I had to render the board first then move everything so the board center is 
near 0,0.

- Cirilo

On Mon, Mar 23, 2015 at 8:03 AM, Mário Luzeiro 
mailto:mrluze...@ua.pt>> wrote:
Hi Cirilo,

while working in VRML model parser to import KiCad generated VRML files, I 
notice the issue attached.
The zone filling is strange and parts are missing. Any idea why?!

Regards,
Mario Luzeiro


___
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


[Kicad-developers] [PATCH] One Hotkey submenu is enough

2015-03-22 Thread Michele Ballabio
From: Michele 

There are two Hotkey submenu under "Preferences" in Kicad.
This patch removes the second one.

---
 kicad/menubar.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kicad/menubar.cpp b/kicad/menubar.cpp
index d34379b..3c6a6f4 100644
--- a/kicad/menubar.cpp
+++ b/kicad/menubar.cpp
@@ -343,9 +343,6 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
 preferencesMenu->AppendSeparator();
 Pgm().AddMenuLanguageList( preferencesMenu );
 
-// Hotkey submenu
-AddHotkeyConfigMenu( preferencesMenu );
-
 // Menu Tools:
 wxMenu* toolsMenu = new wxMenu;
 
-- 
2.0.0


___
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] Option in eeschema to annotate keeping multi-unit parts grouped

2015-03-22 Thread Chris Pavlina
Got it - fixed. Looks like I was a bit overzealous in correcting the 
first patch and introduced this.


I also found another issue - it didn't treat unannotated parts 
differently, so if you had a schematic full of R?A it would try to make 
them all R1A. Also fixed.


I can't think of anything else to test. I tried it on every combination 
of hierarchical nastiness I could and it worked fine. Here's the latest 
version, and final if you also can't think of anything else.


Thanks,
Chris

On Sun, Mar 22, 2015 at 04:06:57PM +0100, jp charras wrote:

Le 22/03/2015 03:18, Chris Pavlina a écrit :

Here is a fixed version of the patch. It handled perfectly any complex
hierarchies I could throw at it. Got anything worse to torture it with?

Chris


Better, but not yet perfect...

There is an issue for units of a package which are on different sheets
(both simple and complex hierarchies).
The "normal" annotation use only one package:
For instance unit A of package U1 is in a sheet, unit B of the same
package U1 is on an other sheet.
The "do not swap units" uses one package per sheet (U1A for a sheet, but
U2B for the other sheet).

--
Jean-Pierre CHARRAS

___
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
diff --git a/eeschema/annotate.cpp b/eeschema/annotate.cpp
index 3fccb8e..f041fe3 100644
--- a/eeschema/annotate.cpp
+++ b/eeschema/annotate.cpp
@@ -38,6 +38,7 @@
 #include 
 #include 
 
+#include 
 
 void SCH_EDIT_FRAME::DeleteAnnotation( bool aCurrentSheetOnly )
 {
@@ -62,7 +63,8 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool  aAnnotateSchematic,
  ANNOTATE_ORDER_T  aSortOption,
  ANNOTATE_OPTION_T aAlgoOption,
  bool  aResetAnnotation,
- bool  aRepairTimestamps )
+ bool  aRepairTimestamps,
+ bool  aLockUnits )
 {
 SCH_REFERENCE_LIST references;
 
@@ -73,6 +75,9 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool  aAnnotateSchematic,
 // Build the sheet list.
 SCH_SHEET_LIST sheets;
 
+// Map of locked components
+SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents;
+
 // Test for and replace duplicate time stamps in components and sheets.  Duplicate
 // time stamps can happen with old schematics, schematic conversions, or manual
 // editing of files.
@@ -88,6 +93,19 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool  aAnnotateSchematic,
 }
 }
 
+// If units must be locked, collect all the sets that must be annotated together.
+if( aLockUnits )
+{
+if( aAnnotateSchematic )
+{
+sheets.GetMultiUnitComponents( Prj().SchLibs(), lockedComponents );
+}
+else
+{
+m_CurrentSheet->GetMultiUnitComponents( Prj().SchLibs(), lockedComponents );
+}
+}
+
 // If it is an annotation for all the components, reset previous annotation.
 if( aResetAnnotation )
 DeleteAnnotation( !aAnnotateSchematic );
@@ -141,7 +159,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool  aAnnotateSchematic,
 }
 
 // Recalculate and update reference numbers in schematic
-references.Annotate( useSheetNum, idStep );
+references.Annotate( useSheetNum, idStep, lockedComponents );
 references.UpdateAnnotation();
 
 wxArrayString errors;
diff --git a/eeschema/component_references_lister.cpp b/eeschema/component_references_lister.cpp
index 15eb9e6..6796ef3 100644
--- a/eeschema/component_references_lister.cpp
+++ b/eeschema/component_references_lister.cpp
@@ -39,6 +39,8 @@
 #include 
 #include 
 
+#include 
+
 
 //#define USE_OLD_ALGO
 
@@ -283,7 +285,8 @@ int SCH_REFERENCE_LIST::CreateFirstFreeRefId( std::vector& aIdList, int aFi
 }
 
 
-void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId  )
+void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId,
+  SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap )
 {
 if ( componentFlatList.size() == 0 )
 return;
@@ -327,6 +330,24 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId  )
 if( componentFlatList[ii].m_Flag )
 continue;
 
+// Check whether this component is in aLockedUnitMap.
+SCH_REFERENCE_LIST* lockedList = NULL;
+BOOST_FOREACH( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair, aLockedUnitMap )
+{
+unsigned n_refs = pair.second.GetCount();
+for( unsigned thisRefI = 0; thisRefI < n_refs; ++thisRefI )
+{
+SCH_REFERENCE &thisRef = pair.second[

[Kicad-developers] [PATCH] Friendlier warning for modifying power values

2015-03-22 Thread Chris Pavlina
Currently, if you try to edit the value of a power component in 
eeschema, you get a "... is a power component and it's [sic] value 
cannot be modified!" message.  That message isn't completely accurate, 
though. The edit box also allows you to change the *formatting*, which 
is perfectly valid to do for power texts. Unfortunately, that means that 
if you want to change formatting, you have to go through the 
whole-component edit dialog.


This patch removes that error message. Instead, when editing a power 
component's value, the text field in the edit box is greyed out, and a 
message "Power component value text cannot be modified!" is displayed 
underneath it. All formatting options remain active.


Chris
diff --git a/eeschema/dialogs/dialog_edit_one_field.cpp b/eeschema/dialogs/dialog_edit_one_field.cpp
index 60ef3a6..13bd957 100644
--- a/eeschema/dialogs/dialog_edit_one_field.cpp
+++ b/eeschema/dialogs/dialog_edit_one_field.cpp
@@ -62,6 +62,7 @@ void DIALOG_EDIT_ONE_FIELD::initDlg_base()
 
 m_Invisible->SetValue( m_text_invisible );
 m_TextShapeOpt->SetSelection( m_textshape );
+SetPowerWarning( false );
 
 switch ( m_textHjustify )
 {
@@ -97,8 +98,15 @@ void DIALOG_EDIT_ONE_FIELD::initDlg_base()
 m_TextSizeText->SetLabel( msg );
 
 m_sdbSizerButtonsOK->SetDefault();
+
 }
 
+void DIALOG_EDIT_ONE_FIELD::SetPowerWarning( bool aWarn )
+{
+m_PowerComponentValues->Show( aWarn );
+m_TextValue->Enable( ! aWarn );
+Fit();
+}
 
 void DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick( wxCommandEvent& aEvent )
 {
@@ -159,8 +167,11 @@ wxString DIALOG_LIB_EDIT_ONE_FIELD::GetTextField()
 }
 
 
-void DIALOG_EDIT_ONE_FIELD::TransfertDataToField()
+void DIALOG_EDIT_ONE_FIELD::TransfertDataToField( bool aIncludeText )
 {
+// This method doesn't transfer text anyway.
+(void) aIncludeText;
+
 m_textorient = m_Orient->GetValue() ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ;
 wxString msg = m_TextSize->GetValue();
 m_textsize = ValueFromString( g_UserUnit, msg );
@@ -197,11 +208,12 @@ void DIALOG_EDIT_ONE_FIELD::TransfertDataToField()
 }
 
 
-void DIALOG_LIB_EDIT_ONE_FIELD::TransfertDataToField()
+void DIALOG_LIB_EDIT_ONE_FIELD::TransfertDataToField( bool aIncludeText )
 {
-DIALOG_EDIT_ONE_FIELD::TransfertDataToField();
+DIALOG_EDIT_ONE_FIELD::TransfertDataToField( aIncludeText );
 
-m_field->SetText( GetTextField() );
+if( aIncludeText )
+m_field->SetText( GetTextField() );
 
 m_field->SetSize( wxSize( m_textsize, m_textsize ) );
 m_field->SetOrientation( m_textorient );
@@ -255,11 +267,12 @@ wxString DIALOG_SCH_EDIT_ONE_FIELD::GetTextField()
 };
 
 
-void DIALOG_SCH_EDIT_ONE_FIELD::TransfertDataToField()
+void DIALOG_SCH_EDIT_ONE_FIELD::TransfertDataToField( bool aIncludeText )
 {
-DIALOG_EDIT_ONE_FIELD::TransfertDataToField();
+DIALOG_EDIT_ONE_FIELD::TransfertDataToField( aIncludeText );
 
-m_field->SetText( GetTextField() );
+if( aIncludeText )
+m_field->SetText( GetTextField() );
 
 m_field->SetSize( wxSize( m_textsize, m_textsize ) );
 m_field->SetOrientation( m_textorient );
diff --git a/eeschema/dialogs/dialog_edit_one_field.h b/eeschema/dialogs/dialog_edit_one_field.h
index 7edd99b..c52d4ef 100644
--- a/eeschema/dialogs/dialog_edit_one_field.h
+++ b/eeschema/dialogs/dialog_edit_one_field.h
@@ -74,14 +74,27 @@ public:
 /**
  * Function TransfertDataToField
  * Converts fields from dialog window to variables to be used by child classes
+ *
+ * @param aIncludeText Whether the valies transferred should include the actual
+ * item text. If this is false, formatting will be transferred, but text will
+ * not.
  */
-virtual void TransfertDataToField();
+virtual void TransfertDataToField( bool aIncludeText = true );
 
 void SetTextField( const wxString& aText )
 {
  m_TextValue->SetValue( aText );
 }
 
+/**
+ * Function SetPowerWarning
+ * Disables the Text field and displays the "Power component values cannot
+ * be modified!" warning, if aWarn is true. Performs the inverse if aWarn
+ * is false (this, however, is the default).
+ *
+ * @param aWarn whether or not to produce the warning
+ */
+void SetPowerWarning( bool aWarn );
 
 protected:
 /**
@@ -143,7 +156,7 @@ public:
 
 ~DIALOG_LIB_EDIT_ONE_FIELD() {};
 
-void TransfertDataToField();
+void TransfertDataToField( bool aIncludeText = true );
 
 /**
  * Function GetTextField
@@ -186,7 +199,7 @@ public:
 
 // ~DIALOG_SCH_EDIT_ONE_FIELD() {};
 
-void TransfertDataToField();
+void TransfertDataToField( bool aIncludeText = true );
 
 /**
  * Function GetTextField
diff --git a/eeschema/dialogs/dialog_lib_edit_text_base.cpp b/eeschema/dialogs/dialog_lib_edit_text_base.cpp
index 70324cc..5d3ca5a 100644
--- a/eeschema/dialogs/dialog_lib_edit_text_base.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_text_base.cpp
@@ -1,5 +1,5 @