eWON JTK

com.ewon.ewonitf
Class IOManager

java.lang.Object
  extended by com.ewon.ewonitf.IOManager

public class IOManager
extends Object

This static class provides all methods to interface the eWON IO management (Tags, led, button). The IO management concerns TAG management (tag values, historical logging alarms, ...) and IO servers.

This class also provides access to the user LED.

This class also provides access to the eWON front button.


Field Summary
static int COLOR_GREEN
          use with setUserLed(int) to set the led color to GREEN
static int COLOR_OFF
          use with setUserLed(int) to set the led color to OFF
static int COLOR_RED
          use with setUserLed(int) to set the led color to RED
 
Constructor Summary
IOManager()
           
 
Method Summary
static int getNbTags()
          Return the number of tags defined in the eWON
static void modemLedJvmCtrl(boolean JvmCtrl)
          This function is used to control if the PPP/Modem process must control the Modem led, or if the JAVA application does it.
static boolean readButton()
          Read the current status of the button.
static float readTag(String tagName)
          Read a tag with the given name and returns itf value.
static void setModemLed(int color)
          Control the color/status of the eWON Modem led.
static void setUserLed(int color)
          Control the color/status of the eWON user (status) led.
static void userLedJvmCtrl(boolean JvmCtrl)
          This function is used to control if the eart beat process must control the user led or not.
static void writeTag(String tagName, double tagValue)
          Write to tag passing a double.
static void writeTag(String tagName, float tagValue)
          Write a tag with the given name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLOR_OFF

public static final int COLOR_OFF
use with setUserLed(int) to set the led color to OFF

See Also:
Constant Field Values

COLOR_GREEN

public static final int COLOR_GREEN
use with setUserLed(int) to set the led color to GREEN

See Also:
Constant Field Values

COLOR_RED

public static final int COLOR_RED
use with setUserLed(int) to set the led color to RED

See Also:
Constant Field Values
Constructor Detail

IOManager

public IOManager()
Method Detail

setUserLed

public static void setUserLed(int color)
Control the color/status of the eWON user (status) led. This function operate directly on the led. There is an eart beart process that toggles the led regularly, if you want to take control of the led completely, then userLedJvmCtrl must be called with true, this means that the JVM has the contol of the led.

Parameters:
color - one of COLOR_OFF, COLOR_GREEN or COLOR_RED

setModemLed

public static void setModemLed(int color)
Control the color/status of the eWON Modem led. This function operate directly on the led. There is a PPP/Modem process that controls the led, if you want to take control of the led completely, then modemLedJvmCtrl must be called with true, this means that the JVM has the contol of the led.

Parameters:
color - one of COLOR_OFF, COLOR_GREEN

readButton

public static boolean readButton()
Read the current status of the button.

It is also possible to monitor the button changes using the DefaultEventHandler. The DefaultEventHandler has a function called setOnButtonListener to create a listener on the button state change.

Returns:
true if button is pressed.

userLedJvmCtrl

public static void userLedJvmCtrl(boolean JvmCtrl)
This function is used to control if the eart beat process must control the user led or not.

If JvmCtrl is true then the eart beat process does not toggle the led and the Jvm has the full control over the led (using the setUserLed) function.

Parameters:
JvmCtrl - false if eart beat controls the led. true if JVM controls the led.

modemLedJvmCtrl

public static void modemLedJvmCtrl(boolean JvmCtrl)
This function is used to control if the PPP/Modem process must control the Modem led, or if the JAVA application does it.

If JvmCtrl is true then the PPP/Modem process does not control the led and the Jvm has the full control over the led (using the setModemLed) function.
Once the function has been called, the eWON must be rebooted to release the led control.

Parameters:
JvmCtrl - false if PPP/Modem controls the led. true if JVM controls the led.

readTag

public static float readTag(String tagName)
Read a tag with the given name and returns itf value.

Parameters:
tagName - Tag Name
Returns:
Current tag value.

writeTag

public static void writeTag(String tagName,
                            float tagValue)
Write a tag with the given name.

Parameters:
tagName - Tag Name.
tagValue - Value to set tag.

getNbTags

public static int getNbTags()
Return the number of tags defined in the eWON

Returns:
Number of tags defines.

writeTag

public static void writeTag(String tagName,
                            double tagValue)
Write to tag passing a double. See also writeTag(String, float)

Parameters:
tagName - The tag name.
tagValue - Value to set.

eWON JTK

www.eWON.biz: Your Eyes Watching Over Net