Coder Social home page Coder Social logo

ignition-incendium / incendium Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 504 KB

๐Ÿ“ฆ Package that extends and wraps Ignition scripting API

Home Page: https://pypi.org/project/incendium/

License: MIT License

Python 95.57% Dockerfile 1.70% Makefile 2.73%
ignition python jython inductive-automation scada python2 java

incendium's Introduction

incendium

ci Downloads Join us on GitHub discussions

Package that extends and wraps some functions from Ignition's Scripting API.

For more information, please refer to the Wiki.

Prerequisites

Before you begin, ensure you have met the following requirements:

Installation and usage

Installing as a dependency for your scripting projects

To use incendium, you may install it with pip. It requires Python 2.7.18 or Jython 2.7.3.

python2 -m pip install incendium

Or

jython -m pip install incendium

This will install it as package to your Python installation, which will allow you to call incendium's Scripting functions from Python's REPL, and get code completion using an IDE (PyCharm or Visual Studio Code).

And to uninstall:

python2 -m pip uninstall incendium

Or

jython -m pip uninstall incendium

Using as a dependency in PyCharm

To include incendium as a dependency in PyCharm, you will need to attach it to your project.

  1. Clone the repo or download from releases
  2. With your project open where you want to include incendium, navigate to File > Open and select the incendium project folder
  3. Choose Attach when prompted
  4. Under the incendium project folder, right-click on the src/ folder and choose Mark Directory as > Sources Root

Installing incendium on your Gateway

Tip

You may use the Python in Ignition guide as reference.

As a Jython package

To install incendium as a Jython package on your Gateway, follow these steps:

  1. Install Java 17
  2. Install Jython 2.7.3
  3. Run jython -m pip install incendium
  4. Copy the incendium directory and typing.py from $JYTHON_HOME/Lib/site-packages to $IGNITION_DIR/user-lib/pylib/site-packages
  5. Done

As a Python package

To install incendium as a Python package on your Gateway, follow these steps:

  1. Install Python 2.7.18
  2. Run python -m pip install incendium
  3. Copy the incendium directory and typing.py from $PYTHON2_HOME/Lib/site-packages to $IGNITION_DIR/user-lib/pylib/site-packages
  4. Done

Contributing to incendium

See CONTRIBUTING.md.

Discussions

Feel free to post your questions and/or ideas at Discussions.

Contributors

Thanks to everyone who has contributed to this project.

Up-to-date list of contributors.

License

See LICENSE.

Code of conduct

See CODE_OF_CONDUCT.md.

incendium's People

Contributors

cesarcoatl avatar coatl-bot avatar dependabot[bot] avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

incendium's Issues

Add mechanism for handling concurrent DisposableConnection connections

[C]onsider maintaining a map of concurrent users in the gateway, keyed to client IDs perhaps, to prevent problems when one user exits just after a different user enters. - pturmel, December 2019 (link)

Currently if DisposableConnection were to be used concurrently, when one of the operations ends we risk breaking other operations after the connection is disabled by whomever first completes its transaction.

ImportError: cannot import name TracebackType

Describe the bug

When I try to import incendium.db or any class from incendium.db I get the following error:

$ python
Python 2.7.18 (default, Oct 21 2021, 22:22:05)
[GCC Apple LLVM 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.extend(['/path/to/incendium/src'])
>>> import incendium.db
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/path/to/incendium/src/incendium/db.py", line 15, in <module>
    from types import TracebackType
ImportError: cannot import name TracebackType
>>> quit()

The problem occurs because incendium.types "shadows" the built-in types module.

To Reproduce

See example above.

Expected behavior

This should not occur.

Screenshots

Additional context

DisposableConnection retries

Break after any of the following conditions have been met:

  1. Connection is Valid
  2. Number of retries has been reached

Additionally, raise an Exception if the connection could not be enabled.

[In|Out]Param name_or_index warning "Expected type 'Union[int, str]', got 'unicode' instead"

Describe the bug

When importing unicode_literals from __future__ we get the following warning in PyCharm.

Expected type 'Union[int, str]', got 'unicode' instead

We should change the type from Union[int, str] to Union[int, str, unicode].

To Reproduce

Sample code:

    params = [
        InParam("base_id", system.db.NVARCHAR, base_id)
    ]

Expected behavior

This warning should be mitigated.

Screenshots

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.