-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGUI.py
More file actions
25 lines (22 loc) · 746 Bytes
/
GUI.py
File metadata and controls
25 lines (22 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import CANoe
import time
import PySimpleGUI as sg
app=CANoe.CANoe()
app.Interactive = False
app.open_simulation("rbei_test.cfg")
app.start_Measurement()
sg.theme('SandyBeach')
sg.popup('Current Value of Power Mode is: ', str(app.get_EnvVar("EnvPowerMode")))
layout = [
[sg.Text('Please enter Power mode Value')],
[sg.Text('Power Mode', size =(15, 1)), sg.InputText()],
[sg.Submit(), sg.Cancel()]
]
window = sg.Window('Python-Canoe', layout)
event, values = window.read()
x=int(values.get(0))
window.close()
print("The Power Mode is:" + str(app.get_EnvVar("EnvPowerMode")))
app.set_EnvVar("EnvPowerMode",x);
print("The Updated Power mode is:" + str(app.get_EnvVar("EnvPowerMode")))
app.stop_Measurement()