1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00
Go to file
Matthijs Kooijman ca573351bb Do not store file contents in SketchCode
Now that each file in the sketch has its own text area in the GUI, it is
no longer needed to store the (possibly modified) contents of each file
inside SketchCode. Keeping the contents in the text area is sufficient.
Doing so allows removing the code that dealt with copying contents from
the text area into the SketchCode instance at the right time, which was
fragile and messy.

However, when compiling a sketch, the current (modified) file contents
still should be used. To allow this, the TextStorage interface is
introduced. This is a simple interface implemented by EditorTab, that
allows the SketchCode class to query the GUI for the current contents.
By using an interface, there is no direct dependency on the GUI code. If
no TextStorage instance is attached to a SketchCode, it will just assume
that the contents are always unmodified and the contents from the file
will be used during compilation.

When not using the GUI (e.g. just compiling something from the
commandline), there is no need to load the file contents from disk at
all, the filenames just have to be passed to arduino-builder and the
compiler. So, the SketchCode constructor no longer calls its `load()`
function, leaving this to the GUI code to call when appropriate. This
also modifies the `SketchCode.load()` function to return the loaded
text, instead of storing it internally.

To still support adding new files to a sketch (whose file does not
exist on disk yet), the EditorTab constructor now allows an initial
contents to be passed in, to be used instead of loading from disk. Only
the empty string is passed for new files now, but this could also be
used for the bare minimum contents of a new sketch later (which is now
down by creating a .ino file in a temporary directory).

Another side effect of this change is that all changes to the contents
now happen through the text area, which keeps track of modifications
already. This allows removing all manual calls to `Sketch.setModified()`
(even more, the entire function is removed, making `Sketch.isModified()`
always check the modification status of the contained files).
2016-08-26 16:42:44 +02:00
.settings Update eclipse java-formatter settings 2015-03-27 14:51:11 +01:00
app Do not store file contents in SketchCode 2016-08-26 16:42:44 +02:00
arduino-core Do not store file contents in SketchCode 2016-08-26 16:42:44 +02:00
build Merge branch 'patch-1' of https://github.com/dagwieers/Arduino-1 2016-08-22 14:46:10 +02:00
hardware Update SoftwareSerialExample.ino 2016-08-14 19:14:53 -04:00
libraries Stepper: update version to 1.1.3 2016-03-08 15:37:18 +01:00
.classpath Installing tools from packager (eg: arduino) in packager folder, thus avoiding 2015-11-20 17:15:53 +01:00
.gitignore Update avr-gcc to 4.9.2 and avrdude to 6.3 2016-07-25 12:34:57 +02:00
.project Fix eclipse project files 2012-01-11 14:18:48 +01:00
examples_formatter.conf Serial plotter: added comment to AnalogReadSerial. Fixes #3451 2015-07-06 15:27:07 +02:00
format.every.sketch.sh Examples: mass code format. See example_formatter.conf 2015-07-06 15:19:05 +02:00
lib_sync Added lib_sync, utility script 2015-04-23 17:46:20 +02:00
license.txt adding LGPL (a bit late, whoops). 2007-10-12 01:58:48 +00:00
README.md Fix typo in readme 2016-03-02 17:54:54 +01:00

Arduino

Installation

Detailed instructions are in reference/Guide_Windows.html and reference/Guide_MacOSX.html. For Linux, see the Arduino playground: http://www.arduino.cc/playground/Learning/Linux

Credits

Arduino is an open source project, supported by many.

The Arduino team is composed of Massimo Banzi, David Cuartielles, Tom Igoe and David A. Mellis.

Arduino uses GNU avr-gcc toolchain, GCC ARM Embedded toolchain, avr-libc, avrdude, bossac, openOCD and code from Processing and Wiring.

Icon and about image designed by ToDo