# OPI generation for CS-Studio and Phoebus
This repository is forked from [dls-controls/cssgen](https://github.com/dls-controls/cssgen/blob/master/README.md), and renamed to `opi-generator`, with the package name of `opigen`.
After a thorough refactoring process, `opigen` now supports OPI files generation for both CS-Studio and Phoebus from the same script, which minimizes the effort required to maintain both platforms, making it more efficient and streamlined.
## Installation
```
pip install opigen
```
## Attribute Mapping
`opigen` can generate OPI files that are compatible with both CS-Studio and Phoebus by utilizing the concept of "attribute mapping". Essentially, this involves ensuring that each attribute of a widget class in CS-Studio has a corresponding counterpart in Phoebus. By accurately mapping the attribute names, `opigen` can seamlessly handle both systems with the same code. This approach not only simplifies the development process but also ensures cross-compatibility, making it easier for developers to create robust and adaptable OPI files that can be used across different platforms.
The command line tool `opigen-export_attr_map` could be used to export
the attribute map from CS-Studio (.opi) to Phoebus (.bob) that are in-use.
The exported file contains an attribute map from CS-Studio (`.opi`) to Phoebus (`.bob`).
The attribute name must be mapped for Phoebus, otherwise it will be
missing in the generated file.
Let's assume an use-case that `bitReverse` attribute of the class `Byte` (refers to
`ByteMonitor`) needs to be correctly handled
on both, but the system deployed attribute map does not provide it, the use will
have to extend it. To extend or update it, follow these steps:
- Create a file named `attr.toml` in the current working directory.
- Create a new section with the widget class name, e.g. `[Byte]`.
- Add new attribute maps or override existing ones under the new section,
e.g. `bitReverse = "bitReverse"`.
- If there is no `attr.toml` in the current working directory,
use the one in the user home directory at `~/.opigen/attr.toml` to do
the extend or override if possible.
- If `attr.toml` exists in both places, the one in the current working
directory takes precedence.
Raw data
{
"_id": null,
"home_page": "https://github.com/archman/opi-generator",
"name": "opigen",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "CS-Studio Phoebus OPI XML",
"author": "Tong Zhang",
"author_email": "zhangt@frib.msu.edu",
"download_url": "",
"platform": null,
"description": "# OPI generation for CS-Studio and Phoebus\n\nThis repository is forked from [dls-controls/cssgen](https://github.com/dls-controls/cssgen/blob/master/README.md), and renamed to `opi-generator`, with the package name of `opigen`.\n\nAfter a thorough refactoring process, `opigen` now supports OPI files generation for both CS-Studio and Phoebus from the same script, which minimizes the effort required to maintain both platforms, making it more efficient and streamlined.\n\n## Installation\n\n```\npip install opigen\n```\n\n## Attribute Mapping\n\n`opigen` can generate OPI files that are compatible with both CS-Studio and Phoebus by utilizing the concept of \"attribute mapping\". Essentially, this involves ensuring that each attribute of a widget class in CS-Studio has a corresponding counterpart in Phoebus. By accurately mapping the attribute names, `opigen` can seamlessly handle both systems with the same code. This approach not only simplifies the development process but also ensures cross-compatibility, making it easier for developers to create robust and adaptable OPI files that can be used across different platforms.\n\nThe command line tool `opigen-export_attr_map` could be used to export\nthe attribute map from CS-Studio (.opi) to Phoebus (.bob) that are in-use.\n\nThe exported file contains an attribute map from CS-Studio (`.opi`) to Phoebus (`.bob`).\n\nThe attribute name must be mapped for Phoebus, otherwise it will be\nmissing in the generated file.\n\nLet's assume an use-case that `bitReverse` attribute of the class `Byte` (refers to\n `ByteMonitor`) needs to be correctly handled\non both, but the system deployed attribute map does not provide it, the use will\nhave to extend it. To extend or update it, follow these steps:\n\n- Create a file named `attr.toml` in the current working directory.\n- Create a new section with the widget class name, e.g. `[Byte]`.\n- Add new attribute maps or override existing ones under the new section,\n e.g. `bitReverse = \"bitReverse\"`.\n- If there is no `attr.toml` in the current working directory,\n use the one in the user home directory at `~/.opigen/attr.toml` to do\n the extend or override if possible.\n- If `attr.toml` exists in both places, the one in the current working\n directory takes precedence.\n\n\n",
"bugtrack_url": null,
"license": "APACHE",
"summary": "OPI Generation for CS-Studio and Phoebus",
"version": "1.0.6",
"project_urls": {
"Homepage": "https://github.com/archman/opi-generator"
},
"split_keywords": [
"cs-studio",
"phoebus",
"opi",
"xml"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bfb6f006e0c8fbe3ea54bf48b13a9289505deb3d5e8791ec424ed7fa2c17d119",
"md5": "f87730474a83be77b02e9555a0a423f0",
"sha256": "80bdd1b3bedf29356014998b6cea46166bd07e9a907b780b53b8a368332a3994"
},
"downloads": -1,
"filename": "opigen-1.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f87730474a83be77b02e9555a0a423f0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 44728,
"upload_time": "2024-01-19T16:35:47",
"upload_time_iso_8601": "2024-01-19T16:35:47.844309Z",
"url": "https://files.pythonhosted.org/packages/bf/b6/f006e0c8fbe3ea54bf48b13a9289505deb3d5e8791ec424ed7fa2c17d119/opigen-1.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-19 16:35:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "archman",
"github_project": "opi-generator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "lxml",
"specs": []
},
{
"name": "pytest",
"specs": [
[
">=",
"3.0"
]
]
},
{
"name": "coverage",
"specs": []
},
{
"name": "pytest-cov",
"specs": []
},
{
"name": "python-coveralls",
"specs": []
}
],
"lcname": "opigen"
}