mirror of
https://github.com/nqrduck/nqrduck-pulseprogrammer.git
synced 2024-11-09 11:20:01 +00:00
Changed to decimals.
This commit is contained in:
parent
3fe8cf487f
commit
6df745452b
2 changed files with 5 additions and 4 deletions
|
@ -2,6 +2,7 @@ import logging
|
||||||
import json
|
import json
|
||||||
import decimal
|
import decimal
|
||||||
from PyQt6.QtCore import pyqtSlot
|
from PyQt6.QtCore import pyqtSlot
|
||||||
|
from nqrduck.helpers.serializer import DecimalEncoder
|
||||||
from nqrduck.module.module_controller import ModuleController
|
from nqrduck.module.module_controller import ModuleController
|
||||||
from nqrduck_spectrometer.pulsesequence import PulseSequence
|
from nqrduck_spectrometer.pulsesequence import PulseSequence
|
||||||
|
|
||||||
|
@ -50,7 +51,7 @@ class PulseProgrammerController(ModuleController):
|
||||||
logger.debug("Saving pulse sequence to %s", path)
|
logger.debug("Saving pulse sequence to %s", path)
|
||||||
sequence = self.module.model.pulse_sequence.to_json()
|
sequence = self.module.model.pulse_sequence.to_json()
|
||||||
with open(path, "w") as file:
|
with open(path, "w") as file:
|
||||||
file.write(json.dumps(sequence))
|
file.write(json.dumps(sequence, cls=DecimalEncoder))
|
||||||
|
|
||||||
|
|
||||||
def load_pulse_sequence(self, path):
|
def load_pulse_sequence(self, path):
|
||||||
|
|
|
@ -426,9 +426,9 @@ class FunctionOptionWidget(QWidget):
|
||||||
def on_replot_button_clicked(self):
|
def on_replot_button_clicked(self):
|
||||||
logger.debug("Replot button clicked")
|
logger.debug("Replot button clicked")
|
||||||
# Update the resolution, start_x, end_x and expr lineedits
|
# Update the resolution, start_x, end_x and expr lineedits
|
||||||
self.function_option.value.resolution = float(self.resolution_lineedit.text())
|
self.function_option.value.resolution = self.resolution_lineedit.text()
|
||||||
self.function_option.value.start_x = float(self.start_x_lineedit.text())
|
self.function_option.value.start_x = self.start_x_lineedit.text()
|
||||||
self.function_option.value.end_x = float(self.end_x_lineedit.text())
|
self.function_option.value.end_x = self.end_x_lineedit.text()
|
||||||
try:
|
try:
|
||||||
self.function_option.value.expr = self.expr_lineedit.text()
|
self.function_option.value.expr = self.expr_lineedit.text()
|
||||||
except SyntaxError:
|
except SyntaxError:
|
||||||
|
|
Loading…
Reference in a new issue