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