Useable, export not working but everything else does
This commit is contained in:
+51
-85
@@ -14,7 +14,7 @@ RyzenADJI = ()
|
|||||||
USBdevices = ()
|
USBdevices = ()
|
||||||
TotalUSBpower = ()
|
TotalUSBpower = ()
|
||||||
TotalPower = ()
|
TotalPower = ()
|
||||||
lang = none
|
lang = None
|
||||||
|
|
||||||
def lang():
|
def lang():
|
||||||
global lang
|
global lang
|
||||||
@@ -46,7 +46,7 @@ def start():
|
|||||||
editor()
|
editor()
|
||||||
|
|
||||||
def load():
|
def load():
|
||||||
global System, PCname, CPUPowerLimit, CPUClock, Processor, Gprocessor, GPUpowerLimit, GPUClock, GPUMemoryClock, BusClock, RyzenADJI, USBdevices, TotalUSBpower, TotalPower
|
global System, PCname, CPUPowerLimit, CPUClock, Processor, Gprocessor, GPUpowerLimit, GPUClock, GPUMemoryClock, BusClock, RyzenADJI, USBdevices, TotalUSBpower, TotalPower, lang
|
||||||
with open("Configuationtable.json", "r") as file:
|
with open("Configuationtable.json", "r") as file:
|
||||||
data = json.loads(file.read())
|
data = json.loads(file.read())
|
||||||
System = (data["System"])
|
System = (data["System"])
|
||||||
@@ -63,11 +63,11 @@ def load():
|
|||||||
USBdevices = (data["USBdevices"])
|
USBdevices = (data["USBdevices"])
|
||||||
TotalUSBpower = (data["TotalUSBPower"])
|
TotalUSBpower = (data["TotalUSBPower"])
|
||||||
TotalPower = (data["TotalPower"])
|
TotalPower = (data["TotalPower"])
|
||||||
lang = data(data["lang"])
|
lang = (data["lang"])
|
||||||
|
|
||||||
def Menu():
|
def Menu():
|
||||||
|
os.system('cls')
|
||||||
if lang == "1":
|
if lang == "1":
|
||||||
os.system('cls')
|
|
||||||
print("="*40, "\n", graphics.Menu, "\n", graphics.Rever, "\n", "="*40)
|
print("="*40, "\n", graphics.Menu, "\n", graphics.Rever, "\n", "="*40)
|
||||||
print(" 1. View current configuration \n 2. Edit configuration \n 3. export configuration \n 4. exit program")
|
print(" 1. View current configuration \n 2. Edit configuration \n 3. export configuration \n 4. exit program")
|
||||||
choice = input(" user: ")
|
choice = input(" user: ")
|
||||||
@@ -86,8 +86,7 @@ def Menu():
|
|||||||
else:
|
else:
|
||||||
Menu()
|
Menu()
|
||||||
elif lang == "2":
|
elif lang == "2":
|
||||||
os.system('cls')
|
print("="*40, "\n", graphics.Menu, "\n", graphics.Rever, "\n", "="*40)
|
||||||
print("="*40, "\n", graphics.MenuD, "\n", graphics.ReverD, "\n", "="*40)
|
|
||||||
print(" 1. Aktuelle Konfiguration anzeigen \n 2. Konfiguration bearbeiten \n 3. Konfiguration exportieren \n 4. Programm beenden")
|
print(" 1. Aktuelle Konfiguration anzeigen \n 2. Konfiguration bearbeiten \n 3. Konfiguration exportieren \n 4. Programm beenden")
|
||||||
choice = input(" Benutzer: ")
|
choice = input(" Benutzer: ")
|
||||||
if choice == "1":
|
if choice == "1":
|
||||||
@@ -109,86 +108,52 @@ def Menu():
|
|||||||
Menu()
|
Menu()
|
||||||
|
|
||||||
def editor():
|
def editor():
|
||||||
|
global lang
|
||||||
if lang == "1":
|
if lang == "1":
|
||||||
my_system = platform.uname()
|
filename = "Configuationtable.txt"
|
||||||
os.system('cls')
|
with open(filename, "w") as file:
|
||||||
print(graphics.Warning)
|
file.write("Configuration Table\n")
|
||||||
print(" You are edting data!")
|
file.write("-------------------\n")
|
||||||
print("Don't use units")
|
file.write("PC Name: {}\n".format(data["PCname"]))
|
||||||
CPUPowerLimit = float(input("CPU Power Limit (W): "))
|
file.write("System: {}\n".format(data["System"]))
|
||||||
CPUClock = float(input("CPU Clock (Ghz): "))
|
file.write("Processor: {}\n".format(data["Processor"]))
|
||||||
Gprocessor = input("GPU: ")
|
file.write("CPU Power Limit (W): {}\n".format(data["CPUPowerLimit"]))
|
||||||
GPUpowerLimit = float(input("GPU power limit (W): "))
|
file.write("CPU Clock (GHz): {}\n".format(data["CPUClock"]))
|
||||||
GPUClock = float(input("GPU clock (Mhz): "))
|
file.write("Bus Clock (MHz): {}\n".format(data["BusClock"]))
|
||||||
GPUMemoryClock = float(input("GPU memory clock (Mhz): "))
|
file.write("GPU: {}\n".format(data["Gprocessor"]))
|
||||||
BusClock = float(input("Bus Clock (Mhz): "))
|
file.write("GPU Power Limit (W): {}\n".format(data["GPUpowerLimit"]))
|
||||||
RyzenADJI = input("Ryzen ADJI preset (if you have one, if not leave blank): ")
|
file.write("GPU Clock (MHz): {}\n".format(data["GPUClock"]))
|
||||||
USBdevices = int(input("Amount of static USB devices: " ))
|
file.write("GPU Memory Clock (MHz): {}\n".format(data["GPUMemoryclock"]))
|
||||||
TotalUSBpower = USBdevices * 4.5
|
file.write("Ryzen ADJI Preset: {}\n".format(data["RyzenADJI"]))
|
||||||
TotalPower = (TotalUSBpower + GPUpowerLimit + CPUPowerLimit * 1.352)
|
file.write("USB Devices: {}\n".format(data["USBdevices"]))
|
||||||
data = {
|
file.write("Total USB Power (W): {}\n".format(data["TotalUSBPower"]))
|
||||||
"PCname": my_system.node,
|
file.write("Total Power (W): {}\n".format(data["TotalPower"]))
|
||||||
"System": f"{my_system.system} {my_system.version}",
|
print("Values exported to {}.".format(filename))
|
||||||
"Processor": my_system.processor,
|
elif lang == "2":
|
||||||
"CPUPowerLimit": CPUPowerLimit,
|
filename = "Konfigurationstabelle.txt"
|
||||||
"CPUClock": CPUClock,
|
with open(filename, "w") as file:
|
||||||
"BusClock": BusClock,
|
file.write("Konfigurationstabelle\n")
|
||||||
"Gprocessor": Gprocessor,
|
file.write("---------------------\n")
|
||||||
"GPUpowerLimit": GPUpowerLimit,
|
file.write("PC-Name: {}\n".format(data["PCname"]))
|
||||||
"GPUClock": GPUClock,
|
file.write("System: {}\n".format(data["System"]))
|
||||||
"GPUMemoryclock": GPUMemoryClock,
|
file.write("Prozessor: {}\n".format(data["Processor"]))
|
||||||
"RyzenADJI": RyzenADJI,
|
file.write("Prozessorleistungsgrenze (W): {}\n".format(data["CPUPowerLimit"]))
|
||||||
"USBdevices": USBdevices,
|
file.write("Prozessoruhr (GHz): {}\n".format(data["CPUClock"]))
|
||||||
"TotalUSBPower": TotalUSBpower,
|
file.write("Busuhr (MHz): {}\n".format(data["BusClock"]))
|
||||||
"TotalPower": TotalPower,
|
file.write("GPU: {}\n".format(data["Gprocessor"]))
|
||||||
"lang": lang,
|
file.write("GPU-Leistungsbegrenzung (W): {}\n".format(data["GPUpowerLimit"]))
|
||||||
}
|
file.write("GPU-Takt (MHz): {}\n".format(data["GPUClock"]))
|
||||||
with open("Configuationtable.json", "w") as file:
|
file.write("GPU-Speichertakt (MHz): {}\n".format(data["GPUMemoryclock"]))
|
||||||
file.write(json.dumps(data))
|
file.write("Ryzen ADJI voreingestellt: {}\n".format(data["RyzenADJI"]))
|
||||||
load()
|
file.write("Statische USB-Geräte: {}\n".format(data["USBdevices"]))
|
||||||
Menu()
|
file.write("Gesamtleistung USB (W): {}\n".format(data["TotalUSBPower"]))
|
||||||
if lang == "2":
|
file.write("Gesamtleistung (W): {}\n".format(data["TotalPower"]))
|
||||||
my_system = platform.uname()
|
print("Werte in {} exportiert.".format(filename))
|
||||||
os.system('cls')
|
|
||||||
print(graphics.Warning)
|
|
||||||
print(" Sie bearbeiten Daten!")
|
|
||||||
print(" Verwenden Sie keine Einheiten")
|
|
||||||
CPUPowerLimit = float(input("Prozessorleistungsgrenze (W): "))
|
|
||||||
CPUClock = float(input("Prozessoruhr (Ghz): "))
|
|
||||||
Gprocessor = input("GPU: ")
|
|
||||||
GPUpowerLimit = float(input("GPU-Leistungsbegrenzung (W): "))
|
|
||||||
GPUClock = float(input("GPU-Takt (Mhz): "))
|
|
||||||
GPUMemoryClock = float(input("GPU-Speichertakt (Mhz): "))
|
|
||||||
BusClock = float(input("Busuhr (Mhz): "))
|
|
||||||
RyzenADJI = input("Ryzen ADJI voreingestellt (falls vorhanden, falls nicht leer lassen): ")
|
|
||||||
USBdevices = int(input("Anzahl statischer USB-Geräte: " ))
|
|
||||||
TotalUSBpower = USBdevices * 4.5
|
|
||||||
TotalPower = (TotalUSBpower + GPUpowerLimit + CPUPowerLimit * 1.352)
|
|
||||||
data = {
|
|
||||||
"PCname": my_system.node,
|
|
||||||
"System": f"{my_system.system} {my_system.version}",
|
|
||||||
"Processor": my_system.processor,
|
|
||||||
"CPUPowerLimit": CPUPowerLimit,
|
|
||||||
"CPUClock": CPUClock,
|
|
||||||
"BusClock": BusClock,
|
|
||||||
"Gprocessor": Gprocessor,
|
|
||||||
"GPUpowerLimit": GPUpowerLimit,
|
|
||||||
"GPUClock": GPUClock,
|
|
||||||
"GPUMemoryclock": GPUMemoryClock,
|
|
||||||
"RyzenADJI": RyzenADJI,
|
|
||||||
"USBdevices": USBdevices,
|
|
||||||
"TotalUSBPower": TotalUSBpower,
|
|
||||||
"TotalPower": TotalPower,
|
|
||||||
"lang": lang,
|
|
||||||
}
|
|
||||||
with open("Configuationtable.json", "w") as file:
|
|
||||||
file.write(json.dumps(data))
|
|
||||||
load()
|
|
||||||
Menu()
|
|
||||||
else:
|
else:
|
||||||
error = ('1')
|
error = '1'
|
||||||
funchtion = ('4')
|
function = '4'
|
||||||
errorhandler(error, funchtion)
|
errorhandler(error, function)
|
||||||
|
|
||||||
|
|
||||||
def configdisplay():
|
def configdisplay():
|
||||||
if lang == "1":
|
if lang == "1":
|
||||||
@@ -264,7 +229,7 @@ def export():
|
|||||||
file.write(" System: " + data["System"] + "\n")
|
file.write(" System: " + data["System"] + "\n")
|
||||||
file.write(" PC Name: " + data["PCname"] + "\n")
|
file.write(" PC Name: " + data["PCname"] + "\n")
|
||||||
file.write("\n Proezsor: " + data["Processor"] + "\n")
|
file.write("\n Proezsor: " + data["Processor"] + "\n")
|
||||||
file.write(" Prozessorleistungsgrenze: " + data["CPUPowerLimit"] + "W" + "\n")
|
file.write(" Prozessorleistungsgrenze: " + float(data["CPUPowerLimit"] + "W" + "\n"))
|
||||||
file.write(" Prozessoruhr: " + str(data["CPUClock"]) + "Ghz" + "\n")
|
file.write(" Prozessoruhr: " + str(data["CPUClock"]) + "Ghz" + "\n")
|
||||||
file.write(" Busuhr: " + str(data["BusClock"]) + "Mhz" + "\n")
|
file.write(" Busuhr: " + str(data["BusClock"]) + "Mhz" + "\n")
|
||||||
file.write("\n GPU: " + data["Gprocessor"] + "\n")
|
file.write("\n GPU: " + data["Gprocessor"] + "\n")
|
||||||
@@ -381,3 +346,4 @@ def exitstage2():
|
|||||||
t = t - 1
|
t = t - 1
|
||||||
|
|
||||||
start()
|
start()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user