Re: [Kicad-developers] Hating wx configuration more than ever...

2012-05-08 Thread Dick Hollenbeck
On 05/07/2012 11:10 PM, Lorenzo Marcantonio wrote:
 On Mon, May 07, 2012 at 02:25:44PM -0500, Dick Hollenbeck wrote:
 But I cannot tell you what a wxChar* means THIS MONTH.

 The best thing the wxWidgets folks could do is to start with this line:

 typedef std::string wxString

 and then go fix all the compile errors after that.

 wxString has served too many masters and its biggest mistake was coming into 
 existence.



That last sentence was not fair of me, since std::string did not exist when 
wxString was
written.  But I retain my other point of view that wxString is no longer 
needed, and
wxWidgets could be done with std::string and an elaborate std::string factory 
class.


With latest wx, wxString is a container holding a std::string holding 
characters encoded
as UTF8 bytes on linux and OSX.  Windows is unknown.


See:

http://docs.wxwidgets.org/2.9.3/overview_changes_since28.html#overview_changes_unicode

which says:


For example, the notorious (due to the confusion they created) macros |wxT()
http://docs.wxwidgets.org/2.9.3/group__group__funcmacro__string.html#ga437ea6ba615b75dac8603e96ec864160|
and |_T()
http://docs.wxwidgets.org/2.9.3/group__group__funcmacro__string.html#ga7dfc2888539861afe6c4337ef315472b|
are not needed at all any longer.


This means that we eventually, we'll no longer need all the wxT() stuff, since 
we
basically never put anything but ASCII characters in those wrappers and to 
convert from an
ASCII string to UTF8 is simply a matter of copying bytes without any conversion 
at all. 
And converting ASCII bytes to UTF16 characters is simply a matter of zeroing 
out the upper
byte.


So eventually we can go back and remove all the wxT() wrappers.

I think all their APIs would be better off using UTF8 encoded std::strings, 
they could
convert to any other required encoding behind their public APIs, as they do now 
from wxString.

wxChar* in such a world, typedef-ed to a pointer to a 32 bit character, should 
not be
needed much for strings anyways in the future.  Single characters yes, strings 
not so much.

wxString feels a lot like the 80's and 90's now, which I characterize as let's 
watch
Microsoft learn how to program, as they lead us into the future, constantly 
changing
directions, constantly costing developers money chasing a new fad, zigging 
left, then
right, but always wanting to lead, not knowing where they are going.


Dick





 The wx wiki *explicitly* tells to use fscking wxString instead of std::string!
 
 Note that it is recommended to use wxString as much as possible. Do no use 
 char* or std::string unless you use a third-party library that requires you 
 to do so. 
 

 Since I didn't passed --disable-unicode, wxChar* should be a wchar_t*. Also 
 the operator const wxChar * is present... maybe the culprit is lacking the 
 const bit somehow.

 Also the 'fun' thing in the wx trunk doc is this:

 
 The wxString class has been completely rewritten for wxWidgets 3.0 and this 
 change was actually the main reason for the calling that version wxWidgets 
 3.0.

 wxString is a class representing a Unicode character string. wxString uses 
 std::basic_string internally (even if wxUSE_STL is not defined) to store its 
 content (unless this is not supported by the compiler or disabled 
 specifically when building wxWidgets) and it therefore inherits many features 
 from std::basic_string. (Note that most implementations of std::basic_string 
 are thread-safe and don't use reference counting.)
 

 So at least part of your suggestion was taken in account... (I'd rather have 
 junked it wxString completely) also part of the fun is that wxString USES 
 std::basic_string not wxString EXTENDS std::basic_string. Yay a PART-OF 
 instead of IS-A relationship...

 I don't actually care about 2.9 at the moment...



___
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] Hating wx configuration more than ever...

2012-05-08 Thread Lorenzo Marcantonio
On Tue, May 08, 2012 at 01:01:07AM -0500, Dick Hollenbeck wrote:
 With latest wx, wxString is a container holding a std::string holding 
 characters encoded
 as UTF8 bytes on linux and OSX.  Windows is unknown.

UTF8? not wide chars? Strange, the C++ approach is usually using
wchar_t, not MBCS... there *is* a configure option for using UTF8 in
2.9, maybe that's active in your build.

This would actually break every indexed access to the string (unless
they abstracted it with huge performance penalties, having to start from
the beginning each time).

I see 6GB ram *laptops* around. I think these days string processing
(i.e. not only copying strings from a place to another) in core is more
convenient with wchars...

-- 
Lorenzo Marcantonio
Logos Srl

___
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] KiCad library format

2012-05-08 Thread Milan Horák

Hello,

I am afraid that I am not as goog programmer as it may look. I use 
documentation a lot, because of little experience. But I have a goal and 
I am going towards it. An I will get there :-)


I will do as much I can to help. And will release the source too.

Milan

P.S. I'd like to buy beginners package of worms ;-)

Dne 8.5.2012 10:00, Miguel Angel Ajo Pelayo napsal(a):

Milan, Interesting project,

Wouldn't you be interested in joining the scripting taskforce, right?

I've been thinking during last days about schema  footprint
visualization in the python scripting we're building, and one thing is
the visualization to UI, that reusing the current KiCad code would be
the cleanest/fastest/easier to maintain, but...

Then something else comes to my mind (for web app building, and even for
desktop apps), some kind of render painters (in python) capable of
taking a BOARD MODULE (later schematic parts and schematics) and
spiting out a .svg or .png : just imagine a web app doing a:

painter = pcbnew.PAINTER(my_module)

my_svg = painter.GetSVG()
my_png = painter.GetPNG()

That could be of great reuse in many places, with the new PLUGIN
architecture, it could even be reused to paint the new format files,
eagle (when available), altium  orcad?  if there is some brave man
around :-)






2012/5/7 Dick Hollenbeck d...@softplc.com mailto:d...@softplc.com

Do you want to buy some worms?


Good accomplishment.

  Hello,
 
  not to give a fish but teach how to fish instead :-)
 
  Found it in sources and it is pretty self explanatory.
  Thank you guys and thank you for all the work you do.
 
  Milan
 
  Dne 6.5.2012 16:12, Dick Hollenbeck napsal(a):
  On 05/06/2012 08:23 AM, Milan Horák wrote:
  Hi gentlemen,
 
  I'm working on my fun project - KiCad file visualiser
  (http://kicad.picaxe.cz/kifivi/index.php).
 
  I have a question about KiCad component library format.
Documentation
  says that ALIAS line has to be the second line right after DEF
line, but
  in the default device.lib from package it is not this way.
 
  I.e. CP component - ALIAS line follows fields F1 line.
 
  What is the right way then?
 
  Tkanks for any answer.
 
  Milan
  Sometimes even a developer, or even the original author, may not
carry this information in
  his/her head.  So to answer the question, he/she would have to
look at the source.
 
  This is perhaps something you can do to?
 
  ___
  Mailing list: https://launchpad.net/~kicad-developers
  Post to : kicad-developers@lists.launchpad.net
mailto: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
mailto:kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp




--

Miguel Angel Ajo Pelayo
http://www.nbee.es
+34 636 52 25 69
skype: ajoajoajo


___
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] Errors compiling revision 3543

2012-05-08 Thread Brian Sidebotham
On 5 May 2012 13:29, Wayne Stambaugh stambau...@verizon.net wrote:
 On 5/5/2012 7:57 AM, David J S Briscoe wrote:
 On 05/05/2012 12:02, Lorenzo Marcantonio wrote:
 On Sat, May 05, 2012 at 11:42:05AM +0100, David J S Briscoe wrote:
 If you need any more info I will be pleased to supply it.
 Thanks
 It would be useful to actually know what the error was... are you sure 
 there isn't more detail in the logs?

 Also it's strange, that file IIRC only contains an array declaration for 
 the image...

 Hi,
 Turns out it was the same problem as last time (detailed in this email
 reply)

 Wayne,
 Thanks for your reply.

 David,

 Your welcome.  I'm glad I could help out.

 libgmp-10.dll is present in C:\kicad-winbuilder\kicad-winbuilder\mingw\bin
 I have just added this directory to my path manually and the error has
 disappeared. This is the first time that I have had this problem.
 I think Brian is the person to sort this out, as it's his script. I
 don't want to take up any more of your time as I'm sure you have enough
 on your plate writing code for KiCAD.

 David.

 There have been some recent changes to mingw-get which Brian's script
 uses to pull MinGW that may require some updates to his build script.
 I've never used the Windows builder but I have plenty of experience with
 MinGW so I'm pretty versed on it's strengths and weaknesses.

 Wayne


 I did the same thing again and it's compiling OK as I write this.
 I have 2 copies of the MinGW compiler on my system and the script finds
 the directory that does not contain the above file first and then complains.
 The reason I've had to do this again is because I've removed/reinstalled
 the other copy of MinGW a few times as well a the Kicad-winbuilder script.
 I think that's the reason, could be wrong. I will move a copy of this
 file to the other installation to make sure.

 David.

Hi David,

You can always file bugs like this against the kicad-winbuilder
project on launchpad so that I can address the problems.

I am currently rolling a new release of kicad-winbuilder so that it is
a complete sandbox environment. This will include cmake and bazaar
installs, so there will be no dependacies (it is essentially a
portable binary release). This should fix all issues like this, and
problems with having msys installed (or WinAvr which has msys
components in it's install).

Thanks for replying to this Wayne.

Best Regards,

Brian.

___
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] You wanted multipage PDFs...

2012-05-08 Thread Brian Sidebotham
On 2 May 2012 21:01, Lorenzo Marcantonio l.marcanto...@logossrl.com wrote:
 ... you got multipage PDFs!
 ...
 --
 Lorenzo Marcantonio
 Logos Srl

Fantastic work Lorenzo!! Thanks very much for this update!

Best Regards, Brian.

___
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] Hating wx configuration more than ever...

2012-05-08 Thread Lorenzo Marcantonio
On Tue, May 08, 2012 at 08:21:50AM -0500, Dick Hollenbeck wrote:
 Besides, it gives the computer something to do when it doesn't have anything 
 else to do,
 which is most of the time.

You didn't work with mainframes or embedded system it seems XD

 Also, remember that you gain in most circumstances since you probably started 
 with
 serialized bytes.  Storage (.e.g. disk or network) is mostly a matter of 
 working with
 bytes.  So this gain tends to balance out the cost you mention with respect 
 to indexing. 
 We are probably burning more cycles converting to 16 or 32 bit characters in 
 KiCad than
 the cost of indexing for insertion would cost.

I specified 'if you aren't only copying them from here to there'. In
UTF8 moving forward or backward is O(n) complexity instead of O(1)
because character length is variabile. More like a list than an array.

 a) there is no longer a reason for wxWidgets project to have their own string 
 class.  It
 leads to lack of portability, creates an attachment to wx, and makes folks 
 learn another
 way of doing something for which there is now a standard in C++.

Absolutely concord.

 
 b) Microsoft is not a good foundation on which to base any software 
 investment, since they

Look at MFC then ATL now .NET :P:P

  I see 6GB ram *laptops* around. 
 
 Go buy some, quit whining about opengl.   :)

We buy laptops second hand because with the ruggeds a 'new' is about
4000 eur :D So now I'm using an original core duo :P:P And Intel GPU is
less than stellar with opengl

 No, that convenience is established by the API.   My convenience is not the 
 computer's
 convenience.

Talking in terms of iterator it's more or like the difference between
a forward iterator and a random iterator. Said that, people is still
doing sorts on mag tape (not really, an equivalent spool), so it's more
the algorithms that matter.

-- 
Lorenzo Marcantonio
Logos Srl

___
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] KiCad library format

2012-05-08 Thread Milan Horák

Hello,

for now the script can extract all the data from library file and show 
it in html. Next step is to show every component as a table + zoomable PNG.


Milan

Dne 8.5.2012 11:23, Milan Horák napsal(a):

Hello,

I am afraid that I am not as goog programmer as it may look. I use
documentation a lot, because of little experience. But I have a goal and
I am going towards it. An I will get there :-)

I will do as much I can to help. And will release the source too.

Milan

P.S. I'd like to buy beginners package of worms ;-)


___
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] KiCad library format

2012-05-08 Thread Miguel Angel Ajo Pelayo
I've put the SVG drawing in my scripting wishlist, but it seems like a long
task, well, in fact, drawing in any format
is a long task :) (or it seems like that to me.)

2012/5/8 Dick Hollenbeck d...@softplc.com

 On 05/08/2012 02:09 PM, Milan Horák wrote:
  Hello,
 
  for now the script can extract all the data from library file and show
  it in html. Next step is to show every component as a table + zoomable
 PNG.

 The SVG format might be a better idea.


 
  Milan
 
  Dne 8.5.2012 11:23, Milan Horák napsal(a):
  Hello,
 
  I am afraid that I am not as goog programmer as it may look. I use
  documentation a lot, because of little experience. But I have a goal and
  I am going towards it. An I will get there :-)
 
  I will do as much I can to help. And will release the source too.
 
  Milan
 
  P.S. I'd like to buy beginners package of worms ;-)
  ___
  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




-- 

Miguel Angel Ajo Pelayo
http://www.nbee.es
+34 636 52 25 69
skype: ajoajoajo
___
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] Hating wx configuration more than ever...

2012-05-08 Thread Dick Hollenbeck
On 05/08/2012 09:00 AM, Lorenzo Marcantonio wrote:
 On Tue, May 08, 2012 at 08:21:50AM -0500, Dick Hollenbeck wrote:
 Besides, it gives the computer something to do when it doesn't have anything 
 else to do,
 which is most of the time.
 You didn't work with mainframes or embedded system it seems XD


We are not working with embedded systems.  We are writing KiCad for computers 
that have
nothing to do except hope you press a key or move a mouse.


But I've worked in a number of environments, and about half of it embedded.


Embedded software I wrote is used to generate about 3-5% of all the electric 
power on the
power grid in the U.S. now:


  http://softplc.com/prusace.php


The Grand Coulee Dam is the largest power plant in the Unites States.  We were 
chosen in
2008 to replace 40 year old technology.   This is the largest power plant in 
the United
States, of any technology, coal, nuclear or other.  Its the largest power plant 
in the
U.S. period.


Hi hope this qualifies as some embedded experience, because otherwise I would 
have a more
difficult time updating my resume.





 Also, remember that you gain in most circumstances since you probably 
 started with
 serialized bytes.  Storage (.e.g. disk or network) is mostly a matter of 
 working with
 bytes.  So this gain tends to balance out the cost you mention with respect 
 to indexing. 
 We are probably burning more cycles converting to 16 or 32 bit characters in 
 KiCad than
 the cost of indexing for insertion would cost.
 I specified 'if you aren't only copying them from here to there'. In
 UTF8 moving forward or backward is O(n) complexity instead of O(1)
 because character length is variabile. More like a list than an array.

I agree with this analysis.   But as I run KiCad on wx 2.9.HEAD, it is not 
perceptibly
slower than on 2.8.

Funny thing.  So I don't think O(n) means much here, the computer has nothing 
else to do.


So it is not significantly slower, nor did the wx designers think it would be 
when they
made the choice to use UTF8 inside wxString on linux.


So they agree with me that it is a reasonable way to move forward.  However, I 
was just
saying that they could have done the whole show using std::string 8 bit, using 
UTF8, and
did not need the extra wxString wrapper.



Dick




___
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