private void InitDeviceOffsetsDict(DeviceDefSchema deviceDefSchema)
 {
     _deviceOffsetsDic = new Dictionary <DeviceDef, IEnumerator <int> >();
     foreach (var deviceDef in deviceDefSchema.DeviceDefCollection)
     {
         var offsets = OffsetProvider.GetOffsets(deviceDef);
         _deviceOffsetsDic.Add(deviceDef, offsets.GetEnumerator());
     }
 }
        public IEnumerable <DeviceGroupConfig> Convert(DeviceDefSchema deviceDefSchema)
        {
            //init offsets
            OffsetProvider.Init(deviceDefSchema);

            InitDeviceOffsetsDict(deviceDefSchema);

            InitDeviceDefsDict(deviceDefSchema);

            if (deviceDefSchema.GenerationCount == 0)
            {
                var top = GetDeviceGroupConfig(deviceDefSchema, null);
                yield return(top);
            }
            else
            {
                for (int i = 0; i < deviceDefSchema.GenerationCount; i++)
                {
                    var top = GetDeviceGroupConfig(deviceDefSchema, i);

                    yield return(top);
                }
            }
        }