Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ipositioning.py 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # Copyright (c) Twisted Matrix Laboratories.
  2. # See LICENSE for details.
  3. """
  4. Positioning interfaces.
  5. @since: 14.0
  6. """
  7. from zope.interface import Attribute, Interface
  8. class IPositioningReceiver(Interface):
  9. """
  10. An interface for positioning providers.
  11. """
  12. def positionReceived(latitude, longitude):
  13. """
  14. Method called when a position is received.
  15. @param latitude: The latitude of the received position.
  16. @type latitude: L{twisted.positioning.base.Coordinate}
  17. @param longitude: The longitude of the received position.
  18. @type longitude: L{twisted.positioning.base.Coordinate}
  19. """
  20. def positionErrorReceived(positionError):
  21. """
  22. Method called when position error is received.
  23. @param positionError: The position error.
  24. @type positionError: L{twisted.positioning.base.PositionError}
  25. """
  26. def timeReceived(time):
  27. """
  28. Method called when time and date information arrives.
  29. @param time: The date and time (expressed in UTC unless otherwise
  30. specified).
  31. @type time: L{datetime.datetime}
  32. """
  33. def headingReceived(heading):
  34. """
  35. Method called when a true heading is received.
  36. @param heading: The heading.
  37. @type heading: L{twisted.positioning.base.Heading}
  38. """
  39. def altitudeReceived(altitude):
  40. """
  41. Method called when an altitude is received.
  42. @param altitude: The altitude.
  43. @type altitude: L{twisted.positioning.base.Altitude}
  44. """
  45. def speedReceived(speed):
  46. """
  47. Method called when the speed is received.
  48. @param speed: The speed of a mobile object.
  49. @type speed: L{twisted.positioning.base.Speed}
  50. """
  51. def climbReceived(climb):
  52. """
  53. Method called when the climb is received.
  54. @param climb: The climb of the mobile object.
  55. @type climb: L{twisted.positioning.base.Climb}
  56. """
  57. def beaconInformationReceived(beaconInformation):
  58. """
  59. Method called when positioning beacon information is received.
  60. @param beaconInformation: The beacon information.
  61. @type beaconInformation: L{twisted.positioning.base.BeaconInformation}
  62. """
  63. class IPositioningBeacon(Interface):
  64. """
  65. A positioning beacon.
  66. """
  67. identifier = Attribute(
  68. """
  69. A unique identifier for this beacon. The type is dependent on the
  70. implementation, but must be immutable.
  71. """
  72. )
  73. class INMEAReceiver(Interface):
  74. """
  75. An object that can receive NMEA data.
  76. """
  77. def sentenceReceived(sentence):
  78. """
  79. Method called when a sentence is received.
  80. @param sentence: The received NMEA sentence.
  81. @type L{twisted.positioning.nmea.NMEASentence}
  82. """
  83. __all__ = ["IPositioningReceiver", "IPositioningBeacon", "INMEAReceiver"]