[Plplot-devel] RE : RE : Qt driver update

2009-09-01 Thread Rochel, Alban
Werner,

Good news for the flush() issue. It works on Windows too (I just had forgotten 
to save the changes I told you to do). To bring the window to front, try to add 
widget-raise() after widget-flush() in plD_eop_qtwidget.

Alban

De : Werner Smekal [sme...@iap.tuwien.ac.at]
Date d'envoi : mardi 1 septembre 2009 08:58
À : Rochel, Alban
Cc : Alan W. Irwin; Hazen Babcock; Jerry; Plplot-devel mailing list
Objet : Re: RE : [Plplot-devel] Qt driver update

This solves the problems for the grey page. After you run a program
the first plot will be shown (after a short while if there are
multiplots). This is for the carbon qt binary, but I expect this to
work also for the cocoa qt binary. The only thing left now (apart from
this color crazyness) is that the window is in the background when you
start it. Is it possible in Qt to bring the window into the
foreground, since this is something the user would await? I'll commit
these changes.

 As for the colour issues, I suspect we have the same kind of issue
 as we have with getenv() on Linux. Qt, as we use it, seems to mess
 up something in the system environment (and I have no idea what).
 I've not had getenv() issues with Qt 4.4. Is it possible for you to
 try this version of Qt?

It must be something like that since the cocoa library of the same qt
version doesn't have these problems. That's really strange that Qt
somehow overloads the stdlib functions with buggy functions.

 I am currently starting to work on Windows for Tuomas Seppala's
 issues. I have no experience on cmake on Windows, so I hope it won't
 take me too long. I'll be away (part of) this afternoon. To tell you
 everything, my wife and I are expecting a baby within 3 weeks, we
 have to go to the hospital this afternoon, and don't be surprised if
 I appear to be away unexpectedly some time in the next weeks.
 However, I'll try to work as much as possible on fixing the issues
 before the release.

It's actually not much a problem, maybe the wiki helps you a bit: 
http://www.miscdebris.net/plplot_wiki/index.php?title=Qt

Congratulations to you and your wife about the upcoming birth! I wish
you all the best and I'm sure it will be a great time for all of you.

Regards,
Werner


 Alban

--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: sme...@iap.tuwien.ac.at
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] RE : RE : Qt driver update

2009-09-01 Thread Werner Smekal
Hi Alban,

this works as well. Very good, so apart from this color issue, the qt  
drivers on Mac work quite well. I'll commit this as well. Please test  
on Linux if these changes did mess something up.

Thanks,
Werner

On 01.09.2009, at 10:03, Rochel, Alban wrote:

 Werner,

 Good news for the flush() issue. It works on Windows too (I just had  
 forgotten to save the changes I told you to do). To bring the window  
 to front, try to add widget-raise() after widget-flush() in  
 plD_eop_qtwidget.

 Alban
 
 De : Werner Smekal [sme...@iap.tuwien.ac.at]
 Date d'envoi : mardi 1 septembre 2009 08:58
 À : Rochel, Alban
 Cc : Alan W. Irwin; Hazen Babcock; Jerry; Plplot-devel mailing list
 Objet : Re: RE : [Plplot-devel] Qt driver update

 This solves the problems for the grey page. After you run a program
 the first plot will be shown (after a short while if there are
 multiplots). This is for the carbon qt binary, but I expect this to
 work also for the cocoa qt binary. The only thing left now (apart from
 this color crazyness) is that the window is in the background when you
 start it. Is it possible in Qt to bring the window into the
 foreground, since this is something the user would await? I'll commit
 these changes.

 As for the colour issues, I suspect we have the same kind of issue
 as we have with getenv() on Linux. Qt, as we use it, seems to mess
 up something in the system environment (and I have no idea what).
 I've not had getenv() issues with Qt 4.4. Is it possible for you to
 try this version of Qt?

 It must be something like that since the cocoa library of the same qt
 version doesn't have these problems. That's really strange that Qt
 somehow overloads the stdlib functions with buggy functions.

 I am currently starting to work on Windows for Tuomas Seppala's
 issues. I have no experience on cmake on Windows, so I hope it won't
 take me too long. I'll be away (part of) this afternoon. To tell you
 everything, my wife and I are expecting a baby within 3 weeks, we
 have to go to the hospital this afternoon, and don't be surprised if
 I appear to be away unexpectedly some time in the next weeks.
 However, I'll try to work as much as possible on fixing the issues
 before the release.

 It's actually not much a problem, maybe the wiki helps you a bit: 
 http://www.miscdebris.net/plplot_wiki/index.php?title=Qt

 Congratulations to you and your wife about the upcoming birth! I wish
 you all the best and I'm sure it will be a great time for all of you.

 Regards,
 Werner


 Alban

 --
 Dr. Werner Smekal
 Institut fuer Allgemeine Physik
 Technische Universitaet Wien
 Wiedner Hauptstr 8-10
 A-1040 Wien
 Austria

 email: sme...@iap.tuwien.ac.at
 web: http://www.iap.tuwien.ac.at/~smekal
 phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469  
 (laboratory)
 fax: +43-(0)1-58801-13499


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
 30-Day
 trial. Simplify your report design, integration and deployment - and  
 focus on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Plplot-devel mailing list
 Plplot-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/plplot-devel

--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: sme...@iap.tuwien.ac.at
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] RE : RE : Qt driver update

2009-09-01 Thread Werner Smekal
Hi Alban,

yes this works. I'll commit this as well. We may have to discuss, if  
this doesn't break anything else, e.g. if someone wants to use the  
driver in her Qt application, but as I understand it will initQtApp()  
only called if there is no existing qt app (or at least the specific  
lines), so this should be not much trouble.

Thanks for your help,
Werner

On 01.09.2009, at 10:58, Rochel, Alban wrote:

 Hi Werner,

 I'm not sure when Qt makes this change to the system settings, but I  
 suppose it's during the QApplication creation. So, can you try  
 changing
 QLocale::setDefault(QLocale::c())
 into
 setlocale(LC_NUMERIC, C);
 in qt.cpp (line ~100)?

 I hope this will work because I'm out of ideas...

 Alban
 
 De : Werner Smekal [sme...@iap.tuwien.ac.at]
 Date d'envoi : mardi 1 septembre 2009 09:56
 À : Rochel, Alban
 Cc : Alan W. Irwin; Plplot-devel mailing list; Hazen Babcock
 Objet : Re: RE : [Plplot-devel] Qt driver update

 Hi Alban,

 yes it compiles now, but it doesn't work. Still the same problem (I
 reverted all my changes to plctrl.c). Any other ideas?

 Regards,
 Werner

 On 01.09.2009, at 10:53, Rochel, Alban wrote:

 Oops, I forgot: add #include QLocale somewhere at the top (e.g.
 below #include QMutexLocker)
 
 De : plplot-devel-boun...@lists.sourceforge.net 
 [plplot-devel-boun...@lists.sourceforge.net
 ] de la part de Werner Smekal [sme...@iap.tuwien.ac.at]
 Date d'envoi : mardi 1 septembre 2009 09:47
 À : Alan W. Irwin
 Cc : Plplot-devel mailing list; Hazen Babcock
 Objet : Re: [Plplot-devel] Qt driver update

 Hi,

 I think I found out what the problem is. The first page reads okay,
 but then qt takes over to show the plot and somehow changes the
 locale
 or something. This is on a Mac, English version, but Austrian
 locale -
 so after that scanf expects floating point numbers to be written
 numbers like 3,1415 and not 3.1415. scanf fails then on the
 numbers. I
 assume that this is the problem, since I printed the out the numbers
 with printf in case  sscanf fails and the output is:

 0: 0.0   0.0   0.0   0.0   1.0 0
 1: 1.0   1.0   1.0   1.0   1.0 0
 0: 0.0   1.0   1.0   1.0   1.0 0
 0,00, -0,00, 0,00. 0,00, 0,00, 3075440

 *** PLPLOT WARNING ***
 Unrecognized cmap1 format (wrong number of items (1) for version 2  
 of
 format) 0.0   1.0   1.0   1.0   1.0 0

 I'll try now to play around with my locale. The other Mac has also
 Austrian locale, but obviously Qt cocoa doesn't mess around here.

 Ok, this is the problem. Qt carbon changes the locale and sscanf
 doesn't work as expected any more. If I add

 setlocale(LC_NUMERIC, C);

 just before the sscanf call, everything works as expected. This is
 obviously not the correct solution but at least we know what is going
 wrong. Also if I change my locale to UK the example works as  
 expected.

 Regards,
 Werner

 --
 Dr. Werner Smekal
 Institut fuer Allgemeine Physik
 Technische Universitaet Wien
 Wiedner Hauptstr 8-10
 A-1040 Wien
 Austria

 email: sme...@iap.tuwien.ac.at
 web: http://www.iap.tuwien.ac.at/~smekal
 phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469
 (laboratory)
 fax: +43-(0)1-58801-13499


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008
 30-Day
 trial. Simplify your report design, integration and deployment - and
 focus on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Plplot-devel mailing list
 Plplot-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/plplot-devel

 --
 Dr. Werner Smekal
 Institut fuer Allgemeine Physik
 Technische Universitaet Wien
 Wiedner Hauptstr 8-10
 A-1040 Wien
 Austria

 email: sme...@iap.tuwien.ac.at
 web: http://www.iap.tuwien.ac.at/~smekal
 phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469  
 (laboratory)
 fax: +43-(0)1-58801-13499


--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: sme...@iap.tuwien.ac.at
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] RE : RE : Qt driver update

2009-09-01 Thread Alan W. Irwin
On 2009-09-01 12:08+0200 Werner Smekal wrote:

 Hi Alban,

 yes this [setting locale in qt] works.

Hi Werner:

Thanks very much for thinking of locale as a possibility for messing up
sscanf.  That was a stroke of debugging genius, and it is wonderful news
that we now have the reason for all the strange results you were getting
when attempting to read palette files.

However, I don't think the current solution (revision 10363) to this problem
is correct. Instead of forcing the C locale whenever we use qt, the user
should be allowed to use any locale they like for _user_ input to PLplot
regardless of device driver. Of course, our palette files absolutely require
setlocale(LC_NUMERIC, C); in order to be read properly as you have
discovered. Thus, I think our best solution to this whole issue is to save
the user locale, use setlocale(LC_NUMERIC, C); to read the file, then
restore the user locale in both cmap0_palette_read and plspal1.  This method
absolutely guards against any locale issue (say for a different library than
qt) ever again screwing up palette file reading so this is what I like.

What do you think of this idea?  If you agree, would you be willing to help
with the implementation and testing?  (I don't know how to get the current
locale [there appears to be no function called getlocale, although
localeconv might be a possibility on Linux], and we have to insure that
setlocale [and whatever you recommend for getting the current locale
information] works on all our platforms.)

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


[Plplot-devel] RE : RE : Qt driver update

2009-08-27 Thread Rochel, Alban
Good news, thanks for testing!

I'll try and add it in eop() with the next patch.

Alban


De : Werner Smekal [sme...@iap.tuwien.ac.at]
Date d'envoi : jeudi 27 août 2009 13:01
À : Rochel, Alban
Cc : Alan W. Irwin; Plplot-devel mailing list
Objet : Re: RE : [Plplot-devel] Qt driver update

Hi Alban,

yes, that makes example 17 update regularily. The window opens still
in the background but stuff is plotted without getting the focus. The
other examples still remain grey. Would a
QApplication::processEvents();-call for eop/end help? I didn't find
the corresponding functions in the qt driver, so I couldn't try.

Thanks,
Werner

On 27.08.2009, at 09:31, Rochel, Alban wrote:

 Hello Werner,

 For your issue with example 17, can you try changing
 QtPLWidget::flush() in bindings/qt_gui/plqt.cpp (line 594) into:
 void QtPLWidget::flush()
 {
repaint();
   QApplication::processEvents();
 }

 I hope this will help...

 Alban
 
 De : Werner Smekal [sme...@iap.tuwien.ac.at]
 Date d'envoi : jeudi 27 août 2009 08:05
 À : Alan W. Irwin
 Cc : Rochel, Alban; Plplot-devel mailing list
 Objet : Re: [Plplot-devel] Qt driver update

 Hi Alban,

 I have committed your patch as revision 10346.  I am really happy to
 see
 this go in before our release.

 I tried the latest plplot code from svn with Qt 4.5.1 on Mac Os X and
 the issues still remain:

 * if I start an example (qtwidget device) from the terminal a window
 pops up in the background which is just grey. After I click on it, the
 plot updates.
 * example 17 doesn't update even if it gets the focus. Instead it
 remains grey and after some time I'll get only the last plot of
 example 17
 * example 16 has wrong colors. The following warning messages are
 print to the screen:

 *** PLPLOT WARNING ***
 Unrecognized cmap1 format 0.0   1.0   1.0   1.0   1.0 0

 *** PLPLOT WARNING ***
 Unrecognized cmap1 format 0. 240. 0.5 1.0 1. 0

 *** PLPLOT WARNING ***
 Unrecognized cmap1 format 0.0   0.0   0.0   0.0   1.0 0

 HTH,
 Werner



 Alan
 __
 Alan W. Irwin

 Astronomical research affiliation with Department of Physics and
 Astronomy,
 University of Victoria (astrowww.phys.uvic.ca).

 Programming affiliations with the FreeEOS equation-of-state
 implementation
 for stellar interiors (freeeos.sf.net); PLplot scientific plotting
 software
 package (plplot.org); the libLASi project (unifont.org/lasi); the
 Loads of
 Linux Links project (loll.sf.net); and the Linux Brochure Project
 (lbproject.sf.net).
 __

 Linux-powered Science
 __

 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008
 30-Day
 trial. Simplify your report design, integration and deployment - and
 focus on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Plplot-devel mailing list
 Plplot-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/plplot-devel

 --
 Dr. Werner Smekal
 Institut fuer Allgemeine Physik
 Technische Universitaet Wien
 Wiedner Hauptstr 8-10
 A-1040 Wien
 Austria

 email: sme...@iap.tuwien.ac.at
 web: http://www.iap.tuwien.ac.at/~smekal
 phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469
 (laboratory)
 fax: +43-(0)1-58801-13499


--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: sme...@iap.tuwien.ac.at
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel