EyesWeb XMI Forum
http://forum.eyesweb.infomus.org/

building Block with dynamic I/O
http://forum.eyesweb.infomus.org/viewtopic.php?f=25&t=585
Page 1 of 1

Author:  Quan [ 11 May 2010, 07:18 ]
Post subject:  building Block with dynamic I/O

Hi, currently I'm building a block that take dynamic inputs then output a Matrix with dynamic size with respect to the number of inputs.
So, I suppose the inputs are Audio-Buffers , and the output is a Matrix.

I still can't figure out:

1. How to set different number of inputs, and then I can access them through a loop ?

2. How to change the size of the output matrix (as I found in the reference manual, the IMatrix class doesn't have ReSize() function).

can you help me? I would be very grateful. Thanks,

Quan

Author:  Quan [ 12 May 2010, 04:02 ]
Post subject:  Re: building Block with dynamic I/O

well, I manage to solve the 2nd problem, by using double_matrix_init_info_ptr.

But still stuck at the 1st one...

Author:  paolo [ 12 May 2010, 22:25 ]
Post subject:  Re: building Block with dynamic I/O

To iterate the inputs:
int num = GetSignature()->GetInputs()->GetNumItems();
for( int i = 0; i < num; ++i )
{
IInputPinSignature* inputPtr = GetSignature()->GetInputs()->GetItem( i );
// ....
}


You cannot explicitly set the numer of inputs; however, you can simpli use SetInput to add new inputs to your block (using different identifiers), or RemoveInput to delete them

Paolo

Author:  Quan [ 13 May 2010, 10:14 ]
Post subject:  Re: building Block with dynamic I/O

hi,

I can show the addition inputs now.. But when I change the number of inputs parameter, the block is not updated, only if I reset eyesweb it'll update.

so, In which method (i.e ::InitSignature() , ::CheckSignature()...) I should add SetInput/RemoveInput to register/remove a new one?

Thanks,

Quan

Author:  Quan [ 13 May 2010, 17:05 ]
Post subject:  Re: building Block with dynamic I/O

hi,

I attach the code for a simple block that has multiple inputs (type double) then output a matrix. I managed to change the inputs (tested in debug mode the value of GetSignature()->GetInputs()->GetNumItems()).

The block works fine with constant Number of Inputs, but when I change the number of inputs, the block itself doesn't update, in GUI it shows the old inputs. If, for example, I reduce the inputs, then point the mouse cursor to the pins that have been supposed to be removed , an error occurred and the eyesweb crashed !
If I restart eyesweb after changing the number of inputs, the block now is updated with the right number of input pins.

I try to modify the code by putting the SetInput/RemoveInput in some ways but .. seem like I still go on the wrong ways.
:(

Attachments:
File comment: Test block code
Test_Block.rar [1.65 KiB]
Downloaded 852 times

Author:  paolo [ 15 May 2010, 00:15 ]
Post subject:  Re: building Block with dynamic I/O

After changing the numer of inputs, outputs, or parameter, you have to call the method
Notify_SignatureChanged()
to see your changes reflected in the GUI.

Paolo

Author:  Quan [ 15 May 2010, 00:55 ]
Post subject:  Re: building Block with dynamic I/O

hi, now all the bug have gone ..
:D :D :D

THANK YOU VERY MUCH !!!

Quan

Author:  Lerakroxa [ 04 Mar 2016, 18:40 ]
Post subject:  building Block with dynamic I/O

Seems like one library was compiled with "multithreaded" static linking to C runtime and another was with "multithreaded DLL" dynamic linking to C runtime via msvcr90.dll/msvcp90.dll. All of them have to match.

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/