Meta Point Event Detector Usage
-
I created a alphanumeric-data type script to evaluate an operating condition - which works. The problem is triggering the Event Detector. I'm using State Detector but I can't tell what causes it to fire. It seems that the field State should match (character string) one of the meta point script returns (i.e. "Fan Off). I couldn't find a reference to State Detector setup.
-
You intuition is correct, are you experiencing a problem with getting it to work? Can you make your Meta point settable for the sake of testing your detectors?
I consulted the code for AlphanumericStateDetectorRT:
protected boolean stateDetected(PointValueTime newValue) { String newAlpha = newValue.getStringValue(); return StringUtils.equals(newAlpha, vo.getAlphanumericState()); }
-
No sooner did I post this question than I got it too work. Very nice.
Got another question: Is it possible to insert variables into the string? Something like "Got a problem with sensor - value is $sensorvariablename".
BTW - who wrote all this code?
-
Also, is time available as a variable? Or do I have to create it? The concept is to check for Time >= ATimeValue.
-
By "the string" do you mean the Alias? No, it is not possible. Using state detectors, it doesn't make sense to me to have to do that. Point event detectors are on a per-point basis already, so the data point that it applies to is known. Similarly, for a State detector (but not a regex state detector) the state is unchanging. So, I don't know why you would want to do that. It does make some sense for a Regex state detector, though, but isn't possible at the moment.
Mango has existed for quite a while, so there have been a few contributors. Of absolute noteworthiness are Matthew Lohbiler, who wrote Mango M2M, and Terry Packer, who is our senior developer. But, if you peruse our opensource Github repositories you may find others, such as myself, who have made contributions. A great many of the modules are written by contributors. Most classes do have an author documented at the top, but this is not always updated to reflect everyone who touched a class.