public class YDisplay extends YFunction
Modifier and Type | Class and Description |
---|---|
static interface |
YDisplay.TimedReportCallback
TimedReportCallback for Display
|
static interface |
YDisplay.UpdateCallback
Deprecated UpdateCallback for Display
|
Modifier and Type | Field and Description |
---|---|
protected int |
_brightness |
protected String |
_command |
protected int |
_displayHeight |
protected int |
_displayType |
protected int |
_displayWidth |
protected int |
_enabled |
protected int |
_layerCount |
protected int |
_layerHeight |
protected int |
_layerWidth |
protected int |
_orientation |
protected String |
_startupSeq |
protected YDisplay.UpdateCallback |
_valueCallbackDisplay |
static int |
BRIGHTNESS_INVALID
invalid brightness value
|
static String |
COMMAND_INVALID
invalid command value
|
static int |
DISPLAYHEIGHT_INVALID
invalid displayHeight value
|
static int |
DISPLAYTYPE_GRAY |
static int |
DISPLAYTYPE_INVALID |
static int |
DISPLAYTYPE_MONO
invalid displayType value
|
static int |
DISPLAYTYPE_RGB |
static int |
DISPLAYWIDTH_INVALID
invalid displayWidth value
|
static int |
ENABLED_FALSE
invalid enabled value
|
static int |
ENABLED_INVALID |
static int |
ENABLED_TRUE |
static int |
LAYERCOUNT_INVALID
invalid layerCount value
|
static int |
LAYERHEIGHT_INVALID
invalid layerHeight value
|
static int |
LAYERWIDTH_INVALID
invalid layerWidth value
|
static int |
ORIENTATION_DOWN |
static int |
ORIENTATION_INVALID |
static int |
ORIENTATION_LEFT
invalid orientation value
|
static int |
ORIENTATION_RIGHT |
static int |
ORIENTATION_UP |
static String |
STARTUPSEQ_INVALID
invalid startupSeq value
|
_advertisedValue, _cacheExpiration, _className, _dataStreams, _func, _funId, _hwId, _lastErrorMsg, _lastErrorType, _logicalName, _serial, _userData, _valueCallbackFunction, ADVERTISEDVALUE_INVALID, FUNCTIONDESCRIPTOR_INVALID, LOGICALNAME_INVALID
Modifier | Constructor and Description |
---|---|
protected |
YDisplay(String func) |
Modifier and Type | Method and Description |
---|---|
int |
_invokeValueCallback(String value) |
protected void |
_parseAttr(org.json.JSONObject json_val) |
int |
copyLayerContent(int srcLayerId,
int dstLayerId)
Copies the whole content of a layer to another layer.
|
int |
fade(int brightness,
int duration)
Smoothly changes the brightness of the screen to produce a fade-in or fade-out
effect.
|
static YDisplay |
FindDisplay(String func)
Retrieves a display for a given identifier.
|
static YDisplay |
FirstDisplay()
Starts the enumeration of displays currently accessible.
|
int |
flushLayers() |
int |
get_brightness()
Returns the luminosity of the module informative leds (from 0 to 100).
|
String |
get_command() |
int |
get_displayHeight()
Returns the display height, in pixels.
|
YDisplayLayer |
get_displayLayer(int layerId)
Returns a YDisplayLayer object that can be used to draw on the specified
layer.
|
int |
get_displayType()
Returns the display type: monochrome, gray levels or full color.
|
int |
get_displayWidth()
Returns the display width, in pixels.
|
int |
get_enabled()
Returns true if the screen is powered, false otherwise.
|
int |
get_layerCount()
Returns the number of available layers to draw on.
|
int |
get_layerHeight()
Returns the height of the layers to draw on, in pixels.
|
int |
get_layerWidth()
Returns the width of the layers to draw on, in pixels.
|
int |
get_orientation()
Returns the currently selected display orientation.
|
String |
get_startupSeq()
Returns the name of the sequence to play when the displayed is powered on.
|
int |
getBrightness()
Returns the luminosity of the module informative leds (from 0 to 100).
|
String |
getCommand() |
int |
getDisplayHeight()
Returns the display height, in pixels.
|
int |
getDisplayType()
Returns the display type: monochrome, gray levels or full color.
|
int |
getDisplayWidth()
Returns the display width, in pixels.
|
int |
getEnabled()
Returns true if the screen is powered, false otherwise.
|
int |
getLayerCount()
Returns the number of available layers to draw on.
|
int |
getLayerHeight()
Returns the height of the layers to draw on, in pixels.
|
int |
getLayerWidth()
Returns the width of the layers to draw on, in pixels.
|
int |
getOrientation()
Returns the currently selected display orientation.
|
String |
getStartupSeq()
Returns the name of the sequence to play when the displayed is powered on.
|
int |
newSequence()
Starts to record all display commands into a sequence, for later replay.
|
YDisplay |
nextDisplay()
Continues the enumeration of displays started using yFirstDisplay().
|
int |
pauseSequence(int delay_ms)
Waits for a specified delay (in milliseconds) before playing next
commands in current sequence.
|
int |
playSequence(String sequenceName)
Replays a display sequence previously recorded using
newSequence() and saveSequence().
|
int |
registerValueCallback(YDisplay.UpdateCallback callback)
Registers the callback function that is invoked on every change of advertised value.
|
int |
resetAll()
Clears the display screen and resets all display layers to their default state.
|
void |
resetHiddenLayerFlags() |
int |
saveSequence(String sequenceName)
Stops recording display commands and saves the sequence into the specified
file on the display internal memory.
|
int |
sendCommand(String cmd) |
int |
set_brightness(int newval)
Changes the brightness of the display.
|
int |
set_command(String newval) |
int |
set_enabled(int newval)
Changes the power state of the display.
|
int |
set_orientation(int newval)
Changes the display orientation.
|
int |
set_startupSeq(String newval)
Changes the name of the sequence to play when the displayed is powered on.
|
int |
setBrightness(int newval)
Changes the brightness of the display.
|
int |
setCommand(String newval) |
int |
setEnabled(int newval)
Changes the power state of the display.
|
int |
setOrientation(int newval)
Changes the display orientation.
|
int |
setStartupSeq(String newval)
Changes the name of the sequence to play when the displayed is powered on.
|
int |
stopSequence()
Stops immediately any ongoing sequence replay.
|
int |
swapLayerContent(int layerIdA,
int layerIdB)
Swaps the whole content of two layers.
|
int |
upload(String pathname,
byte[] content)
Uploads an arbitrary file (for instance a GIF file) to the display, to the
specified full path name.
|
_AddToCache, _clearDataStreamCache, _devRequest, _download, _escapeAttr, _FindFromCache, _get_json_path_struct, _get_json_path, _json_get_array, _json_get_key, _json_get_string, _parse, _parserHelper, _setAttr, _throw, _UpdateTimedReportCallbackList, _UpdateValueCallbackList, _upload, _upload, clearCache, describe, errMessage, errorMessage, errorType, errType, FindFunction, FirstFunction, functionDescriptor, get_advertisedValue, get_errorMessage, get_errorType, get_friendlyName, get_functionDescriptor, get_functionId, get_hardwareId, get_logicalName, get_module, get_userData, getAdvertisedValue, getErrorMessage, getErrorType, getFriendlyName, getFunctionDescriptor, getFunctionId, getHardwareId, getLogicalName, getModule, getUserData, isOnline, load, module, nextFunction, registerValueCallback, set_logicalName, set_userData, setLogicalName, setUserData, toString, userData
public static final int ENABLED_FALSE
public static final int ENABLED_TRUE
public static final int ENABLED_INVALID
public static final String STARTUPSEQ_INVALID
public static final int BRIGHTNESS_INVALID
public static final int ORIENTATION_LEFT
public static final int ORIENTATION_UP
public static final int ORIENTATION_RIGHT
public static final int ORIENTATION_DOWN
public static final int ORIENTATION_INVALID
public static final int DISPLAYWIDTH_INVALID
public static final int DISPLAYHEIGHT_INVALID
public static final int DISPLAYTYPE_MONO
public static final int DISPLAYTYPE_GRAY
public static final int DISPLAYTYPE_RGB
public static final int DISPLAYTYPE_INVALID
public static final int LAYERWIDTH_INVALID
public static final int LAYERHEIGHT_INVALID
public static final int LAYERCOUNT_INVALID
public static final String COMMAND_INVALID
protected int _enabled
protected String _startupSeq
protected int _brightness
protected int _orientation
protected int _displayWidth
protected int _displayHeight
protected int _displayType
protected int _layerWidth
protected int _layerHeight
protected int _layerCount
protected String _command
protected YDisplay.UpdateCallback _valueCallbackDisplay
protected YDisplay(String func)
func
- : functionidprotected void _parseAttr(org.json.JSONObject json_val) throws org.json.JSONException
_parseAttr
in class YFunction
org.json.JSONException
public int get_enabled() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getEnabled() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_enabled(int newval) throws YAPI_Exception
newval
- : either YDisplay.ENABLED_FALSE or YDisplay.ENABLED_TRUE, according to the power
state of the displayYAPI_Exception
- on errorpublic int setEnabled(int newval) throws YAPI_Exception
newval
- : either Y_ENABLED_FALSE or Y_ENABLED_TRUE, according to the power state of the displayYAPI_Exception
- on errorpublic String get_startupSeq() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getStartupSeq() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_startupSeq(String newval) throws YAPI_Exception
newval
- : a string corresponding to the name of the sequence to play when the displayed is powered onYAPI_Exception
- on errorpublic int setStartupSeq(String newval) throws YAPI_Exception
newval
- : a string corresponding to the name of the sequence to play when the displayed is powered onYAPI_Exception
- on errorpublic int get_brightness() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getBrightness() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_brightness(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the brightness of the displayYAPI_Exception
- on errorpublic int setBrightness(int newval) throws YAPI_Exception
newval
- : an integer corresponding to the brightness of the displayYAPI_Exception
- on errorpublic int get_orientation() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getOrientation() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_orientation(int newval) throws YAPI_Exception
newval
- : a value among YDisplay.ORIENTATION_LEFT, YDisplay.ORIENTATION_UP,
YDisplay.ORIENTATION_RIGHT and YDisplay.ORIENTATION_DOWN corresponding to the display orientationYAPI_Exception
- on errorpublic int setOrientation(int newval) throws YAPI_Exception
newval
- : a value among Y_ORIENTATION_LEFT, Y_ORIENTATION_UP, Y_ORIENTATION_RIGHT and
Y_ORIENTATION_DOWN corresponding to the display orientationYAPI_Exception
- on errorpublic int get_displayWidth() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getDisplayWidth() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_displayHeight() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getDisplayHeight() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_displayType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getDisplayType() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_layerWidth() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLayerWidth() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_layerHeight() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLayerHeight() throws YAPI_Exception
YAPI_Exception
- on errorpublic int get_layerCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic int getLayerCount() throws YAPI_Exception
YAPI_Exception
- on errorpublic String get_command() throws YAPI_Exception
YAPI_Exception
- on errorpublic String getCommand() throws YAPI_Exception
YAPI_Exception
- on errorpublic int set_command(String newval) throws YAPI_Exception
YAPI_Exception
public int setCommand(String newval) throws YAPI_Exception
YAPI_Exception
public static YDisplay FindDisplay(String func)
func
- : a string that uniquely characterizes the displaypublic int registerValueCallback(YDisplay.UpdateCallback callback)
callback
- : the callback function to call, or a null pointer. The callback function should take two
arguments: the function object of which the value has changed, and the character string describing
the new advertised value.public int _invokeValueCallback(String value)
_invokeValueCallback
in class YFunction
public int resetAll() throws YAPI_Exception
YAPI_Exception
- on errorpublic int fade(int brightness, int duration) throws YAPI_Exception
brightness
- : the new screen brightnessduration
- : duration of the brightness transition, in milliseconds.YAPI_Exception
- on errorpublic int newSequence() throws YAPI_Exception
YAPI_Exception
- on errorpublic int saveSequence(String sequenceName) throws YAPI_Exception
sequenceName
- : the name of the newly created sequenceYAPI_Exception
- on errorpublic int playSequence(String sequenceName) throws YAPI_Exception
sequenceName
- : the name of the newly created sequenceYAPI_Exception
- on errorpublic int pauseSequence(int delay_ms) throws YAPI_Exception
delay_ms
- : the duration to wait, in millisecondsYAPI_Exception
- on errorpublic int stopSequence() throws YAPI_Exception
YAPI_Exception
- on errorpublic int upload(String pathname, byte[] content) throws YAPI_Exception
pathname
- : path and name of the new file to createcontent
- : binary buffer with the content to setYAPI_Exception
- on errorpublic int copyLayerContent(int srcLayerId, int dstLayerId) throws YAPI_Exception
srcLayerId
- : the identifier of the source layer (a number in range 0..layerCount-1)dstLayerId
- : the identifier of the destination layer (a number in range 0..layerCount-1)YAPI_Exception
- on errorpublic int swapLayerContent(int layerIdA, int layerIdB) throws YAPI_Exception
layerIdA
- : the first layer (a number in range 0..layerCount-1)layerIdB
- : the second layer (a number in range 0..layerCount-1)YAPI_Exception
- on errorpublic YDisplay nextDisplay()
public static YDisplay FirstDisplay()
public YDisplayLayer get_displayLayer(int layerId) throws YAPI_Exception
layerId
- : the identifier of the layer (a number in range 0..layerCount-1)YAPI_Exception
- on errorpublic int flushLayers() throws YAPI_Exception
YAPI_Exception
public void resetHiddenLayerFlags() throws YAPI_Exception
YAPI_Exception
public int sendCommand(String cmd) throws YAPI_Exception
YAPI_Exception
Copyright © 2015. All rights reserved.