Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basler cam development #164

Open
wants to merge 37 commits into
base: BaslerCam
Choose a base branch
from

Conversation

YangLiujames
Copy link
Contributor

No description provided.

@YangLiujames
Copy link
Contributor Author

@AhmetCanSolak , Could you help with this request?

Copy link
Contributor

@AhmetCanSolak AhmetCanSolak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start @YangLiujames ! Once conflict details are cleaned, I think I will be able to give a complete review.


def __del__(self):
self.closecam()
exitcode = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line can be omitted

Copy link
Contributor

@AhmetCanSolak AhmetCanSolak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many improvements @YangLiujames thank you, I dropped a couple comments. Once you have some demos implemented let's try to run those demos together on device and see if we run into anything we don't expect so far.

from pypylon import pylon as py
from pypylon import genicam
import sys
exitcode = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this global variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking in case the software crashed and it will close and quit ... From my experience, if things are not closed properly, often restart the computer is required and it is quite annoying. The global variable sort of add a protection in del() if there is a better way. please let me know

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if your program crash, there is no guarentee python garbage collector will call __del__ methods :) so it is a false sense of protection in this case. I agree with your concern and we can think what else we can do to address this unclosed devices concerns.

Copy link
Contributor

@AhmetCanSolak AhmetCanSolak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are getting there, thank you @YangLiujames . I requested some log and name changes.

@property
def image_width(self):
width = self.camera.Width.GetValue()
print("SensorMax Width {} for camera".format(width))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also switch the print statements with usage of logger as in mirror device adapter?

@property
def exposure_mode(self):
self.camera.ExposureMode.GetSymbolics()
self.camera.ExposureMode.GetValue()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you gotta return something here @YangLiujames , I got the value but what does GetSymbolics return here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Symbolics return all the available options. For this settings, I changed this function to fix this converns

@YangLiujames YangLiujames requested review from edyoshikun and removed request for edyoshikun June 14, 2023 00:30
Copy link
Contributor

@AhmetCanSolak AhmetCanSolak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped various comments and questions for you @YangLiujames

return min(max(number, lower_bound), upper_bound)


class GrabStrategy(Enum):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to BaslerGrabStrategy?

@YangLiujames YangLiujames self-assigned this Jun 22, 2023
@YangLiujames YangLiujames marked this pull request as draft June 23, 2023 21:55
Copy link
Contributor

@AhmetCanSolak AhmetCanSolak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is ready overall, just the exitcode comment needs to be addressed, otherwise looks good to me @YangLiujames . You can get review from @edyoshikun and @keithchev as well.

@AhmetCanSolak AhmetCanSolak marked this pull request as ready for review July 25, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants