File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,6 +199,16 @@ func (p *Plugin) updateLastKnownDetectorStates(detectorMatrix []*dcspb.DetectorI
199199 if _ , ok := p .detectorMap [dcsDet ]; ! ok {
200200 p .detectorMap [dcsDet ] = detInfo
201201 } else {
202+ // If we're getting a PFR or SOR availability information within the State field of an incoming STATE_CHANGE_EVENT,
203+ // before processing it as any other state change, we need to update the availability fields
204+ if detInfo .State == dcspb .DetectorState_PFR_AVAILABLE || detInfo .State == dcspb .DetectorState_PFR_UNAVAILABLE {
205+ p .detectorMap [dcsDet ].PfrAvailability = detInfo .State
206+ }
207+ if detInfo .State == dcspb .DetectorState_SOR_AVAILABLE || detInfo .State == dcspb .DetectorState_SOR_UNAVAILABLE {
208+ p .detectorMap [dcsDet ].SorAvailability = detInfo .State
209+ }
210+
211+ // if we're getting a STATE_CHANGE event with any non-null state
202212 if detInfo .State != dcspb .DetectorState_NULL_STATE {
203213 p .detectorMap [dcsDet ].State = detInfo .State
204214 timestamp , err := time .Parse (DCS_TIME_FORMAT , detInfo .Timestamp )
You can’t perform that action at this time.
0 commit comments