Newbie question: accessing parameters
Posted: 11 Dec 2015, 06:58
Hi,
In my custom application, I write the SWLDA scores into a file when the P3Speller flashes finish. To do so, I modified "Association.cpp" and "Association.h" files. However, the output file was located in a rigid filepath (e.g., "../data/SWLDAscores.txt").
Now I want to store that file dinamically inside the P3Speller data directory and rename it as the data file name in each run. For instance, the folder might be "data/test001" and the file (for the first run) might be "data/test001/testS001R01.txt".
In order to do that, I thought that I could access to the environment parameters inside "Association.cpp" and stablish the output file name checking the DataDirectory, SubjectName, SubjectSession and SubjectRun parameters, but I do not know how to do it.
In "P3SpellerTask.cpp", for example, it is enough to check them doing something like this:
But I cannot do it inside "Association.cpp" class. I guessed that is because that class does not inherit from the Environment class, so I tried to follow "Your's code environment" section from here: http://www.bci2000.org/wiki/index.php/P ... ment_Class, without results.
I do not really understand what I should do. Can someone help me?
Thanks in advance,
VĂctor.
In my custom application, I write the SWLDA scores into a file when the P3Speller flashes finish. To do so, I modified "Association.cpp" and "Association.h" files. However, the output file was located in a rigid filepath (e.g., "../data/SWLDAscores.txt").
Now I want to store that file dinamically inside the P3Speller data directory and rename it as the data file name in each run. For instance, the folder might be "data/test001" and the file (for the first run) might be "data/test001/testS001R01.txt".
In order to do that, I thought that I could access to the environment parameters inside "Association.cpp" and stablish the output file name checking the DataDirectory, SubjectName, SubjectSession and SubjectRun parameters, but I do not know how to do it.
In "P3SpellerTask.cpp", for example, it is enough to check them doing something like this:
Code: Select all
string d_dir = Parameter("DataDirectory");I do not really understand what I should do. Can someone help me?
Thanks in advance,
VĂctor.