2021-03-09 18:56:50 +01:00
2021-03-09 18:56:50 +01:00
2021-03-09 18:54:48 +01:00

Morbidissimo -- A very soft IOC.

Consists of two parts:

ModuleManager

A manager/runner of scripts:

  • Checks a folder (e.g., ./scripts/) for files *.py.
  • If file contains a function run(), this is imported and executed.
  • At a fixed interval, the function is run again (if the last call has finished). If it is still running, it will not be started a second time (i.e., continuous scripts also work).
  • If a file's mtime changes, its potentially running function will be killed, the script reloaded and executed again.

MorIOC

A trivially easy to use softIOC:

  • Uses pcaspy (in a slightly unintended way).
  • serve (output) PVs and host (input) PVs:
with MorIOC("mtest") as mor:
    while True:
        # serve MTEST:RAND1 and MTEST:RAND2
        # holding a random float and a random int
        mor.serve(
            rand1 = random(),
            rand2 = randint(10, 100)
        )

        # host MTEST:BUCKET
        # can be filled from external via caput
        # get current value
        # serve MTEST:DOUBLED holding the doubled value
        mor.host(bucket = int)
        value = mor.get("bucket")
        mor.serve(doubled = value * 2)

        sleep(0.5)
  • PV's data type is inferred from the value
  • Currently only supports scalar. Will add numpy arrays next...
Description
A very soft IOC.
Readme 86 KiB
Languages
Python 100%