From 4c18f7c2f17988b9ba003e588702ccaeee890b62 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 10 Jan 2023 10:18:40 +0800 Subject: [PATCH 01/12] [2.13.2] note the chainlog of pnc acc --- .../eagle/core/function/v2x/events/V2XEventManager.kt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index b5520f7be9..2d75560419 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -454,14 +454,6 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb } @SuppressLint("NewApi") - @ChainLog( - linkChainLog = CHAIN_LINK_LOG_CLOUD_V2N, - linkCode = CHAIN_LINK_CLOUD, - endpoint = TracingConstants.Endpoint.PAD, - nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_V2N, - paramIndexes = [0], - clientPkFileName = "sn" - ) override fun onAutopilotIdentifyPlanningObj(planningObjects: List?) { super.onAutopilotIdentifyPlanningObj(planningObjects) if(!FunctionBuildConfig.isV2NFromCar){ From f01b79de268963e00b8a14a6a562dd5818a35e65 Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 12 Jan 2023 13:46:54 +0800 Subject: [PATCH 02/12] =?UTF-8?q?[2.13.2]V2X=E6=96=B0=E5=A2=9E=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../och/bus/fragment/BaseBusTabFragment.java | 1 - .../com/mogo/functions/test/RoadAITest.kt | 21 ++ .../function/v2x/events/V2XEventManager.kt | 2 - .../v2x/events/alarm/V2XAlarmServer.java | 39 ++-- .../events/manager/IMoGoV2XMarkerManager.java | 7 +- .../manager/impl/MoGoV2XMarkerManager.java | 49 +++-- .../v2x/events/marker/MarkerManager.kt | 196 ++++++++++++++++++ .../events/scenario/impl/AbsV2XScenario.java | 5 +- .../scenario/impl/V2XScenarioManager.java | 8 + .../scenario/scene/airoad/AiRoadMarker.kt | 147 +++---------- .../scene/road/V2XAiRoadEventMarker.kt | 112 ++-------- .../scene/road/V2XRoadEventMarker.java | 56 +++-- .../scene/road/V2XRoadEventScenario.java | 18 +- .../route/V2XOptimalRouteVREventMarker.java | 14 +- .../route/V2XOptimalRouteVREventScenario.java | 15 +- .../warning/V2XFrontWarningScenario.java | 2 +- .../function/v2x/events/utils/EntityUtils.kt | 23 +- .../v2x/internal/data/V2XRoadXEvent.kt | 6 +- .../eagle/core/data/enums/EventTypeEnumNew.kt | 2 +- .../data/map/entity/V2XRoadEventEntity.java | 1 + .../call/map/CallerVisualAngleManager.kt | 7 +- gradle.properties | 2 +- 22 files changed, 383 insertions(+), 350 deletions(-) create mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index 6d442d2e28..bbfd9df381 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -37,7 +37,6 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager; import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView; -import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; diff --git a/app/src/androidTest/java/com/mogo/functions/test/RoadAITest.kt b/app/src/androidTest/java/com/mogo/functions/test/RoadAITest.kt index 5c29d76922..6f50da9ea0 100644 --- a/app/src/androidTest/java/com/mogo/functions/test/RoadAITest.kt +++ b/app/src/androidTest/java/com/mogo/functions/test/RoadAITest.kt @@ -7,7 +7,10 @@ import androidx.test.filters.* import com.mogo.eagle.core.function.hmi.ui.* import com.mogo.eagle.core.function.main.* import com.mogo.eagle.core.function.v2x.events.* +import com.mogo.eagle.core.function.v2x.internal.data.V2XRoadXData +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent.RoadAI +import com.mogo.eagle.core.utilcode.util.GsonUtils import kotlinx.coroutines.* import org.junit.* import org.junit.runner.* @@ -157,4 +160,22 @@ class RoadAITest { } } + + @Test + fun testRoadAI() = runBlocking { + ensureMoGoHmiFragmentShow() + val shigu = "{\"poiType\":\"100321\",\"receiveTime\":1673506266967,\"detectTime\":1673506266924,\"id\":\"f7b1df85-895a-41c1-b05d-7356955c1c91\",\"index\":\"636136931493454271\",\"polygon\":[{\"lon\":112.57321291454436,\"lat\":26.823070465392494},{\"lon\":112.573215006931,\"lat\":26.8230675990919},{\"lon\":112.573219106955,\"lat\":26.823061914715},{\"lon\":112.573223182233,\"lat\":26.8230562153801},{\"lon\":112.573227231639,\"lat\":26.8230505007471},{\"lon\":112.573231254048,\"lat\":26.8230447704754},{\"lon\":112.573235248336,\"lat\":26.8230390242245},{\"lon\":112.573239213377,\"lat\":26.8230332616541},{\"lon\":112.573243148045,\"lat\":26.8230274824236},{\"lon\":112.573247051217,\"lat\":26.8230216861928},{\"lon\":112.573250921765,\"lat\":26.823015872621},{\"lon\":112.573254758566,\"lat\":26.823010041368},{\"lon\":112.573258560494,\"lat\":26.8230041920932},{\"lon\":112.573262326424,\"lat\":26.8229983244562},{\"lon\":112.573266055231,\"lat\":26.8229924381166},{\"lon\":112.573269779025,\"lat\":26.8229864802436},{\"lon\":112.573273466,\"lat\":26.8229805039295},{\"lon\":112.573277118207,\"lat\":26.8229745102999},{\"lon\":112.573280737695,\"lat\":26.8229685004807},{\"lon\":112.573284326516,\"lat\":26.8229624755973},{\"lon\":112.57328788672,\"lat\":26.8229564367755},{\"lon\":112.573291420358,\"lat\":26.822950385141},{\"lon\":112.573294929481,\"lat\":26.8229443218192},{\"lon\":112.573298416139,\"lat\":26.822938247936},{\"lon\":112.573301882384,\"lat\":26.822932164617},{\"lon\":112.573305330265,\"lat\":26.8229260729878},{\"lon\":112.573308761833,\"lat\":26.8229199741741},{\"lon\":112.57331217914,\"lat\":26.8229138693015},{\"lon\":112.573315584235,\"lat\":26.8229077594956},{\"lon\":112.573318940869,\"lat\":26.8229017005891},{\"lon\":112.57332227685,\"lat\":26.8228956326057},{\"lon\":112.573325593901,\"lat\":26.8228895563037},{\"lon\":112.573328893742,\"lat\":26.8228834724414},{\"lon\":112.573332178097,\"lat\":26.8228773817772},{\"lon\":112.573335448685,\"lat\":26.8228712850694},{\"lon\":112.573338707228,\"lat\":26.8228651830762},{\"lon\":112.573341955449,\"lat\":26.822859076556},{\"lon\":112.573345195068,\"lat\":26.8228529662671},{\"lon\":112.573348427807,\"lat\":26.8228468529679},{\"lon\":112.573351655387,\"lat\":26.8228407374165},{\"lon\":112.57335487953,\"lat\":26.8228346203714},{\"lon\":112.573358101958,\"lat\":26.8228285025908},{\"lon\":112.573361324391,\"lat\":26.8228223848331},{\"lon\":112.573364548551,\"lat\":26.8228162678566},{\"lon\":112.573367776161,\"lat\":26.8228101524196},{\"lon\":112.57337100894,\"lat\":26.8228040392803},{\"lon\":112.573374248612,\"lat\":26.8227979291972},{\"lon\":112.573377570805,\"lat\":26.8227916708447},{\"lon\":112.573380890942,\"lat\":26.8227854119249},{\"lon\":112.573384209049,\"lat\":26.8227791523835},{\"lon\":112.573387525157,\"lat\":26.8227728921664},{\"lon\":112.573390839291,\"lat\":26.8227666312191},{\"lon\":112.573394151482,\"lat\":26.8227603694874},{\"lon\":112.573397461756,\"lat\":26.8227541069172},{\"lon\":112.573400770143,\"lat\":26.822747843454},{\"lon\":112.573404076669,\"lat\":26.8227415790437},{\"lon\":112.573407381363,\"lat\":26.822735313632},{\"lon\":112.573410684254,\"lat\":26.8227290471645},{\"lon\":112.57341398537,\"lat\":26.8227227795872},{\"lon\":112.573417284738,\"lat\":26.8227165108456},{\"lon\":112.573420582386,\"lat\":26.8227102408855},{\"lon\":112.573423878344,\"lat\":26.8227039696526},{\"lon\":112.573427172639,\"lat\":26.8226976970928},{\"lon\":112.573430465298,\"lat\":26.8226914231516},{\"lon\":112.5736541921437,\"lat\":26.822260937315143},{\"lon\":112.57362367177457,\"lat\":26.822244991227713},{\"lon\":112.573399937477,\"lat\":26.822675492918},{\"lon\":112.573396691977,\"lat\":26.8226816946351},{\"lon\":112.573393403264,\"lat\":26.8226879586397},{\"lon\":112.573390112889,\"lat\":26.8226942213535},{\"lon\":112.573386820836,\"lat\":26.8227004828209},{\"lon\":112.573383527072,\"lat\":26.822706742987},{\"lon\":112.573380231507,\"lat\":26.8227130021005},{\"lon\":112.573376934206,\"lat\":26.8227192599775},{\"lon\":112.573373635113,\"lat\":26.8227255169308},{\"lon\":112.573370334197,\"lat\":26.8227317727439},{\"lon\":112.573367031403,\"lat\":26.8227380276418},{\"lon\":112.573363726739,\"lat\":26.822744281759},{\"lon\":112.573360420141,\"lat\":26.8227505349933},{\"lon\":112.573357111541,\"lat\":26.8227567875221},{\"lon\":112.573353801054,\"lat\":26.8227630392523},{\"lon\":112.573350488563,\"lat\":26.8227692902611},{\"lon\":112.573347174021,\"lat\":26.8227755406808},{\"lon\":112.573343849991,\"lat\":26.8227818018286},{\"lon\":112.57334059532,\"lat\":26.8227879346295},{\"lon\":112.573337344447,\"lat\":26.8227940752481},{\"lon\":112.57333410391,\"lat\":26.8228002103548},{\"lon\":112.573330872,\"lat\":26.8228063391622},{\"lon\":112.573327646909,\"lat\":26.8228124609577},{\"lon\":112.573324426983,\"lat\":26.8228185749099},{\"lon\":112.573321210588,\"lat\":26.8228246801823},{\"lon\":112.573317995803,\"lat\":26.8228307762173},{\"lon\":112.573314781099,\"lat\":26.8228368621259},{\"lon\":112.573311564666,\"lat\":26.8228429372788},{\"lon\":112.573308344862,\"lat\":26.822849000878},{\"lon\":112.573305119998,\"lat\":26.8228550522037},{\"lon\":112.573301888377,\"lat\":26.8228610905445},{\"lon\":112.573298648327,\"lat\":26.8228671151949},{\"lon\":112.573295398165,\"lat\":26.8228731254473},{\"lon\":112.573292136233,\"lat\":26.822879120603},{\"lon\":112.573288860863,\"lat\":26.8228850999821},{\"lon\":112.573285560822,\"lat\":26.8228910767817},{\"lon\":112.573282199005,\"lat\":26.822897124157},{\"lon\":112.573278821808,\"lat\":26.8229031714324},{\"lon\":112.573275437073,\"lat\":26.8229092033326},{\"lon\":112.573272042813,\"lat\":26.8229152188038},{\"lon\":112.573268637042,\"lat\":26.8229212167948},{\"lon\":112.573265217788,\"lat\":26.8229271962611},{\"lon\":112.573261783086,\"lat\":26.8229331561851},{\"lon\":112.573258330982,\"lat\":26.8229390955283},{\"lon\":112.573254859519,\"lat\":26.8229450132931},{\"lon\":112.573251366753,\"lat\":26.8229509084733},{\"lon\":112.573247850743,\"lat\":26.8229567800818},{\"lon\":112.57324430955,\"lat\":26.8229626271411},{\"lon\":112.573240741245,\"lat\":26.8229684486883},{\"lon\":112.573237142704,\"lat\":26.8229742453022},{\"lon\":112.573233541124,\"lat\":26.8229799700034},{\"lon\":112.573229900299,\"lat\":26.8229856807403},{\"lon\":112.573226220729,\"lat\":26.8229913784753},{\"lon\":112.573222503466,\"lat\":26.8229970634612},{\"lon\":112.573218749581,\"lat\":26.8230027359391},{\"lon\":112.573214960128,\"lat\":26.8230083961865},{\"lon\":112.573211136192,\"lat\":26.8230140444302},{\"lon\":112.573207278832,\"lat\":26.8230196809522},{\"lon\":112.573203389132,\"lat\":26.8230253060135},{\"lon\":112.573199468169,\"lat\":26.8230309198603},{\"lon\":112.573195517033,\"lat\":26.8230365227693},{\"lon\":112.573191536797,\"lat\":26.8230421150085},{\"lon\":112.573187548559,\"lat\":26.8230476745161},{\"lon\":112.57318546455338,\"lat\":26.823050549063097}],\"polygonRoads\":[{\"tileId\":556834853,\"roadId\":\"130372\",\"laneNo\":-1,\"bearing\":152,\"roadName\":\"雁鸣路\"},{\"tileId\":556834853,\"roadId\":\"130372\",\"laneNo\":-2,\"bearing\":152,\"roadName\":\"雁鸣路\"},{\"tileId\":556834853,\"roadId\":\"130372\",\"laneNo\":-3,\"bearing\":152,\"roadName\":\"雁鸣路\"}],\"center\":{\"lon\":112.57320982521519,\"lat\":26.82306821019599},\"centerRoad\":{\"tileId\":556834853,\"roadId\":\"130372\",\"laneNo\":-2,\"bearing\":152,\"roadName\":\"雁鸣路\"},\"obstacles\":[{\"id\":0,\"type\":1,\"score\":95,\"polygon\":[{\"lon\":112.57321361221982,\"lat\":26.823054701276522},{\"lon\":112.57321254435868,\"lat\":26.823070134384093},{\"lon\":112.57320704440468,\"lat\":26.823066238995114},{\"lon\":112.57320772757787,\"lat\":26.823050237509577}],\"boundBox\":[{\"x\":2979.852783203125,\"y\":929.4248657226562},{\"x\":3031.54296875,\"y\":929.4248657226562},{\"x\":3031.54296875,\"y\":977.5980834960938},{\"x\":2979.852783203125,\"y\":977.5980834960938}],\"center\":{\"lon\":112.57320982521519,\"lat\":26.82306821019599}}],\"imgUrl\":\"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/roadwork_image/2023-01-12/f7b1df85-895a-41c1-b05d-7356955c1c91_172_18_24_62.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1673506267%3B1673513467%26q-key-time%3D1673506267%3B1673513467%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3Db6b2911110c9941471cfc447d7704b9caa57a0e1\",\"ip\":\"172.18.24.62\",\"score\":95,\"radius\":0,\"type\":2,\"trianglePolygon\":[[{\"lon\":112.57321291454436,\"lat\":26.823070465392494},{\"lon\":112.573215006931,\"lat\":26.8230675990919},{\"lon\":112.573219106955,\"lat\":26.823061914715},{\"lon\":112.573223182233,\"lat\":26.8230562153801},{\"lon\":112.573227231639,\"lat\":26.8230505007471},{\"lon\":112.573231254048,\"lat\":26.8230447704754},{\"lon\":112.573235248336,\"lat\":26.8230390242245},{\"lon\":112.573239213377,\"lat\":26.8230332616541},{\"lon\":112.573243148045,\"lat\":26.8230274824236},{\"lon\":112.573247051217,\"lat\":26.8230216861928},{\"lon\":112.573250921765,\"lat\":26.823015872621},{\"lon\":112.573254758566,\"lat\":26.823010041368},{\"lon\":112.573258560494,\"lat\":26.8230041920932},{\"lon\":112.573262326424,\"lat\":26.8229983244562},{\"lon\":112.573266055231,\"lat\":26.8229924381166},{\"lon\":112.573269779025,\"lat\":26.8229864802436},{\"lon\":112.573273466,\"lat\":26.8229805039295},{\"lon\":112.573277118207,\"lat\":26.8229745102999},{\"lon\":112.573280737695,\"lat\":26.8229685004807},{\"lon\":112.573284326516,\"lat\":26.8229624755973},{\"lon\":112.57328788672,\"lat\":26.8229564367755},{\"lon\":112.573291420358,\"lat\":26.822950385141},{\"lon\":112.573294929481,\"lat\":26.8229443218192},{\"lon\":112.573298416139,\"lat\":26.822938247936},{\"lon\":112.573301882384,\"lat\":26.822932164617},{\"lon\":112.573305330265,\"lat\":26.8229260729878},{\"lon\":112.573308761833,\"lat\":26.8229199741741},{\"lon\":112.57331217914,\"lat\":26.8229138693015},{\"lon\":112.573315584235,\"lat\":26.8229077594956},{\"lon\":112.573318940869,\"lat\":26.8229017005891},{\"lon\":112.57332227685,\"lat\":26.8228956326057},{\"lon\":112.573325593901,\"lat\":26.8228895563037},{\"lon\":112.573328893742,\"lat\":26.8228834724414},{\"lon\":112.573332178097,\"lat\":26.8228773817772},{\"lon\":112.573335448685,\"lat\":26.8228712850694},{\"lon\":112.573338707228,\"lat\":26.8228651830762},{\"lon\":112.573341955449,\"lat\":26.822859076556},{\"lon\":112.573345195068,\"lat\":26.8228529662671},{\"lon\":112.573348427807,\"lat\":26.8228468529679},{\"lon\":112.573351655387,\"lat\":26.8228407374165},{\"lon\":112.57335487953,\"lat\":26.8228346203714},{\"lon\":112.573358101958,\"lat\":26.8228285025908},{\"lon\":112.573361324391,\"lat\":26.8228223848331},{\"lon\":112.573364548551,\"lat\":26.8228162678566},{\"lon\":112.573367776161,\"lat\":26.8228101524196},{\"lon\":112.57337100894,\"lat\":26.8228040392803},{\"lon\":112.573374248612,\"lat\":26.8227979291972},{\"lon\":112.573377570805,\"lat\":26.8227916708447},{\"lon\":112.573380890942,\"lat\":26.8227854119249},{\"lon\":112.573384209049,\"lat\":26.8227791523835},{\"lon\":112.573387525157,\"lat\":26.8227728921664},{\"lon\":112.573390839291,\"lat\":26.8227666312191},{\"lon\":112.573394151482,\"lat\":26.8227603694874},{\"lon\":112.573397461756,\"lat\":26.8227541069172},{\"lon\":112.573400770143,\"lat\":26.822747843454},{\"lon\":112.573404076669,\"lat\":26.8227415790437},{\"lon\":112.573407381363,\"lat\":26.822735313632},{\"lon\":112.573410684254,\"lat\":26.8227290471645},{\"lon\":112.57341398537,\"lat\":26.8227227795872},{\"lon\":112.573417284738,\"lat\":26.8227165108456},{\"lon\":112.573420582386,\"lat\":26.8227102408855},{\"lon\":112.573423878344,\"lat\":26.8227039696526},{\"lon\":112.573427172639,\"lat\":26.8226976970928},{\"lon\":112.573430465298,\"lat\":26.8226914231516},{\"lon\":112.5736541921437,\"lat\":26.822260937315143},{\"lon\":112.57362367177457,\"lat\":26.822244991227713},{\"lon\":112.573399937477,\"lat\":26.822675492918},{\"lon\":112.573396691977,\"lat\":26.8226816946351},{\"lon\":112.573393403264,\"lat\":26.8226879586397},{\"lon\":112.573390112889,\"lat\":26.8226942213535},{\"lon\":112.573386820836,\"lat\":26.8227004828209},{\"lon\":112.573383527072,\"lat\":26.822706742987},{\"lon\":112.573380231507,\"lat\":26.8227130021005},{\"lon\":112.573376934206,\"lat\":26.8227192599775},{\"lon\":112.573373635113,\"lat\":26.8227255169308},{\"lon\":112.573370334197,\"lat\":26.8227317727439},{\"lon\":112.573367031403,\"lat\":26.8227380276418},{\"lon\":112.573363726739,\"lat\":26.822744281759},{\"lon\":112.573360420141,\"lat\":26.8227505349933},{\"lon\":112.573357111541,\"lat\":26.8227567875221},{\"lon\":112.573353801054,\"lat\":26.8227630392523},{\"lon\":112.573350488563,\"lat\":26.8227692902611},{\"lon\":112.573347174021,\"lat\":26.8227755406808},{\"lon\":112.573343849991,\"lat\":26.8227818018286},{\"lon\":112.57334059532,\"lat\":26.8227879346295},{\"lon\":112.573337344447,\"lat\":26.8227940752481},{\"lon\":112.57333410391,\"lat\":26.8228002103548},{\"lon\":112.573330872,\"lat\":26.8228063391622},{\"lon\":112.573327646909,\"lat\":26.8228124609577},{\"lon\":112.573324426983,\"lat\":26.8228185749099},{\"lon\":112.573321210588,\"lat\":26.8228246801823},{\"lon\":112.573317995803,\"lat\":26.8228307762173},{\"lon\":112.573314781099,\"lat\":26.8228368621259},{\"lon\":112.573311564666,\"lat\":26.8228429372788},{\"lon\":112.573308344862,\"lat\":26.822849000878},{\"lon\":112.573305119998,\"lat\":26.8228550522037},{\"lon\":112.573301888377,\"lat\":26.8228610905445},{\"lon\":112.573298648327,\"lat\":26.8228671151949},{\"lon\":112.573295398165,\"lat\":26.8228731254473},{\"lon\":112.573292136233,\"lat\":26.822879120603},{\"lon\":112.573288860863,\"lat\":26.8228850999821},{\"lon\":112.573285560822,\"lat\":26.8228910767817},{\"lon\":112.573282199005,\"lat\":26.822897124157},{\"lon\":112.573278821808,\"lat\":26.8229031714324},{\"lon\":112.573275437073,\"lat\":26.8229092033326},{\"lon\":112.573272042813,\"lat\":26.8229152188038},{\"lon\":112.573268637042,\"lat\":26.8229212167948},{\"lon\":112.573265217788,\"lat\":26.8229271962611},{\"lon\":112.573261783086,\"lat\":26.8229331561851},{\"lon\":112.573258330982,\"lat\":26.8229390955283},{\"lon\":112.573254859519,\"lat\":26.8229450132931},{\"lon\":112.573251366753,\"lat\":26.8229509084733},{\"lon\":112.573247850743,\"lat\":26.8229567800818},{\"lon\":112.57324430955,\"lat\":26.8229626271411},{\"lon\":112.573240741245,\"lat\":26.8229684486883},{\"lon\":112.573237142704,\"lat\":26.8229742453022},{\"lon\":112.573233541124,\"lat\":26.8229799700034},{\"lon\":112.573229900299,\"lat\":26.8229856807403},{\"lon\":112.573226220729,\"lat\":26.8229913784753},{\"lon\":112.573222503466,\"lat\":26.8229970634612},{\"lon\":112.573218749581,\"lat\":26.8230027359391},{\"lon\":112.573214960128,\"lat\":26.8230083961865},{\"lon\":112.573211136192,\"lat\":26.8230140444302},{\"lon\":112.573207278832,\"lat\":26.8230196809522},{\"lon\":112.573203389132,\"lat\":26.8230253060135},{\"lon\":112.573199468169,\"lat\":26.8230309198603},{\"lon\":112.573195517033,\"lat\":26.8230365227693},{\"lon\":112.573191536797,\"lat\":26.8230421150085},{\"lon\":112.573187548559,\"lat\":26.8230476745161},{\"lon\":112.57318546455338,\"lat\":26.823050549063097}]],\"obstaclePoint\":[{\"lon\":112.573443,\"lat\":26.822538},{\"lon\":112.573691,\"lat\":26.822676},{\"lon\":112.573021,\"lat\":26.823149},{\"lon\":112.572974,\"lat\":26.823199}],\"createTime\":1673506267760,\"createTimeStr\":\"2023-01-12 14:51:07\"}" + val road1 = "{\"poiType\":\"100061\",\"receiveTime\":1673509755649,\"detectTime\":1673509755637,\"id\":\"86447e30-2dfc-4a27-8d01-41ffe9a9a7fe\",\"index\":\"636136931493457343\",\"polygon\":[{\"lon\":112.57337137520945,\"lat\":26.822950000610152},{\"lon\":112.5733703998375,\"lat\":26.82294943400411},{\"lon\":112.57336923793872,\"lat\":26.82294944578748},{\"lon\":112.57336827709125,\"lat\":26.82295003202963},{\"lon\":112.57336786590433,\"lat\":26.822950822795498},{\"lon\":112.57332583348149,\"lat\":26.823144415135413},{\"lon\":112.57332583904886,\"lat\":26.823145130116597},{\"lon\":112.57332615359141,\"lat\":26.82314578706645},{\"lon\":112.57332672775591,\"lat\":26.823146282906478},{\"lon\":112.57332747145331,\"lat\":26.823146539837108},{\"lon\":112.57332807078356,\"lat\":26.823146549872188},{\"lon\":112.57332882464814,\"lat\":26.82314631801647},{\"lon\":112.57332941903356,\"lat\":26.823145841742402},{\"lon\":112.57332970267485,\"lat\":26.82314536795171},{\"lon\":112.57339652767452,\"lat\":26.82297757920771},{\"lon\":112.57339644737766,\"lat\":26.82297673161999},{\"lon\":112.57339607387638,\"lat\":26.822976136665098},{\"lon\":112.57337137520945,\"lat\":26.822950000610152}],\"polygonRoads\":[{\"tileId\":556834853,\"roadId\":\"130314\",\"laneNo\":-1,\"bearing\":330,\"roadName\":\"雁鸣路\"},{\"tileId\":556834853,\"roadId\":\"130314\",\"laneNo\":-2,\"bearing\":330,\"roadName\":\"雁鸣路\"},{\"tileId\":556834853,\"roadId\":\"130314\",\"laneNo\":-3,\"bearing\":330,\"roadName\":\"雁鸣路\"},{\"tileId\":556834853,\"roadId\":\"130583\",\"laneNo\":-1,\"bearing\":278}],\"center\":{\"lon\":112.57336404707121,\"lat\":26.823024407262803},\"centerRoad\":{\"tileId\":556834853,\"roadId\":\"130314\",\"laneNo\":-2,\"bearing\":330,\"roadName\":\"雁鸣路\"},\"obstacles\":[{\"id\":0,\"type\":1,\"score\":88,\"polygon\":[{\"lon\":112.57334137965555,\"lat\":26.82313245733589},{\"lon\":112.573329020958,\"lat\":26.823145531571242},{\"lon\":112.57332663570918,\"lat\":26.823144025991855},{\"lon\":112.57333875695714,\"lat\":26.823130823353114}],\"boundBox\":[{\"x\":1439.8624267578125,\"y\":893.4229736328125},{\"x\":1474.45361328125,\"y\":893.4229736328125},{\"x\":1474.45361328125,\"y\":966.433837890625},{\"x\":1439.8624267578125,\"y\":966.433837890625}],\"center\":{\"lon\":112.57332779256919,\"lat\":26.823144756804734}},{\"id\":1,\"type\":1,\"score\":87,\"polygon\":[{\"lon\":112.57339986657128,\"lat\":26.822898951544797},{\"lon\":112.5733716620538,\"lat\":26.822952992001163},{\"lon\":112.57336786188131,\"lat\":26.822949186370185},{\"lon\":112.57339561566401,\"lat\":26.822894141465785}],\"boundBox\":[{\"x\":2085.054443359375,\"y\":503.0662841796875},{\"x\":2116.11865234375,\"y\":503.0662841796875},{\"x\":2116.11865234375,\"y\":559.9113159179688},{\"x\":2085.054443359375,\"y\":559.9113159179688}],\"center\":{\"lon\":112.5733698249888,\"lat\":26.822951164464232}},{\"id\":2,\"type\":1,\"score\":71,\"polygon\":[{\"lon\":112.57342641528835,\"lat\":26.82293191667262},{\"lon\":112.57339610867105,\"lat\":26.82297860774548},{\"lon\":112.5733928192764,\"lat\":26.822975877911627},{\"lon\":112.57342270277888,\"lat\":26.822928610829003}],\"boundBox\":[{\"x\":1873.2490234375,\"y\":507.2391357421875},{\"x\":1900.5283203125,\"y\":507.2391357421875},{\"x\":1900.5283203125,\"y\":562.299560546875},{\"x\":1873.2490234375,\"y\":562.299560546875}],\"center\":{\"lon\":112.57339452365564,\"lat\":26.822977300519444}}],\"imgUrl\":\"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/roadwork_image/2023-01-12/86447e30-2dfc-4a27-8d01-41ffe9a9a7fe_172_18_24_62.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1673509757%3B1673516957%26q-key-time%3D1673509757%3B1673516957%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D557de14ddfb999d35ddef9e23b3532d9d299c62f\",\"ip\":\"172.18.24.62\",\"score\":82,\"radius\":0,\"type\":1,\"createTime\":1673509757496,\"createTimeStr\":\"2023-01-12 15:49:17\"}" + val road2 = "{\"poiType\":\"100061\",\"receiveTime\":1673509756306,\"detectTime\":1673509756290,\"id\":\"be6a2000-a96c-42c8-a7ef-f83388d84858\",\"index\":\"636136931493532287\",\"polygon\":[{\"lon\":112.5733515539896,\"lat\":26.823143145432386},{\"lon\":112.57335140084462,\"lat\":26.823142454672727},{\"lon\":112.57335096472467,\"lat\":26.823141869074952},{\"lon\":112.57335031202503,\"lat\":26.82314147779103},{\"lon\":112.57334954211333,\"lat\":26.82314134039038},{\"lon\":112.57334877220161,\"lat\":26.82314147779103},{\"lon\":112.573348119502,\"lat\":26.823141869074952},{\"lon\":112.57334768338202,\"lat\":26.823142454672727},{\"lon\":112.57334753023707,\"lat\":26.823143145432386},{\"lon\":112.57334768338202,\"lat\":26.82314383619207},{\"lon\":112.57334811950196,\"lat\":26.82314442178987},{\"lon\":112.5733487722016,\"lat\":26.823144813073792},{\"lon\":112.57334954211333,\"lat\":26.823144950474443},{\"lon\":112.57335031202504,\"lat\":26.823144813073792},{\"lon\":112.57335096472468,\"lat\":26.82314442178987},{\"lon\":112.57335140084464,\"lat\":26.82314383619207},{\"lon\":112.5733515539896,\"lat\":26.823143145432386}],\"polygonRoads\":[{\"tileId\":556834853,\"roadId\":\"130314\",\"laneNo\":-4,\"bearing\":332,\"roadName\":\"雁鸣路\"}],\"center\":{\"lon\":112.57334952644263,\"lat\":26.823143141971546},\"centerRoad\":{\"tileId\":556834853,\"roadId\":\"130314\",\"laneNo\":-4,\"bearing\":332,\"roadName\":\"雁鸣路\"},\"obstacles\":[{\"id\":0,\"type\":1,\"score\":72,\"polygon\":[{\"lon\":112.57341760772391,\"lat\":26.823104379136176},{\"lon\":112.57335121413183,\"lat\":26.82314367391432},{\"lon\":112.57334751791018,\"lat\":26.823142500693834},{\"lon\":112.57341321183773,\"lat\":26.82310322131963}],\"boundBox\":[{\"x\":1551.2252197265625,\"y\":352.58837890625},{\"x\":1562.4649658203125,\"y\":352.58837890625},{\"x\":1562.4649658203125,\"y\":376.17327880859375},{\"x\":1551.2252197265625,\"y\":376.17327880859375}],\"center\":{\"lon\":112.57334952644263,\"lat\":26.823143141971546}}],\"imgUrl\":\"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/roadwork_image/2023-01-12/be6a2000-a96c-42c8-a7ef-f83388d84858_172_18_24_42.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1673509758%3B1673516958%26q-key-time%3D1673509758%3B1673516958%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3Db2682464078ae53eae6e87f924abe17fa7c04ac8\",\"ip\":\"172.18.24.42\",\"score\":72,\"radius\":0,\"type\":1,\"createTime\":1673509758511,\"createTimeStr\":\"2023-01-12 15:49:18\"}" + val jingzhi1 = "{\"poiType\":\"100321\",\"detectTime\":1673506266924,\"id\":\"f7b1df85-895a-41c1-b05d-7356955c1c91\",\"index\":\"636136931493454271\",\"polygon\":[],\"center\":{\"lon\":112.57320982521519,\"lat\":26.82306821019599},\"centerRoad\":{\"tileId\":556834853,\"laneNo\":-2,\"bearing\":152},\"score\":95,\"radius\":0,\"type\":2}" + val jingzhi2 = "{\"poiType\":\"100321\",\"detectTime\":1673506266924,\"id\":\"f7b1df85-895a-41c1-b05d-7356955c1c91\",\"index\":\"636136931493454271\",\"polygon\":[],\"center\":{\"lon\":112.57320982521519,\"lat\":26.82306821019599},\"centerRoad\":{\"tileId\":556834853,\"laneNo\":-2,\"bearing\":152},\"score\":95,\"radius\":0,\"type\":2}" + val jingzhi3 = "{\"poiType\":\"100321\",\"detectTime\":1673506266924,\"id\":\"f7b1df85-895a-41c1-b05d-7356955c1c91\",\"index\":\"636136931493454271\",\"polygon\":[],\"center\":{\"lon\":112.57320982521519,\"lat\":26.82306821019599},\"centerRoad\":{\"tileId\":556834853,\"laneNo\":-2,\"bearing\":152},\"score\":95,\"radius\":0,\"type\":2}" + while (true) { + delay(1000) + V2XEventManager.onAck(V2XEvent.RoadEventX(data = GsonUtils.fromJson(shigu, V2XRoadXData::class.java))) + V2XEventManager.onAck(V2XEvent.RoadEventX(data = GsonUtils.fromJson(road1, V2XRoadXData::class.java))) + V2XEventManager.onAck(V2XEvent.RoadEventX(data = GsonUtils.fromJson(road2, V2XRoadXData::class.java))) + } + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index c4d8c01906..12d03d56ac 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -50,7 +50,6 @@ import com.mogo.eagle.core.function.v2x.events.network.* import com.mogo.eagle.core.function.v2x.events.observer.* import com.mogo.eagle.core.function.v2x.events.receiver.* import com.mogo.eagle.core.function.v2x.events.scenario.impl.* -import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.* import com.mogo.eagle.core.function.v2x.events.utils.* import com.mogo.eagle.core.function.v2x.events.utils.MapUtils import com.mogo.eagle.core.function.v2x.events.voice.* @@ -110,7 +109,6 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb BridgeApi.init(context) if (hasInit.compareAndSet(false, true)) { if (!V2XManager.hasInit()) { - AiRoadMarker.init(context) V2XManager.init(V2XConfig.Builder().also { it.aiCloudConfig(MoGoAiCloudClientConfig.getInstance()) it.context(context) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java index 244289a40e..7019f0601f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java @@ -75,32 +75,25 @@ public class V2XAlarmServer { double eventBearing = eventLocation.getAngle(); double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing); Log.d("RWJ", "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle); - if (diffAngle >= 0 && diffAngle <= 20) { + if (diffAngle <= 20) { // 3、计算当前车辆行驶方向与事件位置之间夹角《20度,保证道路事件在车辆前方 -// double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi( -// currentLocation.getLongitude(), -// currentLocation.getLatitude(), -// eventLocation.getLon(), -// eventLocation.getLat(), -// (int) currentLocation.getBearing() -// ); -// -// Log.d("RWJ", "eventAngle:" + eventAngle); -// if (0 <= eventAngle && eventAngle <= 20) { -// if (showedEvents.contains(v2XRoadEventEntity)) { -// return null; -// } -// Log.d("RWJ", "showed---"); -// showedEvents.add(v2XRoadEventEntity); -// return v2XRoadEventEntity; -// } + double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi( + currentLocation.getLongitude(), + currentLocation.getLatitude(), + eventLocation.getLon(), + eventLocation.getLat(), + (int) currentLocation.getBearing() + ); - if (showedEvents.contains(v2XRoadEventEntity)) { - return null; + Log.d("RWJ", "eventAngle:" + eventAngle); + if (0 <= eventAngle && eventAngle <= 20) { + if (showedEvents.contains(v2XRoadEventEntity)) { + return null; + } + Log.d("RWJ", "showed---"); + showedEvents.add(v2XRoadEventEntity); + return v2XRoadEventEntity; } - Log.d("RWJ", "showed---"); - showedEvents.add(v2XRoadEventEntity); - return v2XRoadEventEntity; } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java index 5d795e8cd3..f82f7c4014 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java @@ -4,6 +4,7 @@ import android.content.Context; import com.alibaba.android.arouter.facade.template.IProvider; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; +import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult; @@ -37,11 +38,11 @@ public interface IMoGoV2XMarkerManager extends IProvider { /** * 绘制正在预警的道路事件的POI点 - * - * @param context + * @param context * @param roadEventEntity + * @return */ - void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener); + IMogoMarker drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener); /** * 清除 道路事件 POI diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java index 2269ede098..0e19213da2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java @@ -56,8 +56,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { // 记录所有的:新鲜事儿的道路事件点、探路事件 private static final CopyOnWriteArraySet mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>(); - // 上次的道路事件的预警Marker - private static IMogoMarker mAlarmInfoMarker; + @Override public void drawableLastAllPOI() { @@ -133,7 +132,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { } @Override - public void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) { + public IMogoMarker drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) { try { IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); if (v2xStatus != null) { @@ -148,7 +147,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { .latitude(roadEventEntity.getLocation().getLat()) .longitude(roadEventEntity.getLocation().getLon()); optionsRipple.anchor(0.5f, 0.5f); - MarkerShowEntity markerShowEntity = new MarkerShowEntity(); MarkerExploreWay markerExploreWay = roadEventEntity.getNoveltyInfo(); markerShowEntity.setBindObj(markerExploreWay); @@ -156,22 +154,21 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { markerShowEntity.setTextContent(markerExploreWay.getAddr()); markerShowEntity.setMarkerLocation(markerExploreWay.getLocation()); markerShowEntity.setMarkerType(CARD_TYPE_NOVELTY); - optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity)); optionsRipple.period(1); - + IMogoMarker ret = null; if (MogoStatusManager.getInstance().isVrMode()) { - mAlarmInfoMarker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity); + ret = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity); } else { optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity)); IMogoMarkerManager marker = MogoMarkerManager.getInstance(context); if (marker != null) { - mAlarmInfoMarker = marker.addMarker(V2X_EVENT_ALARM_POI, optionsRipple); + ret = marker.addMarker(V2X_EVENT_ALARM_POI, optionsRipple); } } // 当前Marker设置为最上面 - if (mAlarmInfoMarker != null) { - mAlarmInfoMarker.setToTop(); + if (ret != null) { + ret.setToTop(); } // 绘制连接线 IMoGoV2XPolylineManager polylineManager = BridgeApi.INSTANCE.v2xPolyline(); @@ -183,28 +180,30 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { new MogoLatLng(roadEventEntity.getLocation().getLat(), roadEventEntity.getLocation().getLon() ), context); + + return ret; } else { CallerLogger.INSTANCE.e(M_V2X + TAG, "Location 必须进行初始化!!!!!"); } } catch (Exception e) { e.printStackTrace(); } + return null; } @Override public void clearAlarmPOI() { - - boolean isRoadEventPOIShow = false; - IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); - if (v2xStatus != null) { - isRoadEventPOIShow = v2xStatus.isRoadEventPOIShow(); - } - if (isRoadEventPOIShow) { - v2xStatus.setRoadEventPOIShow(TAG, false); - if (mAlarmInfoMarker != null) { - mAlarmInfoMarker.remove(); - } - } +// boolean isRoadEventPOIShow = false; +// IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); +// if (v2xStatus != null) { +// isRoadEventPOIShow = v2xStatus.isRoadEventPOIShow(); +// } +// if (isRoadEventPOIShow) { +// v2xStatus.setRoadEventPOIShow(TAG, false); +// if (mAlarmInfoMarker != null) { +// mAlarmInfoMarker.remove(); +// } +// } } @Override @@ -221,9 +220,9 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { @Override public void forceClearAlarmPOI() { - if (mAlarmInfoMarker != null) { - mAlarmInfoMarker.remove(); - } +// if (mAlarmInfoMarker != null) { +// mAlarmInfoMarker.remove(); +// } } @Override diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt new file mode 100644 index 0000000000..1da4e586ae --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt @@ -0,0 +1,196 @@ +package com.mogo.eagle.core.function.v2x.events.marker + +import android.os.Handler +import android.os.HandlerThread +import android.util.Log +import com.mogo.cloud.commons.utils.CoordinateUtils +import com.mogo.commons.utils.DrivingDirectionUtils +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager +import com.mogo.map.marker.IMogoMarker +import com.mogo.map.overlay.IMogoPolyline +import kotlinx.coroutines.Runnable +import java.util.LinkedList +import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicReference + + +data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val coordinateType: Int, var markers: ArrayList? = null, var lines: ArrayList? = null) { + + fun addLine(line: IMogoPolyline) { + var ll = this.lines + if (ll == null) { + ll = ArrayList() + this.lines = ll + } + ll.add(line) + } + + fun addMarker(marker: IMogoMarker) { + var mm = this.markers + if (mm == null) { + mm = ArrayList() + this.markers = mm + } + mm.add(marker) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as MarkerWrapper + + if (id != other.id) return false + + return true + } + + override fun hashCode(): Int { + return id.hashCode() + } +} + +object MarkerManager { + + private const val TAG = "MarkerManager" + + private val markers by lazy { LinkedList() } + + private val toRemoveMakers by lazy { LinkedList() } + + private val isFirstAdd by lazy { AtomicBoolean(false) } + + private val elapsedDistances by lazy { ConcurrentHashMap() } + + private val lastCarLocation by lazy { AtomicReference() } + + private val lastGpsLocation by lazy { AtomicReference() } + + private val checkTask = object : Runnable { + + override fun run() { + + try { + Log.d(TAG, "--- checkTask --- 1 ---") + if (lastCarLocation.get() == null) { + return + } + Log.d(TAG, "--- checkTask --- 2 ---") + if (lastGpsLocation.get() == null) { + return + } + Log.d(TAG, "--- checkTask --- 3 ---") + val toRemove = toRemoveMakers.iterator() + val carLoc = AtomicReference() + while (toRemove.hasNext()) { + val marker = toRemove.next() + if (carLoc.get() == null) { + carLoc.set(if (marker.coordinateType == 0) { + //高德坐标 + CallerMapLocationListenerManager.getCurrentLocation() + } else { + CallerMapLocationListenerManager.getCurrentGpsLocation() + }) + } + val currentLocation = carLoc.get() + val lastLocation = if (marker.coordinateType == 0) lastCarLocation.get() else lastGpsLocation.get() + + if (marker.coordinateType == 0) { + lastCarLocation.set(currentLocation) + } else { + lastGpsLocation.set(currentLocation) + } + if (currentLocation != null && lastLocation != null) { + val delta = CoordinateUtils.calculateLineDistance(currentLocation.longitude, currentLocation.latitude, lastLocation.longitude, lastLocation.latitude) + Log.d(TAG, "--- checkTask --- 4 ---:delta:$delta") + var elapsed = elapsedDistances[marker] + if (elapsed == null) { + elapsed = delta.toDouble() + } else { + elapsed += delta + } + Log.d(TAG, "--- checkTask --- 5 ---:delta:$delta, elapsed:${elapsed}") + if (elapsed >= 300) { + var removeMarkerError = marker.markers == null || marker.markers?.isEmpty() == true + marker.markers?.forEach { + try { + it.setVisible(false) + it.destroy() + } catch (t: Throwable) { + t.printStackTrace() + removeMarkerError = true + Log.e(TAG, "--- checkTask --- remove marker error:${t.message}") + } + } + var removeLineError = marker.lines == null || marker.lines?.isEmpty() == true + marker.lines?.forEach { + try { + it.isVisible = false + it.destroy() + } catch (t: Throwable) { + t.printStackTrace() + removeLineError = true + Log.e(TAG, "--- checkTask --- remove line error:${t.message}") + } + } + if (!removeLineError && !removeMarkerError) { + toRemove.remove() + } + synchronized(elapsedDistances) { + elapsedDistances.remove(marker) + } + } else { + elapsedDistances[marker] = elapsed + } + } + } + val iterator = markers.iterator() + while (iterator.hasNext()) { + val marker = iterator.next() + if (carLoc.get() == null) { + carLoc.set(if (marker.coordinateType == 0) { + //高德坐标 + CallerMapLocationListenerManager.getCurrentLocation() + } else { + CallerMapLocationListenerManager.getCurrentGpsLocation() + }) + } + val location = carLoc.get() + if (location != null) { + val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(location.longitude, location.latitude, marker.lon, marker.lat, location.bearing.toDouble()) + if (angle >= 90) { + iterator.remove() + synchronized(toRemoveMakers) { + toRemoveMakers.offer(marker) + } + } + } + } + } catch (t: Throwable) { + t.printStackTrace() + } finally { + lastCarLocation.set(CallerMapLocationListenerManager.getCurrentLocation()) + lastGpsLocation.set(CallerMapLocationListenerManager.getCurrentGpsLocation()) + handler.postDelayed(this, 1000) + } + } + } + + private val handler by lazy { + val thread = HandlerThread("check_marker_expired") + thread.start() + Handler(thread.looper) + } + + + fun addMarker(marker: MarkerWrapper) { + synchronized(markers) { + markers.offer(marker) + } + if (isFirstAdd.compareAndSet(false,true)) { + handler.postDelayed(checkTask, 1000) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java index 8fe0d5b892..88baed92e0 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java @@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicReference; public abstract class AbsV2XScenario implements IV2XScenario { protected String TAG = "AbsV2XScenario"; private IV2XMarker mV2XMarker; - private static final AtomicReference mV2XMessageEntity = new AtomicReference<>(); + private final AtomicReference mV2XMessageEntity = new AtomicReference<>(); protected AbsV2XScenario() { } @@ -28,13 +28,14 @@ public abstract class AbsV2XScenario implements IV2XScenario { @Override public void close() { - clearPOI(); +// clearPOI(); } /** * 释放资源 */ public void release() { + mV2XMessageEntity.set(null); mV2XMarker = null; } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java index a8f916dc9f..5220d55573 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java @@ -35,6 +35,8 @@ public class V2XScenarioManager implements IV2XScenarioManager { private static final String TAG = "V2XScenarioManager"; private AbsV2XScenario mV2XScenario = null; + private AtomicReference last = new AtomicReference<>(); + private V2XScenarioManager() { } @@ -54,6 +56,12 @@ public class V2XScenarioManager implements IV2XScenarioManager { public void handlerMessage(V2XMessageEntity v2XMessageEntity) { CallerLogger.INSTANCE.d(M_V2X + TAG, "处理V2X场景:" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString())); try { + + V2XMessageEntity old = last.get(); + if (old != null && old.equals(v2XMessageEntity)) { + return; + } + last.set(v2XMessageEntity); synchronized (V2XScenarioManager.class) { // 展示 ThreadUtils.runOnUiThread(() -> { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt index 5251b27fa6..dfbf16bf89 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt @@ -1,93 +1,65 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad import android.animation.* -import android.content.* import android.graphics.* import android.os.* import android.view.animation.* import androidx.core.util.Pair -import androidx.lifecycle.* -import androidx.lifecycle.Lifecycle.Event -import androidx.lifecycle.Lifecycle.Event.ON_CREATE -import androidx.lifecycle.Lifecycle.Event.ON_DESTROY import com.mogo.cloud.commons.utils.CoordinateUtils import com.mogo.commons.utils.DrivingDirectionUtils import com.mogo.eagle.core.data.map.* -import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity -import com.mogo.eagle.core.function.api.map.listener.* -import com.mogo.eagle.core.function.api.v2x.* import com.mogo.eagle.core.function.call.map.* -import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener -import com.mogo.eagle.core.function.call.v2x.* -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI +import com.mogo.eagle.core.function.v2x.events.marker.MarkerManager +import com.mogo.eagle.core.function.v2x.events.marker.MarkerWrapper import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.* -import com.mogo.eagle.core.utilcode.kotlin.* import com.mogo.eagle.core.utilcode.mogo.logger.* import com.mogo.map.* import com.mogo.map.overlay.* -import io.netty.util.internal.* import java.lang.Runnable import java.util.* +import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.* import kotlin.collections.ArrayList /** * Ai云道路施工事件,道路颜色标记类 */ -object AiRoadMarker { +class AiRoadMarker { - private const val TAG = "AiRoadMarker" + companion object { + @JvmField + val aiMakers = ConcurrentHashMap() + } + + private val TAG = "AiRoadMarker" private val marker by lazy { AtomicReference() } - private val carLocation by lazy { AtomicReference>() } - private val overlayManager by lazy { MogoOverlayManager.getInstance() } - private val line by lazy { AtomicReference() } - private val START_COLOR = Color.parseColor("#002ABAD9") private val END_COLOR = Color.parseColor("#66FF7A30") + private val roadMarker by lazy { V2XAiRoadEventMarker() } + + private val line = AtomicReference() + private val handler by lazy { Handler(Looper.getMainLooper()) } private val checkExpiredTask = Runnable { val poi = this.marker.get() - val car = this.carLocation.get() + val car = CallerMapLocationListenerManager.getCurrentGpsLocation() if (poi != null && car != null) { - val distance = CoordinateUtils.calculateLineDistance(car.first, car.second, poi.poi_lon, poi.poi_lat) + val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat) if (distance < 500) { unMarker(poi) } } } - private val onClearAllMarker = object : OnClearAllMarker { - - override fun onClearAllMarkers() { - Logger.d(TAG, "--- onClearAllMarkers ----") - val marker = this@AiRoadMarker.marker.get() - if (marker != null) { - Logger.d(TAG, "--- onClearAllMarkers ----2") - unMarker(marker) - } - } - - override fun onClearAllMarkers(tag: String) { - Logger.d(TAG, "--- onClearAllMarkers ----: tag: $tag") - val marker = this@AiRoadMarker.marker.get() - if (marker != null && tag == V2X_EVENT_ALARM_POI) { - Logger.d(TAG, "--- onClearAllMarkers ----: tag: -- 1: $tag") - unMarker(marker) - } - } - } - - private val markers = ConcurrentSet() - private val options by lazy { MogoPolylineOptions().apply { zIndex(40000f) @@ -97,71 +69,21 @@ object AiRoadMarker { } } - fun init(ctx: Context) { - ctx.lifeCycleOwner.lifecycle.addObserver(object : LifecycleEventObserver { - override fun onStateChanged(source: LifecycleOwner, event: Event) { - if (event == ON_CREATE) { - onCreate() - } - if (event == ON_DESTROY) { - onDestroy() - } - } - }) - } - - private val onLocationListener = object : IMoGoMapLocationListener { - - override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) { - if (location == null || !isGps) { - return - } - try { - val loc = arrayOf(location.longitude, location.latitude) - carLocation.set(Triple(loc[0], loc[1], location.bearing.toDouble())) - } catch (t: Throwable) { - Logger.e(TAG, "error: ${t.message}") - } - } - } - - private fun onCreate() { - CallMarkersClearManager.addAllMarkersClearListener(TAG, onClearAllMarker) - CallerMapLocationListenerManager.addListener(TAG, onLocationListener, true) - } - - private fun onDestroy() { - CallMarkersClearManager.removeAllMarkersClearListener(TAG) - CallerMapLocationListenerManager.removeListener(TAG, true) - removeLine() - } - fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false) { - handler.removeCallbacks(checkExpiredTask) - val location = carLocation.get() ?: return - if (markers.contains(marker)) { - Logger.d(TAG, "--- maker --- cache hit ---") - return - } - Logger.d(TAG, "--- marker ---:${marker}") - synchronized(markers) { - markers += marker - } + val location = CallerMapLocationListenerManager.getCurrentGpsLocation() ?: return this.marker.set(marker) + val wrapper = MarkerWrapper(marker.id, marker.poi_lon, marker.poi_lat, 1, null, null) if (drawMarker) { - marker.entity?.apply { V2XAiRoadEventMarker.drawMarkers(this) } + marker.entity?.apply { roadMarker.drawMarkers(this, wrapper) } } if (drawRoadLine) { //施工中心点前方的自车行驶方向上300米距离 - val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), 300f) + val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.bearing, 300f) //施工中心点后方的自车行驶方向上300米距离 Logger.d(TAG, "--- marker --- 3 --- l1: $l1") - val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), -300f) + val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.bearing, -300f) if (l1.points.isEmpty() || l2.points.isEmpty()) { Logger.d(TAG, "--- marker --- 3 --- return ----") - synchronized(markers) { - markers.remove(marker) - } return } Logger.d(TAG, "--- marker --- 4 --- l2: $l2") @@ -178,7 +100,7 @@ object AiRoadMarker { var find: Pair = Pair(centerX, centerY) var min = Long.MAX_VALUE for (p in it) { - val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.third) + val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.bearing.toDouble()) if (angle < min) { min = angle find = p @@ -190,18 +112,14 @@ object AiRoadMarker { Logger.d(TAG, "--- marker --- 6 --- marker: $marker") if (l1 != null && l1.points.isNotEmpty()) { for (l in l1.points) { - if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, location.third + 180) < 90L) { + if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, (location.bearing + 180).toDouble()) < 90L) { points.add(l.let { MogoLatLng(it.second, it.first) }) } } } if (points.size <= 1) { - synchronized(markers) { - markers.remove(marker) - } return } - removeLine() val evaluator = ArgbEvaluator() val interceptor = DecelerateInterpolator(1.5f) val total = points.size @@ -223,8 +141,10 @@ object AiRoadMarker { if (!line.isVisible) { line.isVisible = true } - } else { - removeLine() + if (line != null) { + wrapper.addLine(line) + } + MarkerManager.addMarker(wrapper) } } @@ -239,22 +159,21 @@ object AiRoadMarker { } } - fun unMarker(marker: Marker) { + private fun unMarker(marker: Marker) { Logger.d(TAG, "--- unMarker ---") - markers -= marker this.marker.set(null) removeLine() - V2XAiRoadEventMarker.removeMarkers(null) + roadMarker.removeMarkers() handler.removeCallbacks(checkExpiredTask) } - fun receive(marker: Marker) { + fun receive() { Logger.d(TAG, "receive --- 1 ---") val poi = this.marker.get() - val car = this.carLocation.get() + val car = CallerMapLocationListenerManager.getCurrentGpsLocation() if (poi != null && car != null) { - val distance = CoordinateUtils.calculateLineDistance(car.first, car.second, marker.poi_lon, marker.poi_lat) - Logger.d(TAG, "receive --- 2 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance") + val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat) + Logger.d(TAG, "receive --- 2 ---:car:[${car.longitude}, ${car.latitude}] -> poi:[${poi.poi_lon}, ${poi.poi_lat}] --> distance:$distance") if (distance < 500) { checkExpired() } else { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt index 980b86d9d7..3fd2422a9c 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -1,42 +1,33 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road import android.graphics.* -import android.util.* -import com.mogo.cloud.commons.utils.* -import com.mogo.commons.utils.DrivingDirectionUtils +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.map.* import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.v2xMarker +import com.mogo.eagle.core.function.v2x.events.marker.MarkerWrapper import com.mogo.map.* import com.mogo.map.marker.* import com.mogo.map.overlay.* -import java.util.* import java.util.concurrent.atomic.* import kotlin.Pair import kotlin.collections.ArrayList -object V2XAiRoadEventMarker { +class V2XAiRoadEventMarker { private val current = AtomicReference?>>() private val v2xLocation = AtomicReference() - private val carLocation = AtomicReference() - - private val timer = Timer() - - private val timerTask by lazy { AtomicReference() } - - private val distance = AtomicInteger(0) - private val overlayManager by lazy { MogoOverlayManager.getInstance() } - fun drawMarkers(entity: V2XRoadEventEntity) { - removeMarkers(current.get()) - timerTask.get()?.cancel() + fun drawMarkers(entity: V2XRoadEventEntity, wrapper: MarkerWrapper) { val extra = entity.noveltyInfo.extras["polygon"] - if (extra is List<*>) { + v2xMarker()?.drawableAlarmPOI(context(), entity, null)?.also { + wrapper.addMarker(it) + } + if (extra is List<*> && entity.poiType != EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.poiType) { if (extra.size > 0) { val polygons: MutableList> = ArrayList() for (i in extra.indices) { @@ -52,7 +43,6 @@ object V2XAiRoadEventMarker { polygons.add(androidx.core.util.Pair.create(second, first)) } if (polygons.size > 0) { - v2xMarker()?.drawableAlarmPOI(context(), entity, null) val l2 = entity.noveltyInfo?.location ?: return v2xLocation.set(MogoLocation().also { it.longitude = l2.lon; it.latitude = l2.lat; it.bearing = l2.angle.toFloat() @@ -82,24 +72,17 @@ object V2XAiRoadEventMarker { current.set(Pair(line, null)) if (line != null) { line.isVisible = true + wrapper.addLine(line) } } } } } - fun removeMarkers(pair: Pair?>?) { - if (pair != null) { - realRemove(pair) - } else { - val prev = current.get() - if (prev != null) { - realRemove(prev) - val v2xMarker = v2xMarker() - v2xMarker?.also { - it.forceClearAlarmPOI() - } - } + fun removeMarkers() { + val prev = current.get() + if (prev != null) { + realRemove(prev) } } @@ -115,73 +98,4 @@ object V2XAiRoadEventMarker { } } } - - fun onLocationChanged(location: MogoLocation) { - val markerLocation = v2xLocation.get() - carLocation.set(location) - if (markerLocation != null) { - if (isOutOfRange( - markerLocation.longitude, - markerLocation.latitude, - location.longitude, - location.latitude, - location.bearing.toDouble() - ) - ) { - v2xLocation.set(null) - this.distance.set(0) - timer.schedule(object : TimerTask() { - override fun run() { - val carLocation = this@V2XAiRoadEventMarker.carLocation.get() - Log.d( - "XXXXX", - "timer do action ---: marker_lon: ${markerLocation.longitude}, marker_lat: ${markerLocation.latitude}, car_lon:${carLocation.longitude}, car_lat: ${carLocation.latitude}" - ) - checkDistanceIsValid( - markerLocation.longitude, - markerLocation.latitude, - carLocation - ) - } - }.also { this.timerTask.set(it) }, 1000, 1000) - } - } - } - - private fun checkDistanceIsValid(x1: Double, y1: Double, location: MogoLocation) { - val distance = DrivingDirectionUtils.distance(x1, y1, location.longitude, location.latitude) - Log.d("XXXXX", "distance: $distance") - if (this.distance.addAndGet(distance.toInt()) >= 100) { - Log.d("XXXXX", "remove marker") - removeMarkers(null) - this.timerTask.get()?.cancel() - } - } - - private fun isOutOfRange( - markerLon: Double, - markerLat: Double, - carLon: Double, - carLat: Double, - carAngle: Double - ): Boolean { - return !isFrontOfCar(markerLon, markerLat, carLon, carLat, carAngle) - } - - private fun isFrontOfCar( - markerLon: Double, - markerLat: Double, - carLon: Double, - carLat: Double, - carAngle: Double - ): Boolean { - val degree = DrivingDirectionUtils.getDegreeOfCar2Poi2( - carLon, - carLat, - markerLon, - markerLat, - carAngle - ) - return degree < 90 - } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java index ff12063cb2..4de55a0c84 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java @@ -10,10 +10,11 @@ import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager; +import com.mogo.eagle.core.function.v2x.events.marker.MarkerWrapper; +import com.mogo.eagle.core.function.v2x.events.marker.MarkerManager; import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; -import com.mogo.eagle.core.network.utils.GsonUtil; +import com.mogo.map.marker.IMogoMarker; import java.util.ArrayList; import java.util.List; @@ -25,34 +26,29 @@ import java.util.Objects; public class V2XRoadEventMarker implements IV2XMarker { - private static AiRoadMarker.Marker mMarker; - @Override public void drawPOI(V2XRoadEventEntity entity) { try { // 清除道路事件 IMoGoV2XMarkerManager marker = BridgeApi.INSTANCE.v2xMarker(); if (marker != null) { - marker.clearAlarmPOI(); if (entity != null) { Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType()); if (!Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType()) && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType()) && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType()) - && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType()) && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())) { - AiRoadMarker.Marker prev = mMarker; - if (prev != null) { - AiRoadMarker.INSTANCE.unMarker(prev); - mMarker = null; + IMogoMarker iMarker = marker.drawableAlarmPOI(BridgeApi.INSTANCE.context(), entity, null); + if (iMarker != null) { + Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- add Marker"); + ArrayList markers = new ArrayList<>(); + markers.add(iMarker); + String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat(); + MarkerManager.INSTANCE.addMarker(new MarkerWrapper(id, entity.getLocation().getLon(), entity.getLocation().getLat(), 0, markers, null)); + } else { + Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker"); } - marker.drawableAlarmPOI(BridgeApi.INSTANCE.context(), entity, null); } else { - AiRoadMarker.Marker prev = mMarker; - if (prev != null) { - AiRoadMarker.INSTANCE.unMarker(prev); - mMarker = null; - } MarkerExploreWay noveltyInfo = entity.getNoveltyInfo(); Log.d("RWJ", "V2XRoadEventMarker -> noveltyInfo:" + noveltyInfo); if (noveltyInfo != null && noveltyInfo.extras != null) { @@ -86,12 +82,12 @@ public class V2XRoadEventMarker implements IV2XMarker { if (noveltyInfo.extras.containsKey("gps_location")) { gpsLocation = (Pair) ((List)(noveltyInfo.extras.get("gps_location"))).get(0); } - if (!polygons.isEmpty() && gpsLocation != null) { MarkerLocation location = noveltyInfo.getLocation(); AiRoadMarker.Marker m = new AiRoadMarker.Marker(noveltyInfo.getInfoId(), noveltyInfo.getPoiType(), gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity); - mMarker = m; - AiRoadMarker.INSTANCE.marker(m, true, isDrawRoadLine(m.getPoiType())); + AiRoadMarker aiMarker = new AiRoadMarker(); + aiMarker.marker(m, true, isDrawRoadLine(m.getPoiType())); + AiRoadMarker.aiMakers.put(noveltyInfo.getInfoId(), aiMarker); } } } @@ -109,16 +105,16 @@ public class V2XRoadEventMarker implements IV2XMarker { @Override public void clearPOI() { // 移除线 - IMoGoV2XPolylineManager polyLineManager = BridgeApi.INSTANCE.v2xPolyline(); - if (polyLineManager != null) { - polyLineManager.clearLine(); - } - IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker(); - if (v2xMarker != null) { - // 移除事件POI - v2xMarker.clearAlarmPOI(); - // 绘制上次的数据 - v2xMarker.drawableLastAllPOI(); - } +// IMoGoV2XPolylineManager polyLineManager = BridgeApi.INSTANCE.v2xPolyline(); +// if (polyLineManager != null) { +// polyLineManager.clearLine(); +// } +// IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker(); +// if (v2xMarker != null) { +// // 移除事件POI +// v2xMarker.clearAlarmPOI(); +// // 绘制上次的数据 +// v2xMarker.drawableLastAllPOI(); +// } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java index 12c6437810..b96d19cd12 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java @@ -109,7 +109,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp } String poiType = content.getPoiType(); if (EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType) || - EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType().equals(poiType) || + EventTypeEnumNew. TYPE_SOCKET_ROAD_JINGZHI.getPoiType().equals(poiType) || EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(poiType) || EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType().equals(poiType)) { MogoLocation carLocation = CallerMapLocationListenerManager.INSTANCE.getCurrentLocation(); @@ -150,10 +150,10 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp @Override public void clearPOI() { - IV2XMarker marker = getV2XMarker(); - if (marker != null) { - marker.clearPOI(); - } +// IV2XMarker marker = getV2XMarker(); +// if (marker != null) { +// marker.clearPOI(); +// } } @Override @@ -164,11 +164,12 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp CallerHmiManager.INSTANCE.showWarning(WarningDirectionEnum.ALERT_WARNING_TOP, TimeUnit.HOURS.toMillis(1)); V2XMessageEntity entity = getV2XMessageEntity(); if (entity != null) { - if (entity.isNeedAddLine()) { - drawPOI(); - } + V2XRoadEventEntity content = entity.getContent(); if (content != null) { + if (entity.isNeedAddLine() && !EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(content.getPoiType()) ) { + drawPOI(); + } MarkerExploreWay noveltyInfo = content.getNoveltyInfo(); if (noveltyInfo != null && EventTypeEnumNew.FOURS_FOG.getPoiType().equals(content.getNoveltyInfo().getPoiType())) { CallerHmiManager.INSTANCE.displayEffects(); @@ -192,7 +193,6 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp if (isNeedChangeAngle()) { CallerVisualAngleManager.INSTANCE.changeVisualAngle(new CallerVisualAngleManager.Scene.Default(3, TimeUnit.SECONDS)); } - clearPOI(); release(); } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java index 3ca5bb86e1..03bdcf95c1 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java @@ -39,13 +39,13 @@ public class V2XOptimalRouteVREventMarker implements IV2XMarker? = null, val polygon: List? = null, val type: Int? = 0, - val detectTime: Long? = 0L + val detectTime: Long? = 0L, + val crossId: String? = null ) @Keep @@ -24,7 +25,8 @@ data class CenterRoad( val laneNo: Int? = null, val roadId: String? = null, val roadName: String? = null, - val tileId: Int? = 0 + val tileId: Int? = 0, + val heading: String? = null ) @Keep diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index de725ae49d..a876d30687 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -477,7 +477,7 @@ enum class EventTypeEnumNew( ), TYPE_SOCKET_ROAD_SHIGU( - "10013", + "100321", "前方%s米道路事故", poiTypeSrcVr = R.drawable.v2x_icon_shigu_sanjiaopai, content = "前方%s米道路事故", diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java index 096016b387..4d76ad0100 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java @@ -35,6 +35,7 @@ public class V2XRoadEventEntity implements Serializable { // 绑定 MarkerView 的数据, 业务需要啥数据就传入啥数据 private Object bindObj; + public MarkerLocation getLocation() { return location; } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt index a4c5b72ce9..a3c5cd7144 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt @@ -310,9 +310,12 @@ object CallerVisualAngleManager { return@launch } } - + if (prev.priority == current.priority) { + Log.d("${M_DEVA}${TAG}", "--- 9 --- 场景[$prev]正在展示,尚未收到关闭,优先级一致,直接return") + return@launch + } if (prev.priority > current.priority && prev.displayThreshold < 0) { - Log.d("${M_DEVA}${TAG}", "--- 6 --- 场景[$prev]正在展示,尚未收到关闭,场景,依然展示当前场景,直接return") + Log.d("${M_DEVA}${TAG}", "--- 10 --- 场景[$prev]正在展示,尚未收到关闭,场景,依然展示当前场景,直接return") return@launch } doRealVisualAngleChange(triggerTime, current, displayed) diff --git a/gradle.properties b/gradle.properties index 6cc519e950..0429b863a6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.3.27 MOGO_TELEMATIC_VERSION=1.4.3.27 ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=2.8.0.11 +MAP_SDK_VERSION=2.9.0.12_test_01 MAP_SDK_OPERATION_VERSION=1.1.4.1 # websocket WEBSOCKET_VERSION=1.1.7 From df1d7433527f86494759b9a3be5c74d17ac05723 Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 12 Jan 2023 13:46:54 +0800 Subject: [PATCH 03/12] [2.13.2]xxxx --- .../main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt b/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt index d0043384b8..f817632c20 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt @@ -15,11 +15,11 @@ class ThreadOptStartup: AndroidStartup() { ThreadManager .init(ThreadConfig.Builder() .maxKeepAliveTime(5, SECONDS) - /*.dump(DumpConfig.Builder() + .dump(DumpConfig.Builder() .dumpLogFilePath(File(context.getExternalFilesDir(null), "thread_dump_log_${ SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ROOT).format(Date()) }.txt").absolutePath) .dumpPeriod(5, SECONDS) .threadRunThreshold(10, SECONDS) - .build())*/) + .build())) return true } From ec388f757c82a51b607d87c7aae7a9c08d099f46 Mon Sep 17 00:00:00 2001 From: renwj Date: Fri, 13 Jan 2023 18:44:14 +0800 Subject: [PATCH 04/12] =?UTF-8?q?[2.13.2]V2X=E6=96=B0=E5=A2=9E=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt b/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt index f817632c20..d0043384b8 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt @@ -15,11 +15,11 @@ class ThreadOptStartup: AndroidStartup() { ThreadManager .init(ThreadConfig.Builder() .maxKeepAliveTime(5, SECONDS) - .dump(DumpConfig.Builder() + /*.dump(DumpConfig.Builder() .dumpLogFilePath(File(context.getExternalFilesDir(null), "thread_dump_log_${ SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ROOT).format(Date()) }.txt").absolutePath) .dumpPeriod(5, SECONDS) .threadRunThreshold(10, SECONDS) - .build())) + .build())*/) return true } From 06d3575b9e1c9fe97e8d058ffaa3faca42fe54aa Mon Sep 17 00:00:00 2001 From: lianglihui Date: Fri, 13 Jan 2023 18:47:23 +0800 Subject: [PATCH 05/12] =?UTF-8?q?2132=20=E6=94=AF=E6=8C=81sop=20=E4=BA=91?= =?UTF-8?q?=E8=B0=83=E5=BA=A6update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dispatch/DispatchAutoPilotManager.java | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java index bd8b98e7ac..72a42c653c 100644 --- a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java +++ b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java @@ -33,6 +33,7 @@ import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DISPATCH; import static com.zhjt.dispatch.model.DispatchServiceModel.DISPATCH_RESULT_AFFIRM; import static com.zhjt.dispatch.model.DispatchServiceModel.DISPATCH_RESULT_MANUAL_CANCEL; @@ -161,20 +162,27 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener wayLatLon = new ArrayList<>(); - if (receiverBean != null && receiverBean.getStopsList() != null) { - for (MogoLatLng mogoLatLng : receiverBean.getStopsList()) { - wayLatLon.add(new AutopilotControlParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon)); +// AutopilotControlParameters currentAutopilot = new AutopilotControlParameters(); +// currentAutopilot.isSpeakVoice = false; +// List wayLatLon = new ArrayList<>(); +// if (receiverBean != null && receiverBean.getStopsList() != null) { +// for (MogoLatLng mogoLatLng : receiverBean.getStopsList()) { +// wayLatLon.add(new AutopilotControlParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon)); +// } +// } +// currentAutopilot.wayLatLons = wayLatLon; +// currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getStartLat(), receiverBean.getStartLon()); +// currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getEndLat(), receiverBean.getEndLon()); +// currentAutopilot.vehicleType = 10; +// CallerLogger.INSTANCE.d(M_DISPATCH + TAG, "开启自动驾驶====" + currentAutopilot); +// CallerAutoPilotManager.INSTANCE.startAutoPilot(currentAutopilot); + AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo(); + if (autopilotStatusInfo !=null){ + AutopilotControlParameters autopilotControlParameters = autopilotStatusInfo.getAutopilotControlParameters(); + if (autopilotControlParameters != null){ + CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); } } - currentAutopilot.wayLatLons = wayLatLon; - currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getStartLat(), receiverBean.getStartLon()); - currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getEndLat(), receiverBean.getEndLon()); - currentAutopilot.vehicleType = 10; - CallerLogger.INSTANCE.d(M_DISPATCH + TAG, "开启自动驾驶====" + currentAutopilot); - CallerAutoPilotManager.INSTANCE.startAutoPilot(currentAutopilot); } @Override From b4216da0d5fac110f46f0dc0d4389584b0cfe5b4 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Fri, 13 Jan 2023 18:50:58 +0800 Subject: [PATCH 06/12] [2.13.2] merge --- .../och/bus/fragment/BaseBusTabFragment.java | 15 +- .../ui/TaxiPassengerBaseFragment.java | 131 ++++++++++-------- .../mogo/och/taxi/ui/BaseTaxiTabFragment.java | 15 +- .../hmi/ui/setting/DebugSettingView.kt | 10 ++ .../function/hmi/ui/setting/SOPSettingView.kt | 1 + .../main/res/layout/view_debug_setting.xml | 12 ++ .../core/data/config/FunctionBuildConfig.kt | 7 + .../eagle/core/data/config/HmiBuildConfig.kt | 2 +- .../java/com/mogo/map/utils/ObjectUtils.java | 3 +- 9 files changed, 124 insertions(+), 72 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index bbfd9df381..2017b5a63a 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -27,6 +27,7 @@ import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; import com.mogo.commons.voice.AIAssist; +import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.config.HmiBuildConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; @@ -140,16 +141,20 @@ public abstract class BaseBusTabFragment @Override public void onClickImpl(View v) { //切换地图的远近视图 - if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) { + if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight() + || MogoMapUIController.getInstance().getCurrentMapVisualAngle().isRoma()) { CallerVisualAngleManager.INSTANCE.updateLongSightLevel(false); -// Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true); + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true); MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null); mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium); } else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) { CallerVisualAngleManager.INSTANCE.updateLongSightLevel(true); -// Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false); - MogoMapUIController.getInstance().setRomaMode(); -// MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null); + if (FunctionBuildConfig.isRomaMode) { + MogoMapUIController.getInstance().setRomaMode(); + } else { + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false); + MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null); + } mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long); } else { MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null); diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java index 26fbc8a313..62f47df941 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java @@ -14,6 +14,7 @@ import androidx.fragment.app.FragmentTransaction; import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.commons.mvp.MvpFragment; +import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy; import com.mogo.eagle.core.function.api.hmi.view.IViewNotification; @@ -30,10 +31,10 @@ import com.mogo.map.uicontroller.VisualAngleMode; import com.mogo.och.taxi.passenger.R; import com.mogo.och.taxi.passenger.callback.ITPClickStartAutopilotCallback; import com.mogo.och.taxi.passenger.event.UIStatus; +import com.mogo.och.taxi.passenger.mulprocess.EmptyService; import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter; import com.mogo.och.taxi.passenger.ui.comment.TaxiPassengerArrivedView; import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils; -import com.mogo.och.taxi.passenger.mulprocess.EmptyService; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; @@ -112,31 +113,35 @@ public class TaxiPassengerBaseFragment extends MvpFragment(new TaxiPassengerArrivedView(getContext())); mArrivedEndView.get().setITaxiPassengerScoreCallback((taxiPassengerScoreUpdateOrderReqBean) -> getPresenter().arrivedAndScore(taxiPassengerScoreUpdateOrderReqBean)); } @@ -175,9 +180,10 @@ public class TaxiPassengerBaseFragment extends MvpFragment { if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) { @@ -201,7 +208,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment(new TaxiPassengerStartAutopilotView(getContext())); } mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(this); - OverlayViewUtils.showOverlayView(getActivity(),mStartAutopilotView.get()); + OverlayViewUtils.showOverlayView(getActivity(), mStartAutopilotView.get()); updateStartAutopilotBtnStatus(isClickable); - }else { - if (mStartAutopilotView == null || mStartAutopilotView.get() == null){ + } else { + if (mStartAutopilotView == null || mStartAutopilotView.get() == null) { return; } mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null); @@ -333,15 +343,15 @@ public class TaxiPassengerBaseFragment extends MvpFragment + FunctionBuildConfig.isRomaMode = isChecked + if (!FunctionBuildConfig.isRomaMode) { + tbDrawRomaMode.isChecked = false + } + } + //重启工控机所有节点 btnIpcReboot.onClick { CallerAutoPilotManager.sendIpcReboot() @@ -1148,6 +1157,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 云端弱势交通控制 */ + tbCloudWeaknessTraffic.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView tbCloudWeaknessTraffic.setOnCheckedChangeListener { _, isChecked -> if (isChecked) { //默认关闭 CallerHmiManager.setCloudWeaknessTraffic(true) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index ca74993d5a..4a575188d4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -89,6 +89,7 @@ class SOPSettingView @JvmOverloads constructor( /** * 云端弱势交通控制 */ + tbCloudWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked -> if (isChecked) { //默认关闭 CallerHmiManager.setCloudWeaknessTraffic(true) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index 5fddb03d64..bef611254c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -266,6 +266,18 @@ android:textOn="关闭云端感知绘制" android:textSize="@dimen/dp_24" /> + + Date: Fri, 13 Jan 2023 18:54:42 +0800 Subject: [PATCH 07/12] [2.13.2] fix bug of sop and debug view obu ruoshi --- .../mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt | 1 + .../mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 01e4de1b36..5684bb1301 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -1146,6 +1146,7 @@ class DebugSettingView @JvmOverloads constructor( /** * obu弱势交通控制 */ + tbObuWeaknessTraffic.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView tbObuWeaknessTraffic.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { //默认开启 CallerHmiManager.setObuWeaknessTraffic(true) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index 4a575188d4..6865374f1c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -78,6 +78,7 @@ class SOPSettingView @JvmOverloads constructor( /** * obu弱势交通控制 */ + tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { //默认开启 CallerHmiManager.setObuWeaknessTraffic(true) From 6e2283f85d36fc51a3495229eaf4cfda3ce5635b Mon Sep 17 00:00:00 2001 From: renwj Date: Sat, 14 Jan 2023 10:38:32 +0800 Subject: [PATCH 08/12] =?UTF-8?q?[2.13.2]=E5=9B=9E=E9=80=80=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0429b863a6..6cc519e950 100644 --- a/gradle.properties +++ b/gradle.properties @@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.3.27 MOGO_TELEMATIC_VERSION=1.4.3.27 ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=2.9.0.12_test_01 +MAP_SDK_VERSION=2.8.0.11 MAP_SDK_OPERATION_VERSION=1.1.4.1 # websocket WEBSOCKET_VERSION=1.1.7 From 11f256380d69db92f5ac465d30c8560c0d0deca2 Mon Sep 17 00:00:00 2001 From: renwj Date: Sat, 14 Jan 2023 13:31:01 +0800 Subject: [PATCH 09/12] =?UTF-8?q?[2.13.2]=E4=BF=AE=E6=AD=A3=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=B6=88=E5=A4=B1=E5=90=8E=E7=A7=BB=E9=99=A4=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt index 3fd2422a9c..563aada462 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -69,7 +69,7 @@ class V2XAiRoadEventMarker { options.zIndex(75000f) options.maxIndex(800000f) val line = overlayManager.addPolyline(options) - current.set(Pair(line, null)) + current.set(Pair(line, wrapper.markers)) if (line != null) { line.isVisible = true wrapper.addLine(line) From 1cb37113869e67f29b46ab74ecd537690080fb7c Mon Sep 17 00:00:00 2001 From: renwj Date: Sat, 14 Jan 2023 16:51:47 +0800 Subject: [PATCH 10/12] =?UTF-8?q?[2.13.2]V2N=E4=BA=8B=E4=BB=B6=E6=92=AD?= =?UTF-8?q?=E6=8A=A5=E8=AF=AD=E9=9F=B3=E6=8F=90=E7=A4=BA=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/hmi/ui/MoGoHmiFragment.kt | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index a786c3ec4f..770380de6b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -111,6 +111,7 @@ import me.jessyan.autosize.utils.AutoSizeUtils import mogo_msg.MogoReportMsg import record_cache.RecordPanelOuterClass import java.util.* +import java.util.concurrent.atomic.AtomicReference /** @@ -171,7 +172,7 @@ class MoGoHmiFragment : MvpFragment(), private var adUpgradeDialog: AdUpgradeDialog? = null - private var lastSpeakJob: Job? = null + private val lastSpeakJob by lazy { AtomicReference() } private var lastShowV2XJob: Job? = null @@ -901,7 +902,7 @@ class MoGoHmiFragment : MvpFragment(), override fun onShow(reminder: IReminder) { listener?.onShow() lastShowV2XJob?.safeCancel() - lastSpeakJob?.safeCancel() + lastSpeakJob.get()?.safeCancel() showingV2XTip = reminder lifecycleScope.launch { delay(expireTime) @@ -914,7 +915,7 @@ class MoGoHmiFragment : MvpFragment(), lifecycleScope.launch { speak(it, ttsContent) }.also { itx -> - lastSpeakJob = itx + lastSpeakJob.set(itx) } } } @@ -970,10 +971,7 @@ class MoGoHmiFragment : MvpFragment(), "$M_HMI$TAG", "--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime" ) - lastShowV2XJob?.safeCancel() - lastSpeakJob?.safeCancel() - lifecycleScope.launch { delay(expireTime) }.also { itx -> @@ -984,10 +982,18 @@ class MoGoHmiFragment : MvpFragment(), } if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) { - lifecycleScope.launch { + val last = lastSpeakJob.get() + Log.d("CODE", "---- 0 ------: last: $last") + if (last != null && !last.isCompleted) { + Log.d("CODE", "---- 1 ------") + return + } + lifecycleScope.launch(Dispatchers.Default) { + Log.d("CODE", "---- 2 ------") speak(it, ttsContent) + Log.d("CODE", "---- 3 ------") }.also { itx -> - lastSpeakJob = itx + lastSpeakJob.set(itx) } } } From e43f6c404ee9b3ccb65f7c32c79f829b949429c8 Mon Sep 17 00:00:00 2001 From: renwj Date: Sat, 14 Jan 2023 16:53:26 +0800 Subject: [PATCH 11/12] =?UTF-8?q?[2.13.2]=E4=BC=98=E5=8C=96=E9=81=93?= =?UTF-8?q?=E8=B7=AF=E4=BA=8B=E4=BB=B6=E7=9A=84=E8=AF=AD=E9=9F=B3=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scene/road/V2XRoadEventScenario.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java index b96d19cd12..4eb32d0dc2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java @@ -27,6 +27,7 @@ import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; import com.mogo.eagle.core.network.utils.GsonUtil; import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.concurrent.TimeUnit; /** @@ -72,16 +73,23 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp try { if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) { //只展示不播报 不广播 - boolean onlyShow = getV2XMessageEntity().isOnlyShow(); + V2XMessageEntity entity = getV2XMessageEntity(); + boolean onlyShow = entity.isOnlyShow(); if (!onlyShow) { // 设置TTS - getV2XMessageEntity().getContent().getTts(false); + V2XRoadEventEntity content = entity.getContent(); + if (content != null && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())) { + content.getTts(false); + } } showWindow(); - String poiType = getV2XMessageEntity().getContent().getPoiType(); - String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat()); - String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon()); - String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId(); + String poiType = entity.getContent().getPoiType(); + String lat = String.valueOf(entity.getContent().getLocation().getLat()); + String lon = String.valueOf(entity.getContent().getLocation().getLon()); + String infoId = entity.getContent().getNoveltyInfo().getInfoId(); String style = "1"; Map properties = new HashMap<>(); properties.put("dbid", infoId); @@ -117,7 +125,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp if (carLocation != null && noveltyInfo != null) { MarkerLocation eventLocation = noveltyInfo.getLocation(); if (eventLocation != null) { - double distance = CoordinateUtils.calculateLineDistance(carLocation.getLongitude(), carLocation.getLatitude(), eventLocation.getLon(), eventLocation.getLat()); + double distance = content.getDistance(); alarmText = String.format(alarmText, Math.round(distance) + ""); ttsText = String.format(ttsText, Math.round(distance) + ""); } From 5e9a7cac13298796cbc42cf46230055bbce1ae58 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Sat, 14 Jan 2023 17:07:30 +0800 Subject: [PATCH 12/12] =?UTF-8?q?[2.13.2]fix=E6=B6=88=E6=81=AF=E7=9B=92?= =?UTF-8?q?=E5=AD=90=E8=98=91=E8=8F=87=E5=B0=8F=E5=8A=A9=E6=89=8BItem?= =?UTF-8?q?=E6=B0=94=E6=B3=A1=E4=BD=8D=E7=BD=AE=E5=81=8F=E7=A7=BBBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/DriverMsgBoxBubbleAdapter.kt | 2 +- .../main/res/layout/item_msg_box_summary.xml | 3 +- .../res/layout/item_msg_bubble_summary.xml | 62 +++++++++++++++++++ 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_summary.xml diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index e7b7342600..1f656db107 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -61,7 +61,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A return BubbleNoticeHolder(view) } summary -> { - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_summary,parent,false) + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_summary,parent,false) return BubbleSummaryHolder(view) } else -> { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_summary.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_summary.xml index 158fb1f2c6..9f2439221a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_summary.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_summary.xml @@ -38,11 +38,12 @@ + + + + + + + + + + + \ No newline at end of file