()
| 2047 | } |
| 2048 | |
| 2049 | public void run() { |
| 2050 | try { |
| 2051 | uploading = true; |
| 2052 | |
| 2053 | removeAllLineHighlights(); |
| 2054 | if (serialMonitor != null) { |
| 2055 | serialMonitor.suspend(); |
| 2056 | } |
| 2057 | if (serialPlotter != null) { |
| 2058 | serialPlotter.suspend(); |
| 2059 | } |
| 2060 | |
| 2061 | boolean success = sketchController.exportApplet(usingProgrammer); |
| 2062 | if (success) { |
| 2063 | statusNotice(tr("Done uploading.")); |
| 2064 | } |
| 2065 | } catch (SerialNotFoundException e) { |
| 2066 | if (portMenu.getItemCount() == 0) { |
| 2067 | statusError(tr("Serial port not selected.")); |
| 2068 | } else { |
| 2069 | if (serialPrompt()) { |
| 2070 | run(); |
| 2071 | } else { |
| 2072 | statusNotice(tr("Upload canceled.")); |
| 2073 | } |
| 2074 | } |
| 2075 | } catch (PreferencesMapException e) { |
| 2076 | statusError(I18n.format( |
| 2077 | tr("Error while uploading: missing '{0}' configuration parameter"), |
| 2078 | e.getMessage())); |
| 2079 | } catch (RunnerException e) { |
| 2080 | //statusError("Error during upload."); |
| 2081 | //e.printStackTrace(); |
| 2082 | status.unprogress(); |
| 2083 | statusError(e); |
| 2084 | } catch (Exception e) { |
| 2085 | e.printStackTrace(); |
| 2086 | } finally { |
| 2087 | populatePortMenu(); |
| 2088 | avoidMultipleOperations = false; |
| 2089 | } |
| 2090 | status.unprogress(); |
| 2091 | uploading = false; |
| 2092 | //toolbar.clear(); |
| 2093 | toolbar.deactivateExport(); |
| 2094 | |
| 2095 | resumeOrCloseSerialMonitor(); |
| 2096 | resumeOrCloseSerialPlotter(); |
| 2097 | base.onBoardOrPortChange(); |
| 2098 | } |
| 2099 | } |
| 2100 | |
| 2101 | static public boolean isUploading() { |
nothing calls this directly
no test coverage detected