Pages: [1]   Go Down
Author Topic: [Guide] Fix Arduino IDE slowdown in Windows & replace the ugly Win7 taskbar icon  (Read 4582 times)
0 Members and 2 Guests are viewing this topic.
Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem:
-Arduino IDE takes too long to start
-Arduino IDE takes too much to open the "Tools" menu

Solution:
http://servicios.ried.cl/arduino/temp/rxtxSerial-2.2_fixed_2009-03-17.rar (replace the dll file)

How it works?:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1237179908
http://erwin.ried.cl/?modo=visor&elemento=265
______________________________________________________________

Problem:
-Arduino IDE icon looks ugly (16x16 image upscaled to the taskbar size icon) in Windows 7

Solution:
http://servicios.ried.cl/arduino/temp/windows7_arduino-0022_fix.rar (Instructions inside)

How it works?:
Nullifing the SetIcon function inside Base.class (pde.jar), then replacing some resources in the java binaries to let Windows 7 handle the icon the correct way, take a peek to the final result:
http://content.screencast.com/users/eried/folders/Jing/media/aa2a12cd-09ec-417d-a6c3-1a081747da22/2011-02-03_1525.png
______________________________________________________________

Enjoy,
More stuff: http://servicios.ried.cl/
Logged

My website: http://ried.cl

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

excellent
does seem to be faster :clap hands:

now if only you could make the little red x ALT-F4 do the same as CTRL-Q (remember file and window size) everything would be wonderful smiley
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are we supposed to drop the first fix in the main directory?
Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just replace the original file, it should have the same name.
Logged

My website: http://ried.cl

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This works great! I used it on vista home premium and arduino0022.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

eried: can you attach a patch for the changes you made to RXTX to the issue you opened for this (http://code.google.com/p/arduino/issues/detail?id=200)?  If I get a chance, I'll try to include RXTX in the Arduino repository and apply this fix to the source code there and the DLL we ship.

Similarly, can you open an issue with patch for the icon fix?  The current approach is a bit of a hack.  smiley
Logged

Chile
Offline Offline
Edison Member
*
Karma: 35
Posts: 1251
Arduino rocks?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice, attaching and opening issue right now.

The problem with the icon I think is just the resource size (ICON_IMAGE):

Code:
public static void setIcon(Frame frame)
{
    Image image = Toolkit.getDefaultToolkit().createImage(PApplet.ICON_IMAGE);
    frame.setIconImage(image);
}

But I haven't fixed the java code (as you said I just 'hacked' the class/jar bytecode).
Logged

My website: http://ried.cl

Oregon
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know this slowdown has supposedly been fixed by fixing the underlying RXTX library.  But, I recently had the Tools menu hang on Linux (Ubuntu 11.10/ Arduino 0021 or 0022, I think).  So I got the Arduino GUI code and made my own workaround.  Then, the slowdown disappeared on me.  But I feel the following is a still a good addition to the Arduino GUI code and I don't know the proper way to submit it, so I'm posting it here.  I changed the Editor.java file as follows:

I added the static member variable processing.app.Editor.expectedPortCount around line 100:

  static JMenu serialMenu;
  static int expectedPortCount = 5; // serial port search progress bar

  static SerialMenuListener serialMenuListener;


I added a ProgressMonitor to processing.app.Editor.populateSerialMenu() which starts around line 959:

 protected void populateSerialMenu() {
    // getting list of ports

    JMenuItem rbMenuItem;

    //System.out.println("Clearing serial port menu.");
   
    serialMenu.removeAll();
    boolean empty = true;

    try
    {
      ProgressMonitor progressMonitor = new ProgressMonitor(this,
        "Searching for serial ports", "", 0, 100);
      int portCount = 0;
      int serialPortCount = 0;

      for (Enumeration enumeration = CommPortIdentifier.getPortIdentifiers();
        enumeration.hasMoreElements() && !progressMonitor.isCanceled();)
      {
        CommPortIdentifier commportidentifier = (CommPortIdentifier)enumeration.nextElement();
        ++portCount;
        //System.out.println("Found communication port: " + commportidentifier);
        if (commportidentifier.getPortType() == CommPortIdentifier.PORT_SERIAL)
        {
          ++serialPortCount;
          //System.out.println("Adding port to serial port menu: " + commportidentifier);
          String curr_port = commportidentifier.getName();
          rbMenuItem = new JCheckBoxMenuItem(curr_port, curr_port.equals(Preferences.get("serial.port")));
          rbMenuItem.addActionListener(serialMenuListener);
          //serialGroup.add(rbMenuItem);
          serialMenu.add(rbMenuItem);
          empty = false;
        }
        progressMonitor.setNote(String.format("Found: %d total comm ports   %d serial ports\n",
          portCount, serialPortCount));
        progressMonitor.setProgress(Math.max(1,Math.min(99,
          (100*portCount)/Math.max(expectedPortCount,portCount+1))));

      }
      if (!empty) {
        //System.out.println("enabling the serialMenu");
        serialMenu.setEnabled(true);
      }
      expectedPortCount = (portCount > 0) ? portCount : 5;
      progressMonitor.close();

    }

    catch (Exception exception)
    {
      System.out.println(_("error retrieving port list"));
      exception.printStackTrace();
    }
   
    if (serialMenu.getItemCount() == 0) {
      serialMenu.setEnabled(false);
    }

    //serialMenu.addSeparator();
    //serialMenu.add(item);
  }


The ProgressMonitor dialog box only opens if there is a 500 ms delay or more.
Logged

French Polynesia
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi !

rxtxSerial.dll replacement still a working fix with Arduino 023.

Thanks a lot eried !

Eric
Logged

Pages: [1]   Go Up
Jump to: