Skip to content
Snippets Groups Projects

Implement dialog to add/edit a single channel in database

Merged Lan Dam requested to merge i69-add-edit-single-channel-dialog into master
All threads resolved!
1 file
+ 5
3
Compare changes
  • Side-by-side
  • Inline
@@ -10,6 +10,8 @@ from sohstationviewer.view.util.plot_func_names import plot_functions
from sohstationviewer.view.db_config.add_edit_single_channel_helper import (
get_params, get_channel_info, get_param_info)
from sohstationviewer.database.process_db import execute_db
def get_db_str_with_null(col, val):
"""
@@ -317,7 +319,7 @@ class AddEditSingleChannelDialog(QDialog):
height = f"height={self.height_spnbox.value()}"
sql = (f"UPDATE Parameters SET {plot_type}, {value_colorb}, "
f"{value_colorw}, {height} WHERE {param}")
print('NEED TO EXECUTE: param sql:', sql)
execute_db(sql)
def insert_channel_info(self):
sql = ("INSERT INTO Channels VALUES ("
@@ -329,7 +331,7 @@ class AddEditSingleChannelDialog(QDialog):
f"'{self.unit_lnedit.text()}', "
f"{self.fix_point_spnbox.value()}, "
f"'{self.data_type_lnedit.text()}')")
print('NEED TO EXECUTE: insert channel sql:', sql)
execute_db(sql)
def update_channel_info(self):
channel = f"channel='{self.name_lnedit.text()}'"
@@ -343,7 +345,7 @@ class AddEditSingleChannelDialog(QDialog):
sql = (f"UPDATE Channels SET {label}, {param}, {linked_chan}, "
f"{convert_factor}, {unit}, {fix_point}, {data_type} "
f"WHERE {channel}")
print('NEED TO EXECUTE: update channel sql:', sql)
execute_db(sql)
if __name__ == '__main__':
Loading