radarsiggen.cpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #include "radarsiggen.h"
  2. RadarSigGen::RadarSigGen(QObject *parent) : QObject(parent)
  3. {
  4. SigMutex = new QMutex();
  5. sig = new double();
  6. fs = new double();
  7. PRF = new double();
  8. len = new double();
  9. coderSig = new coder::array<double,1U>();
  10. }
  11. void RadarSigGen::SlotRadarGen(int order)
  12. {
  13. qDebug() << QString::fromLocal8Bit("生成信号")<<order;
  14. sig = new double();
  15. len = new double();
  16. SigMutex->lock();
  17. if (nullptr != sig)
  18. {
  19. delete sig;
  20. }
  21. switch (order) {
  22. case 1:
  23. sig = new double[400000];
  24. RadarSignalGenerator001(sig,fs,PRF);
  25. break;
  26. case 2:
  27. coderSig = new coder::array<double,1U>[400000];
  28. sig = new double[400000];
  29. RadarSignalGenerator101(coderSig[0],fs,PRF,len);
  30. sig = coderSig->data();
  31. break;
  32. case 3:
  33. sig = new double[400000];
  34. coderSig = new coder::array<double,1U>[400000];
  35. RadarSignalGenerator102(coderSig[0],fs,PRF,len);
  36. sig = coderSig->data();
  37. break;
  38. case 4:
  39. sig = new double[400000];
  40. coderSig = new coder::array<double,1U>[400000];
  41. RadarSignalGenerator103(coderSig[0],fs,PRF,len);
  42. sig = coderSig->data();
  43. break;
  44. case 5:
  45. sig = new double[400000];
  46. coderSig = new coder::array<double,1U>[400000];
  47. RadarSignalGenerator201(coderSig[0],fs,PRF,len);
  48. sig = coderSig->data();
  49. break;
  50. case 6:
  51. sig = new double[400000];
  52. coderSig = new coder::array<double,1U>[400000];
  53. RadarSignalGenerator202(coderSig[0],fs,PRF,len);
  54. sig = coderSig->data();
  55. break;
  56. case 7:
  57. sig = new double[400000];
  58. coderSig = new coder::array<double,1U>[400000];
  59. RadarSignalGenerator203(coderSig[0],fs,PRF,len);
  60. sig = coderSig->data();
  61. break;
  62. case 8:
  63. sig = new double[400000];
  64. coderSig = new coder::array<double,1U>[400000];
  65. RadarSignalGenerator301(coderSig[0],fs,PRF,len);
  66. sig = coderSig->data();
  67. break;
  68. case 9:
  69. sig = new double[400000];
  70. coderSig = new coder::array<double,1U>[400000];
  71. RadarSignalGenerator302(coderSig[0],fs,PRF,len);
  72. sig = coderSig->data();
  73. break;
  74. case 10:
  75. sig = new double[400000];
  76. coderSig = new coder::array<double,1U>[400000];
  77. RadarSignalGenerator303(coderSig[0],fs,PRF,len);
  78. sig = coderSig->data();
  79. break;
  80. case 11:
  81. sig = new double[400000];
  82. coderSig = new coder::array<double,1U>[400000];
  83. RadarSignalGenerator401(coderSig[0],fs,PRF,len);
  84. sig = coderSig->data();
  85. break;
  86. case 12:
  87. sig = new double[400000];
  88. coderSig = new coder::array<double,1U>[400000];
  89. RadarSignalGenerator402(coderSig[0],fs,PRF,len);
  90. sig = coderSig->data();
  91. break;
  92. case 13:
  93. sig = new double[400000];
  94. coderSig = new coder::array<double,1U>[400000];
  95. RadarSignalGenerator403(coderSig[0],fs,PRF,len);
  96. sig = coderSig->data();
  97. break;
  98. default:
  99. sig = new double[20];
  100. break;
  101. }
  102. // for (int i = 10000;i < 10050;i++)
  103. // {
  104. // std::cout << sig[i] << std::endl;
  105. // }
  106. SigMutex->unlock();
  107. }