Commit 93abbb3a authored by Aaron Bray's avatar Aaron Bray

Merge 3 branchs ['unc/enviornment', 'unc/DataRequests',...

Merge 3 branchs ['unc/enviornment', 'unc/DataRequests', 'unc/idata_request_selection'] into unc/comp_523
parents fcfa3023 720a2f2a
...@@ -87,6 +87,8 @@ set(moc_sources ...@@ -87,6 +87,8 @@ set(moc_sources
controls/ScenarioEditorWidget.h controls/ScenarioEditorWidget.h
controls/PlotSetWidget.h controls/PlotSetWidget.h
controls/EnviornmentWidget.h
conditions/ConditionWidget.h conditions/ConditionWidget.h
conditions/ChronicAnemiaWidget.h conditions/ChronicAnemiaWidget.h
conditions/ChronicObstructivePulmonaryDiseaseWidget.h conditions/ChronicObstructivePulmonaryDiseaseWidget.h
...@@ -111,6 +113,7 @@ set(UI_FILES ...@@ -111,6 +113,7 @@ set(UI_FILES
ui/DataRequestView.ui ui/DataRequestView.ui
ui/DynamicControls.ui ui/DynamicControls.ui
ui/Enviornment.ui
ui/ConditionsEditor.ui ui/ConditionsEditor.ui
ui/Condition.ui ui/Condition.ui
...@@ -162,6 +165,9 @@ set(CONTROLS_FILES ...@@ -162,6 +165,9 @@ set(CONTROLS_FILES
controls/DataRequestViewWidget.h controls/DataRequestViewWidget.h
controls/VitalsMonitorWidget.cxx controls/VitalsMonitorWidget.cxx
controls/VitalsMonitorWidget.h controls/VitalsMonitorWidget.h
controls/EnviornmentWidget.cxx
controls/EnviornmentWidget.h
) )
source_group("Controls" FILES ${CONTROLS_FILES}) source_group("Controls" FILES ${CONTROLS_FILES})
list(APPEND SOURCE ${CONTROLS_FILES}) list(APPEND SOURCE ${CONTROLS_FILES})
...@@ -371,11 +377,35 @@ set(CPACK_PACKAGE_VERSION "${EXPLORER_VERSION}") ...@@ -371,11 +377,35 @@ set(CPACK_PACKAGE_VERSION "${EXPLORER_VERSION}")
#set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") #set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/pulse_logo.png") set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/pulse_logo.png")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/AirDensity.jpeg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/AirPressure.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Blanket.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Clothing.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Emissivity.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Fan.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Heater.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Humidity.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/RadiantTemp.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Submerged.jpeg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Temp.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Wind.jpg")
#set(CPACK_DMG_DS_STORE "${CMAKE_CURRENT_SOURCE_DIR}/packaging/DS_Store") #set(CPACK_DMG_DS_STORE "${CMAKE_CURRENT_SOURCE_DIR}/packaging/DS_Store")
if(APPLE) if(APPLE)
set(CPACK_BUNDLE_STARTUP_COMMAND PulseExplorer) set(CPACK_BUNDLE_STARTUP_COMMAND PulseExplorer)
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/pulse_logo.png") set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/pulse_logo.png")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/AirDensity.jpeg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/AirPressure.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Blanket.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Clothing.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Emissivity.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Fan.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Heater.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Humidity.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/RadiantTemp.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Submerged.jpeg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Temp.jpg")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resource/Wind.jpg")
set(CPACK_BUNDLE_ICON pulse.icns) set(CPACK_BUNDLE_ICON pulse.icns)
set(MACOSX_BUNDLE_ICON_FILE pulse.icns) set(MACOSX_BUNDLE_ICON_FILE pulse.icns)
set(MACOSX_BUNDLE_BUNDLE_VERSION "${EXPLORER_VERSION}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${EXPLORER_VERSION}")
......
...@@ -18,7 +18,7 @@ public: ...@@ -18,7 +18,7 @@ public:
QChronicAnemiaWidget::QChronicAnemiaWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent, flags) QChronicAnemiaWidget::QChronicAnemiaWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent, flags)
{ {
m_Controls = new Controls(); m_Controls = new Controls();
m_Controls->ReductionFactor = new QScalarWidget("Reduction Factor", 0, 1, 0.1, false, this); m_Controls->ReductionFactor = new QScalarWidget("Reduction Factor", 0, 1, 0.1, ScalarOptionWidget::None, this);
layout()->addWidget(m_Controls->ReductionFactor); layout()->addWidget(m_Controls->ReductionFactor);
reset(); reset();
} }
......
...@@ -19,8 +19,8 @@ public: ...@@ -19,8 +19,8 @@ public:
QChronicObstructivePulmonaryDiseaseWidget::QChronicObstructivePulmonaryDiseaseWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags) QChronicObstructivePulmonaryDiseaseWidget::QChronicObstructivePulmonaryDiseaseWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags)
{ {
m_Controls = new Controls(); m_Controls = new Controls();
m_Controls->BronchitisSeverity = new QScalarWidget("Bronchitis Severity", 0, 1, 0.1, false, this); m_Controls->BronchitisSeverity = new QScalarWidget("Bronchitis Severity", 0, 1, 0.1, ScalarOptionWidget::None, this);
m_Controls->EmphysemaSeverity = new QScalarWidget("Emphysema Severity", 0, 1, 0.1, false, this); m_Controls->EmphysemaSeverity = new QScalarWidget("Emphysema Severity", 0, 1, 0.1, ScalarOptionWidget::None, this);
layout()->addWidget(m_Controls->BronchitisSeverity); layout()->addWidget(m_Controls->BronchitisSeverity);
layout()->addWidget(m_Controls->EmphysemaSeverity); layout()->addWidget(m_Controls->EmphysemaSeverity);
reset(); reset();
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
QChronicPericardialEffusionWidget::QChronicPericardialEffusionWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags) QChronicPericardialEffusionWidget::QChronicPericardialEffusionWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags)
{ {
m_Controls = new Controls(); m_Controls = new Controls();
m_Controls->AccumulatedVolume = new QScalarQuantityWidget<VolumeUnit>("Accumulated Volume", 0, 1000, 1, VolumeUnit::mL, false, this); m_Controls->AccumulatedVolume = new QScalarQuantityWidget<VolumeUnit>("Accumulated Volume", 0, 1000, 1, VolumeUnit::mL, ScalarOptionWidget::None, this);
m_Controls->AccumulatedVolume->addUnit(VolumeUnit::L); m_Controls->AccumulatedVolume->addUnit(VolumeUnit::L);
layout()->addWidget(m_Controls->AccumulatedVolume); layout()->addWidget(m_Controls->AccumulatedVolume);
reset(); reset();
......
...@@ -19,8 +19,8 @@ public: ...@@ -19,8 +19,8 @@ public:
QChronicRenalStenosisWidget::QChronicRenalStenosisWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags) QChronicRenalStenosisWidget::QChronicRenalStenosisWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags)
{ {
m_Controls = new Controls(); m_Controls = new Controls();
m_Controls->LeftKidneySeverity = new QScalarWidget("Left Kidney Severity", 0, 1, 0.1, false, this); m_Controls->LeftKidneySeverity = new QScalarWidget("Left Kidney Severity", 0, 1, 0.1, ScalarOptionWidget::None, this);
m_Controls->RightKidneySeverity = new QScalarWidget("Right Kidney Severity", 0, 1, 0.1, false, this); m_Controls->RightKidneySeverity = new QScalarWidget("Right Kidney Severity", 0, 1, 0.1, ScalarOptionWidget::None, this);
layout()->addWidget(m_Controls->LeftKidneySeverity); layout()->addWidget(m_Controls->LeftKidneySeverity);
layout()->addWidget(m_Controls->RightKidneySeverity); layout()->addWidget(m_Controls->RightKidneySeverity);
reset(); reset();
......
...@@ -21,9 +21,9 @@ public: ...@@ -21,9 +21,9 @@ public:
QImpairedAlveolarExchangeWidget::QImpairedAlveolarExchangeWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags) QImpairedAlveolarExchangeWidget::QImpairedAlveolarExchangeWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags)
{ {
m_Controls = new Controls(); m_Controls = new Controls();
m_Controls->ImpairedFraction = new QScalarWidget("Impaired Fraction", 0, 1, 0.1, false, this); m_Controls->ImpairedFraction = new QScalarWidget("Impaired Fraction", 0, 1, 0.1, ScalarOptionWidget::None, this);
layout()->addWidget(m_Controls->ImpairedFraction); layout()->addWidget(m_Controls->ImpairedFraction);
m_Controls->ImpairedSurfaceArea = new QScalarQuantityWidget<AreaUnit>("Impaired Surface Area", 0, 100, 1, AreaUnit::m2, false, this); m_Controls->ImpairedSurfaceArea = new QScalarQuantityWidget<AreaUnit>("Impaired Surface Area", 0, 100, 1, AreaUnit::m2, ScalarOptionWidget::None, this);
m_Controls->ImpairedSurfaceArea->addUnit(AreaUnit::cm2); m_Controls->ImpairedSurfaceArea->addUnit(AreaUnit::cm2);
layout()->addWidget(m_Controls->ImpairedSurfaceArea); layout()->addWidget(m_Controls->ImpairedSurfaceArea);
reset(); reset();
......
...@@ -20,9 +20,9 @@ public: ...@@ -20,9 +20,9 @@ public:
QLobarPneumoniaWidget::QLobarPneumoniaWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags) QLobarPneumoniaWidget::QLobarPneumoniaWidget(QWidget *parent, Qt::WindowFlags flags) : QConditionWidget(parent,flags)
{ {
m_Controls = new Controls(); m_Controls = new Controls();
m_Controls->Severity = new QScalarWidget("Severity", 0, 1, 0.1, false, this); m_Controls->Severity = new QScalarWidget("Severity", 0, 1, 0.1, ScalarOptionWidget::None, this);
m_Controls->LeftLungAffected = new QScalarWidget("Left Lung Affected", 0, 1, 0.1, false, this); m_Controls->LeftLungAffected = new QScalarWidget("Left Lung Affected", 0, 1, 0.1, ScalarOptionWidget::None, this);
m_Controls->RightLungAffected = new QScalarWidget("Right Lung Affected", 0, 1, 0.1, false, this); m_Controls->RightLungAffected = new QScalarWidget("Right Lung Affected", 0, 1, 0.1, ScalarOptionWidget::None, this);
layout()->addWidget(m_Controls->Severity); layout()->addWidget(m_Controls->Severity);
layout()->addWidget(m_Controls->LeftLungAffected); layout()->addWidget(m_Controls->LeftLungAffected);
layout()->addWidget(m_Controls->RightLungAffected); layout()->addWidget(m_Controls->RightLungAffected);
......
/* Distributed under the Apache License, Version 2.0.
See accompanying NOTICE file for details.*/
#include <QApplication>
#include <QDockWidget>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QLayout>
#include <QMainWindow>
#include <QWidget>
#include <QPlainTextEdit>
#include <QFile>
#include <QDoubleSpinBox>
#include <QGroupBox>
#include <QScrollBar>
#include <QTimer>
#include <QThread>
#include <QPointer>
#include <QtCharts/QChart>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCharts/QValueAxis>
#include <QCloseEvent>
#include <QMessageBox>
#include "cdm/CommonDataModel.h"
#include "cdm/utils/FileUtils.h"
#ifdef PARAVIEW
#include <pqActiveObjects.h>
#include <pqAlwaysConnectedBehavior.h>
#include <pqApplicationCore.h>
#include <pqObjectBuilder.h>
#include <pqPersistentMainWindowStateBehavior.h>
#include <pqContextView.h>
#include <pqXYChartView.h>
#include <pqRenderView.h>
#include <vtkSMProxy.h>
#include <vtkSMPropertyHelper.h>
#include <vtkSMReaderFactory.h>
#include "GeometryView.h"
#endif
#include "AddPopup.h"
#include "ui_AddPopup.h"
#include "ExplorerIntroWidget.h"
#include "ui_AddPopup.h"
#include "DataRequestsWidget.h"
#include "VitalsMonitorWidget.h"
#include "DynamicControlsWidget.h"
#include "EnviornmentWidget.h"
#include "cdm/CommonDataModel.h"
#include "PulsePhysiologyEngine.h"
#include "cdm/engine/SEDataRequestManager.h"
#include "cdm/engine/SEEngineTracker.h"
#include "cdm/properties/SEScalarTime.h"
class AddPopup::Controls : public Ui::AddPopup
{
public:
virtual ~Controls()
{
}
#ifdef PARAVIEW
QPointer<GeometryView> GeometryView;
pqRenderView* ParaViewRenderView;
#endif
QPulse* Pulse = nullptr;
QPointer<QThread> Thread;
std::stringstream Status;
double CurrentSimTime_s;
InputMode Mode = InputMode::None;
QEnviornmentWidget* envir;
};
AddPopup::AddPopup(std::string name,QWidget *parent):QDialog(parent),Ui(new Ui::AddPopup)
{
QEnviornmentWidget* envir = dynamic_cast<QEnviornmentWidget*> (parent);
m_Controls = new Controls();
m_Controls->setupUi(this);
setWindowIcon(QIcon("resource/pulse.ico"));
QFont f("Arial", 18);
m_Controls->label->setFont(f);
m_Controls->label->setText(QString::fromUtf8(name.c_str()));
if (name == "Add Gases") {
m_Controls->Substance->addItem(QString("Oxygen"));
m_Controls->Substance->addItem(QString("Nitrogen"));
m_Controls->Substance->addItem(QString("Hydrogen"));
m_Controls->Substance->addItem(QString("Argon"));
m_Controls->Substance->addItem(QString("Carbon Dioxide"));
}
else {
m_Controls->Substance->addItem(QString("Dust"));
m_Controls->Substance->addItem(QString("Forest Exudates"));
m_Controls->Substance->addItem(QString("Geyesr Steam"));
m_Controls->Substance->addItem(QString("Smoke"));
m_Controls->Substance->addItem(QString("Particulates"));
}
connect(m_Controls->Add, SIGNAL(clicked()), this, SLOT(add()));
}
AddPopup::~AddPopup()
{
delete m_Controls;
}
void AddPopup::add() {
if (m_Controls->label->text() == "Add Gases") {
emit insertG(m_Controls->Substance->currentText(), m_Controls->Amount->value());
hide();
}
else {
emit insertA(m_Controls->Substance->currentText(), m_Controls->Amount->value());
hide();
}
}
/* Distributed under the Apache License, Version 2.0.
See accompanying NOTICE file for details.*/
#ifndef AddPopup_H
#define AddPopup_H
#include <qdialog.h>
#include <QMainWindow>
#include <QObject>
#include "QPulse.h"
namespace Ui {
class AddPopup;
}
class AddPopup : public QDialog
{
Q_OBJECT
public:
explicit AddPopup(std::string name,QWidget * parent = nullptr);
virtual ~AddPopup();
Ui::AddPopup *Ui;
//protected:
signals:
void insertG(QString substance, double amount);
signals:
void insertA(QString substance, double amount);
protected slots:
void add();
private:
class Controls;
Controls* m_Controls;
};
#endif // AddPopup_H
...@@ -42,11 +42,14 @@ QDataRequestViewWidget::~QDataRequestViewWidget() ...@@ -42,11 +42,14 @@ QDataRequestViewWidget::~QDataRequestViewWidget()
void QDataRequestViewWidget::Reset() void QDataRequestViewWidget::Reset()
{ {
QMdiSubWindow* item; QMdiSubWindow* item;
while ((item = m_Controls->mdiArea->subWindowList().takeAt(0)) != nullptr) if (m_Controls->mdiArea->subWindowList().size() > 0)
{ {
QPlotSetWidget* plotSet = (QPlotSetWidget*)item->widget(); while ((item = m_Controls->mdiArea->subWindowList().takeAt(0)) != nullptr)
plotSet->Reset(); {
m_Controls->mdiArea->subWindowList().removeAt(0); QPlotSetWidget* plotSet = (QPlotSetWidget*)item->widget();
plotSet->Reset();
m_Controls->mdiArea->subWindowList().removeAt(0);
}
} }
m_Controls->TileButton->setEnabled(false); m_Controls->TileButton->setEnabled(false);
m_Controls->NewPlotSetButton->setEnabled(false); m_Controls->NewPlotSetButton->setEnabled(false);
......
This diff is collapsed.
/* Distributed under the Apache License, Version 2.0.
See accompanying NOTICE file for details.*/
#pragma once
#include <QObject>
#include <QDockWidget>
#include "QPulse.h"
class SEEnvironmentalConditions;
namespace Ui {
class EnviornmentWidget;
}
class QEnviornmentWidget : public QDockWidget, public PulseListener
{
Q_OBJECT
public:
QEnviornmentWidget(QPulse& qp, QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
virtual ~QEnviornmentWidget();
void Reset();
//SECondition& GetInitialEnvironmentConditions();
void EnableControls(bool conditions, bool actions);
void AtSteadyState(PhysiologyEngine& pulse);
void AtSteadyStateUpdateUI();// Main Window will call this to update UI Components
void ProcessPhysiology(PhysiologyEngine& pulse);
void PhysiologyUpdateUI();// Main Window will call this to update UI Components
//signals:
protected slots:
void EnableCooling();
void EnableCoolingSurfaceArea();
void EnableCoolingSurfaceAreaFraction();
void EnableHeating();
void EnableHeatingSurfaceArea();
void EnableHeatingSurfaceAreaFraction();
void EnableAppliedTemp();
void EnableAppliedTempSurfaceArea();
void EnableAppliedSurfaceAreaFraction();
void LoadEnvironmentFile();
void LoadEnvironmentFile(const std::string& fileName);
void SaveEnvironmentFile();
void SaveEnviornmentFile(const std::string& fileName);
void ControlsToEnvironment();
void EnvironmentToControls();
private:
class Controls;
Controls* m_Controls;
};
\ No newline at end of file
...@@ -48,7 +48,7 @@ See accompanying NOTICE file for details.*/ ...@@ -48,7 +48,7 @@ See accompanying NOTICE file for details.*/
#include "DataRequestViewWidget.h" #include "DataRequestViewWidget.h"
#include "VitalsMonitorWidget.h" #include "VitalsMonitorWidget.h"
#include "DynamicControlsWidget.h" #include "DynamicControlsWidget.h"
#include "EnviornmentWidget.h"
#include "cdm/CommonDataModel.h" #include "cdm/CommonDataModel.h"
#include "PulsePhysiologyEngine.h" #include "PulsePhysiologyEngine.h"
#include "cdm/engine/SEDataRequestManager.h" #include "cdm/engine/SEDataRequestManager.h"
...@@ -69,6 +69,7 @@ public: ...@@ -69,6 +69,7 @@ public:
delete ExplorerIntroWidget; delete ExplorerIntroWidget;
delete VitalsMonitorWidget; delete VitalsMonitorWidget;
delete DataRequestViewWidget; delete DataRequestViewWidget;
delete EnviornmentWidget;
delete DynamicControls; delete DynamicControls;
} }
...@@ -81,6 +82,7 @@ public: ...@@ -81,6 +82,7 @@ public:
QExplorerIntroWidget* ExplorerIntroWidget=nullptr; QExplorerIntroWidget* ExplorerIntroWidget=nullptr;
QVitalsMonitorWidget* VitalsMonitorWidget=nullptr; QVitalsMonitorWidget* VitalsMonitorWidget=nullptr;
QDataRequestViewWidget* DataRequestViewWidget=nullptr; QDataRequestViewWidget* DataRequestViewWidget=nullptr;
QEnviornmentWidget* EnviornmentWidget = nullptr;
QDynamicControlsWidget* DynamicControls=nullptr; QDynamicControlsWidget* DynamicControls=nullptr;
std::stringstream Status; std::stringstream Status;
double CurrentSimTime_s; double CurrentSimTime_s;
...@@ -146,6 +148,9 @@ MainExplorerWindow::MainExplorerWindow() ...@@ -146,6 +148,9 @@ MainExplorerWindow::MainExplorerWindow()
m_Controls->DataRequestViewWidget = new QDataRequestViewWidget(*m_Controls->Pulse, this); m_Controls->DataRequestViewWidget = new QDataRequestViewWidget(*m_Controls->Pulse, this);
m_Controls->DataRequestViewWidget->setTitleBarWidget(new QWidget()); m_Controls->DataRequestViewWidget->setTitleBarWidget(new QWidget());
m_Controls->TabWidget->widget(tabIdx++)->layout()->addWidget(m_Controls->DataRequestViewWidget); m_Controls->TabWidget->widget(tabIdx++)->layout()->addWidget(m_Controls->DataRequestViewWidget);
m_Controls->EnviornmentWidget = new QEnviornmentWidget(*m_Controls->Pulse, this);
m_Controls->EnviornmentWidget->setTitleBarWidget(new QWidget());
m_Controls->TabWidget->widget(tabIdx++)->layout()->addWidget(m_Controls->EnviornmentWidget);
m_Controls->StartEngine->setVisible(false); m_Controls->StartEngine->setVisible(false);
m_Controls->RunInRealtime->setVisible(false); m_Controls->RunInRealtime->setVisible(false);
...@@ -206,6 +211,7 @@ void MainExplorerWindow::ResetExplorer() ...@@ -206,6 +211,7 @@ void MainExplorerWindow::ResetExplorer()
m_Controls->Pulse->Reset(); m_Controls->Pulse->Reset();
m_Controls->Mode = InputMode::None; m_Controls->Mode = InputMode::None;
m_Controls->DataRequestViewWidget->Reset(); m_Controls->DataRequestViewWidget->Reset();
m_Controls->EnviornmentWidget->Reset();
m_Controls->VitalsMonitorWidget->Reset(); m_Controls->VitalsMonitorWidget->Reset();
m_Controls->RunInRealtime->setChecked(true); m_Controls->RunInRealtime->setChecked(true);
m_Controls->PlayPause->setText("Pause"); m_Controls->PlayPause->setText("Pause");
...@@ -231,6 +237,7 @@ void MainExplorerWindow::ResetEngine() ...@@ -231,6 +237,7 @@ void MainExplorerWindow::ResetEngine()
#endif #endif
m_Controls->DynamicControls->Reset(); m_Controls->DynamicControls->Reset();
m_Controls->DataRequestViewWidget->Reset(); m_Controls->DataRequestViewWidget->Reset();
m_Controls->EnviornmentWidget->Reset();
m_Controls->VitalsMonitorWidget->Reset(); m_Controls->VitalsMonitorWidget->Reset();
m_Controls->RunInRealtime->setChecked(true); m_Controls->RunInRealtime->setChecked(true);
m_Controls->PlayPause->setText("Pause"); m_Controls->PlayPause->setText("Pause");
...@@ -263,6 +270,7 @@ void MainExplorerWindow::StartShowcase() ...@@ -263,6 +270,7 @@ void MainExplorerWindow::StartShowcase()
m_Controls->RunInRealtime->setVisible(true); m_Controls->RunInRealtime->setVisible(true);
m_Controls->ResetExplorer->setVisible(true); m_Controls->ResetExplorer->setVisible(true);
m_Controls->ResetEngine->setVisible(true); m_Controls->ResetEngine->setVisible(true);
m_Controls->EnviornmentWidget->EnableControls(false, false);
if (!m_Controls->DynamicControls->SetupShowcase(m_Controls->ExplorerIntroWidget->GetSelectedShowcase())) if (!m_Controls->DynamicControls->SetupShowcase(m_Controls->ExplorerIntroWidget->GetSelectedShowcase()))
{ {
...@@ -290,6 +298,7 @@ void MainExplorerWindow::SetupScenarioEditor() ...@@ -290,6 +298,7 @@ void MainExplorerWindow::SetupScenarioEditor()
m_Controls->RunInRealtime->setVisible(false); m_Controls->RunInRealtime->setVisible(false);
m_Controls->ResetExplorer->setVisible(true); m_Controls->ResetExplorer->setVisible(true);
m_Controls->ResetEngine->setVisible(false); m_Controls->ResetEngine->setVisible(false);
m_Controls->EnviornmentWidget->EnableControls(true, false);
m_Controls->Mode = InputMode::Scenario; m_Controls->Mode = InputMode::Scenario;
} }
...@@ -310,6 +319,7 @@ void MainExplorerWindow::SetupEngineState() ...@@ -310,6 +319,7 @@ void MainExplorerWindow::SetupEngineState()
m_Controls->RunInRealtime->setVisible(false); m_Controls->RunInRealtime->setVisible(false);
m_Controls->ResetExplorer->setVisible(true); m_Controls->ResetExplorer->setVisible(true);
m_Controls->ResetEngine->setVisible(false); m_Controls->ResetEngine->setVisible(false);
m_Controls->EnviornmentWidget->EnableControls(false, false);
m_Controls->Mode = InputMode::State; m_Controls->Mode = InputMode::State;
} }
...@@ -329,6 +339,7 @@ void MainExplorerWindow::SetupPatientEditor() ...@@ -329,6 +339,7 @@ void MainExplorerWindow::SetupPatientEditor()
m_Controls->RunInRealtime->setVisible(false); m_Controls->RunInRealtime->setVisible(false);
m_Controls->ResetExplorer->setVisible(true); m_Controls->ResetExplorer->setVisible(true);
m_Controls->ResetEngine->setVisible(false); m_Controls->ResetEngine->setVisible(false);
m_Controls->EnviornmentWidget->EnableControls(true, false);
m_Controls->DynamicControls->SetupPatientEditor(); m_Controls->DynamicControls->SetupPatientEditor();
m_Controls->Mode = InputMode::Patient; m_Controls->Mode = InputMode::Patient;
...@@ -369,12 +380,14 @@ void MainExplorerWindow::AtSteadyState(PhysiologyEngine& pulse) ...@@ -369,12 +380,14 @@ void MainExplorerWindow::AtSteadyState(PhysiologyEngine& pulse)
m_Controls->DynamicControls->AtSteadyState(pulse); m_Controls->DynamicControls->AtSteadyState(pulse);
m_Controls->VitalsMonitorWidget->AtSteadyState(pulse); m_Controls->VitalsMonitorWidget->AtSteadyState(pulse);
m_Controls->DataRequestViewWidget->AtSteadyState(pulse); m_Controls->DataRequestViewWidget->AtSteadyState(pulse);
m_Controls->EnviornmentWidget->AtSteadyState(pulse);
} }
void MainExplorerWindow::AtSteadyStateUpdateUI() void MainExplorerWindow::AtSteadyStateUpdateUI()
{// This is called from a slot, you can update UI here {// This is called from a slot, you can update UI here
m_Controls->DynamicControls->AtSteadyStateUpdateUI(); m_Controls->DynamicControls->AtSteadyStateUpdateUI();
m_Controls->VitalsMonitorWidget->AtSteadyStateUpdateUI(); m_Controls->VitalsMonitorWidget->AtSteadyStateUpdateUI();
m_Controls->DataRequestViewWidget->AtSteadyStateUpdateUI(); m_Controls->DataRequestViewWidget->AtSteadyStateUpdateUI();
m_Controls->EnviornmentWidget->AtSteadyStateUpdateUI();
m_Controls->PlayPause->setEnabled(true); m_Controls->PlayPause->setEnabled(true);
m_Controls->ResetEngine->setEnabled(true); m_Controls->ResetEngine->setEnabled(true);
...@@ -387,7 +400,7 @@ void MainExplorerWindow::ProcessPhysiology(PhysiologyEngine& pulse) ...@@ -387,7 +400,7 @@ void MainExplorerWindow::ProcessPhysiology(PhysiologyEngine& pulse)
m_Controls->DynamicControls->ProcessPhysiology(pulse); m_Controls->DynamicControls->ProcessPhysiology(pulse);
m_Controls->VitalsMonitorWidget->ProcessPhysiology(pulse); m_Controls->VitalsMonitorWidget->ProcessPhysiology(pulse);
m_Controls->DataRequestViewWidget->ProcessPhysiology(pulse); m_Controls->DataRequestViewWidget->ProcessPhysiology(pulse);
m_Controls->EnviornmentWidget->ProcessPhysiology(pulse);
m_Controls->CurrentSimTime_s = pulse.GetSimulationTime(TimeUnit::s); m_Controls->CurrentSimTime_s = pulse.GetSimulationTime(TimeUnit::s);
} }
void MainExplorerWindow::PhysiologyUpdateUI() void MainExplorerWindow::PhysiologyUpdateUI()
...@@ -395,6 +408,7 @@ void MainExplorerWindow::PhysiologyUpdateUI() ...@@ -395,6 +408,7 @@ void MainExplorerWindow::PhysiologyUpdateUI()
m_Controls->DynamicControls->PhysiologyUpdateUI(); m_Controls->DynamicControls->PhysiologyUpdateUI();
m_Controls->VitalsMonitorWidget->PhysiologyUpdateUI(); m_Controls->VitalsMonitorWidget->PhysiologyUpdateUI();
m_Controls->DataRequestViewWidget->PhysiologyUpdateUI(); m_Controls->DataRequestViewWidget->PhysiologyUpdateUI();
m_Controls->EnviornmentWidget->PhysiologyUpdateUI();
m_Controls->Status.str(""); m_Controls->Status.str("");
m_Controls->Status << "Current Simulation Time : " << m_Controls->CurrentSimTime_s << "s"; m_Controls->Status << "Current Simulation Time : " << m_Controls->CurrentSimTime_s << "s";
......
This diff is collapsed.
...@@ -9,6 +9,7 @@ See accompanying NOTICE file for details.*/ ...@@ -9,6 +9,7 @@ See accompanying NOTICE file for details.*/
#include <QDoubleSpinBox> #include <QDoubleSpinBox>
#include <QSpacerItem> #include <QSpacerItem>
#include <QComboBox> #include <QComboBox>
#include <QRadioButton.h>
#include "controls/ScalarWidget.h" #include "controls/ScalarWidget.h"
...@@ -18,17 +19,22 @@ See accompanying NOTICE file for details.*/ ...@@ -18,17 +19,22 @@ See accompanying NOTICE file for details.*/
template <typename Unit> template <typename Unit>
class QScalarQuantityWidget : public QScalarConvertWidget class QScalarQuantityWidget : public QScalarConvertWidget
{ {
public: public:
explicit QScalarQuantityWidget(const QString& name, double min, double max, double step, const Unit& unit, bool check = true, QWidget *parent = nullptr); explicit QScalarQuantityWidget(const QString& name, double min, double max, double step, const Unit& unit, ScalarOptionWidget optWidget=ScalarOptionWidget::Check, QWidget *parent = nullptr, bool seperate_label = false);
void reset(); void reset();
bool isChecked(); bool isChecked();
void setDecimals(int prec);
void addUnit(const Unit& unit); void addUnit(const Unit& unit);
void setValue(const SEScalarQuantity<Unit>& s); void setValue(const SEScalarQuantity<Unit>& s);
void getValue(SEScalarQuantity<Unit>& s); void getValue(SEScalarQuantity<Unit>& s);
void enableInput(bool b); void enableInput(bool b);
void enableConverter(bool b); void enableConverter(bool b);
void fullDisable();
const QRadioButton* getRadioButton() { return m_Radio; }
protected slots: protected slots:
void checkProperty(bool b); void checkProperty(bool b);
...@@ -39,6 +45,7 @@ protected slots: ...@@ -39,6 +45,7 @@ protected slots:
QHBoxLayout* m_Layout; QHBoxLayout* m_Layout;
QCheckBox* m_Check; QCheckBox* m_Check;
QRadioButton* m_Radio;
QLabel* m_Label; QLabel* m_Label;
QDoubleSpinBox* m_Value; QDoubleSpinBox* m_Value;
QSpacerItem* m_Spacer; QSpacerItem* m_Spacer;
......
...@@ -3,7 +3,7 @@ See accompanying NOTICE file for details.*/ ...@@ -3,7 +3,7 @@ See accompanying NOTICE file for details.*/
#include "ScalarQuantityWidget.h" #include "ScalarQuantityWidget.h"
template<typename Unit> template<typename Unit>
QScalarQuantityWidget<Unit>::QScalarQuantityWidget(const QString& name, double min, double max, double step, const Unit& unit, bool check, QWidget *parent) : QScalarConvertWidget(parent), m_DefaultUnit(unit) QScalarQuantityWidget<Unit>::QScalarQuantityWidget(const QString& name, double min, double max, double step, const Unit& unit, ScalarOptionWidget optWidget, QWidget *parent, bool seperate_label) : QScalarConvertWidget(parent), m_DefaultUnit(unit)
{ {
setAutoFillBackground(true); setAutoFillBackground(true);
m_Layout = new QHBoxLayout(this); m_Layout = new QHBoxLayout(this);
...@@ -13,30 +13,58 @@ QScalarQuantityWidget<Unit>::QScalarQuantityWidget(const QString& name, double m ...@@ -13,30 +13,58 @@ QScalarQuantityWidget<Unit>::QScalarQuantityWidget(const QString& name, double m
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0); sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0); sizePolicy.setVerticalStretch(0);
if (check) m_Check = nullptr;
m_Radio = nullptr;
switch (optWidget)
{ {
m_Check = new QCheckBox(name, this); case ScalarOptionWidget::Check:
sizePolicy.setHeightForWidth(m_Check->sizePolicy().hasHeightForWidth()); {
m_Check->setSizePolicy(sizePolicy); m_Check = new QCheckBox(name, this);
m_Label = nullptr; sizePolicy.setHeightForWidth(m_Check->sizePolicy().hasHeightForWidth());
m_Layout->addWidget(m_Check); m_Check->setSizePolicy(sizePolicy);