Example #1
0
 public HitsDataEvent Save(ReadsDataEvent read, HitsDataEvent hit, string information)
 {
     if (this.DataFile.DataRepository is SystemRepository)
     {
         var start = DateTime.Now;
         hit.Information = information;
         this.Save(hit);
         //PIPS.Logger.WriteLine("HitsDataTable: new hit save = {0} ms", (DateTime.Now - start).TotalMilliseconds);
         // this read already exists so we need to resynce it with boss
         var indy = read.Hits.FindIndex(
             h => h.HotList == hit.HotList);
         if (indy != -1)
         {
             read.Hits[indy].Information = information;
         }
         read.SaveAndQueueForSync();
         return(hit);
     }
     return(null);
 }
Example #2
0
 public HitsDataEvent Save(long read_id, string hotlist, string information)
 {
     if (this.DataFile.DataRepository is SystemRepository)
     {
         var            start = DateTime.Now;
         ReadsDataEvent read  = (this.DataFile.DataRepository as SystemRepository).Events.Reads.SelectByID(read_id) as ReadsDataEvent;
         HitsDataEvent  hit   = this.CreateHitsDataEvent();
         hit.Alarm        = "MED";
         hit.DisplayColor = Color.Blue;
         hit.Field1       = hit.Field2 = hit.Field3 = hit.Field4 = hit.Field5 = string.Empty;
         hit.HotList      = hotlist;
         hit.IsCovert     = false;
         hit.PNCID        = string.Empty;
         hit.Priority     = 500;
         hit.ReadID       = read.ID;
         hit.VRM          = read.VRM;
         var result = Save(read, hit, information);
         //PIPS.Logger.WriteLine("HitsDataTable: new hit save = {0} ms", (DateTime.Now - start).TotalMilliseconds);
         return(result);
     }
     return(null);
 }
Example #3
0
        protected override void OnInserted(DataEvent ev)
        {
            HitsDataEvent hit = ev as HitsDataEvent;

            base.OnInserted(ev);
        }