2023-04-14 19:30:30 +08:00
|
|
|
|
#include "TrendGraph.h"
|
|
|
|
|
|
#include "ui_TrendGraph.h"
|
2023-04-27 19:48:15 +08:00
|
|
|
|
#include <QListView>
|
|
|
|
|
|
#include "global.h"
|
2023-04-14 19:30:30 +08:00
|
|
|
|
|
|
|
|
|
|
CTrendGraph::CTrendGraph(QWidget *parent) :
|
|
|
|
|
|
QWidget(parent),
|
|
|
|
|
|
ui(new Ui::CTrendGraph)
|
|
|
|
|
|
{
|
|
|
|
|
|
ui->setupUi(this);
|
2023-04-27 19:48:15 +08:00
|
|
|
|
|
|
|
|
|
|
QDateTime curDateTime=QDateTime::currentDateTime();//通过QDateTime的currentDateTime获得当前的日期时间,并赋值给curDateTime
|
|
|
|
|
|
ui->dateTimeEdit_start->setDateTime(curDateTime);
|
|
|
|
|
|
ui->dateTimeEdit_end->setDateTime(curDateTime);
|
|
|
|
|
|
|
|
|
|
|
|
ui->comboBox_channel->setView(new QListView());
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < g_ChannelBaseInfo.size(); i++) {
|
|
|
|
|
|
ui->comboBox_channel->insertItem(i,g_ChannelBaseInfo[i].channelName);
|
|
|
|
|
|
}
|
|
|
|
|
|
connect(ui->comboBox_channel,SIGNAL(currentIndexChanged(const QString &)),this,SLOT(on_comboBox_channel_currentTextChanged(const QString&)));
|
|
|
|
|
|
|
2023-04-14 19:30:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CTrendGraph::~CTrendGraph()
|
|
|
|
|
|
{
|
|
|
|
|
|
delete ui;
|
|
|
|
|
|
}
|
2023-04-27 19:48:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CTrendGraph::on_comboBox_channel_currentTextChanged(const QString& strChannelName)
|
|
|
|
|
|
{
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
for (i = 0; i < g_ChannelBaseInfo.size(); i++) {
|
|
|
|
|
|
if(strChannelName == g_ChannelBaseInfo[i].channelName){
|
|
|
|
|
|
m_strChannelID = g_ChannelBaseInfo[i].channelID;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CTrendGraph::on_pushButton_search_clicked()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|