-
Notifications
You must be signed in to change notification settings - Fork 71
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
[WIP] Support for remote serial ports #176
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -474,7 +474,8 @@ class MotorChannel(ThorLabsAPT.APTChannel): | |
'DRV113': (pq.Quantity(20480, 'ct/mm'),) * 3, | ||
'DRV114': (pq.Quantity(20480, 'ct/mm'),) * 3, | ||
'FW103': (pq.Quantity(25600 / 360, 'ct/deg'),) * 3, | ||
'NR360': (pq.Quantity(25600 / 5.4546, 'ct/deg'),) * 3 | ||
'NR360': (pq.Quantity(25600 / 5.4546, 'ct/deg'),) * 3, | ||
'PRM1-Z8': (pq.Quantity(1919.64 / 360 ,'ct/deg'),) * 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert unrelated changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, thanks, we had that included in our local testing and committed by accident. That really belongs in #167, probably. |
||
}, | ||
# TODO: add other tables here. | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I wonder if the better approach is to include this functionality in
open_serial
and just add more named parameters to that functionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I somewhat agree, but I'm also of mixed minds. The API that PySerial offers for local and remote serial ports is subtly different enough that it might make
open_serial
confusing to call if it does both. Would something likeremote=True
be enough, do you think? If so, we could do both by having the oldopen_serial
and newopen_serial_remote
both basically be private methods called by a new combinedopen_serial
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
open_serial
, you already offer the option to define the device either withport
or with thepid
/vid
/serial_number
combination. I think, if the logic complexity does not explode, it would be better to add anotherurl
parameter instead of having to maintain a separate class method just for thefor_url
approach.Also, even if you don't do that, one thing that smells odd to me (without having dug too deep into the api) is that the array of configuration parameters is different between
open_serial
andopen_serial_remote
, (baud/timeout/write_timeout vs baud/dsrdtr/rtscts/xonxoff/timeout).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All excellent points