Skip to content
Snippets Groups Projects
Commit 3297a1d2 authored by mhoeschle's avatar mhoeschle
Browse files

add function at the end, above __name__ == ... to run from command line

parent db587b29
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ if len(devices) == 0:
# Create an array of instant cameras for the found devices and avoid exceeding a maximum number of devices. -> Output-> Pylon::CInstantCameraArray
CAMERAS_ARRAY = pylon.InstantCameraArray(min(len(devices), MAX_CAMERAS_TO_USE))
print(f'cameras: {CAMERAS_ARRAY}')
# print(f'cameras: {CAMERAS_ARRAY}') # for debug
l = CAMERAS_ARRAY.GetSize()
......@@ -47,17 +47,13 @@ def listcams():
for i, camera_instantz in enumerate(CAMERAS_ARRAY):
# cam is an instance Swig object of type Pylon::CInstantCamera on cluster on HD
camera_instantz.Attach(tlFactory.CreateDevice(devices[i]))
print(f'camInstatnt: {type(camera_instantz)}')
#
# list all the connected cameras at the system:
#
print(f'camera_instantz: {type(camera_instantz)}')
# Print the serial number of the model of the camera. - by replacing .GetSerialNumber() with .GetModelName() outputs the Modelname
cam_ids = camera_instantz.GetDeviceInfo().GetSerialNumber()
print("Using device ", cam_ids)
return cam_ids
return cam_ids, camera_instantz
# Open cameras:
......@@ -243,6 +239,8 @@ def freeruncam():
# ---> ongoing, not yet in usage.
CAM_ID, CAM_INSTANT = listcams()
if __name__ == '__main__':
CAM_ID, CAM_INSTANT = listcams()
readcams()
# readcams()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment