You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dll.cpp 7.8KB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. extern "C"{
  5. //allgemein
  6. //-------------------------------------------------------------------------------------------------------------------------------------
  7. string PATH_OV = "meta/dist/Release/openvibe-designer.sh";
  8. string PATH_AquisitionServer = "meta/dist/Release/openvibe-acquisition-server.sh";
  9. string fileXDawnTraining = "p300-visual-2-train-xDAWN.xml";
  10. string fileClassifierTraining = "p300-visual-3-train-classifier.xml";
  11. //visuell
  12. //-------------------------------------------------------------------------------------------------------------------------------------
  13. string PATH_FILES_Visual = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/";
  14. string pathOVFile_visuell = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/signals/p300-xdawn-train2.ov";
  15. string pathClassifierCFG_visuell = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-classifier.cfg";
  16. string pathSpatialCFG_visuell = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-spatial-filter.cfg";
  17. string PATH_DEFAULT_visuell = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets";
  18. string fileCopySpellingVisuell = "p300-visual-1-acquisition.xml";
  19. string filefreeSpellingVisuell = "p300-visual-4-online.xml";
  20. //taktil
  21. //------------------------------------------------------------------------------------------------------------------------------------
  22. string fileCopySpellingTaktil = "p300-visual-1-acquisition.xml";
  23. string filefreeSpellingTaktil = "p300-visual-4-online.xml";
  24. string PATH_FILES_taktil = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/";
  25. string pathOVFile_taktil = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/signals/p300-xdawn-train2.ov";
  26. string pathClassifierCFG_taktil = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-classifier.cfg";
  27. string pathSpatialCFG_taktil = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-spatial-filter.cfg";
  28. string PATH_DEFAULT_taktil = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets";
  29. //Befehle
  30. //-------------------------------------------------------------------------------------------------------------------------------------
  31. string command = "bash";
  32. string nogui = "--no-gui";
  33. string play = "--play";
  34. char* getCommandPS(){
  35. string s = "";
  36. s = s.append("ps").append(" ").append("-e");
  37. char char_array[s.length()+1];
  38. strcpy(char_array, s.c_str());
  39. char* s_convert = char_array;
  40. return s_convert;
  41. }
  42. char* getCommandFreespellingTaktil()
  43. {
  44. string s = "";
  45. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES_taktil).append(filefreeSpellingTaktil).append(" ").append(nogui);
  46. char char_array[s.length()+1];
  47. strcpy(char_array, s.c_str());
  48. char* s_convert = char_array;
  49. return s_convert;
  50. }
  51. char* getCommandFreespellingVisuell()
  52. {
  53. string s = "";
  54. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES_Visual).append(filefreeSpellingVisuell).append(" ").append(nogui);
  55. char char_array[s.length()+1];
  56. strcpy(char_array, s.c_str());
  57. char* s_convert = char_array;
  58. return s_convert;
  59. }
  60. char* getCommandCopyspellingTaktil()
  61. {
  62. string s = "";
  63. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES_taktil).append(fileCopySpellingTaktil).append(" ").append(nogui);
  64. char char_array[s.length()+1];
  65. strcpy(char_array, s.c_str());
  66. char* s_convert = char_array;
  67. return s_convert;
  68. }
  69. char* getCommandCopyspellingVisuell()
  70. {
  71. string s = "";
  72. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES_Visual).append(fileCopySpellingVisuell).append(" ").append(nogui);
  73. char char_array[s.length()+1];
  74. strcpy(char_array, s.c_str());
  75. char* s_convert = char_array;
  76. return s_convert;
  77. }
  78. char* getCommandXDawn_taktil()
  79. {
  80. string s = "";
  81. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES_taktil).append(fileXDawnTraining).append(" ").append(nogui);
  82. char char_array[s.length()+1];
  83. strcpy(char_array, s.c_str());
  84. char* s_convert = char_array;
  85. return s_convert;
  86. }
  87. char* getCommandXDawn_visuell()
  88. {
  89. string s = "";
  90. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES_Visual).append(fileXDawnTraining).append(" ").append(nogui);
  91. char char_array[s.length()+1];
  92. strcpy(char_array, s.c_str());
  93. char* s_convert = char_array;
  94. return s_convert;
  95. }
  96. char* getCommandClassifier_visuell()
  97. {
  98. string s = "";
  99. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES_Visual).append(fileClassifierTraining).append(" ").append(nogui);
  100. char char_array[s.length()+1];
  101. strcpy(char_array, s.c_str());
  102. char* s_convert = char_array;
  103. return s_convert;
  104. }
  105. char* getCommandClassifier_taktil()
  106. {
  107. string s = "";
  108. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES_taktil).append(fileClassifierTraining).append(" ").append(nogui);
  109. char char_array[s.length()+1];
  110. strcpy(char_array, s.c_str());
  111. char* s_convert = char_array;
  112. return s_convert;
  113. }
  114. char* getCommandStartAquisitionServer()
  115. {
  116. string s = "";
  117. s = s.append(command).append(" ").append(PATH_AquisitionServer);
  118. char char_array[s.length()+1];
  119. strcpy(char_array, s.c_str());
  120. char* s_convert = char_array;
  121. return s_convert;
  122. }
  123. char* getDefaultPath_visuell()
  124. {
  125. string s = PATH_DEFAULT_visuell;
  126. char char_array[s.length()+1];
  127. strcpy(char_array, s.c_str());
  128. char* s_convert = char_array;
  129. return s_convert;
  130. }
  131. char* getDefaultPath_taktil()
  132. {
  133. string s = PATH_DEFAULT_taktil;
  134. char char_array[s.length()+1];
  135. strcpy(char_array, s.c_str());
  136. char* s_convert = char_array;
  137. return s_convert;
  138. }
  139. char* getPathOVFile_visuell()
  140. {
  141. string s = pathOVFile_visuell;
  142. char char_array[s.length()+1];
  143. strcpy(char_array, s.c_str());
  144. char* s_convert = char_array;
  145. return s_convert;
  146. }
  147. char* getSpatialCFGFile_visuell()
  148. {
  149. string s = pathSpatialCFG_visuell;
  150. char char_array[s.length()+1];
  151. strcpy(char_array, s.c_str());
  152. char* s_convert = char_array;
  153. return s_convert;
  154. }
  155. char* getClassifierCFGFile_visuell()
  156. {
  157. string s = pathClassifierCFG_visuell;
  158. char char_array[s.length()+1];
  159. strcpy(char_array, s.c_str());
  160. char* s_convert = char_array;
  161. return s_convert;
  162. }
  163. char* getPathOVFile_taktil()
  164. {
  165. string s = pathOVFile_taktil;
  166. char char_array[s.length()+1];
  167. strcpy(char_array, s.c_str());
  168. char* s_convert = char_array;
  169. return s_convert;
  170. }
  171. char* getSpatialCFGFile_taktil()
  172. {
  173. string s = pathSpatialCFG_taktil;
  174. char char_array[s.length()+1];
  175. strcpy(char_array, s.c_str());
  176. char* s_convert = char_array;
  177. return s_convert;
  178. }
  179. char* getClassifierCFGFile_taktil()
  180. {
  181. string s = pathClassifierCFG_taktil;
  182. char char_array[s.length()+1];
  183. strcpy(char_array, s.c_str());
  184. char* s_convert = char_array;
  185. return s_convert;
  186. }
  187. }