Skip to content

Commit

Permalink
Merge branch 'release-2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcorbett committed May 31, 2017
2 parents b423d48 + 5f4294e commit 085f09d
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 7 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changelog

========== Version 2.0.2 ==========

Patches and Bug Fixes:
- Fix taweili#159 and arduino/Arduino#5454

========== Version 2.0.1 ==========

Patches and Bug Fixes:
Expand Down
4 changes: 2 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ ArduBlock is a Block Programming Language for Arduino. The language and function
Ardublock is a free graphical programming environment to make programming physical computing with Arduino as easy as drag and drop. It is based on the popular ‘scratch’ programming language, which many will already be familiar with. Ardublock generates code in C, a text based language used by the Arduino IDE, which can then be studied and modified if desired.

Ardublock is an extension to the Arduino IDE so that will need to be downloaded as well (found here https://www.arduino.cc/en/Main/Software).
* Ardublock has been tested with version 1.0.5-r2, available here: http://arduino.googlecode.com/files/arduino-1.0.5-r2-windows.exe
* Ardublock is tested with version 1.8.2, available here: https://www.arduino.cc/download_handler.php?f=/arduino-1.8.2-windows.exe

Code written in Ardublock has the file extension .abp.

####Getting Started with ArduBlock
1. Install the Arduino IDE, from https://www.arduino.cc/en/Main/Software
2. Download ardublock-all.jar from https://github.com/gregcorbett/ardublock/releases/latest
2. Download ardublock-all.jar https://github.com/stfc/ardublock/releases/latest
3. Copy ardublock-all.jar to C:/Users/<username>/Arduino/tools/ArduBlockTool/tool/ardublock-all.jar under
* Be careful, the name of folder “ArduBlockTool” under tools folder is case sensitive.
* In Mac, /Users/<username>/Documents/Arduino/tools/ArduBlockTool/tool/ardublock-all.jar
Expand Down
Binary file added lib/arduino-core.jar
Binary file not shown.
Binary file modified lib/pde.jar
Binary file not shown.
28 changes: 25 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.ardublock</groupId>
<artifactId>ardublock</artifactId>
<packaging>jar</packaging>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.2-SNAPSHOT</version>
<name>ArduBlock</name>
<description>A Block Programming Language for Arduino</description>
<properties>
Expand Down Expand Up @@ -61,7 +61,23 @@
<repositoryLayout>default</repositoryLayout>
<groupId>arduino</groupId>
<artifactId>pde</artifactId>
<version>1.0</version>
<version>1.1</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
<execution>
<id>install-arduino-core</id>
<phase>validate</phase>
<configuration>
<file>${basedir}/lib/arduino-core.jar</file>
<repositoryLayout>default</repositoryLayout>
<groupId>arduino</groupId>
<artifactId>arduino-core</artifactId>
<version>1.6.12</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
Expand Down Expand Up @@ -89,7 +105,13 @@
<groupId>arduino</groupId>
<artifactId>pde</artifactId>
<scope>provided</scope>
<version>1.0</version>
<version>1.1</version>
</dependency>
<dependency>
<groupId>arduino</groupId>
<artifactId>arduino-core</artifactId>
<scope>provided</scope>
<version>1.6.12</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
Expand Down
24 changes: 23 additions & 1 deletion src/main/java/com/ardublock/ArduBlockTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;

import processing.app.Editor;
import processing.app.EditorTab;
import processing.app.SketchFile;
import processing.app.tools.Tool;

import com.ardublock.core.Context;
Expand Down Expand Up @@ -69,7 +74,24 @@ public void didNew()
}

public void didGenerate(String source) {
ArduBlockTool.editor.setText(source);
java.lang.reflect.Method method;
try {
// pre Arduino 1.6.12
Class ed = ArduBlockTool.editor.getClass();
Class[] cArg = new Class[1];
cArg[0] = String.class;
method = ed.getMethod("setText", cArg);
method.invoke(ArduBlockTool.editor, source);
}
catch (NoSuchMethodException e) {
ArduBlockTool.editor.getCurrentTab().setText(source);
} catch (IllegalAccessException e) {
ArduBlockTool.editor.getCurrentTab().setText(source);
} catch (SecurityException e) {
ArduBlockTool.editor.getCurrentTab().setText(source);
} catch (InvocationTargetException e) {
ArduBlockTool.editor.getCurrentTab().setText(source);
}
ArduBlockTool.editor.handleExport(false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ ardublock.ui.create_refer=create reference
ardublock.ui.website=Go to Web Site
ardublock.ui.serialMonitor=Serial Monitor
ardublock.ui.saveImage=Save as image...
ardublock.ui.version=2.0.1
ardublock.ui.version=2.0.2

ardublock.error_msg.digital_var_slot=Digital variable slot must take a 'digital variable' name.\nHint: Look at the 'variable' socket on the highlighted block
ardublock.error_msg.number_var_slot=Standard variable slot must take a standard 'numeric' variable name.\nHint: Look at the 'variable' socket on the highlighted block
Expand Down

0 comments on commit 085f09d

Please sign in to comment.