Skip to content

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

TransferAWGFileTask #57

wants to merge 5 commits into from

Conversation

rassouly
Copy link
Contributor

@rassouly rassouly commented Jul 4, 2019

This is a cleaned up version of the code present in the catlab branch. It cannot be merged before #56.

@MatthieuDartiailh MatthieuDartiailh self-requested a review July 7, 2019 00:58
@MatthieuDartiailh
Copy link
Member

Let me know when to do a first review.

@rassouly
Copy link
Contributor Author

rassouly commented Aug 2, 2019

I have rebased this PR on #56, started testing it and you can start reviewing it

@MatthieuDartiailh
Copy link
Member

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
Copy link
Member

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))
Copy link
Member

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):
Copy link
Member

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)
Copy link
Member

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.
Copy link
Member

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)
Copy link
Member

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):
Copy link
Member

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 -*-
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MIssing blank line

@rassouly rassouly mentioned this pull request Mar 27, 2020
Base automatically changed from master to main January 19, 2021 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants