123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- #include "radar.h"
- Radar::Radar(QObject *parent,
- uint32_t PlatformID, uint32_t InstanceID, bool SwitchMode,
- QString Name, QUrl SimulationUrl,
- int style) : ExternalSim(parent)
- {
- StyleInit();
- this->PlatformID = PlatformID;
- this->InstanceID = InstanceID;
- this->SwitchMode = SwitchMode;
- this->Name = Name;
- this->SimulatorUrl = SimulationUrl;
- this->style = style;
- radarsim = new client(nullptr, SimulationUrl);
- connect(this,&Radar::SigSendStyleToSim,
- radarsim,&client::SlotSendStyleToSim);
- }
- void Radar::StyleInit()
- {
- Style Radar101;
- Radar101.fs = 20e9;
- Radar101.fc = 9.5e9;
- Radar101.moduType = QString::fromLocal8Bit("矩形脉冲");
- Radar101.PRFMode = QString::fromLocal8Bit("抖动");
- Radar101.PRFs.push_back(1/2e-6);
- Radar101.PRFs.push_back(1/3e-6);
- Radar101.PRFs.push_back(1/4e-6);
- Radar101.PulseWidth = 1e-6;
- RadarStyleList.insert(std::pair<int, Style>(101,Radar101));
- Style Radar201;
- Radar201.fs = 20e9;
- Radar201.fc = 9.5e9;
- Radar201.moduType = QString::fromLocal8Bit("相位编码");
- Radar201.PRFMode = QString::fromLocal8Bit("抖动");
- Radar201.PRFs.push_back(1/2e-6);
- Radar201.PRFs.push_back(1/3e-6);
- Radar201.PRFs.push_back(1/4e-6);
- Radar201.PulseWidth = 1e-6;
- RadarStyleList.insert(std::pair<int, Style>(201,Radar201));
- Style Radar301;
- Radar301.fs = 20e9;
- Radar301.fc = 9.5e9;
- Radar301.moduType = QString::fromLocal8Bit("线性调频");
- Radar301.PRFMode = QString::fromLocal8Bit("抖动");
- Radar301.PRFs.push_back(1/2e-6);
- Radar301.PRFs.push_back(1/3e-6);
- Radar301.PRFs.push_back(1/4e-6);
- Radar301.PulseWidth = 1e-6;
- Radar301.BandWidth = 1e9;
- RadarStyleList.insert(std::pair<int, Style>(301,Radar301));
- Style Radar401;
- Radar401.fs = 20e9;
- Radar401.fc = 9.5e9;
- Radar401.moduType = QString::fromLocal8Bit("调频连续");
- Radar401.PRFMode = QString::fromLocal8Bit("抖动");
- Radar401.PRFs.push_back(1/2e-6);
- Radar401.PRFs.push_back(1/3e-6);
- Radar401.PRFs.push_back(1/4e-6);
- Radar401.PulseWidth = 1e-6;
- Radar401.BandWidth = 1e9;
- RadarStyleList.insert(std::pair<int, Style>(401,Radar401));
- Style Radar102;
- Radar102.fs = 20e9;
- Radar102.fc = 9.5e9;
- Radar102.moduType = QString::fromLocal8Bit("矩形脉冲");
- Radar102.PRFMode = QString::fromLocal8Bit("固定");
- Radar102.PRFs.push_back(1/3e-6);
- Radar102.PulseWidth = 1e-6;
- RadarStyleList.insert(std::pair<int, Style>(102,Radar102));
- Style Radar202;
- Radar202.fs = 20e9;
- Radar202.fc = 9.5e9;
- Radar202.moduType = QString::fromLocal8Bit("相位编码");
- Radar202.PRFMode = QString::fromLocal8Bit("固定");
- Radar202.PRFs.push_back(1/3e-6);
- Radar202.PulseWidth = 1e-6;
- RadarStyleList.insert(std::pair<int, Style>(202,Radar202));
- Style Radar302;
- Radar302.fs = 20e9;
- Radar302.fc = 9.5e9;
- Radar302.moduType = QString::fromLocal8Bit("线性调频");
- Radar302.PRFMode = QString::fromLocal8Bit("固定");
- Radar302.PRFs.push_back(1/3e-6);
- Radar302.PulseWidth = 1e-6;
- Radar302.BandWidth = 1e9;
- RadarStyleList.insert(std::pair<int, Style>(302,Radar302));
- Style Radar402;
- Radar402.fs = 20e9;
- Radar402.fc = 9.5e9;
- Radar402.moduType = QString::fromLocal8Bit("调频连续");
- Radar402.PRFMode = QString::fromLocal8Bit("固定");
- Radar402.PRFs.push_back(1/3e-6);
- Radar402.PulseWidth = 1e-6;
- Radar402.BandWidth = 1e9;
- RadarStyleList.insert(std::pair<int, Style>(402,Radar402));
- Style Radar103;
- Radar103.fs = 20e9;
- Radar103.fc = 9.5e9;
- Radar103.moduType = QString::fromLocal8Bit("矩形脉冲");
- Radar103.PRFMode = QString::fromLocal8Bit("固定");
- Radar103.PRFs.push_back(1/2e-6);
- Radar103.PulseWidth = 0.5e-6;
- RadarStyleList.insert(std::pair<int, Style>(103,Radar103));
- Style Radar203;
- Radar203.fs = 20e9;
- Radar203.fc = 9.5e9;
- Radar203.moduType = QString::fromLocal8Bit("相位编码");
- Radar203.PRFMode = QString::fromLocal8Bit("固定");
- Radar203.PRFs.push_back(1/2e-6);
- Radar203.PulseWidth = 0.5e-6;
- RadarStyleList.insert(std::pair<int, Style>(203,Radar203));
- Style Radar303;
- Radar303.fs = 20e9;
- Radar303.fc = 9.5e9;
- Radar303.moduType = QString::fromLocal8Bit("线性调频");
- Radar303.PRFMode = QString::fromLocal8Bit("固定");
- Radar303.PRFs.push_back(1/2e-6);
- Radar303.PulseWidth = 0.5e-6;
- Radar303.BandWidth = 0.5e9;
- RadarStyleList.insert(std::pair<int, Style>(303,Radar303));
- Style Radar403;
- Radar403.fs = 20e9;
- Radar403.fc = 9.5e9;
- Radar403.moduType = QString::fromLocal8Bit("调频连续");
- Radar403.PRFMode = QString::fromLocal8Bit("固定");
- Radar403.PRFs.push_back(1/2e-6);
- Radar403.PulseWidth = 0.5e-6;
- Radar303.BandWidth = 0.5e9;
- RadarStyleList.insert(std::pair<int, Style>(403,Radar403));
- }
- void Radar::StyleUpdate(int newstyle)
- {
- style = newstyle;
- emit SigSendStyleToSim(QString::number(newstyle));
- }
|