fix bug of car color and biz config upper case
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package com.mogo.eagle.core.function.v2x.speedlimit;
|
||||
|
||||
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
|
||||
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
@@ -8,58 +11,64 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.zhjt.service_biz.BizConfig;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* 限速
|
||||
*
|
||||
* @author mogoauto
|
||||
*/
|
||||
public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
|
||||
|
||||
private static SpeedLimitDataManager instance ;
|
||||
private static SpeedLimitDataManager instance;
|
||||
private Location mLocation;
|
||||
// private static Context mContext;
|
||||
private Timer mTimer;
|
||||
private SpeedLimitDataManager(){
|
||||
|
||||
private SpeedLimitDataManager() {
|
||||
}
|
||||
public static SpeedLimitDataManager getInstance(){
|
||||
if (instance == null){
|
||||
synchronized (SpeedLimitDataManager.class){
|
||||
if (instance == null){
|
||||
|
||||
public static SpeedLimitDataManager getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (SpeedLimitDataManager.class) {
|
||||
if (instance == null) {
|
||||
instance = new SpeedLimitDataManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
private class SpeedTimerTask extends TimerTask{
|
||||
|
||||
private class SpeedTimerTask extends TimerTask {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mLocation != null){
|
||||
if (mLocation != null) {
|
||||
if (MogoMapUIController.getInstance() != null) {
|
||||
int speedLimmit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (speedLimmit > 0) {
|
||||
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimmit);
|
||||
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimmit);
|
||||
}
|
||||
}
|
||||
});
|
||||
getSpeedLimit();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void start(){
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerCarLocationChangedListener("SpeedLimitDataManager",this);
|
||||
mTimer = new Timer();
|
||||
mTimer.schedule(new SpeedTimerTask(), 3000,1000);
|
||||
@BizConfig(biz = V2I,dependentBizNode = "",bizNode = BIZ_SLW)
|
||||
private void getSpeedLimit() {
|
||||
int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
|
||||
UiThreadHandler.post(() -> {
|
||||
if (speedLimit > 0) {
|
||||
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit);
|
||||
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerCarLocationChangedListener("SpeedLimitDataManager", this);
|
||||
Timer mTimer = new Timer();
|
||||
mTimer.schedule(new SpeedTimerTask(), 3000, 1000);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
mLocation = latLng;
|
||||
|
||||
Reference in New Issue
Block a user