Merge branch 'test_MogoAP_eagle-1030_211020_8.0.14.2' into dev_MogoAP_eagle-1030_211020_8.0.14
This commit is contained in:
@@ -31,6 +31,13 @@ changeCurrentIcon : 修改自车3D模型
|
||||
changeMaoViewAngle : 修改地图视角
|
||||
```
|
||||
|
||||
* ### 小地图 MAP 图层 相关 -> [CallerSmpManager.kt][DebugSettingView.kt] -> [Demo][DebugSettingView.kt]
|
||||
|
||||
```
|
||||
showPanel() : 显示小地图
|
||||
hidePanel() : 隐藏小地图
|
||||
```
|
||||
|
||||
* ### 域控制器 相关 -> [CallerAutoPilotManager.kt][DebugSettingView.kt] -> [Demo][DebugSettingView.kt]
|
||||
|
||||
```
|
||||
|
||||
@@ -156,9 +156,9 @@ ext {
|
||||
mogoserviceapi : "com.mogo.service:mogo-service-api:${MOGO_SERVICE_API_VERSION}",
|
||||
moduleapps : "com.mogo.module:module-apps:${MOGO_MODULE_APPS_VERSION}",
|
||||
moduleextensions : "com.mogo.module:module-extensions:${MOGO_MODULE_EXTENSIONS_VERSION}",
|
||||
chat : "com.mogo.module.carchatout:module-chat:${MOGO_MODULE_CHAT_VERSION}",
|
||||
callchat : "com.mogo.module.carchatout:module-carchatting:${MOGO_MODULE_CARCHATTING_VERSION}",
|
||||
callchatprovider : "com.mogo.module.carchatout:module-carchatting-provider:${MOGO_MODULE_CARCHATTINGPROVIDER_VERSION}",
|
||||
chat : "com.mogo.module.carchatim:module-chat:${MOGO_MODULE_CHAT_VERSION}",
|
||||
callchat : "com.mogo.module.carchatim:module-carchatting:${MOGO_MODULE_CARCHATTING_VERSION}",
|
||||
callchatprovider : "com.mogo.module.carchatim:module-carchatting-provider:${MOGO_MODULE_CARCHATTINGPROVIDER_VERSION}",
|
||||
|
||||
// V2X
|
||||
moduleV2x : "com.mogo.module:module-v2x:${MOGO_MODULE_V2X_VERSION}",
|
||||
|
||||
@@ -209,12 +209,13 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
|
||||
val notificationView = V2XNotificationView(it)
|
||||
notificationView.setWarningIcon(EventTypeEnum.getWarningIcon(v2xType.toString()))
|
||||
|
||||
notificationView.setWarningContent(
|
||||
alertContent ?: EventTypeEnum.getWarningContent(
|
||||
v2xType.toString()
|
||||
)
|
||||
)
|
||||
val warningContent = alertContent ?: EventTypeEnum.getWarningContent(v2xType.toString())
|
||||
if (warningContent.isNullOrEmpty()) {
|
||||
Logger.e(TAG, "Show warningContent is null or empty!")
|
||||
return
|
||||
} else {
|
||||
notificationView.setWarningContent(warningContent)
|
||||
}
|
||||
|
||||
if (mWarningFloat != null && mWarningFloat!!.config.floatTag != tag) {
|
||||
WarningFloat.dismiss(mWarningFloat!!.config.floatTag, true)
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListe
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -49,11 +50,11 @@ import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
* 展示 本机、网络、工控机、OBU等状态信息,支持设置IP,等参数进行调试
|
||||
*/
|
||||
class DebugSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener, IMoGoMapLocationListener {
|
||||
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener, IMoGoMapLocationListener {
|
||||
|
||||
private val TAG = "DebugSettingView"
|
||||
|
||||
@@ -132,7 +133,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString()
|
||||
tvAutopilotInfo.text =
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfoJsonString()
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfoJsonString()
|
||||
|
||||
// 初始化App 配置信息
|
||||
val appConfigInfo = AppConfigInfo()
|
||||
@@ -150,7 +151,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
// 初始化OBU IP信息
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
|
||||
|
||||
etObuIP.setText(ipAddress)
|
||||
etObuIP.text?.let { etObuIP.setSelection(it.length) }
|
||||
@@ -172,18 +173,18 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
// 初始化 GSP数据源 数据
|
||||
rgGpsProvider.check(
|
||||
when (FunctionBuildConfig.gpsProvider) {
|
||||
0 -> {
|
||||
R.id.rbGpsProviderAndroid
|
||||
when (FunctionBuildConfig.gpsProvider) {
|
||||
0 -> {
|
||||
R.id.rbGpsProviderAndroid
|
||||
}
|
||||
1 -> {
|
||||
R.id.rbGpsProviderRTK
|
||||
}
|
||||
2 -> {
|
||||
R.id.rbGpsProviderOBU
|
||||
}
|
||||
else -> R.id.rbGpsProviderAndroid
|
||||
}
|
||||
1 -> {
|
||||
R.id.rbGpsProviderRTK
|
||||
}
|
||||
2 -> {
|
||||
R.id.rbGpsProviderOBU
|
||||
}
|
||||
else -> R.id.rbGpsProviderAndroid
|
||||
}
|
||||
)
|
||||
rgGpsProvider.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
@@ -201,14 +202,14 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
// 初始化 感知数据是否绘制 选择情况
|
||||
rgIsDrawIdentifyData.check(
|
||||
when (FunctionBuildConfig.isDrawIdentifyData) {
|
||||
true -> {
|
||||
R.id.rbDraw
|
||||
when (FunctionBuildConfig.isDrawIdentifyData) {
|
||||
true -> {
|
||||
R.id.rbDraw
|
||||
}
|
||||
false -> {
|
||||
R.id.rbDoNotDraw
|
||||
}
|
||||
}
|
||||
false -> {
|
||||
R.id.rbDoNotDraw
|
||||
}
|
||||
}
|
||||
)
|
||||
rgIsDrawIdentifyData.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
@@ -277,6 +278,13 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
CallerAutoPilotManager.setIsWriteLog(true)
|
||||
}
|
||||
}
|
||||
tbControlView.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if (isChecked) {
|
||||
CallerSmpManager.hidePanel()
|
||||
} else {
|
||||
CallerSmpManager.showPanel()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,10 +37,11 @@
|
||||
android:id="@+id/flVipIdentificationView"
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:layout_marginLeft="@dimen/module_vip_margin_left"
|
||||
android:layout_marginStart="@dimen/module_vip_margin_left"
|
||||
android:layout_marginTop="@dimen/module_vip_margin_top"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toRightOf="@+id/viewSpeedChart"
|
||||
app:layout_constraintTop_toTopOf="@+id/viewSpeedChart" />
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.AutoPilotStatusView
|
||||
android:id="@+id/viewAutopilotStatus"
|
||||
|
||||
@@ -91,6 +91,16 @@
|
||||
android:textOn="显示「车辆检测」"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbControlView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:textOff="隐藏「小地图」"
|
||||
android:textOn="显示「小地图」"
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
<!-- <Button
|
||||
android:id="@+id/tbChangeCarCenter100"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.data.v2x.VipMessage
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
@@ -16,7 +15,6 @@ import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightListenerMa
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.core.function.v2x.vip.network.VipNetWorkModel
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener
|
||||
@@ -25,7 +23,7 @@ import com.mogo.utils.logger.Logger
|
||||
import kotlin.math.abs
|
||||
|
||||
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
|
||||
IMogoCarLocationChangedListener2, Handler.Callback {
|
||||
Handler.Callback {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -55,8 +53,6 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
|
||||
fun initServer(context: Context) {
|
||||
mContext = context
|
||||
MogoApisHandler.getInstance()
|
||||
.apis.registerCenterApi.registerCarLocationChangedListener(TAG, this)
|
||||
MogoApisHandler.getInstance()
|
||||
.apis.getSocketManagerApi(context)
|
||||
.registerOnMessageListener(401025, this)
|
||||
@@ -109,7 +105,10 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
return
|
||||
}
|
||||
if (trafficLightResult.currentRoadTrafficLight() == null) {
|
||||
Logger.d(TAG, "vip 获取到灯态,但没找到对应车道数据 result : $trafficLightResult , then resetConditions")
|
||||
Logger.d(
|
||||
TAG,
|
||||
"vip 获取到灯态,但没找到对应车道数据 result : $trafficLightResult , then resetConditions"
|
||||
)
|
||||
resetConditions()
|
||||
return
|
||||
}
|
||||
@@ -132,7 +131,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
lastResult?.let {
|
||||
//如果上次结果和本次灯态结果变化比较大,则已变灯,控制HMI展示弹窗
|
||||
if (abs(currentResult!!.remain - it.remain) > 5) {
|
||||
Logger.d(TAG,"调用showWarningV2X to show")
|
||||
Logger.d(TAG, "调用showWarningV2X to show")
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType.toInt(),
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.content,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
|
||||
@@ -233,12 +232,15 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
|
||||
private fun turnLight(controlTime: Int) {
|
||||
result?.let {
|
||||
val bearing =
|
||||
MogoApisHandler.getInstance().apis.mapServiceApi.getSingletonLocationClient(mContext).lastKnowLocation.bearing.toDouble()
|
||||
Logger.d(TAG, "turnLight -- bearing : $bearing")
|
||||
MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
||||
it.lightId,
|
||||
it.crossId,
|
||||
mLocation!!.bearing.toDouble(), controlTime, {
|
||||
it.lightId, it.crossId, bearing, controlTime,
|
||||
{
|
||||
Logger.d(TAG, "变灯请求成功")
|
||||
}, { errorMsg ->
|
||||
},
|
||||
{ errorMsg ->
|
||||
Logger.e(TAG, "变灯请求失败 msg : $errorMsg")
|
||||
})
|
||||
}
|
||||
@@ -250,13 +252,4 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
mContext = null
|
||||
}
|
||||
|
||||
override fun onCarLocationChanged(latLng: MogoLatLng?) {
|
||||
}
|
||||
|
||||
override fun onCarLocationChanged2(latLng: Location?) {
|
||||
latLng?.let {
|
||||
mLocation = it
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -88,7 +88,12 @@ object CallerMapLocationListenerManager : CallerBase() {
|
||||
*/
|
||||
fun invokeMapLocationChangeListener(location: MogoLocation?) {
|
||||
//LogUtils.dTag(TAG, "mapStyleMode:$location")
|
||||
Log.w("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener")
|
||||
val longitude = "${location?.longitude}"
|
||||
if (longitude.length>12){
|
||||
Log.e("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener")
|
||||
}else{
|
||||
Log.w("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener")
|
||||
}
|
||||
mLocation = location
|
||||
mMapStyleChangeListeners.forEach {
|
||||
val tag = it.key
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
object CallerSmpManager : CallerBase() {
|
||||
private val mogoSmallMapProvider: IMogoSmallMapProvider
|
||||
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP)
|
||||
.navigation() as IMogoSmallMapProvider
|
||||
.navigation() as IMogoSmallMapProvider
|
||||
|
||||
/**
|
||||
* 绘制路径线
|
||||
@@ -31,4 +31,20 @@ object CallerSmpManager : CallerBase() {
|
||||
fun clearPolyline() {
|
||||
mogoSmallMapProvider.clearPolyline()
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示面板
|
||||
*/
|
||||
@JvmStatic
|
||||
fun showPanel() {
|
||||
mogoSmallMapProvider.showPanel()
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏面板
|
||||
*/
|
||||
@JvmStatic
|
||||
fun hidePanel() {
|
||||
mogoSmallMapProvider.hidePanel()
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
<dimen name="module_vip_width">104px</dimen>
|
||||
<dimen name="module_vip_height">104px</dimen>
|
||||
<dimen name="module_vip_margin_left">40px</dimen>
|
||||
<dimen name="module_vip_margin_left">540px</dimen>
|
||||
<dimen name="module_vip_margin_top">40px</dimen>
|
||||
|
||||
<dimen name="module_ext_speed_width_sm_radius">30px</dimen>
|
||||
<dimen name="module_ext_speed_width_big_radius">130px</dimen>
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
<dimen name="module_vip_width">104px</dimen>
|
||||
<dimen name="module_vip_height">104px</dimen>
|
||||
<dimen name="module_vip_margin_left">40px</dimen>
|
||||
<dimen name="module_vip_margin_left">380px</dimen>
|
||||
<dimen name="module_vip_margin_top">40px</dimen>
|
||||
|
||||
<dimen name="module_ext_speed_width_sm_radius">20px</dimen>
|
||||
<dimen name="module_ext_speed_width_big_radius">110px</dimen>
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.commons.voice;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.tts.base.IMogoTTS;
|
||||
import com.mogo.tts.base.MogoTTSConstants;
|
||||
import com.mogo.tts.base.PreemptType;
|
||||
@@ -46,7 +47,12 @@ public class AIAssist {
|
||||
|
||||
|
||||
private AIAssist( Context context ) {
|
||||
mTTS = ( IMogoTTS ) ARouter.getInstance().build( MogoTTSConstants.API_PATH ).navigation( context.getApplicationContext() );
|
||||
try {
|
||||
mTTS = ( IMogoTTS ) ARouter.getInstance().build( MogoTTSConstants.API_PATH ).navigation( context.getApplicationContext() );
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ToastUtils.showShort("TTS 初始化失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,7 @@ kapt.include.compile.classpath=false
|
||||
android.useAndroidX=true
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
android.jetifier.blacklist=module-service-2.0.94.aar
|
||||
android.jetifier.blacklist=module-service-2.1.3.4.aar
|
||||
## maven 配置
|
||||
RELEASE_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-releases/
|
||||
SNAPSHOT_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-snapshots/
|
||||
@@ -89,102 +89,103 @@ applicationName=IntelligentPilot
|
||||
versionCode=80007
|
||||
versionName=8.0.14
|
||||
################# 新架构模块Maven版本管理 #################
|
||||
MOGO_CORE_FUNCTION_AUTOPILOT_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_CHECK_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_HMI_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_MAIN_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_MAP_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_MONITORING_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_NOTICE_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_OBU_MOGO_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_SMP_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_V2X_VERSION=0.0.36
|
||||
MOGO_CORE_DATA_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_API_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_CALL_VERSION=0.0.36
|
||||
MOGO_CORE_RES_VERSION=0.0.36
|
||||
MOGO_CORE_UTILS_VERSION=0.0.36
|
||||
MOGO_CORE_NETWORK_VERSION=0.0.36
|
||||
MOGO_CORE_FUNCTION_AUTOPILOT_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_CHECK_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_HMI_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_MAIN_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_MAP_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_MONITORING_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_NOTICE_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_OBU_MOGO_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_SMP_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_V2X_VERSION=0.0.45.4
|
||||
MOGO_CORE_DATA_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_API_VERSION=0.0.45.4
|
||||
MOGO_CORE_FUNCTION_CALL_VERSION=0.0.45.4
|
||||
MOGO_CORE_RES_VERSION=0.0.45.4
|
||||
MOGO_CORE_UTILS_VERSION=0.0.45.4
|
||||
MOGO_CORE_NETWORK_VERSION=0.0.45.4
|
||||
################# 旧版本架构模块版本 #################
|
||||
## 工程内模块
|
||||
MOGO_COMMONS_VERSION=2.0.94
|
||||
MOGO_UTILS_VERSION=2.0.94
|
||||
MAP_AMAP_VERSION=2.0.94
|
||||
MAP_AUTONAVI_VERSION=2.0.94
|
||||
MOGO_MAP_VERSION=2.0.94
|
||||
MOGO_MAP_API_VERSION=2.0.94
|
||||
MOGO_SERVICE_VERSION=2.0.94
|
||||
MOGO_SERVICE_API_VERSION=2.0.94
|
||||
MOGO_CONNECTION_VERSION=2.0.94
|
||||
MOGO_MODULE_APPS_VERSION=2.0.94
|
||||
MOGO_MODULE_NAVI_VERSION=2.0.94
|
||||
MOGO_MODULE_SHARE_VERSION=2.0.94
|
||||
MOGO_MODULE_COMMON_VERSION=2.0.94
|
||||
MOGO_MODULE_MAIN_VERSION=2.0.94
|
||||
MOGO_MODULE_MAP_VERSION=2.0.94
|
||||
MOGO_MODULE_SERVICE_VERSION=2.0.94
|
||||
MOGO_MODULE_EXTENSIONS_VERSION=2.0.94
|
||||
MOGO_MODULE_SEARCH_VERSION=2.0.94
|
||||
MOGO_MODULE_BACK_VERSION=2.0.94
|
||||
MOGO_MODULE_V2X_VERSION=2.0.94
|
||||
MOGO_COMMONS_VERSION=2.1.3.4
|
||||
MOGO_UTILS_VERSION=2.1.3.4
|
||||
MAP_AMAP_VERSION=2.1.3.4
|
||||
MAP_AUTONAVI_VERSION=2.1.3.4
|
||||
MOGO_MAP_VERSION=2.1.3.4
|
||||
MOGO_MAP_API_VERSION=2.1.3.4
|
||||
MOGO_SERVICE_VERSION=2.1.3.4
|
||||
MOGO_SERVICE_API_VERSION=2.1.3.4
|
||||
MOGO_CONNECTION_VERSION=2.1.3.4
|
||||
MOGO_MODULE_APPS_VERSION=2.1.3.4
|
||||
MOGO_MODULE_NAVI_VERSION=2.1.3.4
|
||||
MOGO_MODULE_SHARE_VERSION=2.1.3.4
|
||||
MOGO_MODULE_COMMON_VERSION=2.1.3.4
|
||||
MOGO_MODULE_MAIN_VERSION=2.1.3.4
|
||||
MOGO_MODULE_MAP_VERSION=2.1.3.4
|
||||
MOGO_MODULE_SERVICE_VERSION=2.1.3.4
|
||||
MOGO_MODULE_EXTENSIONS_VERSION=2.1.3.4
|
||||
MOGO_MODULE_SEARCH_VERSION=2.1.3.4
|
||||
MOGO_MODULE_BACK_VERSION=2.1.3.4
|
||||
MOGO_MODULE_V2X_VERSION=2.1.3.4
|
||||
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=2.0.94
|
||||
MOGO_MODULE_TANLU_VERSION=2.1.3.4
|
||||
# 推送
|
||||
MOGO_MODULE_PUSH_VERSION=2.0.94
|
||||
MOGO_MODULE_PUSH_BASE_VERSION=2.0.94
|
||||
MOGO_MODULE_PUSH_NOOP_VERSION=2.0.94
|
||||
MOGO_MODULE_PUSH_VERSION=2.1.3.4
|
||||
MOGO_MODULE_PUSH_BASE_VERSION=2.1.3.4
|
||||
MOGO_MODULE_PUSH_NOOP_VERSION=2.1.3.4
|
||||
# 探路上报和分享模块
|
||||
TANLULIB_VERSION=2.0.94
|
||||
MOGO_TANLU_API_VERSION=2.0.94
|
||||
TANLULIB_VERSION=2.1.3.4
|
||||
MOGO_TANLU_API_VERSION=2.1.3.4
|
||||
#左侧面板模块
|
||||
MOGO_MODULE_LEFT_PANEL_VERSION=2.0.94
|
||||
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.0.94
|
||||
MOGO_MODULE_LEFT_PANEL_VERSION=2.1.3.4
|
||||
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.1.3.4
|
||||
# 小控件
|
||||
MOGO_MODULE_WIDGETS_VERSION=2.0.94
|
||||
MOGO_MODULE_WIDGETS_VERSION=2.1.3.4
|
||||
# obu
|
||||
MOGO_MODULE_OBU_VERSION=2.0.94
|
||||
MOGO_MODULE_OBU_MOGO_VERSION=2.0.94
|
||||
MOGO_MODULE_OBU_VERSION=2.1.3.4
|
||||
MOGO_MODULE_OBU_MOGO_VERSION=2.1.3.4
|
||||
# monitor
|
||||
MOGO_MODULE_MONITOR_VERSION=2.0.94
|
||||
MOGO_MODULE_MONITOR_VERSION=2.1.3.4
|
||||
# bugly
|
||||
CRASHREPORT_VERSION=2.0.94
|
||||
CRASHREPORT_BUGLY_VERSION=2.0.94
|
||||
CRASHREPORT_NOOP_VERSION=2.0.94
|
||||
CRASHREPORT_UPGRADE_VERSION=2.0.94
|
||||
CRASHREPORT_VERSION=2.1.3.4
|
||||
CRASHREPORT_BUGLY_VERSION=2.1.3.4
|
||||
CRASHREPORT_NOOP_VERSION=2.1.3.4
|
||||
CRASHREPORT_UPGRADE_VERSION=2.1.3.4
|
||||
## tts
|
||||
TTS_BASE_VERSION=2.0.94
|
||||
TTS_DI_VERSION=2.0.94
|
||||
TTS_ZHI_VERSION=2.0.94
|
||||
TTS_PAD_VERSION=2.0.94
|
||||
TTS_NOOP_VERSION=2.0.94
|
||||
TTS_BASE_VERSION=2.1.3.4
|
||||
TTS_DI_VERSION=2.1.3.4
|
||||
TTS_ZHI_VERSION=2.1.3.4
|
||||
TTS_PAD_VERSION=2.1.3.4
|
||||
TTS_NOOP_VERSION=2.1.3.4
|
||||
# 自研地图
|
||||
MAP_CUSTOM_VERSION=2.0.94
|
||||
MOGO_MODULE_ADAS_VERSION=2.0.94
|
||||
MAP_CUSTOM_VERSION=2.1.3.4
|
||||
MOGO_MODULE_ADAS_VERSION=2.1.3.4
|
||||
# 基础服务实现:passport、socket、location
|
||||
MOGO_BASE_WEBSOCKET_SDK_VERSION=2.0.94
|
||||
MOGO_BASE_SERVICES_APK_VERSION=2.0.94
|
||||
MOGO_BASE_SERVICES_SDK_VERSION=2.0.94
|
||||
MOGO_MODULE_CHAT_VERSION=2.0.94
|
||||
MOGO_BASE_WEBSOCKET_SDK_VERSION=2.1.3.4
|
||||
MOGO_BASE_SERVICES_APK_VERSION=2.1.3.4
|
||||
MOGO_BASE_SERVICES_SDK_VERSION=2.1.3.4
|
||||
MOGO_MODULE_CHAT_VERSION=2.1.3.4
|
||||
# 车聊聊
|
||||
MOGO_MODULE_CARCHATTING_VERSION=2.0.94
|
||||
MOGO_MODULE_CARCHATTING_VERSION=2.1.3.4
|
||||
# 车聊聊接口
|
||||
MOGO_MODULE_CARCHATTINGPROVIDER_VERSION=2.0.94
|
||||
MOGO_MODULE_CARCHATTINGPROVIDER_VERSION=2.1.3.4
|
||||
|
||||
# 皮肤
|
||||
MOGO_SKIN_SUPPORT_VERSION=2.0.94
|
||||
MOGO_SKIN_LIGHT_VERSION=2.0.94
|
||||
MOGO_SKIN_SUPPORT_IMPL_VERSION=2.0.94
|
||||
MOGO_SKIN_SUPPORT_NOOP_VERSION=2.0.94
|
||||
SKIN_SUPPORT_VERSION=2.0.94
|
||||
SKIN_SUPPORT_APPCOMPAT_VERSION=2.0.94
|
||||
SKIN_SUPPORT_CARDVIEW_VERSION=2.0.94
|
||||
SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.0.94
|
||||
SKIN_SUPPORT_DESIGN_VERSION=2.0.94
|
||||
MOGO_SKIN_SUPPORT_VERSION=2.1.3.4
|
||||
MOGO_SKIN_LIGHT_VERSION=2.1.3.4
|
||||
MOGO_SKIN_SUPPORT_IMPL_VERSION=2.1.3.4
|
||||
MOGO_SKIN_SUPPORT_NOOP_VERSION=2.1.3.4
|
||||
SKIN_SUPPORT_VERSION=2.1.3.4
|
||||
SKIN_SUPPORT_APPCOMPAT_VERSION=2.1.3.4
|
||||
SKIN_SUPPORT_CARDVIEW_VERSION=2.1.3.4
|
||||
SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.1.3.4
|
||||
SKIN_SUPPORT_DESIGN_VERSION=2.1.3.4
|
||||
# OCH
|
||||
MOGO_OCH_VERSION=2.0.94-test
|
||||
MOGO_OCH_BUS_VERSION=2.0.94-test
|
||||
MOGO_OCH_NOOP_VERSION=2.0.94-test
|
||||
MOGO_OCH_TAXI_VERSION=2.0.94-test
|
||||
MOGO_OCH_VERSION=2.1.3.4-test
|
||||
MOGO_OCH_BUS_VERSION=2.1.3.4-test
|
||||
MOGO_OCH_NOOP_VERSION=2.1.3.4-test
|
||||
MOGO_OCH_TAXI_VERSION=2.1.3.4-test
|
||||
# mogoAiCloud sdk services
|
||||
MOGO_AICLOUD_SERVICES_SDK_VERSION=2.0.94
|
||||
MOGO_AICLOUD_SERVICES_SDK_VERSION=2.1.3.4
|
||||
################# 旧版本架构模块版本 #################
|
||||
|
||||
@@ -751,8 +751,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) {
|
||||
Log.w("DHY-location", location.getLon() + "," + location.getLat() + " AMapViewWrapper-onLocationChanged:");
|
||||
Log.w("DHY-location", location.getLon() + "," + location.getLat() + " AMapViewWrapper-onLocationChanged:location");
|
||||
MogoLocation mLastLocation = ObjectUtils.fromLocation(location);
|
||||
Log.w("DHY-location", mLastLocation.getLongitude() + "," + mLastLocation.getLatitude() + " AMapViewWrapper-onLocationChanged:mLastLocation");
|
||||
UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation));
|
||||
|
||||
Location sysLocation = new Location(location.getProvider());
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
private static final String TAG = "ALocationClient";
|
||||
|
||||
private MogoLocation mLastLocation;
|
||||
private LocationListener mListener = new InternalLocationListener();
|
||||
private final LocationListener mListener = new InternalLocationListener();
|
||||
|
||||
private boolean mIsDestroyed = false;
|
||||
|
||||
@@ -114,7 +114,7 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( @NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location ) {
|
||||
Log.w("DHY-location", location.getLon() + "," + location.getLat() + " ALocationClient-onLocationChanged");
|
||||
Log.w("DHY-location", location.getLon() + "," + location.getLat() + " ALocationClient-onLocationChanged:location");
|
||||
if ( mIsDestroyed ) {
|
||||
destroyWarming();
|
||||
return;
|
||||
@@ -126,6 +126,7 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
}
|
||||
Trace.beginSection( "timer.onLocationChanged" );
|
||||
mLastLocation = ObjectUtils.fromLocation( location );
|
||||
Log.w("DHY-location", mLastLocation.getLongitude() + "," + mLastLocation.getLatitude() + " ALocationClient-onLocationChanged:mLastLocation");
|
||||
UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation));
|
||||
|
||||
Set< IMogoLocationListener > listeners = MogoLocationListenerRegister.getInstance().getListeners();
|
||||
@@ -152,16 +153,7 @@ public class ALocationClient implements IMogoLocationClient {
|
||||
return;
|
||||
}
|
||||
if (locationToUpdate instanceof RTKAutopilotLocationBean) {
|
||||
MogoLocation last = getLastKnowLocation();
|
||||
RTKAutopilotLocationBean current = (RTKAutopilotLocationBean) locationToUpdate;
|
||||
boolean isNeedUpdate = (last == null || last.getLatitude() != current.getLat() || last.getLongitude() != current.getLon());
|
||||
if (!isNeedUpdate) {
|
||||
return;
|
||||
}
|
||||
if (last != null) {
|
||||
last.setLatitude(current.getLat());
|
||||
last.setLongitude(current.getLon());
|
||||
}
|
||||
if (mClient != null) {
|
||||
mClient.updateRTKAutoPilotLocation(current);
|
||||
}
|
||||
|
||||
@@ -53,19 +53,19 @@ import java.util.List;
|
||||
*/
|
||||
public class ObjectUtils {
|
||||
|
||||
public static MarkerOptions fromMogo( MogoMarkerOptions opt ) {
|
||||
public static MarkerOptions fromMogo(MogoMarkerOptions opt) {
|
||||
|
||||
if ( opt == null ) {
|
||||
if (opt == null) {
|
||||
return null;
|
||||
}
|
||||
ArrayList< BitmapDescriptor > descriptors = new ArrayList<>();
|
||||
final ArrayList< Bitmap > icons = opt.getIcons();
|
||||
if ( icons != null && !icons.isEmpty() ) {
|
||||
for ( Bitmap icon : icons ) {
|
||||
if ( icon == null || icon.isRecycled() ) {
|
||||
ArrayList<BitmapDescriptor> descriptors = new ArrayList<>();
|
||||
final ArrayList<Bitmap> icons = opt.getIcons();
|
||||
if (icons != null && !icons.isEmpty()) {
|
||||
for (Bitmap icon : icons) {
|
||||
if (icon == null || icon.isRecycled()) {
|
||||
continue;
|
||||
}
|
||||
descriptors.add( new BitmapDescriptor( icon ) );
|
||||
descriptors.add(new BitmapDescriptor(icon));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,83 +86,84 @@ public class ObjectUtils {
|
||||
// }
|
||||
|
||||
MarkerOptions markerOptions = new MarkerOptions()
|
||||
.setGps( opt.isGps() )
|
||||
.position( new LonLatPoint( opt.getLongitude(), opt.getLatitude() ) )
|
||||
.anchor( opt.getU(), opt.getV() )
|
||||
.icons( descriptors )
|
||||
.period( opt.getPeriod() )
|
||||
.controlAngle( opt.isControlAngle() )
|
||||
.rotateAngle( opt.getRotate() )
|
||||
.setFlat( opt.isFlat() )
|
||||
.visible( opt.isVisible() )
|
||||
.infoWindowEnable( opt.isInifoWindowEnable() )
|
||||
.setGps(opt.isGps())
|
||||
.position(new LonLatPoint(opt.getLongitude(), opt.getLatitude()))
|
||||
.anchor(opt.getU(), opt.getV())
|
||||
.icons(descriptors)
|
||||
.period(opt.getPeriod())
|
||||
.controlAngle(opt.isControlAngle())
|
||||
.rotateAngle(opt.getRotate())
|
||||
.setFlat(opt.isFlat())
|
||||
.visible(opt.isVisible())
|
||||
.infoWindowEnable(opt.isInifoWindowEnable())
|
||||
.scale(opt.getScale())
|
||||
.alpha( opt.getAlpha() )
|
||||
.alpha(opt.getAlpha())
|
||||
// .draggable( opt.isDraggable() )
|
||||
.setInfoWindowOffset( opt.getOffsetX(), opt.getOffsetY() )
|
||||
.zIndex( opt.getzIndex() );
|
||||
.setInfoWindowOffset(opt.getOffsetX(), opt.getOffsetY())
|
||||
.zIndex(opt.getzIndex());
|
||||
try {
|
||||
Color.parseColor( opt.getAnchorColor() );
|
||||
markerOptions.anchorColor( opt.getAnchorColor() );
|
||||
} catch ( Exception e ) {
|
||||
Color.parseColor(opt.getAnchorColor());
|
||||
markerOptions.anchorColor(opt.getAnchorColor());
|
||||
} catch (Exception e) {
|
||||
}
|
||||
markerOptions.vrEnable( opt.is3DMode() );
|
||||
if ( !TextUtils.isEmpty( opt.getResName() ) ) {
|
||||
markerOptions.setMarkerIconName( opt.getResName() );
|
||||
markerOptions.vrEnable(opt.is3DMode());
|
||||
if (!TextUtils.isEmpty(opt.getResName())) {
|
||||
markerOptions.setMarkerIconName(opt.getResName());
|
||||
} else {
|
||||
BitmapDescriptor descriptor = getBitmapDescriptorFromMogo( opt );
|
||||
if ( descriptor != null ) {
|
||||
markerOptions.markerIcon( descriptor );
|
||||
BitmapDescriptor descriptor = getBitmapDescriptorFromMogo(opt);
|
||||
if (descriptor != null) {
|
||||
markerOptions.markerIcon(descriptor);
|
||||
}
|
||||
if ( opt.getIcon3DRes() != 0 ) {
|
||||
markerOptions.marker3DIcon( opt.getIcon3DRes() );
|
||||
if (opt.getIcon3DRes() != 0) {
|
||||
markerOptions.marker3DIcon(opt.getIcon3DRes());
|
||||
}
|
||||
}
|
||||
if ( !TextUtils.isEmpty( opt.getTitle() ) ) {
|
||||
markerOptions.title( opt.getTitle() );
|
||||
if (!TextUtils.isEmpty(opt.getTitle())) {
|
||||
markerOptions.title(opt.getTitle());
|
||||
}
|
||||
if ( !TextUtils.isEmpty( opt.getSnippet() ) ) {
|
||||
markerOptions.snippet( opt.getSnippet() );
|
||||
if (!TextUtils.isEmpty(opt.getSnippet())) {
|
||||
markerOptions.snippet(opt.getSnippet());
|
||||
}
|
||||
return markerOptions;
|
||||
}
|
||||
|
||||
private static BitmapDescriptor getBitmapDescriptorFromMogo( MogoMarkerOptions options ) {
|
||||
if ( options == null ) {
|
||||
private static BitmapDescriptor getBitmapDescriptorFromMogo(MogoMarkerOptions options) {
|
||||
if (options == null) {
|
||||
return null;
|
||||
}
|
||||
Bitmap icon = options.getIcon();
|
||||
if ( icon != null ) {
|
||||
return BitmapDescriptorFactory.INSTANCE.fromBitmap( icon );
|
||||
if (icon != null) {
|
||||
return BitmapDescriptorFactory.INSTANCE.fromBitmap(icon);
|
||||
}
|
||||
View view = options.getIconView();
|
||||
if ( view != null ) {
|
||||
return BitmapDescriptorFactory.INSTANCE.fromView( view );
|
||||
if (view != null) {
|
||||
return BitmapDescriptorFactory.INSTANCE.fromView(view);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static MogoLocation fromLocation( com.zhidaoauto.map.sdk.open.location.MogoLocation aLocation ) {
|
||||
if ( aLocation == null ) {
|
||||
public static MogoLocation fromLocation(com.zhidaoauto.map.sdk.open.location.MogoLocation aLocation) {
|
||||
if (aLocation == null) {
|
||||
return null;
|
||||
}
|
||||
MogoLocation location = new MogoLocation();
|
||||
// location.setLocType( aLocation.getLocationType() );
|
||||
location.setSpeed( aLocation.getSpeed() );
|
||||
location.setLatitude( aLocation.getLat() );
|
||||
location.setLongitude( aLocation.getLon() );
|
||||
location.setAltitude( aLocation.getAltitude() );
|
||||
// location.setTime( aLocation.getTime() );
|
||||
location.setBearing( aLocation.getHeading() );
|
||||
// location.setAccuracy( aLocation.getAccuracy() );
|
||||
location.setCityCode( aLocation.getCityCode() );
|
||||
location.setCityName( aLocation.getCity() );
|
||||
location.setProvider( aLocation.getProvider() );
|
||||
location.setAddress( aLocation.getAddress() );
|
||||
location.setDistrict( aLocation.getDistrict() );
|
||||
location.setProvince( aLocation.getProvince() );
|
||||
location.setAdCode( aLocation.getAdCode() );
|
||||
location.setLocType(1); // 定位类型
|
||||
location.setSatellite(4);
|
||||
location.setSpeed(aLocation.getSpeed());
|
||||
location.setLatitude(aLocation.getLat());
|
||||
location.setLongitude(aLocation.getLon());
|
||||
location.setAltitude(aLocation.getAltitude());
|
||||
location.setBearing(aLocation.getHeading());
|
||||
location.setCityCode(aLocation.getCityCode());
|
||||
location.setCityName(aLocation.getCity());
|
||||
location.setProvider(aLocation.getProvider());
|
||||
location.setAddress(aLocation.getAddress());
|
||||
location.setDistrict(aLocation.getDistrict());
|
||||
location.setProvince(aLocation.getProvince());
|
||||
location.setAdCode(aLocation.getAdCode());
|
||||
// location.setAccuracy( aLocation.getAccuracy() );
|
||||
// location.setTime( aLocation.getTime() );
|
||||
// location.setLocationDetail( aLocation.getLocationDetail() );
|
||||
// location.setPoiName( aLocation.getPoiName() );
|
||||
// location.setAoiName( aLocation.getAoiName() );
|
||||
@@ -173,15 +174,14 @@ public class ObjectUtils {
|
||||
// location.setBuildingId( aLocation.getBuildingId() );
|
||||
// location.setFloor( aLocation.getFloor() );
|
||||
// location.setGpsAccuracyStatus( aLocation.getGpsAccuracyStatus() );
|
||||
// location.setSatellite( aLocation.getSatellites() );
|
||||
return location;
|
||||
}
|
||||
|
||||
public static LonLatPoint fromMogo( MogoLatLng latLng ) {
|
||||
if ( latLng == null ) {
|
||||
public static LonLatPoint fromMogo(MogoLatLng latLng) {
|
||||
if (latLng == null) {
|
||||
return null;
|
||||
}
|
||||
return new LonLatPoint( latLng.lon, latLng.lat );
|
||||
return new LonLatPoint(latLng.lon, latLng.lat);
|
||||
}
|
||||
|
||||
// public static NaviLatLng fromMogoAsNavi( MogoLatLng latLng ) {
|
||||
@@ -198,11 +198,11 @@ public class ObjectUtils {
|
||||
// return new LatLng( latLng.lat, latLng.lng );
|
||||
// }
|
||||
|
||||
public static MogoLatLng fromAMap( LonLatPoint point ) {
|
||||
if ( point == null ) {
|
||||
public static MogoLatLng fromAMap(LonLatPoint point) {
|
||||
if (point == null) {
|
||||
return null;
|
||||
}
|
||||
return new MogoLatLng( point.getLatitude(), point.getLongitude() );
|
||||
return new MogoLatLng(point.getLatitude(), point.getLongitude());
|
||||
}
|
||||
|
||||
// public static MogoLatLng CameraPositionfromAMap( LatLng point ) {
|
||||
@@ -212,19 +212,19 @@ public class ObjectUtils {
|
||||
// return new MogoLatLng( point.latitude, point.longitude );
|
||||
// }
|
||||
|
||||
public static GeocodeQuery fromMogo( MogoGeocodeQuery query ) {
|
||||
if ( query == null ) {
|
||||
public static GeocodeQuery fromMogo(MogoGeocodeQuery query) {
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
GeocodeQuery q = new GeocodeQuery( query.getLocationName(), query.getCity() );
|
||||
GeocodeQuery q = new GeocodeQuery(query.getLocationName(), query.getCity());
|
||||
return q;
|
||||
}
|
||||
|
||||
public static RegeocodeQuery fromMogo( MogoRegeocodeQuery query ) {
|
||||
if ( query == null ) {
|
||||
public static RegeocodeQuery fromMogo(MogoRegeocodeQuery query) {
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
RegeocodeQuery q = new RegeocodeQuery( fromMogo( query.getPoint() ), 1000 );
|
||||
RegeocodeQuery q = new RegeocodeQuery(fromMogo(query.getPoint()), 1000);
|
||||
return q;
|
||||
}
|
||||
|
||||
@@ -266,39 +266,39 @@ public class ObjectUtils {
|
||||
// return mogoCrossroad;
|
||||
// }
|
||||
|
||||
public static MogoGeocodeAddress fromAMap( GeocodeAddress address ) {
|
||||
if ( address == null ) {
|
||||
public static MogoGeocodeAddress fromAMap(GeocodeAddress address) {
|
||||
if (address == null) {
|
||||
return null;
|
||||
}
|
||||
MogoGeocodeAddress mogoGeocodeAddress = new MogoGeocodeAddress();
|
||||
mogoGeocodeAddress.setAdcode( address.getAdcode() );
|
||||
mogoGeocodeAddress.setBuilding( address.getBuilding() );
|
||||
mogoGeocodeAddress.setCity( address.getCity() );
|
||||
mogoGeocodeAddress.setDistrict( address.getDistrict() );
|
||||
mogoGeocodeAddress.setFormatAddress( address.getFormatAddress() );
|
||||
mogoGeocodeAddress.setLatlng( fromAMap( address.getLonlat() ) );
|
||||
mogoGeocodeAddress.setLevel( address.getLevel() );
|
||||
mogoGeocodeAddress.setNeighborhood( address.getNeighborhood() );
|
||||
mogoGeocodeAddress.setProvince( address.getProvince() );
|
||||
mogoGeocodeAddress.setTownship( address.getTownship() );
|
||||
mogoGeocodeAddress.setAdcode(address.getAdcode());
|
||||
mogoGeocodeAddress.setBuilding(address.getBuilding());
|
||||
mogoGeocodeAddress.setCity(address.getCity());
|
||||
mogoGeocodeAddress.setDistrict(address.getDistrict());
|
||||
mogoGeocodeAddress.setFormatAddress(address.getFormatAddress());
|
||||
mogoGeocodeAddress.setLatlng(fromAMap(address.getLonlat()));
|
||||
mogoGeocodeAddress.setLevel(address.getLevel());
|
||||
mogoGeocodeAddress.setNeighborhood(address.getNeighborhood());
|
||||
mogoGeocodeAddress.setProvince(address.getProvince());
|
||||
mogoGeocodeAddress.setTownship(address.getTownship());
|
||||
return mogoGeocodeAddress;
|
||||
}
|
||||
|
||||
public static MogoGeocodeResult fromAMap( GeocodeResult result ) {
|
||||
if ( result == null || result.getGeocodeAddressList() == null ) {
|
||||
public static MogoGeocodeResult fromAMap(GeocodeResult result) {
|
||||
if (result == null || result.getGeocodeAddressList() == null) {
|
||||
return null;
|
||||
}
|
||||
MogoGeocodeResult mogoGeocodeResult = new MogoGeocodeResult();
|
||||
final List< MogoGeocodeAddress > addresses = new ArrayList<>();
|
||||
List< GeocodeAddress > list = result.getGeocodeAddressList();
|
||||
for ( GeocodeAddress geocodeAddress : list ) {
|
||||
final MogoGeocodeAddress mogoGeocodeAddress = fromAMap( geocodeAddress );
|
||||
if ( mogoGeocodeAddress != null ) {
|
||||
addresses.add( mogoGeocodeAddress );
|
||||
final List<MogoGeocodeAddress> addresses = new ArrayList<>();
|
||||
List<GeocodeAddress> list = result.getGeocodeAddressList();
|
||||
for (GeocodeAddress geocodeAddress : list) {
|
||||
final MogoGeocodeAddress mogoGeocodeAddress = fromAMap(geocodeAddress);
|
||||
if (mogoGeocodeAddress != null) {
|
||||
addresses.add(mogoGeocodeAddress);
|
||||
}
|
||||
}
|
||||
|
||||
mogoGeocodeResult.setAddresses( addresses );
|
||||
mogoGeocodeResult.setAddresses(addresses);
|
||||
return mogoGeocodeResult;
|
||||
}
|
||||
|
||||
@@ -374,23 +374,23 @@ public class ObjectUtils {
|
||||
// return mogoSubPoiItem;
|
||||
// }
|
||||
|
||||
public static MogoPoiItem fromAMap( PoiItem poiItem ) {
|
||||
if ( poiItem == null ) {
|
||||
public static MogoPoiItem fromAMap(PoiItem poiItem) {
|
||||
if (poiItem == null) {
|
||||
return null;
|
||||
}
|
||||
MogoPoiItem mogoPoiItem = new MogoPoiItem();
|
||||
mogoPoiItem.setAdCode( poiItem.getAdCode() );
|
||||
mogoPoiItem.setAdName( poiItem.getAdName() );
|
||||
mogoPoiItem.setBusinessArea( poiItem.getBusinessArea() );
|
||||
mogoPoiItem.setCityCode( poiItem.getCityCode() );
|
||||
mogoPoiItem.setCityName( poiItem.getCityName() );
|
||||
mogoPoiItem.setDirection( poiItem.getDirection() );
|
||||
mogoPoiItem.setDistance( poiItem.getDistance() );
|
||||
mogoPoiItem.setEmail( poiItem.getEmail() );
|
||||
mogoPoiItem.setEnter( fromAMap( poiItem.getEnter() ) );
|
||||
mogoPoiItem.setExit( fromAMap( poiItem.getExit() ) );
|
||||
mogoPoiItem.setAdCode(poiItem.getAdCode());
|
||||
mogoPoiItem.setAdName(poiItem.getAdName());
|
||||
mogoPoiItem.setBusinessArea(poiItem.getBusinessArea());
|
||||
mogoPoiItem.setCityCode(poiItem.getCityCode());
|
||||
mogoPoiItem.setCityName(poiItem.getCityName());
|
||||
mogoPoiItem.setDirection(poiItem.getDirection());
|
||||
mogoPoiItem.setDistance(poiItem.getDistance());
|
||||
mogoPoiItem.setEmail(poiItem.getEmail());
|
||||
mogoPoiItem.setEnter(fromAMap(poiItem.getEnter()));
|
||||
mogoPoiItem.setExit(fromAMap(poiItem.getExit()));
|
||||
// mogoPoiItem.setIndoorData( fromAMap( poiItem.getIndoorData() ) );
|
||||
mogoPoiItem.setParkingType( poiItem.getParkingType() );
|
||||
mogoPoiItem.setParkingType(poiItem.getParkingType());
|
||||
// mogoPoiItem.setIndoorMap( poiItem.isIndoorMap() );
|
||||
// if ( poiItem.getPhotos() != null ) {
|
||||
// List< MogoPhoto > mogoPhotos = new ArrayList<>();
|
||||
@@ -403,13 +403,13 @@ public class ObjectUtils {
|
||||
// mogoPoiItem.setPhotos( mogoPhotos );
|
||||
// }
|
||||
// mogoPoiItem.setPoiExtension( fromAMap( poiItem.getPoiExtension() ) );
|
||||
mogoPoiItem.setPoiId( poiItem.getPoiId() );
|
||||
mogoPoiItem.setPoint( fromAMap( poiItem.getLonLatPoint() ) );
|
||||
mogoPoiItem.setPostcode( poiItem.getPostcode() );
|
||||
mogoPoiItem.setProvinceCode( poiItem.getProvinceCode() );
|
||||
mogoPoiItem.setProvinceName( poiItem.getProvinceName() );
|
||||
mogoPoiItem.setShopID( poiItem.getShopID() );
|
||||
mogoPoiItem.setSnippet( poiItem.getSnippet() );
|
||||
mogoPoiItem.setPoiId(poiItem.getPoiId());
|
||||
mogoPoiItem.setPoint(fromAMap(poiItem.getLonLatPoint()));
|
||||
mogoPoiItem.setPostcode(poiItem.getPostcode());
|
||||
mogoPoiItem.setProvinceCode(poiItem.getProvinceCode());
|
||||
mogoPoiItem.setProvinceName(poiItem.getProvinceName());
|
||||
mogoPoiItem.setShopID(poiItem.getShopID());
|
||||
mogoPoiItem.setSnippet(poiItem.getSnippet());
|
||||
// if ( poiItem.getSubPois() != null ) {
|
||||
// List< MogoSubPoiItem > mogoSubPoiItems = new ArrayList<>();
|
||||
// for ( SubPoiItem subPois : poiItem.getSubPois() ) {
|
||||
@@ -420,20 +420,20 @@ public class ObjectUtils {
|
||||
// }
|
||||
// mogoPoiItem.setSubPois( mogoSubPoiItems );
|
||||
// }
|
||||
mogoPoiItem.setTel( poiItem.getTel() );
|
||||
mogoPoiItem.setTypeCode( poiItem.getTypeCode() );
|
||||
mogoPoiItem.setTitle( poiItem.getTitle() );
|
||||
mogoPoiItem.setTypeDes( poiItem.getTypeDes() );
|
||||
mogoPoiItem.setWebsite( poiItem.getWebsite() );
|
||||
mogoPoiItem.setTel(poiItem.getTel());
|
||||
mogoPoiItem.setTypeCode(poiItem.getTypeCode());
|
||||
mogoPoiItem.setTitle(poiItem.getTitle());
|
||||
mogoPoiItem.setTypeDes(poiItem.getTypeDes());
|
||||
mogoPoiItem.setWebsite(poiItem.getWebsite());
|
||||
return mogoPoiItem;
|
||||
}
|
||||
|
||||
public static MogoRegeocodeAddress fromAMap( RegeocodeAddress regeocodeAddress ) {
|
||||
if ( regeocodeAddress == null ) {
|
||||
public static MogoRegeocodeAddress fromAMap(RegeocodeAddress regeocodeAddress) {
|
||||
if (regeocodeAddress == null) {
|
||||
return null;
|
||||
}
|
||||
MogoRegeocodeAddress mogoRegeocodeAddress = new MogoRegeocodeAddress();
|
||||
mogoRegeocodeAddress.setAdCode( regeocodeAddress.getAdCode() );
|
||||
mogoRegeocodeAddress.setAdCode(regeocodeAddress.getAdCode());
|
||||
// if ( regeocodeAddress.getAois() != null ) {
|
||||
// List< MogoAoiItem > items = new ArrayList<>();
|
||||
// for ( AoiItem aois : regeocodeAddress.getAois() ) {
|
||||
@@ -445,7 +445,7 @@ public class ObjectUtils {
|
||||
// mogoRegeocodeAddress.setAois( items );
|
||||
// }
|
||||
|
||||
mogoRegeocodeAddress.setBuilding( regeocodeAddress.getBuilding() );
|
||||
mogoRegeocodeAddress.setBuilding(regeocodeAddress.getBuilding());
|
||||
// if ( regeocodeAddress.getBusinessAreas() != null ) {
|
||||
// List< MogoBusinessArea > mogoBusinessAreas = new ArrayList<>();
|
||||
// for ( BusinessArea businessArea : regeocodeAddress.getBusinessAreas() ) {
|
||||
@@ -457,9 +457,9 @@ public class ObjectUtils {
|
||||
// mogoRegeocodeAddress.setBusinessAreas( mogoBusinessAreas );
|
||||
// }
|
||||
|
||||
mogoRegeocodeAddress.setCity( regeocodeAddress.getCity() );
|
||||
mogoRegeocodeAddress.setCityCode( regeocodeAddress.getCityCode() );
|
||||
mogoRegeocodeAddress.setCountry( regeocodeAddress.getCountry() );
|
||||
mogoRegeocodeAddress.setCity(regeocodeAddress.getCity());
|
||||
mogoRegeocodeAddress.setCityCode(regeocodeAddress.getCityCode());
|
||||
mogoRegeocodeAddress.setCountry(regeocodeAddress.getCountry());
|
||||
// if ( regeocodeAddress.getCrossroads() != null ) {
|
||||
// List< MogoCrossroad > mogoCrossroads = new ArrayList<>();
|
||||
// for ( Crossroad crossroad : regeocodeAddress.getCrossroads() ) {
|
||||
@@ -471,19 +471,19 @@ public class ObjectUtils {
|
||||
// }
|
||||
// mogoRegeocodeAddress.setCrossroads( mogoCrossroads );
|
||||
// }
|
||||
mogoRegeocodeAddress.setDistrict( regeocodeAddress.getDistrict() );
|
||||
mogoRegeocodeAddress.setFormatAddress( regeocodeAddress.getFormatAddress() );
|
||||
mogoRegeocodeAddress.setNeighborhood( regeocodeAddress.getNeighborhood() );
|
||||
if ( regeocodeAddress.getPoiList() != null ) {
|
||||
List< MogoPoiItem > mogoPoiItems = new ArrayList<>();
|
||||
List< PoiItem > list = regeocodeAddress.getPoiList();
|
||||
for ( PoiItem pois : list ) {
|
||||
MogoPoiItem mogoPoiItem = fromAMap( pois );
|
||||
mogoPoiItems.add( mogoPoiItem );
|
||||
mogoRegeocodeAddress.setDistrict(regeocodeAddress.getDistrict());
|
||||
mogoRegeocodeAddress.setFormatAddress(regeocodeAddress.getFormatAddress());
|
||||
mogoRegeocodeAddress.setNeighborhood(regeocodeAddress.getNeighborhood());
|
||||
if (regeocodeAddress.getPoiList() != null) {
|
||||
List<MogoPoiItem> mogoPoiItems = new ArrayList<>();
|
||||
List<PoiItem> list = regeocodeAddress.getPoiList();
|
||||
for (PoiItem pois : list) {
|
||||
MogoPoiItem mogoPoiItem = fromAMap(pois);
|
||||
mogoPoiItems.add(mogoPoiItem);
|
||||
}
|
||||
mogoRegeocodeAddress.setPois( mogoPoiItems );
|
||||
mogoRegeocodeAddress.setPois(mogoPoiItems);
|
||||
}
|
||||
mogoRegeocodeAddress.setProvince( regeocodeAddress.getProvince() );
|
||||
mogoRegeocodeAddress.setProvince(regeocodeAddress.getProvince());
|
||||
// if ( regeocodeAddress.getRoads() != null ) {
|
||||
// List< MogoRegeocodeRoad > mogoRegeocodeRoads = new ArrayList<>();
|
||||
// for ( RegeocodeRoad road : regeocodeAddress.getRoads() ) {
|
||||
@@ -495,43 +495,43 @@ public class ObjectUtils {
|
||||
// mogoRegeocodeAddress.setRoads( mogoRegeocodeRoads );
|
||||
// }
|
||||
// mogoRegeocodeAddress.setStreetNumber( fromAMap( regeocodeAddress.getStreetNumber() ) );
|
||||
mogoRegeocodeAddress.setTowncode( regeocodeAddress.getTowncode() );
|
||||
mogoRegeocodeAddress.setTownship( regeocodeAddress.getTownship() );
|
||||
mogoRegeocodeAddress.setTowncode(regeocodeAddress.getTowncode());
|
||||
mogoRegeocodeAddress.setTownship(regeocodeAddress.getTownship());
|
||||
return mogoRegeocodeAddress;
|
||||
}
|
||||
|
||||
public static MogoRegeocodeResult fromAMap( RegeocodeResult regeocodeResult ) {
|
||||
if ( regeocodeResult == null ) {
|
||||
public static MogoRegeocodeResult fromAMap(RegeocodeResult regeocodeResult) {
|
||||
if (regeocodeResult == null) {
|
||||
return null;
|
||||
}
|
||||
MogoRegeocodeResult mogoRegeocodeResult = new MogoRegeocodeResult();
|
||||
mogoRegeocodeResult.setRegeocodeAddress( fromAMap( regeocodeResult.getRegeocodeAddress() ) );
|
||||
mogoRegeocodeResult.setRegeocodeAddress(fromAMap(regeocodeResult.getRegeocodeAddress()));
|
||||
return mogoRegeocodeResult;
|
||||
}
|
||||
|
||||
public static InputtipsQuery fromMogo( MogoInputtipsQuery query ) {
|
||||
if ( query == null ) {
|
||||
public static InputtipsQuery fromMogo(MogoInputtipsQuery query) {
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
InputtipsQuery inputtipsQuery = new InputtipsQuery( query.getKeyword(), query.getCity() );
|
||||
inputtipsQuery.setCityLimit( query.isCityLimit() );
|
||||
inputtipsQuery.setLocation( fromMogo( query.getLocation() ) );
|
||||
inputtipsQuery.setType( query.getType() );
|
||||
InputtipsQuery inputtipsQuery = new InputtipsQuery(query.getKeyword(), query.getCity());
|
||||
inputtipsQuery.setCityLimit(query.isCityLimit());
|
||||
inputtipsQuery.setLocation(fromMogo(query.getLocation()));
|
||||
inputtipsQuery.setType(query.getType());
|
||||
return inputtipsQuery;
|
||||
}
|
||||
|
||||
public static MogoTip fromAMap( Tip tip ) {
|
||||
if ( tip == null ) {
|
||||
public static MogoTip fromAMap(Tip tip) {
|
||||
if (tip == null) {
|
||||
return null;
|
||||
}
|
||||
MogoTip mogoTip = new MogoTip();
|
||||
mogoTip.setAdCode( tip.getAdcode() );
|
||||
mogoTip.setAddress( tip.getAddress() );
|
||||
mogoTip.setDistrict( tip.getDistrict() );
|
||||
mogoTip.setName( tip.getName() );
|
||||
mogoTip.setPoiID( tip.getPoiID() );
|
||||
mogoTip.setPoint( fromAMap( tip.getLatPoint() ) );
|
||||
mogoTip.setTypeCode( tip.getTypeCode() );
|
||||
mogoTip.setAdCode(tip.getAdcode());
|
||||
mogoTip.setAddress(tip.getAddress());
|
||||
mogoTip.setDistrict(tip.getDistrict());
|
||||
mogoTip.setName(tip.getName());
|
||||
mogoTip.setPoiID(tip.getPoiID());
|
||||
mogoTip.setPoint(fromAMap(tip.getLatPoint()));
|
||||
mogoTip.setTypeCode(tip.getTypeCode());
|
||||
return mogoTip;
|
||||
}
|
||||
|
||||
@@ -546,197 +546,123 @@ public class ObjectUtils {
|
||||
// return mogoPoi;
|
||||
// }
|
||||
|
||||
public static MogoPoiSearchQuery fromAMap( Query query ) {
|
||||
if ( query == null ) {
|
||||
public static MogoPoiSearchQuery fromAMap(Query query) {
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
MogoPoiSearchQuery mogoPoiSearchQuery = new MogoPoiSearchQuery( query.getKeyword(), query.getCategory(), query.getCity() );
|
||||
MogoPoiSearchQuery mogoPoiSearchQuery = new MogoPoiSearchQuery(query.getKeyword(), query.getCategory(), query.getCity());
|
||||
// mogoPoiSearchQuery.setBuilding( query.getBuilding() );
|
||||
mogoPoiSearchQuery.setCityLimit( query.getCityLimit() );
|
||||
mogoPoiSearchQuery.setDistanceSort( query.getDistanceSort() );
|
||||
mogoPoiSearchQuery.setLocation( fromAMap( query.getLocation() ) );
|
||||
mogoPoiSearchQuery.setPageNum( query.getPageNum() );
|
||||
mogoPoiSearchQuery.setPageSize( query.getPageSize() );
|
||||
mogoPoiSearchQuery.setCityLimit(query.getCityLimit());
|
||||
mogoPoiSearchQuery.setDistanceSort(query.getDistanceSort());
|
||||
mogoPoiSearchQuery.setLocation(fromAMap(query.getLocation()));
|
||||
mogoPoiSearchQuery.setPageNum(query.getPageNum());
|
||||
mogoPoiSearchQuery.setPageSize(query.getPageSize());
|
||||
return mogoPoiSearchQuery;
|
||||
}
|
||||
|
||||
public static Query fromMogo( MogoPoiSearchQuery query ) {
|
||||
if ( query == null || query.getQuery() == null ) {
|
||||
public static Query fromMogo(MogoPoiSearchQuery query) {
|
||||
if (query == null || query.getQuery() == null) {
|
||||
return null;
|
||||
}
|
||||
Query psq = new Query( query.getQuery(), "", "" );
|
||||
String category = getCategory( query.getQuery() );
|
||||
if ( !category.equals( "" ) )
|
||||
psq = new Query( "", "", getCategory( query.getQuery() ) );
|
||||
Query psq = new Query(query.getQuery(), "", "");
|
||||
String category = getCategory(query.getQuery());
|
||||
if (!category.equals(""))
|
||||
psq = new Query("", "", getCategory(query.getQuery()));
|
||||
// psq.setBuilding( query.getBuilding() );
|
||||
psq.setCityLimit( query.isCityLimit() );
|
||||
psq.setDistanceSort( query.isDistanceSort() );
|
||||
psq.setLocation( fromMogo( query.getLocation() ) );
|
||||
psq.setPageNum( query.getPageNum() );
|
||||
psq.setPageSize( query.getPageSize() );
|
||||
psq.setCityLimit(query.isCityLimit());
|
||||
psq.setDistanceSort(query.isDistanceSort());
|
||||
psq.setLocation(fromMogo(query.getLocation()));
|
||||
psq.setPageNum(query.getPageNum());
|
||||
psq.setPageSize(query.getPageSize());
|
||||
return psq;
|
||||
}
|
||||
|
||||
public static MogoSearchBound fromAMap( SearchBound bound ) {
|
||||
if ( bound == null ) {
|
||||
public static MogoSearchBound fromAMap(SearchBound bound) {
|
||||
if (bound == null) {
|
||||
return null;
|
||||
}
|
||||
if ( bound.getShape() == SearchBound.BOUND_SHAPE ) {
|
||||
return new MogoSearchBound( fromAMap( bound.getCenter() ), bound.getRange(), bound.isDistanceSort() );
|
||||
} else if ( bound.getShape() == SearchBound.POLYGON_SHAPE ) {
|
||||
return new MogoSearchBound( fromAMap( bound.getPolyGonList() ) );
|
||||
} else if ( bound.getShape() == SearchBound.RECTANGLE_SHAPE ) {
|
||||
return new MogoSearchBound( fromAMap( bound.getLowerLeft() ), fromAMap( bound.getUpperRight() ) );
|
||||
if (bound.getShape() == SearchBound.BOUND_SHAPE) {
|
||||
return new MogoSearchBound(fromAMap(bound.getCenter()), bound.getRange(), bound.isDistanceSort());
|
||||
} else if (bound.getShape() == SearchBound.POLYGON_SHAPE) {
|
||||
return new MogoSearchBound(fromAMap(bound.getPolyGonList()));
|
||||
} else if (bound.getShape() == SearchBound.RECTANGLE_SHAPE) {
|
||||
return new MogoSearchBound(fromAMap(bound.getLowerLeft()), fromAMap(bound.getUpperRight()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List< MogoLatLng > fromAMap( List< LonLatPoint > latLngs ) {
|
||||
if ( latLngs == null ) {
|
||||
public static List<MogoLatLng> fromAMap(List<LonLatPoint> latLngs) {
|
||||
if (latLngs == null) {
|
||||
return null;
|
||||
}
|
||||
List< MogoLatLng > result = new ArrayList<>( latLngs.size() );
|
||||
for ( LonLatPoint latLng : latLngs ) {
|
||||
result.add( fromAMap( latLng ) );
|
||||
List<MogoLatLng> result = new ArrayList<>(latLngs.size());
|
||||
for (LonLatPoint latLng : latLngs) {
|
||||
result.add(fromAMap(latLng));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List< LonLatPoint > fromMogo( List< MogoLatLng > latLngs ) {
|
||||
if ( latLngs == null ) {
|
||||
public static List<LonLatPoint> fromMogo(List<MogoLatLng> latLngs) {
|
||||
if (latLngs == null) {
|
||||
return null;
|
||||
}
|
||||
List< LonLatPoint > result = new ArrayList<>( latLngs.size() );
|
||||
for ( MogoLatLng latLng : latLngs ) {
|
||||
result.add( fromMogo( latLng ) );
|
||||
List<LonLatPoint> result = new ArrayList<>(latLngs.size());
|
||||
for (MogoLatLng latLng : latLngs) {
|
||||
result.add(fromMogo(latLng));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static SearchBound fromMogo( MogoSearchBound bound ) {
|
||||
if ( bound == null ) {
|
||||
public static SearchBound fromMogo(MogoSearchBound bound) {
|
||||
if (bound == null) {
|
||||
return null;
|
||||
}
|
||||
if ( bound.getShape() == MogoSearchBound.SHAPE_BOUND ) {
|
||||
return new SearchBound( fromMogo( bound.getCenterPoint() ), bound.getRadiusInMeters(), bound.isDistanceSort() );
|
||||
} else if ( bound.getShape() == MogoSearchBound.SHAPE_POLYGON ) {
|
||||
return new SearchBound( fromMogo( bound.getPolyGonList() ) );
|
||||
} else if ( bound.getShape() == MogoSearchBound.SHAPE_RECTANGLE ) {
|
||||
return new SearchBound( fromMogo( bound.getLowerLeft() ), fromMogo( bound.getUpperRight() ) );
|
||||
if (bound.getShape() == MogoSearchBound.SHAPE_BOUND) {
|
||||
return new SearchBound(fromMogo(bound.getCenterPoint()), bound.getRadiusInMeters(), bound.isDistanceSort());
|
||||
} else if (bound.getShape() == MogoSearchBound.SHAPE_POLYGON) {
|
||||
return new SearchBound(fromMogo(bound.getPolyGonList()));
|
||||
} else if (bound.getShape() == MogoSearchBound.SHAPE_RECTANGLE) {
|
||||
return new SearchBound(fromMogo(bound.getLowerLeft()), fromMogo(bound.getUpperRight()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MogoPoiResult fromAMap( PoiSearchResult result ) {
|
||||
if ( result == null ) {
|
||||
public static MogoPoiResult fromAMap(PoiSearchResult result) {
|
||||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
MogoPoiResult mogoPoiResult = new MogoPoiResult();
|
||||
if ( result.getItems() != null ) {
|
||||
final List< PoiSearchItem > poiItems = result.getItems();
|
||||
final ArrayList< MogoPoiItem > mogoPoiItems = new ArrayList<>( poiItems.size() );
|
||||
for ( PoiSearchItem poiItem : poiItems ) {
|
||||
mogoPoiItems.add( fromAMap( poiItem.getPoi() ) );
|
||||
if (result.getItems() != null) {
|
||||
final List<PoiSearchItem> poiItems = result.getItems();
|
||||
final ArrayList<MogoPoiItem> mogoPoiItems = new ArrayList<>(poiItems.size());
|
||||
for (PoiSearchItem poiItem : poiItems) {
|
||||
mogoPoiItems.add(fromAMap(poiItem.getPoi()));
|
||||
}
|
||||
mogoPoiResult.setPois( mogoPoiItems );
|
||||
mogoPoiResult.setPois(mogoPoiItems);
|
||||
}
|
||||
return mogoPoiResult;
|
||||
}
|
||||
|
||||
// public static MogoNaviInfo fromAMap(Context context, NaviInfo naviInfo ) {
|
||||
// if ( naviInfo == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoNaviInfo mogoNaviInfo = new MogoNaviInfo();
|
||||
// mogoNaviInfo.setCurrentRoadName( naviInfo.getCurrentRoadName() );
|
||||
// mogoNaviInfo.setCurrentSpeed( naviInfo.getCurrentSpeed() );
|
||||
// mogoNaviInfo.setCurStepRetainDistance( naviInfo.getCurStepRetainDistance() );
|
||||
// mogoNaviInfo.setCurStepRetainTime( naviInfo.getCurStepRetainTime() );
|
||||
// mogoNaviInfo.setIconResId( IconTypeUtils.getResIdByIconType( context, naviInfo.getIconType() ) );
|
||||
// mogoNaviInfo.setNextRoadName( naviInfo.getNextRoadName() );
|
||||
// mogoNaviInfo.setPathRetainDistance( naviInfo.getPathRetainDistance() );
|
||||
// mogoNaviInfo.setPathRetainTime( naviInfo.getPathRetainTime() );
|
||||
// mogoNaviInfo.setCurrentSpeed( naviInfo.getLimitSpeed() );
|
||||
// return mogoNaviInfo;
|
||||
// }
|
||||
//
|
||||
// public static MogoCongestionInfo fromAMap( AimLessModeCongestionInfo aimLessModeCongestionInfo ) {
|
||||
// if ( aimLessModeCongestionInfo == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoCongestionInfo congestionInfo = new MogoCongestionInfo();
|
||||
// congestionInfo.setCongestionStatus( aimLessModeCongestionInfo.getCongestionStatus() );
|
||||
// congestionInfo.setEventLat( aimLessModeCongestionInfo.getEventLat() );
|
||||
// congestionInfo.setEventLon( aimLessModeCongestionInfo.getEventLon() );
|
||||
// congestionInfo.setEventType( aimLessModeCongestionInfo.getEventType() );
|
||||
// congestionInfo.setCongestionLinks( new ArrayList<MogoCongestionLink>() );
|
||||
// congestionInfo.setLength( aimLessModeCongestionInfo.getLength() );
|
||||
// congestionInfo.setRoadName( aimLessModeCongestionInfo.getRoadName() );
|
||||
// congestionInfo.setTime( aimLessModeCongestionInfo.getTime() );
|
||||
// if ( aimLessModeCongestionInfo.getAmapCongestionLinks() != null
|
||||
// && aimLessModeCongestionInfo.getAmapCongestionLinks().length != 0 ) {
|
||||
// for ( AMapCongestionLink amapCongestionLink : aimLessModeCongestionInfo.getAmapCongestionLinks() ) {
|
||||
// if ( amapCongestionLink == null ) {
|
||||
// continue;
|
||||
// }
|
||||
// MogoCongestionLink link = new MogoCongestionLink();
|
||||
// link.setCongestionStatus( amapCongestionLink.getCongestionStatus() );
|
||||
// if ( amapCongestionLink.getCoords() != null ) {
|
||||
// link.setCoords( new ArrayList< MogoLatLng >() );
|
||||
// Iterator<NaviLatLng> iterator = amapCongestionLink.getCoords().iterator();
|
||||
// while ( iterator.hasNext() ) {
|
||||
// NaviLatLng naviLatLng = iterator.next();
|
||||
// if ( naviLatLng == null ) {
|
||||
// continue;
|
||||
// }
|
||||
// link.getCoords().add( new MogoLatLng( naviLatLng.getLatitude(), naviLatLng.getLongitude() ) );
|
||||
// }
|
||||
// }
|
||||
// congestionInfo.getCongestionLinks().add( link );
|
||||
// }
|
||||
// }
|
||||
// return congestionInfo;
|
||||
// }
|
||||
//
|
||||
// public static MogoTraffic fromAMap(AMapNaviTrafficFacilityInfo[] aMapNaviTrafficFacilityInfos ) {
|
||||
// if ( aMapNaviTrafficFacilityInfos == null || aMapNaviTrafficFacilityInfos.length == 0 ) {
|
||||
// return null;
|
||||
// }
|
||||
// for ( AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo : aMapNaviTrafficFacilityInfos ) {
|
||||
// if ( aMapNaviTrafficFacilityInfo == null ) {
|
||||
// continue;
|
||||
// }
|
||||
// MogoTraffic traffic = new MogoTraffic( MogoTraffic.TYPE_AIM );
|
||||
// traffic.setDistance( aMapNaviTrafficFacilityInfo.getDistance() );
|
||||
// traffic.setSpeedLimit( aMapNaviTrafficFacilityInfo.getLimitSpeed() );
|
||||
// traffic.setTrafficType( aMapNaviTrafficFacilityInfo.getBroadcastType() );
|
||||
// traffic.setLat( aMapNaviTrafficFacilityInfo.latitude );
|
||||
// traffic.setLon( aMapNaviTrafficFacilityInfo.longitude );
|
||||
// return traffic;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
public static PolylineOptions fromMogo( MogoPolylineOptions options ) {
|
||||
if ( options == null ) {
|
||||
public static PolylineOptions fromMogo(MogoPolylineOptions options) {
|
||||
if (options == null) {
|
||||
return null;
|
||||
}
|
||||
PolylineOptions target = new PolylineOptions();
|
||||
target.setGps(options.gps());
|
||||
if ( options.getPoints() != null ) {
|
||||
List< LonLatPoint > points = new ArrayList<>();
|
||||
for ( MogoLatLng point : options.getPoints() ) {
|
||||
points.add( fromMogo( point ) );
|
||||
if (options.getPoints() != null) {
|
||||
List<LonLatPoint> points = new ArrayList<>();
|
||||
for (MogoLatLng point : options.getPoints()) {
|
||||
points.add(fromMogo(point));
|
||||
}
|
||||
target.lonLatPoints( points );
|
||||
target.lonLatPoints(points);
|
||||
}
|
||||
target.setLineWidth( options.getWidth() );
|
||||
target.setLineWidth(options.getWidth());
|
||||
target.zIndex(options.getZIndex());
|
||||
target.setColor( options.getColor() );
|
||||
target.useGradient( options.isGradient() );
|
||||
if ( options.getColorValues() != null ) {
|
||||
target.colorValues( options.getColorValues() );
|
||||
target.setColor(options.getColor());
|
||||
target.useGradient(options.isGradient());
|
||||
if (options.getColorValues() != null) {
|
||||
target.colorValues(options.getColorValues());
|
||||
}
|
||||
// target.transparency( options.getTransparency() );
|
||||
// target.aboveMaskLayer( options.isAboveMaskLayer() );
|
||||
@@ -746,31 +672,25 @@ public class ObjectUtils {
|
||||
return target;
|
||||
}
|
||||
|
||||
// public static MogoLatLng fromAMap( LatLng latLng ) {
|
||||
// if ( latLng == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// return new MogoLatLng( latLng.latitude, latLng.longitude );
|
||||
// }
|
||||
|
||||
public static MapCameraPosition fromAMap( CameraPosition position ) {
|
||||
if ( position == null ) {
|
||||
public static MapCameraPosition fromAMap(CameraPosition position) {
|
||||
if (position == null) {
|
||||
return null;
|
||||
}
|
||||
return new MapCameraPosition( fromAMap( position.getTarget() ), position.getBearing(), position.getTilt(), position.getZoom() );
|
||||
return new MapCameraPosition(fromAMap(position.getTarget()), position.getBearing(), position.getTilt(), position.getZoom());
|
||||
}
|
||||
|
||||
private static String getCategory( String key ) {
|
||||
private static String getCategory(String key) {
|
||||
String category = "";
|
||||
if ( key.equals( "加油站" ) ) {
|
||||
if (key.equals("加油站")) {
|
||||
category = "6";
|
||||
} else if ( key.equals( "停车场" ) ) {
|
||||
} else if (key.equals("停车场")) {
|
||||
category = "12";
|
||||
} else if ( key.equals( "餐馆" ) ) {
|
||||
} else if (key.equals("餐馆")) {
|
||||
category = "22";
|
||||
} else if ( key.equals( "洗车" ) ) {
|
||||
} else if (key.equals("洗车")) {
|
||||
category = "8";
|
||||
} else if ( key.equals( "厕所" ) ) {
|
||||
} else if (key.equals("厕所")) {
|
||||
|
||||
}
|
||||
return category;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
GROUP=com.mogo.module.carchatout
|
||||
GROUP=com.mogo.module.carchatim
|
||||
POM_ARTIFACT_ID=module-carchatting
|
||||
VERSION_CODE=1
|
||||
@@ -1,3 +1,3 @@
|
||||
GROUP=com.mogo.module.carchatout
|
||||
GROUP=com.mogo.module.carchatim
|
||||
POM_ARTIFACT_ID=module-carchatting-provider
|
||||
VERSION_CODE=1
|
||||
@@ -1,3 +1,3 @@
|
||||
GROUP=com.mogo.module.carchatout
|
||||
GROUP=com.mogo.module.carchatim
|
||||
POM_ARTIFACT_ID=module-chat
|
||||
VERSION_CODE=1
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,21 +1,26 @@
|
||||
package com.mogo.tts.pad;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.aispeech.AIEchoConfig;
|
||||
import com.aispeech.AIError;
|
||||
import com.aispeech.DUILiteConfig;
|
||||
import com.aispeech.DUILiteSDK;
|
||||
import com.aispeech.common.AIConstant;
|
||||
import com.aispeech.export.config.AILocalTTSConfig;
|
||||
import com.aispeech.export.engines2.AILocalTTSEngine;
|
||||
import com.aispeech.export.config.AuthConfig;
|
||||
import com.aispeech.export.config.EchoConfig;
|
||||
import com.aispeech.export.engines.AILocalTTSEngine;
|
||||
import com.aispeech.export.intent.AILocalTTSIntent;
|
||||
import com.aispeech.export.listeners.AILocalTTSListener;
|
||||
import com.aispeech.export.listeners.AITTSListener;
|
||||
import com.aispeech.lite.AuthType;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.cloud.commons.BuildConfig;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
@@ -23,7 +28,6 @@ import com.mogo.tts.base.IMogoTTS;
|
||||
import com.mogo.tts.base.IMogoTTSCallback;
|
||||
import com.mogo.tts.base.MogoTTSConstants;
|
||||
import com.mogo.tts.base.PreemptType;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.auto.platform.voice.VoiceClient;
|
||||
import com.zhidao.voicesdk.MogoVoiceManager;
|
||||
@@ -92,11 +96,12 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
||||
//echo module res
|
||||
private static final String ECHO_RES = "echo/sspe_aec_ch2_mic1_ref1_asr_v2.0.0.95.bin";
|
||||
//local tts module res
|
||||
private static final String TTS_DICT_RES = "v2.1.31_aitts_sent_dict_local.db";
|
||||
private static final String TTS_FRONT_RES = "v2.1.31_local_front.bin";
|
||||
private static final String TTS_DICT_RES = "aitts_sent_dict_local.db";
|
||||
private static final String TTS_FRONT_RES = "local_front.bin";
|
||||
public static final String TTS_BACK_RES_GUODGM = "tts/guodgm_common_back_ce_local.v2.1.0.bin";
|
||||
private AILocalTTSEngine mEngine;
|
||||
private AILocalTTSIntent mAILocalTTSIntent;
|
||||
private String[] mBackResBinArray = new String[]{TTS_BACK_RES_ZHILING};
|
||||
private String[] mBackResBinArray = new String[]{TTS_BACK_RES_ZHILING,TTS_BACK_RES_GUODGM};
|
||||
// 单独的语音播放
|
||||
private boolean mHasAuth;
|
||||
|
||||
@@ -107,63 +112,58 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
||||
}
|
||||
|
||||
private void initTtsConfig() {
|
||||
Logger.d(TAG, "initTtsConfig");
|
||||
// 产品认证需设置 apiKey, productId, productKey, productSecret
|
||||
// DUILiteConfig config = new DUILiteConfig(
|
||||
// "d65ec9d65082d65ec9d65082614c36cc",
|
||||
// "279605401",
|
||||
// "cdb83d210ad55d7e9e388754eb890e7c",
|
||||
// "5bd044ac68dc193df2e0fc4be3a120dd");
|
||||
// config.setAuthTimeout(5000); //设置授权连接超时时长,默认5000ms
|
||||
// config.setExtraParameter("DEVICE_NAME", "fea815f374af8");
|
||||
// config.setExtraParameter("DEVICE_ID", "fea815f374af8");
|
||||
try {
|
||||
Logger.d(TAG, "initTtsConfig");
|
||||
//在线授权配置
|
||||
AuthConfig.Builder onlineBuilder = new AuthConfig.Builder()
|
||||
.setType(AuthType.ONLINE)
|
||||
.setCustomDeviceName(MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
|
||||
DUILiteConfig config = new DUILiteConfig(
|
||||
"113cc31f6385113cc31f6385618c86f5",
|
||||
"278586132",
|
||||
"1fe5930844b488a8d32d9ef7717be7dc",
|
||||
"f601ecc407986b548ac8ab2a9144162e");
|
||||
config.setExtraParameter("DEVICE_NAME", MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
config.setExtraParameter("DEVICE_ID", MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
config.setAuthTimeout(5000); //设置授权连接超时时长,默认5000ms
|
||||
config.setDeviceProfileDirPath("/sdcard/speech"); // 自定义设置授权文件的保存路径,需要确保该路径事先存在
|
||||
// config.setThreadAffinity(3); //绑定第3个核,降低CPU占用
|
||||
// config.setOfflineProfileName("auth.txt");//设置assetes目录下的离线授权文件
|
||||
//设置SDK录音模式
|
||||
// 单麦 单麦Echo 双麦 线性4麦 环形4麦 环形6麦,可选的
|
||||
config.setAudioRecorderType(audioRecorderType);
|
||||
if (config.getAudioRecorderType() == DUILiteConfig.TYPE_COMMON_ECHO) {
|
||||
AIEchoConfig aiEchoConfig = new AIEchoConfig();
|
||||
aiEchoConfig.setAecResource(ECHO_RES); // 设置echo的AEC资源文件
|
||||
aiEchoConfig.setChannels(2); //音频总的通道数
|
||||
aiEchoConfig.setMicNumber(1); //真实mic数
|
||||
// 默认为1,即左通道为rec录音音频,右通道为play参考音频(播放音频)
|
||||
// 若设置为2,通道会互换,即左通道为play参考音频(播放音频),右通道为rec录音音频
|
||||
aiEchoConfig.setRecChannel(1);
|
||||
aiEchoConfig.setSavedDirPath("/sdcard/aispeech/aecPcmFile/");//设置保存的aec原始输入和aec之后的音频文件路径
|
||||
config.setEchoConfig(aiEchoConfig);
|
||||
}
|
||||
if (BuildConfig.DEBUG) {
|
||||
config.openLog();
|
||||
// 设置log日志的级别
|
||||
DUILiteSDK.setDebugMode(3);
|
||||
}
|
||||
Logger.d(TAG, "DUILite SDK is isAuthorized ? " + DUILiteSDK.isAuthorized(mContext));
|
||||
DUILiteSDK.init(mContext,
|
||||
config,
|
||||
new DUILiteSDK.InitListener() {
|
||||
@Override
|
||||
public void success() {
|
||||
Logger.d(TAG, "授权成功!");
|
||||
mHasAuth = true;
|
||||
initTtsEngine();
|
||||
}
|
||||
//echo 配置
|
||||
EchoConfig echoConfig = new EchoConfig.Builder()
|
||||
.setAecResource(ECHO_RES)// 2mic AEC资源
|
||||
.setChannels(2)//设置音频通道数
|
||||
.setMicNumber(1)//设置mic数
|
||||
.setSavedDirPath("/sdcard/aispeech/aecPcmFile/")//设置echo前后音频保存路径
|
||||
.create();
|
||||
|
||||
@Override
|
||||
public void error(final String errorCode, final String errorInfo) {
|
||||
Logger.d(TAG, "授权失败\n\nErrorCode:" + errorCode + "\n\nErrorInfo:" + errorInfo);
|
||||
}
|
||||
});
|
||||
if (BuildConfig.DEBUG){
|
||||
DUILiteSDK.openLog();//开启日志,需要在sdk init 之前调用
|
||||
}
|
||||
|
||||
DUILiteSDK.init(mContext, new DUILiteConfig.Builder()
|
||||
.setApiKey("113cc31f6385113cc31f6385618c86f5")
|
||||
.setProductId("278586132")
|
||||
.setProductKey("1fe5930844b488a8d32d9ef7717be7dc")
|
||||
.setProductSecret("f601ecc407986b548ac8ab2a9144162e")
|
||||
.setAuthConfig(onlineBuilder.create())//授权配置
|
||||
// .setRecorderConfig(recorderConfig)//设置录音配置
|
||||
// .setUploadConfig(uploadConfig)//设置日志上传配置
|
||||
// .setTtsCacheDir("/sdcard/speech/cache") //设置tts cache文件存放目录
|
||||
.setEchoConfig(echoConfig)
|
||||
.create(), new DUILiteSDK.InitListener() {
|
||||
@Override
|
||||
public void success() {
|
||||
Logger.d(TAG, "授权成功");
|
||||
mHasAuth = true;
|
||||
initTtsEngine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(String errorCode, final String errorInfo) {
|
||||
Logger.e(TAG, "error code : " + errorCode + " , error info :" + errorInfo);
|
||||
// throw new IllegalStateException("授权失败,请检查授权配置");
|
||||
}
|
||||
});
|
||||
|
||||
boolean isAuthorized = DUILiteSDK.isAuthorized(mContext);//查询授权状态,DUILiteSDK.init之后随时可以调
|
||||
Logger.d(TAG, "DUILite SDK is isAuthorized ? " + isAuthorized);
|
||||
|
||||
String core_version = DUILiteSDK.getCoreVersion();//获取内核版本号
|
||||
Logger.d(TAG, "core version is: " + core_version);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void initTtsEngine() {
|
||||
@@ -171,39 +171,45 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
||||
if (mEngine != null) {
|
||||
mEngine.destroy();
|
||||
}
|
||||
AILocalTTSConfig config = new AILocalTTSConfig();
|
||||
// 设置assets目录下合成字典名
|
||||
config.setDictResource(TTS_DICT_RES);//普通话字典
|
||||
// 设置合成字典的外部路径,包含文件名(需要手动拷贝到指定目录)
|
||||
// config.setDictResource("/sdcard/speech/tts/aitts_sent_dict_idx_middle_2.0.4_20180806.db");
|
||||
// AILocalTTSConfig config = new AILocalTTSConfig();
|
||||
// // 设置assets目录下合成字典名
|
||||
// config.setDictResource(TTS_DICT_RES);//普通话字典
|
||||
// // 设置合成字典的外部路径,包含文件名(需要手动拷贝到指定目录)
|
||||
// // config.setDictResource("/sdcard/speech/tts/aitts_sent_dict_idx_middle_2.0.4_20180806.db");
|
||||
//
|
||||
// // 非必需,用户自定义词典,用于修复离线合成问题,如多音字发音、停顿和数字字母符号读法错误等
|
||||
// // 正常情況用不着,这个只有有发音问题需要紧急修复可以改这个资源。user_source.bin该资源由合成组提供的工具包生成。
|
||||
// // config.setUserDictResource("user_source.bin");
|
||||
// // 设置assets目录下前端合成资源名
|
||||
// config.setFrontBinResource(TTS_FRONT_RES);//普通话前端资源
|
||||
// //config.setFrontBinResource(SampleConstants.TTS_FRONT_RES_YUEYU);//粤语前端资源
|
||||
// //config.setFrontBinResource(SampleConstants.TTS_FRONT_RES_SICHUAN);//四川话前端资源
|
||||
// // 设置合成前端资源的外部路径,包含文件名(需要手动拷贝到指定目录)
|
||||
// // config.setFrontBinResource("/sdcard/speech/tts/v2.1.23_local_front.bin");
|
||||
// // default is true
|
||||
// config.setUseCache(false);
|
||||
// //设置后端合成音色资源,如果只需设置一个,则array只需要传一个成员值就可以
|
||||
// config.addSpeakerResource(mBackResBinArray);
|
||||
// // 设置合成音色的外部路径,包含文件名(需要手动拷贝到指定目录)
|
||||
// // config.addSpeakerResource("/sdcard/speech/tts/zhilingf_common_back_ce_local.v2.1.0.bin");
|
||||
|
||||
// 非必需,用户自定义词典,用于修复离线合成问题,如多音字发音、停顿和数字字母符号读法错误等
|
||||
// 正常情況用不着,这个只有有发音问题需要紧急修复可以改这个资源。user_source.bin该资源由合成组提供的工具包生成。
|
||||
// config.setUserDictResource("user_source.bin");
|
||||
// 设置assets目录下前端合成资源名
|
||||
config.setFrontBinResource(TTS_FRONT_RES);//普通话前端资源
|
||||
//config.setFrontBinResource(SampleConstants.TTS_FRONT_RES_YUEYU);//粤语前端资源
|
||||
//config.setFrontBinResource(SampleConstants.TTS_FRONT_RES_SICHUAN);//四川话前端资源
|
||||
// 设置合成前端资源的外部路径,包含文件名(需要手动拷贝到指定目录)
|
||||
// config.setFrontBinResource("/sdcard/speech/tts/v2.1.23_local_front.bin");
|
||||
// default is true
|
||||
config.setUseCache(false);
|
||||
//设置后端合成音色资源,如果只需设置一个,则array只需要传一个成员值就可以
|
||||
config.addSpeakerResource(mBackResBinArray);
|
||||
// 设置合成音色的外部路径,包含文件名(需要手动拷贝到指定目录)
|
||||
// config.addSpeakerResource("/sdcard/speech/tts/zhilingf_common_back_ce_local.v2.1.0.bin");
|
||||
mEngine = AILocalTTSEngine.getInstance();//创建实例
|
||||
|
||||
mEngine = AILocalTTSEngine.createInstance();//创建实例
|
||||
AILocalTTSConfig config = new AILocalTTSConfig.Builder()
|
||||
.setFrontResBin(TTS_FRONT_RES)//设置前端合成资源路径.assets路径或sd卡路径均可
|
||||
.setDictDb(TTS_DICT_RES)//设置合成字典资源路径.assets路径或sd卡路径均可
|
||||
.setBackResBinArray(mBackResBinArray)//设置后端合成音色资源,如果只需设置一个,则array只需要传一个成员值就可以,init前设置setBackResBin接口无效
|
||||
.build();
|
||||
mEngine.init(config, new AILocalTTSListenerImpl());//初始化合成引擎
|
||||
|
||||
mAILocalTTSIntent = new AILocalTTSIntent();
|
||||
// 设置合成音语速,范围为0.5~2.0
|
||||
mAILocalTTSIntent.setSpeed(0.85f);
|
||||
mAILocalTTSIntent.setSpeechRate(0.85f);
|
||||
|
||||
mAILocalTTSIntent.setUseSSML(false); // 设置是否使用ssml合成语法,默认为false
|
||||
mAILocalTTSIntent.setVolume(100); // 设置合成音频的音量,范围为1~500
|
||||
mAILocalTTSIntent.setSpeechVolume(100); // 设置合成音频的音量,范围为1~500
|
||||
// 保存合成音频到指定路径,格式为wav
|
||||
mAILocalTTSIntent.setSaveAudioFilePath(Environment.getExternalStorageDirectory() + "/tts/"
|
||||
mAILocalTTSIntent.setSaveAudioFileName(Environment.getExternalStorageDirectory() + "/tts/"
|
||||
+ System.currentTimeMillis() + ".wav");
|
||||
}
|
||||
|
||||
@@ -339,9 +345,9 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
||||
Logger.d( TAG, "speakTTSVoice");
|
||||
if (mEngine != null && mHasAuth) {
|
||||
// 合成并播放
|
||||
mEngine.speak(mAILocalTTSIntent, text, "1024");
|
||||
mEngine.speak(text,"1024",mAILocalTTSIntent);
|
||||
// 合成音频,不播放,同时输出实时pcm音频,音频回调在onSynthesizeDataArrived接口
|
||||
mEngine.synthesize(mAILocalTTSIntent, text, "1024");
|
||||
// mEngine.synthesize(mAILocalTTSIntent, text, "1024");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,11 +526,11 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
||||
}
|
||||
|
||||
private boolean isVoiceServiceReady( Context context ) {
|
||||
if ( AppUtils.isProcessRunning( context, AppUtils.getPackageUid( context, "com.zhidao.speech" ) )) {
|
||||
if ( isProcessRunning( context, getPackageUid( context, "com.zhidao.speech" ) )) {
|
||||
Logger.d( TAG, "pad txz is voiceServiceReady" );
|
||||
return true;
|
||||
} else if ( AppUtils.isProcessRunning( context, AppUtils.getPackageUid( context, "com.txznet.txz" ) )
|
||||
&& AppUtils.isProcessRunning( context, AppUtils.getPackageUid( context, "com.txznet.adapter" ) ) ) {
|
||||
} else if ( isProcessRunning( context, getPackageUid( context, "com.txznet.txz" ) )
|
||||
&& isProcessRunning( context, getPackageUid( context, "com.txznet.adapter" ) ) ) {
|
||||
Logger.d( TAG, "txz is voiceServiceReady" );
|
||||
return true;
|
||||
}
|
||||
@@ -632,7 +638,7 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
||||
context.sendBroadcast( intent );
|
||||
}
|
||||
|
||||
private static class AILocalTTSListenerImpl implements AILocalTTSListener {
|
||||
private static class AILocalTTSListenerImpl implements AITTSListener {
|
||||
|
||||
@Override
|
||||
public void onInit(int status) {
|
||||
@@ -645,8 +651,23 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String utteranceId, AIError error) {
|
||||
Logger.d(TAG, "检测到错误:" + error.toString());
|
||||
public void onError(String s, AIError aiError) {
|
||||
Logger.d(TAG, "检测到错误:" + aiError.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReady(String s) {
|
||||
Logger.d(TAG, "开始播放");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompletion(String s) {
|
||||
Logger.d(TAG, "播放完成");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(int currentTime, int totalTime, boolean isRefTextTTSFinished) {
|
||||
Logger.d(TAG, "当前:" + currentTime + "ms, 总计:" + totalTime + "ms, 可信度:" + isRefTextTTSFinished);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -665,20 +686,33 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
|
||||
public void onSynthesizeFinish(String utteranceId) {
|
||||
Logger.d(TAG, "合成结束");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeechStart(String utteranceId) {
|
||||
Logger.d(TAG, "开始播放");
|
||||
public static boolean isProcessRunning( Context context, int uid ) {
|
||||
if ( context == null ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeechProgress(int currentTime, int totalTime, boolean isRefTextTTSFinished) {
|
||||
Logger.d(TAG, "当前:" + currentTime + "ms, 总计:" + totalTime + "ms, 可信度:" + isRefTextTTSFinished);
|
||||
ActivityManager am = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
||||
List< ActivityManager.RunningServiceInfo > runningServiceInfos = am.getRunningServices( 200 );
|
||||
if ( runningServiceInfos.size() > 0 ) {
|
||||
for ( ActivityManager.RunningServiceInfo appProcess : runningServiceInfos ) {
|
||||
if ( uid == appProcess.uid ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeechFinish(String utteranceId) {
|
||||
Logger.d(TAG, "播放完成");
|
||||
return false;
|
||||
}
|
||||
//获取已安装应用的 uid,-1 表示未安装此应用或程序异常
|
||||
public static int getPackageUid( Context context, String packageName ) {
|
||||
try {
|
||||
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo( packageName, 0 );
|
||||
if ( applicationInfo != null ) {
|
||||
return applicationInfo.uid;
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
BIN
tts/tts-pad/src/main/jniLibs/arm64-v8a/libduiutils.so
Normal file → Executable file
BIN
tts/tts-pad/src/main/jniLibs/arm64-v8a/libduiutils.so
Normal file → Executable file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user