psdi.app.location

Class LocationMeter

  • All Implemented Interfaces:
    java.rmi.Remote, LocationMeterRemote, DeployedMeterRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class LocationMeter
    extends DeployedMeter
    implements LocationMeterRemote
    MBO to represent a LocationMeter. See Location package description for details.

    The key attributes for this object are as follows: SiteId, Location and MeterName.

    The attributes in this object are as follows:

    Attribute NameDescription
    AvgCalcMethodMethod used to calculate the average meter units per day upon entry of a new or modified meter reading. Valid values are as follows:

    MethodDescription
    STATICAverage is not recalculated - static value is stored in AvgCalcValue.
    ALLAll previous location meter readings are used in the calculation.
    SLIDING-READINGSLast n* location meter readings are used in the calculation.
    SLIDING-DAYSLocation Meter Readings from last n* days are used in the calculation.
    SLIDING-WEEKSLocation Meter Readings from last n* weeks are used in the calculation.
    SLIDING-MONTHSLocatoin Meter Readings from last n* months are used in the calculation.
    * n is a user-specified number
    AvgMeterUnitsNon-persistent attribute. Holds the calculated average value. This value is dynamically calculated based on the AvgCalcMethod and the AvgCalcValue or SlidingWindowSize.
    AvgCalcValueaverage value for CONTINUOUS LocationMeters that employ a STATIC AvgCalcMethod.
    ChangeBy, ChangeDateName of the user who entered or last modified this LocationMeter and the date the LocationMeter was entered or modified. These default to the system user name and date.
    DeltaValueNon-persistent attribute. This attribute, the value of which is calculated when a new reading is reported, is used to roll down the reading to this LocationMeter's children.
    DomainIdNon-persistent attribute. For LocationMeters associated with CHARACTERISTIC meters only, this attribute holds domain information from the Meter. This domain information is used by NewReading and PreviousReading to look up and validate against the values in the ALNValue object.
    DoRolloverWill this LocationMeter's new reading roll the meter over. This attribute is READONLY when Rollover is null.
    ActiveY/N field indicating whether or not the location's meter is available to accept readings.
    LocationLocation associated with the meter in this LocationMeter.
    GroupNameIdentifier of the meter group from which this meter was copied to this LocationMeter.
    InspectorNon-persistent attribute. Person who has provided the meter reading.
    IsDeltaNon-persistent attribute. Is the meter reading being reported for this LocationMeter a delta value?
    LastReadingMost recent reading for this LocationMeter.
    LastReadingDateMost recent reading date for this LocationMeter.
    LDKeyLong description key for the Remarks attribute. This is a link to text stored in the LongDescription table.
    LifeToDateTotal of all meter readings since the meter was manufactured. Reset only on replacement of physical meter.
    MeasureUnitId unit of measure for this LocationMeter. The value defaults to the meter's MeasureUnitId but can then be modified. This attribute pertains only to meters of type CONTINUOUS and GAUGE.
    MeterNameIdentifier of the meter associated with the location in this LocationMeter.
    NewReadingNon-persistent attribute. New meter reading value.
    NewReadingDateNon-persistent attribute. Date of the new meter reading value. This cannot be a future date.
    PreviousReadingNon-persistent attribute. Displays the most recent reading for this LocationMeter.
    PreviousReadingDateNon-persistent attribute. Displays the most recent reading date for this LocationMeter.
    PreviousReadingInspectorNon-persistent attribute. Displays the inspector for this LocationMeter's most recent reading.
    RemarksAdditional information supplied by the user regarding the LocationMeter record. Long description enabled.
    Rollover Rollover value for this LocationMeter. If this LocationMeter has been created when applying a meter group to this location, the value defaults to the meter group's rollover value but can then be modified.
    SinceInstallDifference between the current meter reading for this LocationMeter's meter and the meter reading when this LocationMeter's location was moved into its current configuration.
    SinceLastInspectionDifference between the current meter reading for this LocationMeter's meter and the meter reading when the last work order of type INSPECTION was opened or closed on this LocationMeter's location as determined by application setup.
    SinceLastOverhaulDifference between the current meter reading for this LocationMeter's meter and the meter reading when the last work order of type OVERHAUL was opened or closed on this LocationMeter's location as determined by application setup.
    SinceLastRepairDifference between the current meter reading for this LocationMeter's meter and the meter reading when the last work order was opened or closed on this LocationMeter's location as determined by application setup.
    SlidingWindowSizeif the AvgCalcMethod employs a sliding scale, this attribute specifies the number of readings, days, weeks or months to use in the average calculation.
    See Also:
    psdi.app.meter.metergroup, psdi.app.meter.meteringroup
    • Constructor Detail

      • LocationMeter

        public LocationMeter(MboSet ms)
                      throws MXException,
                             java.rmi.RemoteException
        Construct the LocationMeter object
        Parameters:
        ms - Mbo set
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • getDeploymentInfo

        protected java.lang.Object[] getDeploymentInfo()
                                                throws MXException,
                                                       java.rmi.RemoteException
        provides key value and meter reading table name information for the LocationMeter ("location" and "locmeterreading")
        Specified by:
        getDeploymentInfo in class DeployedMeter
        Returns:
        Object[] holding the keyvalue "location" in Object[0], meter reading table name "locmeterreading" in Object[1] and average calculation key "location" for this subclass of DeployedMeter.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        DeployedMeter.getDeploymentInfo(), DeployedMeter.init(), psdi.app.meter.DeployedMeter#getReadings()
      • processContinuousReadings

        protected void processContinuousReadings()
                                          throws MXException,
                                                 java.rmi.RemoteException
        processes the new or adjusted reading for the LocationMeter by adding a new meter reading (if the transaction is for a new reading) and updating this LocationMeter's meterreadings that are subsequent to the new reading or modification.
        Specified by:
        processContinuousReadings in class DeployedMeter
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        LocationMeter.getReadings(), #LocMeterReadingSet.updateReadingsAfterReadingUpdate(), #LocMeterReadingSet.updateReadingsAfterNewReading()
      • propagateNewLocMeterReadingToAssetsAtLoc

        protected void propagateNewLocMeterReadingToAssetsAtLoc(long meterreadingid)
                                                         throws MXException,
                                                                java.rmi.RemoteException
        when a new location meter reading is entered for this LocationMeter, creates asset meterreadings for the AssetMeters of top-level assets at the location. The AssetMeters for each asset must meet the following criteria:
        • Active attribute must be true
        • RollDownSource must be LOCATION
        • MeterName attribute must be the same as this LocationMeter's MeterName
        Parameters:
        meterreadingid - locmeterreading's meterreadingid, used to set the MeterReading.LocMeterReadingId of any new asset meterreadings created here.
        Throws:
        MXException
        java.rmi.RemoteException
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Description copied from class: DeployedMeter
        called whenever a field is modified to update the changedate and changeby attributes
        Overrides:
        modify in class DeployedMeter
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Description copied from class: Mbo
        Mark the object to be deleted depending on the access modifier. This will usually be overridden in the subclass of Mbo as there may be application specific rules as to if and when an object can be deleted. Object is not actually deleted in the database until save() is called. This method will also mark all associated Long Description and Translation Mbos for deletion.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class DeployedMeter
        Parameters:
        accessModifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • isOwningMboNOSAVE

        public void isOwningMboNOSAVE()
                               throws MXException,
                                      java.rmi.RemoteException
        10-19707: the modify() method sets the owner(most likely Location) isModified flag to true. However if the user does not have the secrutiy for SAVE of the application where MAINMBO is the owning object, the location object should not be updated. This applies to enter Meter Reading - per the product designer we should allow meter readings to be saved while not saving the location if the user group has only READ but no SAVE security for the application
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Check if process is being saved via Integration. Call the autoWogen method to generate work orders if needed.
        Overrides:
        save in class DeployedMeter
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        enterNewReading, updateCumulatives
      • getMboSet

        public MboSetRemote getMboSet(java.lang.String name)
                               throws MXException,
                                      java.rmi.RemoteException
        Description copied from class: Mbo
        Get a related MboSet for the object using the named relationship. Used for cross object linking; for example,Work Order to Asset.
        Specified by:
        getMboSet in interface MboRemote
        Overrides:
        getMboSet in class Mbo
        Parameters:
        name - The relationship provided to retrieve a related mboSet, usually using foreign keys. For example, "psdi.app.workorder.WOSetRemote.ASSET" is a relationship for the work order object to access the asset Set where "workorder.assetnum=asset.assetnum". The relationship can also be chained. Such as ASSET.ASSETSTATUS.
        Returns:
        The returned related set specified through the relationship.
        Throws:
        MXException - "A relationship called {0} does not exist for the {1} business object" exception will be thrown if the relationship was not found. "Unknown Object" exception will be thrown if the database object can not be found through the relationship.
        java.rmi.RemoteException
        See Also:
        Mbo.getMboSet(String)