Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
YDisplay Class Reference

#include <yocto_display.h>

Inheritance diagram for YDisplay:
Inheritance graph
[legend]

Public Member Functions

virtual int _invokeValueCallback (string value)
 
int brightness (void)
 
string command (void)
 
virtual int copyLayerContent (int srcLayerId, int dstLayerId)
 
int displayHeight (void)
 
Y_DISPLAYTYPE_enum displayType (void)
 
int displayWidth (void)
 
Y_ENABLED_enum enabled (void)
 
virtual int fade (int brightness, int duration)
 
int flushLayers (void)
 
int get_brightness (void)
 
string get_command (void)
 
int get_displayHeight (void)
 
YDisplayLayerget_displayLayer (unsigned layerId)
 
Y_DISPLAYTYPE_enum get_displayType (void)
 
int get_displayWidth (void)
 
Y_ENABLED_enum get_enabled (void)
 
int get_layerCount (void)
 
int get_layerHeight (void)
 
int get_layerWidth (void)
 
Y_ORIENTATION_enum get_orientation (void)
 
string get_startupSeq (void)
 
int layerCount (void)
 
int layerHeight (void)
 
int layerWidth (void)
 
virtual int newSequence (void)
 
YDisplaynext (void)
 
YDisplaynextDisplay (void)
 
Y_ORIENTATION_enum orientation (void)
 
virtual int pauseSequence (int delay_ms)
 
virtual int playSequence (string sequenceName)
 
virtual int registerValueCallback (YDisplayValueCallback callback)
 
virtual int resetAll (void)
 
void resetHiddenLayerFlags (void)
 
virtual int saveSequence (string sequenceName)
 
int sendCommand (string cmd)
 
int set_brightness (int newval)
 
int set_command (const string &newval)
 
int set_enabled (Y_ENABLED_enum newval)
 
int set_orientation (Y_ORIENTATION_enum newval)
 
int set_startupSeq (const string &newval)
 
int setBrightness (int newval)
 
int setCommand (const string &newval)
 
int setEnabled (Y_ENABLED_enum newval)
 
int setOrientation (Y_ORIENTATION_enum newval)
 
int setStartupSeq (const string &newval)
 
string startupSeq (void)
 
virtual int stopSequence (void)
 
virtual int swapLayerContent (int layerIdA, int layerIdB)
 
virtual int upload (string pathname, string content)
 
 ~YDisplay ()
 
- Public Member Functions inherited from YFunction
void _clearDataStreamCache ()
 
string _decode_json_string (const string &json)
 
string _download (const string &url)
 
YDataStream_findDataStream (YDataSet &dataset, const string &def)
 
string _get_json_path (const string &json, const string &path)
 
vector< string > _json_get_array (const string &json)
 
string _json_get_key (const string &json, const string &data)
 
string _json_get_string (const string &json)
 
int _parseEx (yJsonStateMachine &j)
 
virtual int _parserHelper (void)
 
string _parseString (yJsonStateMachine &j)
 
string _request (const string &request)
 
string _requestEx (int tcpchan, const string &request, yapiRequestProgressCallback callback, void *context)
 
void _throw (YRETCODE errType, string errMsg)
 
YRETCODE _upload (const string &path, const string &content)
 
YRETCODE _uploadWithProgress (const string &path, const string &content, yapiRequestProgressCallback callback, void *context)
 
string advertisedValue (void)
 
void clearCache ()
 
string describe (void)
 
string errMessage (void)
 
string errorMessage (void)
 
YRETCODE errorType (void)
 
YRETCODE errType (void)
 
YFUN_DESCR functionDescriptor (void)
 
string get_advertisedValue (void)
 
string get_errorMessage (void)
 
YRETCODE get_errorType (void)
 
virtual string get_friendlyName (void)
 
YFUN_DESCR get_functionDescriptor (void)
 
string get_functionId (void)
 
string get_hardwareId (void)
 
string get_hubSerial ()
 
string get_logicalName (void)
 
YModuleget_module (void)
 
void * get_userData (void)
 
bool isOnline (void)
 
YRETCODE load (int msValidity)
 
virtual string loadAttribute (string attrName)
 
string logicalName (void)
 
YModulemodule (void)
 
virtual int muteValueCallbacks (void)
 
YFunctionnext (void)
 
YFunctionnextFunction (void)
 
virtual int registerValueCallback (YFunctionValueCallback callback)
 
int set_advertisedValue (const string &newval)
 
int set_logicalName (const string &newval)
 
void set_userData (void *data)
 
int setAdvertisedValue (const string &newval)
 
int setLogicalName (const string &newval)
 
void setUserData (void *data)
 
virtual int unmuteValueCallbacks (void)
 
void * userData (void)
 
virtual ~YFunction ()
 

Static Public Member Functions

static YDisplayFind (string func)
 
static YDisplayFindDisplay (string func)
 
static YDisplayFirst (void)
 
static YDisplayFirstDisplay (void)
 
- Static Public Member Functions inherited from YFunction
static void _ClearCache (void)
 
static YFunctionFind (string func)
 
static YFunctionFindFunction (string func)
 
static YFunctionFirst (void)
 
static YFunctionFirstFunction (void)
 

Static Public Attributes

static const int BRIGHTNESS_INVALID = YAPI_INVALID_UINT
 
static const string COMMAND_INVALID = YAPI_INVALID_STRING
 
static const int DISPLAYHEIGHT_INVALID = YAPI_INVALID_UINT
 
static const Y_DISPLAYTYPE_enum DISPLAYTYPE_GRAY = Y_DISPLAYTYPE_GRAY
 
static const Y_DISPLAYTYPE_enum DISPLAYTYPE_INVALID = Y_DISPLAYTYPE_INVALID
 
static const Y_DISPLAYTYPE_enum DISPLAYTYPE_MONO = Y_DISPLAYTYPE_MONO
 
static const Y_DISPLAYTYPE_enum DISPLAYTYPE_RGB = Y_DISPLAYTYPE_RGB
 
static const int DISPLAYWIDTH_INVALID = YAPI_INVALID_UINT
 
static const Y_ENABLED_enum ENABLED_FALSE = Y_ENABLED_FALSE
 
static const Y_ENABLED_enum ENABLED_INVALID = Y_ENABLED_INVALID
 
static const Y_ENABLED_enum ENABLED_TRUE = Y_ENABLED_TRUE
 
static const int LAYERCOUNT_INVALID = YAPI_INVALID_UINT
 
static const int LAYERHEIGHT_INVALID = YAPI_INVALID_UINT
 
static const int LAYERWIDTH_INVALID = YAPI_INVALID_UINT
 
static const Y_ORIENTATION_enum ORIENTATION_DOWN = Y_ORIENTATION_DOWN
 
static const Y_ORIENTATION_enum ORIENTATION_INVALID = Y_ORIENTATION_INVALID
 
static const Y_ORIENTATION_enum ORIENTATION_LEFT = Y_ORIENTATION_LEFT
 
static const Y_ORIENTATION_enum ORIENTATION_RIGHT = Y_ORIENTATION_RIGHT
 
static const Y_ORIENTATION_enum ORIENTATION_UP = Y_ORIENTATION_UP
 
static const string STARTUPSEQ_INVALID = YAPI_INVALID_STRING
 
- Static Public Attributes inherited from YFunction
static const string ADVERTISEDVALUE_INVALID = YAPI_INVALID_STRING
 
static const string FRIENDLYNAME_INVALID = YAPI_INVALID_STRING
 
static const YFUN_DESCR FUNCTIONDESCRIPTOR_INVALID = Y_FUNCTIONDESCRIPTOR_INVALID
 
static const string FUNCTIONID_INVALID = YAPI_INVALID_STRING
 
static const string HARDWAREID_INVALID = YAPI_INVALID_STRING
 
static const string LOGICALNAME_INVALID = YAPI_INVALID_STRING
 

Private Member Functions

virtual int _parseAttr (YJSONObject *json_val)
 
 YDisplay (const string &func)
 

Private Attributes

vector< YDisplayLayer * > _allDisplayLayers
 
int _brightness
 
string _command
 
int _displayHeight
 
Y_DISPLAYTYPE_enum _displayType
 
int _displayWidth
 
Y_ENABLED_enum _enabled
 
int _layerCount
 
int _layerHeight
 
int _layerWidth
 
Y_ORIENTATION_enum _orientation
 
bool _recording
 
string _sequence
 
string _startupSeq
 
YDisplayValueCallback _valueCallbackDisplay
 

Friends

YDisplayyFindDisplay (const string &func)
 
YDisplayyFirstDisplay (void)
 

Additional Inherited Members

- Protected Member Functions inherited from YFunction
YRETCODE _buildSetRequest (const string &changeattr, const string *changeval, string &request, string &errmsg)
 
string _escapeAttr (const string &changeval)
 
YRETCODE _getDescriptor (YFUN_DESCR &fundescr, string &errMsg)
 
YRETCODE _getDevice (YDevice *&dev, string &errMsg)
 
YRETCODE _load_unsafe (int msValidity)
 
YRETCODE _nextFunction (string &hwId)
 
int _parse (YJSONObject *j)
 
YRETCODE _setAttr (string attrname, string newvalue)
 
 YFunction (const string &func)
 
- Static Protected Member Functions inherited from YFunction
static void _AddToCache (const string &classname, const string &func, YFunction *obj)
 
static YFunction_FindFromCache (const string &classname, const string &func)
 
static void _UpdateTimedReportCallbackList (YFunction *func, bool add)
 
static void _UpdateValueCallbackList (YFunction *func, bool add)
 
- Protected Attributes inherited from YFunction
string _advertisedValue
 
u64 _cacheExpiration
 
string _className
 
std::map< string, YDataStream * > _dataStreams
 
string _func
 
YFUN_DESCR _fundescr
 
string _funId
 
string _hwId
 
string _lastErrorMsg
 
YRETCODE _lastErrorType
 
string _logicalName
 
string _serial
 
yCRITICAL_SECTION _this_cs
 
void * _userData
 
YFunctionValueCallback _valueCallbackFunction
 
- Static Protected Attributes inherited from YFunction
static std::map< string, YFunction * > _cache
 

Detailed Description

YDisplay Class: Display function interface

Yoctopuce display interface has been designed to easily show information and images. The device provides built-in multi-layer rendering. Layers can be drawn offline, individually, and freely moved on the display. It can also replay recorded sequences (animations).

Definition at line 586 of file yocto_display.h.

Constructor & Destructor Documentation

YDisplay::YDisplay ( const string &  func)
private

Definition at line 607 of file yocto_display.cpp.

YDisplay::~YDisplay ( )

Definition at line 629 of file yocto_display.cpp.

Member Function Documentation

int YDisplay::_invokeValueCallback ( string  value)
virtual

Reimplemented from YFunction.

Definition at line 1199 of file yocto_display.cpp.

int YDisplay::_parseAttr ( YJSONObject json_val)
privatevirtual

Reimplemented from YFunction.

Definition at line 646 of file yocto_display.cpp.

int YDisplay::brightness ( void  )
inline

Definition at line 708 of file yocto_display.h.

string YDisplay::command ( void  )
inline

Definition at line 829 of file yocto_display.h.

int YDisplay::copyLayerContent ( int  srcLayerId,
int  dstLayerId 
)
virtual

Copies the whole content of a layer to another layer. The color and transparency of all the pixels from the destination layer are set to match the source pixels. This method only affects the displayed content, but does not change any property of the layer object. Note that layer 0 has no transparency support (it is always completely opaque).

Parameters
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)
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1361 of file yocto_display.cpp.

int YDisplay::displayHeight ( void  )
inline

Definition at line 775 of file yocto_display.h.

Y_DISPLAYTYPE_enum YDisplay::displayType ( void  )
inline

Definition at line 788 of file yocto_display.h.

int YDisplay::displayWidth ( void  )
inline

Definition at line 763 of file yocto_display.h.

Y_ENABLED_enum YDisplay::enabled ( void  )
inline

Definition at line 656 of file yocto_display.h.

int YDisplay::fade ( int  brightness,
int  duration 
)
virtual

Smoothly changes the brightness of the screen to produce a fade-in or fade-out effect.

Parameters
brightness: the new screen brightness
duration: duration of the brightness transition, in milliseconds.
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1236 of file yocto_display.cpp.

static YDisplay* YDisplay::Find ( string  func)
inlinestatic

Definition at line 1015 of file yocto_display.h.

YDisplay * YDisplay::FindDisplay ( string  func)
static

Retrieves a display for a given identifier. The identifier can be specified using several formats:

  • FunctionLogicalName
  • ModuleSerialNumber.FunctionIdentifier
  • ModuleSerialNumber.FunctionLogicalName
  • ModuleLogicalName.FunctionIdentifier
  • ModuleLogicalName.FunctionLogicalName

This function does not require that the display is online at the time it is invoked. The returned object is nevertheless valid. Use the method YDisplay.isOnline() to test if the display is indeed online at a given time. In case of ambiguity when looking for a display by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

Parameters
func: a string that uniquely characterizes the display
Returns
a YDisplay object allowing you to drive the display.

Definition at line 1148 of file yocto_display.cpp.

static YDisplay* YDisplay::First ( void  )
inlinestatic

Definition at line 1039 of file yocto_display.h.

YDisplay * YDisplay::FirstDisplay ( void  )
static

Starts the enumeration of displays currently accessible. Use the method YDisplay.nextDisplay() to iterate on next displays.

Returns
a pointer to a YDisplay object, corresponding to the first display currently online, or a NULL pointer if there are none.

Definition at line 1398 of file yocto_display.cpp.

int YDisplay::flushLayers ( void  )

Definition at line 1431 of file yocto_display.cpp.

int YDisplay::get_brightness ( void  )

Returns the luminosity of the module informative leds (from 0 to 100).

Returns
an integer corresponding to the luminosity of the module informative leds (from 0 to 100)

On failure, throws an exception or returns Y_BRIGHTNESS_INVALID.

Definition at line 802 of file yocto_display.cpp.

string YDisplay::get_command ( void  )

Definition at line 1083 of file yocto_display.cpp.

int YDisplay::get_displayHeight ( void  )

Returns the display height, in pixels.

Returns
an integer corresponding to the display height, in pixels

On failure, throws an exception or returns Y_DISPLAYHEIGHT_INVALID.

Definition at line 944 of file yocto_display.cpp.

YDisplayLayer * YDisplay::get_displayLayer ( unsigned  layerId)

Returns a YDisplayLayer object that can be used to draw on the specified layer. The content is displayed only when the layer is active on the screen (and not masked by other overlapping layers).

Parameters
layerId: the identifier of the layer (a number in range 0..layerCount-1)
Returns
an YDisplayLayer object

On failure, throws an exception or returns NULL.

Definition at line 1415 of file yocto_display.cpp.

Y_DISPLAYTYPE_enum YDisplay::get_displayType ( void  )

Returns the display type: monochrome, gray levels or full color.

Returns
a value among Y_DISPLAYTYPE_MONO, Y_DISPLAYTYPE_GRAY and Y_DISPLAYTYPE_RGB corresponding to the display type: monochrome, gray levels or full color

On failure, throws an exception or returns Y_DISPLAYTYPE_INVALID.

Definition at line 974 of file yocto_display.cpp.

int YDisplay::get_displayWidth ( void  )

Returns the display width, in pixels.

Returns
an integer corresponding to the display width, in pixels

On failure, throws an exception or returns Y_DISPLAYWIDTH_INVALID.

Definition at line 915 of file yocto_display.cpp.

Y_ENABLED_enum YDisplay::get_enabled ( void  )

Returns true if the screen is powered, false otherwise.

Returns
either Y_ENABLED_FALSE or Y_ENABLED_TRUE, according to true if the screen is powered, false otherwise

On failure, throws an exception or returns Y_ENABLED_INVALID.

Definition at line 692 of file yocto_display.cpp.

int YDisplay::get_layerCount ( void  )

Returns the number of available layers to draw on.

Returns
an integer corresponding to the number of available layers to draw on

On failure, throws an exception or returns Y_LAYERCOUNT_INVALID.

Definition at line 1061 of file yocto_display.cpp.

int YDisplay::get_layerHeight ( void  )

Returns the height of the layers to draw on, in pixels.

Returns
an integer corresponding to the height of the layers to draw on, in pixels

On failure, throws an exception or returns Y_LAYERHEIGHT_INVALID.

Definition at line 1032 of file yocto_display.cpp.

int YDisplay::get_layerWidth ( void  )

Returns the width of the layers to draw on, in pixels.

Returns
an integer corresponding to the width of the layers to draw on, in pixels

On failure, throws an exception or returns Y_LAYERWIDTH_INVALID.

Definition at line 1003 of file yocto_display.cpp.

Y_ORIENTATION_enum YDisplay::get_orientation ( void  )

Returns the currently selected display orientation.

Returns
a value among Y_ORIENTATION_LEFT, Y_ORIENTATION_UP, Y_ORIENTATION_RIGHT and Y_ORIENTATION_DOWN corresponding to the currently selected display orientation

On failure, throws an exception or returns Y_ORIENTATION_INVALID.

Definition at line 859 of file yocto_display.cpp.

string YDisplay::get_startupSeq ( void  )

Returns the name of the sequence to play when the displayed is powered on.

Returns
a string corresponding to the name of the sequence to play when the displayed is powered on

On failure, throws an exception or returns Y_STARTUPSEQ_INVALID.

Definition at line 746 of file yocto_display.cpp.

int YDisplay::layerCount ( void  )
inline

Definition at line 824 of file yocto_display.h.

int YDisplay::layerHeight ( void  )
inline

Definition at line 812 of file yocto_display.h.

int YDisplay::layerWidth ( void  )
inline

Definition at line 800 of file yocto_display.h.

int YDisplay::newSequence ( void  )
virtual

Starts to record all display commands into a sequence, for later replay. The name used to store the sequence is specified when calling saveSequence(), once the recording is complete.

Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1251 of file yocto_display.cpp.

YDisplay* YDisplay::next ( void  )
inline

Definition at line 1026 of file yocto_display.h.

YDisplay * YDisplay::nextDisplay ( void  )

Continues the enumeration of displays started using yFirstDisplay().

Returns
a pointer to a YDisplay object, corresponding to a display currently online, or a NULL pointer if there are no more displays to enumerate.

Definition at line 1388 of file yocto_display.cpp.

Y_ORIENTATION_enum YDisplay::orientation ( void  )
inline

Definition at line 736 of file yocto_display.h.

int YDisplay::pauseSequence ( int  delay_ms)
virtual

Waits for a specified delay (in milliseconds) before playing next commands in current sequence. This method can be used while recording a display sequence, to insert a timed wait in the sequence (without any immediate effect). It can also be used dynamically while playing a pre-recorded sequence, to suspend or resume the execution of the sequence. To cancel a delay, call the same method with a zero delay.

Parameters
delay_ms: the duration to wait, in milliseconds
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1310 of file yocto_display.cpp.

int YDisplay::playSequence ( string  sequenceName)
virtual

Replays a display sequence previously recorded using newSequence() and saveSequence().

Parameters
sequenceName: the name of the newly created sequence
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1290 of file yocto_display.cpp.

int YDisplay::registerValueCallback ( YDisplayValueCallback  callback)
virtual

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of ySleep or yHandleEvents. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a NULL pointer as argument.

Parameters
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.

Definition at line 1180 of file yocto_display.cpp.

int YDisplay::resetAll ( void  )
virtual

Clears the display screen and resets all display layers to their default state. Using this function in a sequence will kill the sequence play-back. Don't use that function to reset the display at sequence start-up.

Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1218 of file yocto_display.cpp.

void YDisplay::resetHiddenLayerFlags ( void  )

Definition at line 1440 of file yocto_display.cpp.

int YDisplay::saveSequence ( string  sequenceName)
virtual

Stops recording display commands and saves the sequence into the specified file on the display internal memory. The sequence can be later replayed using playSequence().

Parameters
sequenceName: the name of the newly created sequence
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1270 of file yocto_display.cpp.

int YDisplay::sendCommand ( string  cmd)

Definition at line 1447 of file yocto_display.cpp.

int YDisplay::set_brightness ( int  newval)

Changes the brightness of the display. The parameter is a value between 0 and

  1. Remember to call the saveToFlash() method of the module if the modification must be kept.
Parameters
newval: an integer corresponding to the brightness of the display
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 835 of file yocto_display.cpp.

int YDisplay::set_command ( const string &  newval)

Definition at line 1105 of file yocto_display.cpp.

int YDisplay::set_enabled ( Y_ENABLED_enum  newval)

Changes the power state of the display.

Parameters
newval: either Y_ENABLED_FALSE or Y_ENABLED_TRUE, according to the power state of the display
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 723 of file yocto_display.cpp.

int YDisplay::set_orientation ( Y_ORIENTATION_enum  newval)

Changes the display orientation. Remember to call the saveToFlash() method of the module if the modification must be kept.

Parameters
newval: a value among Y_ORIENTATION_LEFT, Y_ORIENTATION_UP, Y_ORIENTATION_RIGHT and Y_ORIENTATION_DOWN corresponding to the display orientation
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 892 of file yocto_display.cpp.

int YDisplay::set_startupSeq ( const string &  newval)

Changes the name of the sequence to play when the displayed is powered on. Remember to call the saveToFlash() method of the module if the modification must be kept.

Parameters
newval: a string corresponding to the name of the sequence to play when the displayed is powered on
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 779 of file yocto_display.cpp.

int YDisplay::setBrightness ( int  newval)
inline

Definition at line 723 of file yocto_display.h.

int YDisplay::setCommand ( const string &  newval)
inline

Definition at line 833 of file yocto_display.h.

int YDisplay::setEnabled ( Y_ENABLED_enum  newval)
inline

Definition at line 669 of file yocto_display.h.

int YDisplay::setOrientation ( Y_ORIENTATION_enum  newval)
inline

Definition at line 751 of file yocto_display.h.

int YDisplay::setStartupSeq ( const string &  newval)
inline

Definition at line 696 of file yocto_display.h.

string YDisplay::startupSeq ( void  )
inline

Definition at line 681 of file yocto_display.h.

int YDisplay::stopSequence ( void  )
virtual

Stops immediately any ongoing sequence replay. The display is left as is.

Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1324 of file yocto_display.cpp.

int YDisplay::swapLayerContent ( int  layerIdA,
int  layerIdB 
)
virtual

Swaps the whole content of two layers. The color and transparency of all the pixels from the two layers are swapped. This method only affects the displayed content, but does not change any property of the layer objects. In particular, the visibility of each layer stays unchanged. When used between onae hidden layer and a visible layer, this method makes it possible to easily implement double-buffering. Note that layer 0 has no transparency support (it is always completely opaque).

Parameters
layerIdA: the first layer (a number in range 0..layerCount-1)
layerIdB: the second layer (a number in range 0..layerCount-1)
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1382 of file yocto_display.cpp.

int YDisplay::upload ( string  pathname,
string  content 
)
virtual

Uploads an arbitrary file (for instance a GIF file) to the display, to the specified full path name. If a file already exists with the same path name, its content is overwritten.

Parameters
pathname: path and name of the new file to create
content: binary buffer with the content to set
Returns
YAPI_SUCCESS if the call succeeds.

On failure, throws an exception or returns a negative error code.

Definition at line 1342 of file yocto_display.cpp.

Friends And Related Function Documentation

YDisplay* yFindDisplay ( const string &  func)
friend

Retrieves a display for a given identifier. The identifier can be specified using several formats:

  • FunctionLogicalName
  • ModuleSerialNumber.FunctionIdentifier
  • ModuleSerialNumber.FunctionLogicalName
  • ModuleLogicalName.FunctionIdentifier
  • ModuleLogicalName.FunctionLogicalName

This function does not require that the display is online at the time it is invoked. The returned object is nevertheless valid. Use the method YDisplay.isOnline() to test if the display is indeed online at a given time. In case of ambiguity when looking for a display by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object's is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

Parameters
func: a string that uniquely characterizes the display
Returns
a YDisplay object allowing you to drive the display.

Definition at line 1101 of file yocto_display.h.

YDisplay* yFirstDisplay ( void  )
friend

Starts the enumeration of displays currently accessible. Use the method YDisplay.nextDisplay() to iterate on next displays.

Returns
a pointer to a YDisplay object, corresponding to the first display currently online, or a NULL pointer if there are none.

Definition at line 1112 of file yocto_display.h.

Member Data Documentation

vector<YDisplayLayer*> YDisplay::_allDisplayLayers
private

Definition at line 615 of file yocto_display.h.

int YDisplay::_brightness
private

Definition at line 595 of file yocto_display.h.

string YDisplay::_command
private

Definition at line 603 of file yocto_display.h.

int YDisplay::_displayHeight
private

Definition at line 598 of file yocto_display.h.

Y_DISPLAYTYPE_enum YDisplay::_displayType
private

Definition at line 599 of file yocto_display.h.

int YDisplay::_displayWidth
private

Definition at line 597 of file yocto_display.h.

Y_ENABLED_enum YDisplay::_enabled
private

Definition at line 593 of file yocto_display.h.

int YDisplay::_layerCount
private

Definition at line 602 of file yocto_display.h.

int YDisplay::_layerHeight
private

Definition at line 601 of file yocto_display.h.

int YDisplay::_layerWidth
private

Definition at line 600 of file yocto_display.h.

Y_ORIENTATION_enum YDisplay::_orientation
private

Definition at line 596 of file yocto_display.h.

bool YDisplay::_recording
private

Definition at line 616 of file yocto_display.h.

string YDisplay::_sequence
private

Definition at line 617 of file yocto_display.h.

string YDisplay::_startupSeq
private

Definition at line 594 of file yocto_display.h.

YDisplayValueCallback YDisplay::_valueCallbackDisplay
private

Definition at line 604 of file yocto_display.h.

const int YDisplay::BRIGHTNESS_INVALID = YAPI_INVALID_UINT
static

Definition at line 630 of file yocto_display.h.

const string YDisplay::COMMAND_INVALID = YAPI_INVALID_STRING
static

Definition at line 645 of file yocto_display.h.

const int YDisplay::DISPLAYHEIGHT_INVALID = YAPI_INVALID_UINT
static

Definition at line 637 of file yocto_display.h.

const Y_DISPLAYTYPE_enum YDisplay::DISPLAYTYPE_GRAY = Y_DISPLAYTYPE_GRAY
static

Definition at line 639 of file yocto_display.h.

const Y_DISPLAYTYPE_enum YDisplay::DISPLAYTYPE_INVALID = Y_DISPLAYTYPE_INVALID
static

Definition at line 641 of file yocto_display.h.

const Y_DISPLAYTYPE_enum YDisplay::DISPLAYTYPE_MONO = Y_DISPLAYTYPE_MONO
static

Definition at line 638 of file yocto_display.h.

const Y_DISPLAYTYPE_enum YDisplay::DISPLAYTYPE_RGB = Y_DISPLAYTYPE_RGB
static

Definition at line 640 of file yocto_display.h.

const int YDisplay::DISPLAYWIDTH_INVALID = YAPI_INVALID_UINT
static

Definition at line 636 of file yocto_display.h.

const Y_ENABLED_enum YDisplay::ENABLED_FALSE = Y_ENABLED_FALSE
static

Definition at line 626 of file yocto_display.h.

const Y_ENABLED_enum YDisplay::ENABLED_INVALID = Y_ENABLED_INVALID
static

Definition at line 628 of file yocto_display.h.

const Y_ENABLED_enum YDisplay::ENABLED_TRUE = Y_ENABLED_TRUE
static

Definition at line 627 of file yocto_display.h.

const int YDisplay::LAYERCOUNT_INVALID = YAPI_INVALID_UINT
static

Definition at line 644 of file yocto_display.h.

const int YDisplay::LAYERHEIGHT_INVALID = YAPI_INVALID_UINT
static

Definition at line 643 of file yocto_display.h.

const int YDisplay::LAYERWIDTH_INVALID = YAPI_INVALID_UINT
static

Definition at line 642 of file yocto_display.h.

const Y_ORIENTATION_enum YDisplay::ORIENTATION_DOWN = Y_ORIENTATION_DOWN
static

Definition at line 634 of file yocto_display.h.

const Y_ORIENTATION_enum YDisplay::ORIENTATION_INVALID = Y_ORIENTATION_INVALID
static

Definition at line 635 of file yocto_display.h.

const Y_ORIENTATION_enum YDisplay::ORIENTATION_LEFT = Y_ORIENTATION_LEFT
static

Definition at line 631 of file yocto_display.h.

const Y_ORIENTATION_enum YDisplay::ORIENTATION_RIGHT = Y_ORIENTATION_RIGHT
static

Definition at line 633 of file yocto_display.h.

const Y_ORIENTATION_enum YDisplay::ORIENTATION_UP = Y_ORIENTATION_UP
static

Definition at line 632 of file yocto_display.h.

const string YDisplay::STARTUPSEQ_INVALID = YAPI_INVALID_STRING
static

Definition at line 629 of file yocto_display.h.


The documentation for this class was generated from the following files:


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:13