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.
873 lines
51 KiB
873 lines
51 KiB
# Title: CARIAD-Routing GUI |
|
# Author: Johannes Ziegmann |
|
# Mail: johannes.ziegmann@cariad.technology |
|
# Date: 10.12.2021 |
|
# Description: CARIAD-Routing GUI for showing the request details graphically distributed on map |
|
|
|
import sys |
|
import os |
|
import requests |
|
import time |
|
import datetime |
|
import subprocess |
|
|
|
from PyQt5 import QtCore, QtWidgets |
|
from PyQt5.QtCore import * |
|
from PyQt5.QtWidgets import * |
|
from PyQt5.QtWebEngineWidgets import QWebEngineView |
|
|
|
|
|
# Creating the main window |
|
class App(QMainWindow): |
|
def __init__(self): |
|
super().__init__() |
|
self.title = 'CARIAD Routing (JZ)' |
|
self.setWindowTitle(self.title) |
|
self.setGeometry(250, 250, 1050, 1000) |
|
|
|
self.tab_widget = MyTabWidget(self) |
|
self.setCentralWidget(self.tab_widget) |
|
|
|
self.show() |
|
|
|
# Creating tab widgets |
|
class MyTabWidget(QWidget): |
|
def __init__(self, parent): |
|
super(QWidget, self).__init__(parent) |
|
self.layout = QVBoxLayout(self) |
|
|
|
# Initialize tab screen |
|
self.tabs = QTabWidget() |
|
self.tab1 = QWidget() |
|
self.tab2 = QWidget() |
|
self.tab3 = QWidget() |
|
self.tab4 = QWidget() |
|
|
|
self.tab1UI() |
|
self.tab2UI() |
|
self.tab3UI() |
|
self.tab4UI() |
|
|
|
# Add tabs to widget |
|
self.layout.addWidget(self.tabs) |
|
self.setLayout(self.layout) |
|
|
|
### tab MAP ############################################# |
|
def tab1UI(self): |
|
self.tabs.addTab(self.tab1, "Map") |
|
|
|
self.pushButton_setStart = QPushButton() |
|
self.pushButton_setStart.setGeometry(QtCore.QRect(10, 10, 350, 35)) |
|
self.pushButton_setStart.setFixedSize(350,35) |
|
self.pushButton_setStart.setObjectName("pushButton_setStart") |
|
self.pushButton_setStart.clicked.connect(self.setStart) |
|
self.pushButton_setStart.setText("set ccp") |
|
self.pushButton_setDestination = QPushButton() |
|
self.pushButton_setDestination.setGeometry(QtCore.QRect(10, 55, 350, 35)) |
|
self.pushButton_setDestination.setFixedSize(350,35) |
|
self.pushButton_setDestination.setObjectName("pushButton_setDestination") |
|
self.pushButton_setDestination.clicked.connect(self.setDestination) |
|
self.pushButton_setDestination.setText("set Destination") |
|
self.pushButton_playRouteFromNav = QPushButton() |
|
self.pushButton_playRouteFromNav.setGeometry(QtCore.QRect(360, 10, 350, 35)) |
|
self.pushButton_playRouteFromNav.setFixedSize(350,35) |
|
self.pushButton_playRouteFromNav.setObjectName("pushButton_playRouteFromNav") |
|
self.pushButton_playRouteFromNav.clicked.connect(self.payRouteFromNav) |
|
self.pushButton_playRouteFromNav.setText("play Route from Nav.") |
|
|
|
self.label_map = QWebEngineView(self.tab1)#(ui.centralwidget) |
|
self.label_map.setGeometry(QtCore.QRect(10, 90, 1010, 860)) |
|
local_url = QUrl.fromLocalFile(os.path.abspath("./map.html")) |
|
self.label_map.load(local_url) |
|
self.label_map.setWindowTitle('QWebEngineView') |
|
self.label_map.show() |
|
self.label_map.setZoomFactor(1.5) |
|
|
|
vbox = QVBoxLayout() |
|
vbox.addWidget(self.pushButton_setStart) |
|
vbox.addWidget(self.pushButton_setDestination) |
|
hbox = QHBoxLayout() |
|
hbox.addLayout(vbox) |
|
hbox.addWidget(self.pushButton_playRouteFromNav) |
|
vbox = QVBoxLayout() |
|
vbox.addLayout(hbox) |
|
vbox.addWidget(self.label_map) |
|
self.tab1.setLayout(vbox) |
|
|
|
def setStart(self): |
|
self.label_map.page().runJavaScript('returnS()', self.js_callbackS) |
|
def js_callbackS(self, result): |
|
self.coordinates_start = result |
|
print("Set CCP position: %s" %result) |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.SET_POSITION --ef latitude %f --ef longitude %f"%(result['lat'],result['lng'])) |
|
print("===> " + adb_command) |
|
# am broadcast -a de.esolutions.navigation.SET_POSITION --ef latitude 48.762156 --ef longitude 11.42541 |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def setDestination(self): |
|
self.label_map.page().runJavaScript('returnD()', self.js_callbackD) |
|
def js_callbackD(self, result): |
|
self.coordinates_destination = result |
|
print("Set destination position: %s" %result) |
|
adb_command = ("adb shell am start -a android.intent.action.VIEW -d google.navigation:q=%f,%f"%(result['lat'],result['lng'])) |
|
print("===> " + adb_command) |
|
# am broadcast -a de.esolutions.navigation.SET_POSITION --ef latitude 48.762156 --ef longitude 11.42541 |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def payRouteFromNav(self): |
|
print("Play Route from Navigation:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.REPLAY_ROUTE") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
### tab Vehicle ############################################# |
|
def tab2UI(self): |
|
self.tabs.addTab(self.tab2, "Vehicle") |
|
pushButton_Width = 450 |
|
pushButton_Height = 40 |
|
textEdit_width_small = 100 |
|
textEdit_height_small = 40 |
|
diff_width = 10 |
|
diff_height = 10 |
|
|
|
self.pushButton_consumptionVelocity = QPushButton() |
|
self.pushButton_consumptionVelocity.setGeometry(QtCore.QRect(diff_width, diff_height, pushButton_Width, pushButton_Height)) |
|
self.pushButton_consumptionVelocity.setFixedSize(pushButton_Width,pushButton_Height) |
|
self.pushButton_consumptionVelocity.setObjectName("pushButton_consumptionVelocity") |
|
self.pushButton_consumptionVelocity.clicked.connect(self.consumptionVelocity) |
|
self.pushButton_consumptionVelocity.setText("set velocity") |
|
|
|
self.textEdit_VELOCITY_VALUE_1 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_1.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*0,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_1.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_1.setObjectName("textEdit_VELOCITY_VALUE_1") |
|
self.textEdit_VELOCITY_VALUE_1.setPlaceholderText('VELOCITY_VALUE_1') |
|
self.textEdit_VELOCITY_VALUE_1.setText('28.0') |
|
self.textEdit_VELOCITY_VALUE_2 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_2.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*1,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_2.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_2.setObjectName("textEdit_VELOCITY_VALUE_2") |
|
self.textEdit_VELOCITY_VALUE_2.setPlaceholderText('VELOCITY_VALUE_2') |
|
self.textEdit_VELOCITY_VALUE_2.setText('44.0') |
|
self.textEdit_VELOCITY_VALUE_3 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_3.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*2,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_3.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_3.setObjectName("textEdit_VELOCITY_VALUE_3") |
|
self.textEdit_VELOCITY_VALUE_3.setPlaceholderText('VELOCITY_VALUE_3') |
|
self.textEdit_VELOCITY_VALUE_3.setText('60.0') |
|
self.textEdit_VELOCITY_VALUE_4 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_4.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*3,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_4.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_4.setObjectName("textEdit_VELOCITY_VALUE_4") |
|
self.textEdit_VELOCITY_VALUE_4.setPlaceholderText('VELOCITY_VALUE_4') |
|
self.textEdit_VELOCITY_VALUE_4.setText('76.0') |
|
self.textEdit_VELOCITY_VALUE_5 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_5.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*4,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_5.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_5.setObjectName("textEdit_VELOCITY_VALUE_5") |
|
self.textEdit_VELOCITY_VALUE_5.setPlaceholderText('VELOCITY_VALUE_5') |
|
self.textEdit_VELOCITY_VALUE_5.setText('90.0') |
|
self.textEdit_VELOCITY_VALUE_6 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_6.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*5,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_6.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_6.setObjectName("textEdit_VELOCITY_VALUE_6") |
|
self.textEdit_VELOCITY_VALUE_6.setPlaceholderText('VELOCITY_VALUE_6') |
|
self.textEdit_VELOCITY_VALUE_6.setText('110.0') |
|
self.textEdit_VELOCITY_VALUE_7 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_7.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*6,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_7.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_7.setObjectName("textEdit_VELOCITY_VALUE_7") |
|
self.textEdit_VELOCITY_VALUE_7.setPlaceholderText('VELOCITY_VALUE_7') |
|
self.textEdit_VELOCITY_VALUE_7.setText('130.0') |
|
self.textEdit_VELOCITY_VALUE_8 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_8.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*7,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_8.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_8.setObjectName("textEdit_VELOCITY_VALUE_8") |
|
self.textEdit_VELOCITY_VALUE_8.setPlaceholderText('VELOCITY_VALUE_8') |
|
self.textEdit_VELOCITY_VALUE_8.setText('150.0') |
|
self.textEdit_VELOCITY_VALUE_9 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_9.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*8,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_9.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_9.setObjectName("textEdit_VELOCITY_VALUE_9") |
|
self.textEdit_VELOCITY_VALUE_9.setPlaceholderText('VELOCITY_VALUE_9') |
|
self.textEdit_VELOCITY_VALUE_9.setText('180.0') |
|
self.textEdit_VELOCITY_VALUE_10 = QTextEdit() |
|
self.textEdit_VELOCITY_VALUE_10.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*9,diff_height, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_VALUE_10.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_VALUE_10.setObjectName("textEdit_VELOCITY_VALUE_10") |
|
self.textEdit_VELOCITY_VALUE_10.setPlaceholderText('VELOCITY_VALUE_10') |
|
self.textEdit_VELOCITY_VALUE_10.setText('210.0') |
|
|
|
|
|
#zeilen Nr |
|
zz = 1 |
|
self.pushButton_speedConsumption = QPushButton() |
|
self.pushButton_speedConsumption.setGeometry(QtCore.QRect(diff_width, (diff_height+pushButton_Height)*zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_speedConsumption.setFixedSize(pushButton_Width,pushButton_Height) |
|
self.pushButton_speedConsumption.setObjectName("pushButton_speedConsumption") |
|
self.pushButton_speedConsumption.clicked.connect(self.speedConsumption) |
|
self.pushButton_speedConsumption.setText("set consumption") |
|
|
|
self.textEdit_CONSUMPTION_VALUE_1 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_1.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*0,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_1.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_1.setObjectName("textEdit_CONSUMPTION_VALUE_1") |
|
self.textEdit_CONSUMPTION_VALUE_1.setPlaceholderText('CONSUMPTION_VALUE_1') |
|
self.textEdit_CONSUMPTION_VALUE_1.setText('11.77') |
|
self.textEdit_CONSUMPTION_VALUE_2 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_2.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*1,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_2.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_2.setObjectName("textEdit_CONSUMPTION_VALUE_2") |
|
self.textEdit_CONSUMPTION_VALUE_2.setPlaceholderText('CONSUMPTION_VALUE_2') |
|
self.textEdit_CONSUMPTION_VALUE_2.setText('13.75') |
|
self.textEdit_CONSUMPTION_VALUE_3 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_3.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*2,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_3.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_3.setObjectName("textEdit_CONSUMPTION_VALUE_3") |
|
self.textEdit_CONSUMPTION_VALUE_3.setPlaceholderText('CONSUMPTION_VALUE_3') |
|
self.textEdit_CONSUMPTION_VALUE_3.setText('15.62') |
|
self.textEdit_CONSUMPTION_VALUE_4 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_4.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*3,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_4.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_4.setObjectName("textEdit_CONSUMPTION_VALUE_4") |
|
self.textEdit_CONSUMPTION_VALUE_4.setPlaceholderText('CONSUMPTION_VALUE_4') |
|
self.textEdit_CONSUMPTION_VALUE_4.setText('16.39') |
|
self.textEdit_CONSUMPTION_VALUE_5 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_5.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*4,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_5.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_5.setObjectName("textEdit_CONSUMPTION_VALUE_5") |
|
self.textEdit_CONSUMPTION_VALUE_5.setPlaceholderText('CONSUMPTION_VALUE_5') |
|
self.textEdit_CONSUMPTION_VALUE_5.setText('17.82') |
|
self.textEdit_CONSUMPTION_VALUE_6 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_6.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*5,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_6.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_6.setObjectName("textEdit_CONSUMPTION_VALUE_6") |
|
self.textEdit_CONSUMPTION_VALUE_6.setPlaceholderText('CONSUMPTION_VALUE_6') |
|
self.textEdit_CONSUMPTION_VALUE_6.setText('21.45') |
|
self.textEdit_CONSUMPTION_VALUE_7 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_7.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*6,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_7.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_7.setObjectName("textEdit_CONSUMPTION_VALUE_7") |
|
self.textEdit_CONSUMPTION_VALUE_7.setPlaceholderText('CONSUMPTION_VALUE_7') |
|
self.textEdit_CONSUMPTION_VALUE_7.setText('26.51') |
|
self.textEdit_CONSUMPTION_VALUE_8 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_8.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*7,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_8.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_8.setObjectName("textEdit_CONSUMPTION_VALUE_8") |
|
self.textEdit_CONSUMPTION_VALUE_8.setPlaceholderText('CONSUMPTION_VALUE_8') |
|
self.textEdit_CONSUMPTION_VALUE_8.setText('32.67') |
|
self.textEdit_CONSUMPTION_VALUE_9 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_9.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*8,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_9.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_9.setObjectName("textEdit_CONSUMPTION_VALUE_9") |
|
self.textEdit_CONSUMPTION_VALUE_9.setPlaceholderText('CONSUMPTION_VALUE_9') |
|
self.textEdit_CONSUMPTION_VALUE_9.setText('43.89') |
|
self.textEdit_CONSUMPTION_VALUE_10 = QTextEdit() |
|
self.textEdit_CONSUMPTION_VALUE_10.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*9,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_CONSUMPTION_VALUE_10.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_CONSUMPTION_VALUE_10.setObjectName("textEdit_CONSUMPTION_VALUE_10") |
|
self.textEdit_CONSUMPTION_VALUE_10.setPlaceholderText('CONSUMPTION_VALUE_10') |
|
self.textEdit_CONSUMPTION_VALUE_10.setText('57.53') |
|
|
|
#zeilen Nr |
|
zz = 2 |
|
self.pushButton_consumptionFactorDrivingProfile = QPushButton() |
|
self.pushButton_consumptionFactorDrivingProfile.setGeometry(QtCore.QRect(diff_width, (diff_height+pushButton_Height)*zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_consumptionFactorDrivingProfile.setFixedSize(pushButton_Width,pushButton_Height) |
|
self.pushButton_consumptionFactorDrivingProfile.setObjectName("pushButton_consumptionFactorDrivingProfile") |
|
self.pushButton_consumptionFactorDrivingProfile.clicked.connect(self.consumptionFactorDrivingProfile) |
|
self.pushButton_consumptionFactorDrivingProfile.setText("consumptionFactorDrivingProfile") |
|
|
|
self.textEdit_consumptionFactorDrivingProfile = QTextEdit() |
|
self.textEdit_consumptionFactorDrivingProfile.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*0,(diff_height+pushButton_Height)*zz, textEdit_width_small*3+2*diff_width, pushButton_Height)) |
|
self.textEdit_consumptionFactorDrivingProfile.setFixedSize(textEdit_width_small*3+2*diff_width,pushButton_Height) |
|
self.textEdit_consumptionFactorDrivingProfile.setObjectName("textEdit_consumptionFactorDrivingProfile") |
|
self.textEdit_consumptionFactorDrivingProfile.setPlaceholderText('consumptionFactorDrivingProfile') |
|
self.textEdit_consumptionFactorDrivingProfile.setText('1') |
|
|
|
#zeilen Nr |
|
zz = 3 |
|
self.pushButton_comfortConsumersConsumption = QPushButton() |
|
self.pushButton_comfortConsumersConsumption.setGeometry(QtCore.QRect(diff_width, (diff_height+pushButton_Height)*zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_comfortConsumersConsumption.setFixedSize(pushButton_Width,pushButton_Height) |
|
self.pushButton_comfortConsumersConsumption.setObjectName("pushButton_comfortConsumersConsumption") |
|
self.pushButton_comfortConsumersConsumption.clicked.connect(self.comfortConsumersConsumption) |
|
self.pushButton_comfortConsumersConsumption.setText("comfortConsumersConsumption") |
|
|
|
self.textEdit_comfortConsumersConsumption = QTextEdit() |
|
self.textEdit_comfortConsumersConsumption.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*0,(diff_height+pushButton_Height)*zz, textEdit_width_small*3+2*diff_width, pushButton_Height)) |
|
self.textEdit_comfortConsumersConsumption.setFixedSize(textEdit_width_small*3+2*diff_width,pushButton_Height) |
|
self.textEdit_comfortConsumersConsumption.setObjectName("textEdit_comfortConsumersConsumption") |
|
self.textEdit_comfortConsumersConsumption.setPlaceholderText('comfortConsumersConsumption') |
|
self.textEdit_comfortConsumersConsumption.setText('1') |
|
|
|
#zeilen Nr |
|
zz = 4 |
|
self.pushButton_residualConsumersConsumption = QPushButton() |
|
self.pushButton_residualConsumersConsumption.setGeometry(QtCore.QRect(diff_width, (diff_height+pushButton_Height)*zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_residualConsumersConsumption.setFixedSize(pushButton_Width,pushButton_Height) |
|
self.pushButton_residualConsumersConsumption.setObjectName("pushButton_residualConsumersConsumption") |
|
self.pushButton_residualConsumersConsumption.clicked.connect(self.residualConsumersConsumption) |
|
self.pushButton_residualConsumersConsumption.setText("residualConsumersConsumption") |
|
|
|
self.textEdit_residualConsumersConsumption = QTextEdit() |
|
self.textEdit_residualConsumersConsumption.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*0,(diff_height+pushButton_Height)*zz, textEdit_width_small*3+2*diff_width, pushButton_Height)) |
|
self.textEdit_residualConsumersConsumption.setFixedSize(textEdit_width_small*3+2*diff_width,pushButton_Height) |
|
self.textEdit_residualConsumersConsumption.setObjectName("textEdit_residualConsumersConsumption") |
|
self.textEdit_residualConsumersConsumption.setPlaceholderText('residualConsumersConsumption') |
|
self.textEdit_residualConsumersConsumption.setText('1') |
|
|
|
#zeilen Nr |
|
zz = 5 |
|
self.pushButton_altitudeGainConsumption = QPushButton() |
|
self.pushButton_altitudeGainConsumption.setGeometry(QtCore.QRect(diff_width, (diff_height+pushButton_Height)*zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_altitudeGainConsumption.setFixedSize(pushButton_Width,pushButton_Height) |
|
self.pushButton_altitudeGainConsumption.setObjectName("pushButton_altitudeGainConsumption") |
|
self.pushButton_altitudeGainConsumption.clicked.connect(self.altitudeGainConsumption) |
|
self.pushButton_altitudeGainConsumption.setText("altitudeGainConsumption") |
|
|
|
self.textEdit_altitudeGainConsumption = QTextEdit() |
|
self.textEdit_altitudeGainConsumption.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*0,(diff_height+pushButton_Height)*zz, textEdit_width_small*3+2*diff_width, pushButton_Height)) |
|
self.textEdit_altitudeGainConsumption.setFixedSize(textEdit_width_small*3+2*diff_width,pushButton_Height) |
|
self.textEdit_altitudeGainConsumption.setObjectName("textEdit_residualConsumersConsumption") |
|
self.textEdit_altitudeGainConsumption.setPlaceholderText('altitudeGainConsumption') |
|
self.textEdit_altitudeGainConsumption.setText('73.7') |
|
|
|
#zeilen Nr |
|
zz = 6 |
|
self.pushButton_altitudeLossConsumption = QPushButton() |
|
self.pushButton_altitudeLossConsumption.setGeometry(QtCore.QRect(diff_width, (diff_height+pushButton_Height)*zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_altitudeLossConsumption.setFixedSize(pushButton_Width,pushButton_Height) |
|
self.pushButton_altitudeLossConsumption.setObjectName("pushButton_altitudeGainConsumption") |
|
self.pushButton_altitudeLossConsumption.clicked.connect(self.altitudeLossConsumption) |
|
self.pushButton_altitudeLossConsumption.setText("altitudeLossConsumption") |
|
|
|
self.textEdit_altitudeLossConsumption = QTextEdit() |
|
self.textEdit_altitudeLossConsumption.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*0,(diff_height+pushButton_Height)*zz, textEdit_width_small*3+2*diff_width, pushButton_Height)) |
|
self.textEdit_altitudeLossConsumption.setFixedSize(textEdit_width_small*3+2*diff_width,pushButton_Height) |
|
self.textEdit_altitudeLossConsumption.setObjectName("textEdit_altitudeLossConsumption") |
|
self.textEdit_altitudeLossConsumption.setPlaceholderText('altitudeLossConsumption') |
|
self.textEdit_altitudeLossConsumption.setText('53.2') |
|
|
|
# zeilen Nr |
|
zz = 7 |
|
self.pushButton_currentEnergyContent = QPushButton() |
|
self.pushButton_currentEnergyContent.setGeometry( |
|
QtCore.QRect(diff_width, (diff_height + pushButton_Height) * zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_currentEnergyContent.setFixedSize(pushButton_Width, pushButton_Height) |
|
self.pushButton_currentEnergyContent.setObjectName("pushButton_currentEnergyContent") |
|
self.pushButton_currentEnergyContent.clicked.connect(self.currentEnergyContent) |
|
self.pushButton_currentEnergyContent.setText("currentEnergyContent") |
|
|
|
self.textEdit_currentEnergyContent = QTextEdit() |
|
self.textEdit_currentEnergyContent.setGeometry( |
|
QtCore.QRect(2 * diff_width + pushButton_Width + (diff_width + textEdit_width_small) * 0, |
|
(diff_height + pushButton_Height) * zz, textEdit_width_small * 3 + 2 * diff_width, |
|
pushButton_Height)) |
|
self.textEdit_currentEnergyContent.setFixedSize(textEdit_width_small * 3 + 2 * diff_width, pushButton_Height) |
|
self.textEdit_currentEnergyContent.setObjectName("textEdit_currentEnergyContent") |
|
self.textEdit_currentEnergyContent.setPlaceholderText('altitudeLossConsumption') |
|
self.textEdit_currentEnergyContent.setText('700') |
|
|
|
# zeilen Nr |
|
zz = 8 |
|
self.pushButton_maximumEnergyContent = QPushButton() |
|
self.pushButton_maximumEnergyContent.setGeometry( |
|
QtCore.QRect(diff_width, (diff_height + pushButton_Height) * zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_maximumEnergyContent.setFixedSize(pushButton_Width, pushButton_Height) |
|
self.pushButton_maximumEnergyContent.setObjectName("pushButton_maximumEnergyContent") |
|
self.pushButton_maximumEnergyContent.clicked.connect(self.maximumEnergyContent) |
|
self.pushButton_maximumEnergyContent.setText("maximumEnergyContent") |
|
|
|
self.textEdit_maximumEnergyContent = QTextEdit() |
|
self.textEdit_maximumEnergyContent.setGeometry( |
|
QtCore.QRect(2 * diff_width + pushButton_Width + (diff_width + textEdit_width_small) * 0, |
|
(diff_height + pushButton_Height) * zz, textEdit_width_small * 3 + 2 * diff_width, |
|
pushButton_Height)) |
|
self.textEdit_maximumEnergyContent.setFixedSize(textEdit_width_small * 3 + 2 * diff_width, pushButton_Height) |
|
self.textEdit_maximumEnergyContent.setObjectName("textEdit_maximumEnergyContent") |
|
self.textEdit_maximumEnergyContent.setPlaceholderText('maximumEnergyContent') |
|
self.textEdit_maximumEnergyContent.setText('920') |
|
|
|
# zeilen Nr |
|
zz = 9 |
|
self.pushButton_VELOCITY_OFFSET = QPushButton() |
|
self.pushButton_VELOCITY_OFFSET.setGeometry( |
|
QtCore.QRect(diff_width, (diff_height + pushButton_Height) * zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_VELOCITY_OFFSET.setFixedSize(pushButton_Width, pushButton_Height) |
|
self.pushButton_VELOCITY_OFFSET.setObjectName("pushButton_VELOCITY_OFFSET") |
|
self.pushButton_VELOCITY_OFFSET.clicked.connect(self.VELOCITY_OFFSET) |
|
self.pushButton_VELOCITY_OFFSET.setText("set VELOCITY_OFFSET") |
|
|
|
self.textEdit_VELOCITY_OFFSET_1 = QTextEdit() |
|
self.textEdit_VELOCITY_OFFSET_1.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*0,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_OFFSET_1.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_OFFSET_1.setObjectName("textEdit_VELOCITY_OFFSET_1") |
|
self.textEdit_VELOCITY_OFFSET_1.setPlaceholderText('VELOCITY_OFFSET_1') |
|
self.textEdit_VELOCITY_OFFSET_1.setText('20') |
|
self.textEdit_VELOCITY_OFFSET_2 = QTextEdit() |
|
self.textEdit_VELOCITY_OFFSET_2.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*1,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_OFFSET_2.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_OFFSET_2.setObjectName("textEdit_VELOCITY_OFFSET_2") |
|
self.textEdit_VELOCITY_OFFSET_2.setPlaceholderText('VELOCITY_OFFSET_2') |
|
self.textEdit_VELOCITY_OFFSET_2.setText('15') |
|
self.textEdit_VELOCITY_OFFSET_3 = QTextEdit() |
|
self.textEdit_VELOCITY_OFFSET_3.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*2,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_OFFSET_3.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_OFFSET_3.setObjectName("textEdit_VELOCITY_OFFSET_3") |
|
self.textEdit_VELOCITY_OFFSET_3.setPlaceholderText('VELOCITY_OFFSET_3') |
|
self.textEdit_VELOCITY_OFFSET_3.setText('10') |
|
self.textEdit_VELOCITY_OFFSET_4 = QTextEdit() |
|
self.textEdit_VELOCITY_OFFSET_4.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*3,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_OFFSET_4.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_OFFSET_4.setObjectName("textEdit_VELOCITY_OFFSET_4") |
|
self.textEdit_VELOCITY_OFFSET_4.setPlaceholderText('VELOCITY_OFFSET_4') |
|
self.textEdit_VELOCITY_OFFSET_4.setText('5') |
|
self.textEdit_VELOCITY_OFFSET_5 = QTextEdit() |
|
self.textEdit_VELOCITY_OFFSET_5.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*4,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_OFFSET_5.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_OFFSET_5.setObjectName("textEdit_VELOCITY_OFFSET_5") |
|
self.textEdit_VELOCITY_OFFSET_5.setPlaceholderText('VELOCITY_OFFSET_5') |
|
self.textEdit_VELOCITY_OFFSET_5.setText('0') |
|
self.textEdit_VELOCITY_OFFSET_6 = QTextEdit() |
|
self.textEdit_VELOCITY_OFFSET_6.setGeometry(QtCore.QRect(2*diff_width+pushButton_Width+(diff_width+textEdit_width_small)*5,(diff_height+pushButton_Height)*zz, textEdit_width_small, textEdit_height_small)) |
|
self.textEdit_VELOCITY_OFFSET_6.setFixedSize(textEdit_width_small,textEdit_height_small) |
|
self.textEdit_VELOCITY_OFFSET_6.setObjectName("textEdit_VELOCITY_OFFSET_6") |
|
self.textEdit_VELOCITY_OFFSET_6.setPlaceholderText('VELOCITY_OFFSET_6') |
|
self.textEdit_VELOCITY_OFFSET_6.setText('0') |
|
|
|
# zeilen Nr |
|
zz = 10 |
|
self.pushButton_CUSTOMER_ACTION_TRIGGER_VALUE = QPushButton() |
|
self.pushButton_CUSTOMER_ACTION_TRIGGER_VALUE.setGeometry( |
|
QtCore.QRect(diff_width, (diff_height + pushButton_Height) * zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_CUSTOMER_ACTION_TRIGGER_VALUE.setFixedSize(pushButton_Width, pushButton_Height) |
|
self.pushButton_CUSTOMER_ACTION_TRIGGER_VALUE.setObjectName("pushButton_CUSTOMER_ACTION_TRIGGER_VALUE") |
|
self.pushButton_CUSTOMER_ACTION_TRIGGER_VALUE.clicked.connect(self.CUSTOMER_ACTION_TRIGGER_VALUE) |
|
self.pushButton_CUSTOMER_ACTION_TRIGGER_VALUE.setText("CUSTOMER_ACTION_TRIGGER") |
|
|
|
self.textEdit_CUSTOMER_ACTION_TRIGGER_VALUE = QTextEdit() |
|
self.textEdit_CUSTOMER_ACTION_TRIGGER_VALUE.setGeometry( |
|
QtCore.QRect(2 * diff_width + pushButton_Width + (diff_width + textEdit_width_small) * 0, |
|
(diff_height + pushButton_Height) * zz, textEdit_width_small * 3 + 2 * diff_width, |
|
pushButton_Height)) |
|
self.textEdit_CUSTOMER_ACTION_TRIGGER_VALUE.setFixedSize(textEdit_width_small * 3 + 2 * diff_width, pushButton_Height) |
|
self.textEdit_CUSTOMER_ACTION_TRIGGER_VALUE.setObjectName("textEdit_CUSTOMER_ACTION_TRIGGER_VALUE") |
|
self.textEdit_CUSTOMER_ACTION_TRIGGER_VALUE.setPlaceholderText('CUSTOMER_ACTION_TRIGGER') |
|
self.textEdit_CUSTOMER_ACTION_TRIGGER_VALUE.setText('10') |
|
|
|
# zeilen Nr |
|
zz = 11 |
|
self.pushButton_Occupants = QPushButton() |
|
self.pushButton_Occupants.setGeometry( |
|
QtCore.QRect(diff_width, (diff_height + pushButton_Height) * zz, pushButton_Width, pushButton_Height)) |
|
self.pushButton_Occupants.setFixedSize(pushButton_Width, pushButton_Height) |
|
self.pushButton_Occupants.setObjectName("pushButton_Occupants") |
|
self.pushButton_Occupants.clicked.connect(self.Occupants) |
|
self.pushButton_Occupants.setText("set Occupants") |
|
|
|
self.textEdit_Occupants = QTextEdit() |
|
self.textEdit_Occupants.setGeometry( |
|
QtCore.QRect(2 * diff_width + pushButton_Width + (diff_width + textEdit_width_small) * 0, |
|
(diff_height + pushButton_Height) * zz, textEdit_width_small * 3 + 2 * diff_width, |
|
pushButton_Height)) |
|
self.textEdit_Occupants.setFixedSize(textEdit_width_small * 3 + 2 * diff_width, pushButton_Height) |
|
self.textEdit_Occupants.setObjectName("textEdit_Occupants") |
|
self.textEdit_Occupants.setPlaceholderText('Occupants') |
|
self.textEdit_Occupants.setText('3') |
|
|
|
################################### |
|
|
|
|
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_consumptionVelocity) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_1) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_2) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_3) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_4) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_5) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_6) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_7) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_8) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_9) |
|
hbox.addWidget(self.textEdit_VELOCITY_VALUE_10) |
|
hbox.addStretch(0) |
|
|
|
vbox = QVBoxLayout() |
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_speedConsumption) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_1) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_2) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_3) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_4) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_5) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_6) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_7) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_8) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_9) |
|
hbox.addWidget(self.textEdit_CONSUMPTION_VALUE_10) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_consumptionFactorDrivingProfile) |
|
hbox.addWidget(self.textEdit_consumptionFactorDrivingProfile) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_comfortConsumersConsumption) |
|
hbox.addWidget(self.textEdit_comfortConsumersConsumption) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_residualConsumersConsumption) |
|
hbox.addWidget(self.textEdit_residualConsumersConsumption) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_altitudeGainConsumption) |
|
hbox.addWidget(self.textEdit_altitudeGainConsumption) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_altitudeLossConsumption) |
|
hbox.addWidget(self.textEdit_altitudeLossConsumption) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_currentEnergyContent) |
|
hbox.addWidget(self.textEdit_currentEnergyContent) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_maximumEnergyContent) |
|
hbox.addWidget(self.textEdit_maximumEnergyContent) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
vbox.addSpacing(100) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_VELOCITY_OFFSET) |
|
hbox.addWidget(self.textEdit_VELOCITY_OFFSET_1) |
|
hbox.addWidget(self.textEdit_VELOCITY_OFFSET_2) |
|
hbox.addWidget(self.textEdit_VELOCITY_OFFSET_3) |
|
hbox.addWidget(self.textEdit_VELOCITY_OFFSET_4) |
|
hbox.addWidget(self.textEdit_VELOCITY_OFFSET_5) |
|
hbox.addWidget(self.textEdit_VELOCITY_OFFSET_6) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_CUSTOMER_ACTION_TRIGGER_VALUE) |
|
hbox.addWidget(self.textEdit_CUSTOMER_ACTION_TRIGGER_VALUE) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
|
|
hbox = QHBoxLayout() |
|
hbox.addWidget(self.pushButton_Occupants) |
|
hbox.addWidget(self.textEdit_Occupants) |
|
hbox.addStretch(0) |
|
|
|
vbox.addLayout(hbox) |
|
vbox.addStretch(0) |
|
#hbox = QHBoxLayout() |
|
self.tab2.setLayout(vbox) |
|
|
|
|
|
def consumptionVelocity(self): |
|
print("set velocity for velocity speed consumption:") |
|
arr = [self.textEdit_VELOCITY_VALUE_1.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_2.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_3.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_4.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_5.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_6.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_7.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_8.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_9.toPlainText(), |
|
self.textEdit_VELOCITY_VALUE_10.toPlainText()] |
|
for i in range(1,11): |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef VELOCITY_VALUE_%d %sf"%(i,arr[i-1])) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
time.sleep(.2) |
|
|
|
def speedConsumption(self): |
|
print("set consumption for velocity speed consumption:") |
|
arr = [self.textEdit_CONSUMPTION_VALUE_1.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_2.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_3.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_4.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_5.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_6.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_7.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_8.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_9.toPlainText(), |
|
self.textEdit_CONSUMPTION_VALUE_10.toPlainText()] |
|
for i in range(1,11): |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef CONSUMPTION_VALUE_%d %sf"%(i,arr[i-1])) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
time.sleep(.2) |
|
|
|
def consumptionFactorDrivingProfile(self): |
|
print("set consumptionFactorDrivingProfile:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef consumptionFactorDrivingProfile %sf" % (self.textEdit_consumptionFactorDrivingProfile.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def comfortConsumersConsumption(self): |
|
print("set comfortConsumersConsumption:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef comfortConsumersConsumption %sf" % (self.textEdit_comfortConsumersConsumption.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def residualConsumersConsumption(self): |
|
print("set residualConsumersConsumption:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef residualConsumersConsumption %sf" % (self.textEdit_residualConsumersConsumption.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def altitudeGainConsumption(self): |
|
print("set altitudeGainConsumption:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef altitudeGainConsumption %sf" % (self.textEdit_altitudeGainConsumption.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def altitudeLossConsumption(self): |
|
print("set altitudeLossConsumption:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef altitudeLossConsumption %sf" % (self.textEdit_altitudeLossConsumption.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def currentEnergyContent(self): |
|
print("set currentEnergyContent:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef currentEnergyContent %sf" % (self.textEdit_currentEnergyContent.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def maximumEnergyContent(self): |
|
print("set maximumEnergyContent:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ef maximumEnergyContent %sf" % (self.textEdit_maximumEnergyContent.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def VELOCITY_OFFSET(self): |
|
print("set VELOCITY_OFFSET:") |
|
arr = [self.textEdit_VELOCITY_OFFSET_1.toPlainText(), |
|
self.textEdit_VELOCITY_OFFSET_2.toPlainText(), |
|
self.textEdit_VELOCITY_OFFSET_3.toPlainText(), |
|
self.textEdit_VELOCITY_OFFSET_4.toPlainText(), |
|
self.textEdit_VELOCITY_OFFSET_5.toPlainText(), |
|
self.textEdit_VELOCITY_OFFSET_6.toPlainText()] |
|
arr_txt = ["VELOCITY_UNLIMITED_HIGHWAY_VALUE", |
|
"VELOCITY_OFFSET_VALUE_1", |
|
"VELOCITY_OFFSET_VALUE_2", |
|
"VELOCITY_OFFSET_VALUE_3", |
|
"VELOCITY_OFFSET_VALUE_4", |
|
"VELOCITY_OFFSET_VALUE_5"] |
|
for i in range(6): |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ei %s %s"%(arr_txt[i],arr[i])) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
time.sleep(.2) |
|
|
|
def CUSTOMER_ACTION_TRIGGER_VALUE(self): |
|
print("set CUSTOMER_ACTION_TRIGGER_VALUE:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.CONSUMPTION_SEND --ei CUSTOMER_ACTION_TRIGGER_VALUE %s" % (self.textEdit_CUSTOMER_ACTION_TRIGGER_VALUE.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def Occupants(self): |
|
print("set Occupants:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.VEHICLE_CONFIG --ei Occupants %s" % (self.textEdit_Occupants.toPlainText())) |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
|
|
### tab Gen ############################################# |
|
def tab3UI(self): |
|
self.tabs.addTab(self.tab3, "Gen") |
|
pushButtonWidth = 450 |
|
pushButtonHeight = 35 |
|
self.pushButton_forceStopp = QPushButton() |
|
self.pushButton_forceStopp.setGeometry(QtCore.QRect(10, 10, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_forceStopp.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_forceStopp.setObjectName("pushButton_forceStopp") |
|
self.pushButton_forceStopp.clicked.connect(self.forceStopp) |
|
self.pushButton_forceStopp.setText("force stop NAV *.apk") |
|
|
|
self.pushButton_reboot = QPushButton() |
|
self.pushButton_reboot.setGeometry(QtCore.QRect(10, (10+pushButtonHeight)*1, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_reboot.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_reboot.setObjectName("pushButton_reboot") |
|
self.pushButton_reboot.clicked.connect(self.reboot) |
|
self.pushButton_reboot.setText("reboot HCP3") |
|
|
|
self.pushButton_forwardEsoTrace = QPushButton() |
|
self.pushButton_forwardEsoTrace.setGeometry(QtCore.QRect(10, (10+pushButtonHeight)*2, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_forwardEsoTrace.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_forwardEsoTrace.setObjectName("pushButton_forwardEsoTrace") |
|
self.pushButton_forwardEsoTrace.clicked.connect(self.forwardEsoTrace) |
|
self.pushButton_forwardEsoTrace.setText("forward Eso Trace") |
|
|
|
self.pushButton_setTime = QPushButton() |
|
self.pushButton_setTime.setGeometry(QtCore.QRect(10, (10+pushButtonHeight)*3, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_setTime.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_setTime.setObjectName("pushButton_setTime") |
|
self.pushButton_setTime.clicked.connect(self.setTime) |
|
self.pushButton_setTime.setText("set time") |
|
|
|
self.pushButton_setAllServices = QPushButton() |
|
self.pushButton_setAllServices.setGeometry(QtCore.QRect(10, (10+pushButtonHeight)*4, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_setAllServices.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_setAllServices.setObjectName("pushButton_setAllServices") |
|
self.pushButton_setAllServices.clicked.connect(self.setAllServices) |
|
self.pushButton_setAllServices.setText("enable all Services") |
|
|
|
self.pushButton_setCMCServices = QPushButton() |
|
self.pushButton_setCMCServices.setGeometry(QtCore.QRect(10, (10+pushButtonHeight)*5, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_setCMCServices.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_setCMCServices.setObjectName("pushButton_setCMCServices") |
|
self.pushButton_setCMCServices.clicked.connect(self.setCMCServices) |
|
self.pushButton_setCMCServices.setText("enable CMC Service") |
|
|
|
self.pushButton_setEPPServices = QPushButton() |
|
self.pushButton_setEPPServices.setGeometry(QtCore.QRect(10, (10+pushButtonHeight)*6, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_setEPPServices.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_setEPPServices.setObjectName("pushButton_setEPPServices") |
|
self.pushButton_setEPPServices.clicked.connect(self.setEPPServices) |
|
self.pushButton_setEPPServices.setText("enable EPP Service") |
|
|
|
self.pushButton_setRWBServices = QPushButton() |
|
self.pushButton_setRWBServices.setGeometry(QtCore.QRect(10, (10+pushButtonHeight)*7, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_setRWBServices.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_setRWBServices.setObjectName("pushButton_setRWBServices") |
|
self.pushButton_setRWBServices.clicked.connect(self.setRWBServices) |
|
self.pushButton_setRWBServices.setText("enable RWB Service") |
|
|
|
self.pushButton_setEngine = QPushButton() |
|
self.pushButton_setEngine.setGeometry(QtCore.QRect(10, (10+pushButtonHeight)*8, pushButtonWidth, pushButtonHeight)) |
|
self.pushButton_setEngine.setFixedSize(pushButtonWidth, pushButtonHeight) |
|
self.pushButton_setEngine.setObjectName("pushButton_setEngine") |
|
self.pushButton_setEngine.clicked.connect(self.setEngine) |
|
self.pushButton_setEngine.setText("set BEV engine") |
|
|
|
#hbox = QHBoxLayout() |
|
|
|
vbox = QVBoxLayout() |
|
vbox.addWidget(self.pushButton_forceStopp) |
|
vbox.addWidget(self.pushButton_reboot) |
|
vbox.addWidget(self.pushButton_forwardEsoTrace) |
|
vbox.addWidget(self.pushButton_setTime) |
|
#vbox.addStretch(1) |
|
vbox.addSpacing(50) |
|
vbox.addWidget(self.pushButton_setAllServices) |
|
vbox.addWidget(self.pushButton_setCMCServices) |
|
vbox.addWidget(self.pushButton_setEPPServices) |
|
vbox.addWidget(self.pushButton_setRWBServices) |
|
#vbox.addStretch(0) |
|
#vbox.addStretch(1) |
|
vbox.addSpacing(25) |
|
vbox.addWidget(self.pushButton_setEngine) |
|
vbox.addStretch(0) |
|
|
|
self.tab3.setLayout(vbox) |
|
|
|
def forceStopp(self): |
|
print("kill navigation:") |
|
adb_command = ("adb shell am force-stop de.eso.audi.navi") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def reboot(self): |
|
print("reboot HCP3:") |
|
adb_command = ("adb reboot") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def forwardEsoTrace(self): |
|
print("forward ESO Trace:") |
|
adb_command = ("adb forward tcp:21002 tcp:21002") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def setTime(self): |
|
print("set Time:") |
|
adb_command = ("adb shell date `date +%m%d%H%M%G.%S`") |
|
print("===> " + adb_command) |
|
subprocess.call("adb root", shell=True) |
|
time.sleep(.8) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def setAllServices(self): |
|
print("enable all EV Services:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.SWITCH_ALL_SERVICE_IDS --ei serviceID 2") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def setCMCServices(self): |
|
print("enable CMC Services:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.SWITCH_TO_SERVICE --ei serviceID 2 --es serviceName ChargingManagementCore") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def setEPPServices(self): |
|
print("enable energyPowerPrediction (EPP) Services:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.SWITCH_TO_SERVICE --ei serviceID 2 --es serviceName EnergyPowerPrediction") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def setRWBServices(self): |
|
print("enable RouteBasedConsumption (RWB) Services:") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.SWITCH_TO_SERVICE --ei serviceID 2 --es serviceName RouteBasedConsumption") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
def setEngine(self): |
|
print("set Engine Type (BEV):") |
|
adb_command = ("adb shell am broadcast -a de.esolutions.navigation.VEHICLE_CONFIG --es Enginetype BEV") |
|
print("===> " + adb_command) |
|
subprocess.call(adb_command, shell=True) |
|
|
|
### tab INFO ############################################# |
|
def tab4UI(self): |
|
self.tabs.addTab(self.tab4, "Info") |
|
|
|
# Create label |
|
self.label = QLabel('Writen by: \n Johannes Ziegmann \n johannes.ziegmann@cariad.technology',self) |
|
self.label.setGeometry(10,10,400,50) |
|
|
|
vbox = QVBoxLayout() |
|
vbox.addWidget(self.label) |
|
|
|
self.tab4.setLayout(vbox) |
|
|
|
|
|
######################################################### |
|
|
|
|
|
if __name__ == '__main__': |
|
app = QApplication(sys.argv) |
|
app.setStyleSheet('QMainWindow{border: 2px solid gray;}') |
|
ex = App() |
|
sys.exit(app.exec_())
|
|
|