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_Demo width: 960 height: 960 x: 0; y: 0 color:"#00000000" property int istatus:1 property int iScaleLevel:0 property int iAzimuth:0 property int iBarHeight:0 property bool bShowCross: false property bool bShowGuide: false property bool bHideCrossView: false property bool bVisibleGuide: false property bool bVisibleCross: false property bool bIsFirstInStack: false property bool bIsDemoVisible: false property string imagePath_navi: "/usr/bin/qml_link/images/AppLink/" property int iMsgType:0 Component.onCompleted:{ bIsFirstInStack = true iScaleLevel = applinkControl.QML_NIF_Map_GetCurScale(true) location_com.iScale = iScaleLevel iAzimuth = applinkControl.QML_NIF_Map_GetAzimuth(true); location_com.iDirType = iAzimuth applinkControl.QML_NIF_Gid_StartDemo() } onVisibleChanged: { if(visible){ bIsDemoVisible = true bVisibleGuide = applinkControl.QML_NIF_Gid_GetRouteInfoStatus() bVisibleCross = applinkControl.QML_NIF_Gid_GetMagViewStatus(); if(applinkControl.QML_NIF_Map_SetScale(iScaleLevel, false)==0){ location_com.iScale = iScaleLevel; } applinkControl.QML_NIF_Map_SetAzimuth(iAzimuth,false); location_com.iDirType = iAzimuth applinkControl.QML_NIF_Map_FollowCarWithScale(location_com.iScale,false); if(bVisibleGuide){ bShowGuide = true }else{ } } else{ if(bIsFirstInStack==false) { iScaleLevel = applinkControl.QML_NIF_Map_GetCurScale(false); iAzimuth = applinkControl.QML_NIF_Map_GetAzimuth(false); }else{ bIsFirstInStack = false } if(bIsDemoVisible === true){ applinkControl.QML_NIF_Gid_StopDemo() applinkControl.QML_NIF_Gid_StopGuide() applinkControl.QML_setGuideOffsetvalue(0); bIsDemoVisible = false } } } Connections{ target:applinkControl onSignal_UpdateGuideData:{ if(2 === 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" } } } onSignal_UpdateCurrPosName:{ if(2 === applinkControl.QML_NIF_Gid_iGetNaviStatus()){ location_com.sDestName = qCurrPosName } } onSignal_HideCrossView:{ if(2 === applinkControl.QML_NIF_Gid_iGetNaviStatus()){ bShowCross = false bHideCrossView = false if(bVisibleGuide){ bShowGuide = true } } } onSignal_ShowCrossView:{ if((2 === applinkControl.QML_NIF_Gid_iGetNaviStatus()) && bVisibleCross && (bHideCrossView==false) ){ bShowGuide = false bShowCross = true } } onSignal_NaviStart:{ if(visible){ msg_PopUp.visible = true iMsgType = 25 msg_timer.restart() } } } //===========================location_com===========================// App_LocationComponent{ id:location_com bVisible_dir : true } //===========================guideInfo===========================// App_HMIGuideInfo{ id:guideInfo anchors.right: parent.right anchors.rightMargin:-1 y:99 visible: bVisibleGuide&&bShowGuide } //===========================App_HMICrossInfo===========================// App_HMICrossInfo{ id:crossInfo anchors.right: parent.right y:99 visible: bVisibleCross&&bShowCross } //===========================residualInfo===========================// App_HMIResidualInfo{ id: residualInfo visible: true 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) } Image{ id:menuBackground y:881 visible: location_com.bLongPress?false:true source: imagePath_navi+"M8X_Function_Button_bg.png" } //===========================redBtn===========================// HMIButton{ id: redBtn x:90 y:881 enabled: (applinkControl.QML_NIF_Gid_DemoGetSpeed()==0)?false:true btnImg:imagePath_navi+"M8X_NAVI_Button_w218.png" btnImgOnPressed: imagePath_navi+"M8X_NAVI_Button_w218_p.png" onClicked:{ applinkControl.QML_NIF_Gid_DemoSpeedDown() rdBtn_text.text = applinkControl.QML_convertDemoSpeedToString() fucChangeSpeedEnabled() } } Image{ x:176 y:1060-160 source:imagePath_navi+"M8X_Location_icon_Fast-backward.png" } //===========================rdBtn===========================// HMIButton{ id: rdBtn x:308 y:881 enabled: (applinkControl.QML_NIF_Gid_DemoGetSpeed()==0)?false:true btnImg:imagePath_navi+"M8X_NAVI_Button_w218.png" btnImgOnPressed: imagePath_navi+"M8X_NAVI_Button_w218_p.png" } HMILabel{ id: rdBtn_text x:360 y:1061-160 text:applinkControl.QML_convertDemoSpeedToString() font.pixelSize:38 width:114 height:38 } //===========================accelerateBtn===========================// HMIButton{ id: accelerateBtn x:526 y:881 enabled: (applinkControl.QML_NIF_Gid_DemoGetSpeed()==2)?false:true btnImg:imagePath_navi+"M8X_NAVI_Button_w218.png" btnImgOnPressed: imagePath_navi+"M8X_NAVI_Button_w218_p.png" onClicked:{ applinkControl.QML_NIF_Gid_DemoSpeedUp() rdBtn_text.text = applinkControl.QML_convertDemoSpeedToString() fucChangeSpeedEnabled() } } Image{ x:610 y:1060-160 source:imagePath_navi+"M8X_Location_icon_Fast-forward.png" } //===========================roadCamera===========================// App_HMICamera{ id: roadCamera x:5//8 y:692//705 } //===========================stopDemo===========================// App_HMIReturnBtn{ id: stopDemo x:0//862 y:5//4 visible: location_com.bLongPress?false:true iChange: true onClicked:{ applinkControl.QML_NIF_Gid_StopDemo() applinkControl.QML_NIF_Gid_StopGuide() applinkControl.QML_setGuideOffsetvalue(0); ScreenManager.backward(Layout.APPLINK,WindowsList.APP_LOCATION) } } //===========================soundBtn===========================// HMIButton{ id: soundBtn visible:true x:862//0 y:5//108 width: 98 height: 80 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() } } //===========================pausBtn===========================// HMIButton{ id: pausBtn x:744 y:881 btnImg:imagePath_navi+"M8X_NAVI_Button_w218.png" btnImgOnPressed: imagePath_navi+"M8X_NAVI_Button_w218_p.png" onClicked: { if(istatus) { applinkControl.QML_NIF_Gid_DemoPause() istatus=0 } else { applinkControl.QML_NIF_Gid_DemoContinue() istatus=1 } } } Image{ x:istatus?838:839 y:istatus?1061-160:1066-160 source:istatus?imagePath_navi+"M8X_Location_icon_Pause.png":imagePath_navi+"M8X_Location_icon_play.png" } //===========================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_NIF_Gid_StopDemo() applinkControl.QML_NIF_Gid_StopGuide() applinkControl.QML_setGuideOffsetvalue(0); applinkControl.QML_CloseAppLink(); } } //===========================hideBtn===========================// HMIButton{ id: hideBtn x:862 y:269-160//108 visible: (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 bHideCrossView = true } if(bShowGuide){ bShowGuide = false } } } //===========================viewBtn===========================// HMIButton{ id: viewBtn x:862 y:269-160//108 visible: bHideCrossView||(bVisibleGuide&&(!bShowGuide)&&(!bShowCross)) btnImg: viewBtn.pressed?imagePath_navi+"M8X_Location_Button_p.png":imagePath_navi+"M8X_Location_Button.png" Image{ x:895-parent.x y:289-160-parent.y source:imagePath_navi+"M8X_Location_Arrow_L.png" } onClicked:{ if(bHideCrossView){ bShowCross = true bHideCrossView = false } if( bVisibleGuide && (bShowGuide==false) ){ bShowGuide = true } } } function fucChangeSpeedEnabled() { if(applinkControl.QML_NIF_Gid_DemoGetSpeed()==2){ accelerateBtn.enabled=false; }else{ accelerateBtn.enabled=true; } if(applinkControl.QML_NIF_Gid_DemoGetSpeed()==0){ redBtn.enabled=false; }else{ redBtn.enabled=true; } } 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 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_TmcBar{ id:tmcBar visible: applinkControl.QML_NIF_Tmc_GetShowSwitch() 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 } } } } }