mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:53:25 +02:00
added user activity status
This commit is contained in:
parent
1e23fa7baa
commit
a2df2f8472
4 changed files with 77 additions and 5 deletions
|
@ -25,11 +25,12 @@ Rectangle {
|
||||||
signal canceled()
|
signal canceled()
|
||||||
signal restart()
|
signal restart()
|
||||||
|
|
||||||
property int count: 3
|
property int count: 5
|
||||||
property string calibratingText: "CALIBRATING..."
|
property string calibratingText: "CALIBRATING..."
|
||||||
property string calibratingCountText: "CALIBRATION STARTING IN"
|
property string calibratingCountText: "CALIBRATION STARTING IN"
|
||||||
property string calibrationSuccess: "CALIBRATION COMPLETED"
|
property string calibrationSuccess: "CALIBRATION COMPLETED"
|
||||||
property string calibrationFailed: "CALIBRATION FAILED"
|
property string calibrationFailed: "CALIBRATION FAILED"
|
||||||
|
property string instructionText: "Please stand in a T-Pose during calibration"
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
visible: true
|
visible: true
|
||||||
|
@ -158,6 +159,15 @@ Rectangle {
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
restart();
|
restart();
|
||||||
|
statusText.color = hifi.colors.blueHighlight;
|
||||||
|
statusText.text = info.calibratingCountText;
|
||||||
|
directions.text = instructionText;
|
||||||
|
countDown.visible = true;
|
||||||
|
busyIndicator.running = true;
|
||||||
|
busyRotation.from = 0
|
||||||
|
busyRotation.to = 360
|
||||||
|
busyIndicator.source = blueIndicator;
|
||||||
|
closeWindow.stop();
|
||||||
numberAnimation.stop();
|
numberAnimation.stop();
|
||||||
info.count = (timer.interval / 1000);
|
info.count = (timer.interval / 1000);
|
||||||
numberAnimation.start();
|
numberAnimation.start();
|
||||||
|
@ -178,6 +188,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function start(interval, countNumber) {
|
function start(interval, countNumber) {
|
||||||
countDown.visible = true;
|
countDown.visible = true;
|
||||||
statusText.color = hifi.colors.blueHighlight;
|
statusText.color = hifi.colors.blueHighlight;
|
||||||
|
@ -201,6 +212,7 @@ Rectangle {
|
||||||
busyIndicator.running = false;
|
busyIndicator.running = false;
|
||||||
statusText.text = info.calibrationSuccess
|
statusText.text = info.calibrationSuccess
|
||||||
statusText.color = hifi.colors.greenHighlight
|
statusText.color = hifi.colors.greenHighlight
|
||||||
|
directions.text = "SUCCESS"
|
||||||
closeWindow.start();
|
closeWindow.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -458,7 +458,7 @@ Rectangle {
|
||||||
width: glyphButton.width + calibrationText.width + padding
|
width: glyphButton.width + calibrationText.width + padding
|
||||||
height: hifi.dimensions.controlLineHeight
|
height: hifi.dimensions.controlLineHeight
|
||||||
anchors.top: bottomSeperator.bottom
|
anchors.top: bottomSeperator.bottom
|
||||||
anchors.topMargin: 10
|
anchors.topMargin: 15
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: leftMargin
|
anchors.leftMargin: leftMargin
|
||||||
|
|
||||||
|
@ -590,16 +590,24 @@ Rectangle {
|
||||||
lastConfiguration = composeConfigurationSettings();
|
lastConfiguration = composeConfigurationSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
var settings = InputConfiguration.configurationSettings(pluginName);
|
||||||
|
var data = {
|
||||||
|
"num_pucks": settings["puckCount"]
|
||||||
|
}
|
||||||
|
UserActivityLogger.logAction("mocap_ui_close_dialog", data);
|
||||||
|
}
|
||||||
|
|
||||||
HifiControls.SpinBox {
|
HifiControls.SpinBox {
|
||||||
id: timeToCalibrate
|
id: timeToCalibrate
|
||||||
width: 70
|
width: 70
|
||||||
anchors.top: calibrationButton.bottom
|
anchors.top: calibrationButton.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 20
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: leftMargin
|
anchors.leftMargin: leftMargin
|
||||||
|
|
||||||
minimumValue: 3
|
minimumValue: 5
|
||||||
value: 3
|
value: 5
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
|
@ -645,10 +653,27 @@ Rectangle {
|
||||||
var calibrationScreen = stack.currentItem;
|
var calibrationScreen = stack.currentItem;
|
||||||
if (status["calibrated"]) {
|
if (status["calibrated"]) {
|
||||||
calibrationScreen.success();
|
calibrationScreen.success();
|
||||||
|
var data = {
|
||||||
|
"num_pucks": status["puckCount"],
|
||||||
|
"puck_configuration": status["configuration"],
|
||||||
|
"head_puck": status["head_puck"],
|
||||||
|
"hand_puck": status["hand_puck"]
|
||||||
|
}
|
||||||
|
|
||||||
|
UserActivityLogger.logAction("mocap_ui_success", data);
|
||||||
} else if (!status["calibrated"]) {
|
} else if (!status["calibrated"]) {
|
||||||
var uncalibrated = status["success"];
|
var uncalibrated = status["success"];
|
||||||
if (!uncalibrated) {
|
if (!uncalibrated) {
|
||||||
calibrationScreen.failure();
|
calibrationScreen.failure();
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
"num_pucks": status["puckCount"],
|
||||||
|
"puck_configuration": status["configuration"],
|
||||||
|
"head_puck": status["head_puck"],
|
||||||
|
"hand_puck": status["hand_puck"]
|
||||||
|
}
|
||||||
|
|
||||||
|
UserActivityLogger.logAction("mocap_ui_fail", data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -717,6 +742,12 @@ Rectangle {
|
||||||
|
|
||||||
initializeButtonState();
|
initializeButtonState();
|
||||||
updateCalibrationText();
|
updateCalibrationText();
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
"num_pucks": settings["puckCount"]
|
||||||
|
};
|
||||||
|
|
||||||
|
UserActivityLogger.logAction("mocap_ui_open_dialog", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayTrackerConfiguration(type) {
|
function displayTrackerConfiguration(type) {
|
||||||
|
|
|
@ -374,6 +374,7 @@ QJsonObject ViveControllerManager::InputDevice::configurationSettings() {
|
||||||
configurationSettings["trackerConfiguration"] = configToString(_preferedConfig);
|
configurationSettings["trackerConfiguration"] = configToString(_preferedConfig);
|
||||||
configurationSettings["HMDHead"] = (_headConfig == HeadConfig::HMD) ? true : false;
|
configurationSettings["HMDHead"] = (_headConfig == HeadConfig::HMD) ? true : false;
|
||||||
configurationSettings["handController"] = (_handConfig == HandConfig::HandController) ? true : false;
|
configurationSettings["handController"] = (_handConfig == HandConfig::HandController) ? true : false;
|
||||||
|
configurationSettings["puckCount"] = (int)_validTrackedObjects.size();
|
||||||
return configurationSettings;
|
return configurationSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,14 +385,22 @@ void ViveControllerManager::InputDevice::emitCalibrationStatus(const bool succes
|
||||||
if (_calibrated && success) {
|
if (_calibrated && success) {
|
||||||
status["calibrated"] = _calibrated;
|
status["calibrated"] = _calibrated;
|
||||||
status["configuration"] = configToString(_preferedConfig);
|
status["configuration"] = configToString(_preferedConfig);
|
||||||
|
status["head_puck"] = (_headConfig == HeadConfig::Puck) ? true : false;
|
||||||
|
status["hand_pucks"] = (_handConfig == HandConfig::Pucks) ? true : false;
|
||||||
|
status["puckCount"] = (int)_validTrackedObjects.size();
|
||||||
} else if (!_calibrated && !success) {
|
} else if (!_calibrated && !success) {
|
||||||
status["calibrated"] = _calibrated;
|
status["calibrated"] = _calibrated;
|
||||||
status["success"] = success;
|
status["success"] = success;
|
||||||
|
status["success"] = (int)_validTrackedObjects.size();
|
||||||
|
status["head_puck"] = (_headConfig == HeadConfig::Puck) ? true : false;
|
||||||
|
status["hand_pucks"] = (_handConfig == HandConfig::Pucks) ? true : false;
|
||||||
} else if (!_calibrated && success) {
|
} else if (!_calibrated && success) {
|
||||||
status["calibrated"] = _calibrated;
|
status["calibrated"] = _calibrated;
|
||||||
status["success"] = success;
|
status["success"] = success;
|
||||||
status["configuration"] = configToString(_preferedConfig);
|
status["configuration"] = configToString(_preferedConfig);
|
||||||
status["puckCount"] = (int)_validTrackedObjects.size();
|
status["puckCount"] = (int)_validTrackedObjects.size();
|
||||||
|
status["head_puck"] = (_headConfig == HeadConfig::Puck) ? true : false;
|
||||||
|
status["hand_pucks"] = (_handConfig == HandConfig::Pucks) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit inputConfiguration->calibrationStatus(status); //inputConfiguration->calibrated(status);
|
emit inputConfiguration->calibrationStatus(status); //inputConfiguration->calibrated(status);
|
||||||
|
@ -437,12 +446,31 @@ void ViveControllerManager::InputDevice::handleTrackedObject(uint32_t deviceInde
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ViveControllerManager::InputDevice::sendUserActivityData(QString activity) {
|
||||||
|
QJsonObject jsonData = {
|
||||||
|
{"num_pucks", (int)_validTrackedObjects.size()},
|
||||||
|
{"configuration", configToString(_preferedConfig)},
|
||||||
|
{"head_puck", (_headConfig == HeadConfig::Puck) ? true : false},
|
||||||
|
{"hand_pucks", (_handConfig == HandConfig::Pucks) ? true : false}
|
||||||
|
};
|
||||||
|
|
||||||
|
UserActivityLogger::getInstance().logAction(activity, jsonData);
|
||||||
|
}
|
||||||
|
|
||||||
void ViveControllerManager::InputDevice::calibrateOrUncalibrate(const controller::InputCalibrationData& inputCalibration) {
|
void ViveControllerManager::InputDevice::calibrateOrUncalibrate(const controller::InputCalibrationData& inputCalibration) {
|
||||||
if (!_calibrated) {
|
if (!_calibrated) {
|
||||||
calibrate(inputCalibration);
|
calibrate(inputCalibration);
|
||||||
|
|
||||||
|
if (_calibrated) {
|
||||||
|
sendUserActivityData("mocap_button_success");
|
||||||
|
} else {
|
||||||
|
sendUserActivityData("mocap_button_fail");
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uncalibrate();
|
uncalibrate();
|
||||||
emitCalibrationStatus(true);
|
emitCalibrationStatus(true);
|
||||||
|
sendUserActivityData("mocap_button_uncalibrate");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ private:
|
||||||
void calibrateOrUncalibrate(const controller::InputCalibrationData& inputCalibration);
|
void calibrateOrUncalibrate(const controller::InputCalibrationData& inputCalibration);
|
||||||
void calibrate(const controller::InputCalibrationData& inputCalibration);
|
void calibrate(const controller::InputCalibrationData& inputCalibration);
|
||||||
void uncalibrate();
|
void uncalibrate();
|
||||||
|
void sendUserActivityData(QString activity);
|
||||||
void configureCalibrationSettings(const QJsonObject configurationSettings);
|
void configureCalibrationSettings(const QJsonObject configurationSettings);
|
||||||
QJsonObject configurationSettings();
|
QJsonObject configurationSettings();
|
||||||
controller::Pose addOffsetToPuckPose(int joint) const;
|
controller::Pose addOffsetToPuckPose(int joint) const;
|
||||||
|
|
Loading…
Reference in a new issue