- main.py reduced
- requirements.txt updated
This commit is contained in:
parent
23e5005914
commit
8520ddb6ee
@ -1,9 +1,20 @@
|
|||||||
|
contourpy==1.3.3
|
||||||
|
cycler==0.12.1
|
||||||
|
fonttools==4.62.1
|
||||||
future==1.0.0
|
future==1.0.0
|
||||||
iso8601==2.1.0
|
iso8601==2.1.0
|
||||||
|
kiwisolver==1.5.0
|
||||||
|
matplotlib==3.10.9
|
||||||
netifaces==0.11.0
|
netifaces==0.11.0
|
||||||
netinterfaces==0.1.0
|
netinterfaces==0.1.0
|
||||||
|
numpy==2.4.4
|
||||||
|
packaging==26.2
|
||||||
pillow==12.2.0
|
pillow==12.2.0
|
||||||
|
pyparsing==3.3.2
|
||||||
pyserial==3.5
|
pyserial==3.5
|
||||||
|
python-dateutil==2.9.0.post0
|
||||||
PyYAML==6.0.3
|
PyYAML==6.0.3
|
||||||
|
six==1.17.0
|
||||||
ttk-text==0.3.3
|
ttk-text==0.3.3
|
||||||
ttkthemes==3.3.0
|
ttkthemes==3.3.0
|
||||||
|
xlsxwriter==3.2.9
|
||||||
|
|||||||
44
test_main.py
44
test_main.py
@ -1,12 +1,5 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import optparse
|
|
||||||
import os
|
|
||||||
import time
|
|
||||||
|
|
||||||
import DeviceInterface
|
|
||||||
from LinuxPtpObserver import LinuxPtpObserver
|
|
||||||
from TestController import TestController
|
|
||||||
from GUI import GUI
|
from GUI import GUI
|
||||||
|
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
@ -14,40 +7,3 @@ from GUI import GUI
|
|||||||
gui = GUI()
|
gui = GUI()
|
||||||
|
|
||||||
gui.mainloop()
|
gui.mainloop()
|
||||||
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
usage = "<device/url> <interface> [-s <baudrate>]"
|
|
||||||
|
|
||||||
parser = optparse.OptionParser(usage=usage)
|
|
||||||
parser.add_option("-s", dest="baudrate", default=115200)
|
|
||||||
opts, args = parser.parse_args()
|
|
||||||
|
|
||||||
missing = (
|
|
||||||
len(args) < 1
|
|
||||||
)
|
|
||||||
if missing:
|
|
||||||
print("Something is missing! Usage:", usage)
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
di = DeviceInterface.DeviceInterface(url=args[0], options={"baudrate": opts.baudrate })
|
|
||||||
#results = di.execute_command("osinfo")
|
|
||||||
#print(results)
|
|
||||||
|
|
||||||
def echo(str: str) -> None:
|
|
||||||
print(str, end="")
|
|
||||||
|
|
||||||
di.register_out_callback(echo)
|
|
||||||
|
|
||||||
# get device clock identity
|
|
||||||
OWN_CLOCK_ID_KEY = "Own clock ID"
|
|
||||||
clock_id = di.execute_command("ptp info", separate_results=True)
|
|
||||||
if type(clock_id) == dict and OWN_CLOCK_ID_KEY in clock_id:
|
|
||||||
print("Own clock ID:", clock_id[OWN_CLOCK_ID_KEY])
|
|
||||||
else:
|
|
||||||
print("Could not retrieve device clock ID!")
|
|
||||||
|
|
||||||
lptp_observer = LinuxPtpObserver(args[1])
|
|
||||||
lptp_observer.register_observer_callback(echo)
|
|
||||||
|
|
||||||
di.close()
|
|
||||||
Loading…
x
Reference in New Issue
Block a user