added temporary workaround that removes file duplicates, removed warning message
This commit is contained in:
parent
4222d0adcd
commit
e3a12703da
|
@ -67,7 +67,6 @@ import org.jdom.Element;
|
||||||
|
|
||||||
import se.sics.cooja.ClassDescription;
|
import se.sics.cooja.ClassDescription;
|
||||||
import se.sics.cooja.GUI;
|
import se.sics.cooja.GUI;
|
||||||
import se.sics.cooja.GUI.RunnableInEDT;
|
|
||||||
import se.sics.cooja.Mote;
|
import se.sics.cooja.Mote;
|
||||||
import se.sics.cooja.MotePlugin;
|
import se.sics.cooja.MotePlugin;
|
||||||
import se.sics.cooja.PluginType;
|
import se.sics.cooja.PluginType;
|
||||||
|
@ -141,6 +140,26 @@ public class MspCodeWatcher extends VisPlugin implements MotePlugin {
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
throw new RuntimeException("No debugging info found in firmware, aborting");
|
throw new RuntimeException("No debugging info found in firmware, aborting");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXX Temporary workaround: source file removing duplicates awaiting Mspsim update */
|
||||||
|
{
|
||||||
|
ArrayList<String> newDebugSourceFiles = new ArrayList<String>();
|
||||||
|
for (String sf: debugSourceFiles) {
|
||||||
|
boolean found = false;
|
||||||
|
for (String nsf: newDebugSourceFiles) {
|
||||||
|
if (sf.equals(nsf)) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
newDebugSourceFiles.add(sf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
debugSourceFiles = newDebugSourceFiles.toArray(new String[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rules = new ArrayList<Rule>();
|
rules = new ArrayList<Rule>();
|
||||||
|
|
||||||
loadDefaultRules();
|
loadDefaultRules();
|
||||||
|
@ -683,24 +702,6 @@ public class MspCodeWatcher extends VisPlugin implements MotePlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If no files were found, suggest map function */
|
|
||||||
if (debugSourceFiles.length > 0 && existing.isEmpty() && GUI.isVisualized()) {
|
|
||||||
new RunnableInEDT<Boolean>() {
|
|
||||||
public Boolean work() {
|
|
||||||
JOptionPane.showMessageDialog(
|
|
||||||
GUI.getTopParentContainer(),
|
|
||||||
"The firmware debug info specifies " + debugSourceFiles.length + " source files.\n" +
|
|
||||||
"However, MspCodeWatcher could not find any of these files.\n" +
|
|
||||||
"Make sure the source files were not moved after the firmware compilation.\n" +
|
|
||||||
"\n" +
|
|
||||||
"If you want to manually locate the sources, click the \"Locate sources\" button.",
|
|
||||||
"No source files found",
|
|
||||||
JOptionPane.WARNING_MESSAGE);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}.invokeAndWait();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Sort alphabetically */
|
/* Sort alphabetically */
|
||||||
File[] sorted = existing.toArray(new File[0]);
|
File[] sorted = existing.toArray(new File[0]);
|
||||||
Arrays.sort(sorted, new Comparator<File>() {
|
Arrays.sort(sorted, new Comparator<File>() {
|
||||||
|
|
Loading…
Reference in a new issue