Skip to content
Snippets Groups Projects
Commit 4d87d055 authored by Lan Dam's avatar Lan Dam
Browse files

change back conversion widget to QLineEdit because conversion can go down to 1.0e-06

parent dda80caa
No related branches found
No related tags found
1 merge request!211Implement dialog to add/edit a single channel in database
......@@ -3,7 +3,7 @@ import platform
import os
from typing import Optional, Dict
from PySide2 import QtWidgets
from PySide2 import QtWidgets, QtGui
from PySide2.QtWidgets import QWidget, QDialog, QLineEdit
from sohstationviewer.view.util.plot_func_names import plot_functions
......@@ -72,13 +72,14 @@ class AddEditSingleChannelDialog(QDialog):
"added to channel name to be displayed")
# convert factor to change from count to actual value
self.conversion_lnedit = QtWidgets.QSpinBox()
self.conversion_lnedit.setMinimum(0)
self.conversion_lnedit.setMaximum(5)
self.conversion_lnedit.setToolTip(
self.convesion_lnedit = QtWidgets.QLineEdit(self)
self.convesion_lnedit.setPlaceholderText(
"to convert from count to actual value"
)
self.conversion_lnedit.setValue(1)
validator = QtGui.QDoubleValidator(0.0, 5.0, 6)
validator.setNotation(QtGui.QDoubleValidator.StandardNotation)
self.convesion_lnedit.setValidator(validator)
self.convesion_lnedit.setText('1')
# channel's unit
self.unit_lnedit = QtWidgets.QLineEdit(self)
......@@ -223,8 +224,8 @@ class AddEditSingleChannelDialog(QDialog):
self.label_lnedit.setText(self.channel_info['label'])
self.conversion_lnedit.setValue(
float(self.channel_info['convertFactor']))
self.convesion_lnedit.setText(
str(float(self.channel_info['convertFactor'])))
self.unit_lnedit.setText(self.channel_info['unit'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment