flexbe_behavior_engine icon indicating copy to clipboard operation
flexbe_behavior_engine copied to clipboard

Question: Textarea edit for strings

Open reinzor opened this issue 8 years ago • 2 comments

We would like to add a parameters using a textarea (https://www.w3schools.com/tags/tag_textarea.asp) is this possible?

If not, I would like to add this to the GUI, any pointers?

Thanks,

Rein

reinzor avatar Oct 13 '17 15:10 reinzor

This is not implemented, but should be quite easy to add.

You can change this line to use textarea instead of input or condition this for example on the type of the parameter: param.type=="text"? "textarea" : "input". However, some adjustments might be useful such as changing the class to "input_text" or max-height to something like 50px since the flipping capability of the panel interferes with the dynamic scaling.

It's probably best if you just play around a bit until you are satisfied and make a PR if you think this change would be useful. Let me know if you have further questions on this.

I actually have one question myself: Since the parameters are meant to be used for text entered by the operator before each behavior execution, I usually experienced rather short values. What is in your application the use case for which a textarea makes more sense?

pschillinger avatar Oct 13 '17 17:10 pschillinger

Thanks for the information. I will take a look at this tomorrow. We would like to specify grammars for speech recognition, which are usually multiple lines. This also fired up the other question ( #39 ) since we would like to dynamically generate outcomes from the specified grammar. Example grammar:

ROOT["say_hi"] -> Hi | Hello | Hey
ROOT["say_name"] -> Could you say your name? | What is your name?

More info: https://github.com/tue-robotics/grammar_parser

The idea is to let the user specify a grammar in the text area box and then auto generate the outcomes specified in the ROOT semantics + the timeout of failure outcome.

reinzor avatar Oct 15 '17 15:10 reinzor