public ISTWiderstand Spitzenwert(SOLLWiderstand soll)
        {
            var ist = Berechne(soll);

            ist.Spitzenwert = new double[] { ist.UV, ist.UW, ist.VW }.Max();
            return(ist);
        }
        private void ListBoxSOLL_SelectedIndexChanged(object sender, EventArgs e)
        {
            SOLLWiderstand aktuellerWiderstand = listBoxSOLL.SelectedItem as SOLLWiderstand;

            labelUV.Text = aktuellerWiderstand.UV.ToString();
            labelUW.Text = aktuellerWiderstand.UW.ToString();
            labelVW.Text = aktuellerWiderstand.VW.ToString();

            labelMittelwert.Text = ((aktuellerWiderstand.UV + aktuellerWiderstand.UW + aktuellerWiderstand.VW) / 3).ToString();
        }
        public ISTWiderstand Berechne(SOLLWiderstand soll)
        {
            ISTWiderstand ist = new ISTWiderstand();

            ist.UV = soll.UV * 1.2;
            ist.VW = soll.VW * 0.8;
            ist.UW = soll.UW * 1.111;

            ist.Mittelwert = (ist.UV + ist.VW + ist.UW) / 3;
            return(ist);
        }
        private void GenerateTestData(IRepository repository)
        {
            Random r = new Random();

            for (int i = 0; i < 10; i++)
            {
                SOLLWiderstand soll = new SOLLWiderstand();
                soll.UV = r.NextDouble();
                soll.UW = r.NextDouble();
                soll.VW = r.NextDouble();

                repository.Add(soll);
            }
            repository.Save();
        }