Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CCS
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marko Mecina
CCS
Commits
518c51bb
Commit
518c51bb
authored
2 years ago
by
Marko Mecina
Browse files
Options
Downloads
Patches
Plain Diff
add data extraction options to TST DP item module
parent
dd152db8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tst/tst/data_pool_tab.py
+16
-10
16 additions, 10 deletions
Tst/tst/data_pool_tab.py
with
16 additions
and
10 deletions
Tst/tst/data_pool_tab.py
+
16
−
10
View file @
518c51bb
...
@@ -11,12 +11,9 @@ sys.path.append(confignator.get_option('paths', 'ccs'))
...
@@ -11,12 +11,9 @@ sys.path.append(confignator.get_option('paths', 'ccs'))
import
ccs_function_lib
as
cfl
import
ccs_function_lib
as
cfl
import
s2k_partypes
as
s2k
import
s2k_partypes
as
s2k
try
:
DP_ITEMS_SRC_FILE
=
confignator
.
get_option
(
'
database
'
,
'
datapool-items
'
)
except
confignator
.
config
.
configparser
.
NoOptionError
:
DP_ITEMS_SRC_FILE
=
None
logger
=
logging
.
getLogger
()
logger
=
logging
.
getLogger
()
DP_ITEMS_SRC_FILE
=
cfl
.
DP_ITEMS_SRC_FILE
def
reload_dp_data
():
def
reload_dp_data
():
...
@@ -100,6 +97,8 @@ class DataPoolTable(Gtk.Grid):
...
@@ -100,6 +97,8 @@ class DataPoolTable(Gtk.Grid):
column
.
set_sort_column_id
(
i
)
column
.
set_sort_column_id
(
i
)
self
.
treeview
.
append_column
(
column
)
self
.
treeview
.
append_column
(
column
)
# self.treeview.set_tooltip_text('Right-click for copy menu')
# Handle selection
# Handle selection
self
.
selected_row
=
self
.
treeview
.
get_selection
()
self
.
selected_row
=
self
.
treeview
.
get_selection
()
#self.selected_row.connect("changed", self.item_selected)
#self.selected_row.connect("changed", self.item_selected)
...
@@ -129,11 +128,14 @@ class DataPoolTable(Gtk.Grid):
...
@@ -129,11 +128,14 @@ class DataPoolTable(Gtk.Grid):
if
event
.
button
==
3
:
if
event
.
button
==
3
:
self
.
rcl_menu
.
popup_at_pointer
()
self
.
rcl_menu
.
popup_at_pointer
()
def
copy_cell_content
(
self
,
cell_idx
):
def
copy_cell_content
(
self
,
cell_idx
,
as_string
=
False
):
treeselection
=
self
.
treeview
.
get_selection
()
treeselection
=
self
.
treeview
.
get_selection
()
model
,
it
=
treeselection
.
get_selected
()
model
,
it
=
treeselection
.
get_selected
()
if
model
is
not
None
and
it
is
not
None
:
if
model
is
not
None
and
it
is
not
None
:
self
.
clipboard
.
set_text
(
model
[
it
][
cell_idx
],
-
1
)
if
as_string
:
self
.
clipboard
.
set_text
(
'"
{}
"'
.
format
(
model
[
it
][
cell_idx
]),
-
1
)
else
:
self
.
clipboard
.
set_text
(
model
[
it
][
cell_idx
],
-
1
)
def
on_pid_combo_changed
(
self
,
combo
):
def
on_pid_combo_changed
(
self
,
combo
):
combo_iter
=
combo
.
get_active_iter
()
combo_iter
=
combo
.
get_active_iter
()
...
@@ -155,10 +157,7 @@ class DataPoolTable(Gtk.Grid):
...
@@ -155,10 +157,7 @@ class DataPoolTable(Gtk.Grid):
def
data_pool_filter_func
(
self
,
model
,
iter
,
data
):
def
data_pool_filter_func
(
self
,
model
,
iter
,
data
):
if
(
if
self
.
current_filter_data_pool
is
None
or
self
.
current_filter_data_pool
==
"
None
"
:
self
.
current_filter_data_pool
is
None
or
self
.
current_filter_data_pool
==
"
None
"
):
return
True
return
True
else
:
else
:
return
model
[
iter
][
0
]
==
self
.
current_filter_data_pool
return
model
[
iter
][
0
]
==
self
.
current_filter_data_pool
...
@@ -180,11 +179,18 @@ class TreeRightClickMenu(Gtk.Menu):
...
@@ -180,11 +179,18 @@ class TreeRightClickMenu(Gtk.Menu):
entry_2
=
Gtk
.
MenuItem
(
'
Copy NAME
'
)
entry_2
=
Gtk
.
MenuItem
(
'
Copy NAME
'
)
self
.
attach
(
entry_2
,
0
,
1
,
1
,
2
)
self
.
attach
(
entry_2
,
0
,
1
,
1
,
2
)
entry_2
.
show
()
entry_2
.
show
()
entry_3
=
Gtk
.
MenuItem
(
'
Copy NAME as string
'
)
self
.
attach
(
entry_3
,
0
,
1
,
2
,
3
)
entry_3
.
show
()
entry_1
.
connect
(
'
activate
'
,
self
.
on_copy_pid
,
cruf
)
entry_1
.
connect
(
'
activate
'
,
self
.
on_copy_pid
,
cruf
)
entry_2
.
connect
(
'
activate
'
,
self
.
on_copy_name
,
cruf
)
entry_2
.
connect
(
'
activate
'
,
self
.
on_copy_name
,
cruf
)
entry_3
.
connect
(
'
activate
'
,
self
.
on_copy_name_as_string
,
cruf
)
def
on_copy_pid
(
self
,
menu_item
,
cruf
,
*
args
):
def
on_copy_pid
(
self
,
menu_item
,
cruf
,
*
args
):
cruf
.
copy_cell_content
(
0
)
cruf
.
copy_cell_content
(
0
)
def
on_copy_name
(
self
,
menu_item
,
cruf
,
*
args
):
def
on_copy_name
(
self
,
menu_item
,
cruf
,
*
args
):
cruf
.
copy_cell_content
(
1
)
cruf
.
copy_cell_content
(
1
)
def
on_copy_name_as_string
(
self
,
menu_item
,
cruf
,
*
args
):
cruf
.
copy_cell_content
(
1
,
as_string
=
True
)
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