Skip to content
Snippets Groups Projects
Commit 759f294c authored by alfredo's avatar alfredo
Browse files

domain.java funzionante anche per piu' piattaforme (forse)

parent d410f5d5
No related branches found
No related tags found
No related merge requests found
......@@ -127,26 +127,27 @@ public class Domain {
}
for (int i = 0; i < s1.length; i++) {
String remZip = s1[i].substring(0, s1[i].length() - 4);
String[] curr = remZip.split("-");
for (int j = 0; j < curr.length; j++) {
if (curr.length > 1) {
String a = curr[0];
String b = curr[1];
try {
// inserimento modulo non arduino
DBC.fillModules(a, b, s1[i]);
} catch (SQLException | JSONException e) {
e.printStackTrace();
}
} else {
String a = curr[0];
try {
// inserimento modulo arduino
DBC.fillModules(a, "Arduino1", s1[i]);
} catch (SQLException | JSONException e) {
e.printStackTrace();
}
if(remZip.contains("-debian9-BB")){
String[] curr = remZip.split("-");
String a = curr[0];
String b = curr[1];
try {
// inserimento modulo non arduino
DBC.fillModules(a, b, s1[i]);
} catch (SQLException | JSONException e) {
e.printStackTrace();
}
}
if(remZip.contains("_Arduino1wifi")){
String[] curr = remZip.split("_");
String a = curr[0];
// vogliamo solo Arduino1
String b = curr[1].substring(0, 8);
try {
// inserimento modulo arduino
DBC.fillModules(a, b, s1[i]);
} catch (SQLException | JSONException e) {
e.printStackTrace();
}
}
}
......
......@@ -103,6 +103,8 @@ public class InstallHandler implements HttpHandler {
}
// System.out.println("riga 105 moduleHost = " + moduleHosts);
// divido gli host in base al loro module
// Per ogni host e module, associo ad ogni module tutti i suoi host
// moduleHosts puo' avere module0---host1 e module0---host2, hostsMap unisce i due host sullo stesso module
HashMap<String, ArrayList<String>> hostsMap = new HashMap<String, ArrayList<String>>();
for (String mh : moduleHosts) {
String[] mhSplit = mh.split("---");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment