Skip to content

set_spySetSpySetSpyset_spyset_spy🔗

Short description🔗

set_spySetSpySetSpyset_spyset_spy — Control of the HALCON Debugging Tools.

Signature🔗

set_spy( string Class, string Value )void SetSpy( const HTuple& Class, const HTuple& Value )static void HOperatorSet.SetSpy( HTuple classVal, HTuple value )def set_spy( class_val: str, value: Union[str, int, float] ) -> None

Herror set_spy( const char* Class, const char* Value )

Herror T_set_spy( const Htuple Class, const Htuple Value )

static void HSystem::SetSpy( const HString& Class, const HTuple& Value )

static void HSystem::SetSpy( const HString& Class, const HString& Value )

static void HSystem::SetSpy( const char* Class, const char* Value )

static void HSystem::SetSpy( const wchar_t* Class, const wchar_t* Value ) (Windows only)

static void HSystem.SetSpy( string classVal, HTuple value )

static void HSystem.SetSpy( string classVal, string value )

Description🔗

The operator set_spySetSpy is the HALCON debugging tool. This tool allows the flexible control of the input and output data of HALCON-operators - in graphical as well as in textual form. The data control is activated by using

set_spy(::'mode','on':),

and deactivated by using

set_spy(::'mode','off':).

The debugging tool can further be activated with the help of the environment variable HALCONSPY. The definition of this variable corresponds to calling up 'mode'"mode" and 'on'"on".

The following control modes (ClassclassValclass) can be tuned using Valuevaluevalue:

  • ClassclassValclass = 'operator'"operator" When a routine is called, its name and the names of its parameters will be given (in TRIAS notation).

    List of values: 'on'"on", 'off'"off"

    Default: 'off'"off".

  • ClassclassValclass = 'input_control'"input_control" When a routine is called, the names and values of the input control parameters will be given.

    List of values: 'on'"on", 'off'"off"

    Default: 'off'"off".

  • ClassclassValclass = 'output_control'"output_control" When a routine is called, the names and values of the output control parameters are given.

    List of values: 'on'"on", 'off'"off"

    Default: 'off'"off".

  • ClassclassValclass = 'parameter_values'"parameter_values" Additional information on 'input_control'"input_control" and 'output_control'"output_control": indicates how many values per parameter shall be displayed at most (maximum tuple length of the output).

    Default: 44

  • ClassclassValclass = 'db'"db" Information concerning the 4 relations in the HALCON-database. This is especially valuable in looking for forgotten clear_objClearObj.

    List of values: 'on'"on", 'off'"off"

    Default: 'off'"off".

  • ClassclassValclass = 'time'"time" Processing time of the operator

    List of values: 'on'"on", 'off'"off"

    Default: 'off'"off".

  • ClassclassValclass = 'log_file'"log_file" Spy can hereby divert the text output into a file having been opened with open_fileOpenFile.

    List of values: a file handle (see open_fileOpenFile)

  • ClassclassValclass = 'internal'"internal" If 'internal'"internal" is activated, spy will display the internal procedures and their parameters (file/line) while an HALCON-operator is processed.

    List of values: 'on'"on", 'off'"off"

    Default: 'off'"off".

Each output starts with the thread handle, followed by a global counter that marks the order of the outputs. In multi-threaded applications, this information can be used to assign the output to individual user threads and to reconstruct the chronological sequence.

Attention🔗

Note that under Windows the output on stdout works only in combination with a console application.

Execution information🔗

Execution information
  • Multithreading type: exclusive (runs in parallel only with independent operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

ClassclassValclass (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Control mode

Default: 'mode'"mode"
List of values: 'db', 'input_control', 'internal', 'log_file', 'mode', 'operator', 'output_control', 'parameter_values', 'time'"db", "input_control", "internal", "log_file", "mode", "operator", "output_control", "parameter_values", "time"

Valuevaluevalue (input_control) string → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)Union[str, int, float]Htuple (char* / Hlong / double)

State of the control mode to be set.

Default: 'on'"on"
Suggested values: 'on', 'off', 1, 2, 3, 4, 5, 10, 50, 0.0, 1.0, 2.0, 5.0, 10.0"on", "off", 1, 2, 3, 4, 5, 10, 50, 0.0, 1.0, 2.0, 5.0, 10.0

Example🔗

(C)

/* init spy: Setting of the wished control modi */
set_spy("mode","on")\;
set_spy("operator","on")\;
set_spy("input_control","on")\;
set_spy("output_control","on")\;
/* calling of program section, that will be examined */
set_spy("mode","off")\;  

Result🔗

The operator set_spySetSpy returns the value 2 (H_MSG_TRUE) if the parameters are correct. Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

reset_obj_dbResetObjDb

See also

get_spyGetSpy, query_spyQuerySpy

Module🔗

Foundation