reporting.pvmon package

Submodules

reporting.pvmon.admin module

class reporting.pvmon.admin.AddForm(*args, **kwargs)[source]

Bases: ModelForm

class Meta[source]

Bases: object

exclude = ()
model

alias of MonitoredVariable

base_fields = {'instrument': <django.forms.models.ModelChoiceField object>, 'pv_name': <django.forms.models.ModelChoiceField object>, 'rule_name': <django.forms.fields.CharField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class reporting.pvmon.admin.MonitoredVariableAdmin(model, admin_site)[source]

Bases: ModelAdmin

form

alias of AddForm

list_display = ('id', 'instrument', 'pv_name', 'rule_name')
list_editable = ('pv_name', 'rule_name')
property media
class reporting.pvmon.admin.PVAdmin(model, admin_site)[source]

Bases: ModelAdmin

get_timestamp(pv)[source]
list_display = ('id', 'instrument', 'name', 'value', 'status', 'update_time', 'get_timestamp')
list_filter = ('instrument', 'name', 'status')
property media
class reporting.pvmon.admin.PVNameAdmin(model, admin_site)[source]

Bases: ModelAdmin

list_display = ('id', 'name', 'monitored')
list_editable = ('monitored',)
property media
class reporting.pvmon.admin.PVNameCharField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]

Bases: CharField

to_python(value)[source]

Return a string.

reporting.pvmon.models module

Models for PV monitor app

@author: M. Doucet, Oak Ridge National Laboratory @copyright: 2014 Oak Ridge National Laboratory

class reporting.pvmon.models.MonitoredVariable(*args, **kwargs)[source]

Bases: Model

Table of PVs that need special monitoring and might have DASMON rules associated with them

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

instrument

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

instrument_id
objects = <django.db.models.manager.Manager object>
pv_name

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

pv_name_id
rule_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class reporting.pvmon.models.PV(*args, **kwargs)[source]

Bases: Model

Table holding values

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

instrument

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

instrument_id
name

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

name_id
objects = <django.db.models.manager.Manager object>
status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class reporting.pvmon.models.PVCache(*args, **kwargs)[source]

Bases: Model

Table holding the latest values

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

instrument

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

instrument_id
name

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

name_id
objects = <django.db.models.manager.Manager object>
status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class reporting.pvmon.models.PVName(*args, **kwargs)[source]

Bases: Model

Table holding the Process Variable names

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

monitored

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

monitoredvariable_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
pv_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pvcache_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pvstring_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

pvstringcache_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class reporting.pvmon.models.PVString(*args, **kwargs)[source]

Bases: Model

Table holding string values

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

instrument

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

instrument_id
name

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

name_id
objects = <django.db.models.manager.Manager object>
status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class reporting.pvmon.models.PVStringCache(*args, **kwargs)[source]

Bases: Model

Table holding the latest string values

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

instrument

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

instrument_id
name

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

name_id
objects = <django.db.models.manager.Manager object>
status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

reporting.pvmon.urls module

Define url structure

reporting.pvmon.view_util module

Utilities to compile the PVs stored in the web monitor DB.

@author: M. Doucet, Oak Ridge National Laboratory @copyright: 2014 Oak Ridge National Laboratory

reporting.pvmon.view_util.get_cached_variables(instrument_id, monitored_only=False)[source]

Get cached PV values for a given instrument

Parameters:
  • instrument_id – Instrument object

  • monitored_only – if True, only monitored PVs are returned

reporting.pvmon.view_util.get_live_variables(request, instrument_id, key_id=None)[source]

Create a data dictionary with requested live data

Parameters:
  • request – HTTP request object

  • instrument_id – Instrument object

  • key_id – key to return data for, if request is None

reporting.pvmon.views module

Live PV monitoring

Module contents