示例#1
0
        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
                           } );
            }
        }
示例#2
0
        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 ] ) );
                }
            }
        }
示例#3
0
        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 ] ) );
            }
        }
示例#4
0
 void tracker_MapsReceived( object sender, SonitorEventArgs e )
 {
     var msg = (MapsMessage)e.Message;
     DataReceived( this, new DataEventArgs( msg ) );
 }
示例#5
0
 void tracker_ProtocolReceived( object sender, SonitorEventArgs e )
 {
     var msg = (ProtocolVersionMessage)e.Message;
     DataReceived( this, new DataEventArgs( msg ) );
 }
示例#6
0
 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 ) );
         }
     }
 }