GithubHelp home page GithubHelp logo

cesarcoatl / ignition Goto Github PK

View Code? Open in Web Editor NEW
32.0 2.0 6.0 1.05 MB

⚡ A set of packages and modules that allows developers to get code completion for Ignition Scripting API scripting functions in their IDE of choice.

Home Page: https://docs.inductiveautomation.com/display/DOC81/System+Functions

License: MIT License

Python 100.00%
ignition ignition-scripting python inductive-automation jython scada industrial-automation mock stubs javax

ignition's Introduction

ignition's People

Contributors

cesarcoatl avatar ethanejohnsons avatar pre-commit-ci[bot] avatar sourcery-ai[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ignition's Issues

Add system.db.getConnectionInfo without params

getConnectionInfo() -> Dataset

Returns a dataset of information about the current project's default database connection.

Returns:
Dataset: A dataset containing information about the current project's default database connection, or an empty dataset if the connection wasn't found.

7.9: overload system.nav.centerWindow

Overloaded docstring:

def centerWindow(window):
    """Given a window path, or a reference to a window itself, it will
    center the window.

    Args:
        window (FPMIWindow): A reference to the window to center.
    """

ImportError: No module named builtuins when importing java.lang.Exception

Steps to reproduce:

  1. Run python2
  2. from java.lang import Exception as JException
$ python2
Python 2.7.18 (default, Nov  9 2020, 16:23:15) 
[GCC Apple LLVM 12.0.0 (clang-1200.0.32.21)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from java.lang import Exception as JException
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/thecesrom/.pyenv/versions/ignition-api-27/lib/python2.7/site-packages/java/lang/__init__.py", line 23, in <module>
    from builtins import Exception as PyException
ImportError: No module named builtins

system.sfc.startChart missing chartPath argument

startChart(projectName, chartPath, parameters) → String
Start a new instance of a sequential function chart.
Args:
projectName (str): The project in which to find the chart.
   chartPath (str): The path to the chart to start.
   parameters (dict): A dictionary of parameters to send to the new chart instance. If these parameters are the same as the parameters defined in the Begin step of the chart, the values in this dictionary will take precedence.
Returns:
str: The chart's identifier as a string.

system.tag.queryTagHistory add missing arguments

Args:
intervalSeconds (int): Same as intervalHours and interval Minutes, but in seconds. Can be used on its own, or in conjunction with intervalHours and intervalMinutes.
rangeSeconds (int): Allows you to specify the query range in seconds, instead of using start and end date. Can be positive or negative, and can be used in conjunction with startDate or endDate.

PyCharm Instructions

Would you mind if I submitted some instructions on how to install this in PyCharm? I struggled somewhat before I was able to figure it out myself :)

Add missing parameter to system.dataset.toExcel

From New in 8.0.16:

Scripting Functions
Added an optional sheetName parameter to the system.dataset.toExcel function. This function allows Excel sheets to be named that will be in the Excel Workbook.

Change function definition from:

def toExcel(showHeaders, datasets, nullsEmpty=False):

To:

def toExcel(showHeaders, datasets, nullsEmpty=False, sheetName=None):
    """...
    Args:
        ...
        sheetName (list[str]): ...
    ...
    """

AttributeError: 'module' object has no attribute '_copy_dispatch'

Commit ea530ac on main, c94b517 on 7.9, and 0992a8c on 8.0 introduced an unintended bug.

When updating ignition-api via pip I got the following error:

$ python -m pip install --upgrade ignition-api
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting ignition-api
  Downloading ignition_api-8.1.13-py2-none-any.whl (127 kB)
     |████████████████████████████████| 127 kB 2.3 MB/s 
Requirement already satisfied, skipping upgrade: typing in ./.pyenv/versions/2.7.18/envs/incendium/lib/python2.7/site-packages (from ignition-api) (3.10.0.0)
Installing collected packages: ignition-api
  Attempting uninstall: ignition-api
    Found existing installation: ignition-api 8.1.12.post3
    Uninstalling ignition-api-8.1.12.post3:
      Successfully uninstalled ignition-api-8.1.12.post3
Successfully installed ignition-api-8.1.13
Traceback (most recent call last):
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/thecesrom/.pyenv/versions/2.7.18/envs/incendium/lib/python2.7/site-packages/pip/__main__.py", line 23, in <module>
    from pip._internal.cli.main import main as _main  # isort:skip # noqa
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.py", line 4, in <module>
    import optparse
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/optparse.py", line 90, in <module>
    from gettext import gettext
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/gettext.py", line 49, in <module>
    import locale, copy, os, re, struct, sys
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/copy.py", line 60, in <module>
    from org.python.core import PyStringMap
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/org/python/core/__init__.py", line 5, in <module>
    from java.lang import Object
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/java/lang/__init__.py", line 22, in <module>
    from typing import Union
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/typing.py", line 1440, in <module>
    copy._copy_dispatch[GenericMeta] = _copy_generic
AttributeError: 'module' object has no attribute '_copy_dispatch'
Traceback (most recent call last):
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/thecesrom/.pyenv/versions/2.7.18/envs/incendium/lib/python2.7/site-packages/pip/__main__.py", line 23, in <module>
    from pip._internal.cli.main import main as _main  # isort:skip # noqa
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.py", line 4, in <module>
    import optparse
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/optparse.py", line 90, in <module>
    from gettext import gettext
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/gettext.py", line 49, in <module>
    import locale, copy, os, re, struct, sys
  File "/Users/thecesrom/.pyenv/versions/2.7.18/lib/python2.7/copy.py", line 60, in <module>
    from org.python.core import PyStringMap
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/org/python/core/__init__.py", line 5, in <module>
    from java.lang import Object
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/java/lang/__init__.py", line 22, in <module>
    from typing import Union
  File "/Users/thecesrom/.pyenv/versions/incendium/lib/python2.7/site-packages/typing.py", line 1440, in <module>
    copy._copy_dispatch[GenericMeta] = _copy_generic
AttributeError: 'module' object has no attribute '_copy_dispatch'

After that pip cannot be executed.

Rolling back the java.lang.String changes should solve the problem.

Add system.nav.swapWindow overload

swapWindow(event, swapToPath, params) → PyObject

Args:
event (EventObject): A component event whose enclosing window will be used as the "swap-from" window.

7.9: add system.db.getConnectionInfo with no args

Docstring:

def getConnectionInfo():
    """Returns a dataset of information about the current projects
    default database connection.

    Returns:
        Dataset: A dataset containing information about the current
            projects default database connection, or an empty dataset if
            the connection wasn't found.
    """

Bug on system.file.readFileAsString

Calling `system.file.readFileAdString("path/to/file") throws the following exception:

TypeError: readString(): 1st arg can't be coerced to java.nio.file.Path

system.device.getDeviceHostname is missing

getDeviceHostname(deviceName) → String
Gets the hostname of a device.

Args:
    deviceName (str): The name of the device in Ignition.

Returns:

     The hostname of the device. Null if device doesn't have a hostname.

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.