optimize nsclient logging
This commit is contained in:
parent
afca896f23
commit
2a1fe205ee
|
@ -189,11 +189,11 @@ public class NSClientInternalPlugin implements PluginBase {
|
|||
|
||||
private void updateLog() {
|
||||
try {
|
||||
Spanned newTextLog = Html.fromHtml("");
|
||||
String newTextLog = "";
|
||||
for (EventNSClientNewLog log : listLog) {
|
||||
newTextLog = (Spanned) TextUtils.concat(newTextLog, log.toHtml());
|
||||
newTextLog = newTextLog + log.toPreparedHtml();
|
||||
}
|
||||
textLog = newTextLog;
|
||||
textLog = Html.fromHtml(newTextLog);
|
||||
MainApp.bus().post(new EventNSClientUpdateGUI());
|
||||
} catch (OutOfMemoryError e) {
|
||||
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), "Out of memory!\nStop using this phone !!!", R.raw.error);
|
||||
|
|
|
@ -27,4 +27,9 @@ public class EventNSClientNewLog {
|
|||
Spanned line = Html.fromHtml(timeFormat.format(date) + " <b>" + action + "</b> " + logText + "<br>");
|
||||
return line;
|
||||
}
|
||||
|
||||
public String toPreparedHtml() {
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
return timeFormat.format(date) + " <b>" + action + "</b> " + logText + "<br>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1155,7 +1155,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
}
|
||||
|
||||
// ****** GRAPH *******
|
||||
log.debug("updateGUI checkpoint 1");
|
||||
//log.debug("updateGUI checkpoint 1");
|
||||
|
||||
// allign to hours
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
@ -1286,7 +1286,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
absoluteBasalsLineSeries.setCustomPaint(absolutePaint);
|
||||
}
|
||||
|
||||
log.debug("updateGUI checkpoint 2");
|
||||
//log.debug("updateGUI checkpoint 2");
|
||||
|
||||
// **** IOB COB DEV graph ****
|
||||
class DeviationDataPoint extends DataPoint {
|
||||
|
@ -1404,12 +1404,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
} else {
|
||||
iobGraph.setVisibility(View.GONE);
|
||||
}
|
||||
log.debug("updateGUI checkpoint 3");
|
||||
//log.debug("updateGUI checkpoint 3");
|
||||
|
||||
// remove old data from graph
|
||||
bgGraph.getSecondScale().getSeries().clear();
|
||||
bgGraph.getSeries().clear();
|
||||
log.debug("updateGUI checkpoint 4");
|
||||
//log.debug("updateGUI checkpoint 4");
|
||||
|
||||
// **** Area ****
|
||||
DoubleDataPoint[] areaDataPoints = new DoubleDataPoint[]{
|
||||
|
|
Loading…
Reference in a new issue