Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
explorer
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pulse Physiology Suite
explorer
Commits
963cc9c6
Commit
963cc9c6
authored
Apr 16, 2019
by
Aaron Bray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Major Environment Tab Update
parent
1c920845
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
914 additions
and
835 deletions
+914
-835
conditions/ChronicAnemiaWidget.cxx
conditions/ChronicAnemiaWidget.cxx
+1
-1
conditions/ChronicObstructivePulmonaryDiseaseWidget.cxx
conditions/ChronicObstructivePulmonaryDiseaseWidget.cxx
+2
-2
conditions/ChronicPericardialEffusionWidget.cxx
conditions/ChronicPericardialEffusionWidget.cxx
+1
-1
conditions/ChronicRenalStenosisWidget.cxx
conditions/ChronicRenalStenosisWidget.cxx
+2
-2
conditions/ImpairedAlveolarExchangeWidget.cxx
conditions/ImpairedAlveolarExchangeWidget.cxx
+2
-2
conditions/LobarPneumoniaWidget.cxx
conditions/LobarPneumoniaWidget.cxx
+3
-3
controls/EnviornmentWidget.cxx
controls/EnviornmentWidget.cxx
+432
-117
controls/EnviornmentWidget.h
controls/EnviornmentWidget.h
+19
-12
controls/MainExplorerWindow.cxx
controls/MainExplorerWindow.cxx
+1
-1
controls/PatientEditorWidget.cxx
controls/PatientEditorWidget.cxx
+26
-26
controls/ScalarQuantityWidget.h
controls/ScalarQuantityWidget.h
+8
-1
controls/ScalarQuantityWidget.inl
controls/ScalarQuantityWidget.inl
+77
-27
controls/ScalarWidget.cxx
controls/ScalarWidget.cxx
+73
-29
controls/ScalarWidget.h
controls/ScalarWidget.h
+10
-1
ui/Enviornment.ui
ui/Enviornment.ui
+250
-609
ui/MainExplorerWindow.ui
ui/MainExplorerWindow.ui
+7
-1
No files found.
conditions/ChronicAnemiaWidget.cxx
View file @
963cc9c6
...
...
@@ -18,7 +18,7 @@ public:
QChronicAnemiaWidget
::
QChronicAnemiaWidget
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QConditionWidget
(
parent
,
flags
)
{
m_Controls
=
new
Controls
();
m_Controls
->
ReductionFactor
=
new
QScalarWidget
(
"Reduction Factor"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
ReductionFactor
=
new
QScalarWidget
(
"Reduction Factor"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
layout
()
->
addWidget
(
m_Controls
->
ReductionFactor
);
reset
();
}
...
...
conditions/ChronicObstructivePulmonaryDiseaseWidget.cxx
View file @
963cc9c6
...
...
@@ -19,8 +19,8 @@ public:
QChronicObstructivePulmonaryDiseaseWidget
::
QChronicObstructivePulmonaryDiseaseWidget
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QConditionWidget
(
parent
,
flags
)
{
m_Controls
=
new
Controls
();
m_Controls
->
BronchitisSeverity
=
new
QScalarWidget
(
"Bronchitis Severity"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
EmphysemaSeverity
=
new
QScalarWidget
(
"Emphysema Severity"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
BronchitisSeverity
=
new
QScalarWidget
(
"Bronchitis Severity"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
m_Controls
->
EmphysemaSeverity
=
new
QScalarWidget
(
"Emphysema Severity"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
layout
()
->
addWidget
(
m_Controls
->
BronchitisSeverity
);
layout
()
->
addWidget
(
m_Controls
->
EmphysemaSeverity
);
reset
();
...
...
conditions/ChronicPericardialEffusionWidget.cxx
View file @
963cc9c6
...
...
@@ -22,7 +22,7 @@ public:
QChronicPericardialEffusionWidget
::
QChronicPericardialEffusionWidget
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QConditionWidget
(
parent
,
flags
)
{
m_Controls
=
new
Controls
();
m_Controls
->
AccumulatedVolume
=
new
QScalarQuantityWidget
<
VolumeUnit
>
(
"Accumulated Volume"
,
0
,
1000
,
1
,
VolumeUnit
::
mL
,
fals
e
,
this
);
m_Controls
->
AccumulatedVolume
=
new
QScalarQuantityWidget
<
VolumeUnit
>
(
"Accumulated Volume"
,
0
,
1000
,
1
,
VolumeUnit
::
mL
,
ScalarOptionWidget
::
Non
e
,
this
);
m_Controls
->
AccumulatedVolume
->
addUnit
(
VolumeUnit
::
L
);
layout
()
->
addWidget
(
m_Controls
->
AccumulatedVolume
);
reset
();
...
...
conditions/ChronicRenalStenosisWidget.cxx
View file @
963cc9c6
...
...
@@ -19,8 +19,8 @@ public:
QChronicRenalStenosisWidget
::
QChronicRenalStenosisWidget
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QConditionWidget
(
parent
,
flags
)
{
m_Controls
=
new
Controls
();
m_Controls
->
LeftKidneySeverity
=
new
QScalarWidget
(
"Left Kidney Severity"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
RightKidneySeverity
=
new
QScalarWidget
(
"Right Kidney Severity"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
LeftKidneySeverity
=
new
QScalarWidget
(
"Left Kidney Severity"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
m_Controls
->
RightKidneySeverity
=
new
QScalarWidget
(
"Right Kidney Severity"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
layout
()
->
addWidget
(
m_Controls
->
LeftKidneySeverity
);
layout
()
->
addWidget
(
m_Controls
->
RightKidneySeverity
);
reset
();
...
...
conditions/ImpairedAlveolarExchangeWidget.cxx
View file @
963cc9c6
...
...
@@ -21,9 +21,9 @@ public:
QImpairedAlveolarExchangeWidget
::
QImpairedAlveolarExchangeWidget
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QConditionWidget
(
parent
,
flags
)
{
m_Controls
=
new
Controls
();
m_Controls
->
ImpairedFraction
=
new
QScalarWidget
(
"Impaired Fraction"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
ImpairedFraction
=
new
QScalarWidget
(
"Impaired Fraction"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
layout
()
->
addWidget
(
m_Controls
->
ImpairedFraction
);
m_Controls
->
ImpairedSurfaceArea
=
new
QScalarQuantityWidget
<
AreaUnit
>
(
"Impaired Surface Area"
,
0
,
100
,
1
,
AreaUnit
::
m2
,
fals
e
,
this
);
m_Controls
->
ImpairedSurfaceArea
=
new
QScalarQuantityWidget
<
AreaUnit
>
(
"Impaired Surface Area"
,
0
,
100
,
1
,
AreaUnit
::
m2
,
ScalarOptionWidget
::
Non
e
,
this
);
m_Controls
->
ImpairedSurfaceArea
->
addUnit
(
AreaUnit
::
cm2
);
layout
()
->
addWidget
(
m_Controls
->
ImpairedSurfaceArea
);
reset
();
...
...
conditions/LobarPneumoniaWidget.cxx
View file @
963cc9c6
...
...
@@ -20,9 +20,9 @@ public:
QLobarPneumoniaWidget
::
QLobarPneumoniaWidget
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QConditionWidget
(
parent
,
flags
)
{
m_Controls
=
new
Controls
();
m_Controls
->
Severity
=
new
QScalarWidget
(
"Severity"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
LeftLungAffected
=
new
QScalarWidget
(
"Left Lung Affected"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
RightLungAffected
=
new
QScalarWidget
(
"Right Lung Affected"
,
0
,
1
,
0.1
,
fals
e
,
this
);
m_Controls
->
Severity
=
new
QScalarWidget
(
"Severity"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
m_Controls
->
LeftLungAffected
=
new
QScalarWidget
(
"Left Lung Affected"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
m_Controls
->
RightLungAffected
=
new
QScalarWidget
(
"Right Lung Affected"
,
0
,
1
,
0.1
,
ScalarOptionWidget
::
Non
e
,
this
);
layout
()
->
addWidget
(
m_Controls
->
Severity
);
layout
()
->
addWidget
(
m_Controls
->
LeftLungAffected
);
layout
()
->
addWidget
(
m_Controls
->
RightLungAffected
);
...
...
controls/EnviornmentWidget.cxx
View file @
963cc9c6
This diff is collapsed.
Click to expand it.
controls/EnviornmentWidget.h
View file @
963cc9c6
...
...
@@ -6,6 +6,8 @@ See accompanying NOTICE file for details.*/
#include <QDockWidget>
#include "QPulse.h"
class
SEEnvironmentalConditions
;
namespace
Ui
{
class
EnviornmentWidget
;
}
...
...
@@ -14,19 +16,11 @@ class QEnviornmentWidget : public QDockWidget, public PulseListener
{
Q_OBJECT
public:
QEnviornmentWidget
(
Q
TextEdit
&
log
,
QWidget
*
parent
=
Q_NULLPTR
,
Qt
::
WindowFlags
flags
=
Qt
::
WindowFlags
());
QEnviornmentWidget
(
Q
Pulse
&
qp
,
QWidget
*
parent
=
Q_NULLPTR
,
Qt
::
WindowFlags
flags
=
Qt
::
WindowFlags
());
virtual
~
QEnviornmentWidget
();
void
Reset
();
void
DeleteAerosol
();
void
DeleteGases
();
void
pushall
();
void
UpdateValues
(
PhysiologyEngine
&
pulse
);
//SECondition& GetInitialEnvironmentConditions();
void
AtSteadyState
(
PhysiologyEngine
&
pulse
);
void
AtSteadyStateUpdateUI
();
// Main Window will call this to update UI Components
...
...
@@ -35,8 +29,21 @@ public:
//signals:
protected
slots
:
void
AddGases
();
void
AddAerosol
();
void
EnableCooling
();
void
EnableCoolingSurfaceArea
();
void
EnableCoolingSurfaceAreaFraction
();
void
EnableHeating
();
void
EnableHeatingSurfaceArea
();
void
EnableHeatingSurfaceAreaFraction
();
void
EnableAppliedTemp
();
void
EnableAppliedTempSurfaceArea
();
void
EnableAppliedSurfaceAreaFraction
();
void
SelectEnvironmentFile
();
void
ControlsToEnvironment
();
void
EnvironmentToControls
();
void
LoadEnvironmentFile
(
const
std
::
string
&
fileName
);
private:
class
Controls
;
...
...
controls/MainExplorerWindow.cxx
View file @
963cc9c6
...
...
@@ -148,7 +148,7 @@ MainExplorerWindow::MainExplorerWindow()
m_Controls
->
DataRequestsWidget
=
new
QDataRequestsWidget
(
*
m_Controls
->
LogBox
,
this
);
m_Controls
->
DataRequestsWidget
->
setTitleBarWidget
(
new
QWidget
());
m_Controls
->
TabWidget
->
widget
(
tabIdx
++
)
->
layout
()
->
addWidget
(
m_Controls
->
DataRequestsWidget
);
m_Controls
->
EnviornmentWidget
=
new
QEnviornmentWidget
(
*
m_Controls
->
LogBox
,
this
);
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
);
...
...
controls/PatientEditorWidget.cxx
View file @
963cc9c6
This diff is collapsed.
Click to expand it.
controls/ScalarQuantityWidget.h
View file @
963cc9c6
...
...
@@ -9,6 +9,7 @@ See accompanying NOTICE file for details.*/
#include <QDoubleSpinBox>
#include <QSpacerItem>
#include <QComboBox>
#include <QRadioButton.h>
#include "controls/ScalarWidget.h"
...
...
@@ -18,17 +19,22 @@ See accompanying NOTICE file for details.*/
template
<
typename
Unit
>
class
QScalarQuantityWidget
:
public
QScalarConvertWidget
{
public:
explicit
QScalarQuantityWidget
(
const
QString
&
name
,
double
min
,
double
max
,
double
step
,
const
Unit
&
unit
,
bool
check
=
true
,
QWidget
*
parent
=
nullptr
,
bool
type
=
false
);
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
();
bool
isChecked
();
void
setDecimals
(
int
prec
);
void
addUnit
(
const
Unit
&
unit
);
void
setValue
(
const
SEScalarQuantity
<
Unit
>&
s
);
void
getValue
(
SEScalarQuantity
<
Unit
>&
s
);
void
enableInput
(
bool
b
);
void
enableConverter
(
bool
b
);
void
fullDisable
();
const
QRadioButton
*
getRadioButton
()
{
return
m_Radio
;
}
protected
slots
:
void
checkProperty
(
bool
b
);
...
...
@@ -39,6 +45,7 @@ protected slots:
QHBoxLayout
*
m_Layout
;
QCheckBox
*
m_Check
;
QRadioButton
*
m_Radio
;
QLabel
*
m_Label
;
QDoubleSpinBox
*
m_Value
;
QSpacerItem
*
m_Spacer
;
...
...
controls/ScalarQuantityWidget.inl
View file @
963cc9c6
...
...
@@ -3,7 +3,7 @@ See accompanying NOTICE file for details.*/
#include "ScalarQuantityWidget.h"
template<typename Unit>
QScalarQuantityWidget<Unit>::QScalarQuantityWidget(const QString& name, double min, double max, double step, const Unit& unit,
bool check, QWidget *parent, bool type
) : 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);
m_Layout = new QHBoxLayout(this);
...
...
@@ -13,35 +13,58 @@ QScalarQuantityWidget<Unit>::QScalarQuantityWidget(const QString& name, double m
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
if (check)
m_Check = nullptr;
m_Radio = nullptr;
switch (optWidget)
{
m_Check = new QCheckBox(name, this);
sizePolicy.setHeightForWidth(m_Check->sizePolicy().hasHeightForWidth());
m_Check->setSizePolicy(sizePolicy);
m_Label = nullptr;
m_Layout->addWidget(m_Check);
connect(m_Check, SIGNAL(toggled(bool)), this, SLOT(checkProperty(bool)));
if (type) {
m_Label = new QLabel(name, this);
m_Label->setSizePolicy(sizePolicy);
m_Layout->addWidget(m_Label);
}
}
else
{
m_Check = nullptr;
m_Label = new QLabel(name, this);
sizePolicy.setHeightForWidth(m_Label->sizePolicy().hasHeightForWidth());
m_Label->setSizePolicy(sizePolicy);
m_Layout->addWidget(m_Label);
case ScalarOptionWidget::Check:
{
m_Check = new QCheckBox(name, this);
sizePolicy.setHeightForWidth(m_Check->sizePolicy().hasHeightForWidth());
m_Check->setSizePolicy(sizePolicy);
m_Label = nullptr;
m_Layout->addWidget(m_Check);
connect(m_Check, SIGNAL(toggled(bool)), this, SLOT(checkProperty(bool)));
if (seperate_label)
{
m_Label = new QLabel(name, this);
m_Label->setSizePolicy(sizePolicy);
m_Layout->addWidget(m_Label);
}
break;
}
case ScalarOptionWidget::Radio:
{
m_Radio = new QRadioButton(name, this);
sizePolicy.setHeightForWidth(m_Radio->sizePolicy().hasHeightForWidth());
m_Radio->setSizePolicy(sizePolicy);
m_Label = nullptr;
m_Layout->addWidget(m_Radio);
//connect(m_Radio, SIGNAL(toggled(bool)), this, SLOT(checkProperty(bool)));
if (seperate_label)
{
m_Label = new QLabel(name, this);
m_Label->setSizePolicy(sizePolicy);
m_Layout->addWidget(m_Label);
}
break;
}
case ScalarOptionWidget::None:
{
m_Label = new QLabel(name, this);
sizePolicy.setHeightForWidth(m_Label->sizePolicy().hasHeightForWidth());
m_Label->setSizePolicy(sizePolicy);
m_Layout->addWidget(m_Label);
break;
}
}
m_Spacer = new QSpacerItem(40, 30, QSizePolicy::Expanding, QSizePolicy::Minimum);
m_Layout->addItem(m_Spacer);
m_Value = new QDoubleSpinBox(this);
m_Value->setSingleStep(step);
if (
c
heck)
if (
optWidget == ScalarOptionWidget::C
heck)
m_Value->setSpecialValueText("nan");
m_Value->setMinimum(
c
heck ? min - step : min);
m_Value->setMinimum(
optWidget == ScalarOptionWidget::C
heck ? min - step : min);
m_Value->setMaximum(max);
m_Value->setMinimumSize(QSize(70, 22));
m_Value->setMaximumSize(QSize(70, 22));
...
...
@@ -66,9 +89,13 @@ QScalarQuantityWidget<Unit>::QScalarQuantityWidget(const QString& name, double m
m_Max = max;
m_Step = step;
reset();
if (type) {
m_Check->setChecked(type);
m_Check->hide();
if (seperate_label)
{
if (m_Check != nullptr)
{
m_Check->setChecked(true);
m_Check->hide();
}
}
}
...
...
@@ -78,6 +105,8 @@ void QScalarQuantityWidget<Unit>::reset()
m_Convert = false;
if (m_Check != nullptr)
m_Check->setChecked(false);
if (m_Radio != nullptr)
m_Radio->setChecked(false);
enableInput(true, false);
m_LastUnitIndex = 0;
m_LastValue = m_Value->minimum();
...
...
@@ -90,9 +119,17 @@ bool QScalarQuantityWidget<Unit>::isChecked()
{
if (m_Check != nullptr)
return m_Check->isChecked();
if (m_Radio != nullptr)
return m_Radio->isChecked();
return true;
}
template<typename Unit>
void QScalarQuantityWidget<Unit>::setDecimals(int prec)
{
m_Value->setDecimals(prec);
}
template<typename Unit>
void QScalarQuantityWidget<Unit>::addUnit(const Unit& unit)
{
...
...
@@ -123,6 +160,7 @@ void QScalarQuantityWidget<Unit>::setValue(const SEScalarQuantity<Unit>& s)
m_Value->setValue(m_Value->minimum());
if (m_Check != nullptr)
m_Check->setChecked(false);
m_Value->setEnabled(false);
}
}
...
...
@@ -146,10 +184,22 @@ template<typename Unit>
void QScalarQuantityWidget<Unit>::enableInput(bool check, bool value)
{
if (m_Check != nullptr)
m_Check->setEnabled(check);
m_Check->setChecked(check);
if (m_Radio != nullptr)
m_Radio->setChecked(check);
m_Value->setEnabled(value);
}
template<typename Unit>
void QScalarQuantityWidget<Unit>::fullDisable()
{
enableInput(false);
if (m_Check != nullptr)
m_Check->setDisabled(true);
if (m_Radio != nullptr)
m_Radio->setDisabled(true);
}
template<typename Unit>
void QScalarQuantityWidget<Unit>::checkProperty(bool b)
{
...
...
controls/ScalarWidget.cxx
View file @
963cc9c6
...
...
@@ -5,7 +5,7 @@ See accompanying NOTICE file for details.*/
#include "cdm/CommonDataModel.h"
#include "cdm/properties/SEScalar.h"
QScalarWidget
::
QScalarWidget
(
const
QString
&
name
,
double
min
,
double
max
,
double
step
,
bool
check
,
QWidget
*
parent
,
bool
type
)
:
QWidget
(
parent
)
QScalarWidget
::
QScalarWidget
(
const
QString
&
name
,
double
min
,
double
max
,
double
step
,
ScalarOptionWidget
optWidget
,
QWidget
*
parent
,
bool
seperate_label
)
:
QWidget
(
parent
)
{
setAutoFillBackground
(
true
);
m_Layout
=
new
QHBoxLayout
(
this
);
...
...
@@ -15,35 +15,58 @@ QScalarWidget::QScalarWidget(const QString& name, double min, double max, double
QSizePolicy
sizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Fixed
);
sizePolicy
.
setHorizontalStretch
(
0
);
sizePolicy
.
setVerticalStretch
(
0
);
if
(
check
)
m_Check
=
nullptr
;
m_Radio
=
nullptr
;
switch
(
optWidget
)
{
m_Check
=
new
QCheckBox
(
name
,
this
);
sizePolicy
.
setHeightForWidth
(
m_Check
->
sizePolicy
().
hasHeightForWidth
());
m_Check
->
setSizePolicy
(
sizePolicy
);
m_Label
=
nullptr
;
m_Layout
->
addWidget
(
m_Check
);
connect
(
m_Check
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
checkProperty
(
bool
)));
if
(
type
)
{
m_Label
=
new
QLabel
(
name
,
this
);
m_Label
->
setSizePolicy
(
sizePolicy
);
m_Layout
->
addWidget
(
m_Label
);
}
case
ScalarOptionWidget
:
:
Check
:
{
m_Check
=
new
QCheckBox
(
name
,
this
);
sizePolicy
.
setHeightForWidth
(
m_Check
->
sizePolicy
().
hasHeightForWidth
());
m_Check
->
setSizePolicy
(
sizePolicy
);
m_Label
=
nullptr
;
m_Layout
->
addWidget
(
m_Check
);
connect
(
m_Check
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
checkProperty
(
bool
)));
if
(
seperate_label
)
{
m_Label
=
new
QLabel
(
name
,
this
);
m_Label
->
setSizePolicy
(
sizePolicy
);
m_Layout
->
addWidget
(
m_Label
);
}
break
;
}
case
ScalarOptionWidget
:
:
Radio
:
{
m_Radio
=
new
QRadioButton
(
name
,
this
);
sizePolicy
.
setHeightForWidth
(
m_Radio
->
sizePolicy
().
hasHeightForWidth
());
m_Radio
->
setSizePolicy
(
sizePolicy
);
m_Label
=
nullptr
;
m_Layout
->
addWidget
(
m_Radio
);
//connect(m_Radio, SIGNAL(toggled(bool)), this, SLOT(checkProperty(bool)));
if
(
seperate_label
)
{
m_Label
=
new
QLabel
(
name
,
this
);
m_Label
->
setSizePolicy
(
sizePolicy
);
m_Layout
->
addWidget
(
m_Label
);
}
break
;
}
case
ScalarOptionWidget
:
:
None
:
{
m_Label
=
new
QLabel
(
name
,
this
);
sizePolicy
.
setHeightForWidth
(
m_Label
->
sizePolicy
().
hasHeightForWidth
());
m_Label
->
setSizePolicy
(
sizePolicy
);
m_Layout
->
addWidget
(
m_Label
);
break
;
}
}
else
{
m_Check
=
nullptr
;
m_Label
=
new
QLabel
(
name
,
this
);
sizePolicy
.
setHeightForWidth
(
m_Label
->
sizePolicy
().
hasHeightForWidth
());
m_Label
->
setSizePolicy
(
sizePolicy
);
m_Layout
->
addWidget
(
m_Label
);
}
m_Spacer1
=
new
QSpacerItem
(
40
,
30
,
QSizePolicy
::
Expanding
,
QSizePolicy
::
Maximum
);
m_Spacer1
=
new
QSpacerItem
(
40
,
30
,
QSizePolicy
::
Expanding
,
QSizePolicy
::
Maximum
);
m_Layout
->
addItem
(
m_Spacer1
);
m_Value
=
new
QDoubleSpinBox
(
this
);
m_Value
=
new
QDoubleSpinBox
(
this
);
m_Value
->
setSingleStep
(
step
);
if
(
c
heck
)
if
(
optWidget
==
ScalarOptionWidget
::
C
heck
)
m_Value
->
setSpecialValueText
(
"nan"
);
m_Value
->
setMinimum
(
check
?
min
-
step
:
min
);
m_Value
->
setMinimum
(
optWidget
==
ScalarOptionWidget
::
Check
?
min
-
step
:
min
);
m_Value
->
setMaximum
(
max
);
m_Value
->
setMinimumSize
(
QSize
(
70
,
22
));
m_Value
->
setMaximumSize
(
QSize
(
70
,
22
));
...
...
@@ -53,9 +76,13 @@ QScalarWidget::QScalarWidget(const QString& name, double min, double max, double
m_Layout
->
addItem
(
m_Spacer2
);
setLayout
(
m_Layout
);
reset
();
if
(
type
)
{
m_Check
->
setChecked
(
type
);
m_Check
->
hide
();
if
(
seperate_label
)
{
if
(
m_Check
!=
nullptr
)
{
m_Check
->
setChecked
(
true
);
m_Check
->
hide
();
}
}
}
void
QScalarWidget
::
reset
()
...
...
@@ -74,6 +101,11 @@ bool QScalarWidget::isChecked()
return
true
;
}
void
QScalarWidget
::
setDecimals
(
int
prec
)
{
m_Value
->
setDecimals
(
prec
);
}
void
QScalarWidget
::
setValue
(
const
SEScalar
&
s
)
{
if
(
s
.
IsValid
())
...
...
@@ -90,6 +122,7 @@ void QScalarWidget::setValue(const SEScalar& s)
if
(
m_Check
!=
nullptr
)
m_Check
->
setChecked
(
false
);
m_LastValue
=
m_Value
->
minimum
();
m_Value
->
setEnabled
(
false
);
}
}
...
...
@@ -110,10 +143,21 @@ void QScalarWidget::enableInput(bool b)
void
QScalarWidget
::
enableInput
(
bool
check
,
bool
value
)
{
if
(
m_Check
!=
nullptr
)
m_Check
->
setEnabled
(
check
);
m_Check
->
setChecked
(
check
);
if
(
m_Radio
!=
nullptr
)
m_Radio
->
setChecked
(
check
);
m_Value
->
setEnabled
(
value
);
}
void
QScalarWidget
::
fullDisable
()
{
enableInput
(
false
);
if
(
m_Check
!=
nullptr
)
m_Check
->
setDisabled
(
true
);
if
(
m_Radio
!=
nullptr
)
m_Radio
->
setDisabled
(
true
);
}
void
QScalarWidget
::
checkProperty
(
bool
b
)
{
m_Value
->
setEnabled
(
b
);
...
...
controls/ScalarWidget.h
View file @
963cc9c6
...
...
@@ -9,22 +9,30 @@ See accompanying NOTICE file for details.*/
#include <QDoubleSpinBox>
#include <QSpacerItem>
#include <QComboBox>
#include <QRadioButton.h>
#include "cdm/CommonDataModel.h"
#include "cdm/properties/SEScalar.h"
enum
class
ScalarOptionWidget
{
None
,
Check
,
Radio
};
class
QScalarWidget
:
public
QWidget
{
Q_OBJECT
public:
explicit
QScalarWidget
(
const
QString
&
name
,
double
min
,
double
max
,
double
step
,
bool
check
=
true
,
QWidget
*
parent
=
nullptr
,
bool
type
=
false
);
explicit
QScalarWidget
(
const
QString
&
name
,
double
min
,
double
max
,
double
step
,
ScalarOptionWidget
optWidget
=
ScalarOptionWidget
::
Check
,
QWidget
*
parent
=
nullptr
,
bool
seperate_label
=
false
);
void
reset
();
bool
isChecked
();
void
setDecimals
(
int
prec
);
void
setValue
(
const
SEScalar
&
s
);
void
getValue
(
SEScalar
&
s
);
void
enableInput
(
bool
b
);
void
fullDisable
();
const
QRadioButton
*
getRadioButton
()
{
return
m_Radio
;
}
public
slots
:
void
checkProperty
(
bool
b
);
...
...
@@ -34,6 +42,7 @@ protected:
QHBoxLayout
*
m_Layout
;
QCheckBox
*
m_Check
;
QRadioButton
*
m_Radio
;
QLabel
*
m_Label
;
QDoubleSpinBox
*
m_Value
;
QSpacerItem
*
m_Spacer1
;
...
...
ui/Enviornment.ui
View file @
963cc9c6
This diff is collapsed.
Click to expand it.
ui/MainExplorerWindow.ui
View file @
963cc9c6
...
...
@@ -196,7 +196,13 @@
</item>
</layout>
</widget>
<widget
class=
"QWidget"
name=
"Enviornment"
>
<widget
class=
"QWidget"
name=
"EnviornmentTab"
>
<property
name=
"autoFillBackground"
>
<bool>
true
</bool>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
QWidget#EnvironmentTab { background: lightgrey }
</string>
</property>
<attribute
name=
"title"
>
<string>
Enviornment
</string>
</attribute>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment