All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.cmu.owl.bo.control.luxmate.LuxmateWrapper

edu.cmu.owl.bo.control.luxmate.LuxmateWrapper

public class LuxmateWrapper
This class is the Java wrapper for our luxmate server. This class contains mostly native calls. This class is a singleton.

Version:
1.0

Method Index

 o getInstance(int, WrapperListener)
This static method is the one responsible for enforcing the singleton pattern.
 o lightBrighten(int, float)
This method brightens the specified light.
 o lightDim(int, float)
This method dims the specified light.
 o lightError(int)
This method signals that a light error has occurred
 o lightGetCurrentLevel(int)
This method returns the current level of the light
 o lightIsFaulty(int)
This method determines whether the specified light is faulty.
 o lightIsOn(int)
This method determines whether the specified light is on or not
 o lightRepaired(int)
This method signals that a light has been repaired
 o lightSetCurrentLevel(int, float)
This method sets the light to a specific level
 o lightTurnOff(int)
This method turns the light off.
 o lightTurnOn(int)
This method turns the specified light on.
 o pull()
This method is used to pull the LuxmateNativeWrapper.
 o sensorError(int)
This method signals that a sensor error has occurred
 o sensorGetCurrentLevel(int)
This method sets the sensor to a specific level
 o sensorIsFaulty(int)
This method determines whether the specified sensor is faulty.
 o sensorRepaired(int)
This method signals that a sensor has been repaired
 o turnedOff(int)
This method signals that the specified light has been turned off
 o turnedOn(int)
This method signals that the specified light has been turned on

Methods

 o getInstance
 public static LuxmateWrapper getInstance(int id,
                                          WrapperListener listener)
This static method is the one responsible for enforcing the singleton pattern. Only this method can be used to get the instance of the class.

Parameters:
id - the id of the actuator whose events we wish to listen to
listener - the listener implementation (written by the client)
Returns:
the single instance of the class
 o lightTurnOn
 public native void lightTurnOn(int id)
This method turns the specified light on.

Parameters:
id - the luxmate id of the light
 o lightTurnOff
 public native void lightTurnOff(int id)
This method turns the light off.

Parameters:
id - the luxmate id of the light
 o lightDim
 public native void lightDim(int id,
                             float reln)
This method dims the specified light.

Parameters:
id - the luxmate id of the light
reln - the amount by which to dim the light
 o lightBrighten
 public native void lightBrighten(int id,
                                  float reln)
This method brightens the specified light.

Parameters:
id - the luxmate id of the light
reln - the amount by which to brighten the light
 o lightIsFaulty
 public native boolean lightIsFaulty(int id)
This method determines whether the specified light is faulty.

Parameters:
id - the luxmate id of the light
Returns:
whether the light is faulty or not
 o lightIsOn
 public native boolean lightIsOn(int id)
This method determines whether the specified light is on or not

Parameters:
id - the luxmate id of the light
Returns:
whether the light is on or not
 o lightGetCurrentLevel
 public native float lightGetCurrentLevel(int id)
This method returns the current level of the light

Parameters:
id - the luxmate id of the light
Returns:
the current level of the light
 o lightSetCurrentLevel
 public native void lightSetCurrentLevel(int id,
                                         float value)
This method sets the light to a specific level

Parameters:
id - the luxmate id of the light
value - the value at which to set the light
 o pull
 protected native synchronized void pull()
This method is used to pull the LuxmateNativeWrapper. This method will hopefully be deprecated in the future.

 o sensorGetCurrentLevel
 public native float sensorGetCurrentLevel(int id)
This method sets the sensor to a specific level

Parameters:
id - the luxmate id of the sensor
value - the value at which to set the sensor
 o sensorIsFaulty
 public native boolean sensorIsFaulty(int id)
This method determines whether the specified sensor is faulty.

Parameters:
id - the luxmate id of the sensor
Returns:
whether the sensor is faulty or not
 o turnedOn
 public void turnedOn(int id)
This method signals that the specified light has been turned on

Parameters:
id - the id of the light
 o turnedOff
 public void turnedOff(int id)
This method signals that the specified light has been turned off

Parameters:
id - the id of the light
 o lightError
 public void lightError(int id)
This method signals that a light error has occurred

Parameters:
id - the id of the specified light
 o lightRepaired
 public void lightRepaired(int id)
This method signals that a light has been repaired

Parameters:
id - the id of the light
 o sensorError
 public void sensorError(int id)
This method signals that a sensor error has occurred

Parameters:
id - the id of the sensor
 o sensorRepaired
 public void sensorRepaired(int id)
This method signals that a sensor has been repaired

Parameters:
id - the id of the sensor

All Packages  Class Hierarchy  This Package  Previous  Next  Index