Skip to content

Commit

Permalink
Merge branch 'master' into addcodespacesdemo
Browse files Browse the repository at this point in the history
  • Loading branch information
wduckitt committed Feb 13, 2024
2 parents 3208e36 + b61c3a5 commit c6c9bd9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pvServer/pvServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,11 @@ def check_pv_initialized_after_disconnect():
as_numpy=True, with_ctrlvars=True, use_monitor=True
)
else:
clientPVlist[pvname]["pv"].get(as_string=True)
clientPVlist[pvname]["pv"].get(
as_string=True, as_numpy=False
)
d = clientPVlist[pvname]["pv"].get_with_metadata(
with_ctrlvars=True, use_monitor=True
with_ctrlvars=True, use_monitor=True, as_numpy=False
)
if (clientPVlist[pvname]["pv"].value) is not None:
if d is not None:
Expand All @@ -318,7 +320,10 @@ def check_pv_initialized_after_disconnect():
].tobytes() # convert numpy array to binary
else:
if clientPVlist[pvname]["pv"].count > 1:
d["value"] = list(d["value"])
if isinstance(d["value"], np.ndarray):
d["value"] = d["value"].tolist()
else:
d["value"] = list(d["value"])
if clientPVlist[pvname]["pv"].count == 0:
d["value"] = []
if clientPVlist[pvname]["pv"].count == 1:
Expand Down Expand Up @@ -507,6 +512,7 @@ def on_change_value(
room=str(pvname),
namespace="/pvServer",
)

elif float(count) == 1:
new_char_value = str(char_value)
if len(new_char_value) == 0:
Expand All @@ -530,6 +536,8 @@ def on_change_value(
new_char_value = str(char_value)
if len(new_char_value) == 0:
new_char_value = str(value)
if isinstance(value, np.ndarray):
value = value.tolist()
d = {
"pvname": pvname,
"newmetadata": "False",
Expand Down

0 comments on commit c6c9bd9

Please sign in to comment.