Ejemplo n.º 1
0
 public void Clear()
 {
     Heartbeat      = null;
     Info           = null;
     Options        = null;
     SlotCollection = null;
     SlotOptionsCollection.Clear();
     UnitCollection = null;
     SetupLogAssetsForLogRestart();
 }
Ejemplo n.º 2
0
 private async Task UpdateSlotCollectionFromMessage(FahClientMessage message)
 {
     SlotCollection = SlotCollection.Load(message.MessageText);
     SlotOptionsCollection.Clear();
     foreach (var slot in SlotCollection)
     {
         var slotOptionsCommandText = String.Format(CultureInfo.InvariantCulture, DefaultSlotOptions, slot.ID);
         // not an expected situation at application runtime but when running some
         // tests the Connection will be null and that's fine in those scenarios
         var connection = _client.Connection;
         if (connection != null)
         {
             await connection.CreateCommand(slotOptionsCommandText).ExecuteAsync().ConfigureAwait(false);
         }
     }
 }
Ejemplo n.º 3
0
        private bool UpdateSlotOptionsCollectionFromMessage(FahClientMessage message)
        {
            SlotOptionsCollection.Add(SlotOptions.Load(message.MessageText));
            if (SlotCollection != null && SlotCollection.Count == SlotOptionsCollection.Count)
            {
                foreach (var slotOptions in SlotOptionsCollection)
                {
                    if (Int32.TryParse(slotOptions[Options.MachineID], out var machineID))
                    {
                        var slot = SlotCollection.First(x => x.ID == machineID);
                        slot.SlotOptions = slotOptions;
                    }
                }

                return(true);
            }

            return(false);
        }