Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
045e0df7
Commit
045e0df7
authored
1 year ago
by
Lan Dam
Browse files
Options
Downloads
Patches
Plain Diff
add code to execute db
parent
986e84bc
No related branches found
No related tags found
1 merge request
!211
Implement dialog to add/edit a single channel in database
Pipeline
#3183
passed with stage
Stage: Build Env and Test
in 4 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/view/db_config/add_edit_single_channel_dialog.py
+5
-3
5 additions, 3 deletions
...onviewer/view/db_config/add_edit_single_channel_dialog.py
with
5 additions
and
3 deletions
sohstationviewer/view/db_config/add_edit_single_channel_dialog.py
+
5
−
3
View file @
045e0df7
...
...
@@ -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__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment