24 lines
1.5 KiB
Python
24 lines
1.5 KiB
Python
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QFormLayout, QFileDialog, QCheckBox, QSpinBox
|
|
|
|
from cpdctrl_gui.utility.config import AppConfig
|
|
from .base import FileSelection, SettingsForm
|
|
|
|
class AppSettings(QWidget):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setLayout(QVBoxLayout())
|
|
self.w_form = SettingsForm(AppConfig.MAIN_CFG)
|
|
self.layout().addWidget(self.w_form)
|
|
|
|
w_cache_dir = FileSelection(filemode=QFileDialog.FileMode.Directory)
|
|
self.w_form.add_form_row("dir_cache", "Cache Directory", "~/.cache/cpdctrl", w_cache_dir, "Directory to store temporary data")
|
|
self.w_form.add_form_row("led_device_auto_reconnect", "Autoconnect to last LED Controller", True, QCheckBox(), "Automatically connect to the last used LED Controller")
|
|
self.w_form.add_form_row("voltage_measurement_device_auto_reconnect", "Autoconnect to last Voltage Measurement Device", True, QCheckBox(), "Automatically connect to the last used Voltage Measurement Device")
|
|
w_plot_n = QSpinBox()
|
|
w_plot_n.setMinimum(1000)
|
|
w_plot_n.setMaximum(200000)
|
|
w_plot_n.setSingleStep(1000)
|
|
self.w_form.add_form_row("plot_max_data_points", "Max datapoints in the plot", 20000, w_plot_n, "Maximum number of datapoints in the live plot.\nThis value is limited to ensure performance is not degraded in long measurements")
|
|
self.w_form.add_form_row("led_script_watch_file", "Watch Led Script File", False, QCheckBox(), "Watch the LED script file for changes and reload it automatically")
|
|
|