Topic: oofeg problem

I have a strange problem with oofeg.
For some reason, I cannot select a specific step, active problem or magnificaiton factor for deformed shapes anymore.
Whenever I need to type input, oofeg does not recognise it anymore.
All the buttons still work fine.
Any idea what this could be caused by. Any recent changes to oofeg that would have triggered this?

Thanks

Peter

Re: oofeg problem

I looked back through the more recent changes that could effect oofeg. The only thing I could find was related to case sensitivity (which would be my fault, sorry).
Does it work if you type the commands in lower case?

Re: oofeg problem

the commands that i tried are given in numbers

Re: oofeg problem

OK, I change it back to strncasecmp in oofeg.C and it works now again. Thanks for letting me know.

Re: oofeg problem

Hmmm. I didn't realize these commands were constructed in-code in "apply_change".
So the problem here was that some the magic strings where input two times, and upper-lower case was inconsistent in the code.


I think instead of using strncasecmp (since it's not part of the standard, I think it's best to try to avoid), OOFEG should #define all the magic strings and check them exactly, i.e.;

#define SET_ZPROF_SCALE "set_zprof_scale"
#define ACTIVE_STEP "active_step"

but I don't see why one would need to use strings at all here.
Just an Enum variable seems more suitable for these commands.
I.e. change to

enum OOFEGCommand {
    OC_ActiveStep,
    ....
}

static void apply_change(Widget wid, XtPointer cl, XtPointer cd)
{
    OOFEGSimpleCmd((OOFEGCommand)cl, (char*)cd);
}

// readSimpleString redundant

Much safer and simpler code.
I don't see a need to ever run OOFEGSimpleCmd manually either, since if OOFEG knows about the command, then surely there would also be a button for it already.

6

Re: oofeg problem

Not able to check right now, but oofeg also comes with command line, where you can input all the commands manually, so you can use simple scripts made of these commands.  So the commands can be reached also from the command window, not only from the menu.
This command window is available only when compiled with OOFEG_DEVEL.
Borek

Re: oofeg problem

That was what I assumed at first, but as far as I can tell "OOFEGSimpleCmd" is only ever used in one function: "apply_change", which in turn is only ever used in a bunch of dialog windows that look like

            oofeg_add_dialog(NULL, "Set Contour Width", "Set contour width", "0", color_scale_palette,
                             apply_change, "CONTOUR_WIDTH", ESIDialogValueNumber, NULL);