I am currently attempting to extend the Scpi class to create a custom step that will return the query response as an output. Right now, I am just testing with returning a hard-coded value while maintaining the normal functionality of the original Scpi class. This is my code:
@attribute(OpenTap.Display("SCPI Query", "Returns SCPI response", "Custom"))
# This is the output property that will be used by other steps
ReturnValue = property(String,"Test")\
.add_attribute(Display("Return Value", "", "Output", 0))\
self.ReturnValue = self.ReturnValue + "10"
This is the log result:
How do I properly extend the Scpi class and use it in my Python plugin?
I am not completely sure what you are doing with
I think the class is called OpenTap.Plugins.BasicSteps.ScpiStep. So if you use that, I think your code should be valid.
It seems as though ScpiStep is not recognized either? I got rid of the ReturnValue just for clarity. The same error from above appears when I try this code.
@attribute(Display("Test", "Test", "A Test"))
Well, for ScpiStep to be available to the scope when defining your class, so you need to import OpenTap.Plugins.BasicSteps (for example by
from ... import ScpiStep.
And you might also need to add a reference to OpenTap.BasicSteps.dll by calling: