Class Index | File Index

Classes


Class baja.Status


Extends baja.Simple.
Represents a baja:Status in BajaScript.

Status provides a bit mask for various standardized status flags in the Baja control architecture. Plus it provides for arbitrary extensions using BFacets.

When creating a Simple, always use the 'make' method instead of creating a new Object.
Defined in: obj.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
baja.Status.ACTIVE_LEVEL
String used in a Facets for identifying the active priority level of a writable point.
<static>  
baja.Status.ALARM
Bit for alarm.
<static>  
baja.Status.DEFAULT
Default Status instance.
<static>  
baja.Status.DISABLED
Bit for disabled.
<static>  
baja.Status.DOWN
Bit for down.
<static>  
baja.Status.FAULT
Bit for fault.
<static>  
baja.Status.NULL
Bit for null.
<static>  
baja.Status.ok
Status for ok (null facets).
<static>  
baja.Status.OVERRIDDEN
Bit for overriden.
<static>  
baja.Status.STALE
Bit for stale.
<static>  
baja.Status.UNACKED_ALARM
Bit for unacked alarm.
Fields borrowed from class baja.Value:
newCopy
Fields borrowed from class baja.Object:
equivalent, getIcon
Method Summary
Method Attributes Method Name and Description
 
Decode a Status from a String.
 
Encode the Status to a String.
 
equals(obj)
Equality test.
 
get(name, def)
Return a value from the status facets.
 
Return the Status bits.
 
Return the facets for the Status.
<static>  
baja.Status.getStatusFromIStatus(statusVal)
Return the status from a BIStatus.
 
Return true if the Status is in alarm.
 
Return true if the Status is disabled.
 
Return true if the Status is down.
 
Return true if the Status is in fault.
 
Return true if the Status is null.
 
isOk()
Return true if the Status is ok.
 
Return true if the Status is overriden.
 
Return true if the Status is stale.
 
Return true if the Status is unacked alarm.
 
Return true if the Status is not disabled, fault, down stale or null.
 
make(obj)
Make a Status.
<static>  
baja.Status.make(obj)
Make a Status

The bits (Number) or (for more arguments) an Object Literal can be used to specify the method's arguments.

Class Detail
baja.Status()
Field Detail
<static> baja.Status.ACTIVE_LEVEL
String used in a Facets for identifying the active priority level of a writable point.

<static> baja.Status.ALARM
Bit for alarm.

<static> baja.Status.DEFAULT
Default Status instance.

<static> baja.Status.DISABLED
Bit for disabled.

<static> baja.Status.DOWN
Bit for down.

<static> baja.Status.FAULT
Bit for fault.

<static> baja.Status.NULL
Bit for null.

<static> baja.Status.ok
Status for ok (null facets).

<static> baja.Status.OVERRIDDEN
Bit for overriden.

<static> baja.Status.STALE
Bit for stale.

<static> baja.Status.UNACKED_ALARM
Bit for unacked alarm.
Method Detail
{baja.Status} decodeFromString(str)
Decode a Status from a String.
Parameters:
{String} str
Returns:
{baja.Status}

{String} encodeToString()
Encode the Status to a String.
Returns:
{String}

{Boolean} equals(obj)
Equality test.
Parameters:
obj
Returns:
{Boolean}

get(name, def)
Return a value from the status facets.
Parameters:
{String} name
the name of the value to get from the status facets.
def Optional
if defined, this value is returned if the name can't be found in the status facets.
Returns:
the value from the status facets (null if def is undefined and name can't be found).

{Number} getBits()
Return the Status bits.
Returns:
{Number} status bits.

{baja.Facets} getFacets()
Return the facets for the Status.
Returns:
{baja.Facets} status facets

<static> baja.Status.getStatusFromIStatus(statusVal)
Return the status from a BIStatus.
Parameters:
statusVal
Returns:
resolved status value

{Boolean} isAlarm()
Return true if the Status is in alarm.
Returns:
{Boolean}

{Boolean} isDisabled()
Return true if the Status is disabled.
Returns:
{Boolean}

{Boolean} isDown()
Return true if the Status is down.
Returns:
{Boolean}

{Boolean} isFault()
Return true if the Status is in fault.
Returns:
{Boolean}

{Boolean} isNull()
Return true if the Status is null.
Returns:
{Boolean}

{Boolean} isOk()
Return true if the Status is ok.
Returns:
{Boolean}

{Boolean} isOverridden()
Return true if the Status is overriden.
Returns:
{Boolean}

{Boolean} isStale()
Return true if the Status is stale.
Returns:
{Boolean}

{Boolean} isUnackedAlarm()
Return true if the Status is unacked alarm.
Returns:
{Boolean}

{Boolean} isValid()
Return true if the Status is not disabled, fault, down stale or null.
Returns:
{Boolean} true if valid.

{baja.Status} make(obj)
Make a Status.

The bits (Number) or (for more arguments) an Object Literal can be used to specify the method's arguments.

  var st1 = baja.Status.make(baja.Status.DOWN | baja.Status.FAULT);
  
  // ... or for more arguments...
  
  var st2 = baja.$("baja:Status").make({
    bits: baja.Status.DOWN,
    facets: facets
  });
The make method can also be used to create a new status with its state changed...
  var newStatus = baja.$("baja:Status").make({
    orig: oldStatus, 
    bits: baja.Status.OVERRIDDEN, 
    state: true
  }};
Parameters:
{Object|Number} obj
the Object Literal that specifies the method's arguments or Status bits.
{Number} obj.bits
the Status bits.
{baja.Facets} obj.facets Optional
the facets for the Status.
{baja.Status} obj.orig Optional
if defined, obj.state must also be defined. This is used to create a new Status with one of it's bit states changed (see example above).
{Boolean} obj.state Optional
the state of the bit to change (used in conjunction with obj.orig).
Returns:
{baja.Status} the status.

<static> {baja.Status} baja.Status.make(obj)
Make a Status

The bits (Number) or (for more arguments) an Object Literal can be used to specify the method's arguments.

  var st1 = baja.Status.make(baja.Status.DOWN | baja.Status.FAULT);
  
  // ... or for more arguments...
  
  var st2 = baja.Status.make({
    bits: baja.Status.DOWN,
    facets: facets
  });
The make method can also be used to create a new status with its state changed...
  var newStatus = baja.Status.make({
    orig: oldStatus, 
    bits: baja.Status.OVERRIDDEN, 
    state: true
  }};
Parameters:
{Object|Number} obj
the Object Literal that specifies the method's arguments or Status bits.
{Number} obj.bits
the Status bits.
{baja.Facets} obj.facets Optional
the facets for the Status.
{baja.Status} obj.orig Optional
if defined, obj.state must also be defined. This is used to create a new Status with one of it's bit states changed (see example above).
{Boolean} obj.state Optional
the state of the bit to change (used in conjunction with obj.orig).
Returns:
{baja.Status} the status.

Documentation generated by JsDoc Toolkit 2.3.2