Re: Supporting more than three sensors in your sensor API?

9 views
Skip to first unread message

Scott Cytacki

unread,
Mar 14, 2013, 10:25:59 PM3/14/13
to Charles Xie, org-concord-sensor
I ask again that you join the org-concord-sensor google group so we can continue the discussion there.
https://groups.google.com/forum/?fromgroups#!forum/org-concord-sensor

There are several things that will need to be fixed inorder to handle this and it will be difficult to keep things backwards compatible.
These difficulties are mostly at the higher level sensor api. At the lower level of just working with the LabQuest API it shouldn't be too hard to get working. 

I would start by forking the sensor-project repo in github.

Then copy this file:
https://github.com/concord-consortium/sensor-projects/blob/master/labquest-jna/src/test/java/org/concord/sensor/labquest/jna/LabQuestJNATest.java
with a new name of something like MultiLabQuestJNATest.java

This test is already listing all of the attached devices. It only opens the first one. So you can try opening all of them and then update the 'test' method to read data from all of the the attached devices. 

I would guess that doing this will not work, so you'll need to fix somethings here:
in the LabQuestImpl and LabQuestLibrary so they correctly handling working with 2 or more devices at the same time.

If you get that working please send a pull request so I can incorporate the changes back in the main repository.

After that you have a couple options:

1. Try to fix the higher level api to handle this
2. Just use the lower level LabQuestLibrary and LabQuest objects directly.

You might be best off going with #2. But this will mean you'll need to update you code if you later want to work with other Vernier or Pasco devices.



On Thu, Mar 14, 2013 at 4:23 PM, Charles Xie <qx...@concord.org> wrote:
Hi Scott:

LoggerLite supports more than one MiniQuest interfaces, meaning that you can plug in any number of sensors you want. But your wonderful Java API seems to support only one MiniQuest. I am wondering if it would be easy to expand the support. I know you are busy and probably won't have any time. But perhaps with a meeting with you to point fingers to where I should look at I can help adding this support.

And often this could turn out to be just a few more lines of code...


Let me know.

Charles



--
Scott Cytacki
The Concord Consortium

Charles Xie

unread,
Mar 17, 2013, 2:00:10 PM3/17/13
to org-conco...@googlegroups.com, Charles Xie
I think I got it to work. It turned out to be pretty simple, just as I hoped. Thanks for the tip.
Reply all
Reply to author
Forward
0 new messages