Jump to content

Error while using "Try and Except" for Exposure Setting.


---
 Share

Recommended Posts

Hello,

I am trying to change exposure settings via python script, but if there is a error while calculating the exposure time. The script should give the error in output console/box "try & expect:"

 

Case 1 :

When using "Exposure Mode : Automatic from reference points" via "Try & Expect method"

The script is working properly and showing error in output box.

 

Case 2:

When using "Exposure Mode : Automatic by Matrix or Spot" via "Try & Expect method"

The script is stopping abruptly and showing a popup ERROR message.

As both error messages are same, then why one message is appearing in output box and other as popup Error message.

 

Case 1: -

import gom
	
try:

	gom.script.atos.set_parameters_for_new_measurements (automatic_exposure_time_mode='reference_points')

	gom.script.atos.use_automatic_exposure_time_once_spot (camera='right_camera',coordinate=gom.Vec2d (1226.643629, 1025.0),radius=227,restrict_number_of_exposure_times=2)

except Exception as error:
	print("Exposure Mode : Automatic from reference points")
	
	print(error)	


	
	

Case 1: - Output :

Exposure Mode : Automatic from reference points
FG-0014: Cannot compute the automatic exposure time.

The computations contain an error.

 

Case 2: -

import gom

try:
	gom.script.atos.set_parameters_for_new_measurements (automatic_exposure_time_mode='matrix')

	gom.interactive.atos.adjust_live_image_brightness ()
	
except Exception as error:
	print("Exposure Mode : Automatic by Matrix")
	
	print(error)

Case 2: - Output :

image.png.3738de73b31845c490ca430738b2179d.png

 

 

Thank you in advance

Link to comment
Share on other sites

 Share

×
×
  • Create New...