Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
string now
Browse files Browse the repository at this point in the history
  • Loading branch information
dstrande committed Dec 5, 2023
1 parent 1cf855e commit 595fa7b
Show file tree
Hide file tree
Showing 27 changed files with 95 additions and 95 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flojoy import flojoy, DataContainer, TextBlob, VisaConnection
from flojoy import flojoy, DataContainer, String, VisaConnection
from typing import Optional, Literal


Expand All @@ -7,7 +7,7 @@ def ALIGN_PHASES_AFG31000(
connection: VisaConnection,
channel: Literal["1", "2"] = "1",
input: Optional[DataContainer] = None,
) -> TextBlob:
) -> String:
"""Run this block to align the phases for ch1 and ch2.
This block should also work with compatible Tektronix AFG31XXX instruments.
Expand All @@ -21,12 +21,12 @@ def ALIGN_PHASES_AFG31000(
Returns
-------
TextBlob
Placeholder
String
Aligned channel phases
"""

afg = connection.get_handle()

afg.write(f"SOURCE{channel}:PHASE:INIT")

return TextBlob(text_blob="Aligned channel phases")
return String(s="Aligned channel phases")
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "The IP or VISA address of the VISA device."
}
],
Expand Down Expand Up @@ -92,7 +92,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -196,7 +196,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -277,7 +277,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Save state"
}
],
Expand Down Expand Up @@ -419,7 +419,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -561,7 +561,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"returns": [
{
"name": null,
"type": "TextBlob",
"type": "String",
"description": "Placeholder"
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flojoy import flojoy, OrderedPair, TextBlob, VisaConnection, Vector
from flojoy import flojoy, OrderedPair, String, VisaConnection, Vector
from typing import Literal
from numpy import max, min

Expand All @@ -13,7 +13,7 @@ def ARBITRARY_AFG31000(
amplitude: float = 1,
offset: float = 0,
phase: float = 0,
) -> TextBlob:
) -> String:
"""Take the input waveform and use it as the arbitrary wavefunction.
This block should also work with compatible Tektronix AFG31XXX instruments.
Expand All @@ -37,8 +37,8 @@ def ARBITRARY_AFG31000(
Returns
-------
TextBlob
Placeholder
String
Set FG parameters
"""

assert -180.0 <= phase <= 180.0, "The phase must be between -180 and 180 degrees."
Expand All @@ -65,4 +65,4 @@ def ARBITRARY_AFG31000(
afg.write(f"SOURCE{source}:VOLTAGE:OFFSET {offset}")
afg.write(f"SOURCE{source}:PHASE:ADJUST {phase}DEG")

return TextBlob(text_blob="Set FG parameters")
return String(s="Set FG parameters")
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "The IP or VISA address of the VISA device."
}
],
Expand Down Expand Up @@ -141,7 +141,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -206,7 +206,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -607,7 +607,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"returns": [
{
"name": null,
"type": "TextBlob",
"type": "String",
"description": "Placeholder"
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flojoy import flojoy, DataContainer, TextBlob, VisaConnection
from flojoy import flojoy, DataContainer, String, VisaConnection
from typing import Optional, Literal


Expand All @@ -11,7 +11,7 @@ def BASIC_PARAMETERS_AFG31000(
offset: float = 0,
phase: float = 0,
input: Optional[DataContainer] = None,
) -> TextBlob:
) -> String:
"""Set basic parameters such as frequency for a single channel.
This block should also work with compatible Tektronix AFG31XXX instruments.
Expand All @@ -33,7 +33,7 @@ def BASIC_PARAMETERS_AFG31000(
Returns
-------
TextBlob
String
Placeholder
"""

Expand All @@ -46,4 +46,4 @@ def BASIC_PARAMETERS_AFG31000(
afg.write(f"SOURCE{source}:VOLTAGE:OFFSET {offset}")
afg.write(f"SOURCE{source}:PHASE:ADJUST {phase}DEG")

return TextBlob(text_blob="Set FG parameters")
return String(s="Set FG parameters")
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "The IP or VISA address of the VISA device."
}
],
Expand Down Expand Up @@ -141,7 +141,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -206,7 +206,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -607,7 +607,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"returns": [
{
"name": null,
"type": "TextBlob",
"type": "String",
"description": "Placeholder"
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flojoy import VisaDevice, flojoy, TextBlob
from flojoy import VisaDevice, flojoy, String
from flojoy.connection_manager import DeviceConnectionManager
from pyvisa import ResourceManager
from usb.core import USBError
Expand All @@ -7,7 +7,7 @@
@flojoy
def CONNECT_AFG31000(
device: VisaDevice,
) -> TextBlob:
) -> String:
"""Connect Flojoy to a AFG31000 function generator.
The connection is made with the VISA address in the Flojoy UI.
Expand All @@ -21,7 +21,7 @@ def CONNECT_AFG31000(
Returns
-------
device_addr: TextBlob
device_addr: String
The IP or VISA address of the VISA device.
"""

Expand All @@ -39,4 +39,4 @@ def CONNECT_AFG31000(
afg.write_termination = "\n"
DeviceConnectionManager.register_connection(device, afg)

return TextBlob(text_blob=addr)
return String(s=addr)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "The IP or VISA address of the VISA device."
}
],
Expand Down Expand Up @@ -92,7 +92,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -196,7 +196,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -277,7 +277,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Save state"
}
],
Expand Down Expand Up @@ -419,7 +419,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down Expand Up @@ -561,7 +561,7 @@
{
"name": "default",
"id": "default",
"type": "TextBlob",
"type": "String",
"desc": "Placeholder"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"returns": [
{
"name": "device_addr",
"type": "TextBlob",
"type": "String",
"description": "The IP or VISA address of the VISA device."
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flojoy import flojoy, DataContainer, TextBlob, VisaConnection
from flojoy import flojoy, DataContainer, String, VisaConnection
from typing import Optional, Literal


Expand All @@ -7,7 +7,7 @@ def COPY_AFG31000(
connection: VisaConnection,
channel: Literal["ch1", "ch2"] = "ch1",
input: Optional[DataContainer] = None,
) -> TextBlob:
) -> String:
"""Copy the setup parameters to the other channel.
This block should also work with compatible Tektronix AFG31XXX instruments.
Expand All @@ -21,7 +21,7 @@ def COPY_AFG31000(
Returns
-------
TextBlob
String
Placeholder
"""

Expand All @@ -32,4 +32,4 @@ def COPY_AFG31000(
else:
afg.write("AFGControl:CSCopy CH2,CH1")

return TextBlob(text_blob="Copied channel parameters")
return String(s="Copied channel parameters")
Loading

0 comments on commit 595fa7b

Please sign in to comment.