Skip to content

Commit

Permalink
Alternative implementation using function overloading
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Nov 8, 2021
1 parent d553e8f commit 37eade4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/gui/plugins/component_inspector/AirPressure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Q_INVOKABLE void AirPressure::OnAirPressureNoise(
double _stdDevBias, double _dynamicBiasStdDev,
double _dynamicBiasCorrelationTime)
{
igndbg << "here" << std::endl;
ignition::gazebo::UpdateCallback cb =
[=](EntityComponentManager &_ecm)
{
Expand Down
8 changes: 4 additions & 4 deletions src/gui/plugins/component_inspector/AirPressure.qml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ Rectangle {
dynamicBiasStdDev: model.data[5]
dynamicBiasCorrelationTime: model.data[6]

// Connect to the onNoiseUpdate signal in Noise.qml
Component.onCompleted: {
pressureNoise.onNoiseUpdate.connect(
componentInspector.onAirPressureNoise)
function onNoiseUpdate(_mean, _meanBias, _stdDev,
_stdDevBias, _dynamicBiasStdDev, _dynamicBiasCorrelationTime) {
componentInspector.onAirPressureNoise(_mean, _meanBias, _stdDev,
_stdDevBias, _dynamicBiasStdDev, _dynamicBiasCorrelationTime);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/gui/plugins/component_inspector/Noise.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ Rectangle {

// Signal that a user of this component can connect to in order to receive
// noise updates
signal onNoiseUpdate(double _mean, double _meanBias, double _stdDev,
double _stdDevBias, double _dynamicBiasStdDev,
double _dynamicBiasCorrelationTime)
function onNoiseUpdate(_mean, _meanBias, _stdDev,
_stdDevBias, _dynamicBiasStdDev, _dynamicBiasCorrelationTime) {}


// Display the main content
Column {
Expand Down

0 comments on commit 37eade4

Please sign in to comment.