public OnlineEnergyFileRow([NotNull] OnlineEnergyFileRow other)
        {
            Timestep = other.Timestep;
            var otherEntries = new List <double>(other._energyEntries);

            _energyEntries = otherEntries;
            _loadType      = other.LoadType;
            _sum           = null;
        }
 public void AddValues([NotNull] OnlineEnergyFileRow efr)
 {
     _sum = null;
     if (efr._energyEntries.Count != _energyEntries.Count)
     {
         throw new LPGException("Row lengths are inconsistent");
     }
     for (var i = 0; i < _energyEntries.Count; i++)
     {
         _energyEntries[i] += efr._energyEntries[i];
     }
 }
        public static OnlineEnergyFileRow Read([NotNull] BinaryReader br, [NotNull] CalcLoadTypeDto lt,
                                               [NotNull] CalcParameters parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            var timestep = new TimeStep(br.ReadInt32(), parameters);
            var length   = br.ReadInt32();
            var valuearr = new List <double>(new double[length]);

            for (var i = 0; i < length; i++)
            {
                valuearr[i] = br.ReadDouble();
            }
            var efr = new OnlineEnergyFileRow(timestep, valuearr, lt);

            return(efr);
        }