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.6KB

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