Forum

Author Topic: On start script user should make 2 inputs  (Read 10367 times)

Milderinne

  • Newbie
  • *
  • Posts: 34
    • View Profile
On start script user should make 2 inputs
« on: May 16, 2016, 09:00:46 PM »
Hei,

I have an other question:
Is there any possibility that when a script is started the user gives as input one number and can choose between 2 string input variables in a window as input for the script?
That would make my and others live much easier to process all that data.
I would be thankful for any suggestions.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15354
    • View Profile
Re: On start script user should make 2 inputs
« Reply #1 on: May 18, 2016, 01:29:02 PM »
Hello Milderinne,

Do you mean two fixed options (like buttons) or two input fields that can be adjusted by the user?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Milderinne

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: On start script user should make 2 inputs
« Reply #2 on: May 18, 2016, 07:15:14 PM »
Hello Alexey,

I have created a script which runs through all processes I want (more or less...there is always something to optimize..).
This script should be know applied to different "objects" or samples or how ever we call it.
The only thing I have to change for that, is the number of the specific sample AND the method (out of two).
So I think about something like two radiobuttons to decide which method. And maybe a list of all sample numbers where the user can choose one.

I hope I was able to explain it understandable.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15354
    • View Profile
Re: On start script user should make 2 inputs
« Reply #3 on: May 18, 2016, 07:24:14 PM »
Hello Milderinne,

Then you might need to use PySide module to create your own dialog.

You can use scripts with "dialog" suffix from the following page as a reference:
http://wiki.agisoft.com/wiki/Python
Best regards,
Alexey Pasumansky,
Agisoft LLC

Milderinne

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: On start script user should make 2 inputs
« Reply #4 on: May 18, 2016, 07:35:11 PM »
Ok, thank you. It seems that I would need to adjust quite some  things...

For later use, I might try to use PySide module, but  is there also an "easier way".
Unfortunately, I have only limited time left at the moment.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15354
    • View Profile
Re: On start script user should make 2 inputs
« Reply #5 on: May 18, 2016, 07:40:46 PM »
Hello Milderinne,

You can prompt for the integer,  float and string input from user with the following functions:
PhotoScan.app.getInt(label = "Input int", value = "10")
PhotoScan.app.getFloat()
PhotoScan.app.getString()
Label argument stands for the message box text and value - for default input.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Milderinne

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: On start script user should make 2 inputs
« Reply #6 on: May 18, 2016, 07:54:29 PM »
Hello Alexey.
Perfect, that helps a lot already!
Thank you!

PhotoScan.app.getInt(label = "Input int", value = "10")
--> the 10 should just be without quotation marks right?
« Last Edit: May 18, 2016, 07:59:50 PM by Milderinne »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15354
    • View Profile
Re: On start script user should make 2 inputs
« Reply #7 on: May 18, 2016, 08:01:59 PM »
Hello Milderinne,

Using existing built-in PhotoScan module functionality it is not possible, only one after another. So for more complicated and custom tasks I can only suggest to use PySide, it's not very complicated.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Milderinne

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: On start script user should make 2 inputs
« Reply #8 on: May 18, 2016, 08:14:09 PM »
Sorry, I already changed my answer  ::)
I will try PySide if I get more time for this.
Thank you, for all advices!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15354
    • View Profile
Re: On start script user should make 2 inputs
« Reply #9 on: May 18, 2016, 08:18:53 PM »
As for the value argument, it should be the same type as expected from user input, i.e. integer, float or string. So for getInt() there shouldn't be quotes, I was thinking about getString() at the same time.
Best regards,
Alexey Pasumansky,
Agisoft LLC