agentland.device.led
Class AlphaLEDSignAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.ManagedAgent
|
+--agentland.device.led.AlphaLEDSignAgent
- All Implemented Interfaces:
- Agent, AlphaLEDSign, Good, Managed, MetagluePrimitives, Remote, Serializable, Spy, TextOutput
- public class AlphaLEDSignAgent
- extends ManagedAgent
- implements AlphaLEDSign
AlphaLEDSignAgent
controls the Alpha-brand LED signs.
The Alpha LED sign can display two lines of text.
Using this agent, you can send text information to either the top
line, the bottom line, or the middle (which treats both top and bottom
lines as one). The text can be formatted in different colors, sizes,
and fonts.
- See Also:
AlphaLEDColors
,
AlphaLEDFonts
,
ManagedAgent
,
AlphaLEDSign
, Serialized Form
Methods inherited from class agentland.resource.ManagedAgent |
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, yank, yank, yank |
Methods inherited from class agentland.util.GoodAgent |
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell |
Methods inherited from class metaglue.AgentAgent |
addMonitor, alive, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, lookupClass, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou |
Methods inherited from interface agentland.util.Spy |
tell |
AlphaLEDSignAgent
public AlphaLEDSignAgent()
throws RemoteException,
IOException,
javax.comm.PortInUseException,
javax.comm.NoSuchPortException
- Creates a new
AlphaLEDSignAgent
instance.
This uses the com port and machine specified as attributes.
The com port is configured to 2400-7-2-E.
- Throws:
RemoteException
- if an error occursIOException
- if an error occursjavax.comm.PortInUseException
- if an error occursjavax.comm.NoSuchPortException
- if an error occurs
outputText
public void outputText(TextObject tObj)
- Outputs a given text object onto the LED sign.
- Specified by:
outputText
in interface TextOutput
- Parameters:
tObj
- a TextObject
value
outputText
public void outputText(String sText)
outputText
displays a message across the entire sign.
see the LED Sign PDF document for information on each byte that is used.
- Specified by:
outputText
in interface AlphaLEDSign
- Parameters:
sText
- a String
value that contains the text to
be displayed on the sign.
outputText
public void outputText(String sText,
String sColor)
- Outputs text with a specific color to the LED sign.
- Specified by:
outputText
in interface AlphaLEDSign
- Parameters:
sText
- a String
valuesColor
- a String
value
outputText
public void outputText(String sText,
String sColor,
String sFont)
- Outputs text with a specific color and font to the LED sign.
- Specified by:
outputText
in interface AlphaLEDSign
- Parameters:
sText
- a String
valuesColor
- a String
valuesFont
- a String
value
outputTextBottom
public void outputTextBottom(String sText)
SignBottomOut
displays a message on the bottom line of the
sign. If the message is long, it will scroll
- Specified by:
outputTextBottom
in interface AlphaLEDSign
- Parameters:
stuff
- a String
value that contains the text to be
displayed on the bottom line
outputTextBottom
public void outputTextBottom(String sText,
String sColor)
- Outputs text with a specific color to the bottom row of the LED
- Specified by:
outputTextBottom
in interface AlphaLEDSign
- Parameters:
sText
- a String
valuesColor
- a String
value
outputTextTop
public void outputTextTop(String sText)
- Outputs text to the top line of the LED sign.
- Specified by:
outputTextTop
in interface AlphaLEDSign
- Parameters:
sText
- a String
value
outputTextTop
public void outputTextTop(String sText,
String sColor)
- Outputs text with a specified color to the top row of the LED
- Specified by:
outputTextTop
in interface AlphaLEDSign
- Parameters:
sText
- a String
valuesColor
- a String
value
outputTextBoth
public void outputTextBoth(String topText,
String botText)
- Send output to both lines at once. No color is provided here, so
colors should be set separately.
- Specified by:
outputTextBoth
in interface AlphaLEDSign
- Parameters:
topText
- a String
valuebotText
- a String
value
sendLinesToSign
protected void sendLinesToSign()
- Internal procedure to send current line data out to sign.
get
public String get()
- Gets the text on the LED.
- Specified by:
get
in interface AlphaLEDSign
- Returns:
- a
String
value
getTop
public String getTop()
- Gets the text on the top line of the LED.
- Specified by:
getTop
in interface AlphaLEDSign
- Returns:
- a
String
value
getBottom
public String getBottom()
- Gets the text on the bottom line of the LED.
- Specified by:
getBottom
in interface AlphaLEDSign
- Returns:
- a
String
value
clear
public void clear()
- Outputs a " " space character, essentially clearing the display.
- Specified by:
clear
in interface AlphaLEDSign
- Following copied from interface:
agentland.device.led.AlphaLEDSign
- Throws:
RemoteException
- if an error occurs
setColor
public void setColor(String sColor)
- Sets the color of future text on the display.
The valid colors are auto, red, green, amber, dimred, dimgreen,
brown, orange, yellow, rainbow1, rainbow2, or mix.
If an invalid color is given, the color will be set to auto
- Specified by:
setColor
in interface AlphaLEDSign
- Parameters:
sColor
- a String
value
setColor
public void setColor(int iColor)
- Sets the color of future text on the display.
The valid colors are
AlphaLEDColors.AUTO
AlphaLEDColors.RED
AlphaLEDColors.GREEN
AlphaLEDColors.AMBER
AlphaLEDColors.DIMRED
AlphaLEDColors.DIMGREEN
AlphaLEDColors.BROWN
AlphaLEDColors.ORANGE
AlphaLEDColors.YELLOW
AlphaLEDColors.RAINBOW1
AlphaLEDColors.RAINBOW2
AlphaLEDColors.MIX
If an invalid color is given, the color will be set to
AlphaLEDColors.AUTO
- Specified by:
setColor
in interface AlphaLEDSign
- Parameters:
iColor
- an int
value
setColorTop
public void setColorTop(String sColor)
- Sets the color of the top row. The bottom row is unaffected.
- Specified by:
setColorTop
in interface AlphaLEDSign
- Parameters:
sColor
- a String
value
setColorBottom
public void setColorBottom(String sColor)
- Sets the color of the bottom row. The top row is unaffected.
- Specified by:
setColorBottom
in interface AlphaLEDSign
- Parameters:
sColor
- a String
value
setFont
public void setFont(String sFont)
- Sets the font of future text.
The font can be:
small
medium
mediumbold
large
huge
hugebold
- Specified by:
setFont
in interface AlphaLEDSign
- Parameters:
sFont
- a String
value
setFont
public void setFont(int iFont)
- Sets the font of future text.
The font can be:
AlphaLEDSign.SMALL
AlphaLEDSign.MEDIUM
AlphaLEDSign.MEDIUMBOLD
AlphaLEDSign.LARGE
AlphaLEDSign.HUGE
AlphaLEDSign.HUGEBOLD
- Specified by:
setFont
in interface AlphaLEDSign
- Parameters:
iFont
- an int
value
testOutputText
public boolean testOutputText()
- Tests if we are able to output text to the sign
- Specified by:
testOutputText
in interface AlphaLEDSign
- Returns:
- a
boolean
value
signTest
public boolean signTest()
SignTest
asks the sign what is in Text file A. If the
sign is connected it will respond and the method will return true.
If the sign does not respond with anything, it will return false.
- Specified by:
signTest
in interface AlphaLEDSign
- Returns:
- a
boolean
value - True = sign responded, False =
sign did not respond