mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 11:46:34 +02:00
no debug printing
This commit is contained in:
parent
c9827d1521
commit
adbfa0752a
2 changed files with 3 additions and 19 deletions
|
@ -28,7 +28,6 @@
|
|||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import "../styles-uit" // fixme should end up removeable
|
||||
|
||||
Rectangle {
|
||||
id: pal;
|
||||
|
@ -50,7 +49,6 @@ Rectangle {
|
|||
return -1;
|
||||
}
|
||||
function fromScript(message) {
|
||||
console.log('fixme got message from script', JSON.stringify(message));
|
||||
switch (message.method) {
|
||||
case 'users':
|
||||
var data = message.params;
|
||||
|
@ -58,14 +56,12 @@ Rectangle {
|
|||
myData = data[myIndex];
|
||||
data.splice(myIndex, 1);
|
||||
userData = data;
|
||||
console.log('FIXME', JSON.stringify(myData), myIndex, JSON.stringify(userData));
|
||||
sortModel();
|
||||
break;
|
||||
case 'select':
|
||||
var sessionId = message.params[0];
|
||||
var selected = message.params[1];
|
||||
var userIndex = findSessionIndex(sessionId);
|
||||
console.log('fixme select', sessionId, selected, userIndex);
|
||||
if (selected) {
|
||||
table.selection.clear(); // for now, no multi-select
|
||||
table.selection.select(userIndex);
|
||||
|
@ -84,12 +80,11 @@ Rectangle {
|
|||
var sortProperty = table.getColumn(table.sortIndicatorColumn).role;
|
||||
var before = (table.sortIndicatorOrder === Qt.AscendingOrder) ? -1 : 1;
|
||||
var after = -1 * before;
|
||||
console.log('fixme sort', table.sortIndicatorColumn, sortProperty, before, after);
|
||||
userData.sort(function (a, b) {
|
||||
var aValue = a[sortProperty].toString().toLowerCase(), bValue = b[sortProperty].toString().toLowerCase();
|
||||
switch (true) {
|
||||
case (aValue < bValue): console.log('fixme', aValue, bValue, before); return before;
|
||||
case (aValue > bValue): console.log('fixme', aValue, bValue, after); return after;
|
||||
case (aValue < bValue): return before;
|
||||
case (aValue > bValue): return after;
|
||||
default: return 0;
|
||||
}
|
||||
});
|
||||
|
@ -113,7 +108,6 @@ Rectangle {
|
|||
table.selection.forEach(function (userIndex) {
|
||||
userIds.push(userData[userIndex].sessionId);
|
||||
});
|
||||
console.log('fixme selected ' + JSON.stringify(userIds));
|
||||
pal.sendToScript({method: 'selected', params: userIds});
|
||||
}
|
||||
Connections {
|
||||
|
|
|
@ -142,10 +142,8 @@ function removeOverlays() {
|
|||
|
||||
// Clicks
|
||||
function handleClick(pickRay) {
|
||||
print('fixme handleClick', JSON.stringify(pickRay));
|
||||
ExtendedOverlay.applyPickRay(pickRay, function (overlay) {
|
||||
var message = {method: 'select', params: [overlay.key, !overlay.selected]};
|
||||
print('fixme sending to qml:', JSON.stringify(message));
|
||||
pal.sendToQml(message);
|
||||
return true;
|
||||
});
|
||||
|
@ -160,23 +158,15 @@ function handleMouseEvent(mousePressEvent) { // handleClick if we get one.
|
|||
// But we dont' get mousePressEvents.
|
||||
var triggerMapping = Controller.newMapping(Script.resolvePath('') + '-click');
|
||||
function controllerComputePickRay(hand) {
|
||||
print('fixme controllerComputePickRay', hand);
|
||||
var controllerPose = getControllerWorldLocation(hand, true);
|
||||
print('fixme pose', JSON.stringify(controllerPose), 'valid', controllerPose.valid);
|
||||
if (controllerPose.valid) {
|
||||
print('fixme controllerComputePickRay', hand);
|
||||
var xxfixme = { origin: controllerPose.position, direction: Quat.getUp(controllerPose.orientation) };
|
||||
print('fixme result', JSON.stringify(xxfixme));
|
||||
return xxfixme;
|
||||
return { origin: controllerPose.position, direction: Quat.getUp(controllerPose.orientation) };
|
||||
}
|
||||
print('fixme controllerComputePickRay failed', hand, JSON.stringify(controllerPose));
|
||||
}
|
||||
function makeClickHandler(hand) {
|
||||
return function(clicked) {
|
||||
if (clicked > 0.85) {
|
||||
print('fixme click handler on', clicked, hand);
|
||||
var pickRay = controllerComputePickRay(hand);
|
||||
print('fixme pickRay', JSON.stringify(pickRay));
|
||||
handleClick(pickRay);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue