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

View file

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

View file

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