diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-20 06:07:40 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-20 06:07:40 +0000 |
commit | 57a7a7bc030f31accef12fcef624246c738a69bb (patch) | |
tree | 0665940383052c4393d4483f6f2a08c089c06905 | |
parent | 103b0652bc68791638a2e183886d371722701c5e (diff) |
automatic import of python-ATWGopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-atwg.spec | 506 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 508 insertions, 0 deletions
@@ -0,0 +1 @@ +/ATWG-0.1.5.tar.gz diff --git a/python-atwg.spec b/python-atwg.spec new file mode 100644 index 0000000..6de6403 --- /dev/null +++ b/python-atwg.spec @@ -0,0 +1,506 @@ +%global _empty_manifest_terminate_build 0 +Name: python-ATWG +Version: 0.1.5 +Release: 1 +Summary: Arbitrary Temperature Waveform Generator for Climate Chambers +License: GPLv3 +URL: https://github.com/akaeba/ATWG +Source0: https://mirrors.aliyun.com/pypi/web/packages/1d/97/60fc806927e507b55e510d1eb9e62dbf187ec18d9eabe9f28357f336ee90/ATWG-0.1.5.tar.gz +BuildArch: noarch + +Requires: python3-pyserial +Requires: python3-pyyaml + +%description + [](https://github.com/akaeba/ATWG/actions) + +# ATWG + +__Arbitrary Temperature Waveform Generator__ + +A various waveform shapes creating python script to control a climate chamber via PC. + + +## Releases + +| Version | Date | Source | Change log | +| ---------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------- | +| latest | | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/master.zip ">latest.zip</a> | | +| [v0.1.5](https://github.com/akaeba/ATWG/tree/v0.1.5) | 2021-07-05 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.5.zip ">v0.1.5.zip</a> | revised CLI interface and defaults | +| [v0.1.4](https://github.com/akaeba/ATWG/tree/v0.1.4) | 2021-01-17 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.4.zip ">v0.1.4.zip</a> | added missing files to python package | +| [v0.1.3](https://github.com/akaeba/ATWG/tree/v0.1.3) | 2021-01-17 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.3.zip ">v0.1.3.zip</a> | [atwg-cli](./atwg-cli) is registered as command | +| [v0.1.1](https://github.com/akaeba/ATWG/tree/v0.1.1) | 2021-01-02 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.1.zip ">v0.1.1.zip</a> | [pypi.org](https://pypi.org/project/ATWG/) published | +| [v0.1.0](https://github.com/akaeba/ATWG/tree/v0.1.0) | 2020-03-09 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.0.zip ">v0.1.0.zip</a> | initial draft | + + +## Supported climate chambers + * [Espec Corp SH-641](https://espec.com/na/products/model/sh_641) + - RS232 communication interface + - Espec S-2 controller + + +## Install + +### [pip](https://pypi.org/project/ATWG/) + * Install : `python3.7 -m pip install ATWG ` + * Update : `python3.7 -m pip install --upgrade ATWG ` + +### [Github](https://github.com/akaeba/ATWG) +`git clone https://github.com/akaeba/ATWG.git ` + + +## Command line interface + +### Options + +| Option | Description | Args | +| ---------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| --sine | select sine as used waveform | | +| --trapezoid | select trapezoid as used waveform | | +| --minTemp=myVal | sets minimal temperature value | | +| --maxTemp=myVal | sets maximal temperature value | | +| [--invert] | start with lower part of wave | | +| [--period=1h] | period of waveform | d:hh:mm:ss, h, m, s | +| [--startTemp=25] | waves start temperature | start temperature of wave | +| [--riseTime=0] | positive slew rate, used by '--trapezoid' | degree/time, T(min->max); 5C/h, 120min | +| [--fallTime=0] | negative slew rate, used by '--trapezoid' | degree/time, T(max->min); 5C/h, 120min | +| [--chamber=SIM] | chamber type | [SIM](./ATWG/driver/sim/simChamber.py), [ESPEC_SH641](./ATWG/driver/espec/sh641.py) | +| [--port=] | chamber interfacing port | [SH641 default](./ATWG/driver/espec/sh641InterfaceDefault.yml): <br /> WinNT: `COM1 ` <br /> Linux: `/dev/ttyUSB0 ` | + + +### Run + +#### Call + +| Platform | Command | +|:-------- |:------------------------- | +| Windows | python3 ./atwg-cli [ARGS] | +| Linux | atwg-cli [ARGS] | +| Anaconda | run ./atwg-cli [ARGS] | + +[ARGS]: `--sine --chamber=SIM --minTemp=10 --maxTemp=60 --startTemp=30 --period=1h ` + +This example starts the waveform generator in the simulation mode. The sine wave has a minimal value of 10°C, a +maximum of 60°C and s start value of 30°C. A full period needs one hour. + + +#### Output + +Following output is written to the command line interface while the script is active: + +```text +Arbitrary Temperature Waveform Generator + + Chamber + State : Run / + Type : SIM + Tmeas : +30.02 °C + Tset : +30.06 °C + + Waveform + Shape : sine + Tmin : +10.00 °C + Tmax : +60.00 °C + Period : 1h + Gradient : +2.566 °C/m + + +Press 'CTRL + C' for exit +``` + + +#### Permission denied error on Linux + +In Linux has only the _root_ and _dialout_ group proper rights to open +_/dev/ttyUSB*_ devices. Adding the current user to the _dialout_ group +allows _ATWG_ to run without root permissions. + +```bash +sudo usermod -a -G dialout $USER # add login user to dialout group +sudo reboot # apply settings +``` + + +## Chamber driver + +### How-to add + +The architecture of the _ATWG_ allows the fast integration of a new chamber driver. Therefore is only the import in +the [ATWG](./ATWG/ATWG.py) _open_ procedure necessary. As starting point of a new driver can the class +[simChamber](./ATWG/driver/sim/simChamber.py) serve. There are all _ATWG_ mandatory procedures as simulation +example implemented. + + +### Espec SH641 + +[sh641.py](./ATWG/driver/espec/sh641.py) realizes the interface to the climate chamber. Following instruction listing controls the chamber: + +```python +from ATWG.driver.espec.sh641 import especShSu # import driver + +myChamber = especShSu() # call class constructor +myChamber.open() # open with interface defaults +print(myChamber.get_clima()) # get current clima +myChamber.start() # start chamber +myChamber.set_clima(clima={'temperature': 25}) # set temperature value +myChamber.stop() # stop chamber +myChamber.close() # close handle +``` + +The _open_ procedure accepts as argument a .yml file with the chamber (RS232) configuration. In case of no argument [default](./ATWG/driver/espec/sh641InterfaceDefault.yml)s are used. + + +## References + +* [Espec Corp SH-641](https://espec.com/na/products/model/sh_641) +* [Fix Serial Permission Error](https://websistent.com/fix-serial-port-permission-denied-errors-linux/) + + + + +%package -n python3-ATWG +Summary: Arbitrary Temperature Waveform Generator for Climate Chambers +Provides: python-ATWG +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-ATWG + [](https://github.com/akaeba/ATWG/actions) + +# ATWG + +__Arbitrary Temperature Waveform Generator__ + +A various waveform shapes creating python script to control a climate chamber via PC. + + +## Releases + +| Version | Date | Source | Change log | +| ---------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------- | +| latest | | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/master.zip ">latest.zip</a> | | +| [v0.1.5](https://github.com/akaeba/ATWG/tree/v0.1.5) | 2021-07-05 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.5.zip ">v0.1.5.zip</a> | revised CLI interface and defaults | +| [v0.1.4](https://github.com/akaeba/ATWG/tree/v0.1.4) | 2021-01-17 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.4.zip ">v0.1.4.zip</a> | added missing files to python package | +| [v0.1.3](https://github.com/akaeba/ATWG/tree/v0.1.3) | 2021-01-17 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.3.zip ">v0.1.3.zip</a> | [atwg-cli](./atwg-cli) is registered as command | +| [v0.1.1](https://github.com/akaeba/ATWG/tree/v0.1.1) | 2021-01-02 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.1.zip ">v0.1.1.zip</a> | [pypi.org](https://pypi.org/project/ATWG/) published | +| [v0.1.0](https://github.com/akaeba/ATWG/tree/v0.1.0) | 2020-03-09 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.0.zip ">v0.1.0.zip</a> | initial draft | + + +## Supported climate chambers + * [Espec Corp SH-641](https://espec.com/na/products/model/sh_641) + - RS232 communication interface + - Espec S-2 controller + + +## Install + +### [pip](https://pypi.org/project/ATWG/) + * Install : `python3.7 -m pip install ATWG ` + * Update : `python3.7 -m pip install --upgrade ATWG ` + +### [Github](https://github.com/akaeba/ATWG) +`git clone https://github.com/akaeba/ATWG.git ` + + +## Command line interface + +### Options + +| Option | Description | Args | +| ---------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| --sine | select sine as used waveform | | +| --trapezoid | select trapezoid as used waveform | | +| --minTemp=myVal | sets minimal temperature value | | +| --maxTemp=myVal | sets maximal temperature value | | +| [--invert] | start with lower part of wave | | +| [--period=1h] | period of waveform | d:hh:mm:ss, h, m, s | +| [--startTemp=25] | waves start temperature | start temperature of wave | +| [--riseTime=0] | positive slew rate, used by '--trapezoid' | degree/time, T(min->max); 5C/h, 120min | +| [--fallTime=0] | negative slew rate, used by '--trapezoid' | degree/time, T(max->min); 5C/h, 120min | +| [--chamber=SIM] | chamber type | [SIM](./ATWG/driver/sim/simChamber.py), [ESPEC_SH641](./ATWG/driver/espec/sh641.py) | +| [--port=] | chamber interfacing port | [SH641 default](./ATWG/driver/espec/sh641InterfaceDefault.yml): <br /> WinNT: `COM1 ` <br /> Linux: `/dev/ttyUSB0 ` | + + +### Run + +#### Call + +| Platform | Command | +|:-------- |:------------------------- | +| Windows | python3 ./atwg-cli [ARGS] | +| Linux | atwg-cli [ARGS] | +| Anaconda | run ./atwg-cli [ARGS] | + +[ARGS]: `--sine --chamber=SIM --minTemp=10 --maxTemp=60 --startTemp=30 --period=1h ` + +This example starts the waveform generator in the simulation mode. The sine wave has a minimal value of 10°C, a +maximum of 60°C and s start value of 30°C. A full period needs one hour. + + +#### Output + +Following output is written to the command line interface while the script is active: + +```text +Arbitrary Temperature Waveform Generator + + Chamber + State : Run / + Type : SIM + Tmeas : +30.02 °C + Tset : +30.06 °C + + Waveform + Shape : sine + Tmin : +10.00 °C + Tmax : +60.00 °C + Period : 1h + Gradient : +2.566 °C/m + + +Press 'CTRL + C' for exit +``` + + +#### Permission denied error on Linux + +In Linux has only the _root_ and _dialout_ group proper rights to open +_/dev/ttyUSB*_ devices. Adding the current user to the _dialout_ group +allows _ATWG_ to run without root permissions. + +```bash +sudo usermod -a -G dialout $USER # add login user to dialout group +sudo reboot # apply settings +``` + + +## Chamber driver + +### How-to add + +The architecture of the _ATWG_ allows the fast integration of a new chamber driver. Therefore is only the import in +the [ATWG](./ATWG/ATWG.py) _open_ procedure necessary. As starting point of a new driver can the class +[simChamber](./ATWG/driver/sim/simChamber.py) serve. There are all _ATWG_ mandatory procedures as simulation +example implemented. + + +### Espec SH641 + +[sh641.py](./ATWG/driver/espec/sh641.py) realizes the interface to the climate chamber. Following instruction listing controls the chamber: + +```python +from ATWG.driver.espec.sh641 import especShSu # import driver + +myChamber = especShSu() # call class constructor +myChamber.open() # open with interface defaults +print(myChamber.get_clima()) # get current clima +myChamber.start() # start chamber +myChamber.set_clima(clima={'temperature': 25}) # set temperature value +myChamber.stop() # stop chamber +myChamber.close() # close handle +``` + +The _open_ procedure accepts as argument a .yml file with the chamber (RS232) configuration. In case of no argument [default](./ATWG/driver/espec/sh641InterfaceDefault.yml)s are used. + + +## References + +* [Espec Corp SH-641](https://espec.com/na/products/model/sh_641) +* [Fix Serial Permission Error](https://websistent.com/fix-serial-port-permission-denied-errors-linux/) + + + + +%package help +Summary: Development documents and examples for ATWG +Provides: python3-ATWG-doc +%description help + [](https://github.com/akaeba/ATWG/actions) + +# ATWG + +__Arbitrary Temperature Waveform Generator__ + +A various waveform shapes creating python script to control a climate chamber via PC. + + +## Releases + +| Version | Date | Source | Change log | +| ---------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------- | +| latest | | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/master.zip ">latest.zip</a> | | +| [v0.1.5](https://github.com/akaeba/ATWG/tree/v0.1.5) | 2021-07-05 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.5.zip ">v0.1.5.zip</a> | revised CLI interface and defaults | +| [v0.1.4](https://github.com/akaeba/ATWG/tree/v0.1.4) | 2021-01-17 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.4.zip ">v0.1.4.zip</a> | added missing files to python package | +| [v0.1.3](https://github.com/akaeba/ATWG/tree/v0.1.3) | 2021-01-17 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.3.zip ">v0.1.3.zip</a> | [atwg-cli](./atwg-cli) is registered as command | +| [v0.1.1](https://github.com/akaeba/ATWG/tree/v0.1.1) | 2021-01-02 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.1.zip ">v0.1.1.zip</a> | [pypi.org](https://pypi.org/project/ATWG/) published | +| [v0.1.0](https://github.com/akaeba/ATWG/tree/v0.1.0) | 2020-03-09 | <a id="raw-url" href="https://github.com/akaeba/ATWG/archive/v0.1.0.zip ">v0.1.0.zip</a> | initial draft | + + +## Supported climate chambers + * [Espec Corp SH-641](https://espec.com/na/products/model/sh_641) + - RS232 communication interface + - Espec S-2 controller + + +## Install + +### [pip](https://pypi.org/project/ATWG/) + * Install : `python3.7 -m pip install ATWG ` + * Update : `python3.7 -m pip install --upgrade ATWG ` + +### [Github](https://github.com/akaeba/ATWG) +`git clone https://github.com/akaeba/ATWG.git ` + + +## Command line interface + +### Options + +| Option | Description | Args | +| ---------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| --sine | select sine as used waveform | | +| --trapezoid | select trapezoid as used waveform | | +| --minTemp=myVal | sets minimal temperature value | | +| --maxTemp=myVal | sets maximal temperature value | | +| [--invert] | start with lower part of wave | | +| [--period=1h] | period of waveform | d:hh:mm:ss, h, m, s | +| [--startTemp=25] | waves start temperature | start temperature of wave | +| [--riseTime=0] | positive slew rate, used by '--trapezoid' | degree/time, T(min->max); 5C/h, 120min | +| [--fallTime=0] | negative slew rate, used by '--trapezoid' | degree/time, T(max->min); 5C/h, 120min | +| [--chamber=SIM] | chamber type | [SIM](./ATWG/driver/sim/simChamber.py), [ESPEC_SH641](./ATWG/driver/espec/sh641.py) | +| [--port=] | chamber interfacing port | [SH641 default](./ATWG/driver/espec/sh641InterfaceDefault.yml): <br /> WinNT: `COM1 ` <br /> Linux: `/dev/ttyUSB0 ` | + + +### Run + +#### Call + +| Platform | Command | +|:-------- |:------------------------- | +| Windows | python3 ./atwg-cli [ARGS] | +| Linux | atwg-cli [ARGS] | +| Anaconda | run ./atwg-cli [ARGS] | + +[ARGS]: `--sine --chamber=SIM --minTemp=10 --maxTemp=60 --startTemp=30 --period=1h ` + +This example starts the waveform generator in the simulation mode. The sine wave has a minimal value of 10°C, a +maximum of 60°C and s start value of 30°C. A full period needs one hour. + + +#### Output + +Following output is written to the command line interface while the script is active: + +```text +Arbitrary Temperature Waveform Generator + + Chamber + State : Run / + Type : SIM + Tmeas : +30.02 °C + Tset : +30.06 °C + + Waveform + Shape : sine + Tmin : +10.00 °C + Tmax : +60.00 °C + Period : 1h + Gradient : +2.566 °C/m + + +Press 'CTRL + C' for exit +``` + + +#### Permission denied error on Linux + +In Linux has only the _root_ and _dialout_ group proper rights to open +_/dev/ttyUSB*_ devices. Adding the current user to the _dialout_ group +allows _ATWG_ to run without root permissions. + +```bash +sudo usermod -a -G dialout $USER # add login user to dialout group +sudo reboot # apply settings +``` + + +## Chamber driver + +### How-to add + +The architecture of the _ATWG_ allows the fast integration of a new chamber driver. Therefore is only the import in +the [ATWG](./ATWG/ATWG.py) _open_ procedure necessary. As starting point of a new driver can the class +[simChamber](./ATWG/driver/sim/simChamber.py) serve. There are all _ATWG_ mandatory procedures as simulation +example implemented. + + +### Espec SH641 + +[sh641.py](./ATWG/driver/espec/sh641.py) realizes the interface to the climate chamber. Following instruction listing controls the chamber: + +```python +from ATWG.driver.espec.sh641 import especShSu # import driver + +myChamber = especShSu() # call class constructor +myChamber.open() # open with interface defaults +print(myChamber.get_clima()) # get current clima +myChamber.start() # start chamber +myChamber.set_clima(clima={'temperature': 25}) # set temperature value +myChamber.stop() # stop chamber +myChamber.close() # close handle +``` + +The _open_ procedure accepts as argument a .yml file with the chamber (RS232) configuration. In case of no argument [default](./ATWG/driver/espec/sh641InterfaceDefault.yml)s are used. + + +## References + +* [Espec Corp SH-641](https://espec.com/na/products/model/sh_641) +* [Fix Serial Permission Error](https://websistent.com/fix-serial-port-permission-denied-errors-linux/) + + + + +%prep +%autosetup -n ATWG-0.1.5 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-ATWG -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1.5-1 +- Package Spec generated @@ -0,0 +1 @@ +803d6d94c76b1e73fd6b946a2648fb56 ATWG-0.1.5.tar.gz |