import QtQuick 2.0 import "../com/neusoft/auto/widgets" import "../eventsList.js" as EventsList import "../layoutList.js" as Layout import "../windowsList.js" as WindowsList import "../USB/usb_define.js" as UsbStatusList import "../AC/AC.js" as AC HMIWindow { id:androidauto_hmi x: 0 y: 0 width: 960 height: 576 opacity: 0 //MouseArea single finger default zuo biao property int mouseAAX_Default: 0 property int mouseAAY_Default: 0 property string bgImageStyle: systemCtrl.style property int timestamp: 0 property int fingerNumber: 1 Component.onCompleted: { windowID = WindowsList.ANDROIDAUTO_QML; } onVisibleChanged: { console.log("\n@AndroidAuto**ZLX**onVisibleChanged**androidauto_hmi.visible=**[ " +androidauto_hmi.visible+" ]\n"); /*console.log("\n@AndroidAuto**ZLX**onVisibleChanged**AdjustmentPageStatus(0 show/1 hide) =**[ " +acCtrl.getAdjustmentPageStatus()+" ]\n"); console.log("\n@AndroidAuto**ZLX**onVisibleChanged**acCtrl.iCVBSStatus(0 OFF)=**[ " +acCtrl.iCVBSStatus+" ]\n"); console.log("\n@AndroidAuto**ZLX**onVisibleChanged**systemCtrl.getWarningFlag(true zai)=**[ " +systemCtrl.getWarningFlag()+" ]\n");*/ if(true == androidauto_hmi.visible) { systemCtrl.changWindowlayerState(Layout.VIDEO_LAYER,UsbStatusList.VIDEO_ANDROIDAUTO); systemCtrl.changWindowlayer(Layout.VIDEO_LAYER,Layout.LayerShow); ScreenManager.setFormOpacityOpen(WindowsList.ANDROIDAUTO_QML); ScreenManager.hideOverlay(WindowsList.QUICKLINK_DRAG); ScreenManager.hideOverlay(WindowsList.FAVOURITE_LIST); systemCtrl.menuBarVisibleCtrl(false); } else { ScreenManager.setFormOpacityClose(WindowsList.ANDROIDAUTO_QML); } } MultiPointTouchArea { id: multiArea property variant points: [] touchPoints: [ TouchPoint { id: point1 }, TouchPoint { id: point2 } ] enabled: true anchors.fill: parent minimumTouchPoints: 1 maximumTouchPoints: 2 onPressed: { // console.log("\n\nmultiArea onPressed.point1.pressed= "+point1.pressed); // console.log("\n\nmultiArea onPressed.point2.pressed= "+point2.pressed); if((true == point1.pressed) && (false == point2.pressed)) { fingerNumber = 1; // console.log("\n@AndroidAuto**ZLX**onPressed**point1.x=**[ " +point1.x // +" ]**point1.y=**[ " +point1.y +" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,mouseAAX_Default ,mouseAAY_Default ,Layout.AA_SingleFinger ,Layout.AA_PressDown ,Layout.AA_ACTIONINDEX1_UPDOWN); } else if((true == point1.pressed) && (true == point2.pressed)) { fingerNumber = 2; // console.log("\n@AndroidAuto**ZLX**onPressed**point1.x=**[ "+point1.x // +" ] point1.y=** [ "+point1.y // +" ] point2.x=** [ "+point2.x // +" ] point2.y=** [ "+point2.y+" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,point2.x ,point2.y ,Layout.AA_DoubleFinger ,Layout.AA_POINTER2_DOWN ,Layout.AA_ACTIONINDEX2_UPDOWN); } else { //do nothing } } onGestureStarted: { // console.log("\n\nmultiArea onGestureStarted.fingerNumber= "+fingerNumber); if(1 == fingerNumber) { if(point1.x > 0 && point1.y > 0 && point1.y < 576) { // console.log("\n@AndroidAuto**ZLX**onGestureStarted**X Changed**point1.x=**[ "+point1.x // +" ] point1.y=** [ " +point1.y+" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,mouseAAX_Default ,mouseAAY_Default ,Layout.AA_SingleFinger ,Layout.AA_PressMove ,Layout.AA_ACTIONINDEX1_UPDOWN); } else if(!(point1.x > 0 && point1.y > 0 && point1.y < 576 )) { // console.log("\n@AndroidAuto**ZLX**onGestureStarted**Y Changed**point1.x=**[ "+point1.x // +" ] point1.y=** [ " +point1.y+" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,mouseAAX_Default ,mouseAAY_Default ,Layout.AA_SingleFinger ,Layout.AA_PressUp ,Layout.AA_ACTIONINDEX1_UPDOWN); } else { //do nothing } } else if(2 == fingerNumber) { // console.log("\n@AndroidAuto**ZLX**onGestureStarted**point1.x=**[ "+point1.x // +" ] point1.y=** [ "+point1.y // +" ] point2.x=** [ "+point2.x // +" ] point2.y=** [ "+point2.y+" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,point2.x ,point2.y ,Layout.AA_DoubleFinger ,Layout.AA_PressMove ,Layout.AA_ACTIONINDEX1_UPDOWN); } else { //do nothing } } onReleased: { // console.log("\n\nmultiArea onReleased.fingerNumber= "+fingerNumber); // console.log("\n\nmultiArea onReleased.point1.pressed= "+point1.pressed); // console.log("\n\nmultiArea onReleased.point2.pressed= "+point2.pressed); if(1 == fingerNumber) { if((false == point1.pressed) && (false == point2.pressed)) { // console.log("\n@AndroidAuto**ZLX**onReleased**point1.pressed**point1.x=**[ " +point1.x // +" ]**point1.y=**[ " +point1.y +" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,mouseAAX_Default ,mouseAAY_Default ,Layout.AA_SingleFinger ,Layout.AA_PressUp ,Layout.AA_ACTIONINDEX1_UPDOWN); } else { //do nothing } } else if(2 == fingerNumber) { if((false == point1.pressed) && (false == point2.pressed)) { // console.log("\n@AndroidAuto**ZLX**onReleased**point1.x=**[ "+point1.x // +" ] point1.y=** [ "+point1.y // +" ] point2.x=** [ "+point2.x // +" ] point2.y=** [ "+point2.y+" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,point2.x ,point2.y ,Layout.AA_DoubleFinger ,Layout.AA_POINTER2_UP/*AA_PressUp*/ ,Layout.AA_ACTIONINDEX2_UPDOWN); } else { //do nothing } } else { //do nothing } } onUpdated: { //do nothing } onTouchUpdated: { //do nothing } onCanceled: { //do nothing } } function funcCvbsStatusOn() { console.log("\n@AndroidAuto**ZLX**funcCvbsStatusOn**androidauto_hmi.visible=[" +androidauto_hmi.visible+"]\n"); if(true == androidauto_hmi.visible) { ScreenManager.showOverlay(WindowsList.HOME_STATE_BAR); ScreenManager.setFormZ(WindowsList.HOME_STATE_BAR,WindowsList.Z_OVERLAY_11); } else { //do nothing } } function funcCvbsStatusOff() { console.log("\n@AndroidAuto**ZLX**funcCvbsStatusOff**androidauto_hmi.visible=[" +androidauto_hmi.visible+"]\n"); console.log("\n@AndroidAuto**ZLX**funcCvbsStatusOff**acCtrl.getAdjustmentPageStatus()=[" +acCtrl.getAdjustmentPageStatus()+"]\n"); if(true == androidauto_hmi.visible) { if(AC.AC_BODYB_PAGE_HIDE == acCtrl.getAdjustmentPageStatus()) { ScreenManager.hideOverlay(WindowsList.HOME_STATE_BAR); ScreenManager.setFormZ(WindowsList.HOME_STATE_BAR,WindowsList.Z_OVERLAY_0); } else { //do nothing } } else { //do nothing } } function funcShowAdjustment() { console.log("\n@AndroidAuto**ZLX**funcShowAdjustment**androidauto_hmi.visible=[" +androidauto_hmi.visible+"]\n"); if(true == androidauto_hmi.visible) { ScreenManager.showOverlay(WindowsList.HOME_STATE_BAR); ScreenManager.setFormZ(WindowsList.HOME_STATE_BAR,WindowsList.Z_OVERLAY_10); } else { //do nothing } } function funcHideAdjustment() { console.log("\n@AndroidAuto**ZLX**funcHideAdjustment**androidauto_hmi.visible=[" +androidauto_hmi.visible+"]\n"); if(true == androidauto_hmi.visible) { if(AC.HMI_CVBS_OFF == acCtrl.iCVBSStatus) { ScreenManager.hideOverlay(WindowsList.HOME_STATE_BAR); ScreenManager.setFormZ(WindowsList.HOME_STATE_BAR,WindowsList.Z_OVERLAY_0); } else { //do nothing } } else { //do nothing } } Connections { target: acCtrl /*** CVBS signal ***/ onCvbsStatusOn: funcCvbsStatusOn() onCvbsStatusOff: funcCvbsStatusOff() /*** Aircontrol signal ***/ onShowAdjustment: funcShowAdjustment() onHideAdjustment: funcHideAdjustment() } function funcWarningFlagChange() { console.log("\n@AndroidAuto**ZLX**funcWarningFlagChange**androidauto_hmi.visible=[" +androidauto_hmi.visible+"]\n"); if(true == androidauto_hmi.visible) { ScreenManager.hideOverlay(WindowsList.HOME_STATE_BAR); ScreenManager.setFormZ(WindowsList.HOME_STATE_BAR,WindowsList.Z_OVERLAY_0); } else { //do nothing } } Connections { target:systemCtrl /*** warning flag false signal ***/ onWarningFlagChange: funcWarningFlagChange() } Connections { target: andrCtrl onAaSendXyTimer: { // console.log("\n@AndroidAuto**ZLX**onAaSendXyTimer**fingerNumber=**[ "+fingerNumber+" ]\n"); if(1 == fingerNumber) { if(point1.x > 0 && point1.y > 0 && point1.y < 576) { // console.log("\n@AndroidAuto**ZLX**onGestureStarted**X Changed**point1.x=**[ "+point1.x // +" ] point1.y=** [ " +point1.y+" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,mouseAAX_Default ,mouseAAY_Default ,Layout.AA_SingleFinger ,Layout.AA_PressDown ,Layout.AA_ACTIONINDEX1_UPDOWN); } else { //do nothing } } else if(2 == fingerNumber) { if((point1.x > 0 && point1.y > 0 && point1.y < 576) && (point2.x > 0 && point2.y > 0 && point2.y < 576)) { // console.log("\n@AndroidAuto**ZLX**onPressed**point1.x=**[ "+point1.x // +" ] point1.y=** [ "+point1.y // +" ] point2.x=** [ "+point2.x // +" ] point2.y=** [ "+point2.y+" ]\n"); andrCtrl.aa_ctrl_MouseAreaEvent(timestamp ,point1.x ,point1.y ,point2.x ,point2.y ,Layout.AA_DoubleFinger ,Layout.AA_POINTER2_DOWN ,Layout.AA_ACTIONINDEX2_UPDOWN); } else { //do nothing } } else { //do nothing } } } }