254 lines
9.1 KiB
C++
254 lines
9.1 KiB
C++
#include "../MainWindow.h"
|
|
#include "a2_信号侦察.h"
|
|
#include "a3_信号处理.h"
|
|
#include "a4_信号生成.h"
|
|
#include "a5_信号对消.h"
|
|
#include "function.export.h"
|
|
#include "a6_存储列表.h"
|
|
Data_source data_source;
|
|
void Data_source::set_root(MainWindow* root) { m_root = root; }
|
|
Data_source::Data_source() {}
|
|
// 1
|
|
采集预处理::采集预处理() {
|
|
mainLayout = new QHBoxLayout(this);
|
|
mainLayout->setMargin(0);
|
|
mainLayout->addLayout(createV(), 3);
|
|
auto fw = new FunctionWidget();
|
|
auto 中心频率 = create_input("中心频率", "MHZ");
|
|
auto 带宽 = create_input("带宽", "MHZ");
|
|
auto 采样率 = create_input("采样率", "MHZ");
|
|
auto layout = new QVBoxLayout;
|
|
layout->setSpacing(0);
|
|
layout->addLayout(中心频率);
|
|
layout->addSpacing(10);
|
|
layout->addLayout(带宽);
|
|
layout->addSpacing(10);
|
|
layout->addLayout(采样率);
|
|
fw->init("预处理参数", "展示设备宽采效果", layout);
|
|
mainLayout->addWidget(fw, 1);
|
|
}
|
|
QVBoxLayout* 采集预处理::createV() {
|
|
QVBoxLayout* ret;
|
|
ret = new QVBoxLayout();
|
|
m_频谱图 = new T_采集预处理_频谱图;
|
|
m_频谱图->init();
|
|
ret->addWidget(m_频谱图);
|
|
m_瀑布图 = new T_采集预处理_瀑布图;
|
|
m_瀑布图->init();
|
|
ret->addWidget(m_瀑布图);
|
|
return ret;
|
|
}
|
|
void 采集预处理::paintEvent(QPaintEvent* event) {
|
|
// QPainter painter(this);
|
|
// painter.fillRect(event->rect(), Qt::white);
|
|
QWidget::paintEvent(event);
|
|
}
|
|
|
|
// 2
|
|
QVBoxLayout* 信号侦察::createV() {
|
|
auto ret = new QVBoxLayout;
|
|
m_频谱图 = new T_信号侦察_频谱图();
|
|
m_频谱图->init();
|
|
ret->addWidget(m_频谱图, 1);
|
|
QStringList headers = {"子带通道", "频点", "出联状态", "锁定状态", "出联时间", "出联时长", "符号率", "频值", "EbNo", "误码率", "电平", "帧定时"};
|
|
TreeModel* model = new TreeModel(headers);
|
|
QStringList parentData = {"父节点1", "数据2", "数据3"};
|
|
model->addNode(parentData);
|
|
QModelIndex parentIndex = model->index(0, 0);
|
|
QStringList childData = {"子节点1", "数据2", "数据3"};
|
|
model->addNode(childData, parentIndex);
|
|
treeView = new TreeView;
|
|
treeView->setModel(model);
|
|
TreeDelegate* delegate = new TreeDelegate;
|
|
treeView->setItemDelegate(delegate);
|
|
treeView->expandAll();
|
|
ret->addWidget(treeView, 1);
|
|
return ret;
|
|
}
|
|
|
|
信号侦察::信号侦察() {
|
|
mainLayout = new QHBoxLayout(this);
|
|
mainLayout->setMargin(0);mainLayout->setMargin(0);
|
|
mainLayout->addLayout(createV(), 3);
|
|
auto fw = new FunctionWidget();
|
|
auto layout = new QVBoxLayout;
|
|
layout->setSpacing(0);
|
|
fw->init("侦察参数", "展示参数信息", layout);
|
|
layout->addLayout(create_check_box("载波通道", {"221", "222"}));
|
|
layout->addLayout(create_input("中心频率", "MHz"));
|
|
layout->addLayout(create_input("带宽", "KHz"));
|
|
layout->addLayout(create_input("采样率", "KHz"));
|
|
layout->addLayout(create_check_box("调制方式", {"221", "222"}));
|
|
layout->addLayout(create_input("符号率", "KBd"));
|
|
layout->addLayout(create_check_box("译码方式", {"TPC"}));
|
|
mainLayout->addWidget(fw, 1);
|
|
}
|
|
void 信号侦察::paintEvent(QPaintEvent* event) {
|
|
QPainter painter(this);
|
|
//painter.fillRect(event->rect(), Qt::yellow);
|
|
painter.end();
|
|
QWidget::paintEvent(event);
|
|
}
|
|
|
|
|
|
// 3
|
|
信号处理::信号处理() {
|
|
mainLayout = new QHBoxLayout(this);
|
|
mainLayout->setMargin(0);
|
|
mainLayout->addLayout(createV(), 3);
|
|
auto fw = new FunctionWidget();
|
|
auto layout = new QVBoxLayout;
|
|
layout->setSpacing(0);
|
|
layout->addLayout(create_check_box("工作模式", {"信号侦察"}));
|
|
layout->addLayout(create_check_box("工作模式", {"信号侦察"}));
|
|
fw->init("处理参数", "对用户或载波解调译码分析", layout);
|
|
mainLayout->addWidget(fw, 1);
|
|
}
|
|
void 信号处理::paintEvent(QPaintEvent* event) {
|
|
QPainter painter(this);
|
|
//painter.fillRect(event->rect(), Qt::green);
|
|
painter.end();
|
|
QWidget::paintEvent(event);
|
|
}
|
|
QVBoxLayout* 信号处理::createV() {
|
|
QVBoxLayout* ret;
|
|
ret = new QVBoxLayout();
|
|
ret->addWidget(new QWidget, 1);
|
|
QStringList headers = {"子带通道", "频点", "出联状态", "锁定状态", "出联时间", "出联时长", "符号率", "频值", "EbNo", "误码率", "电平", "帧定时"};
|
|
TreeModel* model = new TreeModel(headers);
|
|
QStringList parentData = {"父节点1", "数据2", "数据3"};
|
|
model->addNode(parentData);
|
|
QModelIndex parentIndex = model->index(0, 0);
|
|
QStringList childData = {"子节点1", "数据2", "数据3"};
|
|
model->addNode(childData, parentIndex);
|
|
treeView = new TreeView;
|
|
treeView->setModel(model);
|
|
TreeDelegate* delegate = new TreeDelegate;
|
|
treeView->setItemDelegate(delegate);
|
|
treeView->expandAll();
|
|
ret->addWidget(treeView, 1);
|
|
return ret;
|
|
}
|
|
|
|
// 4
|
|
信号生成::信号生成() {
|
|
mainLayout = new QHBoxLayout(this);
|
|
mainLayout->setMargin(0);
|
|
mainLayout->addLayout(createV(), 3);
|
|
auto fw = new FunctionWidget();
|
|
auto layout = new QVBoxLayout;
|
|
layout->setSpacing(0);
|
|
layout->addLayout(create_check_box("发射模式", {"多载波合路"}));
|
|
layout->addLayout(create_check_box("数据源", {"本地样本"}));
|
|
layout->addLayout(create_check_box("切入点", {"HDLC封装"}));
|
|
layout->addLayout(create_check_box("信道编码", {"VIT"}));
|
|
// TODO 80比特帧封装
|
|
// TODO 符号映射
|
|
layout->addLayout(create_check_box("调制类型", {"BPSK"}));
|
|
layout->addLayout(create_input("发射时刻", {""}));
|
|
// TODO 发射样本
|
|
fw->init("生成参数", "支持", layout);
|
|
mainLayout->addWidget(fw, 1);
|
|
}
|
|
|
|
// 4
|
|
void 信号生成::paintEvent(QPaintEvent* event) {
|
|
QPainter painter(this);
|
|
//painter.fillRect(event->rect(), Qt::red);
|
|
painter.end();
|
|
QWidget::paintEvent(event);
|
|
}
|
|
|
|
QVBoxLayout* 信号生成::createV() {
|
|
auto ret = new QVBoxLayout;
|
|
m_频谱图 = new T_信号生成_频谱图();
|
|
m_频谱图->init();
|
|
ret->addWidget(m_频谱图, 1);
|
|
QStringList headers = {"载波通道", "数据源"};
|
|
TreeModel* model = new TreeModel(headers);
|
|
QStringList parentData = {"父节点1", "数据2", "数据3"};
|
|
model->addNode(parentData);
|
|
QModelIndex parentIndex = model->index(0, 0);
|
|
QStringList childData = {"子节点1", "数据2", "数据3"};
|
|
model->addNode(childData, parentIndex);
|
|
treeView = new TreeView;
|
|
treeView->setModel(model);
|
|
TreeDelegate* delegate = new TreeDelegate;
|
|
treeView->setItemDelegate(delegate);
|
|
treeView->expandAll();
|
|
ret->addWidget(treeView, 1);
|
|
return ret;
|
|
}
|
|
|
|
|
|
// 5
|
|
信号对消::信号对消() {
|
|
mainLayout = new QHBoxLayout(this);
|
|
mainLayout->setMargin(0);
|
|
mainLayout->addLayout(createV(), 3);
|
|
auto fw = new FunctionWidget();
|
|
auto layout = new QVBoxLayout;
|
|
layout->setSpacing(0);
|
|
layout->addLayout(create_check_box("时差", {"10ms", "20ms"}));
|
|
layout->addLayout(create_check_box("频差", {"100Hz"}));
|
|
layout->addLayout(create_check_box("搜索范围", {"30ms"}));
|
|
fw->init("对消参数", "对40M内发射信号对消", layout);
|
|
mainLayout->addWidget(fw, 1);
|
|
}
|
|
void 信号对消::paintEvent(QPaintEvent* event) {
|
|
QPainter painter(this);
|
|
//painter.fillRect(event->rect(), Qt::blue);
|
|
painter.end();
|
|
QWidget::paintEvent(event);
|
|
}
|
|
|
|
QVBoxLayout* 信号对消::createV() {
|
|
auto ret = new QVBoxLayout;
|
|
m_频谱图 = new T_信号对消_频谱图();
|
|
m_频谱图->init();
|
|
ret->addWidget(m_频谱图, 1);
|
|
QStringList headers = {"子带通道", "频点", "出联状态", "锁定状态", "出联时间", "出联时长", "符号率", "频值", "EbNo", "误码率", "电平", "帧定时"};
|
|
TreeModel* model = new TreeModel(headers);
|
|
QStringList parentData = {"父节点1", "数据2", "数据3"};
|
|
model->addNode(parentData);
|
|
QModelIndex parentIndex = model->index(0, 0);
|
|
QStringList childData = {"子节点1", "数据2", "数据3"};
|
|
model->addNode(childData, parentIndex);
|
|
treeView = new TreeView;
|
|
treeView->setModel(model);
|
|
TreeDelegate* delegate = new TreeDelegate;
|
|
treeView->setItemDelegate(delegate);
|
|
treeView->expandAll();
|
|
ret->addWidget(treeView, 1);
|
|
return ret;
|
|
}
|
|
// 6
|
|
存储列表::存储列表() {
|
|
mainLayout = new QHBoxLayout(this);
|
|
mainLayout->setMargin(0);
|
|
mainLayout->addLayout(createV(), 3);
|
|
auto fw = new FunctionWidget();
|
|
auto layout = new QVBoxLayout;
|
|
layout->setSpacing(0);
|
|
layout->addLayout(create_check_box("工作模式", {"信号侦察"}));
|
|
layout->addLayout(create_check_box("工作模式", {"信号侦察"}));
|
|
fw->init("处理参数", "对用户或载波解调译码分析", layout);
|
|
mainLayout->addWidget(fw, 1);
|
|
}
|
|
void 存储列表::paintEvent(QPaintEvent* event) {
|
|
QPainter painter(this);
|
|
//painter.fillRect(event->rect(), Qt::gray);
|
|
painter.end();
|
|
QWidget::paintEvent(event);
|
|
}
|
|
QVBoxLayout* 存储列表::createV() {
|
|
auto ret = new QVBoxLayout;
|
|
m_table = new CustomTableView(this);
|
|
auto* model = new CustomModel(this);
|
|
auto* delegate = new CustomTableDelegate(this);
|
|
m_table->setModel(model);
|
|
m_table->setItemDelegate(delegate);
|
|
ret->addWidget(m_table);
|
|
return ret;
|
|
}
|