Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bokeh-apps
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
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
ICS Control System Infrastructure
bokeh-apps
Merge requests
!4
Table working
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Table working
marcmunoz/bokeh-apps:master
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Marc Munoz
requested to merge
marcmunoz/bokeh-apps:master
into
master
5 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Added first version of the table
👍
0
👎
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
24d84932
1 commit,
5 years ago
1 file
+
48
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
apps/operations.py
+
48
−
3
Options
@@ -11,6 +11,8 @@ from bokeh.models.widgets import PreText
import
epics
import
time
import
datetime
from
bokeh.models
import
ColumnDataSource
from
bokeh.models.widgets
import
DataTable
,
DateFormatter
,
TableColumn
,
NumberFormatter
doc
=
curdoc
()
@@ -83,7 +85,22 @@ def monMessage(**kws):
themessage
.
append
(
thepv
)
doc
.
add_next_tick_callback
(
partial
(
updateMessage
,
message
=
themessage
))
@gen.coroutine
def
updateTable
(
pv
):
global
dataTable
global
data_table
global
PVNameTable
newValues
=
[]
for
r
in
PVNameTable
:
newValues
.
append
(
epics
.
PV
(
r
).
get
())
sourceTable
.
data
[
"
Values
"
]
=
newValues
def
monTable
(
**
kws
):
thepv
=
kws
doc
.
add_next_tick_callback
(
partial
(
updateTable
,
pv
=
thepv
))
# add a button widget and configure with the call back
PVList
=
[
"
ISrc-010:ISS-HVPf-Doors:CloseR
"
,
"
ISrc-010:ISS-Intf-HMI:ComIocOK
"
]
@@ -97,11 +114,39 @@ for PVname in PVList:
thePVList
.
append
(
epics
.
PV
(
PVname
,
auto_monitor
=
True
,
callback
=
monPV
))
ButtonList
.
append
(
Button
(
label
=
DictionaryPVs
[
PVname
]))
ButtonDictionary
=
dict
(
zip
(
PVList
,
ButtonList
))
first
=
Panel
(
child
=
column
(
ButtonList
),
title
=
'
Interlock
'
)
InterlockPanel
=
Panel
(
child
=
column
(
ButtonList
),
title
=
'
Interlock
'
)
MessagePV
=
epics
.
PV
(
"
NSO-LCR:Ops:Msg
"
,
auto_monitor
=
True
,
callback
=
monMessage
)
pre
=
PreText
(
text
=
"
Waiting for messages
"
,
width
=
500
,
height
=
100
)
second
=
Panel
(
child
=
widgetbox
(
pre
),
title
=
'
Messages
'
)
tabs
=
Tabs
(
tabs
=
[
first
,
second
])
# Create the data source and the monitor for it
PVNameTable
=
[
"
ISrc-010:ISS-Magtr:ForwdPwrR
"
,
"
ISrc-010:ISS-HVPS:VolR
"
,
"
ISrc-010:PBI-BCM-001:AI4-IPCH-RBV
"
,
"
LEBT-010:PBI-BCM-001:AI5-IPCH-RBV
"
]
PVDescriptionTable
=
[
"
Forward Power
"
,
"
High Voltage
"
,
"
BCM ISrc
"
,
"
BCM LEBT
"
]
PVListTable
=
[]
ValuesListTable
=
[]
i
=
0
for
pv
in
PVNameTable
:
PVListTable
.
append
(
epics
.
PV
(
PVNameTable
[
i
]))
ValuesListTable
.
append
(
PVListTable
[
i
].
get
())
i
=
i
+
1
dataTable
=
dict
(
PVNames
=
PVNameTable
,
Description
=
PVDescriptionTable
,
Values
=
ValuesListTable
)
PVmonitorTable
=
epics
.
PV
(
"
ISrc-010:ISS-EVR-Magtr:Event-14-Cnt-I
"
,
auto_monitor
=
True
,
callback
=
monTable
)
sourceTable
=
ColumnDataSource
(
dataTable
)
columns
=
[
TableColumn
(
field
=
"
Description
"
,
title
=
"
PV
"
),
TableColumn
(
field
=
"
Values
"
,
title
=
"
Value
"
,
formatter
=
NumberFormatter
(
format
=
'
0.000
'
)),
]
data_table
=
DataTable
(
source
=
sourceTable
,
columns
=
columns
,
width
=
400
,
height
=
280
)
StatusPanel
=
Panel
(
child
=
widgetbox
(
data_table
,
pre
),
title
=
'
Messages
'
)
tabs
=
Tabs
(
tabs
=
[
StatusPanel
,
InterlockPanel
])
doc
.
add_root
(
tabs
)
Loading