fix the logger add add func of vip check and take over
This commit is contained in:
@@ -6,7 +6,6 @@ import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils;
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.fft.FftFactory;
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.listener.RecordListener;
|
||||
@@ -177,14 +176,14 @@ public class RecordHelper {
|
||||
AudioRecordThread() {
|
||||
bufferSize = AudioRecord.getMinBufferSize(currentConfig.getSampleRate(),
|
||||
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig()) * RECORD_AUDIO_BUFFER_TIMES;
|
||||
Logger.d(TAG, "record buffer size = %s", bufferSize);
|
||||
CallerLogger.INSTANCE.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 {
|
||||
Logger.e(TAG, "mp3EncodeThread != null, 请检查代码");
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread != null, 请检查代码");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,7 +205,7 @@ public class RecordHelper {
|
||||
private void startPcmRecorder() {
|
||||
state = RecordState.RECORDING;
|
||||
notifyState();
|
||||
Logger.d(TAG, "开始录制 Pcm");
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "开始录制 Pcm");
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
fos = new FileOutputStream(tmpFile);
|
||||
@@ -224,7 +223,7 @@ public class RecordHelper {
|
||||
if (state == RecordState.STOP) {
|
||||
makeFile();
|
||||
} else {
|
||||
Logger.i(TAG, "暂停!");
|
||||
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "暂停!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
notifyError("录音失败");
|
||||
@@ -240,7 +239,7 @@ public class RecordHelper {
|
||||
if (state != RecordState.PAUSE) {
|
||||
state = RecordState.IDLE;
|
||||
notifyState();
|
||||
Logger.d(TAG, "录音结束");
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "录音结束");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +267,7 @@ public class RecordHelper {
|
||||
notifyState();
|
||||
stopMp3Encoded();
|
||||
} else {
|
||||
Logger.d(TAG, "暂停");
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "暂停");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,7 +282,7 @@ public class RecordHelper {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Logger.e(TAG, "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +301,7 @@ public class RecordHelper {
|
||||
break;
|
||||
}
|
||||
notifyFinish();
|
||||
Logger.i(TAG, "录音完成! path: %s ; 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
|
||||
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "录音完成! path: %s ; 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -377,7 +376,7 @@ public class RecordHelper {
|
||||
|
||||
private String getFilePath(String fileName) {
|
||||
if (!FileUtils.createOrExistsDir(ROOT_PATH)) {
|
||||
Logger.w(TAG, "文件夹创建失败:%s", ROOT_PATH);
|
||||
CallerLogger.INSTANCE.w("$M_DEVA$TAG", "文件夹创建失败:%s", ROOT_PATH);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -388,7 +387,7 @@ public class RecordHelper {
|
||||
|
||||
private String getTempFilePath() {
|
||||
if (!FileUtils.createOrExistsDir(TEMP_PATH)) {
|
||||
Logger.e(TAG, "文件夹创建失败:%s", TEMP_PATH);
|
||||
CallerLogger.INSTANCE.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);
|
||||
|
||||
@@ -36,19 +36,14 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig> {
|
||||
.registerOnMessageListener(FUNC_CONFIG_TYPE, this)
|
||||
UiThreadHandler.postDelayed({
|
||||
funcConfigNetWorkModel.requestFuncConfig({
|
||||
// SPUtils.getInstance("biz_config").put("config", GsonUtils.toJson(it))
|
||||
// refreshConfig(it)
|
||||
|
||||
//todo test
|
||||
val bizJson = SPUtils.getInstance("biz_config")
|
||||
.getString("config", GsonUtils.toJson(defaultFuncConfig()))
|
||||
refreshConfig(GsonUtils.fromJson(bizJson, FuncConfig::class.java))
|
||||
SPUtils.getInstance("biz_config").put("config", GsonUtils.toJson(it))
|
||||
refreshConfig(it)
|
||||
}, {
|
||||
val bizJson = SPUtils.getInstance("biz_config")
|
||||
.getString("config", GsonUtils.toJson(defaultFuncConfig()))
|
||||
refreshConfig(GsonUtils.fromJson(bizJson, FuncConfig::class.java))
|
||||
})
|
||||
}, 1000L * 30)
|
||||
}, 1000L * 5)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.util.Log
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.apiCall
|
||||
import com.mogo.eagle.core.network.request
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigConst
|
||||
@@ -25,6 +26,7 @@ class FuncConfigNetWorkModel {
|
||||
onError: ((String) -> Unit)? = null
|
||||
) {
|
||||
request<BaseResponse<FuncConfig>> {
|
||||
val map = mutableMapOf<String, Any>()
|
||||
start {
|
||||
if (success == null) {
|
||||
success = onSuccess
|
||||
@@ -32,16 +34,18 @@ class FuncConfigNetWorkModel {
|
||||
if (error == null) {
|
||||
error = onError
|
||||
}
|
||||
}
|
||||
loader {
|
||||
val map = mutableMapOf<String, Any>()
|
||||
//todo test
|
||||
// map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["sn"] = "X20202203105S688HZ"
|
||||
// map["mac"] = DeviceUtils.getMacAddress()
|
||||
map["mac"] = "48:b0:2d:3a:bc:78"
|
||||
// map["channelVersion"] = FuncConfigConst.getChannelCode()
|
||||
map["channelVersion"] = 1
|
||||
getNetWorkApi().funcConfig(map)
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
getNetWorkApi().funcConfig(map)
|
||||
}
|
||||
}
|
||||
onSuccess {
|
||||
if (it.result != null) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneModuleTAG
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.Scene.Companion.scene
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
@@ -71,7 +70,6 @@ class SceneManager {
|
||||
|
||||
//默认未创建的,符合scene tag,首次初始化logger=true
|
||||
scene.addChangeListener { change ->
|
||||
Logger.i("emArrow","scene change : $change")
|
||||
sceneModuleTAG.map.iterator().forEach { map ->
|
||||
val sceneModule = map.value
|
||||
sceneModule.name?.let {
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.GpsStatus
|
||||
@@ -50,10 +51,10 @@ object StatusManager {
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
guardianInfo?.code?.takeIf {
|
||||
Logger.d(TAG, "-- onAutopilotGuardian ---: code: $it")
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onAutopilotGuardian ---: code: $it")
|
||||
it.contains("RTK_STATUS", true) || it.contains("CAN", true) || it == "ILCT_RTK_OR_SLAM_CHANGE"
|
||||
}?.run {
|
||||
Logger.d(TAG, "-- onAutopilotGuardian trigger req ---: code: $this")
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onAutopilotGuardian trigger req ---: code: $this")
|
||||
req()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ import android.content.*
|
||||
import android.util.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RTKStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
import kotlinx.coroutines.*
|
||||
@@ -31,7 +32,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
|
||||
override fun onCreate() {
|
||||
send(RTKStatus(getDesc(), getCode()))
|
||||
Logger.d(TAG, "-- onCreate --")
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onCreate --")
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotCarStatusListenerManager.addListener(TAG, this)
|
||||
if (CallerAutoPilotManager.isConnected()) {
|
||||
@@ -67,7 +68,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||
if (!CallerAutoPilotManager.isConnected()) {
|
||||
Logger.d(TAG, "工控机断开了....")
|
||||
CallerLogger.d("$M_DEVA$TAG", "工控机断开了....")
|
||||
healthInfo.set(null)
|
||||
send(RTKStatus("", -1))
|
||||
}
|
||||
@@ -114,7 +115,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
isOldVersion.set(false)
|
||||
Logger.d(TAG, "-- onDestroy --")
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onDestroy --")
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerAutopilotCarStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import androidx.core.content.*
|
||||
import androidx.recyclerview.widget.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.*
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.R.drawable
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.*
|
||||
@@ -16,7 +16,6 @@ import com.zhjt.mogo_core_function_devatools.status.entity.IpcStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.ui.adapter.StatusAdapter.StatusViewHolder
|
||||
import kotlinx.coroutines.*
|
||||
|
||||
internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): RecyclerView.Adapter<StatusViewHolder>() {
|
||||
|
||||
@@ -124,7 +123,7 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
is TracingStatus -> {
|
||||
val extra = status.state.extra
|
||||
val extraDesc = if (extra != null && extra.isNotEmpty()) extra.values.joinToString(",") else ""
|
||||
Logger.d(TAG, "traceing_state: $status -> extra: $extraDesc :: extra: $extra")
|
||||
CallerLogger.d("$M_DEVA$TAG", "traceing_state: $status -> extra: $extraDesc :: extra: $extra")
|
||||
when(status.state) {
|
||||
//"轨迹类型:${ if (status.state == TRACK_LOADED) "循迹" else if (status.state == ROUTE_LOADED) "自主算路" else "暂无轨迹" }"
|
||||
MAP_TRA_TYPE -> {
|
||||
|
||||
Reference in New Issue
Block a user