Metadata-Version: 2.1
Name: pyimclsts
Version: 0.1.1.5
Summary: Python bindings of the IMC message schema
Project-URL: Homepage, https://github.com/choiwd/pyimctrans
Project-URL: Bug Tracker, https://github.com/choiwd/pyimctrans/issues
Author: Choi Wang Dzak
License: Copyright (c) 2023 Laboratório de Sistemas e Tecnologia Subaquática
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: IMC,IMC message protocol,LSTS
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: ifaddr~=0.2.0
Requires-Dist: ipaddress~=1.0.23
Description-Content-Type: text/markdown

## PyIMCtrans

This tool reads the IMC schema from a XML file, locally creates files containing the messages and connects (imports) the main global machinery.

See `/example` to check an example implementation of the Follow Reference maneuver.

### End-User
- Fancying a virtual env? (Not needed. Just in case you want to isolate it from your python setup)
```shell
$ sudo apt install python3.8-venv
$ python3 -m venv tutorial_env
$ source tutorial_env/bin/activate
```
- To use:
```shell
$ pip3 install pyimclsts
$ # or, if you are cloning the repo, from the folder pyproject.toml is located:
$ pip3 install .
```
- Choose a folder and have a version of the IMC schema. Otherwise, it will fetch the latest IMC version from the LSTS git repository. Extract messages locally, with:
```shell
$ python3 -m pyimclsts.extract
```
Check how to provide a black- or whitelist using:
```shell
$ python3 -m pyimclsts.extract --help
```
This will locally extract the IMC.xml as python classes. You will see a folder called `pyimc_generated` which contains base messages, bitfields and enumerations from the IMC.xml file. They can be locally loaded using, for example:
```python
import pyimc_generated as pg
```
In the top-level module, you will find some functions to allow you to connect to a vehicle and subscribe to messages, namely, a subscriber class.
```python
import pyimclsts.network as n

conn = n.tcp_interface('localhost', 6006)
sub = n.subscriber(conn)

# for example:
sub.subscribe_async(myfunction, pg.messages.Announce)
```
Check `/example` for further details.

### Change log:
#### Version 0.1.1.5
    - Fix .block_outgoing() bug
    
#### Version 0.1.1.4
    - Fix extract logic bug

#### Version 0.1.1.3

    - Hide imports and variables of core.py
    - Move IO interface classes to core.py
    - Implement .block_outgoing() through an injected dependency in the message bus
    - Improve subscriber class:
        - Exits when Abort message is received
        - Queries Entity List when started
        - Tracks src and src_ent and their corresponding names
        - Removed .subscribe_all
            - Same functionality can be achieved with .subscribe_async()
    