Class SDPLocation

java.lang.Object
uk.ac.manchester.spinnaker.messages.sdp.SDPLocation
All Implemented Interfaces:
HasBMPLocation, HasChipLocation, HasCoreLocation

public class SDPLocation extends Object implements HasCoreLocation, HasBMPLocation
Represents a location in an SDP message. This could be a core location or a BMP location. As such it can be interpreted as either.
  • Constructor Details

    • SDPLocation

      public SDPLocation(HasCoreLocation core)
      Make an SDPLocation from a core location.
      Parameters:
      core - The core location to use.
    • SDPLocation

      public SDPLocation(HasBMPLocation bmp)
      Make an SDPLocation from a BMP location.
      Parameters:
      bmp - The BMP location to use.
    • SDPLocation

      public SDPLocation(int major, int minor, int detail)
      Make an SDPLocation from components.
      Parameters:
      major - The first part of the location (x or cabinet).
      minor - The second part of the location (y or frame).
      detail - The third part of the location (p or board).
  • Method Details

    • getX

      public int getX()
      Specified by:
      getX in interface HasChipLocation
      Returns:
      The X coordinate of the chip.
    • getY

      public int getY()
      Specified by:
      getY in interface HasChipLocation
      Returns:
      The Y coordinate of the chip.
    • getP

      public int getP()
      Specified by:
      getP in interface HasCoreLocation
      Returns:
      The processor coordinate of the core on its chip.
    • getCabinet

      public int getCabinet()
      Specified by:
      getCabinet in interface HasBMPLocation
      Returns:
      The cabinet number of the board. Not actually a processor coordinate.
    • getFrame

      public int getFrame()
      Specified by:
      getFrame in interface HasBMPLocation
      Returns:
      The frame number of the board. Not actually a processor coordinate.
    • getBoard

      public int getBoard()
      Specified by:
      getBoard in interface HasBMPLocation
      Returns:
      The board number of the board. Not actually a processor ID.
    • asChipLocation

      public ChipLocation asChipLocation()
      Description copied from interface: HasChipLocation
      Converts (if required) this to a simple X, Y tuple.
      Specified by:
      asChipLocation in interface HasChipLocation
      Returns:
      A ChipLocation representation of the X and Y tuple
    • asCoreLocation

      public CoreLocation asCoreLocation()
      Description copied from interface: HasCoreLocation
      Converts (if required) this to a simple X, Y, P tuple.
      Specified by:
      asCoreLocation in interface HasCoreLocation
      Returns:
      A CoreLocation representation of the X, Y, P tuple
    • asBMPLocation

      public BMPLocation asBMPLocation()
      Description copied from interface: HasBMPLocation
      Converts (if required) this to a simple X, Y, P tuple.
      Specified by:
      asBMPLocation in interface HasBMPLocation
      Returns:
      A CoreLocation representation of the X, Y, P tuple
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object