saving profile added
This commit is contained in:
@@ -776,9 +776,24 @@ class MainWindow(QMainWindow):
|
||||
"",
|
||||
f"ds1809_apply={'true' if self._ds1809_profile_apply.isChecked() else 'false'}",
|
||||
f"ds1809_position_from_min={self._ds1809_profile_position.value()}",
|
||||
"",
|
||||
*self._build_sweep_profile_lines("laser2_current_sweep", self._laser2_sweep.settings()),
|
||||
"",
|
||||
*self._build_sweep_profile_lines("stm32_dac_sweep", self._stm32_dac_sweep.settings()),
|
||||
]
|
||||
return "\n".join(lines) + "\n"
|
||||
|
||||
@staticmethod
|
||||
def _build_sweep_profile_lines(prefix: str, settings: SweepSettings) -> list[str]:
|
||||
return [
|
||||
f"{prefix}_enable={1 if settings.enabled else 0}",
|
||||
f"{prefix}_min_code={settings.min_code}",
|
||||
f"{prefix}_max_code={settings.max_code}",
|
||||
f"{prefix}_step_code={settings.step_code}",
|
||||
f"{prefix}_step_period_us={settings.step_period_us}",
|
||||
f"{prefix}_pause_ms={settings.pause_ms}",
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
def _build_waveform_text(samples: list[int]) -> str:
|
||||
return "\n".join(str(sample) for sample in samples) + "\n"
|
||||
|
||||
Reference in New Issue
Block a user