Packageorg.MARS.robot.sensors
Classpublic class AbstractSensor
InheritanceAbstractSensor Inheritance AbstractElectronicDevice
ImplementsISensor
SubclassesEdgeSensor, IRDetector, LineSensor, TouchSensor

Implements the basic sensor functionality

NOTE: the abstract classes cannot be instantiated



Public Properties
 PropertyDefined by
 InheritednumberOfPorts : Number
Get the number of IO ports in the device.
AbstractElectronicDevice
  shape : Shape
[read-only] The shape of the sensor
AbstractSensor
  type : Class
[read-only] The type of the sensor
AbstractSensor
Protected Properties
 PropertyDefined by
 Inherited_ports : Array
AbstractElectronicDevice
  _shape : Shape
AbstractSensor
  _type : Class
AbstractSensor
Public Methods
 MethodDefined by
  
Creates a sensor with the given shape
AbstractSensor
 Inherited
getPort(portNumber:Number):IOPort
Get a certain IO port by its number
AbstractElectronicDevice
  
getReading():void
The function which is called on every step of the physics engine.
AbstractSensor
Property detail
_shapeproperty
protected var _shape:Shape
shapeproperty 
shape:Shape  [read-only]

The shape of the sensor

Implementation
    public function get shape():Shape
_typeproperty 
protected var _type:Class
typeproperty 
type:Class  [read-only]

The type of the sensor

Implementation
    public function get type():Class
Constructor detail
AbstractSensor()constructor
public function AbstractSensor(shape:Shape)

Creates a sensor with the given shape

Parameters
shape:Shape

See also

Shape
Method detail
getReading()method
public function getReading():void

The function which is called on every step of the physics engine. Gets the reading depending on the type of the sensor.

NOTE: do not call this method of the AbstractSensor class, use the subclass