jamming.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #include "jamming.h"
  2. Jamming::Jamming(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,&Jamming::SigSendStyleToSim,
  16. radarsim,&client::SlotSendStyleToSim);
  17. }
  18. void Jamming::StyleInit()
  19. {
  20. JammingStyle Jamming001;
  21. Jamming001.OpMode = QString::fromLocal8Bit("噪声调频干扰");
  22. Jamming001.fc = 9.5e9;
  23. Jamming001.fs = 20e9;
  24. JammingStyleList.insert(std::pair<int, JammingStyle>(1,Jamming001));
  25. JammingStyle Jamming002;
  26. Jamming002.OpMode = QString::fromLocal8Bit("噪声调幅干扰");
  27. Jamming002.fc = 9.5e9;
  28. Jamming002.fs = 20e9;
  29. JammingStyleList.insert(std::pair<int, JammingStyle>(2,Jamming002));
  30. JammingStyle Jamming003;
  31. Jamming003.OpMode = QString::fromLocal8Bit("射频噪声干扰");
  32. Jamming003.fc = 9.5e9;
  33. Jamming003.fs = 20e9;
  34. JammingStyleList.insert(std::pair<int, JammingStyle>(3,Jamming003));
  35. JammingStyle Jamming004;
  36. Jamming004.OpMode = QString::fromLocal8Bit("距离假目标");
  37. Jamming004.fc = 9.5e9;
  38. Jamming004.fs = 20e9;
  39. JammingStyleList.insert(std::pair<int, JammingStyle>(4,Jamming004));
  40. JammingStyle Jamming005;
  41. Jamming005.OpMode = QString::fromLocal8Bit("速度假目标");
  42. Jamming005.fc = 9.5e9;
  43. Jamming005.fs = 20e9;
  44. JammingStyleList.insert(std::pair<int, JammingStyle>(5,Jamming005));
  45. JammingStyle Jamming006;
  46. Jamming006.OpMode = QString::fromLocal8Bit("速度拖引干扰");
  47. Jamming006.fc = 9.5e9;
  48. Jamming006.fs = 20e9;
  49. JammingStyleList.insert(std::pair<int, JammingStyle>(6,Jamming006));
  50. JammingStyle Jamming007;
  51. Jamming007.OpMode = QString::fromLocal8Bit("间接采样转发干扰");
  52. Jamming007.fc = 9.5e9;
  53. Jamming007.fs = 20e9;
  54. JammingStyleList.insert(std::pair<int, JammingStyle>(7,Jamming007));
  55. JammingStyle Jamming008;
  56. Jamming008.OpMode = QString::fromLocal8Bit("切片转发干扰");
  57. Jamming008.fc = 9.5e9;
  58. Jamming008.fs = 20e9;
  59. JammingStyleList.insert(std::pair<int, JammingStyle>(8,Jamming008));
  60. JammingStyle Jamming009;
  61. Jamming009.OpMode = QString::fromLocal8Bit("DRFM噪声干扰");
  62. Jamming009.fc = 9.5e9;
  63. Jamming009.fs = 20e9;
  64. JammingStyleList.insert(std::pair<int, JammingStyle>(9,Jamming009));
  65. }
  66. void Jamming::StyleUpdate(int newstyle)
  67. {
  68. style = newstyle;
  69. emit SigSendStyleToSim(QString::number(newstyle));
  70. }