Connect command buttons to EventCenter

This commit is contained in:
Krad
2021-10-13 17:39:06 +08:00
parent 1d6631eb1f
commit 72b6469670

View File

@@ -117,6 +117,27 @@ ScanFormWidget::ScanFormWidget(QWidget *parent) : TabFormWidget(parent) {
} }
patient_information->setPatientInformation((PatientInformation*)data); patient_information->setPatientInformation((PatientInformation*)data);
}); });
connect(EventCenter::Default(),&EventCenter::ResponseStop,[=](QObject* sender,QObject* data){
setPreviewing(false);
});
connect(EventCenter::Default(),&EventCenter::ResponsePreview,[=](QObject* sender,QObject* data){
setPreviewing(true);
});
connect(EventCenter::Default(),&EventCenter::PatientSelected,[=](QObject* sender,QObject* data){
patient_information->setPatientInformation((PatientInformation*)data);
});
connect(btnRefresh,&QToolButton::clicked,[=](){
EventCenter::Default()->triggerEvent(GUIEvents::RequestEmptyScan, nullptr, nullptr);
});
connect(btnPreview,&QToolButton::clicked,[=](){
EventCenter::Default()->triggerEvent(GUIEvents::RequestPreviewScan, nullptr, nullptr);
});
connect(btnScan,&QToolButton::clicked,[=](){
EventCenter::Default()->triggerEvent(GUIEvents::RequestPatientScan, nullptr, nullptr);
});
connect(btnStop,&QToolButton::clicked,[=](){
EventCenter::Default()->triggerEvent(GUIEvents::RequestStop, nullptr, nullptr);
});
connect(group, SIGNAL(buttonClicked(int)),this,SLOT(protocolChanged(int))); connect(group, SIGNAL(buttonClicked(int)),this,SLOT(protocolChanged(int)));