Class RpsReporter

    • Constructor Detail

      • RpsReporter

        public RpsReporter​(java.lang.String systemName,
                           java.lang.String prefix)
      • RpsReporter

        public RpsReporter​(java.lang.String systemName,
                           java.lang.String userName,
                           java.lang.String prefix)
    • Method Detail

      • notifyLeaving

        void notifyLeaving​(java.lang.Integer id)
        Notify parameter listeners that a device has left the region covered by this reporter.
        Parameters:
        id - Number of region being left
      • notifyArriving

        void notifyArriving​(java.lang.Integer id)
        Notify parameter listeners that a device has entered the region covered by this reporter.
        Parameters:
        id - Number of region being entered
      • getState

        public int getState()
        Numerical state is the number of transmitters in the region.
        Specified by:
        getState in interface NamedBean
        Specified by:
        getState in interface Reporter
        Returns:
        the state
      • setState

        public void setState​(int i)
        Description copied from interface: NamedBean
        Provide generic access to internal state.

        This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read.

        Specified by:
        setState in interface NamedBean
        Parameters:
        i - the state
      • dispose

        public void dispose()
        Description copied from class: AbstractNamedBean
        Deactivate this object, so that it releases as many resources as possible and no longer effects others.

        For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.

        It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.

        Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.

        Specified by:
        dispose in interface NamedBean
        Overrides:
        dispose in class AbstractNamedBean
      • getLocoAddress

        public LocoAddress getLocoAddress​(java.lang.String rep)
        Parses out a (possibly old) RpsReporter-generated report string to extract the address from the front. Assumes the RpsReporter format is "NNNN".
        Parameters:
        rep - loco string.
        Returns:
        loco address, may be null.
      • getDirection

        public PhysicalLocationReporter.Direction getDirection​(java.lang.String rep)
        Get the direction (ENTER/EXIT) of the report.

        Because of the way Ecos Reporters work (or appear to), all reports are ENTER type.

        Parameters:
        rep - reporter ID in string form.
        Returns:
        direction is always a location entrance
      • getPhysicalLocation

        public PhysicalLocation getPhysicalLocation()
        Get the PhysicalLocation of the Reporter.

        Reports its own location, for now. Not sure if that's the right thing or not. Would be nice if it reported the exact measured location of the transmitter, but right now that doesn't appear to be being stored anywhere retrievable. NOT DONE YET

        Returns:
        PhysicalLocation.getBeanPhysicalLocation
      • getPhysicalLocation

        public PhysicalLocation getPhysicalLocation​(java.lang.String s)
        Get the PhysicalLocation of the Transmitter for a given ID.

        Given an ID (in String form), looks up the Transmitter and gets its current PhysicalLocation (translated from the RPS Measurement).

        Parameters:
        s - transmitter ID.
        Returns:
        physical location.