![]() |
Driverstation / Dashboard in JAVA
We cannot seem to get the Dashboard to work in Java. It works in LabView but when we build or open the Driverstation - everything is 0 and never changes. We tested the hardware on another cRIO imaged for LabView and everything works there (Analog In, Digital In / Out, Solenoid interface).
We tried the DashboardDemo and it gives a compile error about the solenoid class. The new Dashboard GUI will not even load. It is as if the cRIO is hexed against JAVA. We used JAVA last year without incident but this year the libraries just do not seem to work. The display shows all green lights but no sensor data is displayed. |
Re: Driverstation / Dashboard in JAVA
What I ended up doing was grabbing the updateDashboard method from the Dashboard Example, and copying and pasting it into a new class. I then spun off a thread of that class to keep the dashboard constantly updated.
Code:
Dstation station;Code:
package edu.wpi.first.wpilibj.templates;Code:
station.sendToLCD("This is a message"); |
Re: Driverstation / Dashboard in JAVA
Thank you. What you show makes sense. I note that you import each sensor class separately. Is that intentional or just happenstance?
I agree with your peeve on the demo code. There was a post on the main page about test codes being posted without comments but a demo program without comments is really annoying. I once worked with a mathematician who said he did not put comments in his code because any GOOD programmer should be able to read the code & understand the algorithm. Danny |
Re: Driverstation / Dashboard in JAVA
The line "lowDashData.addByte(Solenoid.getAll()); // solenoid cluster" will not compile in version 2011.4. The getAll() method is no longer static. I'm really disappointed FIRST released code that breaks the example.
|
Re: Driverstation / Dashboard in JAVA
Quote:
Quote:
I imported each sensor class separately as a teaching tool. I don't want my students to get in the habit of using wild cards and just importing everything. That's fine if you are slapping together something quickly, but I don't think it's a good practice for production level code. Also, I wasn't sure how wild cards would impact memory, so I opted for what I thought would be the lower memory model. If I'm mistaken there please correct me, as wild cards would definitely keep me from messing up because I forgot to import something. |
Re: Driverstation / Dashboard in JAVA
Quote:
You must have 2011.3. Don't install the plugin update to 2011.4, or that line of code will break. I've looked at multiple systems. |
Re: Driverstation / Dashboard in JAVA
Quote:
As for the curt answer, I was going back to check and see if I could reproduce your problem, which I cannot. I have no errors and no warnings on that line, or any other line in that class. I deployed this to my test bot last night and it worked fine. |
Re: Driverstation / Dashboard in JAVA
Updated the DStation class above with a cleaned up, and hopefully better commented copy. I still need to flesh out exactly what the updateDashboard method is doing, but I think I've got a handle on it now, including how to extend it. Maybe :yikes:
|
Re: Driverstation / Dashboard in JAVA
Confirmed. I just finished running my test rig up and down the school hall (noon CST), and the DStation code performed as expected. Sorry frasnow, I'm not sure why it's not working for you, but no problems here.
|
Re: Driverstation / Dashboard in JAVA
I just started making my own Dashboard in Java and am skipping the protocol they designed entirely (and having the cRIO send stuff with SocketConnection). To be honest, the current system is too much of a pain to consider using.
|
Re: Driverstation / Dashboard in JAVA
Quote:
Today I tried this: 1. Uninstalled all the FRC plugins from Netbeans. 2. Installed what is called version 4.8 on FIRST forge (version 2011.3). With this configuration Solenoid.getAll() is fine and is even declared Static as it should be. 3. Uninstalled version 4.8 from FIRST forge and downloaded & installed version 4.9 (version 2011.4). I get the Solenoid.getAll() is non-static error. Looking in the code, it is indeed not declared as static. All my other systems are using the automatic updates. I just can't understand how your 2011.4 is different from the one on all my systems. It's not an OS problem; I've used Windows 7, Windows XP, Mac OSX, and Linux. It's not a Netbeans version problem; I've tried 6.7, 6.8 and 6.9.1. |
Re: Driverstation / Dashboard in JAVA
Quote:
You could try replacing the solenoid line with: Code:
byte thisBytes = 0; |
Re: Driverstation / Dashboard in JAVA
I've just checked using Eclipse, and the error you have is showing up there. I have no idea why it works when I use Netbeans. I may have to actually hunt down where the libraries are stored on my disk and physically delete them, then re-update.
|
Re: Driverstation / Dashboard in JAVA
Quote:
I'm having my students try the 0 byte thing tonight, since I won't be there to mentor them. Have you already confirmed it works? My other idea is to waste one of the solenoid connections in order to get an instance variable to call the non-static getAll(), which should allow it to display the state of the solenoids. |
Re: Driverstation / Dashboard in JAVA
Quote:
|
| All times are GMT -5. The time now is 12:59. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi