PHD Project - Driver energy prediction
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

257 lines
18 KiB

# -*- coding: utf-8 -*-
# Description: Python3 HMI/UI to set adb commands for HCP3
# Author: Johannes Ziegmann
# Mail: johannes.ziegmann@audi.de
# Date: 10.10.2021
############### IMPORT ###############
import sys
import subprocess
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_adbCommandsJZ(object):
def setupUi(self, adbCommandsJZ):
adbCommandsJZ.setObjectName("adbCommandsJZ")
adbCommandsJZ.setEnabled(True)
adbCommandsJZ.resize(642, 759)
adbCommandsJZ.setContextMenuPolicy(QtCore.Qt.NoContextMenu)
self.textBrowser_Console = QtWidgets.QTextBrowser(adbCommandsJZ)
self.textBrowser_Console.setGeometry(QtCore.QRect(30, 550, 591, 192))
self.textBrowser_Console.setObjectName("textBrowser_Console")
self.pushButton_setMaxEnergyContent = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_setMaxEnergyContent.setGeometry(QtCore.QRect(30, 30, 211, 25))
self.pushButton_setMaxEnergyContent.setObjectName("pushButton_setMaxEnergyContent")
self.pushButton_setCurrentEnergyContent = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_setCurrentEnergyContent.setGeometry(QtCore.QRect(30, 60, 211, 25))
self.pushButton_setCurrentEnergyContent.setObjectName("pushButton_setCurrentEnergyContent")
self.lineEdit_setMaxEnergyContent = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_setMaxEnergyContent.setGeometry(QtCore.QRect(260, 30, 81, 25))
self.lineEdit_setMaxEnergyContent.setObjectName("lineEdit_setMaxEnergyContent")
self.pushButton_setAltitudeGainConsumption = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_setAltitudeGainConsumption.setGeometry(QtCore.QRect(30, 90, 211, 25))
self.pushButton_setAltitudeGainConsumption.setObjectName("pushButton_setAltitudeGainConsumption")
self.pushButton_setAltitudeLossConsumption = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_setAltitudeLossConsumption.setGeometry(QtCore.QRect(30, 120, 211, 25))
self.pushButton_setAltitudeLossConsumption.setObjectName("pushButton_setAltitudeLossConsumption")
self.lineEdit_setCurrentEnergyContent = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_setCurrentEnergyContent.setGeometry(QtCore.QRect(260, 60, 81, 25))
self.lineEdit_setCurrentEnergyContent.setObjectName("lineEdit_setCurrentEnergyContent")
self.lineEdit_setAltitudeGainConsumption = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_setAltitudeGainConsumption.setGeometry(QtCore.QRect(260, 90, 81, 25))
self.lineEdit_setAltitudeGainConsumption.setObjectName("lineEdit_setAltitudeGainConsumption")
self.lineEdit_setAltitudeLossConsumption = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_setAltitudeLossConsumption.setGeometry(QtCore.QRect(260, 120, 81, 25))
self.lineEdit_setAltitudeLossConsumption.setObjectName("lineEdit_setAltitudeLossConsumption")
self.pushButton_velocityConcumption = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_velocityConcumption.setGeometry(QtCore.QRect(30, 150, 591, 25))
self.pushButton_velocityConcumption.setObjectName("pushButton_velocityConcumption")
self.lineEdit_VELOCITY_VALUE_1 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_1.setGeometry(QtCore.QRect(30, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_1.setObjectName("lineEdit_VELOCITY_VALUE_1")
self.lineEdit_VELOCITY_VALUE_2 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_2.setGeometry(QtCore.QRect(90, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_2.setObjectName("lineEdit_VELOCITY_VALUE_2")
self.lineEdit_VELOCITY_VALUE_3 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_3.setGeometry(QtCore.QRect(150, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_3.setObjectName("lineEdit_VELOCITY_VALUE_3")
self.lineEdit_VELOCITY_VALUE_4 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_4.setGeometry(QtCore.QRect(210, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_4.setObjectName("lineEdit_VELOCITY_VALUE_4")
self.lineEdit_VELOCITY_VALUE_6 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_6.setGeometry(QtCore.QRect(330, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_6.setObjectName("lineEdit_VELOCITY_VALUE_6")
self.lineEdit_VELOCITY_VALUE_8 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_8.setGeometry(QtCore.QRect(450, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_8.setObjectName("lineEdit_VELOCITY_VALUE_8")
self.lineEdit_VELOCITY_VALUE_5 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_5.setGeometry(QtCore.QRect(270, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_5.setObjectName("lineEdit_VELOCITY_VALUE_5")
self.lineEdit_VELOCITY_VALUE_7 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_7.setGeometry(QtCore.QRect(390, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_7.setObjectName("lineEdit_VELOCITY_VALUE_7")
self.lineEdit_VELOCITY_VALUE_10 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_10.setGeometry(QtCore.QRect(570, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_10.setObjectName("lineEdit_VELOCITY_VALUE_10")
self.lineEdit_VELOCITY_VALUE_9 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VELOCITY_VALUE_9.setGeometry(QtCore.QRect(510, 180, 51, 25))
self.lineEdit_VELOCITY_VALUE_9.setObjectName("lineEdit_VELOCITY_VALUE_9")
self.pushButton_setOffsetVelocity = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_setOffsetVelocity.setGeometry(QtCore.QRect(30, 220, 591, 25))
self.pushButton_setOffsetVelocity.setObjectName("pushButton_setOffsetVelocity")
self.lineEdit_VelocityOffset_Highway = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VelocityOffset_Highway.setGeometry(QtCore.QRect(30, 250, 81, 25))
self.lineEdit_VelocityOffset_Highway.setText("")
self.lineEdit_VelocityOffset_Highway.setObjectName("lineEdit_VelocityOffset_Highway")
self.lineEdit_VelocityOffset_FRC1 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VelocityOffset_FRC1.setGeometry(QtCore.QRect(130, 250, 81, 25))
self.lineEdit_VelocityOffset_FRC1.setText("")
self.lineEdit_VelocityOffset_FRC1.setObjectName("lineEdit_VelocityOffset_FRC1")
self.lineEdit_VelocityOffset_FRC2 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VelocityOffset_FRC2.setGeometry(QtCore.QRect(230, 250, 81, 25))
self.lineEdit_VelocityOffset_FRC2.setText("")
self.lineEdit_VelocityOffset_FRC2.setObjectName("lineEdit_VelocityOffset_FRC2")
self.lineEdit_VelocityOffset_FRC3 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VelocityOffset_FRC3.setGeometry(QtCore.QRect(340, 250, 81, 25))
self.lineEdit_VelocityOffset_FRC3.setText("")
self.lineEdit_VelocityOffset_FRC3.setObjectName("lineEdit_VelocityOffset_FRC3")
self.lineEdit_VelocityOffset_FRC4 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VelocityOffset_FRC4.setGeometry(QtCore.QRect(440, 250, 81, 25))
self.lineEdit_VelocityOffset_FRC4.setText("")
self.lineEdit_VelocityOffset_FRC4.setObjectName("lineEdit_VelocityOffset_FRC4")
self.lineEdit_VelocityOffset_FRC5 = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_VelocityOffset_FRC5.setGeometry(QtCore.QRect(540, 250, 81, 25))
self.lineEdit_VelocityOffset_FRC5.setText("")
self.lineEdit_VelocityOffset_FRC5.setObjectName("lineEdit_VelocityOffset_FRC5")
self.pushButton_setCustomerActionTrigger = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_setCustomerActionTrigger.setGeometry(QtCore.QRect(30, 290, 211, 25))
self.pushButton_setCustomerActionTrigger.setObjectName("pushButton_setCustomerActionTrigger")
self.lineEdit_customerActionTrigger = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_customerActionTrigger.setGeometry(QtCore.QRect(260, 290, 81, 25))
self.lineEdit_customerActionTrigger.setObjectName("lineEdit_customerActionTrigger")
self.pushButton_mockAllServices = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_mockAllServices.setGeometry(QtCore.QRect(390, 30, 231, 25))
self.pushButton_mockAllServices.setObjectName("pushButton_mockAllServices")
self.pushButton_mockCMC = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_mockCMC.setGeometry(QtCore.QRect(390, 60, 231, 25))
self.pushButton_mockCMC.setObjectName("pushButton_mockCMC")
self.pushButton_mockEnergyPowerPrediction = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_mockEnergyPowerPrediction.setGeometry(QtCore.QRect(390, 90, 231, 25))
self.pushButton_mockEnergyPowerPrediction.setObjectName("pushButton_mockEnergyPowerPrediction")
self.pushButton_mockRWB = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_mockRWB.setGeometry(QtCore.QRect(390, 120, 231, 25))
self.pushButton_mockRWB.setObjectName("pushButton_mockRWB")
self.pushButton_setPosition = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_setPosition.setGeometry(QtCore.QRect(30, 370, 211, 25))
self.pushButton_setPosition.setObjectName("pushButton_setPosition")
self.lineEdit_latitude = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_latitude.setGeometry(QtCore.QRect(260, 370, 81, 25))
self.lineEdit_latitude.setObjectName("lineEdit_latitude")
self.lineEdit_longitude = QtWidgets.QLineEdit(adbCommandsJZ)
self.lineEdit_longitude.setGeometry(QtCore.QRect(360, 370, 81, 25))
self.lineEdit_longitude.setInputMask("")
self.lineEdit_longitude.setObjectName("lineEdit_longitude")
self.comboBox_PositionSelection = QtWidgets.QComboBox(adbCommandsJZ)
self.comboBox_PositionSelection.setGeometry(QtCore.QRect(480, 370, 141, 25))
self.comboBox_PositionSelection.setObjectName("comboBox_PositionSelection")
self.comboBox_PositionSelection.addItem("")
self.comboBox_PositionSelection.addItem("")
self.comboBox_PositionSelection.addItem("")
self.comboBox_PositionSelection.addItem("")
self.comboBox_PositionSelection.addItem("")
self.pushButton_disableDemoMode = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_disableDemoMode.setGeometry(QtCore.QRect(30, 410, 211, 25))
self.pushButton_disableDemoMode.setObjectName("pushButton_disableDemoMode")
self.pushButton_playRouteFromNavigation = QtWidgets.QPushButton(adbCommandsJZ)
self.pushButton_playRouteFromNavigation.setGeometry(QtCore.QRect(30, 450, 211, 25))
self.pushButton_playRouteFromNavigation.setObjectName("pushButton_playRouteFromNavigation")
self.label = QtWidgets.QLabel(adbCommandsJZ)
self.label.setGeometry(QtCore.QRect(40, 520, 67, 17))
self.label.setObjectName("label")
self.retranslateUi(adbCommandsJZ)
QtCore.QMetaObject.connectSlotsByName(adbCommandsJZ)
def retranslateUi(self, adbCommandsJZ):
_translate = QtCore.QCoreApplication.translate
adbCommandsJZ.setWindowTitle(_translate("adbCommandsJZ", "adb commands JZ"))
self.pushButton_setMaxEnergyContent.setText(_translate("adbCommandsJZ", "set maximumEnergyContent"))
self.pushButton_setCurrentEnergyContent.setText(_translate("adbCommandsJZ", "set currentEnergyContent"))
self.pushButton_setAltitudeGainConsumption.setText(_translate("adbCommandsJZ", "set altitudeGainConsumption"))
self.pushButton_setAltitudeLossConsumption.setText(_translate("adbCommandsJZ", "set altitudeLossConsumption"))
self.pushButton_velocityConcumption.setText(_translate("adbCommandsJZ", "set velocity dependent consumption"))
self.pushButton_velocityConcumption.clicked.connect(self.fcnpushButton_velocityConcumption)
self.lineEdit_VELOCITY_VALUE_1.setPlaceholderText(_translate("adbCommandsJZ", "v1"))
self.lineEdit_VELOCITY_VALUE_2.setPlaceholderText(_translate("adbCommandsJZ", "v2"))
self.lineEdit_VELOCITY_VALUE_3.setPlaceholderText(_translate("adbCommandsJZ", "v3"))
self.lineEdit_VELOCITY_VALUE_4.setPlaceholderText(_translate("adbCommandsJZ", "v4"))
self.lineEdit_VELOCITY_VALUE_6.setPlaceholderText(_translate("adbCommandsJZ", "v6"))
self.lineEdit_VELOCITY_VALUE_8.setPlaceholderText(_translate("adbCommandsJZ", "v8"))
self.lineEdit_VELOCITY_VALUE_5.setPlaceholderText(_translate("adbCommandsJZ", "v5"))
self.lineEdit_VELOCITY_VALUE_7.setPlaceholderText(_translate("adbCommandsJZ", "v7"))
self.lineEdit_VELOCITY_VALUE_10.setPlaceholderText(_translate("adbCommandsJZ", "v10"))
self.lineEdit_VELOCITY_VALUE_9.setPlaceholderText(_translate("adbCommandsJZ", "v9"))
self.pushButton_setOffsetVelocity.setText(_translate("adbCommandsJZ", "set offset velocity"))
self.pushButton_setOffsetVelocity.clicked.connect(self.fcnpushButton_setOffsetVelocity)
self.lineEdit_VelocityOffset_Highway.setPlaceholderText(_translate("adbCommandsJZ", "highway"))
self.lineEdit_VelocityOffset_FRC1.setPlaceholderText(_translate("adbCommandsJZ", "FRC1"))
self.lineEdit_VelocityOffset_FRC2.setPlaceholderText(_translate("adbCommandsJZ", "FRC2"))
self.lineEdit_VelocityOffset_FRC3.setPlaceholderText(_translate("adbCommandsJZ", "FRC3"))
self.lineEdit_VelocityOffset_FRC4.setPlaceholderText(_translate("adbCommandsJZ", "FRC4"))
self.lineEdit_VelocityOffset_FRC5.setPlaceholderText(_translate("adbCommandsJZ", "FRC5"))
self.pushButton_setCustomerActionTrigger.setText(_translate("adbCommandsJZ", "set customerActionTrigger"))
self.pushButton_setCustomerActionTrigger.clicked.connect(self.fcnpushButton_setCustomerActionTrigger)
self.pushButton_mockAllServices.setText(_translate("adbCommandsJZ", "mock allServices"))
self.pushButton_mockAllServices.clicked.connect(self.fcnpushButton_mockAllServices)
self.pushButton_mockCMC.setText(_translate("adbCommandsJZ", "mock ChargingManagementCore"))
self.pushButton_mockCMC.clicked.connect(self.fcnpushButton_mockCMC)
self.pushButton_mockEnergyPowerPrediction.setText(_translate("adbCommandsJZ", "mock EnergyPowerPrediction"))
self.pushButton_mockEnergyPowerPrediction.clicked.connect(self.fcnpushButton_mockEnergyPowerPrediction)
self.pushButton_mockRWB.setText(_translate("adbCommandsJZ", "mock RouteBasedConsumption"))
self.pushButton_mockRWB.clicked.connect(self.fcnpushButton_mockRWB)
self.pushButton_setPosition.setText(_translate("adbCommandsJZ", "set position"))
self.pushButton_setPosition.clicked.connect(self.fcnpushButton_setPosition)
self.lineEdit_latitude.setPlaceholderText(_translate("adbCommandsJZ", "latitude"))
self.lineEdit_longitude.setPlaceholderText(_translate("adbCommandsJZ", "longitude"))
self.comboBox_PositionSelection.setItemText(0, _translate("adbCommandsJZ", "Ingolstadt"))
self.comboBox_PositionSelection.setItemText(1, _translate("adbCommandsJZ", "Munich"))
self.comboBox_PositionSelection.setItemText(2, _translate("adbCommandsJZ", "Weissach"))
self.comboBox_PositionSelection.setItemText(3, _translate("adbCommandsJZ", "Berlin"))
self.comboBox_PositionSelection.setItemText(4, _translate("adbCommandsJZ", "Amsterdam"))
# ToDo
self.pushButton_disableDemoMode.setText(_translate("adbCommandsJZ", "disable DemoMode"))
self.pushButton_disableDemoMode.clicked.connect(self.fcnpushButton_disableDemoMode)
self.pushButton_playRouteFromNavigation.setText(_translate("adbCommandsJZ", "playRouteFromNavigation"))
self.pushButton_playRouteFromNavigation.clicked.connect(self.fcnpushButton_playRouteFromNavigation)
self.label.setText(_translate("adbCommandsJZ", "Console"))
def xxx(self):
subprocess.call("xx",shell=True)
def xxx(self):
subprocess.call("xx",shell=True)
def xxx(self):
subprocess.call("xx",shell=True)
def xxx(self):
subprocess.call("xx",shell=True)
def fcnpushButton_velocityConcumption(self):
# ToDo: Consumption
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef consumptionFactorDrivingProfile 5f",shell=True)
def fcnpushButton_setOffsetVelocity(self):
# ToDo: OffsetVelocities
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ei VELOCITY_UNLIMITED_HIGHWAY_VALUE 5", shell=True)
def fcnpushButton_setCustomerActionTrigger(self):
# ToDo: Set Value CustomerActionTrigger
subprocess.call(
"adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ei CUSTOMER_ACTION_TRIGGER_VALUE 10",
shell=True)
def fcnpushButton_mockAllServices(self):
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.SWITCH_ALL_SERVICE_IDS --ei serviceID 2",shell=True)
def fcnpushButton_mockCMC(self):
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.SWITCH_TO_SERVICE --ei serviceID 2 --es serviceName ChargingManagementCore",shell=True)
def fcnpushButton_mockEnergyPowerPrediction(self):
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.SWITCH_TO_SERVICE --ei serviceID 2 --es serviceName EnergyPowerPrediction",shell=True)
def fcnpushButton_mockRWB(self):
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.SWITCH_TO_SERVICE --ei serviceID 2 --es serviceName RouteBasedConsumption",shell=True)
def fcnpushButton_setPosition(self):
# ToDo: Position
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.SET_POSITION --ef latitude 48.762156 --ef longitude 11.42541 --ef bearing 45.0",shell=True)
def fcncomboBox_PositionSelection(self):
# ToDo: Select Position
print('ToDo')
def fcnpushButton_disableDemoMode(self):
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.DISABLE_DEMOMODE",shell=True)
def fcnpushButton_playRouteFromNavigation(self):
subprocess.call("adb shell am broadcast -a de.esolutions.navigation.REPLAY_ROUTE",shell=True)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
adbCommandsJZ = QtWidgets.QDialog()
ui = Ui_adbCommandsJZ()
ui.setupUi(adbCommandsJZ)
adbCommandsJZ.show()
sys.exit(app.exec_())