Running the Designer via cmd

About the GUI application to design signal processing pipelines
Post Reply
dan
Posts: 4
Joined: Sun Feb 07, 2016 5:35 pm

Running the Designer via cmd

Post by dan »

Hi, I have a designer scenario in which I would like to run via a batch file. I am aware that there exists this command --play filename : plays the opened scenario (see also --no-session-management) which plays a scenario but my problem is that this scenario i would like to run has a "brainamp file reader box" in which I would like to pass the file as a parameter in the cmd, is it possible? Since I would like to run it automatically, each time using a different file .. can someone help, please?

jtlindgren
Posts: 778
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Running the Designer via cmd

Post by jtlindgren »

Hi Dan,

you can do what you want by specifying the filename as a configuration token as follows,

Code: Select all

openvibe-designer.cmd --define myFile C:/temp/some.file
and then instead of the actual file path, write ${myFile} to the box configuration. It will be expanded runtime.

Happy hacking,
Jussi

dan
Posts: 4
Joined: Sun Feb 07, 2016 5:35 pm

Re: Running the Designer via cmd

Post by dan »

I tried the following command

openvibe-designer.cmd --play C:/Users/Daniela/Desktop/conf1.xml --define brainampFile C:/Users/Daniela/Desktop/recording/michael.vhdr

and the designer opens the scenario and starts but I get an error 'could not open file' but that file exists because when I input it manually in the box, it works, but for some reason, the cmd is reading the path as if there is a space in front and i get an error
[ ERROR ] <Algorithm::Brainamp file reader> Could not open file [ 'C:/Users/Daniela/Desktop/recording/michael.vhdr']

You see that space in front between [ and '? but if I do not do the space between the brainampFile and the path, I still get an error .. any ideas?

jtlindgren
Posts: 778
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Running the Designer via cmd

Post by jtlindgren »

The problem is not only the space, but the ' ' characters. Where are they coming from? The filename shouldn't have them in it. If you look at the configuration token you defined in the pulldown menu Preferences, does it have ' ' around it or no? If you need to handle filenames with spaces (this always leads to trouble), you should try the " " chars instead, but even they shouldn't be there in the final token as is expanded/shown by Designer.

Hope this helps,

Cheers,
Jussi

dan
Posts: 4
Joined: Sun Feb 07, 2016 5:35 pm

Re: Running the Designer via cmd

Post by dan »

You're right - I added the '' by mistake after pasting the error but without them, I still get the error. I guess the problem is the space but Im not sure what I am doing wrong?

[ ERROR ] <Algorithm::Brainamp file reader> Could not open file [ C:/Users/Daniela/Desktop/recording/michael.vhdr]

jtlindgren
Posts: 778
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Running the Designer via cmd

Post by jtlindgren »

I'm afraid I don't understand where this space comes from. Do you get it if you put the token to the message field of the 'Hello World' box or if you look at the tokens value in Preferences?

dan
Posts: 4
Joined: Sun Feb 07, 2016 5:35 pm

Re: Running the Designer via cmd

Post by dan »

I found the problem!!! there was a space before ${brainampFile} !! It was too obvious to find :(

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Running the Designer via cmd

Post by yrenard »

Dear Dan,

maybe you should use the equal sign between the token name and the token value as is defined in the configuration files :

Code: Select all

--define myFile=C:/temp/some.file
if your file name has spaces or special characters, then you can use double brackets like in :

Code: Select all

--define "myFile=C:/temp/some filename with spaces.file"
hope this helps,
Yann

jtlindgren
Posts: 778
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Running the Designer via cmd

Post by jtlindgren »

Hi Yann,

just a quick note about the separator: I couldn't get "=" to parse in all circumstances on Windows, so in the current mainstream openvibe the token and the value should be separated just by a space.


Cheers,
Jussi

Post Reply