Skip to content

Commit

Permalink
change code for sp2
Browse files Browse the repository at this point in the history
  • Loading branch information
changgonKim committed Apr 29, 2022
1 parent 40e1992 commit 2550774
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
53 changes: 53 additions & 0 deletions python/lvmieb/actor/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ def from_config(cls, config, *args, **kwargs):
# print(instance.controllers)
# instance.parser_args = [instance.controllers]

if "sp2" in instance.config["devices"]["motor_controllers"]:
controllers = (
IebController(
host=ctr["host"], port=ctr["port"], name=ctrname, spec="sp2"
)
for (ctrname, ctr) in instance.config["devices"]["motor_controllers"][
"sp2"
].items()
)
instance.controllers = {c.name: c for c in controllers}
# print(instance.controllers)
# instance.parser_args = [instance.controllers]

if "sp1" in instance.config["devices"]["modules"]["controllers"]:
controllers = (
IebController(
Expand All @@ -98,6 +111,19 @@ def from_config(cls, config, *args, **kwargs):
# print(instance.controllers)
# instance.parser_args = [instance.controllers]

if "sp2" in instance.config["devices"]["modules"]["controllers"]:
controllers = (
IebController(
host=ctr["address"], port=ctr["port"], name=ctrname, spec="sp2"
)
for (ctrname, ctr) in instance.config["devices"]["modules"][
"controllers"
]["sp2"].items()
)
instance.controllers.update({c.name: c for c in controllers})
# print(instance.controllers)
# instance.parser_args = [instance.controllers]

if "sp1" in instance.config["devices"]["depth"]:
controllers = (
IebController(
Expand All @@ -110,6 +136,18 @@ def from_config(cls, config, *args, **kwargs):
)
instance.controllers.update({c.name: c for c in controllers})

if "sp2" in instance.config["devices"]["depth"]:
controllers = (
IebController(
host=ctr["host"],
port=ctr["port"],
name=ctrname,
spec="sp2",
)
for (ctrname, ctr) in instance.config["devices"]["depth"].items()
)
instance.controllers.update({c.name: c for c in controllers})

if "sp1" in instance.config["devices"]["pressure"]:
controllers = (
IebController(
Expand All @@ -125,6 +163,21 @@ def from_config(cls, config, *args, **kwargs):
)
instance.controllers.update({c.name: c for c in controllers})

if "sp2" in instance.config["devices"]["pressure"]:
controllers = (
IebController(
host=ctr["host"],
port=ctr["port"],
pres_id=ctr["id"],
name=ctrname,
spec="sp2",
)
for (ctrname, ctr) in instance.config["devices"]["pressure"][
"sp2"
].items()
)
instance.controllers.update({c.name: c for c in controllers})

if "sensor" in instance.config["devices"]["lab"]:
controllers = (
IebController(
Expand Down
31 changes: 31 additions & 0 deletions python/lvmieb/etc/lvmieb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ devices:
hartmann_right:
host: 10.7.45.28
port: 7778
sp2:
shutter:
host: 10.7.45.27
port: 7776
hartmann_left:
host: 10.7.45.27
port: 7777
hartmann_right:
host: 10.7.45.27
port: 7778
pressure:
sp1:
r1:
Expand All @@ -31,11 +41,28 @@ devices:
host: 10.7.45.30
port: 1115
id: 253
sp2:
r1:
host: 10.7.45.33
port: 1112
id: 253
b1:
host: 10.7.45.33
port: 1114
id: 253
z1:
host: 10.7.45.33
port: 1115
id: 253
depth:
sp1:
host: 10.7.45.30
port: 1116
channel: null
sp2:
host: 10.7.45.30
port: 1116
channel: null
lab:
sensor:
host: 10.7.45.30
Expand All @@ -46,6 +73,10 @@ devices:
wago:
address: 10.7.45.28
port: 502
sp2:
wago:
address: 10.7.45.27
port: 502
modules:
ANALOG1:
model: 750-497
Expand Down

0 comments on commit 2550774

Please sign in to comment.