void tracker_DetectionsReceived( object sender, SonitorEventArgs e ) { var msg = (DetectionsMessage)e.Message; DataReceived( this, new DataEventArgs( msg ) ); foreach ( var detection in msg.Detections ) { CheckDetectorChanges( detection ); CheckBatteryData( detection ); CheckTagButtonData( detection ); CheckTagMove( detection ); Detection( Detectors[ detection.HostName ], new DetectionEventArgs { Aplitude = detection.Amplitude, Confidence = detection.ConfidenceLevel, Detector = Detectors[ detection.HostName ], Tag = Tags[ detection.TagId ], TimeStamp = detection.DateTime } ); } }
void tracker_DetectorsReceived( object sender, SonitorEventArgs e ) { var msg = (DetectorsMessage)e.Message; DataReceived( this, new DataEventArgs( msg ) ); foreach ( var det in msg.Detectors ) { if ( !Detectors.ContainsKey( det.HostName ) ) { Detectors.Add( det.HostName, det ); DetectorAdded( this, new DetectorEventArgs( Detectors[ det.HostName ] ) ); } else { Detectors[ det.HostName ] = det; DetectorStateChanged( this, new DetectorEventArgs( Detectors[ det.HostName ] ) ); } } }
void tracker_DetectorStatusReceived( object sender, SonitorEventArgs e ) { var msg = (DetectorStatusMessage)e.Message; DataReceived( this, new DataEventArgs( msg ) ); foreach ( var state in msg.DetectorStates ) { Detectors[ state.HostName ].Channel = state.Channel; Detectors[ state.HostName ].Status = ( state.Online ? OperationStatus.Online : OperationStatus.Offline ); DetectorStateChanged( this, new DetectorEventArgs( Detectors[ state.HostName ] ) ); } }
void tracker_MapsReceived( object sender, SonitorEventArgs e ) { var msg = (MapsMessage)e.Message; DataReceived( this, new DataEventArgs( msg ) ); }
void tracker_ProtocolReceived( object sender, SonitorEventArgs e ) { var msg = (ProtocolVersionMessage)e.Message; DataReceived( this, new DataEventArgs( msg ) ); }
void tracker_TagsReceived( object sender, SonitorEventArgs e ) { var msg = (TagsMessage)e.Message; DataReceived( this, new DataEventArgs( msg ) ); foreach ( var tag in msg.Tags ) { if ( !Tags.ContainsKey( tag.Id ) ) { Tags.Add( tag.Id, tag ); TagAdded( null, new TagEventArgs( tag ) ); } else { Tags[ tag.Id ] = tag; TagStateChanged( null, new TagEventArgs( tag ) ); } } }