-
Notifications
You must be signed in to change notification settings - Fork 10
TransferAWGFileTask #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Let me know when to do a first review. |
… acquisition cards The code is a slightly modified version of the code written by Raphaël and Zaki.
I have rebased this PR on #56, started testing it and you can start reviewing it |
I will try to have a look next week (I am in vacation). |
"""Command to send and load and .awg file into the AWG | ||
awg_file = bytearray | ||
filename = str | ||
timeout = float |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format de docstring incorrect (see Numpy docstring style guide)
|
||
""" | ||
self.write('SEQuence:ELEMent{}:JTARget:TYPE INDex'.format(position)) | ||
self.write('SEQuence:ELEMent{}:JTARget:INDex {}'.format(position, jump)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the AWG accepts you could concatenate the two messages (using ;).
self.write('SEQuence:ELEMent{}:JTARget:INDex {}'.format(position, jump)) | ||
|
||
@secure_communication() | ||
def send_event(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could check the codebase but this looks like a trigger firing. So we may call it fire_trigger
as in other places.
@@ -713,7 +773,8 @@ def running(self, value): | |||
self.clear_output_buffer() | |||
if value in ('RUN', 1, 'True'): | |||
self.write('AWGC:RUN:IMM') | |||
if self.ask_for_values('AWGC:RST?')[0] not in (1, 2): | |||
values = self.query('AWGC:RST?', format=2, delay=self.delay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query
is not defined and does not have a format argument in recent version of pyvisa I would advise to simply parse the answer.
to_send or traceback : dict | ||
Dict of {channel: array of (bytearrays,intarray,intarray)} to send | ||
to the AWG in case of success containing waveform, position(s) and | ||
repeat(s) or the traceback of the issues in case of failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring is not up to date.
|
||
""" | ||
channel_cfg = self.format_and_eval_string(self.awg_configuration) | ||
# print(channel_cfg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
@@ -506,6 +507,36 @@ def to_send(self, name, waveform): | |||
self._driver.write_binary_values(header, waveform, datatype='B') | |||
self.write('*WAI') | |||
|
|||
@secure_communication() | |||
def send_load_awg_file(self, awg_file, filename='setup', timeout=100): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since awg_file
is actually byte data, I would prefer awg_file_content. Otherwise I would naively think of a path.
@@ -0,0 +1,484 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably similar enough to the other existing task to factor some common code and limit the duplication.
@@ -0,0 +1,398 @@ | |||
# -*- coding: utf-8 -*- | |||
# ----------------------------------------------------------------------------- | |||
# Copyright 2015-2016 by EcpyPulses Authors, see AUTHORS for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And same comment as for the task itself we can probably reuse some parts of the other tasks (in particular none of the functions looks like they need to be duplicated).
text := model.value | ||
entries_updater << model.task.list_accessible_database_entries | ||
tool_tip = EVALUATER_TOOLTIP | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MIssing blank line
This is a cleaned up version of the code present in the catlab branch. It cannot be merged before #56.