public void setHighLowVolume(double low, double high) { GraphView.Line l; l = new GraphView.Line(low, Color.FromArgb(255, 192, 127), true); verteilung.setVertLine("low", l); lautstaerken.setHorizLine("low", l); l = new GraphView.Line(high, Color.FromArgb(64, 255, 255), true); verteilung.setVertLine("high", l); lautstaerken.setHorizLine("high", l); }
public void setStartStopTime(double start, double dauer) { double stop = Math.Min(1, start + dauer); GraphView.Line tmp = new GraphView.Line(start, Color.FromArgb(128, 255, 192, 128), stop, true); lautstaerken.setVertLine("block", tmp); beschleunigung.setVertLine("block", tmp); /*tmp = new GraphView.Line(stop, Color.FromArgb(255, 255, 255),true); * lautstaerken.setVertLine("stop", tmp); * beschleunigung.setVertLine("stop", tmp);*/ }
public void setVolumes(List <double> vol) { lautstaerken.setValues(vol); int werte = 10000; distribution = new List <double>(werte); for (int i = 0; i < werte; i++) { distribution.Add(0); } int index; int max = 0; for (int i = 0; i < vol.Count; i++) { index = (int)Math.Abs(vol[i] * (werte)); if (index < 0) { index = 0; } if (index >= (werte)) { } else { // System.Diagnostics.Trace.WriteLine(index); distribution[index]++; if (distribution[index] > max) { max = (int)distribution[index]; } Ew += index; } } Ew = Ew / (double)werte / (double)vol.Count; Console.WriteLine(distribution.Count); for (int i = 0; i < distribution.Count; i++) { empVar += distribution[i] * Math.Pow(((i / (double)werte) - Ew), 2); } empVar = (empVar / (vol.Count - 1)); Console.WriteLine("STDAbw: " + empVar + " EW: " + Ew); Parallel.For(0, distribution.Count, i => { distribution[i] /= max; }); /*for (int i = 0; i < quantity.Count ; i++) * { * System.Diagnostics.Trace.WriteLine(quantity[i]); * }*/ double sum = 0; GraphView.Line lein = null, EWLine = new GraphView.Line(Ew, Color.Red), stdAbwLine = new GraphView.Line(Ew - empVar, Color.White); for (int i = 0; i < werte; i++) { sum += distribution[i] * max / (double)vol.Count; if (sum > .5) { lein = new GraphView.Line(i / (double)werte, Color.Green); break; } } verteilung.setValues(distribution); // verteilung.setVertLine("50%", lein); //verteilung.setVertLine("EW", EWLine); //verteilung.setVertLine("stdabw", stdAbwLine); }