Skip to content
Snippets Groups Projects
Commit c159c0a6 authored by BBQ's avatar BBQ
Browse files

wait 1 sek after set the sensor values

parent e81f3469
No related branches found
No related tags found
1 merge request!19dev to master
...@@ -49,7 +49,6 @@ public class Benchmark { ...@@ -49,7 +49,6 @@ public class Benchmark {
void start(){ void start(){
String PREFERENCE_URL = "http://localhost:4567/model/items/iris1_item/state"; String PREFERENCE_URL = "http://localhost:4567/model/items/iris1_item/state";
String ACTIVITY_URL = "http://localhost:4567/activity/current"; String ACTIVITY_URL = "http://localhost:4567/activity/current";
int TIME_PERIOD = 5000;
File a_file; File a_file;
File p_file; File p_file;
FileReader a_file_reader; FileReader a_file_reader;
...@@ -73,7 +72,6 @@ public class Benchmark { ...@@ -73,7 +72,6 @@ public class Benchmark {
i++; i++;
} }
else{ else{
try{Thread.sleep(TIME_PERIOD);}catch (InterruptedException e){e.printStackTrace();}
String[] values = Arrays.copyOf(a_next_record,12); String[] values = Arrays.copyOf(a_next_record,12);
setNewValue(values, ACTIVITY_ITEM_NAME,"activity"); setNewValue(values, ACTIVITY_ITEM_NAME,"activity");
HttpResponse response= Request.Get(ACTIVITY_URL).execute().returnResponse(); HttpResponse response= Request.Get(ACTIVITY_URL).execute().returnResponse();
...@@ -94,7 +92,6 @@ public class Benchmark { ...@@ -94,7 +92,6 @@ public class Benchmark {
getCSVHeader(Arrays.copyOf(p_next_record,2),"p"); getCSVHeader(Arrays.copyOf(p_next_record,2),"p");
j++; j++;
}else{ }else{
try{Thread.sleep(TIME_PERIOD);}catch (InterruptedException e){e.printStackTrace();}
String[] values1 = Arrays.copyOf(p_next_record,2); String[] values1 = Arrays.copyOf(p_next_record,2);
setNewValue(values1, PREFERENCE_ITEM_NAME,"preference"); setNewValue(values1, PREFERENCE_ITEM_NAME,"preference");
HttpResponse response1= Request.Get(PREFERENCE_URL).execute().returnResponse(); HttpResponse response1= Request.Get(PREFERENCE_URL).execute().returnResponse();
...@@ -116,6 +113,7 @@ public class Benchmark { ...@@ -116,6 +113,7 @@ public class Benchmark {
} }
private void setNewValue(String[] values, String[] name, String file_typ){ private void setNewValue(String[] values, String[] name, String file_typ){
int TIME_PERIOD = 1000;
if(file_typ.equals("activity")) if(file_typ.equals("activity"))
{ {
int i = 0; int i = 0;
...@@ -152,6 +150,7 @@ public class Benchmark { ...@@ -152,6 +150,7 @@ public class Benchmark {
e.printStackTrace(); e.printStackTrace();
} }
} }
try{Thread.sleep(TIME_PERIOD);}catch (InterruptedException e){e.printStackTrace();}
} }
private void getCSVHeader(String[] a_values,String csv_typ){ private void getCSVHeader(String[] a_values,String csv_typ){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment