From 894bdeedddd64592a5e7689d223c27d8f53204aa Mon Sep 17 00:00:00 2001 From: Blaise Thompson Date: Tue, 21 Nov 2023 10:01:46 -0600 Subject: [PATCH] new daemon omega-d8200 (#91) --- daemons/omega-d8200.avpr | 273 +++++++++++++++++++++++++++++++++++++++ known-hardware.toml | 4 + 2 files changed, 277 insertions(+) create mode 100644 daemons/omega-d8200.avpr diff --git a/daemons/omega-d8200.avpr b/daemons/omega-d8200.avpr new file mode 100644 index 00000000..e80865bf --- /dev/null +++ b/daemons/omega-d8200.avpr @@ -0,0 +1,273 @@ +{ + "config": { + "baud_rate": { + "default": 9600, + "origin": "uses-uart", + "type": "int" + }, + "byte_size": { + "default": 8, + "doc": "Byte size of your instrument.", + "type": "int" + }, + "enable": { + "default": true, + "doc": "Disable this daemon. The kind entry-point will not attempt to start this daemon.", + "origin": "is-daemon", + "type": "boolean" + }, + "log_level": { + "default": "info", + "doc": "Set daemon log-level.", + "origin": "is-daemon", + "type": { + "name": "level", + "symbols": [ + "debug", + "info", + "notice", + "warning", + "error", + "critical", + "alert", + "emergency" + ], + "type": "enum" + } + }, + "log_to_file": { + "default": false, + "doc": "Optionally force logging to a file.", + "origin": "is-daemon", + "type": "boolean" + }, + "make": { + "default": null, + "origin": "is-daemon", + "type": [ + "null", + "string" + ] + }, + "modbus_address": { + "default": 1, + "doc": "Unique address in the modbus network.", + "type": "int" + }, + "model": { + "default": null, + "origin": "is-daemon", + "type": [ + "null", + "string" + ] + }, + "parity": { + "default": "none", + "doc": "Modbus parity.", + "type": { + "name": "parity", + "symbols": [ + "even", + "odd", + "none" + ], + "type": "enum" + } + }, + "port": { + "doc": "TCP port for daemon to occupy.", + "origin": "is-daemon", + "type": "int" + }, + "serial": { + "default": null, + "doc": "Serial number for the particular device represented by the daemon", + "origin": "is-daemon", + "type": [ + "null", + "string" + ] + }, + "serial_port": { + "origin": "uses-uart", + "type": "string" + }, + "stop_bits": { + "default": "one", + "doc": "Number of stop bits.", + "type": { + "name": "stop_bits", + "symbols": [ + "one", + "one_and_half", + "two" + ], + "type": "enum" + } + } + }, + "doc": "", + "hardware": [ + "omega:d8200" + ], + "installation": { + "PyPI": "https://pypi.org/project/yaqd-omega" + }, + "links": { + "bugtracker": "https://github.com/yaq-project/yaqd-omega/-/issues", + "source": "https://github.com/yaq-project/yaqd-omega" + }, + "messages": { + "busy": { + "doc": "Returns true if daemon is currently busy.", + "origin": "is-daemon", + "request": [], + "response": "boolean" + }, + "direct_serial_write": { + "doc": "Expose direct access to the serial port to clients.\n\nThis should not be encouraged for normal use, but may be very important for debugging.\nIf a device is expected to return data, it should be logged at the INFO level, not returned to the client.\nThis is done to allow long tasks to be run asynchronously, and to explicitly discourage use of this method except when debugging.\nSetting `busy` to true is encouraged, but individual daemon writers should consider their own use case.\n", + "origin": "uses-serial", + "request": [ + { + "name": "message", + "type": "bytes" + } + ], + "response": "null" + }, + "get_channel_names": { + "doc": "Get current channel names.", + "origin": "is-sensor", + "request": [], + "response": { + "items": "string", + "type": "array" + } + }, + "get_channel_shapes": { + "doc": "Get current channel shapes. If list is empty, channel is scalar.", + "origin": "is-sensor", + "request": [], + "response": { + "type": "map", + "values": { + "items": "int", + "type": "array" + } + } + }, + "get_channel_units": { + "doc": "Get current channel units.", + "origin": "is-sensor", + "request": [], + "response": { + "type": "map", + "values": [ + "null", + "string" + ] + } + }, + "get_config": { + "doc": "Full configuration for the individual daemon as defined in the TOML file.\nThis includes defaults and shared settings not directly specified in the daemon-specific TOML table.\n", + "origin": "is-daemon", + "request": [], + "response": "string" + }, + "get_config_filepath": { + "doc": "String representing the absolute filepath of the configuration file on the host machine.\n", + "origin": "is-daemon", + "request": [], + "response": "string" + }, + "get_measured": { + "doc": "Returns map of channel_name to measured_value. Always returns additional key measurement_id.", + "origin": "is-sensor", + "request": [], + "response": { + "type": "map", + "values": [ + "int", + "double", + "ndarray" + ] + } + }, + "get_measurement_id": { + "doc": "Get current measurement_id. Clients are encouraged to watch for this to be updated before calling get_measured to get entire measurement.", + "origin": "is-sensor", + "request": [], + "response": { + "type": "int" + } + }, + "get_state": { + "doc": "Get version of the running daemon", + "origin": "is-daemon", + "request": [], + "response": "string" + }, + "id": { + "doc": "JSON object with information to identify the daemon, including name, kind, make, model, serial.\n", + "origin": "is-daemon", + "request": [], + "response": { + "type": "map", + "values": [ + "null", + "string" + ] + } + }, + "shutdown": { + "doc": "Cleanly shutdown (or restart) daemon.", + "origin": "is-daemon", + "request": [ + { + "default": false, + "name": "restart", + "type": "boolean" + } + ], + "response": "null" + } + }, + "protocol": "omega-d8200", + "requires": [], + "state": {}, + "traits": [ + "is-daemon", + "is-sensor", + "uses-serial", + "uses-uart" + ], + "types": [ + { + "fields": [ + { + "name": "shape", + "type": { + "items": "int", + "type": "array" + } + }, + { + "name": "typestr", + "type": "string" + }, + { + "name": "data", + "type": "bytes" + }, + { + "name": "version", + "type": "int" + } + ], + "logicalType": "ndarray", + "name": "ndarray", + "type": "record" + } + ] +} \ No newline at end of file diff --git a/known-hardware.toml b/known-hardware.toml index ea009921..1eba874a 100644 --- a/known-hardware.toml +++ b/known-hardware.toml @@ -215,6 +215,10 @@ links.manufacturer = "https://www.omega.com/en-us/control-monitoring/controllers doc = "Universal Input Digital Panel Meters" links.manufacturer = "https://www.omega.com/en-us/control-monitoring/controllers/pid-controllers/p/CNI-Series" +[omega.d8200] +doc = "USB Data Acquisition Interface Modules, Current Input" +links.manufacturer = "https://www.omega.com/en-us/data-acquisition/data-acquisition-modules/p/D8000-Series" + [omega.dp16pt] doc = "Universal Input Digital Panel Meters" links.manufacturer = "https://www.omega.com/en-us/control-monitoring/meters/universal-input-meters/p/DPPT-Series"