Skip to content

Replicating complexity in builder.py in ibek yaml #167

@gilesknap

Description

@gilesknap

There are some cases where the builder.py is doing things that we probably should replicate in ibek support YAML.

e.g. in the asyn module we have a tidy way of adding configuration items to the asyn object as follows:

    def Initialise(self):
        print('%sConfigure("%s", "%s", %d, %d, %d)' % (
            self.DbdFileList[0], self.asyn_name, self.port_name, self.priority,
            self.noAutoConnect, self.noProcessEos))
        for key, value in self.options.items():
            print('asynSetOption("%s", 0, "%s", "%s")' % (
                self.asyn_name, key, value))
        if self.input_eos is not None:
            print('asynOctetSetInputEos("%s", 0, %s)' % (
                self.asyn_name, quote_c_string(self.input_eos)))
        if self.output_eos is not None:
            print('asynOctetSetOutputEos("%s", 0, %s)' % (
                self.asyn_name, quote_c_string(self.output_eos)))

In particular the options dictionary is really useful here. Also inheritance allows for this pattern to be reused in a few Asyn classes.

At present I have this in YAML which is adequate for the simple streamdevice I have made so far but is pretty limited and the approach does not scale.

https://github.com/epics-containers/ibek-support/blob/14384f341a8000d31c3013ec3b5bd618aa0d17f2/asyn/asyn.ibek.support.yaml#L99C1-L112C93

@coretl @GDYendell do you think we should support dictionary arguments for this purpose?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions