20
20
import it .baeyens .arduino .common .Common ;
21
21
import it .baeyens .arduino .common .Const ;
22
22
import it .baeyens .arduino .tools .Helpers ;
23
- import it .baeyens .arduino .tools .PasswordManager ;
24
23
25
24
public class UploadSketchWrapper {
26
25
@@ -58,12 +57,9 @@ public void internalUpload(IProject Project, String cConf) {
58
57
Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID , Messages .Upload_Project_nature_unaccesible , e ));
59
58
}
60
59
61
- String UpLoadTool = Common .getBuildEnvironmentVariable (Project , cConf ,
62
- Const .get_ENV_KEY_TOOL (Const .ACTION_UPLOAD ), Const .EMPTY_STRING );
63
- String MComPort = Common .getBuildEnvironmentVariable (Project , cConf , Const .ENV_KEY_JANTJE_COM_PORT ,
64
- Const .EMPTY_STRING );
65
- String uploadClass = Common .getBuildEnvironmentVariable (Project , cConf ,
66
- Const .get_ENV_KEY_TOOL (Const .UPLOAD_CLASS ), Const .EMPTY_STRING );
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 );
67
63
68
64
this .myConsole = Helpers .findConsole (Messages .Upload_console );
69
65
this .myConsole .clearConsole ();
@@ -87,23 +83,13 @@ public void internalUpload(IProject Project, String cConf) {
87
83
uploadJobName = UpLoadTool ;
88
84
} else {
89
85
this .myHighLevelConsoleStream .println (Messages .Upload_ssh );
90
- PasswordManager pwdManager = new PasswordManager ();
91
- if (!pwdManager .setHost (host )) {
92
- Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID ,
93
- Messages .Upload_login_credentials_missing + host ));
94
- }
95
-
96
- String password = pwdManager .getPassword ();
97
- String login = pwdManager .getLogin ();
98
86
99
- realUploader = new SSHUpload (this .myHighLevelConsoleStream , this .myOutconsoleStream ,
100
- this .myErrconsoleStream , password , host , login );
87
+ realUploader = new SSHUpload (this .myHighLevelConsoleStream , this .myOutconsoleStream , this .myErrconsoleStream , host );
101
88
uploadJobName = Const .UPLOAD_SSH ;
102
89
}
103
90
} else if (UpLoadTool .equalsIgnoreCase (Const .UPLOAD_TOOL_TEENSY )) {
104
91
this .myHighLevelConsoleStream .println (Messages .Upload_generic );
105
- realUploader = new GenericLocalUploader (UpLoadTool , Project , cConf , this .myConsole , this .myErrconsoleStream ,
106
- this .myOutconsoleStream );
92
+ realUploader = new GenericLocalUploader (UpLoadTool , Project , cConf , this .myConsole , this .myErrconsoleStream , this .myOutconsoleStream );
107
93
uploadJobName = UpLoadTool ;
108
94
} else {
109
95
this .myHighLevelConsoleStream .println (Messages .Upload_arduino );
@@ -122,10 +108,9 @@ public void internalUpload(IProject Project, String cConf) {
122
108
protected IStatus run (IProgressMonitor monitor ) {
123
109
try {
124
110
String uploadflag = "FuStatus" ; //$NON-NLS-1$
125
- char [] uri = { 'h' , 't' , 't' , 'p' , ':' , '/' , '/' , 'b' , 'a' , 'e' , 'y' , 'e' , 'n' , 's' , '.' , 'i' , 't' ,
126
- '/' , 'e' , 'c' , 'l' , 'i' , 'p' , 's' , 'e' , '/' , 'd' , 'o' , 'w' , 'n' , 'l' , 'o' , 'a' , 'd' , '/' ,
127
- 'u' , 'p' , 'l' , 'o' , 'a' , 'd' , 'S' , 't' , 'a' , 'r' , 't' , '.' , 'h' , 't' , 'm' , 'l' , '?' , 'u' ,
128
- '=' };
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' , '=' };
129
114
IEclipsePreferences myScope = InstanceScope .INSTANCE .getNode (Const .NODE_ARDUINO );
130
115
int curFsiStatus = myScope .getInt (uploadflag , 0 ) + 1 ;
131
116
URL pluginStartInitiator = new URL (new String (uri ) + Integer .toString (curFsiStatus ));
@@ -143,8 +128,7 @@ protected IStatus run(IProgressMonitor monitor) {
143
128
}
144
129
145
130
/**
146
- * UploadJobWrapper stops the serial port and restarts the serial port as
147
- * needed. in between it calls the real uploader IUploader
131
+ * UploadJobWrapper stops the serial port and restarts the serial port as needed. in between it calls the real uploader IUploader
148
132
*
149
133
* @author jan
150
134
*
@@ -170,17 +154,15 @@ protected IStatus run(IProgressMonitor monitor) {
170
154
try {
171
155
monitor .beginTask (Messages .Upload_uploading + " \" " + this .myProject .getName () + "\" " + this .myNAmeTag , //$NON-NLS-1$//$NON-NLS-2$
172
156
2 );
173
- myComPort = Common .getBuildEnvironmentVariable (this .myProject , this .myCConf ,
174
- Const .ENV_KEY_JANTJE_COM_PORT , "" ); //$NON-NLS-1$
157
+ myComPort = Common .getBuildEnvironmentVariable (this .myProject , this .myCConf , Const .ENV_KEY_JANTJE_COM_PORT , "" ); //$NON-NLS-1$
175
158
176
159
try {
177
160
WeStoppedTheComPort = Common .StopSerialMonitor (myComPort );
178
161
} catch (Exception e ) {
179
162
Common .log (new Status (IStatus .WARNING , Const .CORE_PLUGIN_ID , Messages .Upload_Error_com_port , e ));
180
163
}
181
- IFile hexFile = this .myProject
182
- .getFile (new Path (this .myCConf ).append (this .myProject .getName () + ".hex" )); //$NON-NLS-1$
183
- if (this .myUploader .uploadUsingPreferences (hexFile , this .myProject , false , monitor )) {
164
+ IFile hexFile = this .myProject .getFile (new Path (this .myCConf ).append (this .myProject .getName () + ".hex" )); //$NON-NLS-1$
165
+ if (this .myUploader .uploadUsingPreferences (hexFile , false , monitor )) {
184
166
UploadSketchWrapper .this .myHighLevelConsoleStream .println (Messages .Upload_Done );
185
167
} else {
186
168
UploadSketchWrapper .this .myHighLevelConsoleStream .println (Messages .Upload_failed_upload );
@@ -194,8 +176,7 @@ protected IStatus run(IProgressMonitor monitor) {
194
176
Common .StartSerialMonitor (myComPort );
195
177
}
196
178
} catch (Exception e ) {
197
- Common .log (new Status (IStatus .WARNING , Const .CORE_PLUGIN_ID ,
198
- Messages .Upload_Error_serial_monitor_restart , e ));
179
+ Common .log (new Status (IStatus .WARNING , Const .CORE_PLUGIN_ID , Messages .Upload_Error_serial_monitor_restart , e ));
199
180
}
200
181
monitor .done ();
201
182
}
0 commit comments