Arduino IDE extensions/plugins

manicksan

Well-known member
Hi,
I have developed some "extensions" to the Arduino IDE

original post
https://forum.arduino.cc/index.php?topic=706855.15

Here is the list of all "extensions" I have developed so far:

1. https://github.com/manicken/arduinoAPIwebserver
this is developed mostly for my extended edition of
"Audio System Design Tool for Teensy Audio Library"
@ https://github.com/manicken/manicken.github.io (have readme)
webpage is @ https://manicken.github.io/

features:
* WebServer for POST(ing) the JSON
which contains the exported Files,
it uses the GET request to execute
the Verify and Upload functions.

* WebSocketServer for Arduino Terminal Capture
used for send the terminal output from Arduino IDE
back to the webpage.

* WebSocketServer used to send data to/from the GUI - items
currently only used to send/receive midi commands,
but standard serial port is planned.

here is the thread describing the extended tool (same content as the readme):
https://forum.pjrc.com/threads/65740-Audio-System-Design-Tool-update


2. https://github.com/manicken/arduinoPrefsSaver
makes it possible to have individual board settings for each "sketch".


3. https://github.com/manicken/arduinoIDEpluginTemplate
just a "extension" template.

4. https://github.com/manicken/arduinoIDEsketchBuildPath
make the build output the files to a build subfolder in the sketch
this ensures that there is no need to do a full compile every time the
sketch is reopened,
(this is a time saver on very big projects that take a lot time to compile)


5. https://github.com/manicken/arduinoUploadOnly
changes the behavior of the upload button so that it only
executes the upload function,
(this is a time saver when uploading to targets that often fail at the upload)

6. https://github.com/manicken/arduinoExtendedPrint
makes it possible to print the sketch in color/(black & white)
with or without line numbers.
A print preview is shown (where enabling/disabling color print,
and if line numbers should be shown)
There is two print options, the Alt one can be used on mac when print to PDF is used,
the downside with the Alt version is that paper orientation is current locked to Landscape,
setting will be available in future version.

7. https://github.com/manicken/arduinoAutoComplete
this autocomplete extension
is using
https://github.com/bobbylight/AutoComplete
because it's also the creator of RSyntaxTextArea
which is used by the Arduino IDE text editor

In this stage it can only be activated by ctrl+space
and contains no Arduino Keywords (only default C/C++ syntax)
I'm planning to do a automatic keyword generator that is gonna do a search in the embedded documentation.

/Jannik
 
Hi,

1) I tried your prefsaver. It is not possible to open more than one "Sketch" anymore? Is that intended?
2) Your tools may be very useful for some of us! This post will be hard to find in a few weeks. Can you add a page to the wiki?
 
I got a cryptic message:
Code:
RenameFile first file dont
@Activate codsn not rname
What does that mean? I've installed the buildpath utility now.
 
...it does not save all preferences..
View attachment 23204
I've added some items to the menu, via boards.local.txt (and use platform.local.txt, too)
These are not saved?

Edit: now it works. Hm.. not sure why it did not work before..
 
Hi,
Sorry for the long wait

answers to questions at post #3:

1. This can be selected in the settings @ Extensions-"Manicken Pref Saver"-Settings-"Close Other Editors"
the intension to close other editors is that the Board Selection and Settings is shared between all open editors.

2. which wiki do you mean?

the cryptic message happens when a sketch first is "initialized"
and I did write it in a hurry that is why its misspelled.

"...it does not save all preferences.."
see the source code at the line that say: "here is the filter of which items to save"
it's saving all items added in the boards.txt files as they are converted into the lines starting with
custom_

see the source code: (have now changed the messages into something more readable)
Code:
private void Activate()
{
    if (!RenameFile(prefsFileNameInactive, prefsFileName)) 
        System.out.println("@reActivate fail (this allways happens when the extension is first activated on a new sketch)"); 
        // was System.out.println("@Activate codsn not rname");        

    PreferencesMap pm = PreferencesData.getMap();
    String[] keys = pm.keySet().toArray(new String[0]);
    Arrays.sort(keys);
    StringBuilder sb = new StringBuilder();
    for (String key : keys) {  // **************** here is the filter of which items to save
        if (key.startsWith("serial.") || 
            key.startsWith("target_") ||
            key.startsWith("custom_") ||
            key.equals("board"))
            sb.append(key + "=" + pm.get(key) + "\r\n");
    }
    saveFile(prefsFileName, sb.toString());
}

private void Deactivate()
{
    if (!RenameFile(prefsFileName, prefsFileNameInactive))
        System.out.println("@Deactivate Fail"); // was System.out.println("@Activate codsn not rname");
}

public boolean RenameFile(String fromName, String toName)
{
    // File (or directory) with old name
    File file = new File(sketch.getFolder() + "/" + fromName);

    if (!file.exists()) {
        /*System.out.println("RenameFile first file dont");*/
        return false;
    }
    // File (or directory) with new name
    File file2 = new File(sketch.getFolder() + "/" + toName);

    if (file2.exists()) { 
        System.out.println("@RenameFile - toName: " + toName + " allready exist"); // was System.out.println("RenameFile second file exist");
        return false;
    }
    // Rename file (or directory)
    return file.renameTo(file2);
}

right now it uses the internal structure of the Arduino IDE
that is very slow, I plan to make it faster in the future.

Actually the only thing that the "extension" needs to do is to change the PreferencesData

but then the menu don't update, and the structure of the menu is tightly coupled together

so the easy variant is to rebuild the whole menu, and that takes some time.

it's the same when switching between Boards.

its really funny because they virtually press all the board setting menu items when loading the settings.

/Jannik
 
and by the way i'm planning a

"Extension"-manager-"extension" like they have in the Processing platform:
ProcessingContributionManager.png

Not that advanced in the beginning
but something that can easily handle all future "extensions" and making installation and updates much easier.
it will use github straight off

Thinking of creating a special repository that contains a json that points to other "extension"-repositories.
And also make it possible for others to create their own repositories and then add links to them in the "manager"
like they have in the Arduino IDE "Additional Boards Manager URLs:"
 
Back
Top