Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strategy for read-only register logging #31

Open
jonnew opened this issue Dec 31, 2023 · 1 comment
Open

Strategy for read-only register logging #31

jonnew opened this issue Dec 31, 2023 · 1 comment
Labels
question Further information is requested
Milestone

Comments

@jonnew
Copy link
Member

jonnew commented Dec 31, 2023

Some ONI device registers are used to inform the user about the state of the hardware, and are useful metadata. They should probably be log-able in some way. It would be nice if they could be exposed via Externalize Property in the workflow editor and saved in a text file, for instance. Here is an example of some read-only registers in ConfigureTest0 which targets the Test0 ONIX device (https://open-ephys.github.io/onix-docs/Hardware%20Guide/Datasheets/test-0.html).

        [XmlIgnore]
        [Category(ConfigurationCategory)]
        [Description("Indicates the number of 16-bit numbers, 0 to PayloadWords - 1, that follow Message in each frame.")]
        public uint DummyCount { get; private set; }

        [XmlIgnore]
        [Category(ConfigurationCategory)]
        [Description("Indicates the rate at which frames are produced. 0 indicates that the frame rate is unspecified (variable or upstream controlled).")]
        public uint FrameRateHz { get; private set; }

        public override IObservable<ContextTask> Process(IObservable<ContextTask> source)
        {
            var deviceName = DeviceName;
            var deviceAddress = DeviceAddress;
            return source.ConfigureDevice(context =>
            {
                var device = context.GetDevice(deviceAddress, Test0.ID);
                context.WriteRegister(deviceAddress, Test0.ENABLE, Enable ? 1u : 0);
                FrameRateHz = context.ReadRegister(deviceAddress, Test0.FRAMERATE);
                DummyCount = context.ReadRegister(deviceAddress, Test0.NUMTESTWORDS);

                var deviceInfo = new DeviceInfo(context, DeviceType, deviceAddress);
                var disposable = DeviceManager.RegisterDevice(deviceName, deviceInfo);
                return disposable;
            });
        }

However, in the workflow, their values appear as default initialized through the UI (0 in this case) and they are not exposable though the Expose Property functionality.

image

The first is fine because they are updated during the call to Process when the workflow is started and seems to be a necessary consequence of the new architecture. However, I think that we should be able to see them at runtime for logging. Maybe I'm missing an obvious way to do this e.g. by changing their accessibility level or via an attribute.

@jonnew jonnew added the question Further information is requested label Dec 31, 2023
@jonnew jonnew added this to the 0.3.0 milestone Aug 13, 2024
@jonnew
Copy link
Member Author

jonnew commented Aug 13, 2024

Revisiting this, I don't know why i would expect these properties to be available via the Externalize Property function. However, the point stands that it would be useful to be able log read-only hardware information in some way.

@jonnew jonnew modified the milestones: 0.3.0, 0.4.0 Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant