|
|
|
|
@ -33,6 +33,7 @@ import com.rehome.dywoa.bleUtil.BluetoothLeService;
|
|
|
|
|
import com.rehome.dywoa.utils.GsonUtils;
|
|
|
|
|
import com.rehome.dywoa.utils.HttpListener;
|
|
|
|
|
import com.rehome.dywoa.utils.NoProgresshttpUtils;
|
|
|
|
|
import com.rehome.dywoa.utils.SPUtils;
|
|
|
|
|
import com.rehome.dywoa.utils.UiUtlis;
|
|
|
|
|
import com.rehome.dywoa.weiget.ListDialog;
|
|
|
|
|
import com.yolanda.nohttp.NoHttp;
|
|
|
|
|
@ -95,6 +96,9 @@ public class CJFragment extends BaseFragment {
|
|
|
|
|
private double bjsx = 0;//报警上限
|
|
|
|
|
private double bjxx = 0;//报警下限
|
|
|
|
|
|
|
|
|
|
private String deviceNameSave;
|
|
|
|
|
private String deviceAddressSave;
|
|
|
|
|
|
|
|
|
|
private BluetoothLeService mBluetoothLeService;
|
|
|
|
|
|
|
|
|
|
public CJFragment() {
|
|
|
|
|
@ -124,6 +128,8 @@ public class CJFragment extends BaseFragment {
|
|
|
|
|
findView();
|
|
|
|
|
et_jg.setEnabled(isEdit);
|
|
|
|
|
btn_selectCheckResult.setEnabled(isEdit);
|
|
|
|
|
deviceAddressSave = (String) SPUtils.get(context, Contans.KEY_BLUE_TOOTH_ADDRESS,"");
|
|
|
|
|
deviceNameSave = (String) SPUtils.get(context, Contans.KEY_BLUE_TOOTH_NAME,"");
|
|
|
|
|
updata(info, index, zj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -213,9 +219,51 @@ public class CJFragment extends BaseFragment {
|
|
|
|
|
if(isEdit){
|
|
|
|
|
if(!TextUtils.isEmpty(info.getPOINTNAME())){
|
|
|
|
|
if(info.getPOINTNAME().contains("温度")){
|
|
|
|
|
mBluetoothLeService.writeHex("0B0B6301");
|
|
|
|
|
new Handler().postDelayed(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
mBluetoothLeService.writeString("BV");
|
|
|
|
|
}
|
|
|
|
|
}, 3000);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测温")){
|
|
|
|
|
mBluetoothLeService.writeHex("0B0B6301");
|
|
|
|
|
new Handler().postDelayed(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
mBluetoothLeService.writeString("BV");
|
|
|
|
|
}
|
|
|
|
|
}, 3000);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("环境温度")){
|
|
|
|
|
mBluetoothLeService.writeHex("0B0B6300");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("环境测温")){
|
|
|
|
|
mBluetoothLeService.writeHex("0B0B6300");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("振动")){
|
|
|
|
|
mBluetoothLeService.writeHex("1F12");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("振动加速度")){
|
|
|
|
|
mBluetoothLeService.writeHex("1F11");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("振动速度")){
|
|
|
|
|
mBluetoothLeService.writeHex("1F12");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("振动位移")){
|
|
|
|
|
mBluetoothLeService.writeHex("1F13");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测振")){
|
|
|
|
|
mBluetoothLeService.writeHex("1F12");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测振加速度")){
|
|
|
|
|
mBluetoothLeService.writeHex("1F11");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测振速度")){
|
|
|
|
|
mBluetoothLeService.writeHex("1F12");
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测振位移")){
|
|
|
|
|
mBluetoothLeService.writeHex("1F13");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -394,12 +442,44 @@ public class CJFragment extends BaseFragment {
|
|
|
|
|
//et_jg.setText("正常");
|
|
|
|
|
if(isEdit){
|
|
|
|
|
if(!TextUtils.isEmpty(info.getPOINTNAME())){
|
|
|
|
|
if(!TextUtils.isEmpty(deviceNameSave) && !TextUtils.isEmpty(deviceAddressSave)){
|
|
|
|
|
if(info.getPOINTNAME().contains("温度")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测温")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("环境温度")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("环境测温")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("振动")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("振动加速度")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("振动速度")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("振动位移")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测振")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测振加速度")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测振速度")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if(info.getPOINTNAME().contains("测振位移")){
|
|
|
|
|
btn_cj.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
|