Skip to content

Commit

Permalink
Move AirPressure functions out of ComponentInspector (#1179)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Nov 9, 2021
1 parent 9fa9a84 commit 2d8d50f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/gui/plugins/component_inspector/AirPressure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace gazebo;
/////////////////////////////////////////////////
AirPressure::AirPressure(ComponentInspector *_inspector)
{
_inspector->Context()->setContextProperty("AirPressure", this);
_inspector->Context()->setContextProperty("AirPressureImpl", this);
this->inspector = _inspector;

ComponentCreator creator =
Expand Down
31 changes: 24 additions & 7 deletions src/gui/plugins/component_inspector/AirPressure.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ Rectangle {
width: componentInspector.width
color: index % 2 == 0 ? lightGrey : darkGrey

/**
* Forward air pressure noise changes to C++
*/
function onAirPressureNoise(_mean, _meanBias, _stdDev, _stdDevBias,
_dynamicBiasStdDev, _dynamicBiasCorrelationTime) {
AirPressureImpl.OnAirPressureNoise(
_mean, _meanBias, _stdDev, _stdDevBias,
_dynamicBiasStdDev, _dynamicBiasCorrelationTime);
}

/**
* Forward air pressure reference altitude changes to C++
*/
function onAirPressureReferenceAltitude(_referenceAltitude) {
AirPressureImpl.OnAirPressureReferenceAltitude(_referenceAltitude);
}

Column {
anchors.fill: parent

Expand All @@ -41,7 +58,7 @@ Rectangle {
// Set the 'expandingHeaderText' value to override the default header
// values, which is based on the model.
expandingHeaderText: "Air pressure"
expandingHeaderToolTip: "Air pressure properties"
expandingHeaderToolTip: "Air pressure properties"
}

// This is the content that will be expanded/contracted using the
Expand Down Expand Up @@ -82,15 +99,15 @@ Rectangle {
Layout.fillWidth: true
height: 40
property double refAltitude: model.data[0]
value: referenceAltitudeSpin.activeFocus ? referenceAltitudeSpin.value : refAltitude
value: referenceAltitudeSpin.activeFocus ? referenceAltitudeSpin.value : refAltitude

minimumValue: 0
maximumValue: 100000
decimals:4
minimumValue: 0
maximumValue: 100000
decimals:4
stepSize: 0.1
onEditingFinished: {
refAltitude = referenceAltitudeSpin.value
componentInspector.onAirPressureReferenceAltitude(refAltitude);
onAirPressureReferenceAltitude(refAltitude);
}
}
}
Expand Down Expand Up @@ -127,7 +144,7 @@ Rectangle {
// Connect to the onNoiseUpdate signal in Noise.qml
Component.onCompleted: {
pressureNoise.onNoiseUpdate.connect(
componentInspector.onAirPressureNoise)
onAirPressureNoise)
}
}
}
Expand Down
17 changes: 0 additions & 17 deletions src/gui/plugins/component_inspector/ComponentInspector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,6 @@ Rectangle {
return 6;
}

/**
* Forward air pressure noise changes to C++
*/
function onAirPressureNoise(_mean, _meanBias, _stdDev, _stdDevBias,
_dynamicBiasStdDev, _dynamicBiasCorrelationTime) {
AirPressure.OnAirPressureNoise(
_mean, _meanBias, _stdDev, _stdDevBias,
_dynamicBiasStdDev, _dynamicBiasCorrelationTime);
}

/**
* Forward air pressure reference altitude changes to C++
*/
function onAirPressureReferenceAltitude(_referenceAltitude) {
AirPressure.OnAirPressureReferenceAltitude(_referenceAltitude);
}

/**
* Forward pose changes to C++
*/
Expand Down

0 comments on commit 2d8d50f

Please sign in to comment.