Go to Post Iteration is a necessary but not sufficient criteria to being a powerhouse team. - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-11-2011, 21:48
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Question Dummy WPILibJ: "parsing" package?

Hey guys, I've been working on a handy little software testing tool that lets you test code (at least to a certain extent) without having to download to the robot. My method for this involves creating a sort of dummy version for WPILibJ with an added Swing application that lets you modify different inputs, such as joystick axis positions and sensor values, and observe the output values, primarily motor speeds and servo positions. It will hopefully help tremendously with initial code testing, although tweaking in order to get it to work correctly with the hardware will still be necessary.

So onto my (sorta) problem. I've been trying to really understand some of the connections between the different parts of WPILibJ, and most are pretty logical. However, there is one part which has so far escaped my grasp: the parsing package. All it contains is a group of 6 blank interfaces, which are implemented by a number of classes within the library. So my question is: what are they for? Are they used by the VM for some purpose, or are they just a simple way to classify different parts of the library? I ask because if there's something special done by the VM, I want to make sure I account for it in my dummy library.
Reply With Quote
  #2   Spotlight this post!  
Unread 27-11-2011, 14:49
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Dummy WPILibJ: "parsing" package?

I've never programmed in Java before, but I think it may be so that each one of the inherited has the same interface (so you don't have to call CANJaguar.Set() and Jagur.Write()) and so that another class, like a PID class, can have one interface. For example, I believe that anything that could be an input for PID is in the PIDSource class, so the PID controller can just call on the common interface.
Reply With Quote
  #3   Spotlight this post!  
Unread 27-11-2011, 16:00
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Dummy WPILibJ: "parsing" package?

That's what interfaces are for, but the interfaces in this case have no methods at all, and don't seem to be used for anything, which is confusing me. There are interfaces (PIDSource, PIDOutput, SpeedController, etc.) which are all used like a normal interface. Only the interfaces in the parsing package don't seem to have a use.
Reply With Quote
  #4   Spotlight this post!  
Unread 29-11-2011, 18:32
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Dummy WPILibJ: "parsing" package?

Quote:
Originally Posted by Ginto8 View Post
That's what interfaces are for, but the interfaces in this case have no methods at all, and don't seem to be used for anything, which is confusing me. There are interfaces (PIDSource, PIDOutput, SpeedController, etc.) which are all used like a normal interface. Only the interfaces in the parsing package don't seem to have a use.
Those interfaces are only used by Eclipse to identify categories of classes. They aren't actually used for anything other than the IDE.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2012, 19:12
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: Dummy WPILibJ: "parsing" package?

jhersh is correct - usually, something like that would be done in Java via annotations, however the current Java being used for FRC does not support them. An interface was the least overhead solution we came up with during development. If you are just creating a dummy set of stuff, you can safely ignore the interfaces unless you plan to use the advanced plug-ins that were out for Java. Given that they have no methods, you could also just use these interfaces directly - even if methods are implemented later, you could add "dummy" implementations/calls for those methods later on.

Good luck with your project!
__________________
CRUD Name: Windows
Rookie Year: 2005
Alumni to Team: 350
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:49.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi