Package com.inductiveautomation.sfc.api
Class PyChartScope
java.lang.Object
org.python.core.PyObject
org.python.core.AbstractDict
org.python.core.PyDictionary
com.inductiveautomation.sfc.api.PyChartScope
- All Implemented Interfaces:
- Serializable,- ConcurrentMap,- Map,- org.python.core.Traverseproc
public class PyChartScope
extends org.python.core.PyDictionary
This class represents any "scope" in the SFC system, and is fundamentally just an observable dictionary. Despite its
 name, it is not limited to chart scope. This class notifies listeners when values are changed, and wraps any
 dictionaries assigned to it as PyChartScopes as well.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceAn observer that gets notified when the scope is modified.Nested classes/interfaces inherited from class org.python.core.PyObjectorg.python.core.PyObject.ConversionException
- 
Field SummaryFieldsFields inherited from class org.python.core.PyDictionaryTYPEFields inherited from class org.python.core.PyObjectattributes, gcMonitorGlobal, objtype
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedPyChartScope(Map<org.python.core.PyObject, org.python.core.PyObject> map) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.python.core.PyObject__findattr_ex__(String name) void__set__(org.python.core.PyObject obj, org.python.core.PyObject value) void__setattr__(String name, org.python.core.PyObject value) void__setitem__(org.python.core.PyObject key, org.python.core.PyObject value) voidaddScopeObserver(PyChartScope.ScopeObserver observer) org.python.core.PyDictionarycopy()protected static PyChartScopecreateFrom(org.python.core.PyDictionary dict) This goes deep through a dictionary and creates PyChartScopes for any embedded dictionaries.*org.python.core.PyDictionarygetSubScope(String id) A convenience function for obtaining sub scopes.booleanvoidinsert(JSONObject json) Takes a JSON object and inserts it into this scope, creating deep observable scopes for all sub dictionaries.protected voidnotifyObservers(String key, org.python.core.PyObject value) protected voidnotifyObservers(org.python.core.PyObject key, org.python.core.PyObject value) voidvoidsetVariable(Object key, Object value) Set or update a variable in the chart scope.booleanIf TRUE, keys of the nature "a.b.c" will be treated as sub scopes "a","b","c" under this one, and will be obtained through getSubScope.protected com.google.common.base.Optional<Object>toJson(org.python.core.PyObject value) protected voidtransferObservers(PyChartScope newScope, PyChartScope existing) When we're replacing a scope, we need to notify everyone who is watching something in that scope.Methods inherited from class org.python.core.PyDictionary__cmp__, __contains__, __delitem__, __eq__, __finditem__, __finditem__, __iter__, __len__, __ne__, __nonzero__, clear, containsKey, containsValue, dict___getitem__, dict___init__, entrySet, equals, fromkeys, fromkeys, get, get, get, getMap, has_key, hashCode, isEmpty, isMappingType, isSequenceType, items, iteritems, iterkeys, itervalues, keys, keySet, merge, mergeFromKeys, mergeFromSeq, pop, pop, popitem, put, putAll, putIfAbsent, pyKeySet, refersDirectlyTo, remove, remove, replace, replace, setdefault, setdefault, size, toString, traverse, update, updateCommon, values, viewitems, viewkeys, viewvaluesMethods inherited from class org.python.core.PyObject__abs__, __add__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __coerce__, __coerce_ex__, __complex__, __delattr__, __delattr__, __delete__, __delitem__, __delslice__, __delslice__, __dir__, __div__, __divmod__, __ensure_finalizer__, __findattr__, __findattr__, __finditem__, __float__, __floordiv__, __format__, __ge__, __get__, __getattr__, __getattr__, __getitem__, __getitem__, __getnewargs__, __getslice__, __getslice__, __gt__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __index__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __iternext__, __itruediv__, __ixor__, __le__, __long__, __lshift__, __lt__, __mod__, __mul__, __neg__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rawdir__, __rdiv__, __rdivmod__, __reduce__, __reduce_ex__, __reduce_ex__, __repr__, __rfloordiv__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __setattr__, __setitem__, __setitem__, __setslice__, __setslice__, __str__, __sub__, __tojava__, __truediv__, __trunc__, __unicode__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _iadd, _iand, _idiv, _idivmod, _ifloordiv, _ilshift, _imod, _imul, _in, _ior, _ipow, _irshift, _is, _isnot, _isub, _itruediv, _ixor, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _unsupportedop, _xor, adaptToCoerceTuple, asDouble, asIndex, asIndex, asInt, asInt, asIterable, asLong, asLong, asName, asName, asString, asString, asStringOrNull, asStringOrNull, bit_length, conjugate, delDict, delType, dispatch__init__, fastGetClass, fastGetDict, finalize, getDict, getJavaProxy, getType, impAttr, implementsDescrDelete, implementsDescrGet, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isIndex, isInteger, isNumberType, mergeClassDict, mergeDictAttr, mergeListAttr, noAttributeError, object___subclasshook__, readonlyAttributeError, runsupportedopMessage, setDict, setType, unsupportedopMessageMethods inherited from interface java.util.concurrent.ConcurrentMapcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
- 
Field Details- 
observers
 
- 
- 
Constructor Details- 
PyChartScopepublic PyChartScope()
- 
PyChartScope
 
- 
- 
Method Details- 
createFromThis goes deep through a dictionary and creates PyChartScopes for any embedded dictionaries.*
- 
copypublic org.python.core.PyDictionary copy()- Overrides:
- copyin class- org.python.core.PyDictionary
 
- 
supportsSubScopespublic boolean supportsSubScopes()If TRUE, keys of the nature "a.b.c" will be treated as sub scopes "a","b","c" under this one, and will be obtained through getSubScope. If FALSE, such a key will be treated as a flat key value.
- 
addScopeObserver
- 
removeScopeObserver
- 
getSubScopeA convenience function for obtaining sub scopes. *
- 
hasKey
- 
setVariableSet or update a variable in the chart scope. This method (or__setitem__(PyObject, PyObject)) must be used in order for observers to be notified.- Parameters:
- key- entry key.
- value- entry value.
 
- 
__setitem__public void __setitem__(org.python.core.PyObject key, org.python.core.PyObject value) - Overrides:
- __setitem__in class- org.python.core.PyDictionary
 
- 
transferObserversWhen we're replacing a scope, we need to notify everyone who is watching something in that scope. Also, we need to go deep and transfer observers/notify for any deeper dictionaries.
- 
__findattr_ex__- Overrides:
- __findattr_ex__in class- org.python.core.PyObject
 
- 
__setattr__- Overrides:
- __setattr__in class- org.python.core.PyObject
 
- 
__set__public void __set__(org.python.core.PyObject obj, org.python.core.PyObject value) - Overrides:
- __set__in class- org.python.core.PyObject
 
- 
notifyObserversprotected void notifyObservers(org.python.core.PyObject key, org.python.core.PyObject value) 
- 
notifyObservers
- 
createSerializableVersionpublic org.python.core.PyDictionary createSerializableVersion()
- 
createSnapshot- Throws:
- Exception
 
- 
toJsonprotected com.google.common.base.Optional<Object> toJson(org.python.core.PyObject value) throws Exception - Throws:
- Exception
 
- 
insertTakes a JSON object and inserts it into this scope, creating deep observable scopes for all sub dictionaries.
- 
getSerializableMap- Returns:
- a HashMap of the PyChartScope's internal map that can be safely serialized and deserialized.
 
 
-