diff --git a/src/forms/select/SelectFormWidget.cpp b/src/forms/select/SelectFormWidget.cpp index 8bcd526..f8e36e0 100644 --- a/src/forms/select/SelectFormWidget.cpp +++ b/src/forms/select/SelectFormWidget.cpp @@ -21,6 +21,7 @@ #include "components/VerticalTextToolButton.h" #include "PatientAddDateDelegate.h" #include "dicom/WorkListManager.h" +#include "utilities/ScanProcessSequence.h" SelectFormWidget::SelectFormWidget(QWidget* parent) : TabFormWidget(parent) @@ -84,6 +85,8 @@ SelectFormWidget::SelectFormWidget(QWidget* parent) this->setSelectedPatient(patientInfo); }); + connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::ScanProcessSequenceFinished, this, &SelectFormWidget::clearSelectedPatient); + //first prepare buttons! prepareButtons(false); @@ -154,7 +157,7 @@ void SelectFormWidget::delPatient() { if (mPatTable->currentIndex().row() < 0) return; QString pUid = mModel->index(mPatTable->currentIndex().row(), PatientUID).data().toString(); // patient has been selected as the scan patient! - if (selectedPatientUID == pUid){ + if (mSelectedPatientUID == pUid){ DialogManager::Default()->requestAlertMessage(tr("Can't delete selected Patient !"),DialogButtonMode::OkOnly,tr("Alert")); return; } @@ -187,7 +190,12 @@ void SelectFormWidget::selectPatient() { void SelectFormWidget::setSelectedPatient(PatientInformation* aPatient) { - selectedPatientUID = aPatient->PatientUID; + mSelectedPatientUID = aPatient->PatientUID; +} + +void SelectFormWidget::clearSelectedPatient() +{ + mSelectedPatientUID.clear(); } void SelectFormWidget::initDetailPanel(QHBoxLayout *contentLayout) {// prepare edit panel diff --git a/src/forms/select/SelectFormWidget.h b/src/forms/select/SelectFormWidget.h index 6a44aad..e690df7 100644 --- a/src/forms/select/SelectFormWidget.h +++ b/src/forms/select/SelectFormWidget.h @@ -21,10 +21,21 @@ public: public slots: void updateDataByAnonymousMode(); private: - QString selectedPatientUID; - void setPatientDetail(const SlideTableView *table, const QSqlTableModel *model, PatientDetailForm *edit_patient) const; + void prepareButtons(bool disableALL); + void initPatEditButtons(QHBoxLayout *layout); + void editPatient(); + void delPatient(); + void selectPatient(); + void setSelectedPatient(PatientInformation* aPatient); + void initDataModel(); + void initDetailPanel(QHBoxLayout *contentLayout); + void initTableView(QLayout *contentLayout); + void reloadLanguage(); + void clearSelectedPatient(); +private: + QString mSelectedPatientUID; QToolButton *mBtnEdit; QToolButton *mBtnDelete; QToolButton *mBtnAdd; @@ -33,26 +44,6 @@ private: QSqlTableModel *mModel; PatientDetailForm *patientDetailForm; QLabel* mSelectTabTitle; - - void prepareButtons(bool disableALL); - - void initPatEditButtons(QHBoxLayout *layout); - - void editPatient(); - - void delPatient(); - - void selectPatient(); - - void setSelectedPatient(PatientInformation* aPatient); - - void initDataModel(); - - void initDetailPanel(QHBoxLayout *contentLayout); - - void initTableView(QLayout *contentLayout); - - void reloadLanguage(); }; diff --git a/src/utilities/ScanProcessSequence.cpp b/src/utilities/ScanProcessSequence.cpp index 7e0dba9..980b4c3 100644 --- a/src/utilities/ScanProcessSequence.cpp +++ b/src/utilities/ScanProcessSequence.cpp @@ -32,7 +32,12 @@ void ScanProcessSequence::pushPosition(ScanPosition aPostion) ScanPosition ScanProcessSequence::popPosition() { - return mScanProtocol.pop(); + ScanPosition result = mScanProtocol.pop(); + if(mScanProtocol.size() == 0) + { + emit ScanProcessSequenceFinished(); + } + return result; } ScanPosition ScanProcessSequence::topPosition() diff --git a/src/utilities/ScanProcessSequence.h b/src/utilities/ScanProcessSequence.h index ce0247c..2c7c208 100644 --- a/src/utilities/ScanProcessSequence.h +++ b/src/utilities/ScanProcessSequence.h @@ -28,6 +28,7 @@ signals: void fullScanDataExport(); void autoLocateXYUpdated(int aX, int aY); void autoLocateZUpdated(int aZ); + void ScanProcessSequenceFinished(); private slots: void updateAutoLocatePosition(int aX, int aY, int aZ);