diff --git a/sohstationviewer/view/db_config/add_edit_single_channel_dialog.py b/sohstationviewer/view/db_config/add_edit_single_channel_dialog.py index a55500df6e9d0669ef6769efa82524f0141a4d09..385e0c0750d614803ce5a5ae9067d68aa3cc92ab 100755 --- a/sohstationviewer/view/db_config/add_edit_single_channel_dialog.py +++ b/sohstationviewer/view/db_config/add_edit_single_channel_dialog.py @@ -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__':