View unanswered posts | View active topics It is currently 24 Sep 2017, 21:12



Reply to topic  [ 8 posts ] 
building Block with dynamic I/O 
Author Message

Joined: 17 Apr 2010, 13:05
Posts: 6
Reply with quote
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


11 May 2010, 07:18
Profile

Joined: 17 Apr 2010, 13:05
Posts: 6
Reply with quote
well, I manage to solve the 2nd problem, by using double_matrix_init_info_ptr.

But still stuck at the 1st one...


12 May 2010, 04:02
Profile

Joined: 21 Mar 2008, 22:35
Posts: 131
Reply with quote
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


12 May 2010, 22:25
Profile

Joined: 17 Apr 2010, 13:05
Posts: 6
Reply with quote
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


13 May 2010, 10:14
Profile

Joined: 17 Apr 2010, 13:05
Posts: 6
Reply with quote
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 688 times
13 May 2010, 17:05
Profile

Joined: 21 Mar 2008, 22:35
Posts: 131
Reply with quote
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


15 May 2010, 00:15
Profile

Joined: 17 Apr 2010, 13:05
Posts: 6
Reply with quote
hi, now all the bug have gone ..
:D :D :D

THANK YOU VERY MUCH !!!

Quan


15 May 2010, 00:55
Profile

Joined: 01 Mar 2016, 01:14
Posts: 1
Location: Россия
Reply with quote
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.


04 Mar 2016, 18:40
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.