/**
* author : lipan
* filename : TestLog.java
* create_time : 2014年8月26日 下午5:49:22
*/
package com.sets.speedtest.domain;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.SparseIntArray;
import android.widget.Button;
import android.widget.ImageView;
import com.github.johnpersano.supertoasts.SuperCardToast;
/**
* @author : lipan
* @create_time : 2014年8月26日 下午5:49:22
* @desc : 测速日志信息
* @update_person:
* @update_time :
* @update_desc :
*
*/
public class TestLog implements Parcelable
{
public static final String KEY = "TEST_LOG";
public Integer addressId; // 地址Id
public String phone_nbr; // 手机号
public String phone_type; // 手机型号
public String carrier; // 运营商: CUC, CMC, CTC, MVNO
public String net_type; // 网络类型:2G, 3G, 4G
public Integer signal_strength = -1; // 移动信号强度:-110 - -50dB,值越大表示信号越好
public Integer download = 0; // 下载带宽, KB为单位
public Integer upload; // 上传带宽, KB为单位
public Long begin_time; // 开始时间
public Long end_time; // 结束时间
public int downloadSize; // 下载文件字节数
public boolean hasBegin = false; // 开始啦
public Integer index; // 索引
public String name; // A、B、C、D名称
public Button button; // 对应的A、B、C、D按钮
public SuperCardToast redoResult; // 重新测试结果toast
public ImageView manImage; // 移动小人图片
public ImageView standImage; // 猫头鹰
public SparseIntArray signalArray = new SparseIntArray(); // 信号强度
public TestLog()
{
}
/**
* @param index
* @param name
*/
public TestLog(Integer index, String name, Button button, ImageView manImage,
ImageView standImage)
{
this.index = index;
this.name = name;
this.button = button;
this.manImage = manImage;
this.standImage = standImage;
}
// /**
// * 下载速度 B/ms
// *
// * @return
// */
// public int getSpeed()
// {
// int spendTime = (int) (end_time - begin_time);
// return downloadSize / spendTime;
// }
@Override
public String toString()
{
return "TestLog [begin_time=" + begin_time + ", end_time=" + end_time + ", downloadSize="
+ downloadSize + "]";
}
public static final Parcelable.Creator<TestLog> CREATOR = new Creator<TestLog>()
{
@Override
public TestLog createFromParcel(Parcel source)
{
TestLog log = new TestLog();
log.signal_strength = source.readInt(); // 移动信号强度:-110 - -50dB,值越大表示信号越好
log.download = source.readInt(); // 下载带宽, KB为单位
log.begin_time = source.readLong(); // 开始时间
log.end_time = source.readLong(); // 结束时间
return log;
}
@Override
public TestLog[] newArray(int size)
{
return new TestLog[size];
}
};
@Override
public int describeContents()
{
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags)
{
dest.writeInt(signal_strength); // 移动信号强度:-110 - -50dB,值越大表示信号越好
dest.writeInt(download); // 下载带宽, KB为单位
dest.writeLong(begin_time); // 开始时间
dest.writeLong(end_time); // 结束时间
}
}