-
Notifications
You must be signed in to change notification settings - Fork 399
Feeltech fy3200s instrument driver #1310
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1310 +/- ##
==========================================
+ Coverage 60.03% 60.12% +0.09%
==========================================
Files 281 283 +2
Lines 19454 19503 +49
==========================================
+ Hits 11679 11726 +47
- Misses 7775 7777 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thank you for your contribution.
Here a first round of comments. The quality of your code looks good.
# | ||
# This file is part of the PyMeasure package. | ||
# | ||
# Copyright (c) 2013-2024 PyMeasure Developers |
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.
# Copyright (c) 2013-2024 PyMeasure Developers | |
# Copyright (c) 2013-2025 PyMeasure Developers |
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.
Please add copyright notice at the top (with the correct year).
class FY3200S(SCPIUnknownMixin, Instrument): | ||
"""Class to control the Feeltech FY3200S arbitrary waveform generator""" | ||
|
||
def __init__(self, adapter: SerialAdapter, name: str = "FY3200s AWG", **kwargs): |
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.
The adapter can be a string or a subclass of Adapter
!
) | ||
|
||
|
||
class FY3200S(SCPIUnknownMixin, Instrument): |
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.
SCPIUnknownMixin is for devices, where we did not know, whether it supports SCPI or not.
If it supports SCPI, do use SCPIMixin. If it does not support SCPI (as it seems), do not use the Mixin, but use scpi_included=False (or similar) in the constructor call.
|
||
def __init__(self, adapter: SerialAdapter, name: str = "FY3200s AWG", **kwargs): | ||
"""Initialize the instrument with a SerialAdapter | ||
:param adapter: SerialAdapter for the connection. The write termination has to be \\n |
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.
You can specify the write termination in the call to super init.
Afterwards you just write the address as "adapter" and the device does the correct configuration for you.
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.
Thanks for adding tests.
@property | ||
def id(self): | ||
"""Get the identification of the instrument.""" | ||
return "Feeltech FY3200S arbitrary waveform generator" |
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.
If you do not read anything from the device, what is the reason for that property?
Typically the id gives the serial number etc.
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.
As a new contributor, you may add your name to authors.txt
as well.
|
||
waveform = Instrument.setting( | ||
"{ch}w%i", | ||
"Set the waveform of the channel.", |
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.
Maybe hint at the Waveforms dictionary, such that a user knows, which values are available.
self.write("{ch}r0") | ||
|
||
|
||
class SubsidiaryChannel(Channel): |
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.
Are both classes the same one?
What are the differences?
Maybe you could base one Channel on the other (e.g. the Main one on the subsidiary on, if only the main one has a few more options).
If they are the same, a single Class would be sufficient, you distinguish the instances in the Instrument.
A driver for a very cheap chinese AWG: https://chinese-electronics-products-tested.blogspot.com/p/fy3200s-function-generator-tested.html