Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
experiment-control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
whuie2
experiment-control
Commits
8bb3dd5c
Commit
8bb3dd5c
authored
3 years ago
by
ivette2
Browse files
Options
Downloads
Patches
Plain Diff
helper functions for GUI
parent
0c63fb9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI-Comm.py
+82
-0
82 additions, 0 deletions
GUI-Comm.py
with
82 additions
and
0 deletions
GUI-Comm.py
0 → 100644
+
82
−
0
View file @
8bb3dd5c
import
cmot_tof
,
freespace_green_resonance
,
narrow_cooling_tweezer_align
'''
"
cmot_tof.py
"
==
"
CMTF
"
"
freespace_green_resonance.py
"
==
"
FSGR
"
"
narrow_cooling_tweezer_align.py
"
==
"
NCTA
"
'''
outdir
=
""
def
create_ss_obj
(
tag
,
params
=
0.0
):
if
(
tag
==
"
CMTF
"
):
SEQ
=
cmot_tof
.
make_sequence
(
"
seq
"
,
params
)
return
SEQ
if
(
tag
==
"
FSGR
"
):
SEQ
=
freespace_green_resonance
.
make_sequence
(
"
seq
"
)
return
SEQ
if
(
tag
==
"
NCTA
"
):
SEQ
=
narrow_cooling_tweezer_align
.
make_sequence
(
"
seq
"
,
params
)
return
SEQ
def
sequences_in_super
(
Supersequence
):
sequences_dict
=
Supersequence
.
to_primitives
()
return
sequences_dict
def
save_altered_super
(
seqs_dict
):
new_super_seq
=
SuperSequence
.
from_primitives
(
outdir
,
"
new_SSS
"
,
seqs_dict
)
new_super_seq
.
save
()
def
events_in_seq
(
name
,
seq
):
supsequence
=
SuperSequence
(
outdir
,
name
,
seq
)
sequenc
=
supsequence
.
by_times
()
print
(
sequenc
)
print
(
type
(
sequenc
))
'''
sequence = ssequence.to_sequence()
events_dict = sequence.to_primitives()
for i in events_dict.keys():
print(i)
return events_dict
'''
def
save_object
(
obj
,
filename
):
with
open
(
filename
,
'
wb
'
)
as
outp
:
pickle
.
dump
(
obj
,
outp
,
pickle
.
HIGHEST_PROTOCOL
)
def
create_dig_event
(
board
,
channel
,
voltage
,
state
,
name
,
time
):
eventaddr
=
'
Events/
'
+
name
+
'
_dig
'
+
'
.txt
'
newevent
=
open
(
eventaddr
,
'
w
'
)
#Fix string -> ints for mask and state
event
=
Event
(
EventType
.
Digital
,
board
,
connector
=
0
,
mask
=
ch
(),
state
=
ch
())
save_object
(
event
,
eventaddr
)
def
create_ana_event
(
board
,
channel
,
voltage
,
state
,
name
,
time
):
eventaddr
=
'
Events/
'
+
name
+
'
_ana
'
+
'
.txt
'
newevent
=
open
(
eventaddr
,
'
w
'
)
event
=
Event
(
EventType
.
Analog
,
board
,
connector
=
0
,
mask
=
ch
(),
state
=
ch
())
save_object
(
event
,
eventaddr
)
def
create_supersequence
():
pass
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