public virtual void ReadChildData(BinaryReader reader) { int x = 0; for (x = 0; (x < _data.Count); x = (x + 1)) { Data.Add(new ByteBlockBlock()); Data[x].Read(reader); } for (x = 0; (x < _data.Count); x = (x + 1)) { Data[x].ReadChildData(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2.Add(new ByteBlockBlock()); Data2[x].Read(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2[x].ReadChildData(reader); } _effectName.ReadString(reader); for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3.Add(new ByteBlockBlock()); Data3[x].Read(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3[x].ReadChildData(reader); } }
private async void ContinousAdding() { for (int i = 0; i < 10; i++) { await Task.Delay(1000); Data2.Add(i); } }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; for (x = 0; (x < _data.Count); x = (x + 1)) { Data.Add(new ByteBlockBlock()); Data[x].Read(reader); } for (x = 0; (x < _data.Count); x = (x + 1)) { Data[x].ReadChildData(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2.Add(new ByteBlockBlock()); Data2[x].Read(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2[x].ReadChildData(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3.Add(new ByteBlockBlock()); Data3[x].Read(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3[x].ReadChildData(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4.Add(new ByteBlockBlock()); Data4[x].Read(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4[x].ReadChildData(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5.Add(new ByteBlockBlock()); Data5[x].Read(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5[x].ReadChildData(reader); } }
public SpeedItem() { bg = new SolidBrush(Color.White); bgf = new SolidBrush(Color.White); fo = new SolidBrush(Color.Blue); pfo = new Pen(Color.Blue); pfod = new Pen(Color.Blue); pfod.DashStyle = DashStyle.Dash; Height = 50; for (int i = 0; i < 60; i++) { Data2.Add(0); Data.Add(0); } }
public SpeedItem(string text, Color cbg, Color cforground) { bg = new SolidBrush(cbg); bgf = new SolidBrush(Color.FromArgb(180, cbg)); fo = new SolidBrush(cforground); pfo = new Pen(cforground); pfod = new Pen(cforground); pfod.DashStyle = DashStyle.Dash; Text = text; Height = 50; for (int i = 0; i < 60; i++) { Data2.Add(0); Data.Add(0); } }
public PerformanceListItem() { dataIem2 = new List <int>(); dataIem = new List <int>(); for (int i = 0; i < 30; i++) { Data.Add(0); } for (int i = 0; i < 30; i++) { Data2.Add(0); } Gray = false; NoGridImage = Properties.Resources.pointCpu; DataGridCache = new Bitmap(60, 40, System.Drawing.Imaging.PixelFormat.Format24bppRgb); }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; _materialEffects.ReadString(reader); _bitmap.ReadString(reader); for (x = 0; (x < _data.Count); x = (x + 1)) { Data.Add(new ByteBlockBlock()); Data[x].Read(reader); } for (x = 0; (x < _data.Count); x = (x + 1)) { Data[x].ReadChildData(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2.Add(new ByteBlockBlock()); Data2[x].Read(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2[x].ReadChildData(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3.Add(new ByteBlockBlock()); Data3[x].Read(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3[x].ReadChildData(reader); } for (x = 0; (x < _cores.Count); x = (x + 1)) { Cores.Add(new LiquidCoreBlockBlock()); Cores[x].Read(reader); } for (x = 0; (x < _cores.Count); x = (x + 1)) { Cores[x].ReadChildData(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4.Add(new ByteBlockBlock()); Data4[x].Read(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4[x].ReadChildData(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5.Add(new ByteBlockBlock()); Data5[x].Read(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5[x].ReadChildData(reader); } }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; _bitmap.ReadString(reader); for (x = 0; (x < _data.Count); x = (x + 1)) { Data.Add(new ByteBlockBlock()); Data[x].Read(reader); } for (x = 0; (x < _data.Count); x = (x + 1)) { Data[x].ReadChildData(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2.Add(new ByteBlockBlock()); Data2[x].Read(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2[x].ReadChildData(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3.Add(new ByteBlockBlock()); Data3[x].Read(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3[x].ReadChildData(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4.Add(new ByteBlockBlock()); Data4[x].Read(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4[x].ReadChildData(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5.Add(new ByteBlockBlock()); Data5[x].Read(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5[x].ReadChildData(reader); } for (x = 0; (x < _aspect.Count); x = (x + 1)) { Aspect.Add(new LightVolumeAspectBlockBlock()); Aspect[x].Read(reader); } for (x = 0; (x < _aspect.Count); x = (x + 1)) { Aspect[x].ReadChildData(reader); } for (x = 0; (x < _emptyname.Count); x = (x + 1)) { Emptyname.Add(new LightVolumeRuntimeOffsetBlockBlock()); Emptyname[x].Read(reader); } for (x = 0; (x < _emptyname.Count); x = (x + 1)) { Emptyname[x].ReadChildData(reader); } }
private void Button_Click(object sender, RoutedEventArgs e) { //Расстановка исходных точек Data2.Clear(); foreach (Axes a in Data1) { Data2.Add(new KeyValuePair <double, double>(a.XValue, a.YValue)); } lineSeries1.DataContext = Data2; //Линейная функция var solver = SolverContext.GetContext(); solver.ClearModel(); var model = solver.CreateModel(); Decision a0 = new Decision(Domain.Real, "a0"); Decision a1 = new Decision(Domain.Real, "a1"); model.AddDecision(a0); model.AddDecision(a1); Term generalError = 0; //функция которую минимизируем foreach (Axes a in Data1) { Term error = Model.Power(a0 + a1 * a.XValue - a.YValue, 2); generalError += error; } model.AddGoal("ComplicatedGoal", GoalKind.Minimize, generalError); var solution = solver.Solve(); var solutions = solution.Decisions.ToList(); var linearB = Math.Round(solutions[0].ToDouble(), 3); var linearA = Math.Round(solutions[1].ToDouble(), 3); solver.ClearModel(); //Квадратичная функция var model2 = solver.CreateModel(); Decision b0 = new Decision(Domain.Real, "b0"); Decision b1 = new Decision(Domain.Real, "b1"); Decision b2 = new Decision(Domain.Real, "b2"); model2.AddDecision(b0); model2.AddDecision(b1); model2.AddDecision(b2); generalError = 0; //функция которую минимизируем foreach (Axes a in Data1) { Term error = Model.Power(b0 + b1 * a.XValue + b2 * a.XValue * a.XValue - a.YValue, 2); generalError += error; } model2.AddGoal("ComplicatedGoal", GoalKind.Minimize, generalError); solution = solver.Solve(); solutions = solution.Decisions.ToList(); var squaredC = Math.Round(solutions[0].ToDouble(), 3); var squaredB = Math.Round(solutions[1].ToDouble(), 3); var squaredA = Math.Round(solutions[2].ToDouble(), 3); textBlock1.Text = "Коэффициенты полинома 1й степени"; textBlock2.Text = $"a = {linearA} "; textBlock3.Text = $"b = {linearB}"; textBlock4.Text = "Коэффициенты полинома 2й степени"; textBlock5.Text = $"a = {squaredA}"; textBlock6.Text = $"b = {squaredB}"; textBlock7.Text = $"c = {squaredC}"; // Отрисовка полиномов double minX = Data1[0].XValue; double maxX = Data1[0].XValue; foreach (Axes a in Data1) { if (a.XValue < minX) { minX = a.XValue; } if (a.XValue > maxX) { maxX = a.XValue; } } Data3.Clear(); for (double i = minX - 2; i <= maxX + 2; i += 0.1) { Data3.Add(new KeyValuePair <double, double>(i, linearA * i + linearB)); } lineSeries2.DataContext = Data3; Data4.Clear(); for (double i = minX - 2; i <= maxX + 2; i += 0.1) { Data4.Add(new KeyValuePair <double, double>(i, squaredA * i * i + squaredB * i + squaredC)); } lineSeries3.DataContext = Data4; }
// item 被 drop 到了 gridView2 private void gridView2_Drop(object sender, DragEventArgs e) { Data2.Add(_draggingEmployee); }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; _particlePhysics.ReadString(reader); for (x = 0; (x < _data.Count); x = (x + 1)) { Data.Add(new ByteBlockBlock()); Data[x].Read(reader); } for (x = 0; (x < _data.Count); x = (x + 1)) { Data[x].ReadChildData(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2.Add(new ByteBlockBlock()); Data2[x].Read(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2[x].ReadChildData(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3.Add(new ByteBlockBlock()); Data3[x].Read(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3[x].ReadChildData(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4.Add(new ByteBlockBlock()); Data4[x].Read(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4[x].ReadChildData(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5.Add(new ByteBlockBlock()); Data5[x].Read(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5[x].ReadChildData(reader); } for (x = 0; (x < _data6.Count); x = (x + 1)) { Data6.Add(new ByteBlockBlock()); Data6[x].Read(reader); } for (x = 0; (x < _data6.Count); x = (x + 1)) { Data6[x].ReadChildData(reader); } for (x = 0; (x < _data7.Count); x = (x + 1)) { Data7.Add(new ByteBlockBlock()); Data7[x].Read(reader); } for (x = 0; (x < _data7.Count); x = (x + 1)) { Data7[x].ReadChildData(reader); } for (x = 0; (x < _data8.Count); x = (x + 1)) { Data8.Add(new ByteBlockBlock()); Data8[x].Read(reader); } for (x = 0; (x < _data8.Count); x = (x + 1)) { Data8[x].ReadChildData(reader); } for (x = 0; (x < _data9.Count); x = (x + 1)) { Data9.Add(new ByteBlockBlock()); Data9[x].Read(reader); } for (x = 0; (x < _data9.Count); x = (x + 1)) { Data9[x].ReadChildData(reader); } }