Hi,
Our company is making use of unique limit ID’s for each test(step) output to the database.
This unique number is stored in the database together with the verdict, upper and lower limit, name, metadata and it’s found output value.
Since we want to move to OpenTAP I am investigating how this functionality can be implemented in OpenTAP. I found the Limits Mixin, which seems a nice implementation to deal with the limits, however it seems not possible to add a unique number to a certain output in a similar way.
In a ideal situation you can add a Upper and Lower Limit and the corresponding LimitID in an extra field, maybe also a name. If this is a seperate class, an additional check could be posssible to make sure your ID will be automatically generated to stay unique.
Is it possible to extend the current Limits Mixin of create a dedicated mixin with this fuctionality?
I prefer to make use of Python, is this possible?
Or are there better ideas to deal with this feature. All idea’s are welcome
Thanks in advance,
Evert
Hi @everthuijben,
It is an interesting idea. What could be an example of a LimitID? Wondering if it’s something you want the user to select.
In any case, you can build your own Limit Mixin. The Basic Mixins plugin is open source so you are free to copy the source and use it however you like. basic-mixins/OpenTap.BasicMixins at main · opentap/basic-mixins · GitHub.
In our current own build test sequencer (which we like to replace by OpenTAP), a LimitID is a unique number which belongs to a certain output value, inclusing it’s limits, name and the verdict. It must be entered by the sequence developer, but the editor gives the first available number and gives a warning when you try to use an existing number in order to make sure that the number stays unique.
Based on this LimitID we can easily search in the test database and it is used by our SPC tooling.
I assume that the default OpenTAP way of working is a unique test parameter name?
I was giving it a try to develop an own Python Mixin, but I did not succeed. I was not able to add an own developed mixin to the list of mixins in the UI of the editor. Is that possible? Or only with a .NET mixin plugin?
You can build a python mixin, but it’s not currently documented. I’ll add this to the documentation for the next release, but here it is for now:
import sys
import opentap
import clr
from opentap import *
from System import String, Object, Double, Func
from OpenTap import ITestStepPostRunMixin, IMixinBuilder, MixinBuilder, MixinMemberData, TypeData, EmbedPropertiesAttribute, ITestStep, Display, DisplayAttribute
class EmbeddingObject(ITestStepPostRunMixin):
Frequency = property(Double, 1.0).add_attribute(Display("Frequency", "The selected frequency."))
Amplitude = property(Double, 1.0).add_attribute(Display("Amplitude", "The selected frequency."))
def OnPostRun(self, args):
print("On post run executed")
@attribute(MixinBuilder(ITestStep))
@attribute(Display("Example Mixin Builder"))
class MixinExampleBuilder(IMixinBuilder):
def Initialize(self, type):
pass
def ToDynamicMember(self, targetType):
mixin = MixinMemberData(self, Func[Object](lambda: EmbeddingObject()))
mixin.Name = "MixinExample:Mixin"
mixin.TypeDescriptor = TypeData.FromType(EmbeddingObject)
mixin.Attributes = Array[Object]([EmbedPropertiesAttribute(),
DisplayAttribute("Mixin Example")])
mixin.DeclaringType = TypeData.FromType(ITestStep)
return mixin
Heres a screenshot from my editor:
Hi Rolf,
Thank you for these examples,
I will play around with it, and let you know if I have some additional questions,
Regards, Evert
