diff --git a/tests/data/device_config.yaml b/tests/data/device_config.yaml new file mode 100644 index 0000000..95cbb2b --- /dev/null +++ b/tests/data/device_config.yaml @@ -0,0 +1,10 @@ +# yaml-language-server: $schema=schema.json +controller: + serial_settings: + port: /dev/serial/by-id/usb-Thorlabs_APT_Filter_Flipper_37007189-if00-port0 + baud: 115200 +transport: + rest: + host: localhost + port: 8083 + log_level: info diff --git a/tests/data/schema.json b/tests/data/schema.json new file mode 100644 index 0000000..4d0a351 --- /dev/null +++ b/tests/data/schema.json @@ -0,0 +1,237 @@ +{ + "$defs": { + "EpicsDocsOptions": { + "properties": { + "path": { + "default": "/workspaces/thorlabs-mff-fastcs", + "format": "path", + "title": "Path", + "type": "string" + }, + "depth": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Depth" + } + }, + "title": "EpicsDocsOptions", + "type": "object" + }, + "EpicsGUIFormat": { + "enum": [ + ".bob", + ".edl" + ], + "title": "EpicsGUIFormat", + "type": "string" + }, + "EpicsGUIOptions": { + "properties": { + "output_path": { + "default": "/workspaces/thorlabs-mff-fastcs/output.bob", + "format": "path", + "title": "Output Path", + "type": "string" + }, + "file_format": { + "$ref": "#/$defs/EpicsGUIFormat", + "default": ".bob" + }, + "title": { + "default": "Simple Device", + "title": "Title", + "type": "string" + } + }, + "title": "EpicsGUIOptions", + "type": "object" + }, + "EpicsIOCOptions": { + "properties": { + "terminal": { + "default": true, + "title": "Terminal", + "type": "boolean" + }, + "pv_prefix": { + "default": "MY-DEVICE-PREFIX", + "title": "Pv Prefix", + "type": "string" + } + }, + "title": "EpicsIOCOptions", + "type": "object" + }, + "EpicsOptions": { + "properties": { + "docs": { + "$ref": "#/$defs/EpicsDocsOptions" + }, + "gui": { + "$ref": "#/$defs/EpicsGUIOptions" + }, + "ioc": { + "$ref": "#/$defs/EpicsIOCOptions" + } + }, + "title": "EpicsOptions", + "type": "object" + }, + "GraphQLOptions": { + "properties": { + "gql": { + "$ref": "#/$defs/GraphQLServerOptions" + } + }, + "title": "GraphQLOptions", + "type": "object" + }, + "GraphQLServerOptions": { + "properties": { + "host": { + "default": "localhost", + "title": "Host", + "type": "string" + }, + "port": { + "default": 8080, + "title": "Port", + "type": "integer" + }, + "log_level": { + "default": "info", + "title": "Log Level", + "type": "string" + } + }, + "title": "GraphQLServerOptions", + "type": "object" + }, + "RestOptions": { + "properties": { + "rest": { + "$ref": "#/$defs/RestServerOptions" + } + }, + "title": "RestOptions", + "type": "object" + }, + "RestServerOptions": { + "properties": { + "host": { + "default": "localhost", + "title": "Host", + "type": "string" + }, + "port": { + "default": 8080, + "title": "Port", + "type": "integer" + }, + "log_level": { + "default": "info", + "title": "Log Level", + "type": "string" + } + }, + "title": "RestServerOptions", + "type": "object" + }, + "SerialConnectionSettings": { + "properties": { + "port": { + "title": "Port", + "type": "string" + }, + "baud": { + "default": 115200, + "title": "Baud", + "type": "integer" + } + }, + "required": [ + "port" + ], + "title": "SerialConnectionSettings", + "type": "object" + }, + "TangoDSROptions": { + "properties": { + "dev_name": { + "default": "MY/DEVICE/NAME", + "title": "Dev Name", + "type": "string" + }, + "dsr_instance": { + "default": "MY_SERVER_INSTANCE", + "title": "Dsr Instance", + "type": "string" + }, + "debug": { + "default": false, + "title": "Debug", + "type": "boolean" + } + }, + "title": "TangoDSROptions", + "type": "object" + }, + "TangoOptions": { + "properties": { + "dsr": { + "$ref": "#/$defs/TangoDSROptions" + } + }, + "title": "TangoOptions", + "type": "object" + }, + "ThorlabsMFFSettings": { + "properties": { + "serial_settings": { + "$ref": "#/$defs/SerialConnectionSettings" + } + }, + "required": [ + "serial_settings" + ], + "title": "ThorlabsMFFSettings", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { + "controller": { + "$ref": "#/$defs/ThorlabsMFFSettings" + }, + "transport": { + "anyOf": [ + { + "$ref": "#/$defs/EpicsOptions" + }, + { + "$ref": "#/$defs/TangoOptions" + }, + { + "$ref": "#/$defs/RestOptions" + }, + { + "$ref": "#/$defs/GraphQLOptions" + } + ], + "title": "Transport" + } + }, + "required": [ + "controller", + "transport" + ], + "title": "ThorlabsMFF", + "type": "object" +} \ No newline at end of file