Skip to content

Commit

Permalink
Version 1.1 Release Candidate 1
Browse files Browse the repository at this point in the history
  • Loading branch information
matzman666 committed Oct 24, 2017
1 parent 2c99d3e commit c835165
Show file tree
Hide file tree
Showing 19 changed files with 818 additions and 225 deletions.
3 changes: 3 additions & 0 deletions VRInputEmulator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_vrinputemulator", "lib_vrinputemulator\lib_vrinputemulator.vcxproj", "{05AC9994-2B63-4DE5-ABF3-95CE346F3A64}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "driver_vrinputemulator", "driver_vrinputemulator\driver_vrinputemulator.vcxproj", "{AF6FBE95-527D-499B-9ABD-3A47E9E84C8A}"
ProjectSection(ProjectDependencies) = postProject
{05AC9994-2B63-4DE5-ABF3-95CE346F3A64} = {05AC9994-2B63-4DE5-ABF3-95CE346F3A64}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client_leapmotion", "client_leapmotion\client_leapmotion.vcxproj", "{329C6147-E62D-456F-8860-A2DD91B113B5}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion client_overlay/bin/win64/res/qml/DeviceAnalogAxisEntry.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RowLayout {
Connections {
target: DeviceManipulationTabController
onConfigureAnalogInputRemappingFinished: {
axisStatus = DeviceManipulationTabController.getAnalogAxisName(deviceIndex, axisId);
axisStatus = DeviceManipulationTabController.getAnalogAxisStatus(deviceIndex, axisId);
configButton.text = axisStatus
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ MyStackViewPage {
var _controllerNames = ["<No Change>"]
_controllerIds = []
for (var i = 0; i < DeviceManipulationTabController.getDeviceCount(); i++) {
_controllerNames.push(DeviceManipulationTabController.getDeviceSerial(i))
var deviceId = DeviceManipulationTabController.getDeviceId(i)
var deviceName = deviceId.toString() + ": " + DeviceManipulationTabController.getDeviceSerial(i)
_controllerNames.push(deviceName)
_controllerIds.push(DeviceManipulationTabController.getDeviceId(i))
}
openVRControllerComboBox.model = _controllerNames
Expand Down
7 changes: 0 additions & 7 deletions client_overlay/bin/win64/res/qml/DeviceInputRemappingPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,6 @@ MyStackViewPage {
Component.onCompleted: {
}

Connections {
target: DeviceManipulationTabController
onConfigureDigitalInputRemappingFinished: {

}
}

}

}
101 changes: 65 additions & 36 deletions client_overlay/bin/win64/res/qml/DeviceManipulationPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,6 @@ MyStackViewPage {
dialogWidth: 600
dialogHeight: 400
dialogContentItem: ColumnLayout {
RowLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
Item {
Layout.fillWidth: true
}
MyComboBox {
id: deviceManipulationNewProfileType
Layout.maximumWidth: 555
Layout.minimumWidth: 555
Layout.preferredWidth: 555
Layout.fillWidth: true
model: [
"Device Offsets"
]
currentIndex: 0
}
Item {
Layout.fillWidth: true
}
}
RowLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Expand All @@ -86,22 +64,37 @@ MyStackViewPage {
}
}
}
ColumnLayout {
Layout.topMargin: 16
Layout.leftMargin: 16
Layout.rightMargin: 16
MyToggleButton {
id: includeDeviceOffsetsToggle
text: "Include Device Offsets"
}
MyToggleButton {
id: includeInputRemapping
text: "Include Input Remapping"
}
}
}
onClosed: {
if (okClicked) {
if (deviceManipulationNewProfileName.text == "") {
deviceManipulationMessageDialog.showMessage("Create New Profile", "ERROR: Empty profile name.")
} else if (deviceManipulationNewProfileType.currentIndex == 0) {
DeviceManipulationTabController.addDeviceManipulationProfile(deviceManipulationNewProfileName.text, deviceIndex, true, false)
} else if (!includeDeviceOffsetsToggle.checked && !includeInputRemapping.checked) {
deviceManipulationMessageDialog.showMessage("Create New Profile", "ERROR: Nothing to include selected.")
} else {
DeviceManipulationTabController.addDeviceManipulationProfile(deviceManipulationNewProfileName.text, deviceIndex, false, true)
DeviceManipulationTabController.addDeviceManipulationProfile(deviceManipulationNewProfileName.text, deviceIndex,
includeDeviceOffsetsToggle.checked, includeInputRemapping.checked)
}

}
}
function openPopup(device) {
deviceManipulationNewProfileName.text = ""
deviceManipulationNewProfileType.currentIndex = 0
includeDeviceOffsetsToggle.checked = false
includeInputRemapping.checked = false
deviceIndex = device
open()
}
Expand All @@ -128,11 +121,11 @@ MyStackViewPage {
Layout.fillWidth: true
model: []
onCurrentIndexChanged: {
deviceModeSelectionComboBox.currentIndex = 0
if (currentIndex >= 0) {
DeviceManipulationTabController.updateDeviceInfo(currentIndex);
fetchDeviceInfo()
}
deviceModeSelectionComboBox.currentIndex = 0
}
}
}

Expand Down Expand Up @@ -183,8 +176,9 @@ MyStackViewPage {
var deviceCount = DeviceManipulationTabController.getDeviceCount()
for (var i = 0; i < deviceCount; i++) {
var deviceMode = DeviceManipulationTabController.getDeviceMode(i)
if (deviceMode == 0 && i != deviceSelectionComboBox.currentIndex) {
var deviceName = DeviceManipulationTabController.getDeviceSerial(i)
var deviceId = DeviceManipulationTabController.getDeviceId(i)
if (i != deviceSelectionComboBox.currentIndex) {
var deviceName =deviceId + ": " + DeviceManipulationTabController.getDeviceSerial(i)
var deviceClass = DeviceManipulationTabController.getDeviceClass(i)
if (deviceClass == 1) {
deviceName += " (HMD)"
Expand Down Expand Up @@ -232,13 +226,14 @@ MyStackViewPage {
if (deviceModeSelectionComboBox.currentIndex == 2 || deviceModeSelectionComboBox.currentIndex == 3) {
var targetId = deviceModeTargetSelectionComboBox.deviceIndices[deviceModeTargetSelectionComboBox.currentIndex]
if (targetId >= 0) {
DeviceManipulationTabController.setDeviceMode(deviceSelectionComboBox.currentIndex, deviceModeSelectionComboBox.currentIndex, targetId)
deviceModeSelectionComboBox.currentIndex = 0
deviceModeTargetSelectionComboBox.currentIndex = -1
if (!DeviceManipulationTabController.setDeviceMode(deviceSelectionComboBox.currentIndex, deviceModeSelectionComboBox.currentIndex, targetId)) {
deviceManipulationMessageDialog.showMessage("Set Device Mode", "Could not set device mode: " + DeviceManipulationTabController.getDeviceModeErrorString())
}
}
} else {
DeviceManipulationTabController.setDeviceMode(deviceSelectionComboBox.currentIndex, deviceModeSelectionComboBox.currentIndex, 0)
deviceModeSelectionComboBox.currentIndex = 0
if (!DeviceManipulationTabController.setDeviceMode(deviceSelectionComboBox.currentIndex, deviceModeSelectionComboBox.currentIndex, 0)) {
deviceManipulationMessageDialog.showMessage("Set Device Mode", "Could not set device mode: " + DeviceManipulationTabController.getDeviceModeErrorString())
}
}
}
}
Expand Down Expand Up @@ -481,8 +476,11 @@ MyStackViewPage {
if (index >= 0) {
var deviceMode = DeviceManipulationTabController.getDeviceMode(index)
var deviceState = DeviceManipulationTabController.getDeviceState(index)
var deviceClass = DeviceManipulationTabController.getDeviceClass(index)
var statusText = ""
if (deviceMode == 0) { // default
deviceModeSelectionComboBox.currentIndex = 0
deviceModeSelectionComboBox.enabled = true
if (deviceState == 0) {
statusText = "Default"
} else if (deviceState == 1) {
Expand All @@ -491,12 +489,21 @@ MyStackViewPage {
statusText = "Default (Unknown state " + deviceState.toString() + ")"
}
} else if (deviceMode == 1) { // fake disconnection
deviceModeSelectionComboBox.currentIndex = 1
if (deviceState == 0 || deviceState == 1) {
statusText = "Disabled"
} else {
statusText = "Disabled (Unknown state " + deviceState.toString() + ")"
}
} else if (deviceMode == 2) { // redirect source
deviceModeSelectionComboBox.currentIndex = 2
var refIndex = DeviceManipulationTabController.getDeviceModeRefDeviceIndex(index)
for (var i = 0; i < deviceModeTargetSelectionComboBox.deviceIndices.length; i++) {
if (refIndex == deviceModeTargetSelectionComboBox.deviceIndices[i]) {
deviceModeTargetSelectionComboBox.currentIndex = i
break
}
}
if (deviceState == 0) {
statusText = "Redirect Source"
} else if (deviceState == 1) {
Expand All @@ -505,6 +512,14 @@ MyStackViewPage {
statusText = "Redirect Source (Unknown state " + deviceState.toString() + ")"
}
} else if (deviceMode == 3) { // redirect target
deviceModeSelectionComboBox.currentIndex = 2
var refIndex = DeviceManipulationTabController.getDeviceModeRefDeviceIndex(index)
for (var i = 0; i < deviceModeTargetSelectionComboBox.deviceIndices.length; i++) {
if (refIndex == deviceModeTargetSelectionComboBox.deviceIndices[i]) {
deviceModeTargetSelectionComboBox.currentIndex = i
break
}
}
if (deviceState == 0) {
statusText = "Redirect Target"
} else if (deviceState == 1) {
Expand All @@ -513,14 +528,23 @@ MyStackViewPage {
statusText = "Redirect Target (Unknown state " + deviceState.toString() + ")"
}
} else if (deviceMode == 4) { // swap mode
deviceModeSelectionComboBox.currentIndex = 3
var refIndex = DeviceManipulationTabController.getDeviceModeRefDeviceIndex(index)
for (var i = 0; i < deviceModeTargetSelectionComboBox.deviceIndices.length; i++) {
if (refIndex == deviceModeTargetSelectionComboBox.deviceIndices[i]) {
deviceModeTargetSelectionComboBox.currentIndex = i
break
}
}
if (deviceState == 0) {
statusText = "Swapped"
} else if (deviceState == 1) {
statusText = "Swapped (Disconnected)"
} else {
statusText = "Swapped (Unknown state " + deviceState.toString() + ")"
}
} else if (deviceMode == 5) { // motion compensation
} else if (deviceMode == 5) { // motion compens4tion
deviceModeSelectionComboBox.currentIndex = 4
if (deviceState == 0) {
statusText = "Motion Compensation"
} else {
Expand All @@ -530,6 +554,11 @@ MyStackViewPage {
statusText = "Unknown Mode " + deviceMode.toString()
}
deviceStatusText.text = statusText
if (deviceClass == 2 || deviceClass == 3) {
deviceIdentifyButton.enabled = true
} else {
deviceIdentifyButton.enabled = false
}
}
}

Expand Down
28 changes: 9 additions & 19 deletions client_overlay/bin/win64/res/qml/MotionCompensationPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,17 @@ MyStackViewPage {

MySlider {
id: movingAverageWindowSlider
// There seems to be a bug which causes the handle to snap to the wrong position when 'from' is not 0
from: 0
to: 19
from: 1
to: 20
stepSize: 1
value: 2
Layout.fillWidth: true
onPositionChanged: {
var val = (1 + ( this.position * this.to)).toFixed(0)
if (activeFocus) {
//ChaperoneTabController.setHeight(val, false);
}
var val = (this.from + this.position * (this.to-this.from)).toFixed(0)
movingAverageWindowText.text = val
}
onValueChanged: {
//ChaperoneTabController.setHeight(value.toFixed(0), false)
DeviceManipulationTabController.setMotionCompensationMovingAverageWindow(value.toFixed(0), false)
}
}

Expand All @@ -216,18 +212,11 @@ MyStackViewPage {
horizontalAlignment: Text.AlignHCenter
function onInputEvent(input) {
var val = parseFloat(input)
if (!isNaN(val)) {
if (val < 1) {
val = 1
}
var v = val.toFixed(0) - 1
if (v <= movingAverageWindowSlider.to) {
movingAverageWindowSlider.value = v
} else {
//ChaperoneTabController.setHeight(v, false)
}
if (!isNaN(val) && val >= 0.0) {
DeviceManipulationTabController.setMotionCompensationMovingAverageWindow(val.toFixed(0))
} else {
movingAverageWindowText.text = DeviceManipulationTabController.getMotionCompensationMovingAverageWindow().toFixed(0)
}
//text = ChaperoneTabController.height.toFixed(2)
}
}
}
Expand All @@ -246,6 +235,7 @@ MyStackViewPage {
deviceSelectionComboBox.currentIndex = DeviceManipulationTabController.getMotionCompensationVelAccMode()
kalmanProcessNoiseInputField.text = DeviceManipulationTabController.getMotionCompensationKalmanProcessNoise().toFixed(2)
kalmanObservationNoiseInputField.text = DeviceManipulationTabController.getMotionCompensationKalmanObservationNoise().toFixed(2)
movingAverageWindowSlider.value = DeviceManipulationTabController.getMotionCompensationMovingAverageWindow().toFixed(0)
setupFinished = true
}

Expand Down
Loading

0 comments on commit c835165

Please sign in to comment.