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

[DRAFT] Add Rigol instrument #8

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rtestbench/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ def unlock(self):
###########

from rtestbench.tools.keysight._factory import get_keysight_tool
from rtestbench.tools.rigol._factory import get_rigol_tool


class ToolFactory(object):
Expand Down Expand Up @@ -560,6 +561,11 @@ def _build_specific_tool(self, tool_info) -> Tool:
return get_keysight_tool(tool_info)
except ValueError:
raise
elif tool_info.manufacturer == "Rigol Technologies":
try:
return get_rigol_tool(tool_info)
except ValueError:
raise
else:
raise NotImplementedError("The manufacturer {} has not been implemented yet.".format(tool_info.manufacturer))

Expand Down
2 changes: 2 additions & 0 deletions rtestbench/tools/rigol/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


25 changes: 25 additions & 0 deletions rtestbench/tools/rigol/_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Factory functions for all rigol instruments."""


from rtestbench.tools.rigol.oscilloscope import ds1102


def get_rigol_tool(tool_info):
"""Returns the dedicated rigol Tool based on the model.

Raises:
ValueError: The model is not known from the system.
"""

try:
return get_rigol_oscilloscope(tool_info)
except ValueError: # When other families are added, update this part of the code.
raise ValueError("Unknown rigol family of instruments/tools.")


def get_rigol_oscilloscope(tool_info):
# DS1102x series
if tool_info.model == "DS1102E":
return ds1102.DS1102E(tool_info)
else:
raise ValueError("Unknown rigol electrometer model")
7 changes: 7 additions & 0 deletions rtestbench/tools/rigol/oscilloscope/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# __all__ = [
# 'ds1102e',
# ]


# from . import _interface_v1
Loading