-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from AlexanderBraml/memristor_dev_fixes
Multiple Improvements to Control Lib
- Loading branch information
Showing
24 changed files
with
659 additions
and
574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import Any | ||
|
||
from py_instrument_control_lib.channels.ChannelEnums import ChannelIndex | ||
|
||
|
||
class FutureValue: | ||
|
||
def __init__(self, channel_idx: ChannelIndex, buffer_index: int): | ||
self.channel_index = channel_idx | ||
self.buffer_index = buffer_index | ||
|
||
def get(self, buffer: list) -> Any: | ||
channel_buffer = buffer[self.channel_index.get() - 1] | ||
if not channel_buffer or len(channel_buffer) <= self.buffer_index: | ||
raise ValueError('Buffer is not filled appropriately.') | ||
return channel_buffer[self.buffer_index] | ||
|
||
def __repr__(self) -> str: | ||
return f'FutureValue @ {self.buffer_index} @ C{self.channel_index.get()}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.