radar.cpp 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #include "radar.h"
  2. Radar::Radar(QObject *parent,
  3. uint32_t PlatformID, uint32_t InstanceID, bool SwitchMode,
  4. QString Name, QUrl SimulationUrl,
  5. int style) : ExternalSim(parent)
  6. {
  7. StyleInit();
  8. this->PlatformID = PlatformID;
  9. this->InstanceID = InstanceID;
  10. this->SwitchMode = SwitchMode;
  11. this->Name = Name;
  12. this->SimulatorUrl = SimulationUrl;
  13. this->style = style;
  14. radarsim = new client(nullptr, SimulationUrl);
  15. connect(this,&Radar::SigSendStyleToSim,
  16. radarsim,&client::SlotSendStyleToSim);
  17. }
  18. void Radar::StyleInit()
  19. {
  20. Style Radar101;
  21. Radar101.fs = 20e9;
  22. Radar101.fc = 9.5e9;
  23. Radar101.moduType = QString::fromLocal8Bit("矩形脉冲");
  24. Radar101.PRFMode = QString::fromLocal8Bit("抖动");
  25. Radar101.PRFs.push_back(1/2e-6);
  26. Radar101.PRFs.push_back(1/3e-6);
  27. Radar101.PRFs.push_back(1/4e-6);
  28. Radar101.PulseWidth = 1e-6;
  29. RadarStyleList.insert(std::pair<int, Style>(101,Radar101));
  30. Style Radar201;
  31. Radar201.fs = 20e9;
  32. Radar201.fc = 9.5e9;
  33. Radar201.moduType = QString::fromLocal8Bit("相位编码");
  34. Radar201.PRFMode = QString::fromLocal8Bit("抖动");
  35. Radar201.PRFs.push_back(1/2e-6);
  36. Radar201.PRFs.push_back(1/3e-6);
  37. Radar201.PRFs.push_back(1/4e-6);
  38. Radar201.PulseWidth = 1e-6;
  39. RadarStyleList.insert(std::pair<int, Style>(201,Radar201));
  40. Style Radar301;
  41. Radar301.fs = 20e9;
  42. Radar301.fc = 9.5e9;
  43. Radar301.moduType = QString::fromLocal8Bit("线性调频");
  44. Radar301.PRFMode = QString::fromLocal8Bit("抖动");
  45. Radar301.PRFs.push_back(1/2e-6);
  46. Radar301.PRFs.push_back(1/3e-6);
  47. Radar301.PRFs.push_back(1/4e-6);
  48. Radar301.PulseWidth = 1e-6;
  49. Radar301.BandWidth = 1e9;
  50. RadarStyleList.insert(std::pair<int, Style>(301,Radar301));
  51. Style Radar401;
  52. Radar401.fs = 20e9;
  53. Radar401.fc = 9.5e9;
  54. Radar401.moduType = QString::fromLocal8Bit("调频连续");
  55. Radar401.PRFMode = QString::fromLocal8Bit("抖动");
  56. Radar401.PRFs.push_back(1/2e-6);
  57. Radar401.PRFs.push_back(1/3e-6);
  58. Radar401.PRFs.push_back(1/4e-6);
  59. Radar401.PulseWidth = 1e-6;
  60. Radar401.BandWidth = 1e9;
  61. RadarStyleList.insert(std::pair<int, Style>(401,Radar401));
  62. Style Radar102;
  63. Radar102.fs = 20e9;
  64. Radar102.fc = 9.5e9;
  65. Radar102.moduType = QString::fromLocal8Bit("矩形脉冲");
  66. Radar102.PRFMode = QString::fromLocal8Bit("固定");
  67. Radar102.PRFs.push_back(1/3e-6);
  68. Radar102.PulseWidth = 1e-6;
  69. RadarStyleList.insert(std::pair<int, Style>(102,Radar102));
  70. Style Radar202;
  71. Radar202.fs = 20e9;
  72. Radar202.fc = 9.5e9;
  73. Radar202.moduType = QString::fromLocal8Bit("相位编码");
  74. Radar202.PRFMode = QString::fromLocal8Bit("固定");
  75. Radar202.PRFs.push_back(1/3e-6);
  76. Radar202.PulseWidth = 1e-6;
  77. RadarStyleList.insert(std::pair<int, Style>(202,Radar202));
  78. Style Radar302;
  79. Radar302.fs = 20e9;
  80. Radar302.fc = 9.5e9;
  81. Radar302.moduType = QString::fromLocal8Bit("线性调频");
  82. Radar302.PRFMode = QString::fromLocal8Bit("固定");
  83. Radar302.PRFs.push_back(1/3e-6);
  84. Radar302.PulseWidth = 1e-6;
  85. Radar302.BandWidth = 1e9;
  86. RadarStyleList.insert(std::pair<int, Style>(302,Radar302));
  87. Style Radar402;
  88. Radar402.fs = 20e9;
  89. Radar402.fc = 9.5e9;
  90. Radar402.moduType = QString::fromLocal8Bit("调频连续");
  91. Radar402.PRFMode = QString::fromLocal8Bit("固定");
  92. Radar402.PRFs.push_back(1/3e-6);
  93. Radar402.PulseWidth = 1e-6;
  94. Radar402.BandWidth = 1e9;
  95. RadarStyleList.insert(std::pair<int, Style>(402,Radar402));
  96. Style Radar103;
  97. Radar103.fs = 20e9;
  98. Radar103.fc = 9.5e9;
  99. Radar103.moduType = QString::fromLocal8Bit("矩形脉冲");
  100. Radar103.PRFMode = QString::fromLocal8Bit("固定");
  101. Radar103.PRFs.push_back(1/2e-6);
  102. Radar103.PulseWidth = 0.5e-6;
  103. RadarStyleList.insert(std::pair<int, Style>(103,Radar103));
  104. Style Radar203;
  105. Radar203.fs = 20e9;
  106. Radar203.fc = 9.5e9;
  107. Radar203.moduType = QString::fromLocal8Bit("相位编码");
  108. Radar203.PRFMode = QString::fromLocal8Bit("固定");
  109. Radar203.PRFs.push_back(1/2e-6);
  110. Radar203.PulseWidth = 0.5e-6;
  111. RadarStyleList.insert(std::pair<int, Style>(203,Radar203));
  112. Style Radar303;
  113. Radar303.fs = 20e9;
  114. Radar303.fc = 9.5e9;
  115. Radar303.moduType = QString::fromLocal8Bit("线性调频");
  116. Radar303.PRFMode = QString::fromLocal8Bit("固定");
  117. Radar303.PRFs.push_back(1/2e-6);
  118. Radar303.PulseWidth = 0.5e-6;
  119. Radar303.BandWidth = 0.5e9;
  120. RadarStyleList.insert(std::pair<int, Style>(303,Radar303));
  121. Style Radar403;
  122. Radar403.fs = 20e9;
  123. Radar403.fc = 9.5e9;
  124. Radar403.moduType = QString::fromLocal8Bit("调频连续");
  125. Radar403.PRFMode = QString::fromLocal8Bit("固定");
  126. Radar403.PRFs.push_back(1/2e-6);
  127. Radar403.PulseWidth = 0.5e-6;
  128. Radar303.BandWidth = 0.5e9;
  129. RadarStyleList.insert(std::pair<int, Style>(403,Radar403));
  130. }
  131. void Radar::StyleUpdate(int newstyle)
  132. {
  133. style = newstyle;
  134. emit SigSendStyleToSim(QString::number(newstyle));
  135. }