91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

動態心電圖繪制,通過qt定時器,實現心電圖從左往右進行繪制,到達坐標軸最大值后,再從左往右繼續進行繪制。
增加:文章地址:https://blog.csdn.net/DoleH/article/details/86250510

資源截圖

代碼片段和文件信息

#include?“dynamicECG.h“
#include?“ui_dynamicECG.h“


DynamicECG::DynamicECG(QWidget?*parent)
:?QWidget(parent)?ui(new?Ui::dynamicECG)
{
ui->setupUi(this);
init();
initEcgWaveLineChart();
}

DynamicECG::~DynamicECG()
{
delete?ui;
}
void?DynamicECG::init()?{

originListIndex?=?0;

}


void?DynamicECG::oneTimeOutAction()?{


if?(originListIndex?>=?originListSize)
{
ecgWaveDrawTimer->stop();
}
else?{
qint16?tempInt16?=?originList.at(originListIndex).toInt();
//qDebug()?< drawEcgWave(originListIndex?tempInt16);
originListIndex++;
}


}

void?DynamicECG::onShowPushButtonclick()
{
originList.clear();
QString?origin?=?ui->inputTextEdit->toPlainText();
originList?=?origin.split(““);
originListSize?=?originList.count();
qDebug()?<
ecgWaveDrawTimer?=?new?QTimer(this);//定時任務
connect(ecgWaveDrawTimer?SIGNAL(timeout())?this?SLOT(oneTimeOutAction()));
ecgWaveDrawTimer->start(8);//5ms執行一次

}

//注意axis_x的輸入,如果大于65535,
void?DynamicECG::drawEcgWave(int?axis_x?qint16?data)?{
int?timesCounts?=?axis_x?/?600;//查看數據是否超過了600
if?(timesCounts?>?0)//如果第一次界面繪制結束,之后存在了600個點
{
axis_x?=?axis_x?-?timesCounts?*?600;
ecgPointBuffer[axis_x].setY(data);

}
else//如果是第一次界面
{
ecgPointBuffer.append(QPointF(axis_x?data));
}
ecgSeries->replace(ecgPointBuffer);
}





//初始化ECG心電圖折線圖
void?DynamicECG::initEcgWaveLineChart()?{


//TODO?其實這里可以用默認的坐標軸
axisY_ECG?=?new?QValueAxis();
axisX_ECG?=?new?QValueAxis();
ecgSeries?=?new?QLineSeries();//TODO?考慮改為平滑曲線
ecgWaveLineChart?=?new?QChart();

//添加曲線到chart中
ecgWaveLineChart->addSeries(ecgSeries);

//設置坐標軸顯示范圍
axisY_ECG->setRange(-350?1200);
axisX_ECG->setRange(0?600);
axisX_ECG->setTickCount(30);
axisY_ECG->setTickCount(10);

//設置坐標軸的顏色,粗細和設置網格顯示
axisX_ECG->setGridLinePen(QPen(Qt::red?1?Qt::DashDotDotLine?Qt::SquareCap?Qt::RoundJoin));?//網格樣式
axisY_ECG->setGridLinePen(QPen(Qt::red?1?Qt::DashDotDotLine?Qt::SquareCap?Qt::RoundJoin));

axisX_ECG->setLinePen(QPen(Qt::red?1?Qt::DashDotDotLine?Qt::SquareCap?Qt::RoundJoin));//坐標軸樣式
axisY_ECG->setLinePen(QPen(Qt::red?1?Qt::DashDotDotLine?Qt::SquareCap?Qt::RoundJoin));

axisY_ECG->setGridLineVisible(true);//顯示線框
axisX_ECG->setGridLineVisible(true);

axisX_ECG->setLabelsVisible(false);//不顯示具體數值
axisY_ECG->setLabelsVisible(false);


//把坐標軸添加到chart中,第二個參數是設置坐標軸的位置,
//只有四個選項,下方:Qt::AlignBottom,左邊:Qt::AlignLeft,右邊:Qt::AlignRight,上方:Qt::AlignTop
ecgWaveLineChart->addAxis(axisX_ECG?Qt::AlignBottom);
ecgWaveLineChart->addAxis(axisY_ECG?Qt::AlignLeft);

//把曲線關聯到坐標軸
ecgSeries->attachAxis(axisX_ECG);
ecgSeries->attachAxis(axisY_ECG);
ecgSeries->setColor(QColor(Qt::black));//設置線的顏色
ecgSeries->setUseOpenGL(true);//openGL加速
setLineChartMargins(ecgWaveLineChart?2);//設置折線圖邊距

ecgWaveLineChart->legend()->hide();//不顯示注釋
ui->ecg

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1100??2019-01-15?20:54??dynamic_ecg_wave.sln
?????目錄???????????0??2019-01-15?21:00??dynamic_ecg_wave\
?????文件????????8623??2019-01-12?21:19??dynamic_ecg_wave\dynamic_ecg_wave.vcxproj
?????文件????????1983??2019-01-12?21:16??dynamic_ecg_wave\dynamic_ecg_wave.vcxproj.filters
?????文件?????????637??2019-01-15?20:56??dynamic_ecg_wave\dynamic_ecg_wave.vcxproj.user
?????文件????????3539??2019-01-15?21:00??dynamic_ecg_wave\dynamicECG.cpp
?????文件?????????843??2019-01-12?21:16??dynamic_ecg_wave\dynamicECG.h
?????文件???????24148??2019-01-12?21:22??dynamic_ecg_wave\dynamicECG.pro.user
?????文件????????2292??2019-01-12?21:20??dynamic_ecg_wave\dynamicECG.ui
?????目錄???????????0??2019-01-12?21:16??dynamic_ecg_wave\GeneratedFiles\
?????目錄???????????0??2019-01-12?21:16??dynamic_ecg_wave\GeneratedFiles\Debug\
?????文件????????3727??2019-01-12?21:10??dynamic_ecg_wave\GeneratedFiles\Debug\moc_data_process.cpp
?????文件????????3704??2019-01-12?21:19??dynamic_ecg_wave\GeneratedFiles\Debug\moc_dynamicECG.cpp
?????文件????????3724??2019-01-12?21:14??dynamic_ecg_wave\GeneratedFiles\Debug\moc_ShowEcgWave.cpp
?????文件????????1427??2019-01-12?21:06??dynamic_ecg_wave\GeneratedFiles\qrc_data_process.cpp
?????文件????????1421??2019-01-12?21:19??dynamic_ecg_wave\GeneratedFiles\qrc_ShowEcgWave.cpp
?????文件????????3536??2019-01-12?21:06??dynamic_ecg_wave\GeneratedFiles\ui_data_process.h
?????文件????????3379??2019-01-12?21:22??dynamic_ecg_wave\GeneratedFiles\ui_dynamicECG.h
?????文件????????3385??2019-01-12?21:15??dynamic_ecg_wave\GeneratedFiles\ui_ShowEcgWave.h
?????文件?????????179??2019-01-12?21:17??dynamic_ecg_wave\main.cpp
?????目錄???????????0??2019-01-11?16:45??dynamic_ecg_wave\Resources\
?????文件??????????72??2019-01-11?16:45??dynamic_ecg_wave\ShowEcgWave.qrc
?????目錄???????????0??2019-01-12?21:04??dynamic_ecg_wave\x64\
?????目錄???????????0??2019-01-15?20:56??dynamic_ecg_wave\x64\Debug\
?????文件?????????429??2019-01-12?21:22??dynamic_ecg_wave\x64\Debug\data_process.log
?????文件??????476255??2019-01-12?21:10??dynamic_ecg_wave\x64\Debug\data_process.obj
?????目錄???????????0??2019-01-12?21:17??dynamic_ecg_wave\x64\Debug\data_process.tlog\
?????文件???????23092??2019-01-12?21:16??dynamic_ecg_wave\x64\Debug\data_process.tlog\CL.command.1.tlog
?????文件??????971962??2019-01-12?21:16??dynamic_ecg_wave\x64\Debug\data_process.tlog\CL.read.1.tlog
?????文件???????11950??2019-01-12?21:16??dynamic_ecg_wave\x64\Debug\data_process.tlog\CL.write.1.tlog
?????文件?????????223??2019-01-12?21:17??dynamic_ecg_wave\x64\Debug\data_process.tlog\data_process.lastbuildstate
............此處省略45個文件信息

評論

共有 條評論