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 8.0KB

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