完善并提交最终版本

master
XF1001 4 years ago
parent c1fde1dc4e
commit 8f6bbbc4f7

@ -54,7 +54,7 @@ public class AddCameraActivity extends Activity implements OnClickListener,AddCa
private EditText pwdEdit = null;
private EditText didEdit = null;
private TextView textView_top_show = null;
private Button done;
private Button button_conn;
private static final int SEARCH_TIME = 3000;
private int option = ContentCommon.INVALID_OPTION;
private int CameraType = ContentCommon.CAMERA_TYPE_MJPEG;
@ -134,7 +134,7 @@ public class AddCameraActivity extends Activity implements OnClickListener,AddCa
Thread.sleep(100);
} catch (Exception e) {
}
if(SystemValue.deviceId.toLowerCase().startsWith("vsta"))
{
NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
@ -278,7 +278,7 @@ public class AddCameraActivity extends Activity implements OnClickListener,AddCa
}
private void InitParams() {
done.setOnClickListener(this);
button_conn.setOnClickListener(this);
btnSearchCamera.setOnClickListener(this);
//监听软键盘的删除键
userEdit.setOnKeyListener(new View.OnKeyListener() {
@ -329,7 +329,7 @@ public class AddCameraActivity extends Activity implements OnClickListener,AddCa
}
progressdlg.dismiss();
NativeCaller.StopSearch();
}
@Override
@ -353,7 +353,7 @@ public class AddCameraActivity extends Activity implements OnClickListener,AddCa
updateListHandler.sendMessage(msg);
}
};
Handler updateListHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
@ -403,7 +403,7 @@ public class AddCameraActivity extends Activity implements OnClickListener,AddCa
Toast.makeText(AddCameraActivity.this,
getResources().getString(R.string.add_search_no),
Toast.LENGTH_LONG).show();
isSearched = false;//
isSearched = false;//
}
}
}
@ -431,7 +431,7 @@ public class AddCameraActivity extends Activity implements OnClickListener,AddCa
textView_top_show = (TextView) findViewById(R.id.login_textView1);
button_play = (Button) findViewById(R.id.play);
button_setting = (Button) findViewById(R.id.setting);
done = (Button) findViewById(R.id.done);
button_conn = (Button) findViewById(R.id.done);
//done.setText("连接");
userEdit = (EditText) findViewById(R.id.editUser);
@ -841,7 +841,7 @@ public class AddCameraActivity extends Activity implements OnClickListener,AddCa
}
}
private String spitValue(String name, String tag) {
public String spitValue(String name, String tag) {
String[] strs = name.split(";");
for (int i = 0; i < strs.length; i++) {
String str1 = strs[i].trim();

@ -207,7 +207,7 @@ public class BridgeService extends Service
break;
case ContentCommon.MSG_TYPE_SET_ALARM:
if (alarmInterface != null) {
// Log.d(TAG,"user result:"+result+" paramType:"+paramType);
Log.d(TAG,"user result:"+result+" paramType:"+paramType);
alarmInterface.callBackSetSystemParamsResult(did, paramType,result);
}
break;
@ -1313,7 +1313,6 @@ public class BridgeService extends Service
// 联动摄像机取消报警
if (sensoraction == ContentCommon.SENSOR_ALARM_ACTION_CANCELALARM)
{
}
if (selfcmd == ContentCommon.SENSOR_ALARM_ACTION_ALARM&& sensoraction == 8)
@ -1371,7 +1370,7 @@ public class BridgeService extends Service
}
//add start by ydzhu 2017-11-20 增加tf卡播放下载接口
//增加tf卡播放下载接口
public void CallBack_TFCardPlayback(String did, byte[] yuv, int type,
int size,int width,int height, int timestamp,float pos,float cachePOS) {
@ -1385,13 +1384,11 @@ public class BridgeService extends Service
public void CallBack_TFCardRecord(String did, float pos,int nError) {
}
//add end
public void CallBack_LowpowerDevMag(String did,int nState) {
}
//start vuid
/**
(sdk0x1240使SearchResult)
@param sysVer:
@ -1415,7 +1412,6 @@ public class BridgeService extends Service
}
//start vuid by dunn 2019-10-22
/**
StartVUID
@param did: UID

@ -123,7 +123,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
private static final String HANDLE_THREAD_NAME = "cameraBackground";
/**定时处理检测消息的Handler和timer*/
protected Handler timeHandler;
private Handler timeHandler;
Timer timer4Fatigue = null;
Timer timer4Nod = null;
Timer timer4Init = null;
@ -257,9 +257,9 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
private static final float MINIMUM_CONFIDENCE_TF_OD_API = 0.6f;
private static final int AUDIO_BUFFER_START_CODE = 0xff00ff;
//surfaceView控键
/**surfaceView控键*/
private GLSurfaceView playSurface = null;
//GLSurfaceView的渲染器
/**GLSurfaceView的渲染器*/
private MyRender myRender;
/**
* videodata
@ -284,9 +284,9 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
private boolean bInitCameraParam = false;
private boolean bManualExit = false;
private TextView textosd = null;
private String strName = null;
private String strDID = null;
private TextView textosd = null;//顶部textView显示用户名的
private String strName = null;//用户名
private String strDID = null;//设备id
private View osdView = null;
private boolean bDisplayFinished = true;
private CustomBuffer AudioBuffer = null;
@ -298,10 +298,10 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
private ImageView videoViewStandard;
//底部控件声明
private HorizontalScrollView bottomView;
//下面是一系列功能按钮
private ImageButton ptzAudio, ptztalk, ptzDefaultSet, ptzBrightness, ptzContrast, ptzTake_photos, ptzTake_vodeo, ptzResolutoin, preset;
private int nStreamCodecType;//分辨率格式
private PopupWindow controlWindow;//设备方向控制提示控件
private PopupWindow mPopupWindowProgress;//进度条控件
private PopupWindow presetBitWindow;//预置位面板
@ -358,7 +358,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
private int picNum = 0;//拍照张数标识
/**
* @Description 退
* @Throws
* @Throws
* NullPointerException dialog
*/
public void showSureDialog() {
@ -385,6 +385,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
builder.show();
}
/**设置灯与警笛的视图(改软件系统的摄像头无法配置)*/
@SuppressLint("HandlerLeak")
private Handler deviceParamsHandler = new Handler() {
public void handleMessage(Message msg) {
@ -432,6 +433,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
int disPlaywidth;
private Bitmap mBmp;
//传输视频流回调的Handler
@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
@ -651,7 +653,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
private Handler msgHandler = new Handler() {
public void handleMessage(Message msg) {
if (msg.what == 1) {
//Log.d("tag", "断线了");
Log.d("tag", "断线了");
Toast.makeText(getApplicationContext(),
R.string.pppp_status_disconnect, Toast.LENGTH_SHORT)
.show();
@ -662,10 +664,6 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
//视频流帧池,存储视频流,保证以一个稳定的帧数输出
private VideoFramePool framePool;
/**
*
* @param savedInstanceState
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -675,7 +673,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.play);
//mine
//设置音频播放器
onCompletionListener = new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
@ -690,9 +688,10 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
alarmPlayer.start();
isAlarming = true;
showToast(R.string.initing);
//脸部框图初始化
mFaceRect = new DrawCaptureRect(getApplicationContext(),
190, 10, 1, 1, getResources().getColor(R.color.color_green));
//在一个activity上面添加额外的content
//在一个activity上面添加额外的content(脸部框图)
addContentView(mFaceRect, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT));
try {
classifier = TensorFlowObjectDetectionAPIModel.create(
@ -730,7 +729,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
showBottom();
//灯与警笛
//灯与警笛(改软件系统的摄像头无法配置)
if (SystemValue.supportLightAndSirenO13AndO10(MySharedPreferenceUtil.getSystemVer(this, strDID))) {
getLightAndSirenStatte(strDID, SystemValue.devicePass);
lightBtn.setVisibility(View.VISIBLE);
@ -790,6 +789,9 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
NativeCaller.PPPPCameraControl(strDID, 16, Resolution);
}
/**
*
*/
private void findView() {
//方向控制提示框
initControlDailog();
@ -857,7 +859,6 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
@Override
public boolean onTouch(View v, MotionEvent event) {
if (!isDown) {
x1 = event.getX();
y1 = event.getY();
@ -871,7 +872,6 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
originalScale = getScale();
break;
case MotionEvent.ACTION_POINTER_UP:
break;
case MotionEvent.ACTION_UP:
if (Math.abs((x1 - x2)) < 25 && Math.abs((y1 - y2)) < 25) {
@ -914,38 +914,12 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
private Matrix matrix = new Matrix();
private Matrix savedMatrix = new Matrix();
private PointF start = new PointF();
private PointF mid = new PointF();
float mMaxZoom = 2.0f;
float mMinZoom = 0.3125f;
float originalScale;
float baseValue;
protected Matrix mBaseMatrix = new Matrix();
protected Matrix mSuppMatrix = new Matrix();
private Matrix mDisplayMatrix = new Matrix();
private final float[] mMatrixValues = new float[9];
protected void zoomTo(float scale, float centerX, float centerY) {
Log.d("zoomTo", "zoomTo scale:" + scale);
if (scale > mMaxZoom) {
scale = mMaxZoom;
} else if (scale < mMinZoom) {
scale = mMinZoom;
}
float oldScale = getScale();
float deltaScale = scale / oldScale;
Log.d("deltaScale", "deltaScale:" + deltaScale);
mSuppMatrix.postScale(deltaScale, deltaScale, centerX, centerY);
videoViewStandard.setScaleType(ImageView.ScaleType.MATRIX);
videoViewStandard.setImageMatrix(getImageViewMatrix());
}
protected Matrix getImageViewMatrix() {
mDisplayMatrix.set(mBaseMatrix);
mDisplayMatrix.postConcat(mSuppMatrix);
return mDisplayMatrix;
}
protected float getScale(Matrix matrix) {
return getValue(matrix, Matrix.MSCALE_X);
}
@ -959,30 +933,13 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
return mMatrixValues[whichValue];
}
/*private float (MotionEvent event) {
try {
float x = event.getX(0) - event.getX(1);
float y = event.getY(0) - event.getY(1);
return FloatMath.sqrt(x * x + y * y);
} catch (Exception e) {
}
return 0;
}*/
private void midPoint(PointF point, MotionEvent event) {
float x = event.getX(0) + event.getX(1);
float y = event.getY(0) + event.getY(1);
point.set(x / 2, y / 2);
}
@Override
public boolean onDown(MotionEvent e) {
Log.d("tag", "onDown");
return false;
}
private final int MINLEN = 80;//最小间距
private final int MINLEN = 80;//滑动的最小间距
private Animation showTopAnim;
private Animation dismissTopAnim;
private boolean isPTZPrompt;
@ -1033,7 +990,6 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
@Override
public void onShowPress(MotionEvent e) {
}
@Override
@ -1041,22 +997,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
return false;
}
public void showSureDialogPlay() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setIcon(R.drawable.app);
builder.setTitle(getResources().getString(R.string.exit_show));
builder.setMessage(R.string.exit_play_show);
builder.setPositiveButton(R.string.str_ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
PlayActivity.this.finish();
}
});
builder.setNegativeButton(R.string.str_cancel, null);
builder.show();
}
/**下方按钮的按键响应*/
@Override
public void onClick(View v) {
switch (v.getId()) {
@ -1276,9 +1217,8 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
}
}
/*
*
/**
*
*/
private class ControlDeviceTask extends AsyncTask<Void, Void, Integer> {
private int type;
@ -1354,7 +1294,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
isControlDevice = false;
if (controlWindow != null && controlWindow.isShowing())
controlWindow.dismiss();
//mine
//每次摄像头朝向改变,需要重新开启定时器,重新初始化
stopBackgroundThread();
reInitPosition();
makeInitAlarm(3);
@ -1362,7 +1302,9 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
}
}
/**
*
*/
private void reInitPosition() {
initPosition = true;
fail2Init = false;
@ -1978,7 +1920,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
public static Map<String, Map<Object, Object>> reslutionlist = new HashMap<String, Map<Object, Object>>();
/**
* reslution
* reslution Handler
*/
private void addReslution(String mess, boolean isfast) {
if (reslutionlist.size() != 0) {
@ -2014,7 +1956,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
}
}
/*
/**
* @param type
*
*/
@ -2076,16 +2018,18 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
@Override
protected synchronized void onDestroy() {
NativeCaller.StopPPPPLivestream(strDID);
StopAudio();
StopTalk();
stopTakevideo();
//mine
releaseAll();
classifier.close();
NativeCaller.StopPPPPLivestream(strDID);//提示摄像头停止传输视频流
StopAudio();//停止播放音频
StopTalk();//停止对讲
stopTakevideo();//停止录像
releaseAll();//释放定时器和tenginekit面部检测模型
classifier.close();//关闭tensorflow的分类器模型
super.onDestroy();
}
/**
* tenginekit
*/
public void releaseAll() {
timeHandler.removeMessages(INIT_MSG);
timeHandler.removeMessages(FATIGUE_MSG);
@ -2111,8 +2055,11 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
}
/***
* BridgeService callback
*
* BridgeService callback
* @Param didid
* @Param brightness
* @Param constrat
* @Param flip使
* **/
@Override
public void callBackCameraParamNotify(String did, int resolution,
@ -2127,12 +2074,11 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
/**
*
*
* @param videobuf
* @param h264Data
* @param len
* @param width
* @param height
* @param videobuf
* @param h264Data h264
* @param len
* @param width
* @param height
*/
@Override
public void callBackVideoData(final byte[] videobuf, int h264Data, int len, int width, int height) {
@ -2143,7 +2089,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
previewHeight = height;
try {
if (mNV21Bytes == null) {
Init();
Init();//初始化tengineKit
}
} catch (final Exception e) {
Log.e(LOG_TAG, "callBackVideoData: " + e);
@ -2155,7 +2101,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
mNV21Bytes = videobuf;
}
};
processImage();
processImage();//调用检测函数
//mine
bDisplayFinished = false;
videodata = videobuf;
@ -2270,7 +2216,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
judgeEyesClose(faceAttr);
judgeYawn(faceAttr);
judgeNod(faceAttr);
judgeNotice(faceIrisInfo.get(0), faceAttr);
judgeAttention(faceIrisInfo.get(0), faceAttr);
}
} else {
if (notDetectFrame >= 50) {
@ -2294,7 +2240,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
mFaceRect.invalidate();
}
}
//初始化人脸检测的有关参数
private void initParams() {
totalFrameNumber = 0;
twiceTimes = 2;
@ -2317,9 +2263,8 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
}
/**
* 姿
*
* @param faceAttr
* 姿
* @param faceAttr
*/
private void initHeadPosition(FaceLandmarkInfo faceAttr) {
totalPitch = totalPitch + faceAttr.pitch;
@ -2330,8 +2275,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
/**
*
*
* @param faceAttr
* @param faceAttr
*/
private void judgeEyesClose(FaceLandmarkInfo faceAttr) {
if (initPosition) return;
@ -2347,8 +2291,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
/**
*
*
* @param faceAttr
* @param faceAttr
*/
private void judgeYawn(FaceLandmarkInfo faceAttr) {
if (initPosition) return;
@ -2402,8 +2345,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
/**
* 姿
*
* @param faceAttr
* @param faceAttr
*/
private void judgeNod(FaceLandmarkInfo faceAttr) {
if (initPosition) return;
@ -2416,10 +2358,10 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
/**
* 线
*
* @param faceIrisInfo
* @param faceIrisInfo
* @param faceAttr
*/
private void judgeNotice(FaceIrisInfo faceIrisInfo, FaceLandmarkInfo faceAttr) {
private void judgeAttention(FaceIrisInfo faceIrisInfo, FaceLandmarkInfo faceAttr) {
if (initPosition) return;
if (isEyesClose) {
loseNoticeFrame = 0;
@ -2429,7 +2371,6 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
TenginekitPoint leftCorner = faceIrisInfo.leftEye.eyeLandmark.get(8);
TenginekitPoint leftOuterCorner = faceIrisInfo.leftEye.eyeLandmark.get(0);
float deviation = (leftCenter.X - leftOuterCorner.X) / (leftCorner.X - leftOuterCorner.X);
//Log.d(LOG_TAG, "judgeNotice: devuation" + Float.toString(deviation));
if (deviation < noticeThreshold1 || deviation > noticeThreshold2 || Math.abs(faceAttr.yaw - normalYaw) > 20) {
loseNoticeFrame = loseNoticeFrame + 1;
} else {
@ -2441,7 +2382,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
}
}
//发出初始化提示
//发出初始化提示警报
public void makeInitAlarm(int flag) {
if (isAlarming) return;
if (alarmPlayer != null) {
@ -2476,7 +2417,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
break;
}
}
//发出未检测到人的警报
public void makenotDetectFrameAlarm() {
if (isAlarming || initPosition) return;
if (alarmPlayer != null) {
@ -2564,7 +2505,28 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
alarmPlayer.start();
isAlarming = true;
}
//发出使用手机的警报
public void makePhoneAlarm() {
if (isAlarming || initPosition) return;
if (alarmPlayer != null) {
alarmPlayer.release();
}
alarmPlayer = MediaPlayer.create(this, R.raw.phone);
alarmPlayer.setOnCompletionListener(onCompletionListener);
alarmPlayer.start();
isAlarming = true;
}
//发出吸烟的警报
public void makeSmokingAlarm() {
if (isAlarming || initPosition) return;
if (alarmPlayer != null) {
alarmPlayer.release();
}
alarmPlayer = MediaPlayer.create(this, R.raw.smoke);
alarmPlayer.setOnCompletionListener(onCompletionListener);
alarmPlayer.start();
isAlarming = true;
}
//重置疲劳检测的有关参数
private void reSetParameter() {
totalFrameNumber = 0;
@ -2580,7 +2542,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
@Override
public synchronized void onResume() {
super.onResume();
handleTimeMsg();
handleTimeMsg();//开启定时器
}
@Override
@ -2588,7 +2550,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
stopBackgroundThread();
super.onPause();
}
//定时处理监控信息,判定疲劳和偏头行为
public void handleTimeMsg() {
timeHandler = new Handler(new Handler.Callback() {
@Override
@ -2689,8 +2651,8 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
* **/
@Override
public void callBackMessageNotify(String did, int msgType, int param) {
Log.d("tag", "MessageNotify did: " + did + " msgType: " + msgType
+ " param: " + param);
/*Log.d("tag", "MessageNotify did: " + did + " msgType: " + msgType
+ " param: " + param);*/
if (bManualExit)
return;
@ -2772,11 +2734,9 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
}
/**
* r
*
*
* @param did
* @param pwd
* @param didid
* @param pwd
*/
public static void getLightAndSirenStatte(String did, String pwd) {
NativeCaller.TransferMessage(did, "trans_cmd_string.cgi?cmd=2109&command=2" + "&loginuse=" + "admin" + "&loginpas=" + pwd, 1);
@ -2804,6 +2764,8 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
private void stopBackgroundThread() {
if(backgroundHandler == null)
return ;
backgroundThread.quitSafely();
try {
backgroundThread.join();
@ -2834,7 +2796,7 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
};
/**
* tensorFlow
* tensorFlow使
*/
private void classifyFrame() {
if (classifier == null || initPosition || videodata == null) {
@ -2852,15 +2814,14 @@ public class PlayActivity extends Activity implements OnTouchListener,OnGestureL
final RectF location = result.getLocation();
if (location != null && result.getConfidence() >= MINIMUM_CONFIDENCE_TF_OD_API) {
if (result.getTitle().equals("phone")) {
;
makePhoneAlarm();
} else if (result.getTitle().equals("smoke")) {
;
} else if (result.getTitle().equals("safety belt")) {
;
makeSmokingAlarm();
}
}
}
}
//改变Bitmap的大小使其适应tensorflow的模型
private Bitmap changeBitmapSize(Bitmap bitmap) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();

@ -13,12 +13,6 @@ import android.view.WindowManager;
import android.widget.Button;
import android.widget.RelativeLayout;
/**
*
* @author
*
*/
public class SettingActivity extends Activity implements OnClickListener
{

@ -69,7 +69,7 @@ public class SettingAlarmActivity extends BaseActivity implements
motionAlermView.setVisibility(View.GONE);
} else {
cbxMotionAlerm.setChecked(true);
cbxMotionAlarm.setChecked(true);
motionAlermView.setVisibility(View.VISIBLE);
}
tvSensitivity.setText(String.valueOf(alermBean
@ -89,7 +89,7 @@ public class SettingAlarmActivity extends BaseActivity implements
private TextView tvSensitivity = null;
private CheckBox cbxMotionAlerm = null;
private CheckBox cbxMotionAlarm = null;
private AlermBean alermBean = null;
private PopupWindow sensitivePopWindow = null;
@ -142,7 +142,7 @@ public class SettingAlarmActivity extends BaseActivity implements
btnOk.setOnClickListener(this);
btnCancel.setOnClickListener(this);
imgSensitiveDrop.setOnClickListener(this);
cbxMotionAlerm.setOnCheckedChangeListener(this);
cbxMotionAlarm.setOnCheckedChangeListener(this);
scrollView.setOnTouchListener(this);
progressDialog.setOnKeyListener(new OnKeyListener() {
@Override
@ -161,7 +161,7 @@ public class SettingAlarmActivity extends BaseActivity implements
public void onClick(View v) {
switch (v.getId()) {
case R.id.alerm_ok:
setAlerm();
setAlarm();
break;
case R.id.alerm_cancel:
finish();
@ -229,7 +229,7 @@ public class SettingAlarmActivity extends BaseActivity implements
}
}
private void setAlerm() {
private void setAlarm() {
if (successFlag) {
Log.e("setAlerm", "setAlermTemp: " + alermBean.getAlarm_temp());
NativeCaller.PPPPAlarmSetting(strDID, alermBean.getAlarm_audio(),
@ -264,7 +264,7 @@ public class SettingAlarmActivity extends BaseActivity implements
private void findView() {
cbxMotionAlerm = (CheckBox) findViewById(R.id.alerm_cbx_move_layout);
cbxMotionAlarm = (CheckBox) findViewById(R.id.alerm_cbx_move_layout);
tvSensitivity = (TextView) findViewById(R.id.alerm_tv_sensitivity);

@ -32,7 +32,7 @@ import android.widget.Toast;
public class SettingUserActivity extends Activity implements OnCheckedChangeListener, OnClickListener,UserInterface{
private boolean successFlag=false;
private int CAMERAPARAM=0xffffffff;//״̬
private int CAMERAPARAM=0xffffffff;
private final int TIMEOUT=3000;
private final int FAILED=0;
private final int SUCCESS=1;

@ -4,9 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import com.ipcamer.detect.R;
import android.content.Context;

@ -6,9 +6,6 @@ import java.util.List;
import java.util.Map;
import com.ipcamer.detect.R;
import com.ipcamer.detect.R.drawable;
import com.ipcamer.detect.R.id;
import com.ipcamer.detect.R.layout;
import com.ipcamera.detect.utils.ContentCommon;
import android.content.Context;

@ -1,7 +1,6 @@
package com.ipcamera.detect.adapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import com.ipcamer.detect.R;
@ -13,7 +12,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
public class SensorListAdapter extends BaseAdapter{

@ -7,12 +7,10 @@ import java.util.Map;
import com.ipcamer.detect.R;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

@ -3,10 +3,6 @@ package com.ipcamera.detect.adapter;
import java.util.ArrayList;
import com.ipcamer.detect.R;
import com.ipcamer.detect.R.drawable;
import com.ipcamer.detect.R.id;
import com.ipcamer.detect.R.layout;
import com.ipcamer.detect.R.string;
import com.ipcamera.detect.bean.WifiScanBean;
import android.content.Context;

@ -12,6 +12,5 @@ public class DefenseConstant {
public static String key_allAlarm="111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
public static String key_allDisAlarm="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
}

@ -1,10 +1,5 @@
package com.ipcamera.detect.bean;
/*
* vst on
* //
* //
*/
public class ErrorBean {
private int errorCode;
private String errorMsg;

@ -1,10 +1,5 @@
package com.ipcamera.detect.bean;
/*
* vst on 2017/5/5 14:03
* //
* //
*/
public class JsonBean {
private int code;
private String json;

@ -1,10 +1,5 @@
package com.ipcamera.detect.bean;
/*
* vst on 2017/10/30 17:22
* //
* //
*/
public class PushBindDeviceBean {
private String uid;
private String token;

@ -1,10 +1,5 @@
package com.ipcamera.detect.bean;
/*
* vst on
* //
* //
*/
public class SetLanguageBean {
private String uid;
private String token;

@ -3,9 +3,6 @@ package com.ipcamera.detect.bean;
import java.io.Serializable;
public class SwitchBean implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String motion_record_plan_enable; //移动侦测录像计划
private String motion_push_plan_enable; //移动侦测推送计划

@ -3,9 +3,6 @@ package com.ipcamera.detect.bean;
import java.io.Serializable;
public class WifiScanBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String did;
private String ssid;

@ -4,11 +4,6 @@ package com.ipcamera.detect.net;
import com.ipcamera.detect.bean.ErrorBean;
import com.ipcamera.detect.bean.JsonBean;
/*
* vst on 2017/9/28 18:21
* //
* //
*/
public abstract interface ApiCallBack {
void onFinish(JsonBean bean);
void onError(ErrorBean bean);

@ -1,10 +1,5 @@
package com.ipcamera.detect.net;
/*
* vst on 2017/10/30 17:39
* //
* //
*/
public class HttpConstances {
//public static final String BASE_SERVICE_URL = "https://api.eye4.cn"; //正式 http://push2.eye4.cn:3000/binding
public static final String BASE_SERVICE_URL="http://push2.eye4.cn:3000";

@ -18,11 +18,6 @@ import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/*
* vst on 2017/9/28 16:39
* //
* //
*/
public class HttpHelper {
public static final String TAG = "OkHttpHelper";
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");

@ -1,7 +1,5 @@
package com.ipcamera.detect.net;
import com.ipcamera.detect.bean.ErrorBean;
import com.ipcamera.detect.bean.JsonBean;
import com.ipcamera.detect.utils.GsonUtils;
@ -10,12 +8,6 @@ import com.ipcamera.detect.utils.StringUtils;
import okhttp3.Request;
/*
* vst on 2017/9/28 17:37
* //
* //
*/
public class VcmApi {
private static VcmApi api;

@ -55,7 +55,7 @@ public class VideoFramePool extends Thread {
if (frameData != null) {
this.myRender.writeSample(frameData,mframeSize,mWidth,mHeight);
}
Log.e("pool","poolsize "+framePool.size() +"frameRate***"+frameRate);
Log.e("pool","poolsize "+framePool.size() +"frameRate***"+frameRate);
try {
endDate = System.currentTimeMillis();
if (frameRate == 10) {

@ -3,7 +3,7 @@
<string name="path">/sdcard/test0.mp4</string>
<!-- 应用程序 -->
<string name="app_name">Driving reminder assistant</string>
<string name="app_name">ReminderAssistant</string>
<string name="camera_user">username</string>
<string name="version_code">version number</string>
<string name="soft_name">software name</string>

@ -0,0 +1,29 @@
package com.ipcamera.detect.utils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class VuidUtilsTest {
@Before
public void setUp() throws Exception {
System.out.println("测试开始:");
}
@After
public void tearDown() throws Exception {
System.out.println("测试结束!");
}
@Test
public void isVuidTest(){
assertTrue(VuidUtils.isVuid("VSTK0914947LLBPL"));
assertFalse(VuidUtils.isVuid("VSTK091497LLBPL"));
assertFalse(VuidUtils.isVuid("VSTK09ss497LLBPL"));
assertFalse(VuidUtils.isVuid("VSTK0914975453"));
assertFalse(VuidUtils.isVuid("0914975453LLBPL"));
}
}
Loading…
Cancel
Save