117118119120121122123124
} protected void notifyAccelerometerChange(int axis, double value) { for (int i = 0; i < accelerometerListeners.size(); i++) { ((ADXL345Listener) accelerometerListeners.elementAt(i)) .didAccelerationChange(new ADXL345Event(this, axis, value)); } }
124125126127128129130131
} protected void notifyADXL345Listeners(int axis, double value) { for (int i = 0; i < accelerometerListeners.size(); i++) { ((ADXL345Listener) accelerometerListeners.elementAt(i)) .didReceiveAcceleration(new ADXL345Event(this, axis, value)); } }
50515253545556575859
} } } private void notifyListeners(double newVoltage){ BatteryVoltageEvent ev = new BatteryVoltageEvent(this, newVoltage); for(int i = 0; i<listeners.size(); i++){ ((BatteryVoltageListener)listeners.elementAt(i)).batteryVoltageChanged(ev); } }
6869707172737475767778
protected void notifyEncoderChange(){ for(int i=0; i<encoderListeners.size(); i++){ ((EncoderListener) encoderListeners.elementAt(i)).countDidChange( new EncoderEvent(this, EncoderEvent.DISTANCE, getState("Distance"), (getState("Direction") == Sensor.TRUE) )
8283848586878889909192
protected void notifyEncoderStarted(){ for(int i=0; i<encoderListeners.size(); i++){ ((EncoderListener) encoderListeners.elementAt(i)).rotationDidStart( new EncoderEvent(this, EncoderEvent.STOPPED, getState("Distance"), (getState("Direction") == Sensor.TRUE) )
96979899100101102103104105106
protected void notifyEncoderStopped(){ for(int i=0; i<encoderListeners.size(); i++){ ((EncoderListener) encoderListeners.elementAt(i)).rotationDidStop( new EncoderEvent(this, EncoderEvent.STOPPED, getState("Distance"), (getState("Direction") == Sensor.TRUE) )
109110111112113114115116117118119
} protected void notifyDirectionChanged(){ for(int i=0; i<encoderListeners.size(); i++){ ((EncoderListener) encoderListeners.elementAt(i)).rotationDidStop( new EncoderEvent(this, EncoderEvent.DIRECTION, getState("Distance"), (getState("Direction") == Sensor.TRUE) )
636465666768697071
} protected void notifyGyroSpike() { for (int i = 0; i < gyroListeners.size(); i++) { ((GyroListener) gyroListeners.elementAt(i)) .didAngleSpike(new GyroEvent(this, GyroEvent.SPIKE, getState("Angle"))); } }
717273747576777879
} protected void notifyGyroChange() { for (int i = 0; i < gyroListeners.size(); i++) { ((GyroListener) gyroListeners.elementAt(i)) .didAngleChange(new GyroEvent(this, GyroEvent.CHANGE, getState("Angle"))); } }
798081828384858687
} protected void notifyGyroListeners() { for (int i = 0; i < gyroListeners.size(); i++) { ((GyroListener) gyroListeners.elementAt(i)) .didReceiveAngle(new GyroEvent(this, GyroEvent.NEW_DATA, getState("Angle"))); } }