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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. extern "C"{
  5. string PATH_OV = "meta/dist/Release/openvibe-designer.sh";
  6. string PATH_AquisitionServer = "meta/dist/Release/openvibe-acquisition-server.sh";
  7. string PATH_FILES = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/";
  8. string pathOVFile = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/signals/p300-xdawn-train2.ov";
  9. string pathClassifierCFG = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-classifier.cfg";
  10. string pathSpatialCFG = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/cfg/p300-spatial-filter.cfg";
  11. string PATH_DEFAULT = "Projekte/OpenViBE_visual_BCI-master/openvibe_visual_bci/datasets";
  12. string fileCopySpellingTaktil = "p300-visual-1-acquisition.xml";
  13. string fileCopySpellingVisuell = "p300-visual-1-acquisition.xml";
  14. string fileXDawnTraining = "p300-visual-2-train-xDAWN.xml";
  15. string fileClassifierTraining = "p300-visual-3-train-classifier.xml";
  16. string filefreeSpellingTaktil = "p300-visual-4-online.xml";
  17. string filefreeSpellingVisuell = "p300-visual-4-online.xml";
  18. string command = "bash";
  19. string nogui = "--no-gui";
  20. string play = "--play";
  21. char* getCommandPS(){
  22. string s = "";
  23. s = s.append("ps").append(" ").append("-e");
  24. char char_array[s.length()+1];
  25. strcpy(char_array, s.c_str());
  26. char* s_convert = char_array;
  27. return s_convert;
  28. }
  29. char* getCommandFreespellingTaktil()
  30. {
  31. string s = "";
  32. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES).append(filefreeSpellingTaktil).append(" ").append(nogui);
  33. char char_array[s.length()+1];
  34. strcpy(char_array, s.c_str());
  35. char* s_convert = char_array;
  36. return s_convert;
  37. }
  38. char* getCommandFreespellingVisuell()
  39. {
  40. string s = "";
  41. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES).append(filefreeSpellingVisuell).append(" ").append(nogui);
  42. char char_array[s.length()+1];
  43. strcpy(char_array, s.c_str());
  44. char* s_convert = char_array;
  45. return s_convert;
  46. }
  47. char* getCommandCopyspellingTaktil()
  48. {
  49. string s = "";
  50. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES).append(fileCopySpellingTaktil).append(" ").append(nogui);
  51. char char_array[s.length()+1];
  52. strcpy(char_array, s.c_str());
  53. char* s_convert = char_array;
  54. return s_convert;
  55. }
  56. char* getCommandCopyspellingVisuell()
  57. {
  58. string s = "";
  59. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES).append(fileCopySpellingVisuell).append(" ").append(nogui);
  60. char char_array[s.length()+1];
  61. strcpy(char_array, s.c_str());
  62. char* s_convert = char_array;
  63. return s_convert;
  64. }
  65. char* getCommandXDawn()
  66. {
  67. string s = "";
  68. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES).append(fileXDawnTraining).append(" ").append(nogui);
  69. char char_array[s.length()+1];
  70. strcpy(char_array, s.c_str());
  71. char* s_convert = char_array;
  72. return s_convert;
  73. }
  74. char* getCommandClassifier()
  75. {
  76. string s = "";
  77. s = s.append(command).append(" ").append(PATH_OV).append(" ").append( play).append(" ").append(PATH_FILES).append(fileClassifierTraining).append(" ").append(nogui);
  78. char char_array[s.length()+1];
  79. strcpy(char_array, s.c_str());
  80. char* s_convert = char_array;
  81. return s_convert;
  82. }
  83. char* getCommandStartAquisitionServer()
  84. {
  85. string s = "";
  86. s = s.append(command).append(" ").append(PATH_AquisitionServer);
  87. char char_array[s.length()+1];
  88. strcpy(char_array, s.c_str());
  89. char* s_convert = char_array;
  90. return s_convert;
  91. }
  92. char* getDefaultPath()
  93. {
  94. string s = PATH_DEFAULT;
  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* getPathOVFile()
  101. {
  102. string s = pathOVFile;
  103. char char_array[s.length()+1];
  104. strcpy(char_array, s.c_str());
  105. char* s_convert = char_array;
  106. return s_convert;
  107. }
  108. char* getSpatialCFGFile()
  109. {
  110. string s = pathSpatialCFG;
  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* getClassifierCFGFile()
  117. {
  118. string s = pathClassifierCFG;
  119. char char_array[s.length()+1];
  120. strcpy(char_array, s.c_str());
  121. char* s_convert = char_array;
  122. return s_convert;
  123. }
  124. }