import QtQuick 2.0 import "../AppLink/Com" import "../windowsList.js" as WindowsList import "../layoutList.js" as Layout import "../eventsList.js" as EventsList Rectangle{ id:app_location width: 960 height: 960 x: 0; y: 0 color:"#00000000" property int iMsgType:0 property bool bShowCross: false property bool bShowGuide: false property bool bHideCrossView: false property bool bVisibleGuide: false property bool bVisibleCross: false property bool bIsCusStatus: false property string imagePath_navi: "/usr/bin/qml_link/images/AppLink/" property string sTMCText:"" property bool bFirstBoot: true onVisibleChanged: { if(visible){ //init applinkControl.QML_SSPLink_SetSearchType(0) location_com.iScale = applinkControl.QML_NIF_Map_GetCurScale(true); location_com.iDirType = applinkControl.QML_NIF_Map_GetAzimuth(true); applinkControl.QML_NIF_Map_SetAzimuth(location_com.iDirType, true); applinkControl.QML_NIF_Map_FollowCarWithScale(location_com.iScale,true); location_com.sDestName = applinkControl.QML_getInitCurrentName(); bVisibleGuide = applinkControl.QML_NIF_Gid_GetRouteInfoStatus(); //获取路线行程图显示状态 bVisibleCross = applinkControl.QML_NIF_Gid_GetMagViewStatus(); //获取扩大图显示状态 //GetNaviStatus if(1 === applinkControl.QML_NIF_Gid_iGetNaviStatus()){ bIsCusStatus = true //引导状态flag: true:引导状态; false:非引导状态 if(bVisibleGuide==0){ bShowGuide = false } if(bVisibleCross==0){ bShowCross = false bHideCrossView = false } if(bVisibleGuide&&!bHideCrossView){ bShowGuide = true } }else{ bIsCusStatus = false } applinkControl.QML_GetGuideDataInfo(); location_com.bTMCswitch = applinkControl.QML_NIF_Tmc_GetShowSwitch() if (!location_com.bLongPress && bIsCusStatus && location_com.bTMCswitch) { tmcBar.visible = true } else { tmcBar.visible = false } applinkControl.QML_GetLaneShow() if(bFirstBoot){ bFirstBoot=false if(bIsCusStatus){ applinkControl.QML_NIF_Tmc_Get() } } applinkControl.QML_NotifyAppLinkDisplayOK() applinkControl.QML_ChangeLinkMapShowStatus(1) if("" == applinkControl.QML_GetTmcSupportTel()) { applinkControl.QML_NIF_Tmcpay_GetSupport(applinkControl.QML_GetTmcPayGetStr()) } applinkControl.QML_NotifyFlickForbidFlag(1) }else{ // ScreenManager.changeForm(Layout.FM_OPACITY_END,WindowsList.APP_LOCATION) // systemCtrlLink.changWindowlayer(Layout.PHONENAVI_LAYER,Layout.LayerHide) } } //========================event proc============================================// Connections{ target:applinkControl onSignal_UpdateGuideData:{ console.log("[aaaaaaaaaa]-----1----UpdateGuideData-----") if(1 === applinkControl.QML_NIF_Gid_iGetNaviStatus()){ residualInfo.restDistance = qRestDist+qRestType directionManuver.distanceText = qDistFromCar+qDistType directionManuver.directMarkImg = applinkControl.strGetNaviDir(iPointKind) if(iRestTime_h==0){ residualInfo.restTime = iRestTime_m+"m" }else if(iRestTime_m==0){ residualInfo.restTime = iRestTime_h+"h" }else{ residualInfo.restTime = iRestTime_h+ "h" + iRestTime_m+"m" } console.log("[aaaaaaaaaa]-----2----UpdateGuideData-----distance is "+residualInfo.restDistance + "time is "+residualInfo.restTime) } } onSignal_UpdateCurrPosName:{ if(visible){ location_com.sDestName = qCurrPosName } } onSignal_HideCrossView:{ if((1 === applinkControl.QML_NIF_Gid_iGetNaviStatus())&&bVisibleCross){ bShowCross = false bHideCrossView = false if(bVisibleGuide){ bShowGuide = true }else{ } } } onSignal_ShowCrossView:{ if((1 === applinkControl.QML_NIF_Gid_iGetNaviStatus()) && bVisibleCross && (bHideCrossView==false) && visible ){ bShowGuide = false bShowCross = true } } onSignal_ChangeGuideStatus:{ if(bIsCusStatus!=bCusStatus){ bIsCusStatus = bCusStatus if(bCusStatus&&bVisibleGuide){ bShowGuide = true }else{ bShowGuide = false bShowCross = false bHideCrossView = false } } } onSignal_StartReroute:{ if(visible){ msg_PopUp.visible = true iMsgType = 17 } } onSignal_EndReroute:{ if(visible){ msg_PopUp.visible = false iMsgType = 0 } } onSignal_NaviStart:{ if(visible){ msg_PopUp.visible = true iMsgType = 20 msg_timer.restart() } } onSignal_NIF_Gid_GuidePointArriveCB:{ if(2 != applinkControl.QML_NIF_Gid_iGetNaviStatus()){ if(iDestType==5){ applinkControl.QML_NIF_Gid_StopGuide() applinkControl.QML_NIF_Cus_DelVia(1) applinkControl.QML_NIF_Cus_DelVia(2) applinkControl.QML_NIF_Cus_DelVia(3) applinkControl.QML_NIF_Cus_DelDest() } applinkControl.QML_NIF_Cus_GetDestAndViaInfo(); } } onSignal_TMC_GetRoadBlockInfo:{ if(visible){ sTMCText = applinkControl.getLanguageType()?(beginRoad + " 至 " + endRoad + "路段交通拥堵"):"Traffic jam from "+beginRoad+" to " +endRoad+"," popMenu.visible = true } } onSignal_TMC_Net_Error:{ if(visible){ msg_PopUp.visible = true iMsgType = 26 msg_timer.restart() } } onSignal_TMC_Auth_Success:{ if(visible){ applinkControl.QML_NIF_Tmc_SetTermToken(authcode) location_com.bTMCswitch = true applinkControl.QML_NIF_Tmc_SetShowSwitch(true) //applinkControl.QML_NIF_Tmcpay_SetPayInfo(applinkControl.QML_GetTmcPaySetStr()) } } onSignal_TMC_Need_Pay:{ if(visible){ //applinkControl.QML_NIF_Tmcpay_SetPayInfo(applinkControl.QML_GetTmcPaySetStr()) applinkControl.QML_SetTmcPayQrStr() pay.aPayVisible = true } } onSignal_TMC_Auth_Fail:{ if(visible){ popMsg_NoService.newspopText2 = qsTr("客服电话:") + applinkControl.QML_GetTmcSupportTel() + applinkControl.qsEmptyString popMsg_NoService.visible = true } } onSignal_TMC_Get_Support:{ if(visible){ } } onSignal_TMC_Get_Expiredate:{ if(visible){ popMsg_ExpireDate.newspopText2 = qsTr("您的实时路况服务有效期至 ") + date + applinkControl.qsEmptyString popMsg_ExpireDate.visible = true } } // onSignal_CalcRouteFinish:{ // if(visible){ // if(bIsFinish == true){ // iMsgType = 0 // msg_PopUp.visible = false // if(applinkControl.QML_NIF_Gid_StartGuide() != -1){ // //applinkControl.QML_NaviStart() // } // }else{ // iMsgType = 7 // msg_PopUp.visible = true // msg_timer.restart() // } // } // } } //===========================location_com===========================// App_LocationComponent{ id:location_com bVisible_dir : true bVisible_scale:true bIsTMCVisible:true } //===========================guideInfo===========================// App_HMIGuideInfo{ id:guideInfo x:560 y:99 visible: location_com.bLongPress?false:(bIsCusStatus&&bVisibleGuide&&bShowGuide) } //===========================App_HMICrossInfo===========================// App_HMICrossInfo{ id:crossInfo y:99 anchors.right: parent.right visible: location_com.bLongPress?false:(bIsCusStatus&&bVisibleCross&&bShowCross) } //===========================residualInfo===========================// App_HMIResidualInfo{ id: residualInfo visible: location_com.bLongPress?false:(bIsCusStatus?true:false) x:102 y:5 } //===========================directionManuver===========================// App_HMIDirectionManuver{ id: directionManuver // x:residualInfo.x+15 // y:residualInfo.y+1 visible: location_com.bLongPress?false:(bIsCusStatus?true:false) } //===========================locationmenu===========================// Image{ id:menuBackground y:881 visible: location_com.bLongPress?false:true source: imagePath_navi+"M8X_Function_Button_bg.png" } App_HMILocationMenu{ id: locationmenu x:90 y:881 visible: location_com.bLongPress?false:true } //===========================roadCamera===========================// App_HMICamera{ id: roadCamera visible:location_com.bLongPress?false:(bIsCusStatus?true:false) x:5//8 y:692//705 } //===========================soundBtn===========================// HMIButton{ id: soundBtn x:862//0 y:5//108 width: 98 height: 80 visible: location_com.bLongPress?false:(bIsCusStatus?true:false) btnImg: soundBtn.pressed?imagePath_navi+"M8X_Location_Button_p.png":imagePath_navi+"M8X_Location_Button.png" btnIcon:imagePath_navi+"M8X_Voice_icon.png" onClicked: { applinkControl.QML_NIF_Gid_TouchGuide() } } //===========================back_home===========================// HMIButton{ id: back_home y:881 visible: location_com.bLongPress?false:true btnImgOnPressed: imagePath_navi +"M8X_Function_close_Button_p.png" btnImg: imagePath_navi+"M8X_Function_close_Button.png" btnIcon: imagePath_navi+"M8X_icon_close.png" onClicked:{ applinkControl.QML_CloseAppLink() //ScreenManager.changeForm(Layout.FM_CLOSE,WindowsList.APP_LOCATION) } } //===========================back==============================// App_HMIReturnBtn{ id:back x:0//862 y:5//4 visible: location_com.bLongPress?false:true onClicked: { ScreenManager.backward(Layout.APPLINK,WindowsList.APP_HOME) } } //===========================hideBtn===========================// HMIButton{ id: hideBtn x:862 y:269-160//108 visible: location_com.bLongPress?false:(bIsCusStatus&&(bShowCross||bShowGuide)) btnImg: hideBtn.pressed?imagePath_navi+"M8X_Location_Button_p.png":imagePath_navi+"M8X_Location_Button.png" Image{ x:901-parent.x y:289-160-parent.y source:imagePath_navi+"M8X_Location_Arrow_R.png" } onClicked:{ if(bShowCross){ bShowCross = false bShowGuide = false bHideCrossView = true }else if(bShowGuide){ bShowGuide = false } //applinkControl.QML_NIF_Map_SetMapMode(1) } } //===========================viewBtn===========================// HMIButton{ id: viewBtn x:862 y:269-160//108 visible: location_com.bLongPress?false:(bIsCusStatus?(bHideCrossView||(bVisibleGuide&&(!bShowGuide)&&(!bShowCross))):false) btnImg: viewBtn.pressed?imagePath_navi+"M8X_Location_Button_p.png":imagePath_navi+"M8X_Location_Button.png" //btnIcon:imagePath_navi+"M8X_Location_Arrow_L.png" Image{ x:895-parent.x y:289-160-parent.y source:imagePath_navi+"M8X_Location_Arrow_L.png" } onClicked:{ if(bHideCrossView){ bShowCross = true bShowGuide = false bHideCrossView = false }else if( bVisibleGuide && (bShowGuide==false) ){ bShowGuide = true } //applinkControl.QML_NIF_Map_SetMapMode(2) } } //===========================msg_PopUp===========================// App_Com_Popup2msg2btn{ id:popMenu newspopText1: sTMCText newspopText2: qsTr("是否重新计算路线?") + applinkControl.qsEmptyString btnTextLeft: qsTr("是") + applinkControl.qsEmptyString btnTextRight: qsTr("否") + applinkControl.qsEmptyString onSignal_btnLeftClick:{ popMenu.visible=false iMsgType = 1 msg_PopUp.visible = true applinkControl.QML_NIF_Tmc_SetAvoidSwitch(true); applinkControl.QML_NIF_Cus_StartCalc(); } } App_Com_Newspopup{ id:msg_PopUp labelCount:1 newspopText1: qsTr(applinkControl.QML_getMessageString(iMsgType)) + applinkControl.qsEmptyString visible:(iMsgType > 0)?true:false bIsTouchClear:applinkControl.QML_getMessageTouchClearFlag(iMsgType) } Timer{ id:msg_timer interval: applinkControl.QML_getMessageTime(iMsgType) onTriggered: { msg_PopUp.visible = false iMsgType = 0 } } App_Com_LaneALL{ id:lane bCrossOrGuideOut:bShowCross||bShowGuide bLongPress:location_com.bLongPress Connections{ target:applinkControl onSignal_UpdateLaneInfo: { if(visible){ lane.bLane = bHasLane if(lane.bLane == true){ lane.iLaneNum = iLaneCnt lane.iLane1 = iLaneInfo1 lane.iLane2 = iLaneInfo2 lane.iLane3 = iLaneInfo3 lane.iLane4 = iLaneInfo4 lane.iLane5 = iLaneInfo5 lane.iLane6 = iLaneInfo6 lane.iLane7 = iLaneInfo7 lane.iLane8 = iLaneInfo8 lane.iLane9 = iLaneInfo9 lane.iLane10 = iLaneInfo10 lane.iLane11 = iLaneInfo11 lane.iLane12 = iLaneInfo12 lane.iLane13 = iLaneInfo13 lane.iLane14 = iLaneInfo14 lane.iLane15 = iLaneInfo15 lane.iLane16 = iLaneInfo16 lane.iLaneRecmd = iLaneRecmdInfo lane.lane1_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(1) lane.lane2_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(2) lane.lane3_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(3) lane.lane4_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(4) lane.lane5_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(5) lane.lane6_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(6) lane.lane7_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(7) lane.lane8_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(8) lane.lane9_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(9) lane.lane10_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(10) lane.lane11_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(11) lane.lane12_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(12) lane.lane13_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(13) lane.lane14_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(14) lane.lane15_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(15) lane.lane16_bLaneOneSimple = applinkControl.QML_getLaneSimpleIndex(16) lane.lane1_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(1) lane.lane2_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(2) lane.lane3_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(3) lane.lane4_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(4) lane.lane5_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(5) lane.lane6_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(6) lane.lane7_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(7) lane.lane8_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(8) lane.lane9_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(9) lane.lane10_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(10) lane.lane11_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(11) lane.lane12_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(12) lane.lane13_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(13) lane.lane14_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(14) lane.lane15_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(15) lane.lane16_bLaneMoreRecmdIndex = applinkControl.QML_getLaneMoreRecmdIndex(16) } } } } } HMIWindowLine{ } App_Com_TMC_Pay{ id:pay aPayVisible:false } App_Com_Newspopup{ id:popMsg_NoService labelCount: 2 newspopText1: qsTr("您尚未开通实时路况服务,请联系客服人员!") + applinkControl.qsEmptyString //newspopText2: qsTr("客服电话:XXXXXXXXXXXXXX") + applinkControl.qsEmptyString visible:false bIsTouchClear:false //backgroundImage : "" yOffset : -75 bHasButton: true newspopText1Height:applinkControl.getLanguageType()?34:68 yOffset2 : applinkControl.getLanguageType()?0:20 } App_Com_Newspopup{ id:popMsg_ExpireDate labelCount: 2 newspopText1: qsTr("付费账号") + applinkControl.qsEmptyString newspopText2: qsTr("您的实时路况服务有效期至 ") + applinkControl.qsEmptyString visible:false bIsTouchClear:false //backgroundImage : "" yOffset : -75 bHasButton: true newspopText2Height:applinkControl.getLanguageType()?34:70 yOffset2 : applinkControl.getLanguageType()?0:-10 } App_Com_TmcBar{ id:tmcBar visible:location_com.bLongPress?false:(bIsCusStatus ? applinkControl.QML_NIF_Tmc_GetShowSwitch() : false) Connections{ target:applinkControl onSignal_TMC_SegmentUpdateDataCB:{ if(visible){ applinkControl.QML_NIF_Tmc_Get() } } onSignal_TMC_GetInfo:{ if(visible){ tmcBar.iCarRunDist = isCarRunDist tmcBar.iCusDist = isCusDist } } onSignal_TMC_GetData:{ if(visible){ tmcBar.segModel=applinkControl.tmcBarListModel } } onSignal_TMC_SetShowStatus:{ if (!location_com.bLongPress && bIsCusStatus && location_com.bTMCswitch) { tmcBar.visible = true } else { tmcBar.visible = false } } } } }