Re: [Kicad-developers] [RFC] Able to install KiCad stable and "daily build" in same computer

2018-04-07 Thread Carsten Schoenert
Am 07.04.18 um 17:34 schrieb Strontium:
> Attached is a patch for discussion only.
> 
> Its the minimum change I could come up with to implement a unique 
> version specific config directory.
> 
> Nick mentioned changing XDG_CONFIG_HOME, that will not work on Windows 
> or Mac.
> And on Linux, etc it will change from "~/.config/kicad" to 
> "~/somethingelse/kicad" which would work, but isn't a very friendly 
> naming scheme.

Changing XDG_CONFIG_HOME itself wouldn't be correct. XDG_CONFIG_HOME is
pointing to '$HOME/.config' and XDG_DATA_HOME is referencing to
$HOME/.local/share.

I'm sure Windows and Mac have similar variables for the folders that
should contain the logical same content.

The path to the KiCad user config must based on such variables plus the
preferred name for the config folder, so like kicad-5 (for KiCad5) and
kicad-6 (for future version KiCad6) and kicad-nightly (for devel
version). GTK is doing this for a long time.

> $ find  ~/.config -type d -name gtk*
> /home/carsten/.config/gtk-3.0
> /home/carsten/.config/gtk-2.0
If KiCad will introduce some version specific user config and data
folders (which I appreciate to see) it will be needed to configured by
the build environment and not hard-coded in the binaries. The variables
can be overwritten with some additional value given while starting the
applications.

e.g.
take the default folders
$ kicad

override the setting for the default config etc.
$ KICAD_XDG_CONFIG_HOME=/my/special/folder kicad

-- 
Regards
Carsten

___
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] Assertion failure in the Symbol Library Editor

2018-04-07 Thread Reece R. Pollack

I probably should have filed this as a bug report. I'll go do that

On 04/07/18 22:39, Reece R. Pollack wrote:
I wanted to create a symbol for the Diodes Inc DMN3300U transistor in 
my private library name "MyParts". Here's what I did:


 1. I attempted to follow the instructions in the eeschema
documentation section 11.4.1 to transfer the 2N7002 part from the
Transistor_FET library to MyParts, renaming it in the process, but
the procedure doesn't work.
 2. I decided to load the 2N7002 part from the Transistor_FET library,
export the part as a file in /tmp, then import it into MyParts,
but it also copied the 2N7002 and BSS138 parts.
 3. I deleted the imported components.
 4. I attempted to revert the change entirely. I got a warning that
reverting was not undo-able, and I said OK. (Everything I care
about is backed up in a GIT repo on a server.)
 5. Kaboom! Okay, no kaboom. An "assertion failed" dialog box.




___
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] Assertion failure in the Symbol Library Editor

2018-04-07 Thread Reece R. Pollack
I wanted to create a symbol for the Diodes Inc DMN3300U transistor in my 
private library name "MyParts". Here's what I did:


1. I attempted to follow the instructions in the eeschema documentation
   section 11.4.1 to transfer the 2N7002 part from the Transistor_FET
   library to MyParts, renaming it in the process, but the procedure
   doesn't work.
2. I decided to load the 2N7002 part from the Transistor_FET library,
   export the part as a file in /tmp, then import it into MyParts, but
   it also copied the 2N7002 and BSS138 parts.
3. I deleted the imported components.
4. I attempted to revert the change entirely. I got a warning that
   reverting was not undo-able, and I said OK. (Everything I care about
   is backed up in a GIT repo on a server.)
5. Kaboom! Okay, no kaboom. An "assertion failed" dialog box.

Don't freak out trying to find the referenced commit in git. I made a 
minor mod to pcbnew on a private branch, so there's a new commit id. 
Here's the last common commit:


   d1af521 Libedit: Fix a few places where item could be NULL


Application: kicad
Version: (5.0.0-rc2-dev-377-gc5012f9), release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.13.0-38-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

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

ASSERT INFO:

/home/reece/MyProjects/KiCad/src/eeschema/lib_edit_frame.cpp(1026): 
assert "m_my_part != aPart" failed in SetCurPart().


BACKTRACE:
[1] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, 
wxEvent&) const
[2] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, 
wxEvtHandler*, wxEvent&)

[3] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[4] wxEvtHandler::TryHereOnly(wxEvent&)
[5] wxEvtHandler::DoTryChain(wxEvent&)
[6] wxEvtHandler::ProcessEvent(wxEvent&)
[7] wxWindowBase::TryAfter(wxEvent&)
[8] wxWindowBase::TryAfter(wxEvent&)
[9] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[10] wxMenuBase::SendEvent(int, int)
[11] g_closure_invoke
[12] g_signal_emit_valist
[13] g_signal_emit
[14] gtk_widget_activate
[15] gtk_menu_shell_activate_item
[16] g_closure_invoke
[17] g_signal_emit_valist
[18] g_signal_emit
[19] gtk_propagate_event
[20] gtk_main_do_event
[21] g_main_context_dispatch
[22] g_main_context_iteration
[23] gtk_main_iteration
[24] wxWindow::DoPopupMenu(wxMenu*, int, int)
[25] wxWindowBase::PopupMenu(wxMenu*, int, int)
[26] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, 
wxEvent&) const
[27] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, 
wxEvtHandler*, wxEvent&)

[28] wxEvtHandler::SearchDynamicEventTable(wxEvent&)
[29] wxEvtHandler::TryHereOnly(wxEvent&)
[30] wxEvtHandler::ProcessEventLocally(wxEvent&)
[31] wxEvtHandler::ProcessEvent(wxEvent&)
[32] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[33] g_closure_invoke
[34] g_signal_emit_valist
[35] g_signal_emit
[36] gtk_propagate_event
[37] gtk_main_do_event
[38] g_main_context_dispatch
[39] g_main_loop_run
[40] gtk_main
[41] wxGUIEventLoop::DoRun()
[42] wxEventLoopBase::Run()
[43] wxAppConsoleBase::MainLoop()
[44] APP_KICAD::OnRun()
[45] wxEntry(int&, wchar_t**)
[46] main
[47] __libc_start_main
[48] _start



___
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] New Footprint libs and wizard issues

2018-04-07 Thread kristoffer Ödmark

Agreed, hereis a patch for that :)

- Kristoffer

On 2018-04-06 17:18, Kevin Cozens wrote:

On 2018-04-06 06:30 AM, kristoffer Ödmark wrote:
Attached is a patch that adds support for custom environment paths. 
Previously the wizard would only accept KISYSMOD, KIPRJMOD and the 
github one.


I added MYSYSMOD as a custom path ages ago. What I find odd about the 
dialog boxes that let you add paths is that they won't accept lower 
case letters in the name of the environment variable. If you type a 
lowercase letter nothing happens on the screen. If it doesn't want 
lowercase it should force what you entered to uppercase when you are 
done entering the variable name.




>From defbd12daaa1876787b63ed784997bf2a4702de2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20=C3=96dmark?= 
Date: Sun, 8 Apr 2018 00:39:06 +0200
Subject: [PATCH] Make Environment Editor accept lowercase, but transform them
 to uppercase when editing

---
 common/dialogs/dialog_env_var_config.cpp | 12 
 common/validators.cpp|  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/common/dialogs/dialog_env_var_config.cpp b/common/dialogs/dialog_env_var_config.cpp
index 8e327ccb2..f94ce0970 100644
--- a/common/dialogs/dialog_env_var_config.cpp
+++ b/common/dialogs/dialog_env_var_config.cpp
@@ -62,6 +62,8 @@ public:
 m_envVarName->Enable( false );
 }
 
+		void TextToUpper( wxCommandEvent& aEvent );
+
 protected:
 void OnSelectPath( wxCommandEvent& event ) override;
 void onHelpClick( wxCommandEvent& event ) override;
@@ -410,10 +412,20 @@ DIALOG_ENV_VAR_SINGLE::DIALOG_ENV_VAR_SINGLE( wxWindow* parent,
 DIALOG_ENV_VAR_SINGLE_BASE( parent )
 {
 m_envVarName->SetValue( aEnvVarName );
+
+		//Allow lovercase in the validator, but then make them uppercase when inserted.
+m_envVarName->Bind( wxEVT_TEXT, _ENV_VAR_SINGLE::TextToUpper, this, wxID_ANY );
 m_envVarPath->SetValue( aEnvVarPath );
 m_envVarName->SetValidator( ENVIRONMENT_VARIABLE_CHAR_VALIDATOR() );
 }
 
+void DIALOG_ENV_VAR_SINGLE::TextToUpper( wxCommandEvent& aEvent )
+{
+		aEvent.Skip();
+		auto val = m_envVarName->GetValue().Upper();
+		m_envVarName->ChangeValue( val );
+}
+
 
 void DIALOG_ENV_VAR_SINGLE::OnSelectPath( wxCommandEvent& event )
 {
diff --git a/common/validators.cpp b/common/validators.cpp
index bb67a7e96..a5f1e6f1f 100644
--- a/common/validators.cpp
+++ b/common/validators.cpp
@@ -80,6 +80,6 @@ FILE_NAME_WITH_PATH_CHAR_VALIDATOR::FILE_NAME_WITH_PATH_CHAR_VALIDATOR( wxString
 ENVIRONMENT_VARIABLE_CHAR_VALIDATOR::ENVIRONMENT_VARIABLE_CHAR_VALIDATOR( wxString* aValue ) :
 wxTextValidator( wxFILTER_INCLUDE_CHAR_LIST | wxFILTER_EMPTY, aValue )
 {
-wxString includeChars( wxT( "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" ) );
+wxString includeChars( wxT( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" ) );
 SetCharIncludes( includeChars );
 }
-- 
2.16.2

___
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] Proposed roadmap changes

2018-04-07 Thread Andrey Kuznetsov
Are there plans to add Constraint Manager to KiCad?

In Allegro, CM allows Design Engineers to specify physical, electrical and
spacing rules for classes, groups and nets, so that the PCB Layout Engineer
will be constrained by these definitions when working on the layout. It's
an explicit engineering note that forces the layout designer to obey these
rules rather than by word of mouth or email for the layout engineer to
follow.

On Thu, Mar 8, 2018 at 10:49 AM, jp charras  wrote:

> Le 08/03/2018 à 19:02, Ouabache Designworks a écrit :
> >
> >
> > On Thu, Mar 8, 2018 at 9:47 AM, Jon Evans > wrote:
> >
> > Netlist export is a key feature of every schematic editor. So is
> multi-sheet support. These
> > aren't random extra features, they are a normal part of any modern
> schematic editor.
> >
> >
> >
> > Yes they are necessary features. My argument is that they have little to
> do with the core mission of
> > putting graphical objects on the screen and probably would not share
> much code with
> > the rest of the program. If you add this into the main program then it
> only makes it bigger and more
> > complex. I alway go  for the simpler and cleaner approach.  Calling the
> netlister is more
> > of a design management task than a schematic editor one so it should go
> into the Design Manager program.
> >
> > John Eaton
>
> "they have little to do with the core mission..."
> This is false.
> A internal netlister is mandatory in a schematic design tool at least
> because it is the key for ERC
> and net highlight.
> An especially for net highlight, it must be *very* fast.
>
> --
> 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
>



-- 
Remember The Past, Live The Present, Change The Future
Those who look only to the past or the present are certain to miss the
future [JFK]

kandre...@gmail.com
Live Long and Prosper,
Andrey
___
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] [RFC] Able to install KiCad stable and "daily build" in same computer

2018-04-07 Thread Strontium

Attached is a patch for discussion only.

Its the minimum change I could come up with to implement a unique 
version specific config directory.


Nick mentioned changing XDG_CONFIG_HOME, that will not work on Windows 
or Mac.
And on Linux, etc it will change from "~/.config/kicad" to 
"~/somethingelse/kicad" which would work, but isn't a very friendly 
naming scheme.


So, what I did is:
Define a previous config dir and a current one.  They can not be sub 
directories of one another, so I went with "kicad.v5" for the new config 
directory.  For a nightly we could use "kicad.v6dev" or some such.


HOW these constants should get assigned I don't know.  At the moment I 
hard coded them.


I changed GetKicadConfigPath() to take a parameter of the config 
subdirectory, and renamed the function to just GetConfigPath().
Added a new GetKicadConfigPath() which works like the old one, but uses 
the new parametrised GetConfigPath().
IF the current config path does not exist, we make it (Same 
functionality as before), except then we check if the old one exists, 
and if it does, we just copy everything from it into the new one, once.  
If the new config path already exists we ignore the old one all together.


Very first time this runs will be slower than normal (due to the file 
copy), every other time it should be exactly the same as it is now.


As far as I know wx does not have a copy directories function, but there 
is one in their forums, so I pulled that, and made some small changes to 
remove redundancy in the code.  Its a pretty straight forward recursive 
copy.  I don't know if this should stay in this file, or live elsewhere, 
or be re-written/re-named.


Patch attached.  Tested on Linux, and seems to work fine.  Should work 
on Windows and MAC, but I haven't tested on those.  ALL programs use the 
GetKicadConfigPath() function to get the base of the configuration (as 
far as I can tell), there should be no strange corner cases.



diff --git a/common/common.cpp b/common/common.cpp
index c547b60f3..77002f473 100644
--- a/common/common.cpp
+++ b/common/common.cpp
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -215,7 +216,57 @@ wxConfigBase* GetNewConfig( const wxString& aProgName )
 }
 
 
-wxString GetKicadConfigPath()
+// Taken from:
+//https://forums.wxwidgets.org/viewtopic.php?t=2080
+//Slightly modified for kicad use.
+bool wxCopyDir(wxString sFrom, wxString sTo, bool noFromOK = false)
+{
+// Fix paths
+if (sFrom[sFrom.Len() - 1] != '\\' && sFrom[sFrom.Len() - 1] != '/') sFrom += wxFILE_SEP_PATH;
+if (sTo[sTo.Len() - 1] != '\\' && sTo[sTo.Len() - 1] != '/') sTo += wxFILE_SEP_PATH;
+
+// Make destination directory
+if (!wxDirExists(sTo)) {
+if (!wxFileName::Mkdir(sTo, wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL)) {
+wxLogError(wxT("%s could not be created!"), sTo.c_str());
+return false;
+}
+}
+
+// Check if source directory exists
+if (!::wxDirExists(sFrom)) {
+if (noFromOK) return true;
+wxLogError(wxT("%s does not exist!\r\nCan not copy directory"), sFrom.c_str());
+return false;
+}
+
+// Copy from Source to Destination
+wxDir fDir(sFrom);
+wxString sNext = wxEmptyString;
+bool bIsFile = fDir.GetFirst();
+while (bIsFile) {
+const wxString sFileFrom = sFrom + sNext;
+const wxString sFileTo = sTo + sNext;
+if (::wxDirExists(sFileFrom)) {
+wxCopyDir(sFileFrom, sFileTo);
+}
+else {
+if (!::wxFileExists(sFileTo)) {
+if (!::wxCopyFile(sFileFrom, sFileTo)) {
+wxLogError(wxT("Could not copy %s to %s !"), sFileFrom.c_str(), sFileTo.c_str());
+return false;
+}
+}
+}
+bIsFile = fDir.GetNext();
+}
+return true;
+}
+
+#define KICAD_PREVIOUS_CONFIG wxT( "kicad" )
+#define KICAD_CURRENT_CONFIG  wxT( "kicad.v5" )
+
+wxFileName GetConfigPath( wxString name )
 {
 wxFileName cfgpath;
 
@@ -240,11 +291,24 @@ wxString GetKicadConfigPath()
 }
 #endif
 
-cfgpath.AppendDir( wxT( "kicad" ) );
+cfgpath.AppendDir( name );
+
+return cfgpath;
+}
+
+
+wxString GetKicadConfigPath()
+{
+wxFileName cfgpath;
+
+cfgpath = GetConfigPath( KICAD_CURRENT_CONFIG );
 
 if( !cfgpath.DirExists() )
 {
-cfgpath.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL );
+// No Current Config, so get the path of the previous config.
+// and copy everything from it.
+wxCopyDir( GetConfigPath( KICAD_PREVIOUS_CONFIG ).GetPath(), 
+   cfgpath.GetPath(), true );
 }
 
 return cfgpath.GetPath();
___
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