Constructor for a boxe for a simple visualization

Concerning processing components: filters, file load/save, visualizations, communication ...
Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Constructor for a boxe for a simple visualization

Post by Tristan »

Hi,
I am trying to develop an interface for my internship which is a bit like the GrazVisalization one. I have several questions :
-first is there a tutorial focused on how to develop a boxe using the visualization toolkit and gtk.h ?
-In one of my attempt I was starting to build what was required which is a constructor of the class like this (in the .cpp) :

CBoxAlgorithmVisualInterface::CBoxAlgorithmVisualInterface(void) :
m_pBuilderInterface(NULL),
m_pMainWindow(NULL),
m_pDrawingArea(NULL),
m_visualizationContext(nullptr)
{
m_oBackgroundColor.pixel = 0;
m_oBackgroundColor.red = 0;
m_oBackgroundColor.green = 0;
m_oBackgroundColor.blue = 0;

m_oForegroundColor.pixel = 0;
m_oForegroundColor.red = 0xFFFF;
m_oForegroundColor.green = 0xFFFF;
m_oForegroundColor.blue = 0xFFFF;
}


However, every time I try to build it, it says in the terminal :
error LNK2005: "public: __thiscall OpenViBEPlugins::SignalProcessing::CBoxAlgorithmVisualInterface::CBoxAlgorithmVisualInterface(void)" (??0CBoxAlgorithmVisualInterface@SignalProcessing@OpenViBEPlugins@@QAE@XZ) dÚjÓ dÚfini(e) dans ovpCBoxAlgorithmVisualInterface.cpp.obj
(translated to already defined) but it is the only time I am specifying the constructor.

-My last question has nothing to do with what's before but in the terminal when I am launching the designer, I have the warning :
[WARNING] File [D:/openvibe-2.2.0-src/dist/extras-Release-x86//bin/openvibe-plugins-contrib-python.dll] is not a plugin module (error:La proc
But the designer is working so I don't know what's wrong.

Thank you so much in advance,
I am just at the beginning of my master degree so I am struggling with things that might be obvious but I don't know what else to do.

Tristan Venot

Thibaut
Posts: 264
Joined: Wed Oct 31, 2018 9:14 am

Re: Constructor for a boxe for a simple visualization

Post by Thibaut »

Hi,
I begin with the second question.
When you build OpenViBE, you have a list of dependencies found or not in this list you have all the driver as :

Code: Select all

--   FAILED to find gtec gMobiLabPlusAPI + lib + dll (optional driver)
--   FAILED to find gtec gUSBampCAPI (optional driver)
--   FAILED to find gtec gNEEDaccessAPI (optional driver)
--   FAILED to find Mitsar device dll (optional driver)
Have you the line ?

Code: Select all

--   Found Python...
if not, you haven't the good version of python for your build (install the 2.7 and the 3) get the x64 if you build with x64 option.

For the first question, personnaly for my first visualisation box i have copy-past an existing box and work with this base.
If you work as an external plugnin (http://openvibe.inria.fr/tutorial-3-how ... -included/) You can give me the git repositery i can check.
Thibaut

Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Re: Constructor for a boxe for a simple visualization

Post by Tristan »

Hi,

Thank you for your answer, it seems that there is a problem indeed with python, it says :
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "2.7")
-- FAILED to find Python (needs v2.7 with bitness matching build target x86)
however Python 2.7 is installed and the cmd knows how to find it so I am a bit lost.

I don't know if it follows the same rules but maybe I can't access the constructor because I don't have the rights to edit it.
I am sending you the git of the boxe (the .cpp and .h) it is a rudimentary code but except the constructor I don't know where the problem could be.
The boxe I am trying to create is in src/boxalgorithm/ VisualInterface.cpp and VisualInterface.h
https://github.com/TristanVenot/Openvibe.git
Thank you again,
Tristan

Thibaut
Posts: 264
Joined: Wed Oct 31, 2018 9:14 am

Re: Constructor for a boxe for a simple visualization

Post by Thibaut »

Hi,
If you build openvibe in x86 mode you must have the pythonx86
try the command :

Code: Select all

build.cmd --platform-target x64
to build in x64 instead and if your python is x64, he can find it. Personally as I test the x86 and x64 version I have both pythons install in different folders:

Code: Select all

python27_x86
python27_x64
python37_x64
For your code i can't see the repositery (maybe a private repo)

Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Re: Constructor for a boxe for a simple visualization

Post by Tristan »

Hi,
Python has been found ! Thank you this part of the problem is solved!

Sorry I did put it in private, now it is public :
https://github.com/TristanVenot/Openvibe.git

Thank you again,
Tristan

Thibaut
Posts: 264
Joined: Wed Oct 31, 2018 9:14 am

Re: Constructor for a boxe for a simple visualization

Post by Thibaut »

Outch it's not as an external plugin, I can't easily download and compile see this tutorial (there is a hello world template) :
http://openvibe.inria.fr/tutorial-3-how ... -included/
With this your repo can be directly down and compile I think actually you copy the file in a different folder to git push/pull.
The first thing i see is you don't need a default constructor you can intialisa your member in initialize method (I did not go so deep in the code to see how it was built by default) the initialize/uninitialize methods are your default constructor/destructor.

Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Re: Constructor for a boxe for a simple visualization

Post by Tristan »

Hi thank you,

I am going to see what I can do, but I just followed this tutorial :
http://openvibe.inria.fr/tutorial-1-imp ... ssing-box/

Thibaut
Posts: 264
Joined: Wed Oct 31, 2018 9:14 am

Re: Constructor for a boxe for a simple visualization

Post by Thibaut »

Ok, you cna see in this tutorial there is no constructor destructor but an initialize and uninitialize function.
You can see in this repo some vizualisation box. (But I'm not an expert of GTK it's certainly not optimized) : https://github.com/tmonseigne/NEUROPERF

Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Re: Constructor for a boxe for a simple visualization

Post by Tristan »

Hi,

It works, it was a matter of priority of constructor, the program had a default constructor, by creating a new constructor, it didn't know which one to deal with therefore it was signaling an error.
I created a parallel box which was exactly the same but with a different name, by doing that the build took into account the default constructor and then switch to the new one I had declared.

My new problem is currently

Code: Select all

 {Error description} : {Box algorithm <VisualInterface> processInput() function failed}, {Error type} : {ErrorType::Internal (code 2)}, {Error location} : {D:\openvibe-2.2.0-src\sdk\kernel\src\kernel\player\ovkCSimulatedBox.cpp::209}
[ ERROR ] {Error description} : {Process failed for box with id (0x0000244b, 0x0000550a) on input 0}, {Error type} : {ErrorType::Internal (code 2)}, {Error location} : {D:\openvibe-2.2.0-src\sdk\kernel\src\kernel\player\ovkCScheduler.cpp::738}
[ ERROR ] Scheduler loop failed.
But I don't think it is the best place in the forum to ask the question, I am going to dig a bit,

Thank you again for your help,
Tristan

Thibaut
Posts: 264
Joined: Wed Oct 31, 2018 9:14 am

Re: Constructor for a boxe for a simple visualization

Post by Thibaut »

the problem is in your VisualInterface Boxe but your git is not update I think.^^ (It's why i suggest you the tutorial for an external plugin you can easily push/pull all repository and others can compile to find the problem

Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Re: Constructor for a boxe for a simple visualization

Post by Tristan »

Here is the new depository :
https://github.com/TristanVenot/openvibe2.0.git

There was also a change in the share folder of dist/extras-release to include the gtk extension for my file.

This is the path of my .cpp just in case :
openvibe-2.2.0-src\extras\contrib\plugins\processing\signal-processing\src\box-algorithms\ovpCBoxAlgorithmVisualInterface.cpp
Thank you again for helping me,
Tristan

Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Transfer from SetSimulation to redraw in GrazVisualisation

Post by Tristan »

Hi,

I am now trying to get different visualization for different directions of stimulation (just as in GrazVisualization), I have a problem with the transfer of the information from the SetSimulation function to the redraw function. Does the process function permit to make a link between the eDirection modified in SetStimulation and the redraw ?

I am giving you my github again
https://github.com/TristanVenot/openvibe2.0.git
The Code is in
contrib/processing/signalprocessing/src/boxalgorithm/VisualInterface.cpp

Thanks again,

Tristan

Thibaut
Posts: 264
Joined: Wed Oct 31, 2018 9:14 am

Re: Constructor for a boxe for a simple visualization

Post by Thibaut »

Hummmm. I see your repo and why is there the extra folder ? you changed all these files ?
But, if I have understand you just wan't to check if you have receive a stimulation when you redraw, there is some possibility :
You can call a redraw fonction when you wan't so you can call a redraw fonction with parameter
if you wan't to keep only a call back (I think it's your method) you can add some member in your class and one of them can be the stimulation update.
Thibaut

Tristan
Posts: 15
Joined: Fri Feb 22, 2019 3:27 pm

Re: Constructor for a boxe for a simple visualization

Post by Tristan »

Hi !

No, I did not change all the files, just one but was unnecessary to upload it, sorry !
I think I missed the point of the stimulation update, however, I find it odd because the program does receive the stimulation however the m_currentDirection (the variable) which gives right or left does not seem to get a new value.

Thanks again,
Tristan

Thibaut
Posts: 264
Joined: Wed Oct 31, 2018 9:14 am

Re: Constructor for a boxe for a simple visualization

Post by Thibaut »

If you have a doubt displays log (a lot of log^^) I have solve some problem with too much display.^^
You can display when you start the process function and when you have a stimulation. make a little scenario with only your visual box and a clock stimulator (or keypress or other stimulator sender) and check the log if you pass and read the stimulation correctly
Thibaut

Post Reply