Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   SmartDashboard Window size not saving (http://www.chiefdelphi.com/forums/showthread.php?t=105856)

kobitate94 21-04-2012 11:58

SmartDashboard Window size not saving
 
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

Re: SmartDashboard Window size not saving
 
Quote:

Originally Posted by kobitate94 (Post 1160862)
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

Re: SmartDashboard Window size not saving
 
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

Re: SmartDashboard Window size not saving
 
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

Re: SmartDashboard Window size not saving
 
Sorry about the annoyance, we'll try to fix it for 2013.

Brad

Djur 03-05-2012 22:27

Re: SmartDashboard Window size not saving
 
The problem seems to be at DashboardFrame.java at line 119:
Code:

// 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_CLOSE);

            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
Code:

setPreferredSize(NETBOOK_SIZE);
to
Code:

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

Sunstroke 04-05-2012 02:36

Re: SmartDashboard Window size not saving
 
Quote:

Originally Posted by Djur (Post 1166754)
The easiest (temporary) fix until the 2013 release would be to change
Code:

setPreferredSize(NETBOOK_SIZE);
to

Code:

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

A better stopgap would be:
Code:

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


All times are GMT -5. The time now is 00:52.

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