log invoke() source

This commit is contained in:
Milos Kozak 2017-01-08 00:38:53 +01:00
parent 6621c2f610
commit 66bd06076e
8 changed files with 13 additions and 11 deletions

View file

@ -11,5 +11,5 @@ public interface APSInterface {
public APSResult getLastAPSResult();
public Date getLastAPSRun();
public void invoke();
public void invoke(String initiator);
}

View file

@ -76,7 +76,7 @@ public class LoopFragment extends Fragment implements View.OnClickListener, Frag
public void onClick(View view) {
switch (view.getId()) {
case R.id.loop_run:
getPlugin().invoke(true);
getPlugin().invoke("Loop button", true);
break;
}

View file

@ -108,15 +108,15 @@ public class LoopPlugin implements PluginBase {
@Subscribe
public void onStatusEvent(final EventTreatmentChange ev) {
invoke(true);
invoke("EventTreatmentChange", true);
}
@Subscribe
public void onStatusEvent(final EventNewBG ev) {
invoke(true);
invoke("EventNewBG", true);
}
public void invoke(boolean allowNotification) {
public void invoke(String initiator, boolean allowNotification) {
try {
if (Config.logFunctionCalls)
log.debug("invoke");
@ -136,7 +136,7 @@ public class LoopPlugin implements PluginBase {
APSInterface usedAPS = configBuilder.getActiveAPS();
if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginBase.APS)) {
usedAPS.invoke();
usedAPS.invoke(initiator);
result = usedAPS.getLastAPSResult();
}

View file

@ -73,7 +73,7 @@ public class OpenAPSAMAFragment extends Fragment implements View.OnClickListener
public void onClick(View view) {
switch (view.getId()) {
case R.id.openapsma_run:
getPlugin().invoke();
getPlugin().invoke("OpenAPSAMA button");
break;
}

View file

@ -99,7 +99,8 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
}
@Override
public void invoke() {
public void invoke(String initiator) {
log.debug("invoke from " + initiator);
lastAPSResult = null;
DetermineBasalAdapterAMAJS determineBasalAdapterAMAJS = null;
try {

View file

@ -67,7 +67,7 @@ public class OpenAPSMAFragment extends Fragment implements View.OnClickListener,
public void onClick(View view) {
switch (view.getId()) {
case R.id.openapsma_run:
getPlugin().invoke();
getPlugin().invoke("OpenAPSMA button");
break;
}

View file

@ -97,7 +97,8 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
}
@Override
public void invoke() {
public void invoke(String initiator) {
log.debug("invoke from " + initiator);
lastAPSResult = null;
DetermineBasalAdapterMAJS determineBasalAdapterMAJS = null;
try {

View file

@ -214,7 +214,7 @@ public class OverviewFragment extends Fragment {
acceptTempButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MainApp.getConfigBuilder().getActiveLoop().invoke(false);
MainApp.getConfigBuilder().getActiveLoop().invoke("Accept temp button", false);
final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.changeRequested) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());