public void SetValue([NotNull] string name, double value, [NotNull] TimeStep timestep, [NotNull] HouseholdKey householdKey,
                             [NotNull] CalcLoadTypeDto loadType)
        {
            if (timestep != _currentTimeStep)
            {
                if (_currentEntry != null)
                {
                    WriteEntry(_currentEntry, householdKey);
                }

                _currentEntry    = new EnergyStorageEntry(timestep, this, _calcParameters.CSVCharacter, _dsc);
                _currentTimeStep = timestep;
            }

            if (_currentEntry == null)
            {
                throw new LPGException("Currententry was null");
            }

            _currentEntry.AddValue(name, value * loadType.ConversionFactor);
        }
        private void WriteEntry([NotNull] EnergyStorageEntry e, [NotNull] HouseholdKey householdKey)
        {
            if (_writeHeader)
            {
                _energyStoragesSw = _fft.MakeFile <StreamWriter>("EnergyStorages.csv", "Energy storage values", true,
                                                                 ResultFileID.EnergyStorages, householdKey, TargetDirectory.Results,
                                                                 _calcParameters.InternalStepsize, CalcOption.EnergyStorageFile);
                _energyStoragesSw.Write(_dsc.GenerateDateStampHeader());
                _energyStoragesSw.WriteLine(GetHeader());
                _writeHeader = false;
            }

            if (!e.Timestep.DisplayThisStep)
            {
                return;
            }

            if (_energyStoragesSw == null)
            {
                throw new LPGException("energystoragesw was null");
            }

            _energyStoragesSw.WriteLine(e.ToString());
        }