psdi.app.pm

Class PMMeter

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


    public class PMMeter
    extends Mbo
    implements PMMeterRemote
    MBO object to represent PMMeter.

    This is a site level object.

    The key attributes for this object are SiteId,Pmnum, and Metername.

    The attributes in this object are as follows:

    Attribute NameDescription
    AlertLeadAcceptable period (in days), prior to the PM due date, during which the PM may be performed.
    AssetnumIdentifier of the asset associated with this PM. Foreign Key to Assetnum.
    AverageIdentifier of the asset associated with this PM. Foreign Key to Assetnum.
    DATEOFNEXTWOEstimated due date for next work order generation.
    FrequencyIdentifies the number of time units to elapse between the workorders generated from PM. The time units can be Days, Weeks, Months or Years.
    LastPmWogenReadMeter Reading at the last work order generation.
    LastPmWogenReadDtMeter Reading Date at Last work order generation.
    LocationIdentifies the location where the work will be done when workorders are generated by this PM.
    MasterPM Identifies the master PM which can be used as template to create associated PM records.
    MeterName Identifies the meter on the PM.
    ORGIDIdentifier of the organization for this PM Meter.
    PMNUMIdentifier for the Preventive Maintenance record.
    READINGATNEXTWOReading at the next work order generation.
    RollOverPoint at which the asset's (or) Location's meter returns to its mininum value. Rollover applies to CONTINUOUS meters only.
    SiteIdIdentifier of the site for the PM.
    StatusIndicates status of a PM.
    ToleranceIdentifier of the tolerance level.
    UnitsToGoIdentifier of the Units to Go.
    UPDMETERA boolean field used to identify if meter is to be updated.

    • Constructor Detail

      • PMMeter

        public PMMeter(MboSet ms)
                throws MXException,
                       java.rmi.RemoteException
        Construct the PMMeter object
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Sets default values for a PMMeter object
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Description copied from class: Mbo
        Pre-save validation method. Programmer can override with specific rules.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long modifier)
                    throws MXException,
                           java.rmi.RemoteException
        Deletes a PMMeter record.
        when all pmmeter are deleted, get the PM(owner) and set the pmactmeter and pmassetwogen fields to false.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        modifier - access modifier
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        Undeletes a PMMeter record.
        when PMMETERs are undeleted, get the PM(owner) and set the pmactmeter fields to editable.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getUnitsToGoReading

        public double getUnitsToGoReading(MboRemote assetLocMeterMbo)
                                   throws java.rmi.RemoteException,
                                          MXException
        Calculate the new value for UnitsToGo attribute using the assetmeter or locationmeter object provided. The calculation is: (LTDLASTPMWOREAD + FREQUENCY)- ASSETLOCMETER.LIFETODATE - TOLERANCE This should be called when establishing UNITSTOGO as a new reading is being entered and the committed update of the ASSETMETER or LOCATIONMETER cumulative meter reading values (most importantly for UNITSTOGO determination, LIFETODATE) cannot be insured prior to PM work order generation being run. For example, when importing a reading via integration, this method is used. When certain that cumulative meter readings unchanging (for example, when the PMWoGenCronTask is run,PMMeter.getUnitsToGoReading() is called.
        Specified by:
        getUnitsToGoReading in interface PMMeterRemote
        Returns:
        PMMeter.UnitsToGo value
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PMMeter.getUnitsToGoReading(MboRemote assetLocMeterMbo)
      • findAssetOrLocationMeterSet

        protected MboSetRemote findAssetOrLocationMeterSet()
                                                    throws MXException,
                                                           java.rmi.RemoteException
        Based on whether PMMeter has asset or location, it returns the ASSETMETER or LOCATIONMETER mboset.
        Returns:
        A set of AssetMeters or LocationMeters depending if PM is for an asset or a location.
        Throws:
        MXException
        java.rmi.RemoteException
      • checkForUseTargetStartAndOpenWo

        public boolean checkForUseTargetStartAndOpenWo()
                                                throws java.rmi.RemoteException,
                                                       MXException
        Check to see if any workorder is open when the PM.UseTargetStart is false
        Returns:
        true if the usetargetdate is false and if any open workorder against this PM
        Throws:
        MXException
        java.rmi.RemoteException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        This method overrides the skipCopyField() in the Mbo. This method takes the MboValueInfo as its parameter to see if this field needs to be copied or skipped.If this field does not need to be copied, it returns true. The following fields donot get copied from the source PMMeter to the target PMMeter.
        1. pmnum
        2. dateofnextwo
        3. lastpmwogenread
        4. lastpmwogenreaddt
        5. readingatnextwo
        6. unitstogo
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        mvi - The MboValueInfo object of the MboValue that needs to be copied.
        Returns:
        True,if the field does not need to be copied.In all other cases return false.
        Throws:
        MXException
        java.rmi.RemoteException
      • setRollOverAndAverage

        public void setRollOverAndAverage()
                                   throws java.rmi.RemoteException,
                                          MXException
        Calculate and set the value of RollOver and Average Field when a meter is entered.
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Method that checks whether a PMMeter can be deleted or not.
        Throws interactive message in case of UI to delete the PM Hierarchy forecast if the meter is deleted
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Description copied from class: Mbo
        Save the object and other linked objects. Subclasses can code their save() logic to include any appropriate updates to other linked objects and call super.save().
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException