Closed luiscruz closed 7 years ago
The second trigger condition can be set to any trigger channel with the setStartTrigger(), setStopTrigger, and setTriggerChannel commands. I.e. adding
engine.setStartTrigger(sampleEngine.triggers.GREATER_THAN,0)
engine.setStopTrigger(sampleEngine.triggers.GREATER_THAN,100)
engine.setTriggerChannel(sampleEngine.channels.timeStamp)
to your main function will tell it to collect 100s worth of samples. This also gives the flexibility to start collecting samples when, for example, current on the main channel exceeds 100 mA, and stop sampling when current drops below 10 mA.
I agree the default behavior should not be to stop at 10s worth of samples. The simpleSamplingExample file has also not been updated to show this, which will certainly be frustrating.
It seems to be a great feature.
I think it is somehow conflicting with a feature implemented with the method startSampling
in which you can define the number of samples. Perhaps startSampling
should use the same triggering mechanism.
SAMPLECOUNT_INFINITE
. Is there something similar for these triggers?I just pushed an update that should fix this.
Stop triggers now default to disabled, and can be set back to disabled by setting the stop trigger to SAMPLECOUNT_INFINITE as you've been doing.
Perfect! Fixed with 0f14c06
The maximum number of samples I can collect is 50000 (10s).
This is what I call:
The problem is in the stop condition of
sampleEngine
in the method__evalStopTrigger(self,measurement)
. It has a second condition based on triggers that is not being customized:After commenting the following lines, everything works fine:
Is this a feature or should I do a pull request removing those lines?