@@ -57,9 +57,12 @@ public void internalUpload(IProject Project, String cConf) {
57
57
Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID , Messages .Upload_Project_nature_unaccesible , e ));
58
58
}
59
59
60
- String UpLoadTool = Common .getBuildEnvironmentVariable (Project , cConf , Const .get_ENV_KEY_TOOL (Const .ACTION_UPLOAD ), Const .EMPTY_STRING );
61
- String MComPort = Common .getBuildEnvironmentVariable (Project , cConf , Const .ENV_KEY_JANTJE_COM_PORT , Const .EMPTY_STRING );
62
- String uploadClass = Common .getBuildEnvironmentVariable (Project , cConf , Const .get_ENV_KEY_TOOL (Const .UPLOAD_CLASS ), Const .EMPTY_STRING );
60
+ String UpLoadTool = Common .getBuildEnvironmentVariable (Project , cConf ,
61
+ Const .get_ENV_KEY_TOOL (Const .ACTION_UPLOAD ), Const .EMPTY_STRING );
62
+ String MComPort = Common .getBuildEnvironmentVariable (Project , cConf , Const .ENV_KEY_JANTJE_COM_PORT ,
63
+ Const .EMPTY_STRING );
64
+ String uploadClass = Common .getBuildEnvironmentVariable (Project , cConf ,
65
+ Const .get_ENV_KEY_TOOL (Const .UPLOAD_CLASS ), Const .EMPTY_STRING );
63
66
64
67
this .myConsole = Helpers .findConsole (Messages .Upload_console );
65
68
this .myConsole .clearConsole ();
@@ -84,12 +87,14 @@ public void internalUpload(IProject Project, String cConf) {
84
87
} else {
85
88
this .myHighLevelConsoleStream .println (Messages .Upload_ssh );
86
89
87
- realUploader = new SSHUpload (this .myHighLevelConsoleStream , this .myOutconsoleStream , this .myErrconsoleStream , host );
90
+ realUploader = new SSHUpload (Project , UpLoadTool , this .myHighLevelConsoleStream ,
91
+ this .myOutconsoleStream , this .myErrconsoleStream , host );
88
92
uploadJobName = Const .UPLOAD_SSH ;
89
93
}
90
94
} else if (UpLoadTool .equalsIgnoreCase (Const .UPLOAD_TOOL_TEENSY )) {
91
95
this .myHighLevelConsoleStream .println (Messages .Upload_generic );
92
- realUploader = new GenericLocalUploader (UpLoadTool , Project , cConf , this .myConsole , this .myErrconsoleStream , this .myOutconsoleStream );
96
+ realUploader = new GenericLocalUploader (UpLoadTool , Project , cConf , this .myConsole , this .myErrconsoleStream ,
97
+ this .myOutconsoleStream );
93
98
uploadJobName = UpLoadTool ;
94
99
} else {
95
100
this .myHighLevelConsoleStream .println (Messages .Upload_arduino );
@@ -108,9 +113,10 @@ public void internalUpload(IProject Project, String cConf) {
108
113
protected IStatus run (IProgressMonitor monitor ) {
109
114
try {
110
115
String uploadflag = "FuStatus" ; //$NON-NLS-1$
111
- char [] uri = { 'h' , 't' , 't' , 'p' , ':' , '/' , '/' , 'b' , 'a' , 'e' , 'y' , 'e' , 'n' , 's' , '.' , 'i' , 't' , '/' , 'e' , 'c' , 'l' , 'i' , 'p' ,
112
- 's' , 'e' , '/' , 'd' , 'o' , 'w' , 'n' , 'l' , 'o' , 'a' , 'd' , '/' , 'u' , 'p' , 'l' , 'o' , 'a' , 'd' , 'S' , 't' , 'a' , 'r' , 't' , '.' ,
113
- 'h' , 't' , 'm' , 'l' , '?' , 'u' , '=' };
116
+ char [] uri = { 'h' , 't' , 't' , 'p' , ':' , '/' , '/' , 'b' , 'a' , 'e' , 'y' , 'e' , 'n' , 's' , '.' , 'i' , 't' ,
117
+ '/' , 'e' , 'c' , 'l' , 'i' , 'p' , 's' , 'e' , '/' , 'd' , 'o' , 'w' , 'n' , 'l' , 'o' , 'a' , 'd' , '/' ,
118
+ 'u' , 'p' , 'l' , 'o' , 'a' , 'd' , 'S' , 't' , 'a' , 'r' , 't' , '.' , 'h' , 't' , 'm' , 'l' , '?' , 'u' ,
119
+ '=' };
114
120
IEclipsePreferences myScope = InstanceScope .INSTANCE .getNode (Const .NODE_ARDUINO );
115
121
int curFsiStatus = myScope .getInt (uploadflag , 0 ) + 1 ;
116
122
URL pluginStartInitiator = new URL (new String (uri ) + Integer .toString (curFsiStatus ));
@@ -128,7 +134,8 @@ protected IStatus run(IProgressMonitor monitor) {
128
134
}
129
135
130
136
/**
131
- * UploadJobWrapper stops the serial port and restarts the serial port as needed. in between it calls the real uploader IUploader
137
+ * UploadJobWrapper stops the serial port and restarts the serial port as
138
+ * needed. in between it calls the real uploader IUploader
132
139
*
133
140
* @author jan
134
141
*
@@ -154,14 +161,16 @@ protected IStatus run(IProgressMonitor monitor) {
154
161
try {
155
162
monitor .beginTask (Messages .Upload_uploading + " \" " + this .myProject .getName () + "\" " + this .myNAmeTag , //$NON-NLS-1$//$NON-NLS-2$
156
163
2 );
157
- myComPort = Common .getBuildEnvironmentVariable (this .myProject , this .myCConf , Const .ENV_KEY_JANTJE_COM_PORT , "" ); //$NON-NLS-1$
164
+ myComPort = Common .getBuildEnvironmentVariable (this .myProject , this .myCConf ,
165
+ Const .ENV_KEY_JANTJE_COM_PORT , "" ); //$NON-NLS-1$
158
166
159
167
try {
160
168
WeStoppedTheComPort = Common .StopSerialMonitor (myComPort );
161
169
} catch (Exception e ) {
162
170
Common .log (new Status (IStatus .WARNING , Const .CORE_PLUGIN_ID , Messages .Upload_Error_com_port , e ));
163
171
}
164
- IFile hexFile = this .myProject .getFile (new Path (this .myCConf ).append (this .myProject .getName () + ".hex" )); //$NON-NLS-1$
172
+ IFile hexFile = this .myProject
173
+ .getFile (new Path (this .myCConf ).append (this .myProject .getName () + ".hex" )); //$NON-NLS-1$
165
174
if (this .myUploader .uploadUsingPreferences (hexFile , false , monitor )) {
166
175
UploadSketchWrapper .this .myHighLevelConsoleStream .println (Messages .Upload_Done );
167
176
} else {
@@ -176,7 +185,8 @@ protected IStatus run(IProgressMonitor monitor) {
176
185
Common .StartSerialMonitor (myComPort );
177
186
}
178
187
} catch (Exception e ) {
179
- Common .log (new Status (IStatus .WARNING , Const .CORE_PLUGIN_ID , Messages .Upload_Error_serial_monitor_restart , e ));
188
+ Common .log (new Status (IStatus .WARNING , Const .CORE_PLUGIN_ID ,
189
+ Messages .Upload_Error_serial_monitor_restart , e ));
180
190
}
181
191
monitor .done ();
182
192
}
0 commit comments