Skip to content

Commit

Permalink
wrong commit ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Fisch authored and Robert Fisch committed Dec 5, 2015
1 parent 741707d commit cbb20c9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public void saveFields()
protected void onDestroy() {
debug("MainActivity: onDestroy");

dataLogger.onDestroy(); // clean up
dataLogger.destroy(); // clean up

if(device!=null) {
// stop the device nicely
Expand Down
17 changes: 13 additions & 4 deletions app/src/main/java/lu/fisch/canze/classes/DataLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public boolean isCreated()

public boolean activate ( boolean state ) {
boolean result = state;
debug ( "DataLogger: activate req " + state );
debug ( "DataLogger: activate > request = " + state );

if ( activated != state) {
if (state) { // now need to activate, open file, start timer
Expand All @@ -105,7 +105,7 @@ public boolean activate ( boolean state ) {
// debug("DataLogger: stop ");
}
}
debug ( "DataLogger: activate return " + result );
debug ( "DataLogger: activate > return " + result );
return result;
}

Expand Down Expand Up @@ -236,16 +236,19 @@ public boolean stop() {
return result;
}

// Bob: Useless
/*
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
public void onCreate() {
public void create() {
// start timer in 400ms
boolean result = start();
// handler.postDelayed(runnable, 400 );
}
*/

public void onDestroy() {
public void destroy() {
handler.removeCallbacks(runnable);
boolean result = stop();
}
Expand Down Expand Up @@ -354,13 +357,19 @@ public void onFieldUpdateEvent(final Field field) {

}

// Bob: This is no activity ...
/*
public void onPause() {
onDestroy();
}
*/

// Bob: This is no activity ...
/*
public void onResume() {
onCreate();
}
*/


// only for test and trace purposes - delete later on
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/lu/fisch/canze/devices/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ public int compare(Field lhs, Field rhs) {
// return it's index in the global registered field array
if(field.isDue(referenceTime)) {
//MainActivity.debug(Calendar.getInstance().getTimeInMillis()/1000.+" > Chosing: "+field.getSID());
MainActivity.debug("Device: getNextField > applicationFields");
return field;
}
}
Expand All @@ -273,12 +274,14 @@ public int compare(Field lhs, Field rhs) {
// return it's index in the global registered field array
if(field.isDue(referenceTime)) {
//MainActivity.debug(Calendar.getInstance().getTimeInMillis()/1000.+" > Chosing: "+field.getSID());
MainActivity.debug("Device: getNextField > activityFieldsScheduled");
return field;
}
}
if(activityFieldsAsFastAsPossible.size()>0)
{
activityFieldIndex = (activityFieldIndex + 1) % activityFieldsAsFastAsPossible.size();
MainActivity.debug("Device: getNextField > activityFieldsAsFastAsPossible");
return activityFieldsAsFastAsPossible.get(activityFieldIndex);
}

Expand Down Expand Up @@ -349,6 +352,7 @@ public void clearFields()
MainActivity.debug("Device: clearFields");
synchronized (fields) {
activityFieldsScheduled.clear();
activityFieldsAsFastAsPossible.clear();
fields.clear();
fields.addAll(applicationFields);
//MainActivity.debug("cleared");
Expand Down

0 comments on commit cbb20c9

Please sign in to comment.