AU-ExoMars / PCOT

Pancam Operations Toolkit
MIT License
3 stars 0 forks source link

Eval function help #6

Closed jimfinnis closed 3 years ago

jimfinnis commented 3 years ago

Eval functions need some kind of help system:

This requires the registerFunc code to be able to handle documentation, and chkargs to be tweaked too (with arg names!) We should also make sure we use chkargs throughout, or make its use automatic. Don't add more funcs until I've thought about this.

jimfinnis commented 3 years ago

Coming along nicely, but does massively complicate adding a function. Here's some code now:

        self.registerFunc("grey", "convert an image to greyscale",
                          [Parameter("image", "an image to process", conntypes.IMG)],
                          [Parameter("useCV",
                                     "if non-zero, use openCV greyscale conversion (RGB input only): 0.299*R + 0.587*G + 0.114*B",
                                     conntypes.NUMBER, deflt=0)],
                          funcGrey)

So that's

jimfinnis commented 3 years ago

Now I need to provide the help function and useful error reporting using that data.

jimfinnis commented 3 years ago

Done, via context menus in the expression editor. Works fairly well.