updated according to new scanProcesseses() interface

This commit is contained in:
fros4943 2008-10-03 13:10:09 +00:00
parent c928a5eec5
commit e547b55196

View file

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: GUI.java,v 1.82 2008/10/03 10:23:05 fros4943 Exp $ * $Id: GUI.java,v 1.83 2008/10/03 13:10:09 fros4943 Exp $
*/ */
package se.sics.cooja; package se.sics.cooja;
@ -1067,34 +1067,26 @@ public class GUI extends Observable {
logger.info("> Scanning for user processes"); logger.info("> Scanning for user processes");
userProcesses = new Vector<String>(); userProcesses = new Vector<String>();
Vector<String> autostartProcesses = new Vector<String>(); Vector<String> autostartProcesses = new Vector<String>();
Vector<String[]> scannedProcessInfo = ContikiMoteTypeDialog Vector<ContikiProcess> scannedProcesses = ContikiMoteTypeDialog.scanForProcesses(contikiCoreDir);
.scanForProcesses(contikiCoreDir);
for (String projectDir : projectDirs) { for (String projectDir : projectDirs) {
// project directories scannedProcesses.addAll(ContikiMoteTypeDialog.scanForProcesses(new File(projectDir)));
scannedProcessInfo.addAll(ContikiMoteTypeDialog
.scanForProcesses(new File(projectDir)));
} }
for (String[] processInfo : scannedProcessInfo) { for (ContikiProcess processInfo : scannedProcesses) {
if (processInfo[0].equals(mainProcessFile.getName())) { if (processInfo.getSourceFile().equals(mainProcessFile)) {
logger.info(">> Found and added: " + processInfo[1] + " (" logger.info(">> Found and added: " + processInfo);
+ processInfo[0] + ")"); userProcesses.add(processInfo.getProcessName());
userProcesses.add(processInfo[1]);
if (addAutostartProcesses) { if (addAutostartProcesses) {
// Parse any autostart processes // Parse any autostart processes
try { try {
// logger.info(">>> Parsing " + processInfo[0] + " for autostart // logger.info(">>> Parsing " + processInfo.getProcessName() + " for autostart processes");
// processes"); Vector<String> autostarters = ContikiMoteTypeDialog.parseAutostartProcesses(mainProcessFile);
Vector<String> autostarters = ContikiMoteTypeDialog
.parseAutostartProcesses(mainProcessFile);
if (autostarters != null) { if (autostarters != null) {
autostartProcesses.addAll(autostarters); autostartProcesses.addAll(autostarters);
} }
} catch (Exception e) { } catch (Exception e) {
logger logger.fatal(">>> Error when parsing autostart processes, aborting: " + e);
.fatal(">>> Error when parsing autostart processes, aborting: "
+ e);
return false; return false;
} }
} }