コード例 #1
0
ファイル: Decoder.cs プロジェクト: ashawnbandy/cecs491
 /// <summary>
 /// The hook for the event dispatcher.
 /// </summary>
 /// <param name="rte"></param>
 public override void onRealTimeEvent(RealTimeEvent rte)
 {
     if(rte.GetType() == typeof(UnparsedMessage))
     {
         UnparsedMessage unparsedMessage = (UnparsedMessage)rte;
         Decode(unparsedMessage);
     }
 }
コード例 #2
0
ファイル: RealTimeEvent.cs プロジェクト: ashawnbandy/cecs491
 public RealTimeEvent(string message, RealTimeEvent originatingEvent)
 {
     this.message = message;
     if (originatingEvent != null)
     {
         _thisDict = originatingEvent._thisDict;
     }
     else
     {
         _thisDict = new Dictionary<string, dynamic>();
     }
 }
コード例 #3
0
 public Decoded(Dictionary<String,String> decoded, RealTimeEvent originatingEvent, String undecoded, String messageType)
     : base("Decoded message type: " + messageType + " from raw message: " + undecoded, originatingEvent)
 {
     this["decodedmessage"] = decoded;
     this["messagetype"] = messageType;
 }
コード例 #4
0
ファイル: Dispatcher.cs プロジェクト: ashawnbandy/cecs491
 public int enqueueEvent(RealTimeEvent realTimeEvent)
 {
     realTimeEventQueue.Enqueue(realTimeEvent);
     return realTimeEventQueue.Count;
 }
コード例 #5
0
ファイル: Database.cs プロジェクト: ashawnbandy/cecs491
 /// <summary>
 /// The hook for the event dispatcher. Determines the type of message, and if applicable, makes a database insertion.
 /// </summary>
 /// <param name="realTimeEvent"></param>
 public override void onRealTimeEvent(RealTimeEvent realTimeEvent)
 {
     int response = 0;
     if (realTimeEvent.GetType() == typeof(Decoded))
     {
         Decoded rte = (Decoded)realTimeEvent;
         string eventType = rte["messagetype"];
         if (eventType == "detection_event")
             response = detectionInsert(rte);
         else if (eventType == "status_response")
             response = statusInsert(rte);
         if (response > 1)
             response = 1;
     }
     //return response;
 }
コード例 #6
0
 public DatabaseResponse(string sql, int response, RealTimeEvent originatingEvent)
     : base("SQL statement: " + sql, originatingEvent)
 {
     this.sql = sql;
     this.response = response;
 }
コード例 #7
0
ファイル: ConsoleLogger.cs プロジェクト: ashawnbandy/cecs491
 /// <summary>
 /// The event dispatcher's hook.
 /// </summary>
 /// <param name="rte">The real time event to be acted upon by this module.</param>
 public override void onRealTimeEvent(RealTimeEvent rte)
 {
     System.Console.WriteLine(rte);
 }
コード例 #8
0
ファイル: Module.cs プロジェクト: ashawnbandy/cecs491
 public virtual void onRealTimeEvent(RealTimeEvent realTimeEvent)
 {
 }