Skip to content

Commit b67dfbf

Browse files
committed
Bring back feature for plotting pose attributes from Component Inspector (#2835)
Signed-off-by: Ian Chen <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]> (cherry picked from commit 6135ae8)
1 parent b23c089 commit b67dfbf

File tree

1 file changed

+46
-35
lines changed

1 file changed

+46
-35
lines changed

src/gui/plugins/component_inspector/Pose3d.qml

+46-35
Original file line numberDiff line numberDiff line change
@@ -90,48 +90,59 @@ Rectangle {
9090
color: "transparent"
9191
width: parent.width
9292
height: gzPoseInstance.height
93-
RowLayout {
94-
id: gzPoseRow
95-
width: parent.width
9693

97-
// Left spacer
98-
Item {
99-
Layout.preferredWidth: margin + indentation
94+
GzPose {
95+
id: gzPoseInstance
96+
width: parent.width - margin * 2 - indentation
97+
x: margin + indentation
98+
readOnly: {
99+
var isModel = entityType == "model"
100+
return !(isModel) || nestedModel
100101
}
101102

102-
// Content
103-
GzPose {
104-
id: gzPoseInstance
105-
Layout.fillWidth: true
106-
Layout.preferredWidth: parent.width
107-
108-
readOnly: {
109-
var isModel = entityType == "model"
110-
return !(isModel) || nestedModel
111-
}
103+
xValue: model.data[0]
104+
yValue: model.data[1]
105+
zValue: model.data[2]
106+
rollValue: model.data[3]
107+
pitchValue: model.data[4]
108+
yawValue: model.data[5]
112109

113-
xValue: model.data[0]
114-
yValue: model.data[1]
115-
zValue: model.data[2]
116-
rollValue: model.data[3]
117-
pitchValue: model.data[4]
118-
yawValue: model.data[5]
119-
120-
onGzPoseSet: {
121-
// _x, _y, _z, _roll, _pitch, _yaw are parameters of signal gzPoseSet
122-
sendPose(_x, _y, _z, _roll, _pitch, _yaw)
123-
}
124-
125-
// By default it is closed
126-
expand: false
110+
onGzPoseSet: (_x, _y, _z, _roll, _pitch, _yaw) => {
111+
// _x, _y, _z, _roll, _pitch, _yaw are parameters of signal gzPoseSet
112+
// from gz-gui GzPose.qml
113+
sendPose(_x, _y, _z, _roll, _pitch, _yaw)
114+
}
127115

128-
} // end gzPoseInstance
116+
// By default pose widget is collapsed
117+
expand: false
129118

130-
// Right spacer
131-
Item {
132-
Layout.preferredWidth: margin
119+
// plotting
120+
gzPlotEnabled: true
121+
gzPlotMimeDataX: { "text/plain" : (model === null) ? "" :
122+
"Component," + model.entity + "," + model.typeId + "," +
123+
model.dataType + ",x," + model.shortName
124+
}
125+
gzPlotMimeDataY: { "text/plain" : (model === null) ? "" :
126+
"Component," + model.entity + "," + model.typeId + "," +
127+
model.dataType + ",y," + model.shortName
128+
}
129+
gzPlotMimeDataZ: { "text/plain" : (model === null) ? "" :
130+
"Component," + model.entity + "," + model.typeId + "," +
131+
model.dataType + ",z," + model.shortName
132+
}
133+
gzPlotMimeDataRoll: { "text/plain" : (model === null) ? "" :
134+
"Component," + model.entity + "," + model.typeId + "," +
135+
model.dataType + ",roll," + model.shortName
136+
}
137+
gzPlotMimeDataPitch: { "text/plain" : (model === null) ? "" :
138+
"Component," + model.entity + "," + model.typeId + "," +
139+
model.dataType + ",pitch," + model.shortName
140+
}
141+
gzPlotMimeDataYaw: { "text/plain" : (model === null) ? "" :
142+
"Component," + model.entity + "," + model.typeId + "," +
143+
model.dataType + ",yaw," + model.shortName
133144
}
134-
} // end RowLayout
145+
} // end gzPoseInstance
135146
} // end Rectangle
136147
} // end Column
137148
} // end Rectangle

0 commit comments

Comments
 (0)