Exemple #1
0
 public PresentValue GetPresentValue(System.Collections.Generic.List <ValueMessage> values, System.Collections.Generic.IDictionary <string, System.Collections.Generic.IDictionary <int, OutletMapping> > outletIdMapper, System.Collections.Generic.IDictionary <string, System.Collections.Generic.IDictionary <int, BankMapping> > bankIdMapper, System.Collections.Generic.IDictionary <string, System.Collections.Generic.IDictionary <int, SensorMapping> > sensorIdMapper, System.Collections.Generic.IDictionary <string, System.Collections.Generic.IDictionary <int, LineMapping> > lineIdMapper)
 {
     if (values == null || values.Count < 1)
     {
         return(new PresentValue());
     }
     if (this.presentValue == null)
     {
         this.presentValue = new PresentValue();
     }
     foreach (ValueMessage current in values)
     {
         try
         {
             this.setDeviceTable(current.CreateTime, current.DeviceValue, current.DeviceID);
             this.setSensorTable(current.CreateTime, current.SensorValue, current.DeviceID, current.SensorNums, current.DeviceMac, sensorIdMapper);
             this.setOutletTable(current.CreateTime, current.OutletValue, current.DeviceID, current.PortNums, current.DeviceMac, outletIdMapper);
             this.setBankTable(current.CreateTime, current.BankValue, current.DeviceID, current.BankNums, current.DeviceMac, bankIdMapper);
             this.setLineTable(current.CreateTime, current.LineValue, current.DeviceID, current.LineNums, current.DeviceMac, lineIdMapper);
         }
         catch (System.Exception ex)
         {
             DebugCenter.GetInstance().appendToFile("Skip device: " + current.DeviceMac + ", " + ex.Message);
         }
     }
     return(this.presentValue);
 }
Exemple #2
0
 public ValueParser(PresentValue presentValue)
 {
     this.presentValue = presentValue;
 }