11import QtQuick
2+ import QtQuick.Layouts
3+ import QtQuick.Controls
24import QtQuick3D
35import QtQuick3D.Helpers
46
57import Main
8+ import Common
69import "/qt/qml/Main/sharedData.js" as SharedData
710import "RobotModelViewer.js" as Logic
811
@@ -13,6 +16,7 @@ Rectangle {
1316 property ClientEndpoint client
1417 property alias robotState: robotState
1518 property alias robotCmd: robotCmd
19+ property alias showRobotCmd: showCmdChk .checked
1620
1721 function updateRobotState (js , robot , fieldName ) {
1822 Logic .updateViewerState (js, robot, fieldName)
@@ -27,6 +31,28 @@ Rectangle {
2731 //
2832 id: root
2933
34+ Control {
35+
36+ z: 10
37+
38+ contentItem: GridLayout {
39+ columns: 2
40+ CheckBox {
41+ id: showAxesChk
42+ Layout .fillWidth : true
43+ Layout .columnSpan : 2
44+ text: ' Show axes'
45+ }
46+ CheckBox {
47+ id: showCmdChk
48+ Layout .fillWidth : true
49+ Layout .columnSpan : 2
50+ text: ' Show command robot'
51+ }
52+ }
53+
54+ }
55+
3056 // The root scene
3157 Node {
3258
@@ -51,7 +77,7 @@ Rectangle {
5177 }
5278
5379 Axes3D {
54-
80+ visible : showAxesChk . checked
5581 }
5682
5783 Node {
@@ -64,16 +90,14 @@ Rectangle {
6490 eulerRotation .x : - 25
6591 }
6692
67-
68-
6993 RobotModelNode {
7094 id: robotState
7195 client: root .client
7296 eulerRotation .x : - 90
7397 y: 75
74- opacity: 0.5
98+ opacity: showAxesChk . checked ? 0.9 : 1
7599 color: ' green'
76- visible : false
100+ axesVisible : showAxesChk . checked
77101 }
78102
79103 RobotModelNode {
@@ -82,6 +106,7 @@ Rectangle {
82106 eulerRotation .x : - 90
83107 y: 75
84108 opacity: 0.5
109+ visible: showCmdChk .checked
85110 }
86111
87112 }
@@ -97,7 +122,7 @@ Rectangle {
97122
98123 environment: SceneEnvironment {
99124 backgroundMode: SceneEnvironment .Color
100- clearColor: Qt . rgba ( 0.8 , 0.8 , 0.8 , 1 )
125+ clearColor: palette . active . base
101126 InfiniteGrid {
102127 gridInterval: 30
103128 }
0 commit comments