init
This commit is contained in:
+192
@@ -0,0 +1,192 @@
|
||||
/**
|
||||
* \page BoxAlgorithm_EBMLStreamSpy EBML stream spy
|
||||
__________________________________________________________________
|
||||
|
||||
Detailed description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Description|
|
||||
* The purpose of this box is to spy an EBML stream and decode
|
||||
* its structure to the log manager. In order to do so, the box
|
||||
* has to know a list of expected EBML node identifiers and EBML
|
||||
* node types. If you don't know what EBML is, you should check
|
||||
* the \ref Doc_WhatIsEBML page. The list of expected node
|
||||
* identifiers and types is collected from a configuration file.
|
||||
* Also, the author is able to chose which log level to use
|
||||
* in order to output the information.
|
||||
*
|
||||
* Such box is mostly usefull for debug purpose. It allows
|
||||
* a developper to check what arrives to a box in a human
|
||||
* readable way.
|
||||
* |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Description|
|
||||
__________________________________________________________________
|
||||
|
||||
Inputs description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Inputs|
|
||||
* This box can receive as many input as necessary. All the inputs
|
||||
* will be of type \ref Doc_Streams_EBMLStream in order to
|
||||
* be parsed by this the reader.
|
||||
* |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Inputs|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Input1|
|
||||
* This is the default input of this box.
|
||||
* |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Input1|
|
||||
__________________________________________________________________
|
||||
|
||||
Settings description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Settings|
|
||||
* |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Settings|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Setting1|
|
||||
* This first setting indicates where to find the configuration file.
|
||||
* The box comes with a default configuration file containing all the
|
||||
* default node identifiers of BRAND_NAME. You should extend this
|
||||
* configuration in order to add your own EBML nodes in case you
|
||||
* have created new EBML stream types.
|
||||
* |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Setting1|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Setting2|
|
||||
* This second settings indicates what log level will be used to
|
||||
* print the EBML stream structure.
|
||||
* |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Setting2|
|
||||
__________________________________________________________________
|
||||
|
||||
Examples description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Examples|
|
||||
* As an example, we could connect an EBML stream spy to a sinus
|
||||
* oscillator. Leave the default sinus oscillator settings to their
|
||||
* default, except the sample count per buffer can be set to 8 for the
|
||||
* example. Chose an appropriate log level for the EBML stream spy and
|
||||
* press 'start'. You will probably notice that a lot of text is sent
|
||||
* to the log manager, making the use of this box difficult in real time.
|
||||
* Once again, consider it as a debugging box.
|
||||
*
|
||||
* The output should look like this :
|
||||
\verbatim
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
|
||||
[ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x00000000),(0x00000000, 0x00000000)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x002b395f, 0x108adfae)]-[name:OVTK_NodeId_Header]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cdd0f7, 0x46b0278d)]-[name:OVTK_NodeId_Header_StreamType]-[type:uinteger]-[value:0 (0x0)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x006f5a08, 0x7796ebc5)]-[name:OVTK_NodeId_Header_StreamVersion]-[type:uinteger]-[value:0 (0x0)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x007855de, 0x3748d375)]-[name:OVTK_NodeId_Header_Signal]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00141c43, 0x0c37006b)]-[name:OVTK_NodeId_Header_Signal_Sampling]-[type:uinteger]-[value:512 (0x200)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0072f560, 0x7ed2cbed)]-[name:OVTK_NodeId_Header_StreamedMatrix]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x003febd4, 0x2725d428)]-[name:OVTK_NodeId_Header_StreamedMatrix_DimensionCount]-[type:uinteger]-[value:2 (0x2)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0000e3c0, 0x3a7d5141)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x001302f7, 0x36d8438a)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Size]-[type:uinteger]-[value:4 (0x4)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 0]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 1]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 2]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 3]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0000e3c0, 0x3a7d5141)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x001302f7, 0x36d8438a)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Size]-[type:uinteger]-[value:8 (0x8)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
|
||||
[ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x00000000),(0x00000000, 0x04000000)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
|
||||
[ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x04000000),(0x00000000, 0x08000000)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
|
||||
[ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x08000000),(0x00000000, 0x0c000000)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
...
|
||||
\endverbatim
|
||||
*
|
||||
* Now let's try to understand what is produced. First we notice a clear
|
||||
* separation between the different chunk the box receives. In each chunk, we
|
||||
* have an EBML hierarchy with the different nodes. Here we analyse a signal
|
||||
* stream so we have a header followed by multiple buffers.
|
||||
*
|
||||
* Concerning the header, we can focuse on the signal header part and
|
||||
* the streamed matrix header part. In the first one, we can see that the sampling
|
||||
* rate node appears as an integer with value 512 (the default sinus oscillator
|
||||
* sampling frequency). The second one contains the description of the streamed
|
||||
* matrix. The matrix has two dimensions (electrodes and sample count per buffer).
|
||||
* The first dimension has a size of 4 (the default sinus oscillator channel count)
|
||||
* and each of this channel has a label (channel 0-3). Finally, the second dimension
|
||||
* has a size of 8 (the sample count per buffer you manually put in the sinus
|
||||
* oscillator configuration) and the samples themselves do not have a name.
|
||||
*
|
||||
* Now looking at the buffer, we only have the streamed matrix part (signal
|
||||
* stream do not produce signal specific buffer). The buffer content can not
|
||||
* be displayed in the console (it could be a huge amount of binary non human
|
||||
* readable data, so it is not relevant to print it). But you have an information
|
||||
* of the size of this buffer. 256 is exactly the number of channels (4) multiplied
|
||||
* by the number of samples per buffer (8) multiplied by the size of a single sample
|
||||
* (8 because a sample is coded on a 64 bits float).
|
||||
*
|
||||
* When familiar with EBML and OpenViBE streams, this box is a strong tool
|
||||
* to analyze what is sent from a box to another.
|
||||
* |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Examples|
|
||||
__________________________________________________________________
|
||||
|
||||
Miscellaneous description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Miscellaneous|
|
||||
* The syntax of the configuration file is simple. Each line of the file
|
||||
* should contain 3 fields. The first field is the name of the EBML node
|
||||
* that should be printed in the log manager (this is human readable).
|
||||
* The second field is the EBML node identifier. The last field is the node
|
||||
* type. Several types are supported :
|
||||
* - \e master : this means that this node does not have data attached but has
|
||||
* several children. Any non master node is a leaf, so can contain data.
|
||||
* - \e integer : this means that this node contains a signed integer value
|
||||
* - \e uinteger : this means that this node contains an unsigned integer value
|
||||
* - \e string : this means that this node contains an ASCII string value
|
||||
* - \e float : this means that this node contains a floating point value
|
||||
* - \e binary : this means that this node contains a raw buffer of elements.
|
||||
* In such case, only the size of the buffer is printed. The content of the
|
||||
* buffer is not printed.
|
||||
*
|
||||
* Any node identifier found in the stream and not present in the configuration
|
||||
* file will be considered of type \e unknown and treated as if it was a \e binary
|
||||
* node.
|
||||
*
|
||||
* Following is a part of the sample configuration file to illustrate the syntax :
|
||||
\verbatim
|
||||
...
|
||||
|
||||
OVTK_NodeId_Header_StreamedMatrix EBML::CIdentifier(0x0072F560, 0x7ED2CBED) master
|
||||
OVTK_NodeId_Header_StreamedMatrix_DimensionCount EBML::CIdentifier(0x003FEBD4, 0x2725D428) uinteger
|
||||
OVTK_NodeId_Header_StreamedMatrix_Dimension EBML::CIdentifier(0x0000E3C0, 0x3A7D5141) master
|
||||
OVTK_NodeId_Header_StreamedMatrix_Dimension_Size EBML::CIdentifier(0x001302F7, 0x36D8438A) uinteger
|
||||
OVTK_NodeId_Header_StreamedMatrix_Dimension_Label EBML::CIdentifier(0x00153E40, 0x190227E0) string
|
||||
OVTK_NodeId_Buffer_StreamedMatrix EBML::CIdentifier(0x00120663, 0x08FBC165) master
|
||||
OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer EBML::CIdentifier(0x00B18C10, 0x427D098C) binary
|
||||
|
||||
OVTK_NodeId_Header_Signal EBML::CIdentifier(0x007855DE, 0x3748D375) master
|
||||
OVTK_NodeId_Header_Signal_Sampling EBML::CIdentifier(0x00141C43, 0x0C37006B) uinteger
|
||||
|
||||
...
|
||||
\endverbatim
|
||||
* |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Miscellaneous|
|
||||
*/
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* \page BoxAlgorithm_ExternalProcessing External Processing
|
||||
__________________________________________________________________
|
||||
|
||||
Detailed description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Description|
|
||||
This box allows to externalize data processing into an external program. It sends EBML data in chunks
|
||||
according to a specified protocol, the external application must respond with an EBML response following
|
||||
this same protocol.
|
||||
|
||||
A SDK for C++ and Python 3 (Python NeuroRT Box) are provided in order to simplify the development of
|
||||
external boxes.
|
||||
|
||||
This box can work in two modes, either it launches the external program itself, or it will wait for client
|
||||
connections during the initialize step.
|
||||
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Description|
|
||||
|
||||
__________________________________________________________________
|
||||
|
||||
Settings description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Settings|
|
||||
|
||||
The External Processing box has several settings. The first eight parameters are reserved for the
|
||||
box. Any additional parameters will be passed to the external program.
|
||||
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Settings|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting1|
|
||||
If true, the box will attempt to start the external program automatically. If this setting is false, then the box will stop
|
||||
during the initialize step and wait for the external program to connect during the time speficied by the Connection Timeout setting.
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting1|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting2|
|
||||
Path to the executable to run. This parameter is only used if the first parameter is activated.
|
||||
|
||||
Example: OpenViBE SDK comes with two example programs, one can be found in ${Path_Bin}/sdk-examples-communication-client-filter
|
||||
Example: In the case you want to run a Python script on Windows, the program you are running is python, e.g: C:/Python35/python.exe
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting2|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting3|
|
||||
Arguments passed to the third party program, if any are necessary. This parameter is only used if the first parameter is activated.
|
||||
|
||||
This parameter will be given to the third party program as is, thus it is necessary to quote any arguments that contain spaces.
|
||||
|
||||
Example: In the case you want to run a Python script on Windows, the parameter is the absolute path to the script that you want to run, e.g.: "C:/MyProject/myprogram.py" or "-m mylibrary.mymodule.mybox".
|
||||
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting3|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting4|
|
||||
The TCP port that the box is listening. It must be in the range 49152-65535 or it can be 0, in which case the port will be chosen
|
||||
automatically.
|
||||
|
||||
The box acts as a Socket server and the external program as a client. If you have several External Processing boxes in the same scenario
|
||||
each has to work on a different port.
|
||||
|
||||
An argument, with the value of the port, will be given to the third party program (after the Arguments parameter ) as: --port PORT
|
||||
|
||||
This means that your external program must accept the --port parameter and use it to connect to this box.
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting4|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting5|
|
||||
Whether or not to generate of a connection identifier for the connection. See the next setting for explanation.
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting5|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting6|
|
||||
This argument will be passed to the external program as a command line parameter: `--connection-id CONNECTIONID` and will be communicated to your
|
||||
program through the protocol as well. You should check that the two are matching in order to avoid a clash if two boxes would be using the same
|
||||
port.
|
||||
|
||||
We advise you to use an automatic identifier generation in production. Choose your custom connection identifier is however necessary when running
|
||||
the external program explicitly.
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting6|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting7|
|
||||
A timeout, in seconds, for the incoming connection acceptance.
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting7|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Setting8|
|
||||
This setting changes how often the box will process data. Each data processing requires that the box will
|
||||
wait until it has received a response from the external program. Too many of these synchronisations can
|
||||
induce a severe performance penalty.
|
||||
|
||||
If the box is a generator, then it will wait for the external program on each step. If the scenario is
|
||||
played in real-time, then the box will poll the external program at 16Hz. If the scenario is in fast-forward
|
||||
the refresh frequency of this box is 1Hz.
|
||||
|
||||
If this setting is set to false, the box will send all data it receives into the external program and wait
|
||||
until it processes it and sends it back.
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Setting8|
|
||||
__________________________________________________________________
|
||||
|
||||
Miscellaneous description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_ExternalProcessing_Miscellaneous|
|
||||
This box requires synchronization with the external program in order to process data correctly and in order.
|
||||
As the synchronization is a relatively slow process with regards to the duration of one update cycle (62ms) it
|
||||
is better to try to limit the number of chunks that are send between the box and the client application.
|
||||
|
||||
If you find that your scenario is too slow, try using time based epoching in front of it to make chunks of data
|
||||
larger.
|
||||
* |OVP_DocEnd_BoxAlgorithm_ExternalProcessing_Miscellaneous|
|
||||
|
||||
*/
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* \page BoxAlgorithm_MatrixValidityChecker Matrix validity checker
|
||||
__________________________________________________________________
|
||||
|
||||
Detailed description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_MatrixValidityChecker_Description|
|
||||
Ensures values stored in a matrix are valid, i.e. regular floating point values as opposed to NaN (not a number) or infinite.
|
||||
* |OVP_DocEnd_BoxAlgorithm_MatrixValidityChecker_Description|
|
||||
__________________________________________________________________
|
||||
|
||||
Inputs description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_MatrixValidityChecker_Inputs|
|
||||
* |OVP_DocEnd_BoxAlgorithm_MatrixValidityChecker_Inputs|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_MatrixValidityChecker_Input1|
|
||||
* |OVP_DocEnd_BoxAlgorithm_MatrixValidityChecker_Input1|
|
||||
__________________________________________________________________
|
||||
|
||||
Settings description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_MatrixValidityChecker_Settings|
|
||||
* |OVP_DocEnd_BoxAlgorithm_MatrixValidityChecker_Settings|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_MatrixValidityChecker_Setting1|
|
||||
Log level of messages to be printed whenever Nan or infinite values are found in input matrix.
|
||||
* |OVP_DocEnd_BoxAlgorithm_MatrixValidityChecker_Setting1|
|
||||
__________________________________________________________________
|
||||
|
||||
Examples description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_MatrixValidityChecker_Examples|
|
||||
* |OVP_DocEnd_BoxAlgorithm_MatrixValidityChecker_Examples|
|
||||
|
||||
__________________________________________________________________
|
||||
|
||||
Miscellaneous description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_MatrixValidityChecker_Miscellaneous|
|
||||
* |OVP_DocEnd_BoxAlgorithm_MatrixValidityChecker_Miscellaneous|
|
||||
*/
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
* \page BoxAlgorithm_StimulationListener Stimulation listener
|
||||
__________________________________________________________________
|
||||
|
||||
Detailed description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_StimulationListener_Description|
|
||||
* The stimulation listener is a debugging purpose box, with
|
||||
* the same idea as the \ref Doc_BoxAlgorithm_EBMLStreamSpy box
|
||||
* but dedicated to stimulation streams. The idea is to dramatically
|
||||
* reduce the log verbosity so the output may be followed realtime
|
||||
* if necessary.
|
||||
* |OVP_DocEnd_BoxAlgorithm_StimulationListener_Description|
|
||||
__________________________________________________________________
|
||||
|
||||
Inputs description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_StimulationListener_Inputs|
|
||||
* This box can receive as many input as necessary. All the inputs
|
||||
* will be of type \ref Doc_Streams_Stimulation in order to
|
||||
* be parsed by this the reader.
|
||||
* |OVP_DocEnd_BoxAlgorithm_StimulationListener_Inputs|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_StimulationListener_Input1|
|
||||
* This is the default input of this box.
|
||||
* |OVP_DocEnd_BoxAlgorithm_StimulationListener_Input1|
|
||||
__________________________________________________________________
|
||||
|
||||
Settings description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_StimulationListener_Settings|
|
||||
* |OVP_DocEnd_BoxAlgorithm_StimulationListener_Settings|
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_StimulationListener_Setting1|
|
||||
* This setting indicates what log level will be used to
|
||||
* print the the received stimulations.
|
||||
* |OVP_DocEnd_BoxAlgorithm_StimulationListener_Setting1|
|
||||
__________________________________________________________________
|
||||
|
||||
Examples description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_StimulationListener_Examples|
|
||||
* As an example, we could connect a clock stimulator to a
|
||||
* stimulation listener. Leave the default settings of the
|
||||
* clock stimulator, so it sends an \e OVTK_StimulationId_Label_00
|
||||
* stimulation every second. Now chose an appropriate log level
|
||||
* for the stimulation listener and press 'start'. If you're
|
||||
* familiar to what \ref Doc_BoxAlgorithm_EBMLStreamSpy produces,
|
||||
* you may feel more confortable with what is produced here for
|
||||
* stimulations.
|
||||
*
|
||||
* The output should look like this :
|
||||
\verbatim
|
||||
...
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 4294967296 (0x100000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 8589934592 (0x200000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 12884901888 (0x300000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 17179869184 (0x400000000) and duration 0 (0x0)
|
||||
...
|
||||
\endverbatim
|
||||
*
|
||||
* Now let's try to understand what is produced. Each line represents
|
||||
* received stimulation. The input index which received the stimulation
|
||||
* is printed. Then follow the stimulation code, its date and its duration.
|
||||
* The stimulation name is retrieved from the type manager when correctly
|
||||
* registered. Here, you can see that an \e OVTK_StimulationId_Label_00 is
|
||||
* received every second.
|
||||
*
|
||||
* More tests could be done with another clock stimulator with different
|
||||
* timings and stimulation codes. You will want to add inputs to the stimulation
|
||||
* listener box in order to get proper results. For example with one more box
|
||||
* sending \e OVTK_StimulationId_Label_01 every half second, the output would
|
||||
* look like this :
|
||||
\verbatim
|
||||
...
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 2147483648 (0x80000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 4294967296 (0x100000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 4294967296 (0x100000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 6442450944 (0x180000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 8589934592 (0x200000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 8589934592 (0x200000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 10737418240 (0x280000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 12884901888 (0x300000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 12884901888 (0x300000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 15032385536 (0x380000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 17179869184 (0x400000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 17179869184 (0x400000000) and duration 0 (0x0)
|
||||
...
|
||||
\endverbatim
|
||||
* |OVP_DocEnd_BoxAlgorithm_StimulationListener_Examples|
|
||||
|
||||
__________________________________________________________________
|
||||
|
||||
Miscellaneous description
|
||||
__________________________________________________________________
|
||||
|
||||
* |OVP_DocBegin_BoxAlgorithm_StimulationListener_Miscellaneous|
|
||||
* |OVP_DocEnd_BoxAlgorithm_StimulationListener_Miscellaneous|
|
||||
*/
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
.. _Doc_BoxAlgorithm_EBMLStreamSpy:
|
||||
|
||||
EBML stream spy
|
||||
===============
|
||||
|
||||
.. container:: attribution
|
||||
|
||||
:Author:
|
||||
Yann Renard
|
||||
:Company:
|
||||
INRIA/IRISA
|
||||
|
||||
.. image:: images/Doc_BoxAlgorithm_EBMLStreamSpy.png
|
||||
|
||||
This sample EBML stream analyzer prints the EBML tree structure to the console
|
||||
|
||||
The purpose of this box is to spy an EBML stream and decode its structure to
|
||||
the log manager. In order to do so, the box has to know a list of expected EBML
|
||||
node identifiers and EBML node types. If you don't know what EBML is, you
|
||||
should check the `EBML Documentation
|
||||
<https://github.com/Matroska-Org/ebml-specification>`_ page. The list of
|
||||
expected node identifiers and types is collected from a configuration file.
|
||||
Also, the author is able to chose which log level to use in order to output the
|
||||
information.
|
||||
|
||||
Such box is mostly useful for debug purpose. It allows
|
||||
a developper to check what arrives to a box in a human
|
||||
readable way.
|
||||
|
||||
Inputs
|
||||
------
|
||||
|
||||
.. csv-table::
|
||||
:header: "Input Name", "Stream Type"
|
||||
|
||||
"Spied EBML stream 1", "EBML stream"
|
||||
|
||||
This box can receive as many input as necessary. All the inputs
|
||||
will be of type :ref:`Doc_Streams_EBML` in order to
|
||||
be parsed by this the reader.
|
||||
|
||||
Spied EBML stream 1
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This is the default input of this box.
|
||||
|
||||
.. _Doc_BoxAlgorithm_EBMLStreamSpy_Settings:
|
||||
|
||||
Settings
|
||||
--------
|
||||
|
||||
.. csv-table::
|
||||
:header: "Setting Name", "Type", "Default Value"
|
||||
|
||||
"EBML nodes description", "Filename", "${Path_Data}/plugins/tools/config-ebml-stream-spy.txt"
|
||||
"Log level to use", "Log level", "Information"
|
||||
"Expand binary blocks", "Boolean", "false"
|
||||
"Number of values in expanded blocks", "Integer", "4"
|
||||
|
||||
EBML nodes description
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This first setting indicates where to find the configuration file.
|
||||
The box comes with a default configuration file containing all the
|
||||
default node identifiers of NeuroRT. You should extend this
|
||||
configuration in order to add your own EBML nodes in case you
|
||||
have created new EBML stream types.
|
||||
|
||||
Log level to use
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
This second settings indicates what log level will be used to
|
||||
print the EBML stream structure.
|
||||
|
||||
.. _Doc_BoxAlgorithm_EBMLStreamSpy_Examples:
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
As an example, we could connect an EBML stream spy to a sinus
|
||||
oscillator. Leave the default sinus oscillator settings to their
|
||||
default, except the sample count per buffer can be set to 8 for the
|
||||
example. Chose an appropriate log level for the EBML stream spy and
|
||||
press 'start'. You will probably notice that a lot of text is sent
|
||||
to the log manager, making the use of this box difficult in real time.
|
||||
Once again, consider it as a debugging box.
|
||||
|
||||
The output should look like this :
|
||||
|
||||
.. code::
|
||||
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
|
||||
[ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x00000000),(0x00000000, 0x00000000)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x002b395f, 0x108adfae)]-[name:OVTK_NodeId_Header]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cdd0f7, 0x46b0278d)]-[name:OVTK_NodeId_Header_StreamType]-[type:uinteger]-[value:0 (0x0)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x006f5a08, 0x7796ebc5)]-[name:OVTK_NodeId_Header_StreamVersion]-[type:uinteger]-[value:0 (0x0)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x007855de, 0x3748d375)]-[name:OVTK_NodeId_Header_Signal]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00141c43, 0x0c37006b)]-[name:OVTK_NodeId_Header_Signal_Sampling]-[type:uinteger]-[value:512 (0x200)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0072f560, 0x7ed2cbed)]-[name:OVTK_NodeId_Header_StreamedMatrix]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x003febd4, 0x2725d428)]-[name:OVTK_NodeId_Header_StreamedMatrix_DimensionCount]-[type:uinteger]-[value:2 (0x2)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0000e3c0, 0x3a7d5141)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x001302f7, 0x36d8438a)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Size]-[type:uinteger]-[value:4 (0x4)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 0]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 1]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 2]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 3]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0000e3c0, 0x3a7d5141)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x001302f7, 0x36d8438a)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Size]-[type:uinteger]-[value:8 (0x8)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
|
||||
[ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x00000000),(0x00000000, 0x04000000)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
|
||||
[ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x04000000),(0x00000000, 0x08000000)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
[ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
|
||||
[ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x08000000),(0x00000000, 0x0c000000)]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
|
||||
[ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
|
||||
[ INF ] <Box algorithm::EBML stream spy>
|
||||
...
|
||||
|
||||
Now let's try to understand what is produced. First we notice a clear
|
||||
separation between the different chunk the box receives. In each chunk, we
|
||||
have an EBML hierarchy with the different nodes. Here we analyse a signal
|
||||
stream so we have a header followed by multiple buffers.
|
||||
|
||||
Concerning the header, we can focuse on the signal header part and
|
||||
the streamed matrix header part. In the first one, we can see that the sampling
|
||||
rate node appears as an integer with value 512 (the default sinus oscillator
|
||||
sampling frequency). The second one contains the description of the streamed
|
||||
matrix. The matrix has two dimensions (electrodes and sample count per buffer).
|
||||
The first dimension has a size of 4 (the default sinus oscillator channel count)
|
||||
and each of this channel has a label (channel 0-3). Finally, the second dimension
|
||||
has a size of 8 (the sample count per buffer you manually put in the sinus
|
||||
oscillator configuration) and the samples themselves do not have a name.
|
||||
|
||||
Now looking at the buffer, we only have the streamed matrix part (signal
|
||||
stream do not produce signal specific buffer). The buffer content can not
|
||||
be displayed in the console (it could be a huge amount of binary non human
|
||||
readable data, so it is not relevant to print it). But you have an information
|
||||
of the size of this buffer. 256 is exactly the number of channels (4) multiplied
|
||||
by the number of samples per buffer (8) multiplied by the size of a single sample
|
||||
(8 because a sample is coded on a 64 bits float).
|
||||
|
||||
When familiar with EBML and OpenViBE streams, this box is a strong tool
|
||||
to analyze what is sent from a box to another.
|
||||
|
||||
.. _Doc_BoxAlgorithm_EBMLStreamSpy_Miscellaneous:
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
The syntax of the configuration file is simple. Each line of the file
|
||||
should contain 3 fields. The first field is the name of the EBML node
|
||||
that should be printed in the log manager (this is human readable).
|
||||
The second field is the EBML node identifier. The last field is the node
|
||||
type. Several types are supported :
|
||||
|
||||
- \e master : this means that this node does not have data attached but has
|
||||
|
||||
several children. Any non master node is a leaf, so can contain data.
|
||||
|
||||
- \e integer : this means that this node contains a signed integer value
|
||||
- \e uinteger : this means that this node contains an unsigned integer value
|
||||
- \e string : this means that this node contains an ASCII string value
|
||||
- \e float : this means that this node contains a floating point value
|
||||
- \e binary : this means that this node contains a raw buffer of elements.
|
||||
|
||||
In such case, only the size of the buffer is printed. The content of the
|
||||
buffer is not printed.
|
||||
|
||||
Any node identifier found in the stream and not present in the configuration
|
||||
file will be considered of type \e unknown and treated as if it was a \e binary
|
||||
node.
|
||||
|
||||
Following is a part of the sample configuration file to illustrate the syntax :
|
||||
|
||||
.. code::
|
||||
|
||||
...
|
||||
|
||||
OVTK_NodeId_Header_StreamedMatrix EBML::CIdentifier(0x0072F560, 0x7ED2CBED) master
|
||||
OVTK_NodeId_Header_StreamedMatrix_DimensionCount EBML::CIdentifier(0x003FEBD4, 0x2725D428) uinteger
|
||||
OVTK_NodeId_Header_StreamedMatrix_Dimension EBML::CIdentifier(0x0000E3C0, 0x3A7D5141) master
|
||||
OVTK_NodeId_Header_StreamedMatrix_Dimension_Size EBML::CIdentifier(0x001302F7, 0x36D8438A) uinteger
|
||||
OVTK_NodeId_Header_StreamedMatrix_Dimension_Label EBML::CIdentifier(0x00153E40, 0x190227E0) string
|
||||
OVTK_NodeId_Buffer_StreamedMatrix EBML::CIdentifier(0x00120663, 0x08FBC165) master
|
||||
OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer EBML::CIdentifier(0x00B18C10, 0x427D098C) binary
|
||||
|
||||
OVTK_NodeId_Header_Signal EBML::CIdentifier(0x007855DE, 0x3748D375) master
|
||||
OVTK_NodeId_Header_Signal_Sampling EBML::CIdentifier(0x00141C43, 0x0C37006B) uinteger
|
||||
|
||||
...
|
||||
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
.. _Doc_BoxAlgorithm_ExternalProcessing:
|
||||
|
||||
External Processing
|
||||
===================
|
||||
|
||||
.. container:: attribution
|
||||
|
||||
:Author:
|
||||
Alexis Placet
|
||||
:Company:
|
||||
Mensia Technologies SA
|
||||
|
||||
.. image:: images/Doc_BoxAlgorithm_ExternalProcessing.png
|
||||
|
||||
Launches an external program which can then process data. This box and the program communicate using TCP connection and a defined protocol.
|
||||
|
||||
This box allows to externalize data processing into an external program. It sends EBML data in chunks
|
||||
according to a specified protocol, the external application must respond with an EBML response following
|
||||
this same protocol.
|
||||
|
||||
A SDK for C++ and Python 3 (Python NeuroRT Box) are provided in order to simplify the development of
|
||||
external boxes.
|
||||
|
||||
This box can work in two modes, either it launches the external program itself, or it will wait for client
|
||||
connections during the initialize step.
|
||||
|
||||
.. _Doc_BoxAlgorithm_ExternalProcessing_Settings:
|
||||
|
||||
Settings
|
||||
--------
|
||||
|
||||
.. csv-table::
|
||||
:header: "Setting Name", "Type", "Default Value"
|
||||
|
||||
"Launch third party program", "Boolean", "true"
|
||||
"Executable path", "Filename", ""
|
||||
"Arguments", "String", ""
|
||||
"Port", "Integer", "0"
|
||||
"Automatic connection identifier", "Boolean", "true"
|
||||
"Custom connection identifier", "String", ""
|
||||
"Incoming connection timeout", "Integer", "10"
|
||||
"Generator", "Boolean", "false"
|
||||
|
||||
The External Processing box has several settings. The first eight parameters are reserved for the
|
||||
box. Any additional parameters will be passed to the external program.
|
||||
|
||||
Launch third party program
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
If true, the box will attempt to start the external program automatically.
|
||||
We advise to use this mode in production.
|
||||
|
||||
If this setting is false, then the box will stop
|
||||
during the initialize step and wait for the external program to connect during the time speficied by the Connection Timeout setting.
|
||||
This mode is useful during development, since it allows to run the program manually and check the console.
|
||||
|
||||
|
||||
Executable path
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Path to the executable to run. This parameter is only used if the first parameter is activated.
|
||||
|
||||
Example: OpenViBE SDK comes with two example programs, one can be found in ``${Path_Bin}/sdk-examples-communication-client-filter``
|
||||
|
||||
Example: In the case you want to run a Python script on Windows, the program you are running is python, e.g: ``C:/Python35/python.exe``
|
||||
|
||||
Arguments
|
||||
~~~~~~~~~
|
||||
|
||||
Arguments passed to the third party program, if any are necessary. This parameter is only used if the first parameter is activated.
|
||||
|
||||
This parameter will be given to the third party program as is, thus it is necessary to quote any arguments that contain spaces.
|
||||
|
||||
Example: In the case you want to run a Python script on Windows, the parameter is the absolute path to the script that you want to run, e.g.: ``C:/MyProject/myprogram.py`` or ``-m mylibrary.mymodule.mybox``.
|
||||
|
||||
Port
|
||||
~~~~
|
||||
|
||||
The TCP port that the box is listening. It must be in the range 49152-65535 or it can be 0, in which case the port will be chosen
|
||||
automatically.
|
||||
|
||||
The box acts as a Socket server and the external program as a client. If you have several External Processing boxes in the same scenario
|
||||
each has to work on a different port.
|
||||
|
||||
We advise to use port ``0`` in production.
|
||||
|
||||
An argument, with the value of the port, will be given to the third party program (after the Arguments parameter ) as: ``--port PORT``
|
||||
|
||||
This means that your external program must accept the ``--port`` parameter and use it to connect to this box.
|
||||
|
||||
Automatic connection identifier
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Whether or not to generate of a connection identifier for the connection. See the next setting for explanation.
|
||||
|
||||
Custom connection identifier
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This argument will be passed to the external program as a command line parameter: ``--connection-id CONNECTIONID`` and will be communicated to your
|
||||
program through the protocol as well. You should check that the two are matching in order to avoid a clash if two boxes would be using the same
|
||||
port.
|
||||
|
||||
We advise you to use an automatic identifier generation in production. Choose your custom connection identifier is however necessary when running
|
||||
the external program explicitly.
|
||||
|
||||
Incoming connection timeout
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
A timeout, in seconds, for the incoming connection acceptance.
|
||||
|
||||
Generator
|
||||
~~~~~~~~~
|
||||
|
||||
This setting changes how often the box will process data. Each data processing requires that the box will
|
||||
wait until it has received a response from the external program. Too many of these synchronisations can
|
||||
induce a severe performance penalty.
|
||||
|
||||
If the box is a generator, then it will wait for the external program on each step. If the scenario is
|
||||
played in real-time, then the box will poll the external program at 16Hz. If the scenario is in fast-forward
|
||||
the refresh frequency of this box is 1Hz.
|
||||
|
||||
If this setting is set to false, the box will send all data it receives into the external program and wait
|
||||
until it processes it and sends it back.
|
||||
|
||||
.. _Doc_BoxAlgorithm_ExternalProcessing_Miscellaneous:
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
Performances
|
||||
~~~~~~~~~~~~
|
||||
This box requires synchronization with the external program in order to process data correctly and in order.
|
||||
As the synchronization is a relatively slow process with regards to the duration of one update cycle (62ms) it
|
||||
is better to try to limit the number of chunks that are send between the box and the client application.
|
||||
|
||||
If you find that your scenario is too slow, try using time based epoching in front of it to make chunks of data
|
||||
larger.
|
||||
|
||||
|
||||
Development mode
|
||||
~~~~~~~~~~~~~~~~
|
||||
While developing your program, you may want to run it in Debug mode in your environment.
|
||||
|
||||
In order to run your program manually you should change the settings of the box:
|
||||
* uncheck option ``Launch Third Party Program``,
|
||||
* uncheck option ``Automatic connection identifier``,
|
||||
* change the default port, for example to ``59595``, (make sure this is the default port used by your program)
|
||||
* make sure the setting ``Incoming connection timeout`` will leave you enough time to run your program manually (default setting should be enough)
|
||||
|
||||
Then, you can first run your scenario through NeuroRT Studio, and then run your program manually.
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
.. _Doc_BoxAlgorithm_MatrixValidityChecker:
|
||||
|
||||
Matrix validity checker
|
||||
=======================
|
||||
|
||||
.. container:: attribution
|
||||
|
||||
:Author:
|
||||
Yann Renard
|
||||
:Company:
|
||||
INRIA/IRISA
|
||||
|
||||
.. image:: images/Doc_BoxAlgorithm_MatrixValidityChecker.png
|
||||
|
||||
This box is for debugging purposes and allows an author to check the validity of a streamed matrix and derived stream. This box can log a message, stop the player or interpolate data.
|
||||
|
||||
Ensures values stored in a matrix are valid, i.e. regular floating point values as opposed to NaN (not a number) or infinite.
|
||||
|
||||
Inputs
|
||||
------
|
||||
|
||||
.. csv-table::
|
||||
:header: "Input Name", "Stream Type"
|
||||
|
||||
"Stream 1", "Streamed matrix"
|
||||
|
||||
Outputs
|
||||
-------
|
||||
|
||||
.. csv-table::
|
||||
:header: "Output Name", "Stream Type"
|
||||
|
||||
"Output stream 1", "Streamed matrix"
|
||||
|
||||
.. _Doc_BoxAlgorithm_MatrixValidityChecker_Settings:
|
||||
|
||||
Settings
|
||||
--------
|
||||
|
||||
.. csv-table::
|
||||
:header: "Setting Name", "Type", "Default Value"
|
||||
|
||||
"Log level", "Log level", "Warning"
|
||||
"Action to do", "Action to do", "Log warning"
|
||||
|
||||
Log level
|
||||
~~~~~~~~~
|
||||
|
||||
Log level of messages to be printed whenever Nan or infinite values are found in input matrix.
|
||||
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
.. _Doc_BoxAlgorithm_StimulationListener:
|
||||
|
||||
Stimulation listener
|
||||
====================
|
||||
|
||||
.. container:: attribution
|
||||
|
||||
:Author:
|
||||
Yann Renard
|
||||
:Company:
|
||||
INRIA/IRISA
|
||||
|
||||
.. image:: images/Doc_BoxAlgorithm_StimulationListener.png
|
||||
|
||||
Prints each received stimulationto the log using the log level specified in the box config.
|
||||
|
||||
The stimulation listener is a debugging purpose box, with
|
||||
the same idea as the :ref:`Doc_BoxAlgorithm_EBMLStreamSpy` box
|
||||
but dedicated to stimulation streams. The idea is to dramatically
|
||||
reduce the log verbosity so the output may be followed realtime
|
||||
if necessary.
|
||||
|
||||
Inputs
|
||||
------
|
||||
|
||||
.. csv-table::
|
||||
:header: "Input Name", "Stream Type"
|
||||
|
||||
"Stimulation stream 1", "Stimulations"
|
||||
|
||||
This box can receive as many input as necessary. All the inputs
|
||||
will be of type :ref:`Doc_Streams_Stimulation` in order to
|
||||
be parsed by this the reader.
|
||||
|
||||
Stimulation stream 1
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This is the default input of this box.
|
||||
|
||||
.. _Doc_BoxAlgorithm_StimulationListener_Settings:
|
||||
|
||||
Settings
|
||||
--------
|
||||
|
||||
.. csv-table::
|
||||
:header: "Setting Name", "Type", "Default Value"
|
||||
|
||||
"Log level to use", "Log level", "Information"
|
||||
|
||||
Log level to use
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
This setting indicates what log level will be used to
|
||||
print the the received stimulations.
|
||||
|
||||
.. _Doc_BoxAlgorithm_StimulationListener_Examples:
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
As an example, we could connect a clock stimulator to a
|
||||
stimulation listener. Leave the default settings of the
|
||||
clock stimulator, so it sends an \e OVTK_StimulationId_Label_00
|
||||
stimulation every second. Now chose an appropriate log level
|
||||
for the stimulation listener and press 'start'. If you're
|
||||
familiar to what :ref:`Doc_BoxAlgorithm_EBMLStreamSpy` produces,
|
||||
you may feel more confortable with what is produced here for
|
||||
stimulations.
|
||||
|
||||
The output should look like this :
|
||||
|
||||
.. code::
|
||||
|
||||
...
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 4294967296 (0x100000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 8589934592 (0x200000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 12884901888 (0x300000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 17179869184 (0x400000000) and duration 0 (0x0)
|
||||
...
|
||||
|
||||
Now let's try to understand what is produced. Each line represents
|
||||
received stimulation. The input index which received the stimulation
|
||||
is printed. Then follow the stimulation code, its date and its duration.
|
||||
The stimulation name is retrieved from the type manager when correctly
|
||||
registered. Here, you can see that an \e OVTK_StimulationId_Label_00 is
|
||||
received every second.
|
||||
|
||||
More tests could be done with another clock stimulator with different
|
||||
timings and stimulation codes. You will want to add inputs to the stimulation
|
||||
listener box in order to get proper results. For example with one more box
|
||||
sending \e OVTK_StimulationId_Label_01 every half second, the output would
|
||||
look like this :
|
||||
|
||||
.. code::
|
||||
|
||||
...
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 2147483648 (0x80000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 4294967296 (0x100000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 4294967296 (0x100000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 6442450944 (0x180000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 8589934592 (0x200000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 8589934592 (0x200000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 10737418240 (0x280000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 12884901888 (0x300000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 12884901888 (0x300000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 15032385536 (0x380000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 0 (0x0) with name Stimulation stream 1 got stimulation 33024 (0x8100)[OVTK_StimulationId_Label_00] at date 17179869184 (0x400000000) and duration 0 (0x0)
|
||||
[ INF ] <Box algorithm::Stimulation listener> For input 1 (0x1) with name Stimulation stream 2 got stimulation 33025 (0x8101)[OVTK_StimulationId_Label_01] at date 17179869184 (0x400000000) and duration 0 (0x0)
|
||||
...
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 962 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1010 B |
Reference in New Issue
Block a user