Skip to content

Commit

Permalink
Merge pull request #48 from ifm/add_o2u_device
Browse files Browse the repository at this point in the history
Add o2u device to meta data and restructure example code in corresponding device type folders
  • Loading branch information
Galoshi authored Oct 30, 2024
2 parents 5a85f7f + 92a845c commit edef040
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions source/rpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io
import numpy as np
import matplotlib.image as mpimg
import warnings


SOCKET_TIMEOUT = 10
Expand Down Expand Up @@ -81,8 +82,8 @@ def _getDeviceMeta(self):
result = DevicesMeta.getData(key="DeviceType", value=_deviceType)
if not result:
_articleNumber = self.getParameter(value="ArticleNumber")
raise TypeError("Device {} with DeviceType {} is not supported by this library!"
.format(_articleNumber, _deviceType))
warnings.warn("Device {} with DeviceType {} and IP {} may not be supported by this library!"
.format(_articleNumber, _deviceType, self.address), ResourceWarning)
return result

def getParameter(self, value: str) -> str:
Expand Down
10 changes: 9 additions & 1 deletion source/static/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DevicesMeta(enum.Enum):
O2I5xx = {"ArticleNumber": ["O2I5xx",
"O2I510", "O2I511", "O2I512",
"O2I513", "O2I514", "O2I500",
"O2I515", "O2I501", "O2I502",
"O2I515", "O2I501", "O2I502",
"O2I503", "O2I504", "O2I505"],
"DeviceType": ["1:256", 0x100],
"LogicGraphConfigExtension": ".o2xlgc",
Expand All @@ -39,6 +39,14 @@ class DevicesMeta(enum.Enum):
"ApplicationConfigExtension": ".o2i4xxapp",
"DeviceConfigExtension": ".o2i4xxcfg",
"PCICConfigExtension": ".o2xpcic"}
O2U5xx = {"ArticleNumber": ["O2U5xx",
"O2U530", "O2U532", "O2U534",
"O2U540", "O2U542", "O2U544"],
"DeviceType": ["1:384", 0x180],
"LogicGraphConfigExtension": ".o2xlgc",
"ApplicationConfigExtension": ".o2u5xxapp",
"DeviceConfigExtension": ".o2u5xxcfg",
"PCICConfigExtension": ".o2xpcic"}

@classmethod
def getData(cls, key, value):
Expand Down

0 comments on commit edef040

Please sign in to comment.