Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions compliance/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class CheckerWarning(Exception):
"YokogawaWT330": 52,
"YokogawaWT330E": 52,
"YokogawaWT330_multichannel": 77,
"YokogawaWT210_DC": 508,
"YokogawaWT310_DC": 549,
"YokogawaWT330_DC": 586,
}

RANGING_MODE = "ranging"
Expand Down
9 changes: 9 additions & 0 deletions ptd_client_server/lib/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
# https://github.com/mlcommons/power-dev/issues/220#issue-835336923
DEVICE_TYPE_WT500 = 48

DC_DEVICES = [508, 549, 586]

MAX_RANGE_FOR_DEVICE = {
8: 20, # WT210
49: 20, # WT310
Expand All @@ -72,6 +74,9 @@
48: 40, # WT500_multichannel
47: 50, # WT1800
66: 30, # WT5000
508: 20, # WT210 DC
549: 20, # WT310 DC
586: 20, # WT330 DC
}


Expand Down Expand Up @@ -296,11 +301,13 @@ def get(
"ptd", "channel", parse=parse_channel, fallback=None
)
self.ptd_device_type: int = get("ptd", "deviceType", parse=int)
ptd_dc_flag: Optional[str] = get("ptd", "dcFlag", fallback=None)
ptd_interface_flag: str = get("ptd", "interfaceFlag")
ptd_device_port: str = get("ptd", "devicePort")
ptd_board_num: Optional[int] = get("ptd", "gpibBoard", parse=int, fallback=None)
# TODO: validate ptd_interface_flag?
# TODO: validate ptd_device_type?
# we can have a list of supported/tested devices and throw a warning when new device is used?
self.ptd_logfile: str = os.path.join(self.tmp_dir.name, "ptd_logfile.txt")
self.ptd_port: int = get("ptd", "networkPort", parse=int, fallback="8888")
self.ptd_command: List[str] = [
Expand All @@ -315,6 +322,7 @@ def get(
if self.ptd_channel is None
else ["-c", ",".join(str(x) for x in self.ptd_channel)]
),
*([] if ptd_dc_flag is None else [ptd_dc_flag]),
*([] if ptd_interface_flag == "" else [ptd_interface_flag]),
str(self.ptd_device_type),
ptd_device_port,
Expand All @@ -324,6 +332,7 @@ def get(
"command": self.ptd_command,
"device_type": self.ptd_device_type,
"interface_flag": ptd_interface_flag,
"dc_flag": ptd_dc_flag,
"device_port": ptd_device_port,
"channel": self.ptd_channel,
}
Expand Down
3 changes: 3 additions & 0 deletions ptd_client_server/server.template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ devicePort: COM1
# Channel value should consist of two numbers separated by a comma for a multichannel analyzer.
# Channel value should consist of one number or be disabled for a 1-channel analyzer.
#channel: 1,2

# (Optional in case of DC meter) flag needed to specify to PTD that meter will be used as DC meter
# dcFlag: -D