Multiple LabQuest Mini modules support

6 views
Skip to first unread message

Charles Xie

unread,
Mar 22, 2013, 12:36:44 PM3/22/13
to org-conco...@googlegroups.com
Hi Scott:

Thanks to your tips, this now works beautifully! We can now use as many sensors as we want in our mixed reality apps.


Thanks,
Charles

Charles Xie

unread,
Mar 22, 2013, 9:38:02 PM3/22/13
to org-conco...@googlegroups.com
I think the easiest thing for me to do now is to commit only two minor additions to LabQuestLibrary.java and a new test. Since these changes are not substantial, I don't think we need to do a fork to get them into the main source. If I do end up having to do more, I will do it through a fork. But for now, a simple commit may be sufficient to make this capacity available.

What do you think, Scott?

Or you can just add the following two methods to LabQuestLibrary.java:

public String getDeviceName(int n) throws LabQuestException {
searchForDevices();
String ret  = getDeviceName(NGIOLibrary.DEVTYPE_LABQUEST_MINI, n);
if(ret != null) {
return ret;
}
return ret;
}

private String getDeviceName(int deviceType, int n) throws LabQuestException {
IntByReference listSig = new IntByReference();
IntByReference numDevices = new IntByReference();
int ret;
Pointer openDeviceListSnapshotHandle = 
ngio.openDeviceListSnapshot(hLibrary, deviceType, 
numDevices, listSig);
int num = numDevices.getValue();
if(num <= 0){
closeDeviceListSnapshot(openDeviceListSnapshotHandle);
return null;
}
byte [] devNameBuf = new byte[NGIOLibrary.MAX_SIZE_DEVICE_NAME];
IntByReference deviceStatusMask = new IntByReference();
ret = ngio.deviceListSnapshot_GetNthEntry(openDeviceListSnapshotHandle, n, 
devNameBuf, devNameBuf.length, deviceStatusMask);
if(ret != 0){
throw new LabQuestException();
}
closeDeviceListSnapshot(openDeviceListSnapshotHandle);

return Native.toString(devNameBuf);
}

Scott Cytacki

unread,
Mar 23, 2013, 8:05:55 AM3/23/13
to org-concord-sensor
Developers using github will fork a repo for a single line change, so I think your changes are definitely worth a fork. 
It really isn't hard.

Go to this page:

For your purposes I recommend creating a new local directory of your fork by following Steps 1 and 2
And push your changes into your fork.

Then send the sensor-projects a pull request:
That page is a bit long, all you really need to do is click the "pull request" button.

In the future, I can show you how you can create a fork and push your changes to it without having to make a new local directory and copy changes into it.



--
--
You received this message because you are subscribed to the Google
Groups "org-concord-sensor" group.
To post to this group, send email to org-conco...@googlegroups.com
To unsubscribe from this group, send email to
org-concord-sen...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/org-concord-sensor?hl=en?hl=en
Google Code project for org-concord-sensor: http://code.google.com/p/org-concord-sensor/
---
You received this message because you are subscribed to the Google Groups "org-concord-sensor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to org-concord-sen...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Scott Cytacki
The Concord Consortium

Reply all
Reply to author
Forward
0 new messages