Error with menu

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
Jean-Francois
Posts: 859
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Error with menu

#1

Post by Jean-Francois »

Hello,

All my scripts with the "menu" custom button are not more working.


The following message appears:
Custom_button_error.jpg
Custom_button_error.jpg (57.05 KiB) Viewed 702 times

I tested with 4.1.14155, but it appears with 4.1.14136 too, maybe earlier.

In addition ... my script UCAC4 is not more working from the script console in 4.1.14155.
I tested the UCAC4 script with 4.1.14136 ... it is still working with the older version.
The Plate Solve coordinates are OK from the version 4.1.14136, but they are completely off with the 4.1.14155.

For the M42 image ... normally at around (5;-5) my script received the coordinates (2.5;17.8).

Jean-Francois
Jean-Francois
Posts: 859
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Error with menu

#2

Post by Jean-Francois »

Hello,

I tested on my laptop with older version ...
all fine with 4.1.14031 or before ... but the first time problem with the menu custom button is with the version 4.1.14120.

What changed in the script between 14031 and 14120 ?

Jean-Francois
User avatar
admin
Site Admin
Posts: 17609
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Error with menu

#3

Post by admin »

Hi Jean-Francois,

thanks for working out the version range for the problem - what happened in that range was that I tried to improve the way that the python scripting was cancelled if you press the 'Stop' button to stop a running script. I wouldn't have expected anything changed to do that to have had any effect on normal running (ie if you are not pressing stop), but aside from some supposedly 'safe' code tidy ups (generated by code analysis tools) there is nothing else to blame.

I will have a dig and see if I can get that fixed for today's update.

cheers,

Robin
User avatar
admin
Site Admin
Posts: 17609
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Error with menu

#4

Post by admin »

Hi,

just a quick update - I am still not 100% sure about the cause, but I have a workaround for you.

In your scripts, shift the class definitions out of the functions up to the main level, so that the classes are defined when the script is first run (even if they are not used at that point). As an example, I shifted the

Code: Select all

class UCAC4_MenuForm(Form):
	.... many lines of class body ....
out of the launch_UCAC4_form() function to put it just above and then it all works fine. I think that something has changed about the way that the custom button code is being run that means it is unhappy about defining new types in response to that code. Still trying to work out why...

cheres,

Robin
User avatar
admin
Site Admin
Posts: 17609
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Error with menu

#5

Post by admin »

Hi,

should be fixed with the latest update - it turns out that my clever new way of cancelling the script left the runtime in an odd and somewhat broken state when I tried to turn it off at the end of a run. If I don't turn it off and leave it in place but deactivated then all is fine.

cheers,

Robin
Jean-Francois
Posts: 859
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Error with menu

#6

Post by Jean-Francois »

Hello Robin,

Yes, it works back with the last version of today.

And the UCAC4 stars coordinates are OK again.
No idea why it was not the case with the preceding version.

Jean-Francois
Post Reply