Log in

View Full Version : SmartDashboard Window size not saving


kobitate94
21-04-2012, 11:58
Hey everybody!

We recently switched Driver Station computers due to the fact that our old classmate kept causing SmartDashboard to crash. We are now using a plastic MacBook running Windows 7 through BootCamp.

The SmartDashboard launches fine, but the window size is too small on launch (1024x400 to be exact). We are able to change the window size just fine through File > Preferences but, when we reopen the dashboard, the window size resets to 1024x400. We know that the layout was saved because we added a second camera feed when we set up the new Driver Station, and it was still showing when we relaunched.

How can we fix this? Thanks in advance!

Sunstroke
21-04-2012, 15:02
Hey everybody!

We recently switched Driver Station computers due to the fact that our old classmate kept causing SmartDashboard to crash. We are now using a plastic MacBook running Windows 7 through BootCamp.

The SmartDashboard launches fine, but the window size is too small on launch (1024x400 to be exact). We are able to change the window size just fine through File > Preferences but, when we reopen the dashboard, the window size resets to 1024x400. We know that the layout was saved because we added a second camera feed when we set up the new Driver Station, and it was still showing when we relaunched.

How can we fix this? Thanks in advance!

There's currently no fix for that when you are running in "competition" mode (which means you don't see the frame around the window).

One option is to not run it in competition mode. To do that, go to Program Files\FRCDashboard\launcher.bat and remove the word competition (or "-competition", I don't remember if there is a hyphen).

agartner01
21-04-2012, 15:26
When your in "competition" mode, the size of the window is hard coded into the program. However, it's quite easy to change, all you have to do is change one line in the source (which is downloadable from firstforge.wpi.edu). I have successfully changed our dashboard to display at 1366x500. If you need any help, or just want me to compile you one with your resolution hard coded, PM me.

kobitate94
23-04-2012, 19:38
Thanks for the help guys! I've passed this on to our lead programmer. Good luck for those going to worlds!

BradAMiller
03-05-2012, 14:40
Sorry about the annoyance, we'll try to fix it for 2013.

Brad

Djur
03-05-2012, 22:27
The problem seems to be at DashboardFrame.java at line 119:

// Set the size / look
if (competition) {
setPreferredSize(NETBOOK_SIZE); //1024x400 - this is your problem
setUndecorated(true);
setLocation(0, 0);
setResizable(false);
} else {
setMinimumSize(MINIMUM_SIZE); //300x200

// Closing operation is handled manually
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOS E);

DashboardPrefs prefs = DashboardPrefs.getInstance();
setPreferredSize(new Dimension(prefs.width.getValue(), prefs.height.getValue())); //This is the dimension stored in the save file
setLocation(prefs.x.getValue(), prefs.y.getValue());
}


So the DashboardFrame will automatically be set to 1024x800 if you're in competition mode. The easiest (temporary) fix until the 2013 release would be to change setPreferredSize(NETBOOK_SIZE); to setPreferredSize(new Dimension(width, height)); with (width, height) being based upon the size of your screen.

Sunstroke
04-05-2012, 02:36
The easiest (temporary) fix until the 2013 release would be to change setPreferredSize(NETBOOK_SIZE); to

setPreferredSize(new Dimension(width, height)); with (width, height) being based upon the size of your screen.

A better stopgap would be:
setPreferredSize(new Dimension(prefs.width.getValue(), prefs.height.getValue()));
because that will now save your screen size, and use the saved screen size.