Go to Post I'm absolutely certain that kids prefer scoring points to not scoring points - AdamHeard [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 21-02-2011, 09:51
wdell wdell is offline
Registered User
AKA: William Dell
FRC #3999 (Shadetree Mechanics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Killeen, Texas
Posts: 55
wdell has a spectacular aura aboutwdell has a spectacular aura about
Re: Dashboard Tutorial fro Java Pls :)

Quote:
Originally Posted by Patrickwhite View Post
There is no documentation provided (as far as I am aware) and the example code is brutal.
Documentation of the example code can be found here. Also, there is a document available by Joe Ross that explains how to modify it in Labview. I couldn't get things to work exactly as described in the doc, but close enough I could figure out how the code works and where to add things, both in the Labview code and in the java code.

I started using SmartDashboard last night though, and it's much easier. Only problem there is getting the driver station to launch it automatically. Someone posted a "fix" that would do this, but it doesn't seem to work for me.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-02-2011, 14:16
robotic321's Avatar
robotic321 robotic321 is offline
Registered User
FRC #1793
 
Join Date: Jan 2010
Location: Norfolk, VA
Posts: 24
robotic321 is an unknown quantity at this point
Re: Dashboard Tutorial fro Java Pls :)

@ 2 above : I do have LabVIEW experience, as last year for breakaway i did the programming all in LabVIEW, but i never messed with the dashboard. @above, thx for documentation.
__________________
=-=-=-=-=-=-=-=-=-=-=-=-=-=


1793 FTW
=-=-=-=-=-=-=-=-=-=-=-=-=-=
Reply With Quote
  #3   Spotlight this post!  
Unread 23-02-2011, 08:16
java4first java4first is offline
(Java) Programming Mentor
AKA: Stu
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 2011
Location: Goffstown, NH
Posts: 56
java4first is an unknown quantity at this point
Re: Dashboard Tutorial fro Java Pls :)

A further note on this, and a question on LabView programming ...

(1) If you use any of the default Dashboard (namely the display of the digitial stuff from the sidecars) - it turns out that the WPI code returns the DIO data in FPGA order, not laptop display order. So you end up displaying 2 bits (14 & 15) that mean nothing, don't display 2 bits (0 & 1) and everything else is in reverse order. Since I'm not a LabView programmer, I put the code in Java on the robot to reverse the bits in this set of calls (after I get the data and before I add it):

lowDashData.addShort(DigitalModule.getInstance(mod ule).getAllDIO());
lowDashData.addShort(DigitalModule.getInstance(mod ule).getDIODirection());

(2) Now my question ... we are using two digitial sidecars this year, and although the code appears to get the data (from module 4 and module 6), the default(?) display only displays module 4. We were able to get all our custom data wired into the display, but haven't been able to figure out yet how to create a copy of the module 4 display and wire it to the second set of data in the cluster / array. Our team has zero experience with LabView (other than what we've managed to do in the last six weeks). I can see the building blocks in the wiring diagram, and more or less understand what it's doing (to convert the cluster to the array, and then extract the data with an index selector). But if someone could point me to an example or give a hint on how to wire / extract the second module, and get it displayed with the same UI stuff in the dashaboard, I'd appreciate it.

Thanks!
Reply With Quote
  #4   Spotlight this post!  
Unread 23-02-2011, 22:31
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Dashboard Tutorial fro Java Pls :)

There are two parts to this. One, update the Java robot code to read and update the values for the second digital slot. I don't have access to the Java code, so I can't help much with this part.

The second part is to update the code for the custom dashboard. If you haven't done it yet, create a dashboard project from the Getting Started window. Open the Dashboard Main VI. Duplicate the group of displays for slot 4 and make one for six. You can do this by ctl-clicking and dragging a copy to the right, or you can copy/paste. You may also want to grow the window and move around the solenoids, communications, and other stuff. All of the controls are grouped to make them be a bit easier to rearrange.

If you double click on the test that says slot four, it should be selected and you can rename it. If you double click on the PWMs, LV will take you to the diagram and hilite the terminal that needs to have data wired. Notice that the original PWM is wired to the outputs of a VI called Parse Digital Module. There is a second VI just beneath, and you only need to drag the four terminals into the same structure and wire them to the Parse outputs. Hopefully that is enough info.

If you decide to duplicate only some of the digital displays, I'd start as above, then ungroup and delete what you aren't using. Click on the new Slot 6 displays, click on the Reorder toolbar button -- second from the right, looks like circular arrows, and choose ungroup. You can how click around and delete items you don't want to wire up anyway. Note that the clusters, arrays, and other display containers are painted transparent, which means they are a bit hard to see where to click. You may find it easier to start from the diagram terminal of the control you want to delete, double click, and LV will flip to the panel and select the item. If you simply want to delete it, you can most likely delete it from the diagram as well -- depends on ini settings.
There is no need to regroup the controls if you don't want. Grouping has no impact on the form of the data. If you do something that seems odd, Undo is your friend.

Feel free to ask other questions.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 26-02-2011, 11:52
java4first java4first is offline
(Java) Programming Mentor
AKA: Stu
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 2011
Location: Goffstown, NH
Posts: 56
java4first is an unknown quantity at this point
Re: Dashboard Tutorial fro Java Pls :)

Greg -

This worked perfectly (just as you described it). Thank you so much for your help!

Stu
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 10:58.

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