amsbr / OctoPrint-EEPROM-Marlin

OctoPrint-EEPROM-Marlin
15 stars 31 forks source link

Syntax checking of input #34

Open azalanono opened 6 years ago

azalanono commented 6 years ago

Hello. Your plugin is really nice, but from practice, I want to suggest you some enhancements: There are countries (i.e. Austria), where "real numbers", numbers with decimal places, are written with "," as "decimal point", while usually english speaking countries use a "." as decimal point. This often causes troubles when one uses a "," while a "." is expected, as vice versa.

Therefore I usually even don't accept a wrong character while the user is typing (on the fly), or I automatically replace the character with the expected one (on the fly), or - in worst case - I do a final check of entered data and output an error when unexpected characters have beed entered.

I highly recommend to you to do the same in your plugin. I do not know what is the best way in your situation, but one of this approaches should be done, preferrably the second one.

Why? Your plugin is usually not used every day. It is used at the beginning, and when everyting is configured well, it will not be used over long time any more. So the user forgets how to correctly input numbers. I repeatedly trap myself in this point. I entered "-0.4" as Z-offset, instead of entering "-0,4". As result, a value of "0" was stored as Z-offset and the next print was crap.

Hope I could help you improving your great plugin.

amsbr commented 6 years ago

Thank you @azalanono! I will apply this improvement soon.