Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pycbsdk/cbhw/device/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self, params: Params):
), # Filled in upon receiving device config.
"proc_chans": 0,
"instrument": -1,
"b_gemini": False,
"channel_infos": {},
"group_infos": {},
"group_nchans": {},
Expand Down
1 change: 1 addition & 0 deletions src/pycbsdk/cbhw/device/nsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ def _handle_procinfo(self, pkt):
prot_str = f"{vmaj}.{vmin}"
logger.info(f"Protocol version {prot_str}")
self._config["proc_chans"] = pkt.chancount
self._config["b_gemini"] = hasattr(pkt, "ident") and "gemini" in pkt.ident.lower()
# config.protocol = prot_str # Too late; we already loaded our factory if we got this far.

def _handle_nplay(self, pkt):
Expand Down
8 changes: 1 addition & 7 deletions src/pycbsdk/examples/group_sample_intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,8 @@ def main(
for ch in range(1, nchans + 1):
_ = cbsdk.set_channel_config(nsp_obj, ch, "smpgroup", smpgroup)

# Calculate the clock step (I hate this)
if inst_addr and int(inst_addr.split(".")[-1]) in [200, 201, 202, 203, 203]:
# Note: This misses Gemini NSP!
t_step = 1 / 1e9
else:
t_step = 1 / config["sysfreq"]

# Create a dummy app.
t_step = 1 / (1e9 if config["b_gemini"] else config["sysfreq"])
app = DummyApp(nchans, duration=duration, t_step=t_step)

time.sleep(2.0)
Expand Down
8 changes: 1 addition & 7 deletions src/pycbsdk/examples/print_rates.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,8 @@ def main(
]
n_chans = sum(b_spk)

# Calculate the clock step (I hate this)
if inst_addr and int(inst_addr.split(".")[-1]) in [200, 201, 202, 203, 203]:
# Note: This misses Gemini NSP!
t_step = 1 / 1e9
else:
t_step = 1 / config["sysfreq"]

# Create the dummy app.
t_step = 1 / (1e9 if config["b_gemini"] else config["sysfreq"])
app = DummyApp(n_chans, history=update_interval, tstep=t_step)
# Register callbacks to update the app's state when appropriate packets are received.
_ = cbsdk.register_spk_callback(nsp_obj, app.update_state)
Expand Down
Loading