Yuval Levy twisted the bytes to say:
Yuval> Bruno Postle wrote:
>> If you add wx code to src/hugin_base then everything, even the
>> command-line tools, will get linked to wxwidgets.
Yuval> fear not - it would be *temporary* for verbose debugging only and would
Yuval> never make it even into SVN - or if it will it will be commented out
Yuval> with a notice for developers how to activate it when they need
verbosity
Yuval> for debug.
Yuval> the problem is that unlike Linux and OS X, Wincrap kills the console
Yuval> when a GUI app is started, so stderr output goes to the equivalent of
Yuval> /dev/nul. Tom directed us to a flag in MSVC when Tim started
introducing
Yuval> verbosity to debug the issue with Celeste in the Wincrap version of
Yuval> Hugin. I tried toying with that flag but it messed up compiling big
Yuval> time. Right now I am writing to a log file, with a method introduced by
Yuval> Tim to debug Celeste. Unfortunately, if Hugin hangs, the buffer does
not
Yuval> get flushed into the file and so the last bits of verbosity, which are
Yuval> the critical ones, are missing. Popping up alert windows gives
real-time
Yuval> immediate feedback and enable quick identification of the source of the
Yuval> problem.
How about flushing after each printf?
Panotools has a Print_Error function that can be reused in hugin. This
function can take any number of parameters. Its beauty is that it uses
a pointer to a function that can be used instead of writing to the
standard output.
static void (*g_printErrorFcn)(char* , va_list va) = NULL;
void PrintError(char*fmt, ...)
{
va_list ap;
va_start(ap, fmt);
if (g_printErrorFcn == NULL) {
PrintErrorIntern(fmt, ap);
} else {
(*g_printErrorFcn)(fmt, ap);
}
va_end(ap);
}
void PrintErrorIntern( char* fmt, va_list ap)
{
vprintf(fmt, ap);
fflush(stdout);
}
>> All this GUI stuff needs to be confined to src/hugin1. Currently
>> it is possible to build and install the command-line tools on a
>> system with no GUI libraries whatsoever (and I do this).
Yuval> Absolutely agreed. We should document these architectural choices
Yuval> somewhere. As these are my first steps into the depth of the code base,
Yuval> I find it an unintuitive nightmare just to locate where things are and
Yuval> understand why there were placed there.
Use the code above, and, at run time, define a function that uses
WX. Then assign it to g_printErrorFcn.
--
Daniel M. German "I still have to see a problem,
however complicated, which, when
you looked at it in the right way
Poul Anderson -> did not become still more complicated."
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at:
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/hugin-ptx
-~----------~----~----~----~------~----~------~--~---