-
Hello everyone, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
If you are willing to share your code and a little more explanation about what you are wanting to validate, I am happy help directly get you started (you can post python code in these discussions, instructions here). I'd have to learn more about what you're trying to do, but I think this should be a perfect use case for the API. However if you are wanting to validate a variable that an experimenter is inputting, then a custom control dialog may be an even better solution. I can help with that as well, just let me know. |
Beta Was this translation helpful? Give feedback.
-
The code you provided worked great, attached is my code for simple task that spins a mouse wheel and the validation i tried to create based on your code. This is the error i pulled from the
Even though i made sure all the variable are sent when calling the function. |
Beta Was this translation helpful? Give feedback.
The API script can only act upon changes to the task variables after they have been made, instead we would like to prevent setting/changing the variable in the first place if it is invalid.
I have created an example for you that uses a custom controls dialog. Download and unzip validation_v1.zip. Place the
input_validation.py
in yourtasks/
folder and placevalidation_gui.py
in yourcontrols_dialogs/
folder.Hope that is enough to get you started. Let me know if you have questions!
CleanShot.2024-07-16.at.12.28.15.mp4