cali util
This commit is contained in:
parent
dd01087bf7
commit
ab7a2ad503
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
__pycache__
|
__pycache__
|
||||||
client-venv
|
client-venv
|
||||||
|
measures
|
9
main.py
9
main.py
@ -149,6 +149,11 @@ def set_range(sender, app_data):
|
|||||||
logger.info("set range %d", app_data)
|
logger.info("set range %d", app_data)
|
||||||
device.update_range(app_data)
|
device.update_range(app_data)
|
||||||
|
|
||||||
|
def save_cali(sender, app_data):
|
||||||
|
path = dpg.get_value("cali_save_path")
|
||||||
|
with open(path, "a") as myfile:
|
||||||
|
myfile.write(f"{app_data}, " + ','.join([str(current_meas[v][-1][1]) for v in current_meas]) + "\n")
|
||||||
|
|
||||||
async def init_gui():
|
async def init_gui():
|
||||||
dpg.create_context()
|
dpg.create_context()
|
||||||
dpg.create_viewport()
|
dpg.create_viewport()
|
||||||
@ -189,6 +194,10 @@ async def init_gui():
|
|||||||
# dpg.set_axis_limits_auto("y_axis")
|
# dpg.set_axis_limits_auto("y_axis")
|
||||||
|
|
||||||
|
|
||||||
|
with dpg.window(label="Calibration controls", pos = [0, 0], width = .2 * width, height = -1):
|
||||||
|
dpg.add_input_text(label="path", tag="cali_save_path")
|
||||||
|
dpg.add_input_int(label="Voltage", callback=save_cali, on_enter=True, tag="save_cali")
|
||||||
|
|
||||||
dpg.show_viewport()
|
dpg.show_viewport()
|
||||||
while dpg.is_dearpygui_running():
|
while dpg.is_dearpygui_running():
|
||||||
dpg.render_dearpygui_frame()
|
dpg.render_dearpygui_frame()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user