Go Down

Topic: [Guide] Fix Arduino IDE slowdown in Windows & replace the ugly Win7 taskbar icon (Read 5000 times) previous topic - next topic

eried

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/
My website: http://ried.cl

mmcp42

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 :)
there are only 10 types of people
them that understands binary
and them that doesn't


eried

My website: http://ried.cl

boekie

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

mellis

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.  :)

eried

Nice, attaching and opening issue right now.

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

Code: [Select]
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).
My website: http://ried.cl

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:

[font=Verdana] static JMenu serialMenu;
  static int expectedPortCount = 5; // serial port search progress bar

  static SerialMenuListener serialMenuListener;
[/font]


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

[font=Verdana]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);
  }
[/font]


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

ޭ

Hi !

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

Thanks a lot eried !

Eric

Go Up