Esempio n. 1
0
        public void Merge(kWhStorage storageToAppend)
        {
            var timestamp = storageToAppend.StartOfFile;

            while (storageToAppend.IsExistingSlot(timestamp))
            {
                Record record = storageToAppend.ReadSlot(timestamp);
                if (record.Raw != ulong.MaxValue)
                {
                    Record storedRecord = SetValue(timestamp, record.Raw, 1000, 21);
                    if (storedRecord == null)
                    {
                        throw new StorageWriteException($"Could not store record ${timestamp}:${record.Raw}");
                    }
                }
                timestamp = timestamp.AddMinutes(1);
            }
        }