[6.0.0] log

This commit is contained in:
zhongchao
2023-08-24 11:16:26 +08:00
parent 4beb4a3532
commit c377ecc260
94 changed files with 2677 additions and 834 deletions

View File

@@ -40,7 +40,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
@Override
public void handlerMessage(V2XMessageEntity v2XMessageEntity) {
CallerLogger.INSTANCE.d(M_V2X + TAG, "处理V2X场景" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString()));
CallerLogger.d(M_V2X + TAG, "处理V2X场景" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString()));
try {
synchronized (V2XScenarioManager.class) {
// 展示
@@ -66,7 +66,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
default:
mV2XScenario = null;
CallerLogger.INSTANCE.e(M_V2X + TAG, "当前V2X消息类型未定义:" + v2XMessageEntity);
CallerLogger.e(M_V2X + TAG, "当前V2X消息类型未定义:" + v2XMessageEntity);
return;
}
// 展示最新的消息

View File

@@ -63,7 +63,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat();
MarkerRemoveManager.INSTANCE.addMarker(new MarkerWrapper(id, entity.getLocation().getLon(), entity.getLocation().getLat(), 0, markers, null, null));
} else {
CallerLogger.INSTANCE.d(M_V2X + "RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker");
CallerLogger.d(M_V2X + "RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker");
}
}
}

View File

@@ -50,7 +50,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
@Override
public void init(@Nullable V2XMessageEntity v2XMessageEntity) {
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- init -----:\n" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString()));
CallerLogger.d(M_V2X + TAG, "----- init -----:\n" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString()));
try {
setV2XMessageEntity(v2XMessageEntity);
if (v2XMessageEntity != null && v2XMessageEntity.getContent() instanceof V2XWarningTarget) {
@@ -64,9 +64,9 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
@Override
public void show() {
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 1 --:\n" + (mMarkerEntity == null ? "null" : mMarkerEntity.toString()));
CallerLogger.d(M_V2X + TAG, "----- show --- 1 --:\n" + (mMarkerEntity == null ? "null" : mMarkerEntity.toString()));
if (mMarkerEntity != null) {
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
CallerLogger.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
String v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
V2XMessageEntity entity = getV2XMessageEntity();
if (!v2xType.equals("0")) {
@@ -126,13 +126,13 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
IV2XMarker marker = getV2XMarker();
if (marker != null && mMarkerEntity != null) {
marker.drawPOI(mMarkerEntity);
CallerLogger.INSTANCE.d(M_V2X + TAG, "drawPOI");
CallerLogger.d(M_V2X + TAG, "drawPOI");
}
}
@Override
public void clearPOI() {
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- clearPOI -----");
CallerLogger.d(M_V2X + TAG, "----- clearPOI -----");
}
@Override

View File

@@ -59,12 +59,12 @@
// @Override
// public void drawPOI(Object entity) {
// try {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "===drawPOI");
// CallerLogger.d(M_V2X + TAG, "===drawPOI");
// mCloundWarningInfo = (V2XWarningTarget) entity;
// drawLineWithEntity();
//
// } catch (Exception e) {
// CallerLogger.INSTANCE.d(M_V2X + TAG, e.toString());
// CallerLogger.d(M_V2X + TAG, e.toString());
// }
//
// }
@@ -115,14 +115,14 @@
// //衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
// //handleStopLine();
// }, 0);
// CallerLogger.INSTANCE.d(M_V2X + TAG, "显示时间为++" + showTime + "识别物类型:" +
// CallerLogger.d(M_V2X + TAG, "显示时间为++" + showTime + "识别物类型:" +
// String.valueOf(mCloundWarningInfo.getType()));
//
// } else { //无停止线
// CallerLogger.INSTANCE.d(M_V2X + TAG, "无停止线");
// CallerLogger.d(M_V2X + TAG, "无停止线");
// WorkThreadHandler.getInstance().postDelayed(() -> {
// /* 衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
// CallerLogger.INSTANCE.d(M_V2X + TAG, "无停止线" + mCloundWarningInfo.toString());
// CallerLogger.d(M_V2X + TAG, "无停止线" + mCloundWarningInfo.toString());
// //绘制识别物与交汇点连线,并且更新连线数据
// drawOtherObjectLine(mCloundWarningInfo);
// //二轮车和行人的渲染和移动
@@ -130,7 +130,7 @@
// if (carLocation.lat != 0 && carLocation.lon != 0) {
// drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
// } else {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "数据为空carLocation == null");
// CallerLogger.d(M_V2X + TAG, "数据为空carLocation == null");
// }
// */
// Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).renderWarningMoveMarker(mCloundWarningInfo.getLon()
@@ -153,7 +153,7 @@
// MogoLatLng startLatLng = new MogoLatLng(carLocation.lat, carLocation.lon);
// MogoLatLng endLatLng = new MogoLatLng(middleLocationInStopLine.lat, middleLocationInStopLine.lon);
// double angle = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
// CallerLogger.INSTANCE.d(M_V2X + TAG, "angle==" + String.valueOf(angle));
// CallerLogger.d(M_V2X + TAG, "angle==" + String.valueOf(angle));
// return angle;
// }
//
@@ -166,14 +166,14 @@
// startLatLng, MogoLatLng mogoLatLng) {
// if (info != null) {
// double angle = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, mogoLatLng.lon, mogoLatLng.lat);
// CallerLogger.INSTANCE.d(M_V2X + TAG, "angle==drawRedWarningLineFrontOfStopLine:" + String.valueOf(angle));
// CallerLogger.d(M_V2X + TAG, "angle==drawRedWarningLineFrontOfStopLine:" + String.valueOf(angle));
// IMoGoStopPolylineManager stopPolyLineMnager = BridgeApi.INSTANCE.v2xStopPolyline();
// if (stopPolyLineMnager != null) {
// IMogoPolyline polyLine = stopPolyLineMnager.getMogoStopPolyline();
// MogoLatLng endLatlng = new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon);
// MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatLng.lon, startLatLng.lat, 25, angle);
// if (polyLine != null) {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "drawStopLine polyLine != null");
// CallerLogger.d(M_V2X + TAG, "drawStopLine polyLine != null");
// polyLine.setPoints(Arrays.asList(startLatLng, addMiddleLoc, endLatlng));
// polyLine.setTransparency(0.5f);
// } else {
@@ -184,11 +184,11 @@
// locations.add(endLatlng);
// lineInfo.setLocations(locations);
// lineInfo.setHeading(info.getHeading());
// CallerLogger.INSTANCE.d(TAG, "drawStopLine width = " + info.getRoadwidth());
// CallerLogger.d(TAG, "drawStopLine width = " + info.getRoadwidth());
// lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
// stopPolyLineMnager.drawStopPolyline(BridgeApi.INSTANCE.context(), lineInfo);
// }
// CallerLogger.INSTANCE.d(M_V2X + TAG, "停止线前方50m区域的三个坐标点是:" + startLatLng.lon + "," + startLatLng.lat +
// CallerLogger.d(M_V2X + TAG, "停止线前方50m区域的三个坐标点是:" + startLatLng.lon + "," + startLatLng.lat +
// "中间点坐标:" + addMiddleLoc.lon + "," + addMiddleLoc.lat
// + "终点" + endLatlng.lon + "," + endLatlng.lat);
// }
@@ -199,7 +199,7 @@
//
// public void clearAllLine() {
// UiThreadHandler.postDelayed(() -> {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "清除所有预警线的时间是:" + String.valueOf(showTime));
// CallerLogger.d(M_V2X + TAG, "清除所有预警线的时间是:" + String.valueOf(showTime));
// //清除识别物到碰撞点预警线
// IMoGoPersonWarnPolylineManager personStopPolyLineManager = BridgeApi.INSTANCE.v2xPersonWarnPolyline();
// if (personStopPolyLineManager != null) {
@@ -251,10 +251,10 @@
// }
// fillPoints.add(y);
// } else {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "停止线数据不存在");
// CallerLogger.d(M_V2X + TAG, "停止线数据不存在");
// }
// } catch (Exception e) {
// CallerLogger.INSTANCE.e(M_V2X + TAG, "exception : " + e);
// CallerLogger.e(M_V2X + TAG, "exception : " + e);
// e.printStackTrace();
// }
// }
@@ -294,7 +294,7 @@
// * */
// private MogoLatLng getMiddleLocationInStopLine() {
// if (carLocation.lat == 0 || carLocation.lon == 0) {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "获取不到车的位置");
// CallerLogger.d(M_V2X + TAG, "获取不到车的位置");
// }
// MogoLatLng newLocation = new MogoLatLng(0, 0);
// if (mCloundWarningInfo != null && mCloundWarningInfo.getStopLines() != null && mCloundWarningInfo.getStopLines().size() > 1) {
@@ -304,7 +304,7 @@
// double angle = Trigonometric.getAngle(x.getLat(), x.getLat(), y.getLon(), y.getLat());
// newLocation = Trigonometric.getNewLocation(x.getLon(), x.getLat(), distance * 0.5, angle);
// } else {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "停止线返回坐标点数量不正确" + mCloundWarningInfo.getStopLines().size());
// CallerLogger.d(M_V2X + TAG, "停止线返回坐标点数量不正确" + mCloundWarningInfo.getStopLines().size());
// }
// return newLocation;
// }
@@ -316,7 +316,7 @@
// * lat 自车纬度
// */
// public void drawSelfCarLine(double lon, double lat, float bearing) {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "drawSelfCarLine");
// CallerLogger.d(M_V2X + TAG, "drawSelfCarLine");
// if (!isSelfLineClear) {
// if (mCloundWarningInfo != null) {
// IMoGoWarnPolylineManager warnPolyLineManager = BridgeApi.INSTANCE.v2xWarnPolyline();
@@ -342,7 +342,7 @@
// //扩展点为了渐变色添加
// addMiddleLoc = Trigonometric.getNewLocation(startLatlng.getLon(), startLatlng.getLat(), distance / 2,
// Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
// CallerLogger.INSTANCE.d(M_V2X + TAG, "angle==扩展点为了渐变色添加:" +
// CallerLogger.d(M_V2X + TAG, "angle==扩展点为了渐变色添加:" +
// String.valueOf(Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat)));
// if (mogoPolyline != null) {
// mogoPolyline.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
@@ -360,9 +360,9 @@
// info.setHasStopLines(mCloundWarningInfo.getStopLines().size() > 0);
// }
// warnPolyLineManager.drawWarnPolyline(BridgeApi.INSTANCE.context(), info);
// CallerLogger.INSTANCE.d(M_V2X + TAG, "自车前方第一条线" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
// CallerLogger.d(M_V2X + TAG, "自车前方第一条线" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
// }
// CallerLogger.INSTANCE.d(M_V2X + TAG, "自车为起点绘制 自车;" + startLatlng.lon + "," + startLatlng.lat +
// CallerLogger.d(M_V2X + TAG, "自车为起点绘制 自车;" + startLatlng.lon + "," + startLatlng.lat +
// "中间扩展点" + addMiddleLoc.lon + "," + addMiddleLoc.lat + "终点:" + endLatlng.lon + "," + endLatlng.lat);
// } else {
// clearAllLine();
@@ -375,7 +375,7 @@
// */
// private void drawOtherObjectLine(V2XWarningTarget info) {
// if (info != null) {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "info != null");
// CallerLogger.d(M_V2X + TAG, "info != null");
// IMoGoPersonWarnPolylineManager personWarnPolylineManager = BridgeApi.INSTANCE.v2xPersonWarnPolyline();
// if (personWarnPolylineManager == null) {
// return;
@@ -387,7 +387,7 @@
// MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatlng.getLon(), startLatlng.getLat(), distance / 2,
// Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));//补点
// if (polyLine != null) {
// CallerLogger.INSTANCE.d(M_V2X + TAG, "目标物与碰撞点连线 != null");
// CallerLogger.d(M_V2X + TAG, "目标物与碰撞点连线 != null");
// polyLine.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
// polyLine.setTransparency(0.5f);
// } else {
@@ -402,10 +402,10 @@
// lineInfo.setHeading(info.getHeading());
// lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
// personWarnPolylineManager.drawPersonWarnPolyline(BridgeApi.INSTANCE.context(), lineInfo);
// CallerLogger.INSTANCE.d(M_V2X + TAG, "目标物与预碰撞点画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
// CallerLogger.d(M_V2X + TAG, "目标物与预碰撞点画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
// }
// } else {
// CallerLogger.INSTANCE.e(M_V2X + TAG, "info == null");
// CallerLogger.e(M_V2X + TAG, "info == null");
// clearAllLine();
// }
// }
@@ -415,14 +415,14 @@
// float distance = CoordinateUtils.calculateLineDistance(
// startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
// double rotate = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
// CallerLogger.INSTANCE.d(M_V2X + TAG, "添加小箭头--目标物与预碰撞点之间的距离是" + String.valueOf(distance));
// CallerLogger.d(M_V2X + TAG, "添加小箭头--目标物与预碰撞点之间的距离是" + String.valueOf(distance));
// if (distance > 5) {
// int count = (int) (distance / 5);
// for (int i = 0; i < count; i++) {
// MogoLatLng newLo = Trigonometric.getNewLocation(
// startLatLng.getLon(), startLatLng.getLat(), 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat));
// Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, new Double(rotate).intValue());
// CallerLogger.INSTANCE.d(M_V2X + TAG, "小箭头位置" + newLo);
// CallerLogger.d(M_V2X + TAG, "小箭头位置" + newLo);
// }
// }
//
@@ -441,6 +441,6 @@
// //衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
// //drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
// }
// CallerLogger.INSTANCE.d(M_V2X + TAG, "车辆行驶轨迹" + latLng.getLongitude() + "," + latLng.getLatitude());
// CallerLogger.d(M_V2X + TAG, "车辆行驶轨迹" + latLng.getLongitude() + "," + latLng.getLatitude());
// }
//}

View File

@@ -6,7 +6,6 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Handler
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
@@ -19,6 +18,8 @@ import com.mogo.eagle.core.data.deva.badcase.SubBagEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.zhidao.loglib.download.DownloadManager
@@ -116,7 +117,7 @@ class BadCaseManagerView @JvmOverloads constructor(
if(bagManagerList.size>0){
bagManagerEntity.reqType = 3
bagManagerEntity.keyReq = bagManagerList[0].key
Log.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
CallerLogger.i(M_DEVA+"sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
bagUploadDialog = BagUploadDialog(context)
@@ -237,24 +238,24 @@ class BadCaseManagerView @JvmOverloads constructor(
override fun onBagManagerResult(bagManager: BagManagerOuterClass.BagManager) {
super.onBagManagerResult(bagManager)
UiThreadHandler.post {
Log.i(TAG,"onBagManagerResult Start")
Log.i(TAG,"keyReq="+bagManager.keyReq)
Log.i(TAG,"reqType="+bagManager.reqType)
Log.i(TAG,"uploadCosResp stat="+bagManager.uploadCosResp.stat)
Log.i(TAG,"descReq description="+bagManager.descReq.description
CallerLogger.i(M_DEVA + TAG,"onBagManagerResult Start")
CallerLogger.i(M_DEVA + TAG,"keyReq="+bagManager.keyReq)
CallerLogger.i(M_DEVA + TAG,"reqType="+bagManager.reqType)
CallerLogger.i(M_DEVA + TAG,"uploadCosResp stat="+bagManager.uploadCosResp.stat)
CallerLogger.i(M_DEVA + TAG,"descReq description="+bagManager.descReq.description
+" audioUrl="+bagManager.descReq.audioUrl
+" reportBI="+bagManager.descReq.reportBI
+" hasAudio="+bagManager.descReq.hasAudio)
for(logBag in bagManager.bagsInfoRespList){
Log.i(TAG,"bagPath="+logBag.bagPath)
Log.i(TAG,"timestamp="+logBag.timestamp)
Log.i(TAG,"description="+logBag.description)
Log.i(TAG,"key="+logBag.key)
Log.i(TAG,"mergeStat="+logBag.mergeStat)
Log.i(TAG,"totalSize="+logBag.totalSize)
Log.i(TAG,"uploadStat="+logBag.uploadStat)
CallerLogger.i(M_DEVA + TAG,"bagPath="+logBag.bagPath)
CallerLogger.i(M_DEVA + TAG,"timestamp="+logBag.timestamp)
CallerLogger.i(M_DEVA + TAG,"description="+logBag.description)
CallerLogger.i(M_DEVA + TAG,"key="+logBag.key)
CallerLogger.i(M_DEVA + TAG,"mergeStat="+logBag.mergeStat)
CallerLogger.i(M_DEVA + TAG,"totalSize="+logBag.totalSize)
CallerLogger.i(M_DEVA + TAG,"uploadStat="+logBag.uploadStat)
}
Log.i(TAG,"onBagManagerResult End")
CallerLogger.i(M_DEVA + TAG,"onBagManagerResult End")
//获取空间使用信息
if(bagManager.reqType == 1){
@@ -367,7 +368,7 @@ class BadCaseManagerView @JvmOverloads constructor(
//执行下一个上传Bag命令
bagManagerEntity.reqType = 3
bagManagerEntity.keyReq = bagManagerList[0].key
Log.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
CallerLogger.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
}
}

View File

@@ -1,5 +1,7 @@
package com.zhjt.mogo_core_function_devatools.badcase.record;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.os.Environment;
@@ -164,8 +166,7 @@ public class RecordHelper {
mp3EncodeThread = new Mp3EncodeThread(resultFile, bufferSize, currentConfig);
mp3EncodeThread.start();
} catch (Exception e) {
// Log.e(e, TAG, e.getMessage());
CallerLogger.INSTANCE.d("$M_DEVA$TAG", e.getMessage());
CallerLogger.d(M_DEVA+TAG, e.getMessage());
}
}
@@ -176,14 +177,14 @@ public class RecordHelper {
AudioRecordThread() {
bufferSize = AudioRecord.getMinBufferSize(currentConfig.getSampleRate(),
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig()) * RECORD_AUDIO_BUFFER_TIMES;
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "record buffer size = %s", bufferSize);
CallerLogger.d("$M_DEVA$TAG", "record buffer size = %s", bufferSize);
audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, currentConfig.getSampleRate(),
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig(), bufferSize);
if (currentConfig.getFormat() == RecordConfig.RecordFormat.MP3) {
if (mp3EncodeThread == null) {
initMp3EncoderThread(bufferSize);
} else {
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread != null, 请检查代码");
CallerLogger.e("$M_DEVA$TAG", "mp3EncodeThread != null, 请检查代码");
}
}
}
@@ -205,7 +206,7 @@ public class RecordHelper {
private void startPcmRecorder() {
state = RecordState.RECORDING;
notifyState();
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "开始录制 Pcm");
CallerLogger.d("$M_DEVA$TAG", "开始录制 Pcm");
FileOutputStream fos = null;
try {
fos = new FileOutputStream(tmpFile);
@@ -223,7 +224,7 @@ public class RecordHelper {
if (state == RecordState.STOP) {
makeFile();
} else {
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "暂停!");
CallerLogger.i("$M_DEVA$TAG", "暂停!");
}
} catch (Exception e) {
notifyError("录音失败");
@@ -239,7 +240,7 @@ public class RecordHelper {
if (state != RecordState.PAUSE) {
state = RecordState.IDLE;
notifyState();
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "录音结束");
CallerLogger.d("$M_DEVA$TAG", "录音结束");
}
}
@@ -267,7 +268,7 @@ public class RecordHelper {
notifyState();
stopMp3Encoded();
} else {
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "暂停");
CallerLogger.d("$M_DEVA$TAG", "暂停");
}
}
}
@@ -282,7 +283,7 @@ public class RecordHelper {
}
});
} else {
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
CallerLogger.e("$M_DEVA$TAG", "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
}
}
@@ -301,7 +302,7 @@ public class RecordHelper {
break;
}
notifyFinish();
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "录音完成! path: %s 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
CallerLogger.i("$M_DEVA$TAG", "录音完成! path: %s 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
}
/**
@@ -353,7 +354,7 @@ public class RecordHelper {
inputStream.close();
}
} catch (Exception e) {
Log.e(TAG, e.getMessage());
CallerLogger.e(M_DEVA + TAG, e.getMessage());
return false;
} finally {
try {
@@ -376,7 +377,7 @@ public class RecordHelper {
private String getFilePath(String fileName) {
if (!FileUtils.createOrExistsDir(ROOT_PATH)) {
CallerLogger.INSTANCE.w("$M_DEVA$TAG", "文件夹创建失败:%s", ROOT_PATH);
CallerLogger.w("$M_DEVA$TAG", "文件夹创建失败:%s", ROOT_PATH);
return null;
}
@@ -387,7 +388,7 @@ public class RecordHelper {
private String getTempFilePath() {
if (!FileUtils.createOrExistsDir(TEMP_PATH)) {
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "文件夹创建失败:%s", TEMP_PATH);
CallerLogger.e("$M_DEVA$TAG", "文件夹创建失败:%s", TEMP_PATH);
}
String fileName = String.format(Locale.getDefault(), "tmp_%s", FileUtils.getNowString(new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.SIMPLIFIED_CHINESE)));
return String.format(Locale.getDefault(), "%s%s.pcm", TEMP_PATH, fileName);

View File

@@ -1,9 +1,11 @@
package com.zhjt.mogo_core_function_devatools.badcase.record.mp3;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
import android.media.MediaExtractor;
import android.media.MediaFormat;
import android.util.Log;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.FileUtils;
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordConfig;
@@ -34,7 +36,7 @@ public class Mp3Utils {
long duration = mf.getLong(MediaFormat.KEY_DURATION) / 1000L;
return duration;
} catch (IOException e) {
Log.e(TAG, e.getMessage());
CallerLogger.e(M_DEVA +TAG, e.getMessage());
} finally {
if (mex != null) {
mex.release();

View File

@@ -53,14 +53,14 @@ public class BaseFloatDialog extends Dialog {
@Override
public void show() {
CallerLogger.INSTANCE.d(TAG, "onShow====");
CallerLogger.d(TAG, "onShow====");
super.show();
setWindowSize();
}
@Override
public void dismiss() {
CallerLogger.INSTANCE.d( TAG, "onDismiss====");
CallerLogger.d( TAG, "onDismiss====");
super.dismiss();
}
private void setWindowSize(){

View File

@@ -142,7 +142,7 @@ public class RoundedDrawable extends Drawable {
drawable.draw(canvas);
} catch (Exception e) {
e.printStackTrace();
CallerLogger.INSTANCE.w(M_HMI + TAG, "Failed to create bitmap from drawable!");
CallerLogger.w(M_HMI + TAG, "Failed to create bitmap from drawable!");
bitmap = null;
}

View File

@@ -273,7 +273,7 @@ public class RoundedImageView extends AppCompatImageView {
try {
d = rsrc.getDrawable(mResource);
} catch (Exception e) {
CallerLogger.INSTANCE.w(M_HMI + TAG, "Unable to find resource : " + mResource + " exception : " + e);
CallerLogger.w(M_HMI + TAG, "Unable to find resource : " + mResource + " exception : " + e);
// Don't try again.
mResource = 0;
}
@@ -311,7 +311,7 @@ public class RoundedImageView extends AppCompatImageView {
try {
d = rsrc.getDrawable(mBackgroundResource);
} catch (Exception e) {
CallerLogger.INSTANCE.w(M_HMI + TAG, "Unable to find resource : " + mBackgroundResource + " exception : " + e);
CallerLogger.w(M_HMI + TAG, "Unable to find resource : " + mBackgroundResource + " exception : " + e);
// Don't try again.
mBackgroundResource = 0;
}

View File

@@ -53,7 +53,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
CallerLogger.INSTANCE.i(M_HMI + TAG, "onCreate");
CallerLogger.i(M_HMI + TAG, "onCreate");
}
@Override
@@ -99,7 +99,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
@Override
protected void loadOthersModules() {
super.loadOthersModules();
CallerLogger.INSTANCE.d(M_MAIN + TAG, "loadOthersModules");
CallerLogger.d(M_MAIN + TAG, "loadOthersModules");
loadOCHModule();
}
@@ -156,7 +156,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
paramIndexes = {0}
)
private void traceStartUp(String content) {
CallerLogger.INSTANCE.d(M_HMI + TAG, content);
CallerLogger.d(M_HMI + TAG, content);
}
@Override

View File

@@ -66,7 +66,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
}
private void initModules() {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "initModules");
CallerLogger.d(M_MAIN + TAG, "initModules");
// BIZ
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_FUNC_BIZ, "IMoGoNoticeProvider"));
// 后置 车聊聊IM
@@ -76,7 +76,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
// 后置 地图数据收集模块
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
}
CallerLogger.INSTANCE.i(M_MAIN + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
CallerLogger.i(M_MAIN + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
}
@Override

View File

@@ -66,7 +66,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
CallerLogger.INSTANCE.i(M_HMI + TAG, "onCreate");
CallerLogger.i(M_HMI + TAG, "onCreate");
}
@Override
@@ -120,7 +120,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
@Override
protected void loadOthersModules() {
super.loadOthersModules();
CallerLogger.INSTANCE.d(M_HMI + TAG, "loadOthersModules");
CallerLogger.d(M_HMI + TAG, "loadOthersModules");
loadOCHModule();
}
@@ -151,7 +151,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
paramIndexes = {0}
)
private void traceStartUp(String content) {
CallerLogger.INSTANCE.d(M_HMI + TAG, content);
CallerLogger.d(M_HMI + TAG, content);
}
@Override

View File

@@ -83,7 +83,7 @@ public class MogoModulesManager implements MogoModulesHandler {
final List<MogoModule> modules = MogoModulePaths.getModuleFunctions();
if (modules != null && !modules.isEmpty()) {
for (MogoModule module : modules) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
CallerLogger.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
IMoGoFunctionProvider provider = loadFunction(module.getPath());
if (provider != null) {
mModuleFunctionProviders.put(module, provider);
@@ -98,7 +98,7 @@ public class MogoModulesManager implements MogoModulesHandler {
final List<MogoModule> modules = MogoModulePaths.getModuleFunctionServers();
if (modules != null && !modules.isEmpty()) {
for (MogoModule module : modules) {
CallerLogger.INSTANCE.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
CallerLogger.d(M_MAIN + TAG, "module.getPath():" + module.getPath() + " name: " + module.getName());
IMoGoFunctionServerProvider provider = loadFunctionServer(module.getPath());
if (provider != null) {
mModuleFunctionServerProviders.put(module, provider);
@@ -115,7 +115,7 @@ public class MogoModulesManager implements MogoModulesHandler {
if (baseModule == null) {
continue;
}
CallerLogger.INSTANCE.d(M_MAIN + TAG, "加载基本模块 : " + baseModule.getPath());
CallerLogger.d(M_MAIN + TAG, "加载基本模块 : " + baseModule.getPath());
loadBaseProvider(baseModule.getPath());
}
}
@@ -155,10 +155,10 @@ public class MogoModulesManager implements MogoModulesHandler {
if (modules != null) {
for (IMoGoFunctionProvider module : modules) {
try {
CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy module: " + module.getFunctionName());
CallerLogger.d(M_HMI + TAG, "destroy module: " + module.getFunctionName());
module.onDestroy();
} catch (Exception e) {
CallerLogger.INSTANCE.e(M_HMI + TAG, e + " onDestroy");
CallerLogger.e(M_HMI + TAG, e + " onDestroy");
}
}
}
@@ -172,10 +172,10 @@ public class MogoModulesManager implements MogoModulesHandler {
if (modules != null) {
for (IMoGoFunctionServerProvider module : modules) {
try {
CallerLogger.INSTANCE.d(M_HMI + TAG, "destroy module: " + module.getFunctionName());
CallerLogger.d(M_HMI + TAG, "destroy module: " + module.getFunctionName());
module.onDestroy();
} catch (Exception e) {
CallerLogger.INSTANCE.e(M_HMI + TAG, e + " onDestroy");
CallerLogger.e(M_HMI + TAG, e + " onDestroy");
}
}
}

View File

@@ -62,7 +62,7 @@ public class FloatingViewHandler {
}
if (sFloatingLayout == null) {
CallerLogger.INSTANCE.e(M_HMI + TAG, "no floating frame. ");
CallerLogger.e(M_HMI + TAG, "no floating frame. ");
return;
}
@@ -85,7 +85,7 @@ public class FloatingViewHandler {
}
if (sFloatingLayout == null) {
CallerLogger.INSTANCE.e(M_HMI + TAG, "no floating frame. ");
CallerLogger.e(M_HMI + TAG, "no floating frame. ");
return;
}
sFloatingLayout.addView(view, params);
@@ -106,18 +106,18 @@ public class FloatingViewHandler {
}
if (sFloatingLayout == null) {
CallerLogger.INSTANCE.e(M_HMI + TAG, "no floating frame. ");
CallerLogger.e(M_HMI + TAG, "no floating frame. ");
return;
}
if (sView == view) {
CallerLogger.INSTANCE.w(M_HMI + TAG, "改布局已添加且没有移除,不操作");
CallerLogger.w(M_HMI + TAG, "改布局已添加且没有移除,不操作");
return;
}
if (sView != null) {
if (priority < sPriority) {
CallerLogger.INSTANCE.w(M_HMI + TAG, "过滤低优先级布局");
CallerLogger.w(M_HMI + TAG, "过滤低优先级布局");
return;
}
sFloatingLayout.removeView(sView);
@@ -144,18 +144,18 @@ public class FloatingViewHandler {
}
if (sFloatingLayout == null) {
CallerLogger.INSTANCE.e(M_HMI + TAG, "no floating frame. ");
CallerLogger.e(M_HMI + TAG, "no floating frame. ");
return;
}
if (sView == view) {
CallerLogger.INSTANCE.w(M_HMI + TAG, "改布局已添加且没有移除,不操作");
CallerLogger.w(M_HMI + TAG, "改布局已添加且没有移除,不操作");
return;
}
if (sView != null) {
if (priority < sPriority) {
CallerLogger.INSTANCE.w(M_HMI + TAG, "过滤低优先级布局");
CallerLogger.w(M_HMI + TAG, "过滤低优先级布局");
return;
}
sFloatingLayout.removeView(sView);

View File

@@ -11,13 +11,9 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Liste
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.map.MogoMapView
import com.mogo.map.overlay.line.Polyline
import com.mogo.map.overlay.point.Point
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay
import com.mogo.map.overlay.proxy.point.IMapPointOverlay
import com.mogo.map.uicontroller.IMogoMapUIController
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
@@ -52,7 +48,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
//设置旋转手势是否可用。
it.setRotateGesturesEnabled(false)
//设置比例尺控件是否可见
it.setScaleControlsEnabled(false)
it.setScaleControlsEnabled(true)
//设置拖拽手势是否可用。
it.setScrollGesturesEnabled(true)
//设置倾斜手势是否可用。
@@ -64,18 +60,6 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
}
}
fun getUI(): IMogoMapUIController {
return uiController
}
fun addLine(options:Polyline.Options): IMapPolylineOverlay? {
return map.addLine(options)
}
fun addPoint(options: Point.Options): IMapPointOverlay?{
return map.addPoint(options)
}
override fun onSaveInstanceState(outState: Bundle?) {
super.onSaveInstanceState(outState)
}
@@ -90,9 +74,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
override fun onSkinModeChange(skinMode: Int) {
if (skinMode == 0) {
getUI().stepInDayMode(false)
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(false)
} else if (skinMode == 1) {
getUI().stepInDayMode(true)
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(true)
}
}
@@ -123,9 +107,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
private fun turn(lightNum: Int) {
if (currentLevel != lightNum) {
when (lightNum) {
0 -> getUI().setCarLightsType(0, 500)
1 -> getUI().setCarLightsType(1, 500)
2 -> getUI().setCarLightsType(2, 500)
0 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(1, 500)
2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
}
currentLevel = lightNum
}