Skip to content

Commit

Permalink
实现保存按钮对应功能
Browse files Browse the repository at this point in the history
  • Loading branch information
JackeyLea committed Nov 1, 2024
1 parent 77825ff commit 7ec7991
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 17 additions & 1 deletion MindViewer/mainwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ MainWidget::MainWidget(QWidget *parent)
, ui(new Ui::MainWidget)
, m_parser(new DataParser)
, m_bStatus(false)
, m_eType(None)
{
ui->setupUi(this);
ui->widgetAttention->setLabel("注意力");
Expand Down Expand Up @@ -50,13 +51,15 @@ void MainWidget::sltBtnCOM()
m_bStatus = true;
ui->labelStatusValue->setText("运行");
m_parser->setSource(COM);
m_eType = COM;
}

void MainWidget::sltBtnSIM()
{
m_bStatus = true;
ui->labelStatusValue->setText("运行");
m_parser->setSource(Sim);
m_eType = Sim;
}

void MainWidget::sltBtnLocal()
Expand All @@ -73,6 +76,7 @@ void MainWidget::sltBtnLocal()
ui->labelStatusValue->setText("运行");
m_parser->setFilePath(filePath);
m_parser->setSource(Local);
m_eType = Local;
}

void MainWidget::sltBtnPlay()
Expand Down Expand Up @@ -104,7 +108,19 @@ void MainWidget::sltBtnClear()

void MainWidget::sltBtnSave()
{
QMessageBox::information(this,tr("警告"),tr("功能未实现,不要乱点"),QMessageBox::Ok);
switch(m_eType){
case COM:
break;
case Sim:
QMessageBox::warning(this,tr("警告"),tr("模拟数据没必要保存"));
break;
case Local:
QMessageBox::warning(this,tr("警告"),tr("你告诉我已经保存的数据怎么再保存"));
break;
default:
QMessageBox::warning(this,tr("警告"),tr("没有选择源怎么保存"));
break;
}
}

// 从解析类中获取数据然后显示
Expand Down
2 changes: 2 additions & 0 deletions MindViewer/mainwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,7 @@ private slots:
DataParser *m_parser;

bool m_bStatus;//状态控制

DataSourceType m_eType;//当前模式
};
#endif // MAINWIDGET_H

0 comments on commit 7ec7991

Please sign in to comment.