Forum

Author Topic: Timed interrupt of a loop.  (Read 1348 times)

stijntje44@hotmail.com

  • Newbie
  • *
  • Posts: 7
    • View Profile
Timed interrupt of a loop.
« on: August 26, 2019, 03:04:31 PM »
Hi,
I made an automated script for agisoft Metashape 1.5.0

This script potentially loops indefinitely and I thought it would be nice to give the user the potential to exit the loop after each loop.

The idea was to Metashape.getBool in order to give the user a chance to input a boolean.

IF the user were to not input anything for say, 10 seconds, it would default to False and continue the loop.

However, you cannot do anything while the script is sleeping, and asking for a boolean also halts the process, so I cannot get any temporary pop-up going.

I've tried with multi-threading but it either doesn't work with Agisoft or I am doing something wrong.

I am using windows 10, python 3.6 (I believe).


Thanks for any help,
Stijn Klessens

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Re: Timed interrupt of a loop.
« Reply #1 on: August 26, 2019, 03:23:59 PM »
Hello Stijn,

Can you share the part of the code that is intended to wait for the user input during the loop?
Best regards,
Alexey Pasumansky,
Agisoft LLC