Added data time and time diffrence between data points to main activity2 common fragment
This commit is contained in:
@@ -93,6 +93,13 @@ public class FragmentCommon extends FragmentOsdBaseClass {
|
||||
tv.setBackgroundColor(okColour);
|
||||
tv.setTextColor(okTextColour);
|
||||
|
||||
tv = (TextView) mRootView.findViewById(R.id.data_time_tv);
|
||||
tv.setText("Time =" + mConnection.mSdServer.mSdData.dataTime.format("%H:%M:%S")
|
||||
+ " (" + String.format("%.1f s)",mConnection.mSdServer.mSdData.timeDiff));
|
||||
tv.setBackgroundColor(okColour);
|
||||
tv.setTextColor(okTextColour);
|
||||
|
||||
|
||||
tv = (TextView) mRootView.findViewById(R.id.alarmTv);
|
||||
if ((mConnection.mSdServer.mSdData.alarmState == 0)
|
||||
&& !mConnection.mSdServer.mSdData.alarmStanding
|
||||
|
||||
@@ -105,6 +105,7 @@ public class SdData implements Parcelable {
|
||||
|
||||
/* Analysis results */
|
||||
public Time dataTime = null;
|
||||
public float timeDiff = 0f;
|
||||
public long alarmState;
|
||||
public String alarmCause = "";
|
||||
public boolean alarmStanding = false;
|
||||
@@ -136,6 +137,7 @@ public class SdData implements Parcelable {
|
||||
rawData = new double[N_RAW_DATA];
|
||||
rawData3D = new double[N_RAW_DATA * 3];
|
||||
dataTime = new Time(Time.getCurrentTimezone());
|
||||
timeDiff = 0f;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -153,6 +155,10 @@ public class SdData implements Parcelable {
|
||||
//cal.setTime(sdf.parse(jo.optString("dataTimeStr")));
|
||||
//dataTime = cal.getTime();
|
||||
// FIXME - this doesn't work!!!
|
||||
Time tnow = new Time();
|
||||
tnow.setToNow();
|
||||
timeDiff = (tnow.toMillis(false)
|
||||
- dataTime.toMillis(false))/1000f;
|
||||
dataTime.setToNow();
|
||||
Log.v(TAG, "fromJSON(): dataTime = " + dataTime.toString());
|
||||
maxVal = jo.optInt("maxVal");
|
||||
|
||||
@@ -504,6 +504,12 @@ public abstract class SdDataSource {
|
||||
mDataStatusTime.setToNow();
|
||||
mSdData.specPower = (long) specPower / ACCEL_SCALE_FACTOR;
|
||||
mSdData.roiPower = (long) roiPower / ACCEL_SCALE_FACTOR;
|
||||
Time tnow = new Time();
|
||||
tnow.setToNow();
|
||||
mSdData.timeDiff = (tnow.toMillis(false)
|
||||
- mSdData.dataTime.toMillis(false))/1000f;
|
||||
mSdData.dataTime.setToNow();
|
||||
|
||||
mSdData.dataTime.setToNow();
|
||||
mSdData.maxVal = 0; // not used
|
||||
mSdData.maxFreq = 0; // not used
|
||||
|
||||
Reference in New Issue
Block a user