forked from toolsforexperiments/instrumentserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_proxy.py
More file actions
31 lines (22 loc) · 1.09 KB
/
test_proxy.py
File metadata and controls
31 lines (22 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 22:12:05 2020
@author: Chao
"""
from instrumentserver.client.proxy import create_instrument
test_src = create_instrument(instrument_class = 'instrumentserver.testing.dummy_instruments.rf.Generator',
name = 'test_src')
dummy_vna = create_instrument(instrument_class = 'instrumentserver.testing.dummy_instruments.rf.ResonatorResponse',
name = 'dummy_vna')
print(dummy_vna.data.setpoints[0])
dummy_channels = create_instrument(instrument_class = 'instrumentserver.testing.dummy_instruments.rf.DummyInstrumentWithSubmodule',
name = 'dummy_channels')
dummy_channels.test_func(1,2,3,4,c=4,d=5)
def dummy_multiply(self,a,b):
return a*b*self.ch0()
dummy_channels.ChanA.add_function(dummy_multiply,override=1)
dummy_channels.ChanA.ch0(0.5)
dummy_channels.ChanA.dummy_multiply(1,2)
# -------------Error cases-------------------------------
# ProxyInstrument("instrument_that_doesn't_exit") # no instrument
# test_src.frequency(10) # invalid set value