Working on JSON parsing and cleanup

Conflicts:
	libraries/controllers/src/controllers/Route.cpp
	libraries/controllers/src/controllers/ScriptingInterface.cpp
	libraries/controllers/src/controllers/StandardController.cpp
	libraries/controllers/src/controllers/impl/RouteBuilderProxy.h
This commit is contained in:
Brad Davis 2015-10-19 19:31:25 -07:00
parent 8d0148a1ca
commit ef6c4f6f66
3 changed files with 163 additions and 163 deletions

View file

@ -1,24 +1,24 @@
{ {
"name": "Full Mapping config including the standard hydra and gamepad and one more thing", "name": "Full Mapping config including the standard hydra and gamepad and one more thing",
"mappings": [ "mappings": [
{ "src": "./mapping-hydra.json" }, { "src": "./mapping-hydra.json" },
{ "src": "./mapping-xbox.json" }, { "src": "./mapping-xbox.json" },
{ {
"name": "example mapping for standard to js function", "name": "example mapping for standard to js function",
"channels": [ { "channels": [ {
"from": "Standard.B", "from": "Standard.B",
"to": { "to": {
"type":"js", "type":"js",
"function": "function(value){ print(\"Standard.B = \" + value );}" "function": "function(value){ print(\"Standard.B = \" + value );}"
} }
}, { }, {
"from": "Standard.B", "from": "Standard.B",
"to": { "to": {
"type":"js", "type":"js",
"src": "http://www.theNextBigThing.com/hifiInputSignalHandler.js" "src": "http://www.theNextBigThing.com/hifiInputSignalHandler.js"
} }
} }
] ]
} }
] ]
} }

View file

@ -1,36 +1,36 @@
{ {
"name": "example mapping from Standard to actions", "name": "example mapping from Standard to actions",
"channels": [ { "channels": [ {
"from": "Standard.LY", "from": "Standard.LY",
"filters": [ { "filters": [ {
"type": "clamp", "type": "clamp",
"min": 0, "min": 0,
"max": 1 "max": 1
} }
], ],
"to": "Actions.Forward" "to": "Actions.Forward"
}, { }, {
"from": "Standard.LY", "from": "Standard.LY",
"filters": [ { "filters": [ {
"type": "clamp", "type": "clamp",
"min": -1, "min": -1,
"max": 0 "max": 0
}, { }, {
"type": "invert" "type": "invert"
} }
], ],
"to": "Actions.Backward" "to": "Actions.Backward"
}, { }, {
"from": "Standard.LX", "from": "Standard.LX",
"filters": [ { "filters": [ {
"type": "scale", "type": "scale",
"scale": 2.0 "scale": 2.0
} }
], ],
"to": "Actions.Yaw" "to": "Actions.Yaw"
}, { }, {
"from": "Standard.A", "from": "Standard.A",
"to": "Actions.Action0" "to": "Actions.Action0"
} }
] ]
} }

View file

@ -1,104 +1,104 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import QtQuick.Dialogs 1.0 import QtQuick.Dialogs 1.0
import "xbox" import "xbox"
Item { Item {
id: root id: root
property real aspect: 300.0 / 215.0 property real aspect: 300.0 / 215.0
width: 300 width: 300
height: width / aspect height: width / aspect
property var device property var device
property string label: "" property string label: ""
property real scale: width / 300.0 property real scale: width / 300.0
Image { Image {
Text { Text {
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
text: root.label text: root.label
visible: root.label != "" visible: root.label != ""
} }
anchors.fill: parent anchors.fill: parent
source: "xbox/xbox360-controller-md.png" source: "xbox/xbox360-controller-md.png"
LeftAnalogStick { LeftAnalogStick {
device: root.device device: root.device
x: (65 * root.scale) - width / 2; y: (42 * root.scale) - height / 2 x: (65 * root.scale) - width / 2; y: (42 * root.scale) - height / 2
} }
// Left stick press // Left stick press
ToggleButton { ToggleButton {
controlId: root.device.LS controlId: root.device.LS
width: 16 * root.scale; height: 16 * root.scale width: 16 * root.scale; height: 16 * root.scale
x: (65 * root.scale) - width / 2; y: (42 * root.scale) - height / 2 x: (65 * root.scale) - width / 2; y: (42 * root.scale) - height / 2
} }
RightAnalogStick { RightAnalogStick {
device: root.device device: root.device
x: (193 * root.scale) - width / 2; y: (96 * root.scale) - height / 2 x: (193 * root.scale) - width / 2; y: (96 * root.scale) - height / 2
} }
// Right stick press // Right stick press
ToggleButton { ToggleButton {
controlId: root.device.RS controlId: root.device.RS
width: 16 * root.scale; height: 16 * root.scale width: 16 * root.scale; height: 16 * root.scale
x: (193 * root.scale) - width / 2; y: (96 * root.scale) - height / 2 x: (193 * root.scale) - width / 2; y: (96 * root.scale) - height / 2
} }
// Left trigger // Left trigger
AnalogButton { AnalogButton {
controlId: root.device.LT controlId: root.device.LT
width: 8; height: 64 width: 8; height: 64
x: (20 * root.scale); y: (7 * root.scale) x: (20 * root.scale); y: (7 * root.scale)
} }
// Right trigger // Right trigger
AnalogButton { AnalogButton {
controlId: root.device.RT controlId: root.device.RT
width: 8; height: 64 width: 8; height: 64
x: (272 * root.scale); y: (7 * root.scale) x: (272 * root.scale); y: (7 * root.scale)
} }
// Left bumper // Left bumper
ToggleButton { ToggleButton {
controlId: root.device.LB controlId: root.device.LB
width: 32 * root.scale; height: 16 * root.scale width: 32 * root.scale; height: 16 * root.scale
x: (40 * root.scale); y: (7 * root.scale) x: (40 * root.scale); y: (7 * root.scale)
} }
// Right bumper // Right bumper
ToggleButton { ToggleButton {
controlId: root.device.RB controlId: root.device.RB
width: 32 * root.scale; height: 16 * root.scale width: 32 * root.scale; height: 16 * root.scale
x: (root.width - width) - (40 * root.scale); y: (7 * root.scale) x: (root.width - width) - (40 * root.scale); y: (7 * root.scale)
} }
DPad { DPad {
device: root.device device: root.device
size: 48 * root.scale size: 48 * root.scale
x: (80 * root.scale); y: (71 * root.scale) x: (80 * root.scale); y: (71 * root.scale)
} }
XboxButtons { XboxButtons {
device: root.device device: root.device
size: 65 * root.scale size: 65 * root.scale
x: (206 * root.scale); y: (19 * root.scale) x: (206 * root.scale); y: (19 * root.scale)
} }
ToggleButton { ToggleButton {
controlId: root.device.Back controlId: root.device.Back
width: 16 * root.scale; height: 12 * root.scale width: 16 * root.scale; height: 12 * root.scale
x: (112 * root.scale); y: (45 * root.scale) x: (112 * root.scale); y: (45 * root.scale)
} }
ToggleButton { ToggleButton {
controlId: root.device.Start controlId: root.device.Start
width: 16 * root.scale; height: 12 * root.scale width: 16 * root.scale; height: 12 * root.scale
x: (177 * root.scale); y: (45 * root.scale) x: (177 * root.scale); y: (45 * root.scale)
} }
} }
} }