//ADD #F0146 baojinfeng 2016/12/24 BEGIN import QtQuick 2.0 import Label 2.0 import "../../com/neusoft/auto/widgets" import "../../layoutList.js" as Layout import "../../windowsList.js" as WindowsList import "../" HMIMask { property int updateWidowsType: Layout.POP_TYPE id:pdcUpdatePopWindow widowsType:updateWidowsType formId: WindowsList.DIAG_PDCUPDATE mask_height:1280 property string bgImageStyle: systemCtrl.style property string sUpdateNewPDCVersion:diagCtrl.sUpdateNewPDCVersion property int bBtStatus: diagCtrl.bBtStatus //add #127989 20170116 liuming end Component.onCompleted: { visible:true } visible:false onVisibleChanged: { if (pdcUpdatePopWindow.visible == true) { pdcUpdateDialog.isBottomBtn = true } else { } } /*********** 8836 update DiagDialog **********/ DiagDialog { id:pdcUpdateDialog y:0 isCenterTitle:true isBottomBtn:true onVisibleChanged: { if(pdcUpdateDialog.visible) { centerTitleColor = "red" } else { } } centerTitle:"Confirm to update?" bottomLeftBtnText:"Yes" bottomRightBtnText:"No" HMILabel { id:newPDCVersion x: 160 y: 420 width: 842 height: 40 font.pixelSize: 24 horizontalAlignment: Label.AlignLeft text:"New PDC Ver:" + sUpdateNewPDCVersion color: "white" } /* process bar */ Rectangle { id:pdcprocessbar y: 480 anchors.horizontalCenter: parent.horizontalCenter width: 500 height: 25 visible: false Rectangle { anchors.bottom: parent.bottom anchors.left: parent.left width:diagCtrl.pdcUpdateProgress*5 height: 25 color: "red" } HMILabel { id: pdcUpdateProNum anchors.centerIn: parent width:60 height: 25 text:diagCtrl.pdcUpdateProgress + "%" color: "black" font.pixelSize: 20*rate } } onLeftButtonClick: { //update by zlx 2018/12/29 #315935 begin if( 1 == USBControl1.getUsbConnectState()) { systemCtrl.setStateMaskHardkey(Layout.HK_MASK_STATE_UPDATE,Layout.HK_MASK_ON) //add by zhangna for qc bug #168982 //btCtrl.setBtPowerOff();//add #127989 20170116 liuming end //add #127989 20170120 liuming begin if(bBtStatus == 1) { btCtrl.setBtPowerOffForSleep(); } else { // } //add #127989 20170120 liuming end pdcUpdateDialog.visible = false newPDCVersion.visible = false diagCtrl.reqStartUpdatePDC() } else { ScreenManager.hideOverlay(WindowsList.DIAG_PDCUPDATE) } //update by zlx 2018/12/29 #315935 end } onRightButtonClick: { ScreenManager.hideOverlay(WindowsList.DIAG_PDCUPDATE) } } /*Pop up result */ Item { id:popResult anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter visible: false Image { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter width: 844 height: 352 source: "qrc:MATERIAL/MATERIAL_M8X_POPUP_BG_WARNING" + bgImageStyle Rectangle { anchors.fill: parent color: "black" } HMILabel { id:popResultText anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter width: 844 height: 352 text:qsTr("PDC Update Failed!") color:"red" } } HMIMouseArea { anchors.fill: parent onClicked: { popResult.visible = false popUpResultTimer.stop() ScreenManager.hideOverlay(WindowsList.DIAG_PDCUPDATE) } } } /* Pop up result Timer */ Timer { id:popUpResultTimer interval: 2000 running: false repeat: false onTriggered: { popResult.visible = false ScreenManager.hideOverlay(WindowsList.DIAG_PDCUPDATE) } } //add #127989 20170116 liuming begin function btStatus() { if(bBtStatus == 1) { //btCtrl.setBtPowerOn() btCtrl.setBtPowerOnForSleep(); } else { //do nothing } } //add #127989 20170116 liuming end //update by zlx 2018/12/29 #315935 begin Connections { target: USBControl1 onUsbDisconnect: { ScreenManager.hideOverlay(WindowsList.DIAG_PDCUPDATE) } } //update by zlx 2018/12/29 #315935 end Connections { target:diagCtrl onPdcUpdateStartOK: { pdcUpdateDialog.visible = true pdcUpdateDialog.isBottomBtn = false newPDCVersion.visible = false pdcUpdateDialog.centerTitle = qsTr("Do not do any operation!") pdcprocessbar.visible = true } onPdcUpdateStartNG: { //add #127989 20170120 liuming begin if( diagCtrl.getCanUpdateFlag()==0 ) //1 means CanUpdate { systemCtrl.setStateMaskHardkey(Layout.HK_MASK_STATE_UPDATE,Layout.HK_MASK_OFF)//add by zhangna for bug #168982 btStatus(); } else { //do nothing } //add #127989 20170120 liuming end pdcUpdateDialog.visible = false popUpResultTimer.start() popResult.visible = true popResultText.text = qsTr("PDC Update Start Failed!") updateWidowsType = Layout.MESSAGE_TYPE//FOD #139403 2016/12/23 BAOJINFENG } onPdcUpdateSuccess: { if( diagCtrl.getCanUpdateFlag()==0 ) //1 means CanUpdate { systemCtrl.setStateMaskHardkey(Layout.HK_MASK_STATE_UPDATE,Layout.HK_MASK_OFF)//add by zhangna for bug #168982 btStatus();//add #127989 20170116 liuming end } else { //do nothing } ScreenManager.hideOverlay(WindowsList.DIAG_PDCUPDATE) ScreenManager.showOverlay(WindowsList.DIAG_PDCSUCCESSMESSAGE) } onPdcUpdateFailed: { //add #127989 20170120 liuming begin if( diagCtrl.getCanUpdateFlag()==0 ) //1 means CanUpdate { systemCtrl.setStateMaskHardkey(Layout.HK_MASK_STATE_UPDATE,Layout.HK_MASK_OFF)//add by zhangna for bug #168982 btStatus(); } else { //do nothing } //add #127989 20170120 liuming end pdcUpdateDialog.visible = false popUpResultTimer.start() popResult.visible = true popResultText.text = qsTr("PDC Update Failed!") updateWidowsType = Layout.MESSAGE_TYPE } } } //ADD #F0146 baojinfeng 2016/12/24 END