Skip to content

Commit

Permalink
feat: add AlarmEvent, PyAlarmEvent, and PyAlarmEventImpl
Browse files Browse the repository at this point in the history
these support latest scripting feature from 8.1.11
  • Loading branch information
cesarcoatl committed Oct 20, 2021
1 parent bb8ac0c commit 13907c9
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 0 deletions.
169 changes: 169 additions & 0 deletions src/com/inductiveautomation/ignition/common/alarming/__init__.py
@@ -0,0 +1,169 @@
from __future__ import print_function

__all__ = ["AlarmEvent", "PyAlarmEvent", "PyAlarmEventImpl"]

from java.lang import Iterable
from org.python.core import PyObject


class AlarmEvent(Iterable):
def acknowledge(self, ackData):
raise NotImplementedError

def active(self, activeData):
raise NotImplementedError

def clear(self, clearData):
raise NotImplementedError

def getAckData(self):
raise NotImplementedError

def getActiveData(self):
raise NotImplementedError

def getClearedData(self):
raise NotImplementedError

def getDisplayPath(self):
raise NotImplementedError

def getId(self):
raise NotImplementedError

def getLabel(self):
raise NotImplementedError

def getLastEventState(self):
raise NotImplementedError

def getName(self):
raise NotImplementedError

def getNotes(self):
raise NotImplementedError

def getPriority(self):
raise NotImplementedError

def getSource(self):
raise NotImplementedError

def getState(self):
raise NotImplementedError

def isAcked(self):
raise NotImplementedError

def isCleared(self):
raise NotImplementedError

def isShelved(self):
raise NotImplementedError

def iterator(self):
pass


class PyAlarmEvent(AlarmEvent):
def acknowledge(self, ackData):
pass

def active(self, activeData):
pass

def clear(self, clearData):
pass

def contains(self, property):
raise NotImplementedError

def get(self, property):
raise NotImplementedError

def getAckData(self):
pass

def getActiveData(self):
pass

def getClearedData(self):
pass

def getDisplayPath(self):
pass

def getId(self):
pass

def getLabel(self):
pass

def getLastEventState(self):
pass

def getName(self):
pass

def getNotes(self):
pass

def getOrDefault(self, property):
raise NotImplementedError

def getOrElse(self, property, defaultValue):
raise NotImplementedError

def getPriority(self):
pass

def getSource(self):
pass

def getState(self):
pass

def isAcked(self):
pass

def isCleared(self):
pass

def isShelved(self):
pass

def set(self, property, value):
raise NotImplementedError

def setGlobal(self, property, value):
raise NotImplementedError

def sourceEvent(self):
raise NotImplementedError


class PyAlarmEventImpl(PyAlarmEvent, PyObject):
def __init__(self, event):
print(event)
super(PyAlarmEventImpl, self).__init__()

def contains(self, property):
pass

def get(self, property):
pass

def getOrDefault(self, property):
pass

def getOrElse(self, property, defaultValue):
pass

def set(self, property, value):
pass

def setGlobal(self, property, value):
pass

def sourceEvent(self):
pass
@@ -1,5 +1,7 @@
__all__ = ["AlarmQueryResult", "AlarmQueryResultImpl"]

from com.inductiveautomation.ignition.common.alarming import PyAlarmEvent


class AlarmQueryResult(object):
"""This is the result of a query against the alarming system, for
Expand All @@ -24,6 +26,9 @@ class AlarmQueryResultImpl(AlarmQueryResult):
def __init__(self, *args):
pass

def __iter__(self):
yield PyAlarmEvent()

def getAssociatedDate(self, uuid):
pass

Expand Down

0 comments on commit 13907c9

Please sign in to comment.