Programming sugestion new Sensor Property: isDetecting

Christopher Groschupff shared this feedback 5 years ago
Submitted

It is not possible to extract wheter a sensor is detecting something right now easily.

void DetectedEntities(List<MyDetectedEntityInfo> entities); might get close, but is a huge waste. I need to create a list, hand it to that function, have it build - and then all I actually do with it is check entities.Count > 0;

I can also get close by having it toggle a lights , then check the status of the light. But that would require 1-2 timers for multicasting or a Polling approach. And would add a light to the whole drawing part.

Replies (1)

photo
1

Why not have the sensor trigger the PB with an argument for each state? :P


But I agree it needs a simple property for that :]

photo
2

Why not Arguments? Well, primarily because I had no idea that was a "thing" now. That is a very interesting vector.


But it is also somewhat unsuiteable for my application. I am talking about a buchn of sensors (at least 1 per direction), each of them could be in any detection state, and one script would have to process them all.


Once either of them starts it, a timer* will keep the script running. Until the script itself decides to stop said timer.


Edit: *Or the updateFrequency of wich I just learned.

photo
Leave a Comment
 
Attach a file