diguySignal

Generated from diguySignal.h

DI-Guy API Version 12.5.1

This file was automatically generated from diguySignal.h. Do not edit this file directly; the changes will be lost.
Includes: diguy_constants.h | diguy_typedefs.h | declspec_diguy.h

Contents:

Alphabetical Index

Link against: libdiguy

class diguySignal

class BDI_DECLSPEC_diguy diguySignal
{
public:
    const char* get_name();
    int set_name(const char* name);
    const char* get_type_name();
    int reset();
    int trigger();
    int triggered();
    int triggered_at_least_n_times(int n);
    int signal_palette_show();
    int signal_palette_hide();
    int get_is_visible_in_signal_palette();
    const char* get_info_text();
    void set_info_text(const char* info_text);
    enum {
        CALLBACK_ID_PRE_TRIGGER = 1,
        CALLBACK_ID_POST_TRIGGER
    };
#ifdef CPLUSPLUS_ONLY
    int add_callback(int callback_id,
        diguySignalCallback* callback,
        void* callback_params = 0,
        void* callback_user_data = 0);
    int remove_callback(int callback_id,
        diguySignalCallback* callback);
    int remove_callback_with_user_data(int callback_id,
        void* callback_user_data);
    int add_callback_script(int callback_id,
        const char* callback_script,
        const char* callback_script_type = NULL);
    int remove_callback_script(int callback_id,
        const char* callback_script,
        const char* callback_script_type = NULL);
    int map_event_handler_to_callback_id(int callback_id,
        const char* handler_name);
    int unmap_event_handler_from_callback_id(int callback_id,
        const char* handler_name,
        int unmap_all_matches = 0);

function diguySignal::get_name

Prototype:

const char* get_name();
Description:

Returns the name of the object. This pointer will never be NULL.

Returns:

name of the signal

Callable From:

function diguySignal::set_name

Prototype:

int set_name(const char* name);
Description:

This function sets the name of this object.

Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::get_type_name

Prototype:

const char* get_type_name();
Description:

Returns the type name of the object. This pointer will never be NULL.

Returns:

type name of the object

Callable From:

function diguySignal::reset

Prototype:

int reset();
Description:

This function resets the signal. The number of times the signal has been triggered will be set to 0.

Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::trigger

Prototype:

int trigger();
Description:

This function triggers the signal. If a sound is associated with the signal, it will be played. The number of times the signal has been triggered will be incremented by one.

Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::triggered

Prototype:

int triggered();
Returns:

Returns the number of times this signal has been triggered since the scenario started or since the last call to reset().

Callable From:

function diguySignal::triggered_at_least_n_times

Prototype:

int triggered_at_least_n_times(int n);
Returns:

Returns 1 if the signal has been triggered at least n times, else returns 0.

Callable From:

function diguySignal::signal_palette_show

Prototype:

int signal_palette_show();
Description:

This function causes the button for this signal to become visible in the DI-Guy Scenario Signal Palette.

This function is for DI-Guy Scenario only.

Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::signal_palette_hide

Prototype:

int signal_palette_hide();
Description:

This function causes the button for this signal to become hidden in the DI-Guy Scenario Signal Palette.

This function is for DI-Guy Scenario only.

Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::get_is_visible_in_signal_palette

Prototype:

int get_is_visible_in_signal_palette();
Description:

This function returns a flag specifying whether the signal's button is visible in the DI-Guy Scenario Signal Palette.

This function is for DI-Guy Scenario only.

Returns:

1 if the signal's button is visible, 0 if not

Callable From:

function diguySignal::get_info_text

Prototype:

const char* get_info_text();
Description:

This function returns an optional signal description buffer.

Returns:

pointer to info text

Callable From:

function diguySignal::set_info_text

Prototype:

void set_info_text(const char* info_text);
Description:

This function sets an optional signal description buffer.

Arguments:

info_text text of info
Callable From:

Callback Functions

enumeration

	enum {
		CALLBACK_ID_PRE_TRIGGER = 1,
		CALLBACK_ID_POST_TRIGGER
	};
Description:

This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script().

Usable From:

function diguySignal::add_callback

Prototype:

int add_callback(int callback_id,
    diguySignalCallback* callback,
    void* callback_params = 0,
    void* callback_user_data = 0);
Description:

This function adds a user callback.

Arguments:

callback pointer to function with prototype diguySignalCallback (typedefed above)
callback_id integer id of when this callback is to be called
callback_paramsnot currently used; pass NULL
callback_user_datapointer for user's own use; DI-Guy will do nothing to the contents of this pointer beyond passing it back when the callback is invoked
callback_id should be one of the following values:

CALLBACK_ID_PRE_TRIGGER

This callback will be called whenever the trigger() function is called, whether internally by DI-Guy of explicitly by the user in C++ or in a script. It will be called before the default handler of the function.

There are no parameters for this callback.

CALLBACK_ID_POST_TRIGGER

This callback will be called whenever the trigger() function is called, whether internally by DI-Guy of explicitly by the user in C++ or in a script. It will be called after the default handler of the function.

There are no parameters for this callback.

Callback Return Values:

Callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the callback returns DIGUY_CALLBACK_STOP, the default handler of the function will not be called; the callback is asserting that it has done everything necessary for the function call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default handler for the function will be called after the callback.

Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::remove_callback

Prototype:

int remove_callback(int callback_id,
    diguySignalCallback* callback);
Description:

This function removes a user callback. All callbacks matching the specified callback_id and callback function will be removed.

Arguments:

callback_id integer id of when this callback is to be called
callback pointer to function with prototype diguySignalCallback (typedefed above)
Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::remove_callback_with_user_data

Prototype:

int remove_callback_with_user_data(int callback_id,
    void* callback_user_data);
Description:

This function removes a user callback. All callbacks matching the specified callback_id and callback_user_data pointer will be removed.

Arguments:

callback_id integer id of when this callback is to be called
callback_user_datapointer for user's own use
Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::add_callback_script

Prototype:

int add_callback_script(int callback_id,
    const char* callback_script,
    const char* callback_script_type = NULL);
Description:

This function adds a user callback script. Callback scripts can be removed with remove_callback_script().

See diguyCharacter::add_callback_script() for an example of use.

Arguments:

callback_id integer id of the callback
callback_script script text of callback to be added
callback_script_typethe type of script contained in callback_script
If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.

Lua specific:

When the script is called, the object for which it is being called will be in the callback_object global.

To pass NULL when calling from a lua script, use nil.

Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::remove_callback_script

Prototype:

int remove_callback_script(int callback_id,
    const char* callback_script,
    const char* callback_script_type = NULL);
Description:

This function removes a user callback script previously added with add_callback_script().

See diguyCharacter::remove_callback_script() for an example of use.

Arguments:

callback_id integer id of the callback
callback_script script text of callback previously added
callback_script_typethe type of script contained in callback_script
If NULL is passed for callback_script, all callback scripts whose ids match callback_id and whose types match callback_script_type will be removed.

If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.

Lua specific:

To pass NULL when calling from a lua script, use nil.

Returns:

0 on success, -1 on failure

Callable From:

Event Handler Functions

function diguySignal::map_event_handler_to_callback_id

Prototype:

int map_event_handler_to_callback_id(int callback_id,
    const char* handler_name);
Description:

This function maps the event handler with the given name to a callback id. This mapping will be saved in the .dss file and restored when the .dss file is loaded.

Mappings can also be made via the DI-Guy Scenario UI.

The event handler is one of the following:

Arguments:

callback_id integer id of callback
handler_name name of the event handler to map
Returns:

0 on success, -1 on failure

Callable From:

function diguySignal::unmap_event_handler_from_callback_id

Prototype:

int unmap_event_handler_from_callback_id(int callback_id,
    const char* handler_name,
    int unmap_all_matches = 0);
Description:

This function unmaps the event handler with the given name from a callback id.

Arguments:

callback_id integer id of callback
handler_name name of the event handler to map
unmap_all_matches pass 0 to unmap only the first match, pass 1 to unmap all matches
Returns:

0 on success, -1 on failure

Callable From:


Alphabetical Index




Copyright (C) 1992-2012 Boston Dynamics

ALL RIGHTS RESERVED.

These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.

Contractor/Manufacturer is:

Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.