import QtQuick 2.0 import Label 2.0 import "../../com/neusoft/auto/widgets" import "../../layoutList.js" as Layout import "../../windowsList.js" as WindowsList import "../" DiagDevelopWindow { id:btsound_home property bool btserviceIsHFP:btCtrl.btserviceIsHFP property bool btserviceIsAVRCP:btCtrl.btserviceIsAVRCP property bool btConnectState:btCtrl.btConnectState property int entersource: diagCtrl.entersource Component.onCompleted: { visible = true } property string bgImageStyle: systemCtrl.style visible:false onVisibleChanged: { if (btsound_home.visible == true) { if (btConnectState == true) { if (btserviceIsAVRCP == true) { if (Layout.HMI_SRC_BTA != systemCtrl.getCurrentSource()) { systemCtrl.reqSource(Layout.HMI_SRC_BTA, Layout.HMI_SRC_START, Layout.HMI_SRC_Front) } else { // } } else { popUpResultTimer.start() popResult.visible = true popResultText.text = qsTr("No AVRCP Connected") } } else { popUpResultTimer.start() popResult.visible = true popResultText.text = qsTr("No BT Connected") } hfpmuteOutput.enabled = false hfpmuteOutput_txt.color = "gray" hfpstopOutput.enabled = false hfpstopOutput_txt.color = "gray" } else { //systemCtrl.reqSource(Layout.HMI_SRC_BTA, Layout.HMI_SRC_End, Layout.HMI_SRC_Front) systemCtrl.reqSource(entersource, Layout.HMI_SRC_START, Layout.HMI_SRC_Front) avpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle hfpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle avpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle hfpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle avpmuteOutput.enabled = true hfpmuteOutput.enabled = true avpstopOutput.enabled = false hfpstopOutput.enabled = false avpmuteOutput_txt.color = "white" avpstopOutput_txt.color = "white" } } HMIButton { id:back_btn x:0 y:165 - btsound_home.y width: 138 height: 70 btnImg: pressed?"qrc:MATERIAL/MATERIAL_M8X_BACK_BUTTON_P"+bgImageStyle:"qrc:MATERIAL/MATERIAL_M8X_BACK_BUTTON"+bgImageStyle Image { id:back_btn_image x:20 anchors.verticalCenter: parent.verticalCenter width: 20 height:34 source: "qrc:MATERIAL/MATERIAL_M8X_ICON_BACK"+bgImageStyle } HMILabel { id:back_btn_label x:44 width: 94//60 height: 70 text: qsTr("Back")+ systemCtrl.emptyString font.pixelSize: 30 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } onClicked: { ScreenManager.changeForm(Layout.ACT_BACK,WindowsList.DIAG_BTMAIN) } } Item { id:btmain_home_title x:0 y:0 width: 960 height: 78 HMILabel { width: 480//120 height: 78 text:qsTr("Diag-BTSoundIO") + systemCtrl.emptyString font.pixelSize: 30 color:"#e1e1e1" anchors.horizontalCenter: parent.horizontalCenter verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } } Item { id: diag_BTSoundIO_Flickable anchors.horizontalCenter: parent.horizontalCenter y: 265 - btsound_home.y width: 842 height: 760//636//760-124 Flickable { id:flick width: 842 height: 760//760-124 anchors.topMargin: 0 contentHeight: flick1.height contentWidth: parent.width clip:true interactive:false//true Column { id:flick1 width: 842 spacing: 2 Row { id: title_avp width: 842 height: 78 visible: (avptoneOutput_ROW.visible == true) ? true : false Item { width: 842 height: 78 HMILabel { id: avpTitle x: 142 width: 842 height: 30 text:qsTr("CODEC A(AVP)") + systemCtrl.emptyString color:"#e1e1e1" font.pixelSize: 30 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } } } Row { id: avptoneOutput_ROW width: 842 height: 78 visible: true spacing: 2 Item { width: 842 height: 78 HMIButton // the button of AVP Tone Output { id:avptoneOutput x: 20 width: 262 height: 78 visible: true btnImg: pressed?"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle:"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle HMILabel { id:avptoneOutput_txt width: 262 height: 78 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter font.pixelSize: 30 text:"Tone Output" color:"white" } onClicked: { systemCtrl.reqSource(Layout.HMI_SRC_PHONE, Layout.HMI_SRC_End, Layout.HMI_SRC_Front) //systemCtrl.reqSource(Layout.HMI_SRC_BTA, Layout.HMI_SRC_START, Layout.HMI_SRC_Front) hfpmuteOutput.enabled = false hfpmuteOutput_txt.color = "gray" hfpstopOutput.enabled = false hfpstopOutput_txt.color = "gray" avpmuteOutput.enabled = true avpmuteOutput_txt.color = "white" avpstopOutput.enabled = false avpstopOutput_txt.color = "white" hfpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle hfpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle if (Layout.HMI_SRC_PHONE == systemCtrl.getCurrentSource()) { diagCtrl.reqBtHfpStop() } else { // } } } HMIButton { id:avpmuteOutput x: 282//20+262//190 width: 262 height: 78 visible: true btnImg: "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle HMILabel { id:avpmuteOutput_txt width: 262 height: 78 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter font.pixelSize: 30 text:"Mute Output" color:"white" } onPressed: { avpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle } onClicked: { avpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle avpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle diagCtrl.reqBtAvpMute() avpstopOutput.enabled = true avpmuteOutput.enabled = false } } HMIButton { id:avpstopOutput x: 544//282+262//360 width: 262 height: 78 visible: true btnImg: "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle HMILabel { id:avpstopOutput_txt width: 262 height: 78 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter font.pixelSize: 30 text:"Stop" color:"white" } onPressed: { avpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle } onClicked: { avpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle avpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle diagCtrl.reqBtAvpStop() avpstopOutput.enabled = false avpmuteOutput.enabled = true } } } } Row { id: title_hfp width: 842 height: 78 visible: (avptoneOutput_ROW.visible == true) ? true : false Item { width: 842 height: 78 HMILabel { id: hfpTitle x: 142 width: 842 height: 78 text:qsTr("CODEC B(HFP)") + systemCtrl.emptyString color:"#e1e1e1" font.pixelSize: 30 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } } } Row { id: hfptoneOutput_ROW width: 842 height: 78 visible: true spacing: 2 Item { width: 842 height: 78 HMIButton // the button of HFP Tone Output { id:hfptoneOutput x: 20 width: 262 height: 78 visible: true btnImg: pressed?"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle:"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle HMILabel { id:hfptoneOutput_txt width: 262 height: 78 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter font.pixelSize: 30 text:"Tone Output" color:"white" } onClicked: { systemCtrl.reqSource(Layout.HMI_SRC_PHONE, Layout.HMI_SRC_START, Layout.HMI_SRC_Front) hfpmuteOutput.enabled = true hfpmuteOutput_txt.color = "white" hfpstopOutput.enabled = false hfpstopOutput_txt.color = "white" avpmuteOutput.enabled = false avpmuteOutput_txt.color = "gray" avpstopOutput.enabled = false avpstopOutput_txt.color = "gray" avpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle avpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle if (Layout.HMI_SRC_BTA == systemCtrl.getCurrentSource()) { diagCtrl.reqBtAvpStop() } else { // } } } HMIButton { id:hfpmuteOutput x: 282//190 width: 262 height: 78 visible: true btnImg: "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle HMILabel { id:hfpmuteOutput_txt width: 262 height: 78 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter font.pixelSize: 30 text:"Mute Output" color:"white" } onPressed: { hfpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle } onClicked: { hfpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle hfpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle diagCtrl.reqBtHfpMute() hfpstopOutput.enabled = true hfpmuteOutput.enabled = false } } HMIButton { id:hfpstopOutput x: 544//360 width: 262 height: 78 visible: true btnImg: "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle HMILabel { id:hfpstopOutput_txt width: 262 height: 78 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter font.pixelSize: 30 text:"Stop" color:"white" } onPressed: { hfpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle } onClicked: { hfpmuteOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262" + bgImageStyle hfpstopOutput.btnImg = "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_W262_P" + bgImageStyle diagCtrl.reqBtHfpStop() hfpstopOutput.enabled = false hfpmuteOutput.enabled = true } } } } } } } }