Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
1 result

Target

Select target project
  • dnn/dtdaq
1 result
Select Git revision
  • master
1 result
Show changes

Commits on Source 2

from .dtdaq import DTDaq
from .dtdaq import DTDaq, DTDaqError, errno
......@@ -6,7 +6,7 @@ import time
import click
import colorama
from .dtdaq import DTDaq
from . import dtdaq
@click.command()
......@@ -18,8 +18,13 @@ from .dtdaq import DTDaq
def main(device, fsampl, channel, gain, filename):
colorama.init()
daq = DTDaq(device.encode('ascii'))
try:
daq = dtdaq.DTDaq(device.encode('ascii'))
print(f'{daq.name} {daq.version} 0x{daq.hwinfo.serial:X}')
except dtdaq.DTDaqError as exc:
if exc.errno == dtdaq.errno.OLCANNOTOPENDRIVER:
return click.echo(f'Error: {exc.message}. Device "{device}" not found.', err=True)
raise
if len(gain) == 1:
gain = list(gain) * len(channel)
......
This diff is collapsed.
import click
from .dtdaq import enum_boards
from . import dtdaq
@click.command()
def main():
for board in enum_boards():
try:
for board in dtdaq.enumerate_devices():
print(board.name)
except dtdaq.DTDaqError as exc:
if exc.errno == dtdaq.errno.OLNOBOARDSINSTALLED:
return print(f'{exc.message}.')
raise
if __name__ == '__main__':
......