import QtQuick 2.0 import "../../com/neusoft/auto/widgets" import "../../windowsList.js" as WindowsList import "../../layoutList.js" as Layout import "../../Setting/Settinglist.js" as Settinglist import "../../eventsList.js" as EventsList Item { id: diagLights_home x:20 width: right3.width height: right3.height //fod F0109 2016/11/26 liuming begin // property int iDaytimeRunningChecked: settingCtrl.iDaytimeRunning // property int iWelcomeLightChecked: settingCtrl.iWelcomeLight // property int iFollowMeHomeTChecked: settingCtrl.iFollowMeHomeT // property int iAmbientChecked: settingCtrl.iAmbient property int iDaytimeRunning: 1 property int iWelcomeLight: 2 property int iFollowMeHomeT: 2 property int iAmbient: 1 property int iWirelessChargSwitch: 0 property string style: systemCtrl.style onVisibleChanged: { if(diagLights_home.visible == true) { diagCtrl.getLightsInfo(); // switch(iDaytimeRunningChecked) // { // case Settinglist.DAYTIME_CHOICE_BOX_CHECKED: // { // iDaytimeRunning = iDaytimeRunningChecked // daytime_running_btn.text = "ON" // break; // } // case Settinglist.DAYTIME_CHOICE_BOX: // { // iDaytimeRunning = iDaytimeRunningChecked // daytime_running_btn.text = "OFF" // break; // } // default: // { // break; // } // } // switch(iWelcomeLightChecked) // { // case Settinglist.WELCOMELIGHT_OFF: // { // iWelcomeLight = iWelcomeLightChecked // welcome_value.text = "OFF" // break; // } // case Settinglist.WELCOMELIGHT_THIRTY: // { // iWelcomeLight = iWelcomeLightChecked // welcome_value.text = "30s" // break; // } // case Settinglist.WELCOMELIGHT_SIXTY: // { // iWelcomeLight = iWelcomeLightChecked // welcome_value.text = "60s" // break; // } // case Settinglist.WELCOMELIGHT_NINETY: // { // iWelcomeLight = iWelcomeLightChecked // welcome_value.text = "90s" // break; // } // default: // { // break; // } // } // switch(iFollowMeHomeTChecked) // { // case Settinglist.FOLLOWMEHOME_TIME_OFF: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "OFF" // break; // } // case Settinglist.FOLLOWMEHOME_TIME_THIRTY: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "30s" // break; // } // case Settinglist.FOLLOWMEHOME_TIME_SIXTY: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "60s" // break; // } // case Settinglist.FOLLOWMEHOME_TIME_NINETY: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "90s" // break; // } // case Settinglist.FOLLOWMEHOME_TIME_OTZ: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "120s" // break; // } // default: // { // break; // } // } // switch(iAmbientChecked) // { // case Settinglist.AMBIENT_CHOICE_CHECKED: // { // ambient_btn.text = "ON" // iAmbient = iAmbientChecked // break; // } // case Settinglist.AMBIENT_CHOICE_BOX: // { // ambient_btn.text = "OFF" // iAmbient = iAmbientChecked // break; // } // default: // { // break; // } // } if (systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_FOLLOWMEHOME_LIGHT) == 0) { follow_me_home.visible = false } else if(systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_FOLLOWMEHOME_LIGHT) == 1) { follow_me_home.visible = true } else { //do nothing } if (systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_DAYTIME_LIGHT) == 0) { daytime_running.visible = false } else if(systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_DAYTIME_LIGHT) == 1) { daytime_running.visible = true } else { //do nothing } if (systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_WELCOMELIGHT) == 0) { welcome.visible = false } else if(systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_WELCOMELIGHT) == 1) { welcome.visible = true } else { //do nothing } if (systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_AMBIENTLIGHT) == 0) { ambient.visible = false } else if(systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_AMBIENTLIGHT) == 1) { ambient.visible = true } else { //do nothing } if (systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_WIRELESS_CHARGING) == 0) { wireless_charging.visible = false } else if(systemCtrl.checkAppCommCodingData(EventsList.HMI_CODING_WIRELESS_CHARGING) == 1) { wireless_charging.visible = true } else { //do nothing } } else { //do nothing } } Column { id:right3 x: 0 y: 0 width: 842 anchors.topMargin: 0 spacing: 2 Row { id: ambient width: right3.width height: 78 Item //for Occupying { width: 18 height: 1 } HMILabel { id:ambient_text width:480//24*20 height:78 text: qsTr("Ambient light")+ systemCtrl.emptyString font.pixelSize: 30 color:"#e1e1e1" anchors.verticalCenter: parent.verticalCenter verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } Item //for Occupying { width: 842 - ambient_text.width - ambient_btn.width - 36 height: 1 } HMILabel //The Button of DaytimeRunning { id:ambient_btn width: 100 height: 78 text: (Settinglist.AMBIENT_CHOICE_BOX == iAmbient)?qsTr("OFF") + systemCtrl.emptyString:qsTr("ON")+ systemCtrl.emptyString font.pixelSize: 30 color:"#e1e1e1" verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignRight } } Row { id: daytime_running width: right3.width height: 78 Item //for Occupying { width: 18 height: 1 } HMILabel { id:daytime_running_text width:480//24*20 height:78 text: qsTr("Daytime running")+ systemCtrl.emptyString font.pixelSize: 30 color:"#e1e1e1" anchors.verticalCenter: parent.verticalCenter verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } Item //for Occupying { width: 842 - daytime_running_text.width - daytime_running_btn.width - 36 height: 1 } HMILabel //The Button of DaytimeRunning { id:daytime_running_btn width: 100 height: 78 text: (Settinglist.DAYTIME_CHOICE_BOX == iDaytimeRunning)?qsTr("OFF") + systemCtrl.emptyString:qsTr("ON")+ systemCtrl.emptyString font.pixelSize: 30 color:"#e1e1e1" verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignRight } } Row { id: welcome width: right3.width height: 78 Item //for Occupying { width: 18 height: 1 } HMILabel { id: welcome_text width:480 height: 78 text:qsTr("Welcome") + systemCtrl.emptyString color:"#e1e1e1" font.pixelSize: 30 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } Item //for Occupying { width: 842 - welcome_text.width - welcome_value.width - 36 height: 1 } HMILabel { id: welcome_value width: 100 height: 78 text:(iWelcomeLight == Settinglist.WELCOMELIGHT_OFF)?"OFF":(iWelcomeLight == Settinglist.WELCOMELIGHT_THIRTY)?"30s":(iWelcomeLight == Settinglist.WELCOMELIGHT_NINETY)?"90s":"60s" font.pixelSize: 30 color:"#e1e1e1" verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignRight } } Row { id: follow_me_home width: right3.width height: 78 Item //for Occupying { width: 18 height: 1 } HMILabel { id: follow_me_home_text width:480 height: 78 text:qsTr("Follow me home") + systemCtrl.emptyString color:"#e1e1e1" font.pixelSize: 30 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } Item //for Occupying { width: 842 - follow_me_home_text.width - follow_me_home_value.width - 36 height: 1 } HMILabel { id: follow_me_home_value width: 100 height: 78 text:(iFollowMeHomeT == Settinglist.FOLLOWMEHOME_TIME_OFF)?"OFF":(iFollowMeHomeT == Settinglist.FOLLOWMEHOME_TIME_THIRTY)?"30s":(iFollowMeHomeT == Settinglist.FOLLOWMEHOME_TIME_OTZ)?"120s":(iFollowMeHomeT == Settinglist.FOLLOWMEHOME_TIME_NINETY)?"90s":"60s" font.pixelSize: 30 color:"#e1e1e1" verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignRight } } Row { id: wireless_charging width: right3.width height: 78 Item //for Occupying { width: 18 height: 1 } HMILabel { id: wireless_charging_text width:480 height: 78 text:qsTr("Wireless charging for cellphone") + systemCtrl.emptyString color:"#e1e1e1" font.pixelSize: 30 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft } Item //for Occupying { width: 842 - wireless_charging_text.width - wireless_charging_value.width - 36 height: 1 } HMILabel { id:wireless_charging_value width: 100 height: 78 text:(iWirelessChargSwitch == Settinglist.WIRELESSCHARGE_CHOICE_CHECKED)?"ON":"OFF" font.pixelSize: 30 color:"#e1e1e1" verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignRight } } } Connections { target: diagCtrl onLightsInfoChanged: { iDaytimeRunning = currDaytimeRunning iWelcomeLight = currWelcomeLight iFollowMeHomeT = currFollowMeHomeT iAmbient = currAmbient iWirelessChargSwitch = currWirelessChargSwitch } // target: settingCtrl // onDaytimeRunningChanged: // { // switch(iDaytimeRunningChecked) // { // case Settinglist.DAYTIME_CHOICE_BOX_CHECKED: // { // iDaytimeRunning = iDaytimeRunningChecked // daytime_running_btn.text = "ON" // break; // } // case Settinglist.DAYTIME_CHOICE_BOX: // { // iDaytimeRunning = iDaytimeRunningChecked // daytime_running_btn.text = "OFF" // break; // } // default: // { // break; // } // } // } // onWelcomeLightChanged: // { // switch(iWelcomeLightChecked) // { // case Settinglist.WELCOMELIGHT_OFF: // { // iWelcomeLight = iWelcomeLightChecked // welcome_value.text = "OFF" // break; // } // case Settinglist.WELCOMELIGHT_THIRTY: // { // iWelcomeLight = iWelcomeLightChecked // welcome_value.text = "30s" // break; // } // case Settinglist.WELCOMELIGHT_SIXTY: // { // iWelcomeLight = iWelcomeLightChecked // welcome_value.text = "60s" // break; // } // case Settinglist.WELCOMELIGHT_NINETY: // { // iWelcomeLight = iWelcomeLightChecked // welcome_value.text = "90s" // break; // } // default: // { // break; // } // } // } // onFollowMeHomeTChanged: // { // switch(iFollowMeHomeTChecked) // { // case Settinglist.FOLLOWMEHOME_TIME_OFF: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "OFF" // break; // } // case Settinglist.FOLLOWMEHOME_TIME_THIRTY: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "30s" // break; // } // case Settinglist.FOLLOWMEHOME_TIME_SIXTY: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "60s" // break; // } // case Settinglist.FOLLOWMEHOME_TIME_NINETY: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "90s" // break; // } // case Settinglist.FOLLOWMEHOME_TIME_OTZ: // { // iFollowMeHomeT = iFollowMeHomeTChecked // follow_me_home_value.text = "120s" // break; // } // default: // { // break; // } // } // } // onAmbientChanged: // { // switch(iAmbientChecked) // { // case Settinglist.AMBIENT_CHOICE_CHECKED: // { // ambient_btn.text = "ON" // iAmbient = iAmbientChecked // break; // } // case Settinglist.AMBIENT_CHOICE_BOX: // { // ambient_btn.text = "OFF" // iAmbient = iAmbientChecked // break; // } // default: // { // break; // } // } // } } //fod F0109 2016/11/26 liuming end }