mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Adding upload using programmer options (instead of verbose).
This commit is contained in:
parent
8523ab1ac7
commit
f1146d80a5
@ -538,7 +538,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
});
|
});
|
||||||
fileMenu.add(saveAsMenuItem);
|
fileMenu.add(saveAsMenuItem);
|
||||||
|
|
||||||
item = newJMenuItem("Upload to I/O Board", 'U');
|
item = newJMenuItem("Upload", 'U');
|
||||||
item.addActionListener(new ActionListener() {
|
item.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
handleExport(false);
|
handleExport(false);
|
||||||
@ -546,13 +546,13 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
});
|
});
|
||||||
fileMenu.add(item);
|
fileMenu.add(item);
|
||||||
|
|
||||||
// item = newJMenuItemShift("Upload to I/O Board (verbose)", 'U');
|
item = newJMenuItemShift("Upload Using Programmer", 'U');
|
||||||
// item.addActionListener(new ActionListener() {
|
item.addActionListener(new ActionListener() {
|
||||||
// public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
// handleExport(true);
|
handleExport(true);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// fileMenu.add(item);
|
fileMenu.add(item);
|
||||||
|
|
||||||
fileMenu.addSeparator();
|
fileMenu.addSeparator();
|
||||||
|
|
||||||
@ -2331,13 +2331,13 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
* Made synchronized to (hopefully) avoid problems of people
|
* Made synchronized to (hopefully) avoid problems of people
|
||||||
* hitting export twice, quickly, and horking things up.
|
* hitting export twice, quickly, and horking things up.
|
||||||
*/
|
*/
|
||||||
synchronized public void handleExport(final boolean verbose) {
|
synchronized public void handleExport(final boolean usingProgrammer) {
|
||||||
//if (!handleExportCheckModified()) return;
|
//if (!handleExportCheckModified()) return;
|
||||||
toolbar.activate(EditorToolbar.EXPORT);
|
toolbar.activate(EditorToolbar.EXPORT);
|
||||||
console.clear();
|
console.clear();
|
||||||
statusNotice("Uploading to I/O Board...");
|
statusNotice("Uploading to I/O Board...");
|
||||||
|
|
||||||
new Thread(verbose ? exportAppHandler : exportHandler).start();
|
new Thread(usingProgrammer ? exportAppHandler : exportHandler).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// DAM: in Arduino, this is upload
|
// DAM: in Arduino, this is upload
|
||||||
@ -2388,6 +2388,9 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
} else {
|
} else {
|
||||||
// error message will already be visible
|
// error message will already be visible
|
||||||
}
|
}
|
||||||
|
} catch (SerialNotFoundException e) {
|
||||||
|
if (serialPrompt()) run();
|
||||||
|
else statusNotice("Upload canceled.");
|
||||||
} catch (RunnerException e) {
|
} catch (RunnerException e) {
|
||||||
//statusError("Error during upload.");
|
//statusError("Error during upload.");
|
||||||
//e.printStackTrace();
|
//e.printStackTrace();
|
||||||
|
@ -42,7 +42,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
|
|||||||
|
|
||||||
/** Titles for each button when the shift key is pressed. */
|
/** Titles for each button when the shift key is pressed. */
|
||||||
static final String titleShift[] = {
|
static final String titleShift[] = {
|
||||||
"Verify (w/ Verbose Output)", "Upload (w/ Verbose Output)", "New Editor Window", "Open in Another Window", "Save", "Serial Monitor"
|
"Verify", "Upload Using Programmer", "New Editor Window", "Open in Another Window", "Save", "Serial Monitor"
|
||||||
};
|
};
|
||||||
|
|
||||||
static final int BUTTON_COUNT = title.length;
|
static final int BUTTON_COUNT = title.length;
|
||||||
@ -310,7 +310,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener, Key
|
|||||||
|
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case RUN:
|
case RUN:
|
||||||
editor.handleRun(e.isShiftDown());
|
editor.handleRun(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// case STOP:
|
// case STOP:
|
||||||
|
@ -1520,15 +1520,15 @@ public class Sketch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected boolean exportApplet(boolean verbose) throws Exception {
|
protected boolean exportApplet(boolean usingProgrammer) throws Exception {
|
||||||
return exportApplet(tempBuildFolder.getAbsolutePath(), verbose);
|
return exportApplet(tempBuildFolder.getAbsolutePath(), usingProgrammer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle export to applet.
|
* Handle export to applet.
|
||||||
*/
|
*/
|
||||||
public boolean exportApplet(String appletPath, boolean verbose)
|
public boolean exportApplet(String appletPath, boolean usingProgrammer)
|
||||||
throws RunnerException, IOException, SerialException {
|
throws RunnerException, IOException, SerialException {
|
||||||
|
|
||||||
// Make sure the user didn't hide the sketch folder
|
// Make sure the user didn't hide the sketch folder
|
||||||
@ -1565,7 +1565,7 @@ public class Sketch {
|
|||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
upload(appletFolder.getPath(), foundName, verbose);
|
upload(appletFolder.getPath(), foundName, usingProgrammer);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1592,7 +1592,7 @@ public class Sketch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected String upload(String buildPath, String suggestedClassName, boolean verbose)
|
protected String upload(String buildPath, String suggestedClassName, boolean usingProgrammer)
|
||||||
throws RunnerException, SerialException {
|
throws RunnerException, SerialException {
|
||||||
|
|
||||||
Uploader uploader;
|
Uploader uploader;
|
||||||
@ -1602,7 +1602,7 @@ public class Sketch {
|
|||||||
uploader = new AvrdudeUploader();
|
uploader = new AvrdudeUploader();
|
||||||
boolean success = uploader.uploadUsingPreferences(buildPath,
|
boolean success = uploader.uploadUsingPreferences(buildPath,
|
||||||
suggestedClassName,
|
suggestedClassName,
|
||||||
verbose);
|
usingProgrammer);
|
||||||
|
|
||||||
return success ? suggestedClassName : null;
|
return success ? suggestedClassName : null;
|
||||||
}
|
}
|
||||||
|
@ -42,14 +42,14 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
public AvrdudeUploader() {
|
public AvrdudeUploader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean uploadUsingPreferences(String buildPath, String className, boolean verbose)
|
public boolean uploadUsingPreferences(String buildPath, String className, boolean usingProgrammer)
|
||||||
throws RunnerException, SerialException {
|
throws RunnerException, SerialException {
|
||||||
this.verbose = verbose;
|
this.verbose = verbose;
|
||||||
Map<String, String> boardPreferences = Base.getBoardPreferences();
|
Map<String, String> boardPreferences = Base.getBoardPreferences();
|
||||||
|
|
||||||
// if no protocol is specified for this board, assume it lacks a
|
// if no protocol is specified for this board, assume it lacks a
|
||||||
// bootloader and upload using the selected programmer.
|
// bootloader and upload using the selected programmer.
|
||||||
if (boardPreferences.get("upload.protocol") == null) {
|
if (usingProgrammer || boardPreferences.get("upload.protocol") == null) {
|
||||||
String programmer = Preferences.get("programmer");
|
String programmer = Preferences.get("programmer");
|
||||||
Target target = Base.getTarget();
|
Target target = Base.getTarget();
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public abstract class Uploader implements MessageConsumer {
|
|||||||
public Uploader() {
|
public Uploader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract boolean uploadUsingPreferences(String buildPath, String className, boolean verbose)
|
public abstract boolean uploadUsingPreferences(String buildPath, String className, boolean usingProgrammer)
|
||||||
throws RunnerException, SerialException;
|
throws RunnerException, SerialException;
|
||||||
|
|
||||||
public abstract boolean burnBootloader() throws RunnerException;
|
public abstract boolean burnBootloader() throws RunnerException;
|
||||||
|
Loading…
Reference in New Issue
Block a user