From 045e0df76df3225502f28c539ca086166b9a775c Mon Sep 17 00:00:00 2001 From: ldam <ldam@passcal.nmt.edu> Date: Mon, 30 Oct 2023 10:13:01 -0600 Subject: [PATCH] add code to execute db --- .../view/db_config/add_edit_single_channel_dialog.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 a55500df6..385e0c075 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__': -- GitLab