Exemple #1
0
 private bool Exists(NodeStatus node)
 {
     foreach (NodeStatus n in nodes)
     {
         if (n.Serial.Equals(node.Serial))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #2
0
 private void Update(NodeStatus node)
 {
     foreach (NodeStatus n in nodes)
     {
         if (n.Serial.Equals(node.Serial))
         {
             n.Update(node);
             return;
         }
     }
 }
Exemple #3
0
        public void Update(NodeStatus node)
        {
            Battery      = node.Battery;
            DeltaBattery = Battery - InitialBattery;

            Rssi       = node.Rssi;
            Firmware   = node.Firmware;
            LastHealth = node.LastHealth;
            FixTime    = node.FixTime;

            SolarVoltage      = node.SolarVoltage;
            TotalSolarCurrent = node.TotalSolarCurrent;
            Temperature       = node.Temperature;

            Latitude  = node.Latitude;
            Longitude = node.Longitude;
        }
Exemple #4
0
        private void ParseNodeHealth(string data)
        {
            if (data.Contains("node_health") == false)
            {
                return;
            }

            NodeStatus node = new NodeStatus(JsonConvert.DeserializeObject(data));

            if (this.Exists(node))
            {
                this.Update(node);
            }
            else
            {
                this.Create(node);
            }
        }
Exemple #5
0
 private void Create(NodeStatus node)
 {
     nodes.Add(node);
 }